@mdn/yari
Advanced tools
Comparing version 2.60.0 to 2.60.1
{ | ||
".": "2.60.0" | ||
".": "2.60.1" | ||
} |
@@ -55,7 +55,12 @@ import path from "node:path"; | ||
if (last) { | ||
last.children.push(entry); | ||
if (!last.children) { | ||
last.children = [entry]; | ||
} | ||
else { | ||
last.children.push(entry); | ||
} | ||
return item; | ||
} | ||
} | ||
item.push({ children: [], ...entry }); | ||
item.push({ ...entry }); | ||
return item; | ||
@@ -75,5 +80,5 @@ }, []); | ||
const nextEntry = i < index.length - 1 ? index[i + 1] : undefined; | ||
prevEntry && "children" in prevEntry && delete prevEntry.children; | ||
nextEntry && "children" in nextEntry && delete nextEntry.children; | ||
return { prev: prevEntry, next: nextEntry }; | ||
const prev = prevEntry && { url: prevEntry.url, title: prevEntry.title }; | ||
const next = nextEntry && { url: nextEntry.url, title: nextEntry.title }; | ||
return { prev, next }; | ||
} | ||
@@ -133,6 +138,31 @@ async function buildPrevNextOverview(slug) { | ||
if (attributes.template === Template.Landing) { | ||
modules = (await buildCurriculumIndex())?.filter((x) => x.children?.length); | ||
modules = (await buildCurriculumIndex()) | ||
?.filter((x) => x.children?.length) | ||
.map(({ url, title, summary, topic, slug, children }) => ({ | ||
url, | ||
title, | ||
summary, | ||
topic, | ||
slug, | ||
children: children.length | ||
? children.map(({ url, title, summary, topic, slug }) => ({ | ||
url, | ||
title, | ||
summary, | ||
topic, | ||
slug, | ||
})) | ||
: undefined, | ||
})); | ||
} | ||
else if (attributes.template === Template.Overview) { | ||
modules = (await buildCurriculumIndex())?.find((x) => x.slug === slug)?.children; | ||
modules = (await buildCurriculumIndex()) | ||
?.find((x) => x.slug === slug) | ||
?.children.map(({ url, title, summary, topic, slug }) => ({ | ||
url, | ||
title, | ||
summary, | ||
topic, | ||
slug, | ||
})); | ||
} | ||
@@ -139,0 +169,0 @@ if (attributes.template === Template.Module) { |
@@ -102,3 +102,7 @@ import path from "node:path"; | ||
if (last) { | ||
last.children.push(entry); | ||
if (!last.children) { | ||
last.children = [entry]; | ||
} else { | ||
last.children.push(entry); | ||
} | ||
return item; | ||
@@ -108,3 +112,3 @@ } | ||
item.push({ children: [], ...entry }); | ||
item.push({ ...entry }); | ||
return item; | ||
@@ -132,6 +136,6 @@ }, []); | ||
prevEntry && "children" in prevEntry && delete prevEntry.children; | ||
nextEntry && "children" in nextEntry && delete nextEntry.children; | ||
const prev = prevEntry && { url: prevEntry.url, title: prevEntry.title }; | ||
const next = nextEntry && { url: nextEntry.url, title: nextEntry.title }; | ||
return { prev: prevEntry, next: nextEntry }; | ||
return { prev, next }; | ||
} | ||
@@ -211,9 +215,30 @@ | ||
if (attributes.template === Template.Landing) { | ||
modules = (await buildCurriculumIndex())?.filter( | ||
(x) => x.children?.length | ||
); | ||
modules = (await buildCurriculumIndex()) | ||
?.filter((x) => x.children?.length) | ||
.map(({ url, title, summary, topic, slug, children }) => ({ | ||
url, | ||
title, | ||
summary, | ||
topic, | ||
slug, | ||
children: children.length | ||
? children.map(({ url, title, summary, topic, slug }) => ({ | ||
url, | ||
title, | ||
summary, | ||
topic, | ||
slug, | ||
})) | ||
: undefined, | ||
})); | ||
} else if (attributes.template === Template.Overview) { | ||
modules = (await buildCurriculumIndex())?.find( | ||
(x) => x.slug === slug | ||
)?.children; | ||
modules = (await buildCurriculumIndex()) | ||
?.find((x) => x.slug === slug) | ||
?.children.map(({ url, title, summary, topic, slug }) => ({ | ||
url, | ||
title, | ||
summary, | ||
topic, | ||
slug, | ||
})); | ||
} | ||
@@ -220,0 +245,0 @@ if (attributes.template === Template.Module) { |
@@ -42,3 +42,4 @@ import fs from "node:fs"; | ||
if (root === CONTENT_ROOT) { | ||
if (process.env.GITHUB_REF) { | ||
if (process.env.GITHUB_REF && | ||
process.env.GITHUB_REPOSITORY !== "mdn/yari") { | ||
name = process.env.GITHUB_REF.split("/").slice(2).join("/"); | ||
@@ -420,3 +421,3 @@ } | ||
function addBaseline(doc) { | ||
if (doc.browserCompat) { | ||
if (doc.browserCompat && !doc.mdn_url?.includes("/docs/MDN/")) { | ||
const filteredBrowserCompat = doc.browserCompat.filter((query) => | ||
@@ -423,0 +424,0 @@ // temporary blocklist while we wait for per-key baseline statuses |
@@ -70,3 +70,6 @@ import fs from "node:fs"; | ||
if (root === CONTENT_ROOT) { | ||
if (process.env.GITHUB_REF) { | ||
if ( | ||
process.env.GITHUB_REF && | ||
process.env.GITHUB_REPOSITORY !== "mdn/yari" | ||
) { | ||
name = process.env.GITHUB_REF.split("/").slice(2).join("/"); | ||
@@ -552,3 +555,3 @@ } else { | ||
function addBaseline(doc: Partial<Doc>) { | ||
if (doc.browserCompat) { | ||
if (doc.browserCompat && !doc.mdn_url?.includes("/docs/MDN/")) { | ||
const filteredBrowserCompat = doc.browserCompat.filter( | ||
@@ -555,0 +558,0 @@ (query) => |
{ | ||
"files": { | ||
"main.css": "/static/css/main.5f709b42.css", | ||
"main.js": "/static/js/main.bf9c4f55.js", | ||
"main.css": "/static/css/main.eeb9c22e.css", | ||
"main.js": "/static/js/main.fe7f4288.js", | ||
"static/js/2.6f11d7af.chunk.js": "/static/js/2.6f11d7af.chunk.js", | ||
"static/css/5.19064a43.chunk.css": "/static/css/5.19064a43.chunk.css", | ||
"static/js/5.9a1f98e7.chunk.js": "/static/js/5.9a1f98e7.chunk.js", | ||
"static/js/5.29503e84.chunk.js": "/static/js/5.29503e84.chunk.js", | ||
"static/css/7.8dbf9ebe.chunk.css": "/static/css/7.8dbf9ebe.chunk.css", | ||
"static/js/7.962089af.chunk.js": "/static/js/7.962089af.chunk.js", | ||
"static/js/7.4f1a0c91.chunk.js": "/static/js/7.4f1a0c91.chunk.js", | ||
"static/css/9.1b353030.chunk.css": "/static/css/9.1b353030.chunk.css", | ||
"static/js/9.f3ca246a.chunk.js": "/static/js/9.f3ca246a.chunk.js", | ||
"static/js/9.00674f57.chunk.js": "/static/js/9.00674f57.chunk.js", | ||
"static/css/10.1904d8f2.chunk.css": "/static/css/10.1904d8f2.chunk.css", | ||
"static/js/10.da052fcd.chunk.js": "/static/js/10.da052fcd.chunk.js", | ||
"static/js/10.799e9a2d.chunk.js": "/static/js/10.799e9a2d.chunk.js", | ||
"static/css/11.706ddea0.chunk.css": "/static/css/11.706ddea0.chunk.css", | ||
"static/js/11.998030ea.chunk.js": "/static/js/11.998030ea.chunk.js", | ||
"static/js/11.18127906.chunk.js": "/static/js/11.18127906.chunk.js", | ||
"static/css/15.6d2a3650.chunk.css": "/static/css/15.6d2a3650.chunk.css", | ||
"static/js/15.04b6285b.chunk.js": "/static/js/15.04b6285b.chunk.js", | ||
"static/js/15.37b1f722.chunk.js": "/static/js/15.37b1f722.chunk.js", | ||
"static/css/6.3bbffd50.chunk.css": "/static/css/6.3bbffd50.chunk.css", | ||
"static/js/6.a3a5d8cb.chunk.js": "/static/js/6.a3a5d8cb.chunk.js", | ||
"static/js/6.910faa0d.chunk.js": "/static/js/6.910faa0d.chunk.js", | ||
"static/css/18.259a2a44.chunk.css": "/static/css/18.259a2a44.chunk.css", | ||
"static/js/18.6e369b1c.chunk.js": "/static/js/18.6e369b1c.chunk.js", | ||
"browser-compatibility-table.js": "/static/js/browser-compatibility-table.046f1b35.chunk.js", | ||
"static/js/19.72d34072.chunk.js": "/static/js/19.72d34072.chunk.js", | ||
"static/js/20.91615896.chunk.js": "/static/js/20.91615896.chunk.js", | ||
"static/js/18.c1660748.chunk.js": "/static/js/18.c1660748.chunk.js", | ||
"browser-compatibility-table.js": "/static/js/browser-compatibility-table.88534b2a.chunk.js", | ||
"static/js/19.147647aa.chunk.js": "/static/js/19.147647aa.chunk.js", | ||
"static/js/20.40de9807.chunk.js": "/static/js/20.40de9807.chunk.js", | ||
"static/css/21.7612237d.chunk.css": "/static/css/21.7612237d.chunk.css", | ||
"static/js/21.05acc86e.chunk.js": "/static/js/21.05acc86e.chunk.js", | ||
"static/js/21.abad1a5e.chunk.js": "/static/js/21.abad1a5e.chunk.js", | ||
"static/css/14.8a1f8bf9.chunk.css": "/static/css/14.8a1f8bf9.chunk.css", | ||
"static/js/14.7d2439f9.chunk.js": "/static/js/14.7d2439f9.chunk.js", | ||
"static/js/14.77228285.chunk.js": "/static/js/14.77228285.chunk.js", | ||
"static/css/23.d58ac90e.chunk.css": "/static/css/23.d58ac90e.chunk.css", | ||
"static/js/23.98a4650d.chunk.js": "/static/js/23.98a4650d.chunk.js", | ||
"static/js/23.ab32febd.chunk.js": "/static/js/23.ab32febd.chunk.js", | ||
"static/css/8.88fa5fca.chunk.css": "/static/css/8.88fa5fca.chunk.css", | ||
"static/js/8.3fd9ebeb.chunk.js": "/static/js/8.3fd9ebeb.chunk.js", | ||
"static/js/3.bf411037.chunk.js": "/static/js/3.bf411037.chunk.js", | ||
"static/js/24.49af4116.chunk.js": "/static/js/24.49af4116.chunk.js", | ||
"static/js/8.fb1e6b2b.chunk.js": "/static/js/8.fb1e6b2b.chunk.js", | ||
"static/js/3.5c3d35f8.chunk.js": "/static/js/3.5c3d35f8.chunk.js", | ||
"static/js/24.d80ef04b.chunk.js": "/static/js/24.d80ef04b.chunk.js", | ||
"static/css/25.a3df29b5.chunk.css": "/static/css/25.a3df29b5.chunk.css", | ||
"static/js/25.934087e1.chunk.js": "/static/js/25.934087e1.chunk.js", | ||
"static/js/25.383ce3b0.chunk.js": "/static/js/25.383ce3b0.chunk.js", | ||
"static/css/26.1b502418.chunk.css": "/static/css/26.1b502418.chunk.css", | ||
"static/js/26.88e06a21.chunk.js": "/static/js/26.88e06a21.chunk.js", | ||
"static/js/4.63677480.chunk.js": "/static/js/4.63677480.chunk.js", | ||
"static/js/12.7511b361.chunk.js": "/static/js/12.7511b361.chunk.js", | ||
"static/js/22.6d2bfad6.chunk.js": "/static/js/22.6d2bfad6.chunk.js", | ||
"static/js/13.ad887b7c.chunk.js": "/static/js/13.ad887b7c.chunk.js", | ||
"static/js/17.3b1456b0.chunk.js": "/static/js/17.3b1456b0.chunk.js", | ||
"static/js/16.c62623a3.chunk.js": "/static/js/16.c62623a3.chunk.js", | ||
"static/js/26.6db50ef3.chunk.js": "/static/js/26.6db50ef3.chunk.js", | ||
"static/js/4.c2e0b2a4.chunk.js": "/static/js/4.c2e0b2a4.chunk.js", | ||
"static/js/12.f166246e.chunk.js": "/static/js/12.f166246e.chunk.js", | ||
"static/js/22.d35ca313.chunk.js": "/static/js/22.d35ca313.chunk.js", | ||
"static/js/13.f36be4a1.chunk.js": "/static/js/13.f36be4a1.chunk.js", | ||
"static/js/17.7935f5e1.chunk.js": "/static/js/17.7935f5e1.chunk.js", | ||
"static/js/16.91e8fc34.chunk.js": "/static/js/16.91e8fc34.chunk.js", | ||
"static/media/STIXTwoMath-Regular.woff2": "/static/media/STIXTwoMath-Regular.a6dd783b1df04c61b10a.woff2", | ||
@@ -213,49 +213,49 @@ "static/media/ai-help_dark.png": "/static/media/ai-help_dark.c6ded5f61535da7aff21.png", | ||
"static/media/small-arrow.svg": "/static/media/small-arrow.a22801b3d18b7d1ea795.svg", | ||
"main.5f709b42.css.map": "/static/css/main.5f709b42.css.map", | ||
"main.bf9c4f55.js.map": "/static/js/main.bf9c4f55.js.map", | ||
"main.eeb9c22e.css.map": "/static/css/main.eeb9c22e.css.map", | ||
"main.fe7f4288.js.map": "/static/js/main.fe7f4288.js.map", | ||
"2.6f11d7af.chunk.js.map": "/static/js/2.6f11d7af.chunk.js.map", | ||
"5.19064a43.chunk.css.map": "/static/css/5.19064a43.chunk.css.map", | ||
"5.9a1f98e7.chunk.js.map": "/static/js/5.9a1f98e7.chunk.js.map", | ||
"5.29503e84.chunk.js.map": "/static/js/5.29503e84.chunk.js.map", | ||
"7.8dbf9ebe.chunk.css.map": "/static/css/7.8dbf9ebe.chunk.css.map", | ||
"7.962089af.chunk.js.map": "/static/js/7.962089af.chunk.js.map", | ||
"7.4f1a0c91.chunk.js.map": "/static/js/7.4f1a0c91.chunk.js.map", | ||
"9.1b353030.chunk.css.map": "/static/css/9.1b353030.chunk.css.map", | ||
"9.f3ca246a.chunk.js.map": "/static/js/9.f3ca246a.chunk.js.map", | ||
"9.00674f57.chunk.js.map": "/static/js/9.00674f57.chunk.js.map", | ||
"10.1904d8f2.chunk.css.map": "/static/css/10.1904d8f2.chunk.css.map", | ||
"10.da052fcd.chunk.js.map": "/static/js/10.da052fcd.chunk.js.map", | ||
"10.799e9a2d.chunk.js.map": "/static/js/10.799e9a2d.chunk.js.map", | ||
"11.706ddea0.chunk.css.map": "/static/css/11.706ddea0.chunk.css.map", | ||
"11.998030ea.chunk.js.map": "/static/js/11.998030ea.chunk.js.map", | ||
"11.18127906.chunk.js.map": "/static/js/11.18127906.chunk.js.map", | ||
"15.6d2a3650.chunk.css.map": "/static/css/15.6d2a3650.chunk.css.map", | ||
"15.04b6285b.chunk.js.map": "/static/js/15.04b6285b.chunk.js.map", | ||
"15.37b1f722.chunk.js.map": "/static/js/15.37b1f722.chunk.js.map", | ||
"6.3bbffd50.chunk.css.map": "/static/css/6.3bbffd50.chunk.css.map", | ||
"6.a3a5d8cb.chunk.js.map": "/static/js/6.a3a5d8cb.chunk.js.map", | ||
"6.910faa0d.chunk.js.map": "/static/js/6.910faa0d.chunk.js.map", | ||
"18.259a2a44.chunk.css.map": "/static/css/18.259a2a44.chunk.css.map", | ||
"18.6e369b1c.chunk.js.map": "/static/js/18.6e369b1c.chunk.js.map", | ||
"browser-compatibility-table.046f1b35.chunk.js.map": "/static/js/browser-compatibility-table.046f1b35.chunk.js.map", | ||
"19.72d34072.chunk.js.map": "/static/js/19.72d34072.chunk.js.map", | ||
"20.91615896.chunk.js.map": "/static/js/20.91615896.chunk.js.map", | ||
"18.c1660748.chunk.js.map": "/static/js/18.c1660748.chunk.js.map", | ||
"browser-compatibility-table.88534b2a.chunk.js.map": "/static/js/browser-compatibility-table.88534b2a.chunk.js.map", | ||
"19.147647aa.chunk.js.map": "/static/js/19.147647aa.chunk.js.map", | ||
"20.40de9807.chunk.js.map": "/static/js/20.40de9807.chunk.js.map", | ||
"21.7612237d.chunk.css.map": "/static/css/21.7612237d.chunk.css.map", | ||
"21.05acc86e.chunk.js.map": "/static/js/21.05acc86e.chunk.js.map", | ||
"21.abad1a5e.chunk.js.map": "/static/js/21.abad1a5e.chunk.js.map", | ||
"14.8a1f8bf9.chunk.css.map": "/static/css/14.8a1f8bf9.chunk.css.map", | ||
"14.7d2439f9.chunk.js.map": "/static/js/14.7d2439f9.chunk.js.map", | ||
"14.77228285.chunk.js.map": "/static/js/14.77228285.chunk.js.map", | ||
"23.d58ac90e.chunk.css.map": "/static/css/23.d58ac90e.chunk.css.map", | ||
"23.98a4650d.chunk.js.map": "/static/js/23.98a4650d.chunk.js.map", | ||
"23.ab32febd.chunk.js.map": "/static/js/23.ab32febd.chunk.js.map", | ||
"8.88fa5fca.chunk.css.map": "/static/css/8.88fa5fca.chunk.css.map", | ||
"8.3fd9ebeb.chunk.js.map": "/static/js/8.3fd9ebeb.chunk.js.map", | ||
"3.bf411037.chunk.js.map": "/static/js/3.bf411037.chunk.js.map", | ||
"24.49af4116.chunk.js.map": "/static/js/24.49af4116.chunk.js.map", | ||
"8.fb1e6b2b.chunk.js.map": "/static/js/8.fb1e6b2b.chunk.js.map", | ||
"3.5c3d35f8.chunk.js.map": "/static/js/3.5c3d35f8.chunk.js.map", | ||
"24.d80ef04b.chunk.js.map": "/static/js/24.d80ef04b.chunk.js.map", | ||
"25.a3df29b5.chunk.css.map": "/static/css/25.a3df29b5.chunk.css.map", | ||
"25.934087e1.chunk.js.map": "/static/js/25.934087e1.chunk.js.map", | ||
"25.383ce3b0.chunk.js.map": "/static/js/25.383ce3b0.chunk.js.map", | ||
"26.1b502418.chunk.css.map": "/static/css/26.1b502418.chunk.css.map", | ||
"26.88e06a21.chunk.js.map": "/static/js/26.88e06a21.chunk.js.map", | ||
"4.63677480.chunk.js.map": "/static/js/4.63677480.chunk.js.map", | ||
"12.7511b361.chunk.js.map": "/static/js/12.7511b361.chunk.js.map", | ||
"22.6d2bfad6.chunk.js.map": "/static/js/22.6d2bfad6.chunk.js.map", | ||
"13.ad887b7c.chunk.js.map": "/static/js/13.ad887b7c.chunk.js.map", | ||
"17.3b1456b0.chunk.js.map": "/static/js/17.3b1456b0.chunk.js.map", | ||
"16.c62623a3.chunk.js.map": "/static/js/16.c62623a3.chunk.js.map" | ||
"26.6db50ef3.chunk.js.map": "/static/js/26.6db50ef3.chunk.js.map", | ||
"4.c2e0b2a4.chunk.js.map": "/static/js/4.c2e0b2a4.chunk.js.map", | ||
"12.f166246e.chunk.js.map": "/static/js/12.f166246e.chunk.js.map", | ||
"22.d35ca313.chunk.js.map": "/static/js/22.d35ca313.chunk.js.map", | ||
"13.f36be4a1.chunk.js.map": "/static/js/13.f36be4a1.chunk.js.map", | ||
"17.7935f5e1.chunk.js.map": "/static/js/17.7935f5e1.chunk.js.map", | ||
"16.91e8fc34.chunk.js.map": "/static/js/16.91e8fc34.chunk.js.map" | ||
}, | ||
"entrypoints": [ | ||
"static/css/main.5f709b42.css", | ||
"static/js/main.bf9c4f55.js" | ||
"static/css/main.eeb9c22e.css", | ||
"static/js/main.fe7f4288.js" | ||
] | ||
} |
@@ -1,1 +0,1 @@ | ||
{"hyData":{"recentContributions":{"items":[{"number":21939,"title":"[zh-cn]: update the translation of `CanvasGradient.addColorStop()` method","updated_at":"2024-07-10T08:20:04Z","url":"https://github.com/mdn/translated-content/pull/21939","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}},{"number":22345,"title":"[zh-cn]: remove experimental_inline","updated_at":"2024-07-10T08:19:06Z","url":"https://github.com/mdn/translated-content/pull/22345","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}},{"number":21771,"title":"[ko] String() 생성자 신규 번역","updated_at":"2024-07-10T05:04:17Z","url":"https://github.com/mdn/translated-content/pull/21771","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}},{"number":22309,"title":"[ko] Intl.Segmenter 설명 신규 번역 외","updated_at":"2024-07-10T05:04:01Z","url":"https://github.com/mdn/translated-content/pull/22309","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}},{"number":34672,"title":"fix(css): update inset() function page","updated_at":"2024-07-10T04:30:07Z","url":"https://github.com/mdn/content/pull/34672","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}},{"number":34695,"title":"fix(css): correct grid `span` usage","updated_at":"2024-07-10T04:28:48Z","url":"https://github.com/mdn/content/pull/34695","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}},{"number":34734,"title":"fix(api): remove alert() and update Notification demo","updated_at":"2024-07-10T04:15:11Z","url":"https://github.com/mdn/content/pull/34734","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}},{"number":34507,"title":"Correct offsetParent condition","updated_at":"2024-07-10T03:11:05Z","url":"https://github.com/mdn/content/pull/34507","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}},{"number":34677,"title":"Add reference for labelled function SyntaxError","updated_at":"2024-07-10T02:54:01Z","url":"https://github.com/mdn/content/pull/34677","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}},{"number":22154,"title":"[zh-cn] update 'Safely inserting external content into a page'","updated_at":"2024-07-10T01:51:42Z","url":"https://github.com/mdn/translated-content/pull/22154","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}}]},"featuredContributor":null,"latestNews":{"items":[]},"featuredArticles":[]},"url":"/en-US/"} | ||
{"hyData":{"recentContributions":{"items":[{"number":33384,"title":"Update Markdown in MDN docs to use GFM syntax","updated_at":"2024-07-23T13:28:27Z","url":"https://github.com/mdn/content/pull/33384","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}},{"number":22272,"title":"zh-CN: update Glossary/UDP","updated_at":"2024-07-23T13:25:21Z","url":"https://github.com/mdn/translated-content/pull/22272","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}},{"number":22241,"title":"zh-CN: update Glossary/World_Wide_Web","updated_at":"2024-07-23T13:24:57Z","url":"https://github.com/mdn/translated-content/pull/22241","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}},{"number":22274,"title":"zh-CN: update Glossary/Type_Conversion ","updated_at":"2024-07-23T13:24:57Z","url":"https://github.com/mdn/translated-content/pull/22274","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}},{"number":33575,"title":"Convert noteblock in `/games` to GFM syntax","updated_at":"2024-07-23T11:48:57Z","url":"https://github.com/mdn/content/pull/33575","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}},{"number":34967,"title":"34700 webkit font feature settings","updated_at":"2024-07-23T11:44:33Z","url":"https://github.com/mdn/content/pull/34967","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}},{"number":20922,"title":"[zh-cn]: update the translation of `aria-labelledby`","updated_at":"2024-07-23T10:43:39Z","url":"https://github.com/mdn/translated-content/pull/20922","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}},{"number":34457,"title":"Set-Cookie: Domain attribute clarification","updated_at":"2024-07-23T10:24:21Z","url":"https://github.com/mdn/content/pull/34457","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}},{"number":21945,"title":"[zh-cn]: update the translation of `CanvasRenderingContext2D.fillStyle` property","updated_at":"2024-07-23T09:05:50Z","url":"https://github.com/mdn/translated-content/pull/21945","repo":{"name":"mdn/translated-content","url":"https://github.com/mdn/translated-content"}},{"number":34975,"title":"Fix invalid links","updated_at":"2024-07-23T07:42:08Z","url":"https://github.com/mdn/content/pull/34975","repo":{"name":"mdn/content","url":"https://github.com/mdn/content"}}]},"featuredContributor":null,"latestNews":{"items":[]},"featuredArticles":[]},"url":"/en-US/"} |
{ | ||
"name": "@zip-js/zip-js", | ||
"version": "2.7.45", | ||
"exports": "./index.js" | ||
"version": "2.7.46", | ||
"exports": { | ||
".": "./index.js", | ||
"./data-uri": "./lib/zip-data-uri.js" | ||
} | ||
} |
@@ -1,1 +0,1 @@ | ||
((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).zip={})})(this,(function(e){"use strict";const{Array:t,Object:n,String:i,Number:r,BigInt:a,Math:s,Date:o,Map:l,Set:c,Response:d,URL:u,Error:f,Uint8Array:h,Uint16Array:w,Uint32Array:_,DataView:p,Blob:b,Promise:g,TextEncoder:m,TextDecoder:y,document:x,crypto:k,btoa:v,TransformStream:S,ReadableStream:R,WritableStream:z,CompressionStream:D,DecompressionStream:T,navigator:E,Worker:A}="undefined"!=typeof globalThis?globalThis:this||self,C=0,F=1,U=-2,W=-3,L=-4,O=-5,I=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],N=1440,P=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],H=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],q=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],B=[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,112,112],M=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],V=[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],K=15;function Z(){let e,t,n,i,r,a;function s(e,t,s,o,l,c,d,u,f,h,w){let _,p,b,g,m,y,x,k,v,S,R,z,D,T,E;S=0,m=s;do{n[e[t+S]]++,S++,m--}while(0!==m);if(n[0]==s)return d[0]=-1,u[0]=0,C;for(k=u[0],y=1;K>=y&&0===n[y];y++);for(x=y,y>k&&(k=y),m=K;0!==m&&0===n[m];m--);for(b=m,k>m&&(k=m),u[0]=k,T=1<<y;m>y;y++,T<<=1)if(0>(T-=n[y]))return W;if(0>(T-=n[m]))return W;for(n[m]+=T,a[1]=y=0,S=1,D=2;0!=--m;)a[D]=y+=n[S],D++,S++;m=0,S=0;do{0!==(y=e[t+S])&&(w[a[y]++]=m),S++}while(++m<s);for(s=a[b],a[0]=m=0,S=0,g=-1,z=-k,r[0]=0,R=0,E=0;b>=x;x++)for(_=n[x];0!=_--;){for(;x>z+k;){if(g++,z+=k,E=b-z,E=E>k?k:E,(p=1<<(y=x-z))>_+1&&(p-=_+1,D=x,E>y))for(;++y<E&&(p<<=1)>n[++D];)p-=n[D];if(E=1<<y,h[0]+E>N)return W;r[g]=R=h[0],h[0]+=E,0!==g?(a[g]=m,i[0]=y,i[1]=k,y=m>>>z-k,i[2]=R-r[g-1]-y,f.set(i,3*(r[g-1]+y))):d[0]=R}for(i[1]=x-z,s>S?w[S]<o?(i[0]=256>w[S]?0:96,i[2]=w[S++]):(i[0]=c[w[S]-o]+16+64,i[2]=l[w[S++]-o]):i[0]=192,p=1<<x-z,y=m>>>z;E>y;y+=p)f.set(i,3*(R+y));for(y=1<<x-1;m&y;y>>>=1)m^=y;for(m^=y,v=(1<<z)-1;(m&v)!=a[g];)g--,z-=k,v=(1<<z)-1}return 0!==T&&1!=b?O:C}function o(s){let o;for(e||(e=[],t=[],n=new Int32Array(K+1),i=[],r=new Int32Array(K),a=new Int32Array(K+1)),t.length<s&&(t=[]),o=0;s>o;o++)t[o]=0;for(o=0;K+1>o;o++)n[o]=0;for(o=0;3>o;o++)i[o]=0;r.set(n.subarray(0,K),0),a.set(n.subarray(0,K+1),0)}this.inflate_trees_bits=(n,i,r,a,l)=>{let c;return o(19),e[0]=0,c=s(n,0,19,19,null,null,r,i,a,e,t),c==W?l.msg="oversubscribed dynamic bit lengths tree":c!=O&&0!==i[0]||(l.msg="incomplete dynamic bit lengths tree",c=W),c},this.inflate_trees_dynamic=(n,i,r,a,l,c,d,u,f)=>{let h;return o(288),e[0]=0,h=s(r,0,n,257,q,B,c,a,u,e,t),h!=C||0===a[0]?(h==W?f.msg="oversubscribed literal/length tree":h!=L&&(f.msg="incomplete literal/length tree",h=W),h):(o(288),h=s(r,n,i,0,M,V,d,l,u,e,t),h!=C||0===l[0]&&n>257?(h==W?f.msg="oversubscribed distance tree":h==O?(f.msg="incomplete distance tree",h=W):h!=L&&(f.msg="empty distance tree with lengths",h=W),h):C)}}Z.inflate_trees_fixed=(e,t,n,i)=>(e[0]=9,t[0]=5,n[0]=P,i[0]=H,C);const G=0,j=1,X=2,Y=3,J=4,Q=5,$=6,ee=7,te=8,ne=9;function ie(){const e=this;let t,n,i,r,a=0,s=0,o=0,l=0,c=0,d=0,u=0,f=0,h=0,w=0;function _(e,t,n,i,r,a,s,o){let l,c,d,u,f,h,w,_,p,b,g,m,y,x,k,v;w=o.next_in_index,_=o.avail_in,f=s.bitb,h=s.bitk,p=s.write,b=p<s.read?s.read-p-1:s.end-p,g=I[e],m=I[t];do{for(;20>h;)_--,f|=(255&o.read_byte(w++))<<h,h+=8;if(l=f&g,c=n,d=i,v=3*(d+l),0!==(u=c[v]))for(;;){if(f>>=c[v+1],h-=c[v+1],16&u){for(u&=15,y=c[v+2]+(f&I[u]),f>>=u,h-=u;15>h;)_--,f|=(255&o.read_byte(w++))<<h,h+=8;for(l=f&m,c=r,d=a,v=3*(d+l),u=c[v];;){if(f>>=c[v+1],h-=c[v+1],16&u){for(u&=15;u>h;)_--,f|=(255&o.read_byte(w++))<<h,h+=8;if(x=c[v+2]+(f&I[u]),f>>=u,h-=u,b-=y,x>p){k=p-x;do{k+=s.end}while(0>k);if(u=s.end-k,y>u){if(y-=u,p-k>0&&u>p-k)do{s.win[p++]=s.win[k++]}while(0!=--u);else s.win.set(s.win.subarray(k,k+u),p),p+=u,k+=u,u=0;k=0}}else k=p-x,p-k>0&&2>p-k?(s.win[p++]=s.win[k++],s.win[p++]=s.win[k++],y-=2):(s.win.set(s.win.subarray(k,k+2),p),p+=2,k+=2,y-=2);if(p-k>0&&y>p-k)do{s.win[p++]=s.win[k++]}while(0!=--y);else s.win.set(s.win.subarray(k,k+y),p),p+=y,k+=y,y=0;break}if(64&u)return o.msg="invalid distance code",y=o.avail_in-_,y=y>h>>3?h>>3:y,_+=y,w-=y,h-=y<<3,s.bitb=f,s.bitk=h,o.avail_in=_,o.total_in+=w-o.next_in_index,o.next_in_index=w,s.write=p,W;l+=c[v+2],l+=f&I[u],v=3*(d+l),u=c[v]}break}if(64&u)return 32&u?(y=o.avail_in-_,y=y>h>>3?h>>3:y,_+=y,w-=y,h-=y<<3,s.bitb=f,s.bitk=h,o.avail_in=_,o.total_in+=w-o.next_in_index,o.next_in_index=w,s.write=p,F):(o.msg="invalid literal/length code",y=o.avail_in-_,y=y>h>>3?h>>3:y,_+=y,w-=y,h-=y<<3,s.bitb=f,s.bitk=h,o.avail_in=_,o.total_in+=w-o.next_in_index,o.next_in_index=w,s.write=p,W);if(l+=c[v+2],l+=f&I[u],v=3*(d+l),0===(u=c[v])){f>>=c[v+1],h-=c[v+1],s.win[p++]=c[v+2],b--;break}}else f>>=c[v+1],h-=c[v+1],s.win[p++]=c[v+2],b--}while(b>=258&&_>=10);return y=o.avail_in-_,y=y>h>>3?h>>3:y,_+=y,w-=y,h-=y<<3,s.bitb=f,s.bitk=h,o.avail_in=_,o.total_in+=w-o.next_in_index,o.next_in_index=w,s.write=p,C}e.init=(e,a,s,o,l,c)=>{t=G,u=e,f=a,i=s,h=o,r=l,w=c,n=null},e.proc=(e,p,b)=>{let g,m,y,x,k,v,S,R=0,z=0,D=0;for(D=p.next_in_index,x=p.avail_in,R=e.bitb,z=e.bitk,k=e.write,v=k<e.read?e.read-k-1:e.end-k;;)switch(t){case G:if(v>=258&&x>=10&&(e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,b=_(u,f,i,h,r,w,e,p),D=p.next_in_index,x=p.avail_in,R=e.bitb,z=e.bitk,k=e.write,v=k<e.read?e.read-k-1:e.end-k,b!=C)){t=b==F?ee:ne;break}o=u,n=i,s=h,t=j;case j:for(g=o;g>z;){if(0===x)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,x--,R|=(255&p.read_byte(D++))<<z,z+=8}if(m=3*(s+(R&I[g])),R>>>=n[m+1],z-=n[m+1],y=n[m],0===y){l=n[m+2],t=$;break}if(16&y){c=15&y,a=n[m+2],t=X;break}if(!(64&y)){o=y,s=m/3+n[m+2];break}if(32&y){t=ee;break}return t=ne,p.msg="invalid literal/length code",b=W,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);case X:for(g=c;g>z;){if(0===x)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,x--,R|=(255&p.read_byte(D++))<<z,z+=8}a+=R&I[g],R>>=g,z-=g,o=f,n=r,s=w,t=Y;case Y:for(g=o;g>z;){if(0===x)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,x--,R|=(255&p.read_byte(D++))<<z,z+=8}if(m=3*(s+(R&I[g])),R>>=n[m+1],z-=n[m+1],y=n[m],16&y){c=15&y,d=n[m+2],t=J;break}if(!(64&y)){o=y,s=m/3+n[m+2];break}return t=ne,p.msg="invalid distance code",b=W,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);case J:for(g=c;g>z;){if(0===x)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,x--,R|=(255&p.read_byte(D++))<<z,z+=8}d+=R&I[g],R>>=g,z-=g,t=Q;case Q:for(S=k-d;0>S;)S+=e.end;for(;0!==a;){if(0===v&&(k==e.end&&0!==e.read&&(k=0,v=k<e.read?e.read-k-1:e.end-k),0===v&&(e.write=k,b=e.inflate_flush(p,b),k=e.write,v=k<e.read?e.read-k-1:e.end-k,k==e.end&&0!==e.read&&(k=0,v=k<e.read?e.read-k-1:e.end-k),0===v)))return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);e.win[k++]=e.win[S++],v--,S==e.end&&(S=0),a--}t=G;break;case $:if(0===v&&(k==e.end&&0!==e.read&&(k=0,v=k<e.read?e.read-k-1:e.end-k),0===v&&(e.write=k,b=e.inflate_flush(p,b),k=e.write,v=k<e.read?e.read-k-1:e.end-k,k==e.end&&0!==e.read&&(k=0,v=k<e.read?e.read-k-1:e.end-k),0===v)))return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,e.win[k++]=l,v--,t=G;break;case ee:if(z>7&&(z-=8,x++,D--),e.write=k,b=e.inflate_flush(p,b),k=e.write,v=k<e.read?e.read-k-1:e.end-k,e.read!=e.write)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);t=te;case te:return b=F,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);case ne:return b=W,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);default:return b=U,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b)}},e.free=()=>{}}const re=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ae=0,se=1,oe=2,le=3,ce=4,de=5,ue=6,fe=7,he=8,we=9;function _e(e,t){const n=this;let i,r=ae,a=0,s=0,o=0;const l=[0],c=[0],d=new ie;let u=0,f=new Int32Array(3*N);const w=new Z;n.bitk=0,n.bitb=0,n.win=new h(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),r==ue&&d.free(e),r=ae,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=(e,t)=>{let i,r,a;return r=e.next_out_index,a=n.read,i=(a>n.write?n.end:n.write)-a,i>e.avail_out&&(i=e.avail_out),0!==i&&t==O&&(t=C),e.avail_out-=i,e.total_out+=i,e.next_out.set(n.win.subarray(a,a+i),r),r+=i,a+=i,a==n.end&&(a=0,n.write==n.end&&(n.write=0),i=n.write-a,i>e.avail_out&&(i=e.avail_out),0!==i&&t==O&&(t=C),e.avail_out-=i,e.total_out+=i,e.next_out.set(n.win.subarray(a,a+i),r),r+=i,a+=i),e.next_out_index=r,n.read=a,t},n.proc=(e,t)=>{let h,_,p,b,g,m,y,x;for(b=e.next_in_index,g=e.avail_in,_=n.bitb,p=n.bitk,m=n.write,y=m<n.read?n.read-m-1:n.end-m;;){let k,v,S,R,z,D,T,E;switch(r){case ae:for(;3>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}switch(h=7&_,u=1&h,h>>>1){case 0:_>>>=3,p-=3,h=7&p,_>>>=h,p-=h,r=se;break;case 1:k=[],v=[],S=[[]],R=[[]],Z.inflate_trees_fixed(k,v,S,R),d.init(k[0],v[0],S[0],0,R[0],0),_>>>=3,p-=3,r=ue;break;case 2:_>>>=3,p-=3,r=le;break;case 3:return _>>>=3,p-=3,r=we,e.msg="invalid block type",t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t)}break;case se:for(;32>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}if((~_>>>16&65535)!=(65535&_))return r=we,e.msg="invalid stored block lengths",t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);a=65535&_,_=p=0,r=0!==a?oe:0!==u?fe:ae;break;case oe:if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);if(0===y&&(m==n.end&&0!==n.read&&(m=0,y=m<n.read?n.read-m-1:n.end-m),0===y&&(n.write=m,t=n.inflate_flush(e,t),m=n.write,y=m<n.read?n.read-m-1:n.end-m,m==n.end&&0!==n.read&&(m=0,y=m<n.read?n.read-m-1:n.end-m),0===y)))return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);if(t=C,h=a,h>g&&(h=g),h>y&&(h=y),n.win.set(e.read_buf(b,h),m),b+=h,g-=h,m+=h,y-=h,0!=(a-=h))break;r=0!==u?fe:ae;break;case le:for(;14>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}if(s=h=16383&_,(31&h)>29||(h>>5&31)>29)return r=we,e.msg="too many length or distance symbols",t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);if(h=258+(31&h)+(h>>5&31),!i||i.length<h)i=[];else for(x=0;h>x;x++)i[x]=0;_>>>=14,p-=14,o=0,r=ce;case ce:for(;4+(s>>>10)>o;){for(;3>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}i[re[o++]]=7&_,_>>>=3,p-=3}for(;19>o;)i[re[o++]]=0;if(l[0]=7,h=w.inflate_trees_bits(i,l,c,f,e),h!=C)return(t=h)==W&&(i=null,r=we),n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);o=0,r=de;case de:for(;h=s,258+(31&h)+(h>>5&31)>o;){let a,d;for(h=l[0];h>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}if(h=f[3*(c[0]+(_&I[h]))+1],d=f[3*(c[0]+(_&I[h]))+2],16>d)_>>>=h,p-=h,i[o++]=d;else{for(x=18==d?7:d-14,a=18==d?11:3;h+x>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}if(_>>>=h,p-=h,a+=_&I[x],_>>>=x,p-=x,x=o,h=s,x+a>258+(31&h)+(h>>5&31)||16==d&&1>x)return i=null,r=we,e.msg="invalid bit length repeat",t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);d=16==d?i[x-1]:0;do{i[x++]=d}while(0!=--a);o=x}}if(c[0]=-1,z=[],D=[],T=[],E=[],z[0]=9,D[0]=6,h=s,h=w.inflate_trees_dynamic(257+(31&h),1+(h>>5&31),i,z,D,T,E,f,e),h!=C)return h==W&&(i=null,r=we),t=h,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);d.init(z[0],D[0],f,T[0],f,E[0]),r=ue;case ue:if(n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,(t=d.proc(n,e,t))!=F)return n.inflate_flush(e,t);if(t=C,d.free(e),b=e.next_in_index,g=e.avail_in,_=n.bitb,p=n.bitk,m=n.write,y=m<n.read?n.read-m-1:n.end-m,0===u){r=ae;break}r=fe;case fe:if(n.write=m,t=n.inflate_flush(e,t),m=n.write,y=m<n.read?n.read-m-1:n.end-m,n.read!=n.write)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);r=he;case he:return t=F,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);case we:return t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);default:return t=U,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t)}}},n.free=e=>{n.reset(e,null),n.win=null,f=null},n.set_dictionary=(e,t,i)=>{n.win.set(e.subarray(t,t+i),0),n.read=n.write=i},n.sync_point=()=>r==se?1:0}const pe=13,be=[0,0,255,255];function ge(){const e=this;function t(e){return e&&e.istate?(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=7,e.istate.blocks.reset(e,null),C):U}e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0,e.inflateEnd=t=>(e.blocks&&e.blocks.free(t),e.blocks=null,C),e.inflateInit=(n,i)=>(n.msg=null,e.blocks=null,8>i||i>15?(e.inflateEnd(n),U):(e.wbits=i,n.istate.blocks=new _e(n,1<<i),t(n),C)),e.inflate=(e,t)=>{let n,i;if(!e||!e.istate||!e.next_in)return U;const r=e.istate;for(t=4==t?O:C,n=O;;)switch(r.mode){case 0:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,8!=(15&(r.method=e.read_byte(e.next_in_index++)))){r.mode=pe,e.msg="unknown compression method",r.marker=5;break}if(8+(r.method>>4)>r.wbits){r.mode=pe,e.msg="invalid win size",r.marker=5;break}r.mode=1;case 1:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,i=255&e.read_byte(e.next_in_index++),((r.method<<8)+i)%31!=0){r.mode=pe,e.msg="incorrect header check",r.marker=5;break}if(!(32&i)){r.mode=7;break}r.mode=2;case 2:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need=(255&e.read_byte(e.next_in_index++))<<24&4278190080,r.mode=3;case 3:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need+=(255&e.read_byte(e.next_in_index++))<<16&16711680,r.mode=4;case 4:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need+=(255&e.read_byte(e.next_in_index++))<<8&65280,r.mode=5;case 5:return 0===e.avail_in?n:(n=t,e.avail_in--,e.total_in++,r.need+=255&e.read_byte(e.next_in_index++),r.mode=6,2);case 6:return r.mode=pe,e.msg="need dictionary",r.marker=0,U;case 7:if(n=r.blocks.proc(e,n),n==W){r.mode=pe,r.marker=0;break}if(n==C&&(n=t),n!=F)return n;n=t,r.blocks.reset(e,r.was),r.mode=12;case 12:return e.avail_in=0,F;case pe:return W;default:return U}},e.inflateSetDictionary=(e,t,n)=>{let i=0,r=n;if(!e||!e.istate||6!=e.istate.mode)return U;const a=e.istate;return r<1<<a.wbits||(r=(1<<a.wbits)-1,i=n-r),a.blocks.set_dictionary(t,i,r),a.mode=7,C},e.inflateSync=e=>{let n,i,r,a,s;if(!e||!e.istate)return U;const o=e.istate;if(o.mode!=pe&&(o.mode=pe,o.marker=0),0===(n=e.avail_in))return O;for(i=e.next_in_index,r=o.marker;0!==n&&4>r;)e.read_byte(i)==be[r]?r++:r=0!==e.read_byte(i)?0:4-r,i++,n--;return e.total_in+=i-e.next_in_index,e.next_in_index=i,e.avail_in=n,o.marker=r,4!=r?W:(a=e.total_in,s=e.total_out,t(e),e.total_in=a,e.total_out=s,o.mode=7,C)},e.inflateSyncPoint=e=>e&&e.istate&&e.istate.blocks?e.istate.blocks.sync_point():U}function me(){}me.prototype={inflateInit(e){const t=this;return t.istate=new ge,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){const t=this;return t.istate?t.istate.inflate(t,e):U},inflateEnd(){const e=this;if(!e.istate)return U;const t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){const e=this;return e.istate?e.istate.inflateSync(e):U},inflateSetDictionary(e,t){const n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):U},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};const ye=4294967295,xe=65535,ke=33639248,ve=101075792,Se=22,Re=void 0,ze="undefined",De="function";class Te{constructor(e){return class extends S{constructor(t,n){const i=new e(n);super({transform(e,t){t.enqueue(i.append(e))},flush(e){const t=i.flush();t&&e.enqueue(t)}})}}}}let Ee=2;try{typeof E!=ze&&E.hardwareConcurrency&&(Ee=E.hardwareConcurrency)}catch(e){}const Ae={chunkSize:524288,maxWorkers:Ee,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Re,CompressionStreamNative:typeof D!=ze&&D,DecompressionStreamNative:typeof T!=ze&&T},Ce=n.assign({},Ae);function Fe(){return Ce}function Ue(e){const{baseURL:n,chunkSize:i,maxWorkers:r,terminateWorkerTimeout:a,useCompressionStream:s,useWebWorkers:o,Deflate:l,Inflate:c,CompressionStream:d,DecompressionStream:u,workerScripts:h}=e;if(We("baseURL",n),We("chunkSize",i),We("maxWorkers",r),We("terminateWorkerTimeout",a),We("useCompressionStream",s),We("useWebWorkers",o),l&&(Ce.CompressionStream=new Te(l)),c&&(Ce.DecompressionStream=new Te(c)),We("CompressionStream",d),We("DecompressionStream",u),h!==Re){const{deflate:e,inflate:n}=h;if((e||n)&&(Ce.workerScripts||(Ce.workerScripts={})),e){if(!t.isArray(e))throw new f("workerScripts.deflate must be an array");Ce.workerScripts.deflate=e}if(n){if(!t.isArray(n))throw new f("workerScripts.inflate must be an array");Ce.workerScripts.inflate=n}}}function We(e,t){t!==Re&&(Ce[e]=t)}const Le=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;Le[e]=t}class Oe{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,i=0|e.length;i>n;n++)t=t>>>8^Le[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class Ie extends S{constructor(){let e;const t=new Oe;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new h(4);new p(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const Ne={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],i=Ne.getPartial(n);return 32===i?e.concat(t):Ne._shiftRight(t,i,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+Ne.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,s.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=Ne.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>s.round(e/1099511627776)||32,_shiftRight(e,t,n,i){for(void 0===i&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(0===t)return i.concat(e);for(let r=0;r<e.length;r++)i.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=Ne.getPartial(r);return i.push(Ne.partial(t+a&31,t+a>32?n:i.pop(),1)),i}},Pe={bytes:{fromBits(e){const t=Ne.bitLength(e)/8,n=new h(t);let i;for(let r=0;t>r;r++)3&r||(i=e[r/4]),n[r]=i>>>24,i<<=8;return n},toBits(e){const t=[];let n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],3&~n||(t.push(i),i=0);return 3&n&&t.push(Ne.partial(8*(3&n),i)),t}}},He=class{constructor(e){const t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){const e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){const t=this;"string"==typeof e&&(e=Pe.utf8String.toBits(e));const n=t._buffer=Ne.concat(t._buffer,e),i=t._length,r=t._length=i+Ne.bitLength(e);if(r>9007199254740991)throw new f("Cannot hash more than 2^53 - 1 bits");const a=new _(n);let s=0;for(let e=t.blockSize+i-(t.blockSize+i&t.blockSize-1);r>=e;e+=t.blockSize)t._block(a.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){const e=this;let t=e._buffer;const n=e._h;t=Ne.concat(t,[Ne.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(s.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){return e>19?e>39?e>59?e>79?void 0:t^n^i:t&n|t&i|n&i:t^n^i:t&n|~t&i}_S(e,t){return t<<e|t>>>32-e}_block(e){const n=this,i=n._h,r=t(80);for(let t=0;16>t;t++)r[t]=e[t];let a=i[0],o=i[1],l=i[2],c=i[3],d=i[4];for(let e=0;79>=e;e++){16>e||(r[e]=n._S(1,r[e-3]^r[e-8]^r[e-14]^r[e-16]));const t=n._S(5,a)+n._f(e,o,l,c)+d+r[e]+n._key[s.floor(e/20)]|0;d=c,c=l,l=n._S(30,o),o=a,a=t}i[0]=i[0]+a|0,i[1]=i[1]+o|0,i[2]=i[2]+l|0,i[3]=i[3]+c|0,i[4]=i[4]+d|0}},qe={getRandomValues(e){const t=new _(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let i,r=0;r<e.length;r+=4){const e=n(4294967296*(i||s.random()));i=987654071*e(),t[r/4]=4294967296*e()|0}return e}},Be={importKey:e=>new Be.hmacSha1(Pe.bytes.toBits(e)),pbkdf2(e,t,n,i){if(n=n||1e4,0>i||0>n)throw new f("invalid params to pbkdf2");const r=1+(i>>5)<<2;let a,s,o,l,c;const d=new ArrayBuffer(r),u=new p(d);let h=0;const w=Ne;for(t=Pe.bytes.toBits(t),c=1;(r||1)>h;c++){for(a=s=e.encrypt(w.concat(t,[c])),o=1;n>o;o++)for(s=e.encrypt(s),l=0;l<s.length;l++)a[l]^=s[l];for(o=0;(r||1)>h&&o<a.length;o++)u.setInt32(h,a[o]),h+=4}return d.slice(0,i/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=He,i=[[],[]];t._baseHash=[new n,new n];const r=t._baseHash[0].blockSize/32;e.length>r&&(e=(new n).update(e).finalize());for(let t=0;r>t;t++)i[0][t]=909522486^e[t],i[1][t]=1549556828^e[t];t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new f("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},Me=typeof k!=ze&&typeof k.getRandomValues==De,Ve="Invalid password",Ke="Invalid signature",Ze="zipjs-abort-check-password";function Ge(e){return Me?k.getRandomValues(e):qe.getRandomValues(e)}const je=16,Xe={name:"PBKDF2"},Ye=n.assign({hash:{name:"HMAC"}},Xe),Je=n.assign({iterations:1e3,hash:{name:"SHA-1"}},Xe),Qe=["deriveBits"],$e=[8,12,16],et=[16,24,32],tt=10,nt=[0,0,0,0],it=typeof k!=ze,rt=it&&k.subtle,at=it&&typeof rt!=ze,st=Pe.bytes,ot=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],i=t._tables[1],r=e.length;let a,s,o,l=1;if(4!==r&&6!==r&&8!==r)throw new f("invalid aes key size");for(t._key=[s=e.slice(0),o=[]],a=r;4*r+28>a;a++){let e=s[a-1];(a%r==0||8===r&&a%r==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],a%r==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),s[a]=s[a-r]^e}for(let e=0;a;e++,a--){const t=s[3&e?a:a-4];o[e]=4>=a||4>e?t:i[0][n[t>>>24]]^i[1][n[t>>16&255]]^i[2][n[t>>8&255]]^i[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],a=[];let s,o,l,c;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let d=s=0;!n[d];d^=o||1,s=a[s]||1){let a=s^s<<1^s<<2^s<<3^s<<4;a=a>>8^255&a^99,n[d]=a,i[a]=d,c=r[l=r[o=r[d]]];let u=16843009*c^65537*l^257*o^16843008*d,f=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][d]=f=f<<24^f>>>8,t[n][a]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new f("invalid aes block size");const n=this._key[t],i=n.length/4-2,r=[0,0,0,0],a=this._tables[t],s=a[0],o=a[1],l=a[2],c=a[3],d=a[4];let u,h,w,_=e[0]^n[0],p=e[t?3:1]^n[1],b=e[2]^n[2],g=e[t?1:3]^n[3],m=4;for(let e=0;i>e;e++)u=s[_>>>24]^o[p>>16&255]^l[b>>8&255]^c[255&g]^n[m],h=s[p>>>24]^o[b>>16&255]^l[g>>8&255]^c[255&_]^n[m+1],w=s[b>>>24]^o[g>>16&255]^l[_>>8&255]^c[255&p]^n[m+2],g=s[g>>>24]^o[_>>16&255]^l[p>>8&255]^c[255&b]^n[m+3],m+=4,_=u,p=h,b=w;for(let e=0;4>e;e++)r[t?3&-e:e]=d[_>>>24]<<24^d[p>>16&255]<<16^d[b>>8&255]<<8^d[255&g]^n[m++],u=_,_=p,p=b,b=g,g=u;return r}},lt=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,i=255&e;255===t?(t=0,255===n?(n=0,255===i?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];const r=Ne.bitLength(t);for(let r=0;i>r;r+=4){this.incCounter(n);const i=e.encrypt(n);t[r]^=i[0],t[r+1]^=i[1],t[r+2]^=i[2],t[r+3]^=i[3]}return Ne.clamp(t,r)}},ct=Be.hmacSha1;let dt=it&&at&&typeof rt.importKey==De,ut=it&&at&&typeof rt.deriveBits==De;class ft extends S{constructor({password:e,rawPassword:t,signed:i,encryptionStrength:r,checkPasswordOnly:a}){super({start(){n.assign(this,{ready:new g((e=>this.resolveReady=e)),password:pt(e,t),signed:i,strength:r-1,pending:new h})},async transform(e,t){const n=this,{password:i,strength:r,resolveReady:s,ready:o}=n;i?(await(async(e,t,n,i)=>{const r=await _t(e,t,n,gt(i,0,$e[t])),a=gt(i,$e[t]);if(r[0]!=a[0]||r[1]!=a[1])throw new f(Ve)})(n,r,i,gt(e,0,$e[r]+2)),e=gt(e,$e[r]+2),a?t.error(new f(Ze)):s()):await o;const l=new h(e.length-tt-(e.length-tt)%je);t.enqueue(wt(n,e,l,0,tt,!0))},async flush(e){const{signed:t,ctr:n,hmac:i,pending:r,ready:a}=this;if(i&&n){await a;const s=gt(r,0,r.length-tt),o=gt(r,r.length-tt);let l=new h;if(s.length){const e=yt(st,s);i.update(e);const t=n.update(e);l=mt(st,t)}if(t){const e=gt(mt(st,i.digest()),0,tt);for(let t=0;tt>t;t++)if(e[t]!=o[t])throw new f(Ke)}e.enqueue(l)}}})}}class ht extends S{constructor({password:e,rawPassword:t,encryptionStrength:i}){let r;super({start(){n.assign(this,{ready:new g((e=>this.resolveReady=e)),password:pt(e,t),strength:i-1,pending:new h})},async transform(e,t){const n=this,{password:i,strength:r,resolveReady:a,ready:s}=n;let o=new h;i?(o=await(async(e,t,n)=>{const i=Ge(new h($e[t]));return bt(i,await _t(e,t,n,i))})(n,r,i),a()):await s;const l=new h(o.length+e.length-e.length%je);l.set(o,0),t.enqueue(wt(n,e,l,o.length,0))},async flush(e){const{ctr:t,hmac:n,pending:i,ready:a}=this;if(n&&t){await a;let s=new h;if(i.length){const e=t.update(yt(st,i));n.update(e),s=mt(st,e)}r.signature=mt(st,n.digest()).slice(0,tt),e.enqueue(bt(s,r.signature))}}}),r=this}}function wt(e,t,n,i,r,a){const{ctr:s,hmac:o,pending:l}=e,c=t.length-r;let d;for(l.length&&(t=bt(l,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new h(t)).set(n,0)}return e})(n,c-c%je)),d=0;c-je>=d;d+=je){const e=yt(st,gt(t,d,d+je));a&&o.update(e);const r=s.update(e);a||o.update(r),n.set(mt(st,r),d+i)}return e.pending=gt(t,d),n}async function _t(e,i,r,a){e.password=null;const s=await(async(e,t,n,i,r)=>{if(!dt)return Be.importKey(t);try{return await rt.importKey("raw",t,n,!1,r)}catch(e){return dt=!1,Be.importKey(t)}})(0,r,Ye,0,Qe),o=await(async(e,t,n)=>{if(!ut)return Be.pbkdf2(t,e.salt,Je.iterations,n);try{return await rt.deriveBits(e,t,n)}catch(i){return ut=!1,Be.pbkdf2(t,e.salt,Je.iterations,n)}})(n.assign({salt:a},Je),s,8*(2*et[i]+2)),l=new h(o),c=yt(st,gt(l,0,et[i])),d=yt(st,gt(l,et[i],2*et[i])),u=gt(l,2*et[i]);return n.assign(e,{keys:{key:c,authentication:d,passwordVerification:u},ctr:new lt(new ot(c),t.from(nt)),hmac:new ct(d)}),u}function pt(e,t){return t===Re?(e=>{if(typeof m==ze){const t=new h((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new m).encode(e)})(e):t}function bt(e,t){let n=e;return e.length+t.length&&(n=new h(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function gt(e,t,n){return e.subarray(t,n)}function mt(e,t){return e.fromBits(t)}function yt(e,t){return e.toBits(t)}class xt extends S{constructor({password:e,passwordVerification:t,checkPasswordOnly:i}){super({start(){n.assign(this,{password:e,passwordVerification:t}),Rt(this,e)},transform(e,t){const n=this;if(n.password){const t=vt(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new f(Ve);e=e.subarray(12)}i?t.error(new f(Ze)):t.enqueue(vt(n,e))}})}}class kt extends S{constructor({password:e,passwordVerification:t}){super({start(){n.assign(this,{password:e,passwordVerification:t}),Rt(this,e)},transform(e,t){const n=this;let i,r;if(n.password){n.password=null;const t=Ge(new h(12));t[11]=n.passwordVerification,i=new h(e.length+t.length),i.set(St(n,t),0),r=12}else i=new h(e.length),r=0;i.set(St(n,e),r),t.enqueue(i)}})}}function vt(e,t){const n=new h(t.length);for(let i=0;i<t.length;i++)n[i]=Dt(e)^t[i],zt(e,n[i]);return n}function St(e,t){const n=new h(t.length);for(let i=0;i<t.length;i++)n[i]=Dt(e)^t[i],zt(e,t[i]);return n}function Rt(e,t){const i=[305419896,591751049,878082192];n.assign(e,{keys:i,crcKey0:new Oe(i[0]),crcKey2:new Oe(i[2])});for(let n=0;n<t.length;n++)zt(e,t.charCodeAt(n))}function zt(e,t){let[n,i,r]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Et(s.imul(Et(i+Tt(n)),134775813)+1),e.crcKey2.append([i>>>24]),r=~e.crcKey2.get(),e.keys=[n,i,r]}function Dt(e){const t=2|e.keys[2];return Tt(s.imul(t,1^t)>>>8)}function Tt(e){return 255&e}function Et(e){return 4294967295&e}const At="deflate-raw";class Ct extends S{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:i}){super({});const{compressed:r,encrypted:a,useCompressionStream:s,zipCrypto:o,signed:l,level:c}=e,d=this;let u,f,h=Ut(super.readable);a&&!o||!l||(u=new Ie,h=Ot(h,u)),r&&(h=Lt(h,s,{level:c,chunkSize:t},i,n)),a&&(o?h=Ot(h,new kt(e)):(f=new ht(e),h=Ot(h,f))),Wt(d,h,(()=>{let e;a&&!o&&(e=f.signature),a&&!o||!l||(e=new p(u.value.buffer).getUint32(0)),d.signature=e}))}}class Ft extends S{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:i}){super({});const{zipCrypto:r,encrypted:a,signed:s,signature:o,compressed:l,useCompressionStream:c}=e;let d,u,h=Ut(super.readable);a&&(r?h=Ot(h,new xt(e)):(u=new ft(e),h=Ot(h,u))),l&&(h=Lt(h,c,{chunkSize:t},i,n)),a&&!r||!s||(d=new Ie,h=Ot(h,d)),Wt(this,h,(()=>{if((!a||r)&&s){const e=new p(d.value.buffer);if(o!=e.getUint32(0,!1))throw new f(Ke)}}))}}function Ut(e){return Ot(e,new S({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function Wt(e,t,i){t=Ot(t,new S({flush:i})),n.defineProperty(e,"readable",{get:()=>t})}function Lt(e,t,n,i,r){try{e=Ot(e,new(t&&i?i:r)(At,n))}catch(i){if(!t)return e;try{e=Ot(e,new r(At,n))}catch(t){return e}}return e}function Ot(e,t){return e.pipeThrough(t)}const It="data",Nt="close",Pt="inflate";class Ht extends S{constructor(e,t){super({});const i=this,{codecType:r}=e;let a;r.startsWith("deflate")?a=Ct:r.startsWith(Pt)&&(a=Ft);let s=0,o=0;const l=new a(e,t),c=super.readable,d=new S({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){n.assign(i,{inputSize:o})}}),u=new S({transform(e,t){e&&e.length&&(s+=e.length,t.enqueue(e))},flush(){const{signature:e}=l;n.assign(i,{signature:e,outputSize:s,inputSize:o})}});n.defineProperty(i,"readable",{get:()=>c.pipeThrough(d).pipeThrough(l).pipeThrough(u)})}}class qt extends S{constructor(e){let t;super({transform:function n(i,r){if(t){const e=new h(t.length+i.length);e.set(t),e.set(i,t.length),i=e,t=null}i.length>e?(r.enqueue(i.slice(0,e)),n(i.slice(e),r)):t=i},flush(e){t&&t.length&&e.enqueue(t)}})}}let Bt=typeof A!=ze;class Mt{constructor(e,{readable:t,writable:i},{options:r,config:a,streamOptions:s,useWebWorkers:o,transferStreams:l,scripts:c},d){const{signal:u}=s;return n.assign(e,{busy:!0,readable:t.pipeThrough(new qt(a.chunkSize)).pipeThrough(new Vt(t,s),{signal:u}),writable:i,options:n.assign({},r),scripts:c,transferStreams:l,terminate:()=>new g((t=>{const{worker:n,busy:i}=e;n?(i?e.resolveTerminated=t:(n.terminate(),t()),e.interface=null):t()})),onTaskFinished(){const{resolveTerminated:t}=e;t&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),t()),e.busy=!1,d(e)}}),(o&&Bt?Gt:Zt)(e,a)}}class Vt extends S{constructor(e,{onstart:t,onprogress:n,size:i,onend:r}){let a=0;super({async start(){t&&await Kt(t,i)},async transform(e,t){a+=e.length,n&&await Kt(n,a,i),t.enqueue(e)},async flush(){e.size=a,r&&await Kt(r,a)}})}}async function Kt(e,...t){try{await e(...t)}catch(e){}}function Zt(e,t){return{run:()=>(async({options:e,readable:t,writable:n,onTaskFinished:i},r)=>{try{const i=new Ht(e,r);await t.pipeThrough(i).pipeTo(n,{preventClose:!0,preventAbort:!0});const{signature:a,inputSize:s,outputSize:o}=i;return{signature:a,inputSize:s,outputSize:o}}finally{i()}})(e,t)}}function Gt(e,t){const{baseURL:i,chunkSize:r}=t;if(!e.interface){let a;try{a=((e,t,i)=>{const r={type:"module"};let a,s;typeof e==De&&(e=e());try{a=new u(e,t)}catch(t){a=e}if(jt)try{s=new A(a)}catch(e){jt=!1,s=new A(a,r)}else s=new A(a,r);return s.addEventListener("message",(e=>(async({data:e},t)=>{const{type:i,value:r,messageId:a,result:s,error:o}=e,{reader:l,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:w}=t;try{if(o){const{message:e,stack:t,code:i,name:r}=o,a=new f(e);n.assign(a,{stack:t,code:i,name:r}),_(a)}else{if("pull"==i){const{value:e,done:n}=await l.read();Yt({type:It,value:e,done:n,messageId:a},t)}i==It&&(await c.ready,await c.write(new h(r)),Yt({type:"ack",messageId:a},t)),i==Nt&&_(null,s)}}catch(o){Yt({type:Nt,messageId:a},t),_(o)}function _(e,t){e?u(e):d(t),c&&c.releaseLock(),w()}})(e,i))),s})(e.scripts[0],i,e)}catch(n){return Bt=!1,Zt(e,t)}n.assign(e,{worker:a,interface:{run:()=>(async(e,t)=>{let i,r;const a=new g(((e,t)=>{i=e,r=t}));n.assign(e,{reader:null,writer:null,resolveResult:i,rejectResult:r,result:a});const{readable:s,options:o,scripts:l}=e,{writable:c,closed:d}=(e=>{let t;const n=new g((e=>t=e));return{writable:new z({async write(t){const n=e.getWriter();await n.ready,await n.write(t),n.releaseLock()},close(){t()},abort:t=>e.getWriter().abort(t)}),closed:n}})(e.writable),u=Yt({type:"start",scripts:l.slice(1),options:o,config:t,readable:s,writable:c},e);u||n.assign(e,{reader:s.getReader(),writer:c.getWriter()});const f=await a;return u||await c.getWriter().close(),await d,f})(e,{chunkSize:r})}})}return e.interface}let jt=!0,Xt=!0;function Yt(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:r}){try{let{value:n,readable:i,writable:a}=e;const s=[];if(n&&(n.byteLength<n.buffer.byteLength?e.value=n.buffer.slice(0,n.byteLength):e.value=n.buffer,s.push(e.value)),r&&Xt?(i&&s.push(i),a&&s.push(a)):e.readable=e.writable=null,s.length)try{return t.postMessage(e,s),!0}catch(n){Xt=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(e){throw n&&n.releaseLock(),i(),e}}let Jt=[];const Qt=[];let $t=0;function en(e){const{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}const tn="HTTP error ",nn="HTTP Range not supported",rn="Writer iterator completed too soon",an="Content-Length",sn="Range",on="HEAD",ln="GET",cn="bytes",dn=65536,un="writable";class fn{constructor(){this.size=0}init(){this.initialized=!0}}class hn extends fn{get readable(){const e=this,{chunkSize:t=dn}=e,n=new R({start(){this.chunkOffset=0},async pull(i){const{offset:r=0,size:a,diskNumberStart:o}=n,{chunkOffset:l}=this;i.enqueue(await On(e,r+l,s.min(t,a-l),o)),l+t>a?i.close():this.chunkOffset+=t}});return n}}class wn extends fn{constructor(){super();const e=this,t=new z({write:t=>e.writeUint8Array(t)});n.defineProperty(e,un,{get:()=>t})}writeUint8Array(){}}class _n extends hn{constructor(e){super(),n.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const n=this,i=e+t,r=e||i<n.size?n.blob.slice(e,i):n.blob;let a=await r.arrayBuffer();return a.byteLength>t&&(a=a.slice(e,i)),new h(a)}}class pn extends fn{constructor(e){super();const t=new S,i=[];e&&i.push(["Content-Type",e]),n.defineProperty(this,un,{get:()=>t.writable}),this.blob=new d(t.readable,{headers:i}).blob()}getData(){return this.blob}}class bn extends hn{constructor(e,t){super(),mn(this,e,t)}async init(){await yn(this,Tn,Sn),super.init()}readUint8Array(e,t){return xn(this,e,t,Tn,Sn)}}class gn extends hn{constructor(e,t){super(),mn(this,e,t)}async init(){await yn(this,En,Rn),super.init()}readUint8Array(e,t){return xn(this,e,t,En,Rn)}}function mn(e,t,i){const{preventHeadRequest:r,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:o}=i;delete(i=n.assign({},i)).preventHeadRequest,delete i.useRangeHeader,delete i.forceRangeRequests,delete i.combineSizeEocd,delete i.useXHR,n.assign(e,{url:t,options:i,preventHeadRequest:r,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:o})}async function yn(e,t,n){const{url:i,preventHeadRequest:a,useRangeHeader:s,forceRangeRequests:o,combineSizeEocd:l}=e;if((e=>{const{baseURL:t}=Fe(),{protocol:n}=new u(e,t);return"http:"==n||"https:"==n})(i)&&(s||o)&&(void 0===a||a)){const i=await t(ln,e,kn(e,l?-22:void 0));if(!o&&i.headers.get("Accept-Ranges")!=cn)throw new f(nn);{let a;l&&(e.eocdCache=new h(await i.arrayBuffer()));const s=i.headers.get("Content-Range");if(s){const e=s.trim().split(/\s*\/\s*/);if(e.length){const t=e[1];t&&"*"!=t&&(a=r(t))}}a===Re?await Dn(e,t,n):e.size=a}}else await Dn(e,t,n)}async function xn(e,t,n,i,r){const{useRangeHeader:a,forceRangeRequests:s,eocdCache:o,size:l,options:c}=e;if(a||s){if(o&&t==l-Se&&n==Se)return o;const r=await i(ln,e,kn(e,t,n));if(206!=r.status)throw new f(nn);return new h(await r.arrayBuffer())}{const{data:i}=e;return i||await r(e,c),new h(e.data.subarray(t,t+n))}}function kn(e,t=0,i=1){return n.assign({},vn(e),{[sn]:cn+"="+(0>t?t:t+"-"+(t+i-1))})}function vn({options:e}){const{headers:t}=e;if(t)return Symbol.iterator in t?n.fromEntries(t):t}async function Sn(e){await zn(e,Tn)}async function Rn(e){await zn(e,En)}async function zn(e,t){const n=await t(ln,e,vn(e));e.data=new h(await n.arrayBuffer()),e.size||(e.size=e.data.length)}async function Dn(e,t,n){if(e.preventHeadRequest)await n(e,e.options);else{const i=(await t(on,e,vn(e))).headers.get(an);i?e.size=r(i):await n(e,e.options)}}async function Tn(e,{options:t,url:i},r){const a=await fetch(i,n.assign({},t,{method:e,headers:r}));if(400>a.status)return a;throw 416==a.status?new f(nn):new f(tn+(a.statusText||a.status))}function En(e,{url:t},i){return new g(((r,a)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",(()=>{if(400>s.status){const e=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{const n=t.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,(e=>e.toUpperCase())),e.push(n)})),r({status:s.status,arrayBuffer:()=>s.response,headers:new l(e)})}else a(416==s.status?new f(nn):new f(tn+(s.statusText||s.status)))}),!1),s.addEventListener("error",(e=>a(e.detail?e.detail.error:new f("Network error"))),!1),s.open(e,t),i)for(const e of n.entries(i))s.setRequestHeader(e[0],e[1]);s.responseType="arraybuffer",s.send()}))}class An extends hn{constructor(e,t={}){super(),n.assign(this,{url:e,reader:t.useXHR?new gn(e,t):new bn(e,t)})}set size(e){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}readUint8Array(e,t){return this.reader.readUint8Array(e,t)}}class Cn extends hn{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await g.all(t.map((async(n,i)=>{await n.init(),i!=t.length-1&&(e.lastDiskOffset+=n.size),e.size+=n.size}))),super.init()}async readUint8Array(e,t,n=0){const i=this,{readers:r}=this;let a,o=n;-1==o&&(o=r.length-1);let l=e;for(;l>=r[o].size;)l-=r[o].size,o++;const c=r[o],d=c.size;if(l+t>d){const r=d-l;a=new h(t),a.set(await On(c,l,r)),a.set(await i.readUint8Array(e+r,t-r,n),r)}else a=await On(c,l,t);return i.lastDiskNumber=s.max(o,i.lastDiskNumber),a}}class Fn extends fn{constructor(e,t=4294967295){super();const i=this;let r,a,s;n.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});const o=new z({async write(t){const{availableSize:n}=i;if(s)t.length<n?await l(t):(await l(t.slice(0,n)),await c(),i.diskOffset+=r.size,i.diskNumber++,s=null,await this.write(t.slice(n)));else{const{value:n,done:o}=await e.next();if(o&&!n)throw new f(rn);r=n,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await Un(r),a=n.writable,s=a.getWriter(),await this.write(t)}},async close(){await s.ready,await c()}});async function l(e){const t=e.length;t&&(await s.ready,await s.write(e),r.size+=t,i.size+=t,i.availableSize-=t)}async function c(){a.size=r.size,await s.close()}n.defineProperty(i,un,{get:()=>o})}}async function Un(e,t){if(!e.init||e.initialized)return g.resolve();await e.init(t)}function Wn(e){return t.isArray(e)&&(e=new Cn(e)),e instanceof R&&(e={readable:e}),e}function Ln(e){e.writable===Re&&typeof e.next==De&&(e=new Fn(e)),e instanceof z&&(e={writable:e});const{writable:t}=e;return t.size===Re&&(t.size=0),e instanceof Fn||n.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function On(e,t,n,i){return e.readUint8Array(t,n,i)}const In=Cn,Nn=Fn,Pn="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),Hn=256==Pn.length;function qn(e,t){return t&&"cp437"==t.trim().toLowerCase()?(e=>{if(Hn){let t="";for(let n=0;n<e.length;n++)t+=Pn[e[n]];return t}return(new y).decode(e)})(e):new y(t).decode(e)}const Bn="filename",Mn="rawFilename",Vn="comment",Kn="rawComment",Zn="uncompressedSize",Gn="compressedSize",jn="offset",Xn="diskNumberStart",Yn="lastModDate",Jn="rawLastModDate",Qn="lastAccessDate",$n="creationDate",ei=[Bn,Mn,Gn,Zn,Yn,Jn,Vn,Kn,Qn,$n,jn,Xn,Xn,"internalFileAttribute","externalFileAttribute","msDosCompatible","zip64","directory","bitFlag","encrypted","signature","filenameUTF8","commentUTF8","compressionMethod","version","versionMadeBy","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class ti{constructor(e){ei.forEach((t=>this[t]=e[t]))}}const ni="File format is not recognized",ii="End of central directory not found",ri="End of Zip64 central directory locator not found",ai="Central directory header not found",si="Local file header not found",oi="Zip64 extra field not found",li="File contains encrypted entry",ci="Encryption method not supported",di="Compression method not supported",ui="Split zip file",fi="utf-8",hi="cp437",wi=[[Zn,ye],[Gn,ye],[jn,ye],[Xn,xe]],_i={[xe]:{getValue:zi,bytes:4},[ye]:{getValue:Di,bytes:8}};class pi{constructor(e,t={}){n.assign(this,{reader:Wn(e),options:t,config:Fe()})}async*getEntriesGenerator(e={}){const t=this;let{reader:i}=t;const{config:r}=t;if(await Un(i),i.size!==Re&&i.readUint8Array||(i=new _n(await new d(i.readable).blob()),await Un(i)),i.size<Se)throw new f(ni);i.chunkSize=(e=>s.max(e.chunkSize,64))(r);const a=await(async(e,t,n)=>{const i=new h(4);return 101010256,Ti(i).setUint32(0,101010256,!0),await r(22)||await r(s.min(1048582,n));async function r(t){const r=n-t,a=await On(e,r,t);for(let e=a.length-22;e>=0;e--)if(a[e]==i[0]&&a[e+1]==i[1]&&a[e+2]==i[2]&&a[e+3]==i[3])return{offset:r+e,buffer:a.slice(e,e+22).buffer}}})(i,0,i.size);if(!a)throw 134695760==zi(Ti(await On(i,0,4)))?new f(ui):new f(ii);const o=Ti(a);let l=zi(o,12),c=zi(o,16);const u=a.offset,w=Ri(o,20),_=u+Se+w;let p=Ri(o,4);const b=i.lastDiskNumber||0;let g=Ri(o,6),m=Ri(o,8),y=0,x=0;if(c==ye||l==ye||m==xe||g==xe){const e=Ti(await On(i,a.offset-20,20));if(117853008==zi(e,0)){c=Di(e,8);let t=await On(i,c,56,-1),n=Ti(t);const r=a.offset-20-56;if(zi(n,0)!=ve&&c!=r){const e=c;c=r,y=c-e,t=await On(i,c,56,-1),n=Ti(t)}if(zi(n,0)!=ve)throw new f(ri);p==xe&&(p=zi(n,16)),g==xe&&(g=zi(n,20)),m==xe&&(m=Di(n,32)),l==ye&&(l=Di(n,40)),c-=l}}if(c<i.size||(y=i.size-c-l-Se,c=i.size-l-Se),b!=p)throw new f(ui);if(0>c)throw new f(ni);let k=0,v=await On(i,c,l,g),S=Ti(v);if(l){const e=a.offset-l;if(zi(S,k)!=ke&&c!=e){const t=c;c=e,y+=c-t,v=await On(i,c,l,g),S=Ti(v)}}const R=a.offset-c-(i.lastDiskOffset||0);if(l==R||0>R||(l=R,v=await On(i,c,l,g),S=Ti(v)),0>c||c>=i.size)throw new f(ni);const z=xi(t,e,"filenameEncoding"),D=xi(t,e,"commentEncoding");for(let a=0;m>a;a++){const o=new bi(i,r,t.options);if(zi(S,k)!=ke)throw new f(ai);gi(o,S,k+6);const l=!!o.bitFlag.languageEncodingFlag,c=k+46,d=c+o.filenameLength,u=d+o.extraFieldLength,h=Ri(S,k+4),w=!0,_=v.subarray(c,d),p=Ri(S,k+32),b=u+p,g=v.subarray(u,b),R=l,T=l,E=w&&!(16&~Si(S,k+38)),A=zi(S,k+42)+y;n.assign(o,{versionMadeBy:h,msDosCompatible:w,compressedSize:0,uncompressedSize:0,commentLength:p,directory:E,offset:A,diskNumberStart:Ri(S,k+34),internalFileAttribute:Ri(S,k+36),externalFileAttribute:zi(S,k+38),rawFilename:_,filenameUTF8:R,commentUTF8:T,rawExtraField:v.subarray(d,u)});const C=xi(t,e,"decodeText")||qn,F=R?fi:z||hi,U=T?fi:D||hi;let W=C(_,F);W===Re&&(W=qn(_,F));let L=C(g,U);L===Re&&(L=qn(g,U)),n.assign(o,{rawComment:g,filename:W,comment:L,directory:E||W.endsWith("/")}),x=s.max(A,x),await mi(o,o,S,k+6);const O=new ti(o);O.getData=(e,t)=>o.getData(e,O,t),k=b;const{onprogress:I}=e;if(I)try{await I(a+1,m,new ti(o))}catch(e){}yield O}const T=xi(t,e,"extractPrependedData"),E=xi(t,e,"extractAppendedData");return T&&(t.prependedData=x>0?await On(i,0,x):new h),t.comment=w?await On(i,u+Se,w):new h,E&&(t.appendedData=_<i.size?await On(i,_,i.size-_):new h),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class bi{constructor(e,t,i){n.assign(this,{reader:e,config:t,options:i})}async getData(e,t,i={}){const a=this,{reader:s,offset:o,diskNumberStart:l,extraFieldAES:c,compressionMethod:d,config:u,bitFlag:w,signature:_,rawLastModDate:p,uncompressedSize:b,compressedSize:m}=a,y=t.localDirectory={},x=Ti(await On(s,o,30,l));let k=xi(a,i,"password"),v=xi(a,i,"rawPassword");if(k=k&&k.length&&k,v=v&&v.length&&v,c&&99!=c.originalCompressionMethod)throw new f(di);if(0!=d&&8!=d)throw new f(di);if(67324752!=zi(x,0))throw new f(si);gi(y,x,4),y.rawExtraField=y.extraFieldLength?await On(s,o+30+y.filenameLength,y.extraFieldLength,l):new h,await mi(a,y,x,4,!0),n.assign(t,{lastAccessDate:y.lastAccessDate,creationDate:y.creationDate});const S=a.encrypted&&y.encrypted,R=S&&!c;if(S){if(!R&&c.strength===Re)throw new f(ci);if(!k&&!v)throw new f(li)}const D=o+30+y.filenameLength+y.extraFieldLength,T=m,E=s.readable;n.assign(E,{diskNumberStart:l,offset:D,size:T});const A=xi(a,i,"signal"),C=xi(a,i,"checkPasswordOnly");C&&(e=new z),e=Ln(e),await Un(e,b);const{writable:F}=e,{onstart:U,onprogress:W,onend:L}=i,O={options:{codecType:Pt,password:k,rawPassword:v,zipCrypto:R,encryptionStrength:c&&c.strength,signed:xi(a,i,"checkSignature"),passwordVerification:R&&(w.dataDescriptor?p>>>8&255:_>>>24&255),signature:_,compressed:0!=d,encrypted:S,useWebWorkers:xi(a,i,"useWebWorkers"),useCompressionStream:xi(a,i,"useCompressionStream"),transferStreams:xi(a,i,"transferStreams"),checkPasswordOnly:C},config:u,streamOptions:{signal:A,size:T,onstart:U,onprogress:W,onend:L}};let I=0;try{({outputSize:I}=await(async(e,t)=>{const{options:n,config:i}=t,{transferStreams:a,useWebWorkers:s,useCompressionStream:o,codecType:l,compressed:c,signed:d,encrypted:u}=n,{workerScripts:f,maxWorkers:h}=i;t.transferStreams=a||a===Re;const w=!(c||d||u||t.transferStreams);return t.useWebWorkers=!w&&(s||s===Re&&i.useWebWorkers),t.scripts=t.useWebWorkers&&f?f[l]:[],n.useCompressionStream=o||o===Re&&i.useCompressionStream,(await(async()=>{const n=Jt.find((e=>!e.busy));if(n)return en(n),new Mt(n,e,t,_);if(Jt.length<h){const n={indexWorker:$t};return $t++,Jt.push(n),new Mt(n,e,t,_)}return new g((n=>Qt.push({resolve:n,stream:e,workerOptions:t})))})()).run();function _(e){if(Qt.length){const[{resolve:t,stream:n,workerOptions:i}]=Qt.splice(0,1);t(new Mt(e,n,i,_))}else e.worker?(en(e),((e,t)=>{const{config:n}=t,{terminateWorkerTimeout:i}=n;r.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout((async()=>{Jt=Jt.filter((t=>t!=e));try{await e.terminate()}catch(e){}}),i))})(e,t)):Jt=Jt.filter((t=>t!=e))}})({readable:E,writable:F},O))}catch(e){if(!C||e.message!=Ze)throw e}finally{const e=xi(a,i,"preventClose");F.size+=I,e||F.locked||await F.getWriter().close()}return C?Re:e.getData?e.getData():F}}function gi(e,t,i){const r=e.rawBitFlag=Ri(t,i+2),a=!(1&~r),s=zi(t,i+6);n.assign(e,{encrypted:a,version:Ri(t,i),bitFlag:{level:(6&r)>>1,dataDescriptor:!(8&~r),languageEncodingFlag:!(2048&~r)},rawLastModDate:s,lastModDate:ki(s),filenameLength:Ri(t,i+22),extraFieldLength:Ri(t,i+24)})}async function mi(e,t,i,r,a){const{rawExtraField:s}=t,c=t.extraField=new l,d=Ti(new h(s));let u=0;try{for(;u<s.length;){const e=Ri(d,u),t=Ri(d,u+2);c.set(e,{type:e,data:s.slice(u+4,u+4+t)}),u+=4+t}}catch(e){}const w=Ri(i,r+4);n.assign(t,{signature:zi(i,r+10),uncompressedSize:zi(i,r+18),compressedSize:zi(i,r+14)});const _=c.get(1);_&&(((e,t)=>{t.zip64=!0;const n=Ti(e.data),i=wi.filter((([e,n])=>t[e]==n));for(let r=0,a=0;r<i.length;r++){const[s,o]=i[r];if(t[s]==o){const i=_i[o];t[s]=e[s]=i.getValue(n,a),a+=i.bytes}else if(e[s])throw new f(oi)}})(_,t),t.extraFieldZip64=_);const p=c.get(28789);p&&(await yi(p,Bn,Mn,t,e),t.extraFieldUnicodePath=p);const b=c.get(25461);b&&(await yi(b,Vn,Kn,t,e),t.extraFieldUnicodeComment=b);const g=c.get(39169);g?(((e,t,i)=>{const r=Ti(e.data),a=Si(r,4);n.assign(e,{vendorVersion:Si(r,0),vendorId:Si(r,2),strength:a,originalCompressionMethod:i,compressionMethod:Ri(r,5)}),t.compressionMethod=e.compressionMethod})(g,t,w),t.extraFieldAES=g):t.compressionMethod=w;const m=c.get(10);m&&(((e,t)=>{const i=Ti(e.data);let r,a=4;try{for(;a<e.data.length&&!r;){const t=Ri(i,a),n=Ri(i,a+2);1==t&&(r=e.data.slice(a+4,a+4+n)),a+=4+n}}catch(e){}try{if(r&&24==r.length){const i=Ti(r),a=i.getBigUint64(0,!0),s=i.getBigUint64(8,!0),o=i.getBigUint64(16,!0);n.assign(e,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:o});const l={lastModDate:vi(a),lastAccessDate:vi(s),creationDate:vi(o)};n.assign(e,l),n.assign(t,l)}}catch(e){}})(m,t),t.extraFieldNTFS=m);const y=c.get(21589);y&&(((e,t,n)=>{const i=Ti(e.data),r=Si(i,0),a=[],s=[];n?(1&~r||(a.push(Yn),s.push(Jn)),2&~r||(a.push(Qn),s.push("rawLastAccessDate")),4&~r||(a.push($n),s.push("rawCreationDate"))):5>e.data.length||(a.push(Yn),s.push(Jn));let l=1;a.forEach(((n,r)=>{if(e.data.length>=l+4){const a=zi(i,l);t[n]=e[n]=new o(1e3*a);const c=s[r];e[c]=a}l+=4}))})(y,t,a),t.extraFieldExtendedTimestamp=y);const x=c.get(6534);x&&(t.extraFieldUSDZ=x)}async function yi(e,t,i,r,a){const s=Ti(e.data),o=new Oe;o.append(a[i]);const l=Ti(new h(4));l.setUint32(0,o.get(),!0);const c=zi(s,1);n.assign(e,{version:Si(s,0),[t]:qn(e.data.subarray(5)),valid:!a.bitFlag.languageEncodingFlag&&c==zi(l,0)}),e.valid&&(r[t]=e[t],r[t+"UTF8"]=!0)}function xi(e,t,n){return t[n]===Re?e.options[n]:t[n]}function ki(e){const t=(4294901760&e)>>16,n=65535&e;try{return new o(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}catch(e){}}function vi(e){return new o(r(e/a(1e4)-a(116444736e5)))}function Si(e,t){return e.getUint8(t)}function Ri(e,t){return e.getUint16(t,!0)}function zi(e,t){return e.getUint32(t,!0)}function Di(e,t){return r(e.getBigUint64(t,!0))}function Ti(e){return new p(e.buffer)}Ue({Inflate:function(e){const t=new me,n=e&&e.chunkSize?s.floor(2*e.chunkSize):131072,i=new h(n);let r=!1;t.inflateInit(),t.next_out=i,this.append=(e,a)=>{const s=[];let o,l,c=0,d=0,u=0;if(0!==e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=n,0!==t.avail_in||r||(t.next_in_index=0,r=!0),o=t.inflate(0),r&&o===O){if(0!==t.avail_in)throw new f("inflating: bad input")}else if(o!==C&&o!==F)throw new f("inflating: "+t.msg);if((r||o===F)&&t.avail_in===e.length)throw new f("inflating: bad input");t.next_out_index&&(t.next_out_index===n?s.push(new h(i)):s.push(i.subarray(0,t.next_out_index))),u+=t.next_out_index,a&&t.next_in_index>0&&t.next_in_index!=c&&(a(t.next_in_index),c=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return s.length>1?(l=new h(u),s.forEach((e=>{l.set(e,d),d+=e.length}))):l=s[0]?new h(s[0]):new h,l}},this.flush=()=>{t.inflateEnd()}}}),e.BlobReader=_n,e.BlobWriter=pn,e.Data64URIReader=class extends hn{constructor(e){super();let t=e.length;for(;"="==e.charAt(t-1);)t--;const i=e.indexOf(",")+1;n.assign(this,{dataURI:e,dataStart:i,size:s.floor(.75*(t-i))})}readUint8Array(e,t){const{dataStart:n,dataURI:i}=this,r=new h(t),a=4*s.floor(e/3),o=atob(i.substring(a+n,4*s.ceil((e+t)/3)+n)),l=e-3*s.floor(a/4);for(let e=l;l+t>e;e++)r[e-l]=o.charCodeAt(e);return r}},e.Data64URIWriter=class extends wn{constructor(e){super(),n.assign(this,{data:"data:"+(e||"")+";base64,",pending:[]})}writeUint8Array(e){const t=this;let n=0,r=t.pending;const a=t.pending.length;for(t.pending="",n=0;n<3*s.floor((a+e.length)/3)-a;n++)r+=i.fromCharCode(e[n]);for(;n<e.length;n++)t.pending+=i.fromCharCode(e[n]);r.length>2?t.data+=v(r):t.pending=r}getData(){return this.data+v(this.pending)}},e.ERR_BAD_FORMAT=ni,e.ERR_CENTRAL_DIRECTORY_NOT_FOUND=ai,e.ERR_ENCRYPTED=li,e.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=ri,e.ERR_EOCDR_NOT_FOUND=ii,e.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=oi,e.ERR_HTTP_RANGE=nn,e.ERR_INVALID_PASSWORD=Ve,e.ERR_INVALID_SIGNATURE=Ke,e.ERR_ITERATOR_COMPLETED_TOO_SOON=rn,e.ERR_LOCAL_FILE_HEADER_NOT_FOUND=si,e.ERR_SPLIT_ZIP_FILE=ui,e.ERR_UNSUPPORTED_COMPRESSION=di,e.ERR_UNSUPPORTED_ENCRYPTION=ci,e.HttpRangeReader=class extends An{constructor(e,t={}){t.useRangeHeader=!0,super(e,t)}},e.HttpReader=An,e.Reader=hn,e.SplitDataReader=Cn,e.SplitDataWriter=Fn,e.SplitZipReader=In,e.SplitZipWriter=Nn,e.TextReader=class extends _n{constructor(e){super(new b([e],{type:"text/plain"}))}},e.TextWriter=class extends pn{constructor(e){super(e),n.assign(this,{encoding:e,utf8:!e||"utf-8"==e.toLowerCase()})}async getData(){const{encoding:e,utf8:t}=this,i=await super.getData();if(i.text&&t)return i.text();{const t=new FileReader;return new g(((r,a)=>{n.assign(t,{onload:({target:e})=>r(e.result),onerror:()=>a(t.error)}),t.readAsText(i,e)}))}}},e.Uint8ArrayReader=class extends hn{constructor(e){super(),n.assign(this,{array:e,size:e.length})}readUint8Array(e,t){return this.array.slice(e,e+t)}},e.Uint8ArrayWriter=class extends wn{init(e=0){n.assign(this,{offset:0,array:new h(e)}),super.init()}writeUint8Array(e){const t=this;if(t.offset+e.length>t.array.length){const n=t.array;t.array=new h(n.length+e.length),t.array.set(n)}t.array.set(e,t.offset),t.offset+=e.length}getData(){return this.array}},e.Writer=wn,e.ZipReader=pi,e.ZipReaderStream=class{constructor(e={}){const{readable:t,writable:n}=new S,i=new pi(t,e).getEntriesGenerator();this.readable=new R({async pull(e){const{done:t,value:n}=await i.next();if(t)return e.close();const r={...n,readable:(()=>{const{readable:e,writable:t}=new S;if(n.getData)return n.getData(t),e})()};delete r.getData,e.enqueue(r)}}),this.writable=n}},e.configure=Ue,e.getMimeType=()=>"application/octet-stream",e.initReader=Wn,e.initStream=Un,e.initWriter=Ln,e.readUint8Array=On,e.terminateWorkers=async()=>{await g.allSettled(Jt.map((e=>(en(e),e.terminate()))))}})); | ||
((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).zip={})})(this,(function(e){"use strict";const{Array:t,Object:n,String:i,Number:r,BigInt:a,Math:s,Date:o,Map:l,Set:c,Response:d,URL:u,Error:f,Uint8Array:h,Uint16Array:w,Uint32Array:_,DataView:p,Blob:b,Promise:g,TextEncoder:m,TextDecoder:y,document:x,crypto:k,btoa:v,TransformStream:S,ReadableStream:R,WritableStream:z,CompressionStream:D,DecompressionStream:T,navigator:E,Worker:A}="undefined"!=typeof globalThis?globalThis:this||self,C=0,F=1,U=-2,W=-3,L=-4,O=-5,I=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],N=1440,P=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],H=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],q=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],B=[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,112,112],M=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],V=[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],K=15;function Z(){let e,t,n,i,r,a;function s(e,t,s,o,l,c,d,u,f,h,w){let _,p,b,g,m,y,x,k,v,S,R,z,D,T,E;S=0,m=s;do{n[e[t+S]]++,S++,m--}while(0!==m);if(n[0]==s)return d[0]=-1,u[0]=0,C;for(k=u[0],y=1;K>=y&&0===n[y];y++);for(x=y,y>k&&(k=y),m=K;0!==m&&0===n[m];m--);for(b=m,k>m&&(k=m),u[0]=k,T=1<<y;m>y;y++,T<<=1)if(0>(T-=n[y]))return W;if(0>(T-=n[m]))return W;for(n[m]+=T,a[1]=y=0,S=1,D=2;0!=--m;)a[D]=y+=n[S],D++,S++;m=0,S=0;do{0!==(y=e[t+S])&&(w[a[y]++]=m),S++}while(++m<s);for(s=a[b],a[0]=m=0,S=0,g=-1,z=-k,r[0]=0,R=0,E=0;b>=x;x++)for(_=n[x];0!=_--;){for(;x>z+k;){if(g++,z+=k,E=b-z,E=E>k?k:E,(p=1<<(y=x-z))>_+1&&(p-=_+1,D=x,E>y))for(;++y<E&&(p<<=1)>n[++D];)p-=n[D];if(E=1<<y,h[0]+E>N)return W;r[g]=R=h[0],h[0]+=E,0!==g?(a[g]=m,i[0]=y,i[1]=k,y=m>>>z-k,i[2]=R-r[g-1]-y,f.set(i,3*(r[g-1]+y))):d[0]=R}for(i[1]=x-z,s>S?w[S]<o?(i[0]=256>w[S]?0:96,i[2]=w[S++]):(i[0]=c[w[S]-o]+16+64,i[2]=l[w[S++]-o]):i[0]=192,p=1<<x-z,y=m>>>z;E>y;y+=p)f.set(i,3*(R+y));for(y=1<<x-1;m&y;y>>>=1)m^=y;for(m^=y,v=(1<<z)-1;(m&v)!=a[g];)g--,z-=k,v=(1<<z)-1}return 0!==T&&1!=b?O:C}function o(s){let o;for(e||(e=[],t=[],n=new Int32Array(K+1),i=[],r=new Int32Array(K),a=new Int32Array(K+1)),t.length<s&&(t=[]),o=0;s>o;o++)t[o]=0;for(o=0;K+1>o;o++)n[o]=0;for(o=0;3>o;o++)i[o]=0;r.set(n.subarray(0,K),0),a.set(n.subarray(0,K+1),0)}this.inflate_trees_bits=(n,i,r,a,l)=>{let c;return o(19),e[0]=0,c=s(n,0,19,19,null,null,r,i,a,e,t),c==W?l.msg="oversubscribed dynamic bit lengths tree":c!=O&&0!==i[0]||(l.msg="incomplete dynamic bit lengths tree",c=W),c},this.inflate_trees_dynamic=(n,i,r,a,l,c,d,u,f)=>{let h;return o(288),e[0]=0,h=s(r,0,n,257,q,B,c,a,u,e,t),h!=C||0===a[0]?(h==W?f.msg="oversubscribed literal/length tree":h!=L&&(f.msg="incomplete literal/length tree",h=W),h):(o(288),h=s(r,n,i,0,M,V,d,l,u,e,t),h!=C||0===l[0]&&n>257?(h==W?f.msg="oversubscribed distance tree":h==O?(f.msg="incomplete distance tree",h=W):h!=L&&(f.msg="empty distance tree with lengths",h=W),h):C)}}Z.inflate_trees_fixed=(e,t,n,i)=>(e[0]=9,t[0]=5,n[0]=P,i[0]=H,C);const G=0,j=1,X=2,Y=3,J=4,Q=5,$=6,ee=7,te=8,ne=9;function ie(){const e=this;let t,n,i,r,a=0,s=0,o=0,l=0,c=0,d=0,u=0,f=0,h=0,w=0;function _(e,t,n,i,r,a,s,o){let l,c,d,u,f,h,w,_,p,b,g,m,y,x,k,v;w=o.next_in_index,_=o.avail_in,f=s.bitb,h=s.bitk,p=s.write,b=p<s.read?s.read-p-1:s.end-p,g=I[e],m=I[t];do{for(;20>h;)_--,f|=(255&o.read_byte(w++))<<h,h+=8;if(l=f&g,c=n,d=i,v=3*(d+l),0!==(u=c[v]))for(;;){if(f>>=c[v+1],h-=c[v+1],16&u){for(u&=15,y=c[v+2]+(f&I[u]),f>>=u,h-=u;15>h;)_--,f|=(255&o.read_byte(w++))<<h,h+=8;for(l=f&m,c=r,d=a,v=3*(d+l),u=c[v];;){if(f>>=c[v+1],h-=c[v+1],16&u){for(u&=15;u>h;)_--,f|=(255&o.read_byte(w++))<<h,h+=8;if(x=c[v+2]+(f&I[u]),f>>=u,h-=u,b-=y,x>p){k=p-x;do{k+=s.end}while(0>k);if(u=s.end-k,y>u){if(y-=u,p-k>0&&u>p-k)do{s.win[p++]=s.win[k++]}while(0!=--u);else s.win.set(s.win.subarray(k,k+u),p),p+=u,k+=u,u=0;k=0}}else k=p-x,p-k>0&&2>p-k?(s.win[p++]=s.win[k++],s.win[p++]=s.win[k++],y-=2):(s.win.set(s.win.subarray(k,k+2),p),p+=2,k+=2,y-=2);if(p-k>0&&y>p-k)do{s.win[p++]=s.win[k++]}while(0!=--y);else s.win.set(s.win.subarray(k,k+y),p),p+=y,k+=y,y=0;break}if(64&u)return o.msg="invalid distance code",y=o.avail_in-_,y=y>h>>3?h>>3:y,_+=y,w-=y,h-=y<<3,s.bitb=f,s.bitk=h,o.avail_in=_,o.total_in+=w-o.next_in_index,o.next_in_index=w,s.write=p,W;l+=c[v+2],l+=f&I[u],v=3*(d+l),u=c[v]}break}if(64&u)return 32&u?(y=o.avail_in-_,y=y>h>>3?h>>3:y,_+=y,w-=y,h-=y<<3,s.bitb=f,s.bitk=h,o.avail_in=_,o.total_in+=w-o.next_in_index,o.next_in_index=w,s.write=p,F):(o.msg="invalid literal/length code",y=o.avail_in-_,y=y>h>>3?h>>3:y,_+=y,w-=y,h-=y<<3,s.bitb=f,s.bitk=h,o.avail_in=_,o.total_in+=w-o.next_in_index,o.next_in_index=w,s.write=p,W);if(l+=c[v+2],l+=f&I[u],v=3*(d+l),0===(u=c[v])){f>>=c[v+1],h-=c[v+1],s.win[p++]=c[v+2],b--;break}}else f>>=c[v+1],h-=c[v+1],s.win[p++]=c[v+2],b--}while(b>=258&&_>=10);return y=o.avail_in-_,y=y>h>>3?h>>3:y,_+=y,w-=y,h-=y<<3,s.bitb=f,s.bitk=h,o.avail_in=_,o.total_in+=w-o.next_in_index,o.next_in_index=w,s.write=p,C}e.init=(e,a,s,o,l,c)=>{t=G,u=e,f=a,i=s,h=o,r=l,w=c,n=null},e.proc=(e,p,b)=>{let g,m,y,x,k,v,S,R=0,z=0,D=0;for(D=p.next_in_index,x=p.avail_in,R=e.bitb,z=e.bitk,k=e.write,v=k<e.read?e.read-k-1:e.end-k;;)switch(t){case G:if(v>=258&&x>=10&&(e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,b=_(u,f,i,h,r,w,e,p),D=p.next_in_index,x=p.avail_in,R=e.bitb,z=e.bitk,k=e.write,v=k<e.read?e.read-k-1:e.end-k,b!=C)){t=b==F?ee:ne;break}o=u,n=i,s=h,t=j;case j:for(g=o;g>z;){if(0===x)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,x--,R|=(255&p.read_byte(D++))<<z,z+=8}if(m=3*(s+(R&I[g])),R>>>=n[m+1],z-=n[m+1],y=n[m],0===y){l=n[m+2],t=$;break}if(16&y){c=15&y,a=n[m+2],t=X;break}if(!(64&y)){o=y,s=m/3+n[m+2];break}if(32&y){t=ee;break}return t=ne,p.msg="invalid literal/length code",b=W,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);case X:for(g=c;g>z;){if(0===x)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,x--,R|=(255&p.read_byte(D++))<<z,z+=8}a+=R&I[g],R>>=g,z-=g,o=f,n=r,s=w,t=Y;case Y:for(g=o;g>z;){if(0===x)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,x--,R|=(255&p.read_byte(D++))<<z,z+=8}if(m=3*(s+(R&I[g])),R>>=n[m+1],z-=n[m+1],y=n[m],16&y){c=15&y,d=n[m+2],t=J;break}if(!(64&y)){o=y,s=m/3+n[m+2];break}return t=ne,p.msg="invalid distance code",b=W,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);case J:for(g=c;g>z;){if(0===x)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,x--,R|=(255&p.read_byte(D++))<<z,z+=8}d+=R&I[g],R>>=g,z-=g,t=Q;case Q:for(S=k-d;0>S;)S+=e.end;for(;0!==a;){if(0===v&&(k==e.end&&0!==e.read&&(k=0,v=k<e.read?e.read-k-1:e.end-k),0===v&&(e.write=k,b=e.inflate_flush(p,b),k=e.write,v=k<e.read?e.read-k-1:e.end-k,k==e.end&&0!==e.read&&(k=0,v=k<e.read?e.read-k-1:e.end-k),0===v)))return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);e.win[k++]=e.win[S++],v--,S==e.end&&(S=0),a--}t=G;break;case $:if(0===v&&(k==e.end&&0!==e.read&&(k=0,v=k<e.read?e.read-k-1:e.end-k),0===v&&(e.write=k,b=e.inflate_flush(p,b),k=e.write,v=k<e.read?e.read-k-1:e.end-k,k==e.end&&0!==e.read&&(k=0,v=k<e.read?e.read-k-1:e.end-k),0===v)))return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);b=C,e.win[k++]=l,v--,t=G;break;case ee:if(z>7&&(z-=8,x++,D--),e.write=k,b=e.inflate_flush(p,b),k=e.write,v=k<e.read?e.read-k-1:e.end-k,e.read!=e.write)return e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);t=te;case te:return b=F,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);case ne:return b=W,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b);default:return b=U,e.bitb=R,e.bitk=z,p.avail_in=x,p.total_in+=D-p.next_in_index,p.next_in_index=D,e.write=k,e.inflate_flush(p,b)}},e.free=()=>{}}const re=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ae=0,se=1,oe=2,le=3,ce=4,de=5,ue=6,fe=7,he=8,we=9;function _e(e,t){const n=this;let i,r=ae,a=0,s=0,o=0;const l=[0],c=[0],d=new ie;let u=0,f=new Int32Array(3*N);const w=new Z;n.bitk=0,n.bitb=0,n.win=new h(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),r==ue&&d.free(e),r=ae,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=(e,t)=>{let i,r,a;return r=e.next_out_index,a=n.read,i=(a>n.write?n.end:n.write)-a,i>e.avail_out&&(i=e.avail_out),0!==i&&t==O&&(t=C),e.avail_out-=i,e.total_out+=i,e.next_out.set(n.win.subarray(a,a+i),r),r+=i,a+=i,a==n.end&&(a=0,n.write==n.end&&(n.write=0),i=n.write-a,i>e.avail_out&&(i=e.avail_out),0!==i&&t==O&&(t=C),e.avail_out-=i,e.total_out+=i,e.next_out.set(n.win.subarray(a,a+i),r),r+=i,a+=i),e.next_out_index=r,n.read=a,t},n.proc=(e,t)=>{let h,_,p,b,g,m,y,x;for(b=e.next_in_index,g=e.avail_in,_=n.bitb,p=n.bitk,m=n.write,y=m<n.read?n.read-m-1:n.end-m;;){let k,v,S,R,z,D,T,E;switch(r){case ae:for(;3>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}switch(h=7&_,u=1&h,h>>>1){case 0:_>>>=3,p-=3,h=7&p,_>>>=h,p-=h,r=se;break;case 1:k=[],v=[],S=[[]],R=[[]],Z.inflate_trees_fixed(k,v,S,R),d.init(k[0],v[0],S[0],0,R[0],0),_>>>=3,p-=3,r=ue;break;case 2:_>>>=3,p-=3,r=le;break;case 3:return _>>>=3,p-=3,r=we,e.msg="invalid block type",t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t)}break;case se:for(;32>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}if((~_>>>16&65535)!=(65535&_))return r=we,e.msg="invalid stored block lengths",t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);a=65535&_,_=p=0,r=0!==a?oe:0!==u?fe:ae;break;case oe:if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);if(0===y&&(m==n.end&&0!==n.read&&(m=0,y=m<n.read?n.read-m-1:n.end-m),0===y&&(n.write=m,t=n.inflate_flush(e,t),m=n.write,y=m<n.read?n.read-m-1:n.end-m,m==n.end&&0!==n.read&&(m=0,y=m<n.read?n.read-m-1:n.end-m),0===y)))return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);if(t=C,h=a,h>g&&(h=g),h>y&&(h=y),n.win.set(e.read_buf(b,h),m),b+=h,g-=h,m+=h,y-=h,0!=(a-=h))break;r=0!==u?fe:ae;break;case le:for(;14>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}if(s=h=16383&_,(31&h)>29||(h>>5&31)>29)return r=we,e.msg="too many length or distance symbols",t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);if(h=258+(31&h)+(h>>5&31),!i||i.length<h)i=[];else for(x=0;h>x;x++)i[x]=0;_>>>=14,p-=14,o=0,r=ce;case ce:for(;4+(s>>>10)>o;){for(;3>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}i[re[o++]]=7&_,_>>>=3,p-=3}for(;19>o;)i[re[o++]]=0;if(l[0]=7,h=w.inflate_trees_bits(i,l,c,f,e),h!=C)return(t=h)==W&&(i=null,r=we),n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);o=0,r=de;case de:for(;h=s,258+(31&h)+(h>>5&31)>o;){let a,d;for(h=l[0];h>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}if(h=f[3*(c[0]+(_&I[h]))+1],d=f[3*(c[0]+(_&I[h]))+2],16>d)_>>>=h,p-=h,i[o++]=d;else{for(x=18==d?7:d-14,a=18==d?11:3;h+x>p;){if(0===g)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);t=C,g--,_|=(255&e.read_byte(b++))<<p,p+=8}if(_>>>=h,p-=h,a+=_&I[x],_>>>=x,p-=x,x=o,h=s,x+a>258+(31&h)+(h>>5&31)||16==d&&1>x)return i=null,r=we,e.msg="invalid bit length repeat",t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);d=16==d?i[x-1]:0;do{i[x++]=d}while(0!=--a);o=x}}if(c[0]=-1,z=[],D=[],T=[],E=[],z[0]=9,D[0]=6,h=s,h=w.inflate_trees_dynamic(257+(31&h),1+(h>>5&31),i,z,D,T,E,f,e),h!=C)return h==W&&(i=null,r=we),t=h,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);d.init(z[0],D[0],f,T[0],f,E[0]),r=ue;case ue:if(n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,(t=d.proc(n,e,t))!=F)return n.inflate_flush(e,t);if(t=C,d.free(e),b=e.next_in_index,g=e.avail_in,_=n.bitb,p=n.bitk,m=n.write,y=m<n.read?n.read-m-1:n.end-m,0===u){r=ae;break}r=fe;case fe:if(n.write=m,t=n.inflate_flush(e,t),m=n.write,y=m<n.read?n.read-m-1:n.end-m,n.read!=n.write)return n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);r=he;case he:return t=F,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);case we:return t=W,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t);default:return t=U,n.bitb=_,n.bitk=p,e.avail_in=g,e.total_in+=b-e.next_in_index,e.next_in_index=b,n.write=m,n.inflate_flush(e,t)}}},n.free=e=>{n.reset(e,null),n.win=null,f=null},n.set_dictionary=(e,t,i)=>{n.win.set(e.subarray(t,t+i),0),n.read=n.write=i},n.sync_point=()=>r==se?1:0}const pe=13,be=[0,0,255,255];function ge(){const e=this;function t(e){return e&&e.istate?(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=7,e.istate.blocks.reset(e,null),C):U}e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0,e.inflateEnd=t=>(e.blocks&&e.blocks.free(t),e.blocks=null,C),e.inflateInit=(n,i)=>(n.msg=null,e.blocks=null,8>i||i>15?(e.inflateEnd(n),U):(e.wbits=i,n.istate.blocks=new _e(n,1<<i),t(n),C)),e.inflate=(e,t)=>{let n,i;if(!e||!e.istate||!e.next_in)return U;const r=e.istate;for(t=4==t?O:C,n=O;;)switch(r.mode){case 0:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,8!=(15&(r.method=e.read_byte(e.next_in_index++)))){r.mode=pe,e.msg="unknown compression method",r.marker=5;break}if(8+(r.method>>4)>r.wbits){r.mode=pe,e.msg="invalid win size",r.marker=5;break}r.mode=1;case 1:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,i=255&e.read_byte(e.next_in_index++),((r.method<<8)+i)%31!=0){r.mode=pe,e.msg="incorrect header check",r.marker=5;break}if(!(32&i)){r.mode=7;break}r.mode=2;case 2:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need=(255&e.read_byte(e.next_in_index++))<<24&4278190080,r.mode=3;case 3:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need+=(255&e.read_byte(e.next_in_index++))<<16&16711680,r.mode=4;case 4:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need+=(255&e.read_byte(e.next_in_index++))<<8&65280,r.mode=5;case 5:return 0===e.avail_in?n:(n=t,e.avail_in--,e.total_in++,r.need+=255&e.read_byte(e.next_in_index++),r.mode=6,2);case 6:return r.mode=pe,e.msg="need dictionary",r.marker=0,U;case 7:if(n=r.blocks.proc(e,n),n==W){r.mode=pe,r.marker=0;break}if(n==C&&(n=t),n!=F)return n;n=t,r.blocks.reset(e,r.was),r.mode=12;case 12:return e.avail_in=0,F;case pe:return W;default:return U}},e.inflateSetDictionary=(e,t,n)=>{let i=0,r=n;if(!e||!e.istate||6!=e.istate.mode)return U;const a=e.istate;return r<1<<a.wbits||(r=(1<<a.wbits)-1,i=n-r),a.blocks.set_dictionary(t,i,r),a.mode=7,C},e.inflateSync=e=>{let n,i,r,a,s;if(!e||!e.istate)return U;const o=e.istate;if(o.mode!=pe&&(o.mode=pe,o.marker=0),0===(n=e.avail_in))return O;for(i=e.next_in_index,r=o.marker;0!==n&&4>r;)e.read_byte(i)==be[r]?r++:r=0!==e.read_byte(i)?0:4-r,i++,n--;return e.total_in+=i-e.next_in_index,e.next_in_index=i,e.avail_in=n,o.marker=r,4!=r?W:(a=e.total_in,s=e.total_out,t(e),e.total_in=a,e.total_out=s,o.mode=7,C)},e.inflateSyncPoint=e=>e&&e.istate&&e.istate.blocks?e.istate.blocks.sync_point():U}function me(){}me.prototype={inflateInit(e){const t=this;return t.istate=new ge,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){const t=this;return t.istate?t.istate.inflate(t,e):U},inflateEnd(){const e=this;if(!e.istate)return U;const t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){const e=this;return e.istate?e.istate.inflateSync(e):U},inflateSetDictionary(e,t){const n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):U},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};const ye=4294967295,xe=65535,ke=33639248,ve=101075792,Se=22,Re=void 0,ze="undefined",De="function";class Te{constructor(e){return class extends S{constructor(t,n){const i=new e(n);super({transform(e,t){t.enqueue(i.append(e))},flush(e){const t=i.flush();t&&e.enqueue(t)}})}}}}let Ee=2;try{typeof E!=ze&&E.hardwareConcurrency&&(Ee=E.hardwareConcurrency)}catch(e){}const Ae={chunkSize:524288,maxWorkers:Ee,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Re,CompressionStreamNative:typeof D!=ze&&D,DecompressionStreamNative:typeof T!=ze&&T},Ce=n.assign({},Ae);function Fe(){return Ce}function Ue(e){const{baseURL:n,chunkSize:i,maxWorkers:r,terminateWorkerTimeout:a,useCompressionStream:s,useWebWorkers:o,Deflate:l,Inflate:c,CompressionStream:d,DecompressionStream:u,workerScripts:h}=e;if(We("baseURL",n),We("chunkSize",i),We("maxWorkers",r),We("terminateWorkerTimeout",a),We("useCompressionStream",s),We("useWebWorkers",o),l&&(Ce.CompressionStream=new Te(l)),c&&(Ce.DecompressionStream=new Te(c)),We("CompressionStream",d),We("DecompressionStream",u),h!==Re){const{deflate:e,inflate:n}=h;if((e||n)&&(Ce.workerScripts||(Ce.workerScripts={})),e){if(!t.isArray(e))throw new f("workerScripts.deflate must be an array");Ce.workerScripts.deflate=e}if(n){if(!t.isArray(n))throw new f("workerScripts.inflate must be an array");Ce.workerScripts.inflate=n}}}function We(e,t){t!==Re&&(Ce[e]=t)}const Le=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;Le[e]=t}class Oe{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,i=0|e.length;i>n;n++)t=t>>>8^Le[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class Ie extends S{constructor(){let e;const t=new Oe;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new h(4);new p(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const Ne={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],i=Ne.getPartial(n);return 32===i?e.concat(t):Ne._shiftRight(t,i,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+Ne.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,s.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=Ne.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>s.round(e/1099511627776)||32,_shiftRight(e,t,n,i){for(void 0===i&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(0===t)return i.concat(e);for(let r=0;r<e.length;r++)i.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=Ne.getPartial(r);return i.push(Ne.partial(t+a&31,t+a>32?n:i.pop(),1)),i}},Pe={bytes:{fromBits(e){const t=Ne.bitLength(e)/8,n=new h(t);let i;for(let r=0;t>r;r++)3&r||(i=e[r/4]),n[r]=i>>>24,i<<=8;return n},toBits(e){const t=[];let n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],3&~n||(t.push(i),i=0);return 3&n&&t.push(Ne.partial(8*(3&n),i)),t}}},He=class{constructor(e){const t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){const e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){const t=this;"string"==typeof e&&(e=Pe.utf8String.toBits(e));const n=t._buffer=Ne.concat(t._buffer,e),i=t._length,r=t._length=i+Ne.bitLength(e);if(r>9007199254740991)throw new f("Cannot hash more than 2^53 - 1 bits");const a=new _(n);let s=0;for(let e=t.blockSize+i-(t.blockSize+i&t.blockSize-1);r>=e;e+=t.blockSize)t._block(a.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){const e=this;let t=e._buffer;const n=e._h;t=Ne.concat(t,[Ne.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(s.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){return e>19?e>39?e>59?e>79?void 0:t^n^i:t&n|t&i|n&i:t^n^i:t&n|~t&i}_S(e,t){return t<<e|t>>>32-e}_block(e){const n=this,i=n._h,r=t(80);for(let t=0;16>t;t++)r[t]=e[t];let a=i[0],o=i[1],l=i[2],c=i[3],d=i[4];for(let e=0;79>=e;e++){16>e||(r[e]=n._S(1,r[e-3]^r[e-8]^r[e-14]^r[e-16]));const t=n._S(5,a)+n._f(e,o,l,c)+d+r[e]+n._key[s.floor(e/20)]|0;d=c,c=l,l=n._S(30,o),o=a,a=t}i[0]=i[0]+a|0,i[1]=i[1]+o|0,i[2]=i[2]+l|0,i[3]=i[3]+c|0,i[4]=i[4]+d|0}},qe={getRandomValues(e){const t=new _(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let i,r=0;r<e.length;r+=4){const e=n(4294967296*(i||s.random()));i=987654071*e(),t[r/4]=4294967296*e()|0}return e}},Be={importKey:e=>new Be.hmacSha1(Pe.bytes.toBits(e)),pbkdf2(e,t,n,i){if(n=n||1e4,0>i||0>n)throw new f("invalid params to pbkdf2");const r=1+(i>>5)<<2;let a,s,o,l,c;const d=new ArrayBuffer(r),u=new p(d);let h=0;const w=Ne;for(t=Pe.bytes.toBits(t),c=1;(r||1)>h;c++){for(a=s=e.encrypt(w.concat(t,[c])),o=1;n>o;o++)for(s=e.encrypt(s),l=0;l<s.length;l++)a[l]^=s[l];for(o=0;(r||1)>h&&o<a.length;o++)u.setInt32(h,a[o]),h+=4}return d.slice(0,i/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=He,i=[[],[]];t._baseHash=[new n,new n];const r=t._baseHash[0].blockSize/32;e.length>r&&(e=(new n).update(e).finalize());for(let t=0;r>t;t++)i[0][t]=909522486^e[t],i[1][t]=1549556828^e[t];t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new f("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},Me=typeof k!=ze&&typeof k.getRandomValues==De,Ve="Invalid password",Ke="Invalid signature",Ze="zipjs-abort-check-password";function Ge(e){return Me?k.getRandomValues(e):qe.getRandomValues(e)}const je=16,Xe={name:"PBKDF2"},Ye=n.assign({hash:{name:"HMAC"}},Xe),Je=n.assign({iterations:1e3,hash:{name:"SHA-1"}},Xe),Qe=["deriveBits"],$e=[8,12,16],et=[16,24,32],tt=10,nt=[0,0,0,0],it=typeof k!=ze,rt=it&&k.subtle,at=it&&typeof rt!=ze,st=Pe.bytes,ot=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],i=t._tables[1],r=e.length;let a,s,o,l=1;if(4!==r&&6!==r&&8!==r)throw new f("invalid aes key size");for(t._key=[s=e.slice(0),o=[]],a=r;4*r+28>a;a++){let e=s[a-1];(a%r==0||8===r&&a%r==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],a%r==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),s[a]=s[a-r]^e}for(let e=0;a;e++,a--){const t=s[3&e?a:a-4];o[e]=4>=a||4>e?t:i[0][n[t>>>24]]^i[1][n[t>>16&255]]^i[2][n[t>>8&255]]^i[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],a=[];let s,o,l,c;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let d=s=0;!n[d];d^=o||1,s=a[s]||1){let a=s^s<<1^s<<2^s<<3^s<<4;a=a>>8^255&a^99,n[d]=a,i[a]=d,c=r[l=r[o=r[d]]];let u=16843009*c^65537*l^257*o^16843008*d,f=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][d]=f=f<<24^f>>>8,t[n][a]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new f("invalid aes block size");const n=this._key[t],i=n.length/4-2,r=[0,0,0,0],a=this._tables[t],s=a[0],o=a[1],l=a[2],c=a[3],d=a[4];let u,h,w,_=e[0]^n[0],p=e[t?3:1]^n[1],b=e[2]^n[2],g=e[t?1:3]^n[3],m=4;for(let e=0;i>e;e++)u=s[_>>>24]^o[p>>16&255]^l[b>>8&255]^c[255&g]^n[m],h=s[p>>>24]^o[b>>16&255]^l[g>>8&255]^c[255&_]^n[m+1],w=s[b>>>24]^o[g>>16&255]^l[_>>8&255]^c[255&p]^n[m+2],g=s[g>>>24]^o[_>>16&255]^l[p>>8&255]^c[255&b]^n[m+3],m+=4,_=u,p=h,b=w;for(let e=0;4>e;e++)r[t?3&-e:e]=d[_>>>24]<<24^d[p>>16&255]<<16^d[b>>8&255]<<8^d[255&g]^n[m++],u=_,_=p,p=b,b=g,g=u;return r}},lt=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,i=255&e;255===t?(t=0,255===n?(n=0,255===i?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];const r=Ne.bitLength(t);for(let r=0;i>r;r+=4){this.incCounter(n);const i=e.encrypt(n);t[r]^=i[0],t[r+1]^=i[1],t[r+2]^=i[2],t[r+3]^=i[3]}return Ne.clamp(t,r)}},ct=Be.hmacSha1;let dt=it&&at&&typeof rt.importKey==De,ut=it&&at&&typeof rt.deriveBits==De;class ft extends S{constructor({password:e,rawPassword:t,signed:i,encryptionStrength:r,checkPasswordOnly:a}){super({start(){n.assign(this,{ready:new g((e=>this.resolveReady=e)),password:pt(e,t),signed:i,strength:r-1,pending:new h})},async transform(e,t){const n=this,{password:i,strength:r,resolveReady:s,ready:o}=n;i?(await(async(e,t,n,i)=>{const r=await _t(e,t,n,gt(i,0,$e[t])),a=gt(i,$e[t]);if(r[0]!=a[0]||r[1]!=a[1])throw new f(Ve)})(n,r,i,gt(e,0,$e[r]+2)),e=gt(e,$e[r]+2),a?t.error(new f(Ze)):s()):await o;const l=new h(e.length-tt-(e.length-tt)%je);t.enqueue(wt(n,e,l,0,tt,!0))},async flush(e){const{signed:t,ctr:n,hmac:i,pending:r,ready:a}=this;if(i&&n){await a;const s=gt(r,0,r.length-tt),o=gt(r,r.length-tt);let l=new h;if(s.length){const e=yt(st,s);i.update(e);const t=n.update(e);l=mt(st,t)}if(t){const e=gt(mt(st,i.digest()),0,tt);for(let t=0;tt>t;t++)if(e[t]!=o[t])throw new f(Ke)}e.enqueue(l)}}})}}class ht extends S{constructor({password:e,rawPassword:t,encryptionStrength:i}){let r;super({start(){n.assign(this,{ready:new g((e=>this.resolveReady=e)),password:pt(e,t),strength:i-1,pending:new h})},async transform(e,t){const n=this,{password:i,strength:r,resolveReady:a,ready:s}=n;let o=new h;i?(o=await(async(e,t,n)=>{const i=Ge(new h($e[t]));return bt(i,await _t(e,t,n,i))})(n,r,i),a()):await s;const l=new h(o.length+e.length-e.length%je);l.set(o,0),t.enqueue(wt(n,e,l,o.length,0))},async flush(e){const{ctr:t,hmac:n,pending:i,ready:a}=this;if(n&&t){await a;let s=new h;if(i.length){const e=t.update(yt(st,i));n.update(e),s=mt(st,e)}r.signature=mt(st,n.digest()).slice(0,tt),e.enqueue(bt(s,r.signature))}}}),r=this}}function wt(e,t,n,i,r,a){const{ctr:s,hmac:o,pending:l}=e,c=t.length-r;let d;for(l.length&&(t=bt(l,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new h(t)).set(n,0)}return e})(n,c-c%je)),d=0;c-je>=d;d+=je){const e=yt(st,gt(t,d,d+je));a&&o.update(e);const r=s.update(e);a||o.update(r),n.set(mt(st,r),d+i)}return e.pending=gt(t,d),n}async function _t(e,i,r,a){e.password=null;const s=await(async(e,t,n,i,r)=>{if(!dt)return Be.importKey(t);try{return await rt.importKey("raw",t,n,!1,r)}catch(e){return dt=!1,Be.importKey(t)}})(0,r,Ye,0,Qe),o=await(async(e,t,n)=>{if(!ut)return Be.pbkdf2(t,e.salt,Je.iterations,n);try{return await rt.deriveBits(e,t,n)}catch(i){return ut=!1,Be.pbkdf2(t,e.salt,Je.iterations,n)}})(n.assign({salt:a},Je),s,8*(2*et[i]+2)),l=new h(o),c=yt(st,gt(l,0,et[i])),d=yt(st,gt(l,et[i],2*et[i])),u=gt(l,2*et[i]);return n.assign(e,{keys:{key:c,authentication:d,passwordVerification:u},ctr:new lt(new ot(c),t.from(nt)),hmac:new ct(d)}),u}function pt(e,t){return t===Re?(e=>{if(typeof m==ze){const t=new h((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new m).encode(e)})(e):t}function bt(e,t){let n=e;return e.length+t.length&&(n=new h(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function gt(e,t,n){return e.subarray(t,n)}function mt(e,t){return e.fromBits(t)}function yt(e,t){return e.toBits(t)}class xt extends S{constructor({password:e,passwordVerification:t,checkPasswordOnly:i}){super({start(){n.assign(this,{password:e,passwordVerification:t}),Rt(this,e)},transform(e,t){const n=this;if(n.password){const t=vt(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new f(Ve);e=e.subarray(12)}i?t.error(new f(Ze)):t.enqueue(vt(n,e))}})}}class kt extends S{constructor({password:e,passwordVerification:t}){super({start(){n.assign(this,{password:e,passwordVerification:t}),Rt(this,e)},transform(e,t){const n=this;let i,r;if(n.password){n.password=null;const t=Ge(new h(12));t[11]=n.passwordVerification,i=new h(e.length+t.length),i.set(St(n,t),0),r=12}else i=new h(e.length),r=0;i.set(St(n,e),r),t.enqueue(i)}})}}function vt(e,t){const n=new h(t.length);for(let i=0;i<t.length;i++)n[i]=Dt(e)^t[i],zt(e,n[i]);return n}function St(e,t){const n=new h(t.length);for(let i=0;i<t.length;i++)n[i]=Dt(e)^t[i],zt(e,t[i]);return n}function Rt(e,t){const i=[305419896,591751049,878082192];n.assign(e,{keys:i,crcKey0:new Oe(i[0]),crcKey2:new Oe(i[2])});for(let n=0;n<t.length;n++)zt(e,t.charCodeAt(n))}function zt(e,t){let[n,i,r]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Et(s.imul(Et(i+Tt(n)),134775813)+1),e.crcKey2.append([i>>>24]),r=~e.crcKey2.get(),e.keys=[n,i,r]}function Dt(e){const t=2|e.keys[2];return Tt(s.imul(t,1^t)>>>8)}function Tt(e){return 255&e}function Et(e){return 4294967295&e}const At="deflate-raw";class Ct extends S{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:i}){super({});const{compressed:r,encrypted:a,useCompressionStream:s,zipCrypto:o,signed:l,level:c}=e,d=this;let u,f,h=Ut(super.readable);a&&!o||!l||(u=new Ie,h=Ot(h,u)),r&&(h=Lt(h,s,{level:c,chunkSize:t},i,n)),a&&(o?h=Ot(h,new kt(e)):(f=new ht(e),h=Ot(h,f))),Wt(d,h,(()=>{let e;a&&!o&&(e=f.signature),a&&!o||!l||(e=new p(u.value.buffer).getUint32(0)),d.signature=e}))}}class Ft extends S{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:i}){super({});const{zipCrypto:r,encrypted:a,signed:s,signature:o,compressed:l,useCompressionStream:c}=e;let d,u,h=Ut(super.readable);a&&(r?h=Ot(h,new xt(e)):(u=new ft(e),h=Ot(h,u))),l&&(h=Lt(h,c,{chunkSize:t},i,n)),a&&!r||!s||(d=new Ie,h=Ot(h,d)),Wt(this,h,(()=>{if((!a||r)&&s){const e=new p(d.value.buffer);if(o!=e.getUint32(0,!1))throw new f(Ke)}}))}}function Ut(e){return Ot(e,new S({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function Wt(e,t,i){t=Ot(t,new S({flush:i})),n.defineProperty(e,"readable",{get:()=>t})}function Lt(e,t,n,i,r){try{e=Ot(e,new(t&&i?i:r)(At,n))}catch(i){if(!t)return e;try{e=Ot(e,new r(At,n))}catch(t){return e}}return e}function Ot(e,t){return e.pipeThrough(t)}const It="data",Nt="close",Pt="inflate";class Ht extends S{constructor(e,t){super({});const i=this,{codecType:r}=e;let a;r.startsWith("deflate")?a=Ct:r.startsWith(Pt)&&(a=Ft);let s=0,o=0;const l=new a(e,t),c=super.readable,d=new S({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){n.assign(i,{inputSize:o})}}),u=new S({transform(e,t){e&&e.length&&(s+=e.length,t.enqueue(e))},flush(){const{signature:e}=l;n.assign(i,{signature:e,outputSize:s,inputSize:o})}});n.defineProperty(i,"readable",{get:()=>c.pipeThrough(d).pipeThrough(l).pipeThrough(u)})}}class qt extends S{constructor(e){let t;super({transform:function n(i,r){if(t){const e=new h(t.length+i.length);e.set(t),e.set(i,t.length),i=e,t=null}i.length>e?(r.enqueue(i.slice(0,e)),n(i.slice(e),r)):t=i},flush(e){t&&t.length&&e.enqueue(t)}})}}let Bt=typeof A!=ze;class Mt{constructor(e,{readable:t,writable:i},{options:r,config:a,streamOptions:s,useWebWorkers:o,transferStreams:l,scripts:c},d){const{signal:u}=s;return n.assign(e,{busy:!0,readable:t.pipeThrough(new qt(a.chunkSize)).pipeThrough(new Vt(t,s),{signal:u}),writable:i,options:n.assign({},r),scripts:c,transferStreams:l,terminate:()=>new g((t=>{const{worker:n,busy:i}=e;n?(i?e.resolveTerminated=t:(n.terminate(),t()),e.interface=null):t()})),onTaskFinished(){const{resolveTerminated:t}=e;t&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),t()),e.busy=!1,d(e)}}),(o&&Bt?Gt:Zt)(e,a)}}class Vt extends S{constructor(e,{onstart:t,onprogress:n,size:i,onend:r}){let a=0;super({async start(){t&&await Kt(t,i)},async transform(e,t){a+=e.length,n&&await Kt(n,a,i),t.enqueue(e)},async flush(){e.size=a,r&&await Kt(r,a)}})}}async function Kt(e,...t){try{await e(...t)}catch(e){}}function Zt(e,t){return{run:()=>(async({options:e,readable:t,writable:n,onTaskFinished:i},r)=>{try{const i=new Ht(e,r);await t.pipeThrough(i).pipeTo(n,{preventClose:!0,preventAbort:!0});const{signature:a,inputSize:s,outputSize:o}=i;return{signature:a,inputSize:s,outputSize:o}}finally{i()}})(e,t)}}function Gt(e,t){const{baseURL:i,chunkSize:r}=t;if(!e.interface){let a;try{a=((e,t,i)=>{const r={type:"module"};let a,s;typeof e==De&&(e=e());try{a=new u(e,t)}catch(t){a=e}if(jt)try{s=new A(a)}catch(e){jt=!1,s=new A(a,r)}else s=new A(a,r);return s.addEventListener("message",(e=>(async({data:e},t)=>{const{type:i,value:r,messageId:a,result:s,error:o}=e,{reader:l,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:w}=t;try{if(o){const{message:e,stack:t,code:i,name:r}=o,a=new f(e);n.assign(a,{stack:t,code:i,name:r}),_(a)}else{if("pull"==i){const{value:e,done:n}=await l.read();Yt({type:It,value:e,done:n,messageId:a},t)}i==It&&(await c.ready,await c.write(new h(r)),Yt({type:"ack",messageId:a},t)),i==Nt&&_(null,s)}}catch(o){Yt({type:Nt,messageId:a},t),_(o)}function _(e,t){e?u(e):d(t),c&&c.releaseLock(),w()}})(e,i))),s})(e.scripts[0],i,e)}catch(n){return Bt=!1,Zt(e,t)}n.assign(e,{worker:a,interface:{run:()=>(async(e,t)=>{let i,r;const a=new g(((e,t)=>{i=e,r=t}));n.assign(e,{reader:null,writer:null,resolveResult:i,rejectResult:r,result:a});const{readable:s,options:o,scripts:l}=e,{writable:c,closed:d}=(e=>{let t;const n=new g((e=>t=e));return{writable:new z({async write(t){const n=e.getWriter();await n.ready,await n.write(t),n.releaseLock()},close(){t()},abort:t=>e.getWriter().abort(t)}),closed:n}})(e.writable),u=Yt({type:"start",scripts:l.slice(1),options:o,config:t,readable:s,writable:c},e);u||n.assign(e,{reader:s.getReader(),writer:c.getWriter()});const f=await a;return u||await c.getWriter().close(),await d,f})(e,{chunkSize:r})}})}return e.interface}let jt=!0,Xt=!0;function Yt(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:r}){try{let{value:n,readable:i,writable:a}=e;const s=[];if(n&&(n.byteLength<n.buffer.byteLength?e.value=n.buffer.slice(0,n.byteLength):e.value=n.buffer,s.push(e.value)),r&&Xt?(i&&s.push(i),a&&s.push(a)):e.readable=e.writable=null,s.length)try{return t.postMessage(e,s),!0}catch(n){Xt=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(e){throw n&&n.releaseLock(),i(),e}}let Jt=[];const Qt=[];let $t=0;function en(e){const{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}const tn="HTTP error ",nn="HTTP Range not supported",rn="Writer iterator completed too soon",an="Content-Length",sn="Range",on="HEAD",ln="GET",cn="bytes",dn=65536,un="writable";class fn{constructor(){this.size=0}init(){this.initialized=!0}}class hn extends fn{get readable(){const e=this,{chunkSize:t=dn}=e,n=new R({start(){this.chunkOffset=0},async pull(i){const{offset:r=0,size:a,diskNumberStart:o}=n,{chunkOffset:l}=this;i.enqueue(await On(e,r+l,s.min(t,a-l),o)),l+t>a?i.close():this.chunkOffset+=t}});return n}}class wn extends fn{constructor(){super();const e=this,t=new z({write:t=>e.writeUint8Array(t)});n.defineProperty(e,un,{get:()=>t})}writeUint8Array(){}}class _n extends hn{constructor(e){super(),n.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const n=this,i=e+t,r=e||i<n.size?n.blob.slice(e,i):n.blob;let a=await r.arrayBuffer();return a.byteLength>t&&(a=a.slice(e,i)),new h(a)}}class pn extends fn{constructor(e){super();const t=new S,i=[];e&&i.push(["Content-Type",e]),n.defineProperty(this,un,{get:()=>t.writable}),this.blob=new d(t.readable,{headers:i}).blob()}getData(){return this.blob}}class bn extends hn{constructor(e,t){super(),mn(this,e,t)}async init(){await yn(this,Tn,Sn),super.init()}readUint8Array(e,t){return xn(this,e,t,Tn,Sn)}}class gn extends hn{constructor(e,t){super(),mn(this,e,t)}async init(){await yn(this,En,Rn),super.init()}readUint8Array(e,t){return xn(this,e,t,En,Rn)}}function mn(e,t,i){const{preventHeadRequest:r,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:o}=i;delete(i=n.assign({},i)).preventHeadRequest,delete i.useRangeHeader,delete i.forceRangeRequests,delete i.combineSizeEocd,delete i.useXHR,n.assign(e,{url:t,options:i,preventHeadRequest:r,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:o})}async function yn(e,t,n){const{url:i,preventHeadRequest:a,useRangeHeader:s,forceRangeRequests:o,combineSizeEocd:l}=e;if((e=>{const{baseURL:t}=Fe(),{protocol:n}=new u(e,t);return"http:"==n||"https:"==n})(i)&&(s||o)&&(void 0===a||a)){const i=await t(ln,e,kn(e,l?-22:void 0));if(!o&&i.headers.get("Accept-Ranges")!=cn)throw new f(nn);{let a;l&&(e.eocdCache=new h(await i.arrayBuffer()));const s=i.headers.get("Content-Range");if(s){const e=s.trim().split(/\s*\/\s*/);if(e.length){const t=e[1];t&&"*"!=t&&(a=r(t))}}a===Re?await Dn(e,t,n):e.size=a}}else await Dn(e,t,n)}async function xn(e,t,n,i,r){const{useRangeHeader:a,forceRangeRequests:s,eocdCache:o,size:l,options:c}=e;if(a||s){if(o&&t==l-Se&&n==Se)return o;const r=await i(ln,e,kn(e,t,n));if(206!=r.status)throw new f(nn);return new h(await r.arrayBuffer())}{const{data:i}=e;return i||await r(e,c),new h(e.data.subarray(t,t+n))}}function kn(e,t=0,i=1){return n.assign({},vn(e),{[sn]:cn+"="+(0>t?t:t+"-"+(t+i-1))})}function vn({options:e}){const{headers:t}=e;if(t)return Symbol.iterator in t?n.fromEntries(t):t}async function Sn(e){await zn(e,Tn)}async function Rn(e){await zn(e,En)}async function zn(e,t){const n=await t(ln,e,vn(e));e.data=new h(await n.arrayBuffer()),e.size||(e.size=e.data.length)}async function Dn(e,t,n){if(e.preventHeadRequest)await n(e,e.options);else{const i=(await t(on,e,vn(e))).headers.get(an);i?e.size=r(i):await n(e,e.options)}}async function Tn(e,{options:t,url:i},r){const a=await fetch(i,n.assign({},t,{method:e,headers:r}));if(400>a.status)return a;throw 416==a.status?new f(nn):new f(tn+(a.statusText||a.status))}function En(e,{url:t},i){return new g(((r,a)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",(()=>{if(400>s.status){const e=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{const n=t.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,(e=>e.toUpperCase())),e.push(n)})),r({status:s.status,arrayBuffer:()=>s.response,headers:new l(e)})}else a(416==s.status?new f(nn):new f(tn+(s.statusText||s.status)))}),!1),s.addEventListener("error",(e=>a(e.detail?e.detail.error:new f("Network error"))),!1),s.open(e,t),i)for(const e of n.entries(i))s.setRequestHeader(e[0],e[1]);s.responseType="arraybuffer",s.send()}))}class An extends hn{constructor(e,t={}){super(),n.assign(this,{url:e,reader:t.useXHR?new gn(e,t):new bn(e,t)})}set size(e){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}readUint8Array(e,t){return this.reader.readUint8Array(e,t)}}class Cn extends hn{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await g.all(t.map((async(n,i)=>{await n.init(),i!=t.length-1&&(e.lastDiskOffset+=n.size),e.size+=n.size}))),super.init()}async readUint8Array(e,t,n=0){const i=this,{readers:r}=this;let a,o=n;-1==o&&(o=r.length-1);let l=e;for(;l>=r[o].size;)l-=r[o].size,o++;const c=r[o],d=c.size;if(l+t>d){const r=d-l;a=new h(t),a.set(await On(c,l,r)),a.set(await i.readUint8Array(e+r,t-r,n),r)}else a=await On(c,l,t);return i.lastDiskNumber=s.max(o,i.lastDiskNumber),a}}class Fn extends fn{constructor(e,t=4294967295){super();const i=this;let r,a,s;n.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});const o=new z({async write(t){const{availableSize:n}=i;if(s)t.length<n?await l(t):(await l(t.slice(0,n)),await c(),i.diskOffset+=r.size,i.diskNumber++,s=null,await this.write(t.slice(n)));else{const{value:n,done:o}=await e.next();if(o&&!n)throw new f(rn);r=n,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await Un(r),a=n.writable,s=a.getWriter(),await this.write(t)}},async close(){await s.ready,await c()}});async function l(e){const t=e.length;t&&(await s.ready,await s.write(e),r.size+=t,i.size+=t,i.availableSize-=t)}async function c(){a.size=r.size,await s.close()}n.defineProperty(i,un,{get:()=>o})}}async function Un(e,t){if(!e.init||e.initialized)return g.resolve();await e.init(t)}function Wn(e){return t.isArray(e)&&(e=new Cn(e)),e instanceof R&&(e={readable:e}),e}function Ln(e){e.writable===Re&&typeof e.next==De&&(e=new Fn(e)),e instanceof z&&(e={writable:e});const{writable:t}=e;return t.size===Re&&(t.size=0),e instanceof Fn||n.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function On(e,t,n,i){return e.readUint8Array(t,n,i)}const In=Cn,Nn=Fn,Pn="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),Hn=256==Pn.length;function qn(e,t){return t&&"cp437"==t.trim().toLowerCase()?(e=>{if(Hn){let t="";for(let n=0;n<e.length;n++)t+=Pn[e[n]];return t}return(new y).decode(e)})(e):new y(t).decode(e)}const Bn="filename",Mn="rawFilename",Vn="comment",Kn="rawComment",Zn="uncompressedSize",Gn="compressedSize",jn="offset",Xn="diskNumberStart",Yn="lastModDate",Jn="rawLastModDate",Qn="lastAccessDate",$n="creationDate",ei=[Bn,Mn,Gn,Zn,Yn,Jn,Vn,Kn,Qn,$n,jn,Xn,Xn,"internalFileAttribute","externalFileAttribute","msDosCompatible","zip64","directory","bitFlag","encrypted","signature","filenameUTF8","commentUTF8","compressionMethod","version","versionMadeBy","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class ti{constructor(e){ei.forEach((t=>this[t]=e[t]))}}const ni="File format is not recognized",ii="End of central directory not found",ri="End of Zip64 central directory locator not found",ai="Central directory header not found",si="Local file header not found",oi="Zip64 extra field not found",li="File contains encrypted entry",ci="Encryption method not supported",di="Compression method not supported",ui="Split zip file",fi="utf-8",hi="cp437",wi=[[Zn,ye],[Gn,ye],[jn,ye],[Xn,xe]],_i={[xe]:{getValue:zi,bytes:4},[ye]:{getValue:Di,bytes:8}};class pi{constructor(e,t={}){n.assign(this,{reader:Wn(e),options:t,config:Fe()})}async*getEntriesGenerator(e={}){const t=this;let{reader:i}=t;const{config:r}=t;if(await Un(i),i.size!==Re&&i.readUint8Array||(i=new _n(await new d(i.readable).blob()),await Un(i)),i.size<Se)throw new f(ni);i.chunkSize=(e=>s.max(e.chunkSize,64))(r);const a=await(async(e,t,n)=>{const i=new h(4);return Ti(i).setUint32(0,101010256,!0),await r(22)||await r(s.min(1048582,n));async function r(t){const r=n-t,a=await On(e,r,t);for(let e=a.length-22;e>=0;e--)if(a[e]==i[0]&&a[e+1]==i[1]&&a[e+2]==i[2]&&a[e+3]==i[3])return{offset:r+e,buffer:a.slice(e,e+22).buffer}}})(i,0,i.size);if(!a)throw 134695760==zi(Ti(await On(i,0,4)))?new f(ui):new f(ii);const o=Ti(a);let l=zi(o,12),c=zi(o,16);const u=a.offset,w=Ri(o,20),_=u+Se+w;let p=Ri(o,4);const b=i.lastDiskNumber||0;let g=Ri(o,6),m=Ri(o,8),y=0,x=0;if(c==ye||l==ye||m==xe||g==xe){const e=Ti(await On(i,a.offset-20,20));if(117853008==zi(e,0)){c=Di(e,8);let t=await On(i,c,56,-1),n=Ti(t);const r=a.offset-20-56;if(zi(n,0)!=ve&&c!=r){const e=c;c=r,y=c-e,t=await On(i,c,56,-1),n=Ti(t)}if(zi(n,0)!=ve)throw new f(ri);p==xe&&(p=zi(n,16)),g==xe&&(g=zi(n,20)),m==xe&&(m=Di(n,32)),l==ye&&(l=Di(n,40)),c-=l}}if(c<i.size||(y=i.size-c-l-Se,c=i.size-l-Se),b!=p)throw new f(ui);if(0>c)throw new f(ni);let k=0,v=await On(i,c,l,g),S=Ti(v);if(l){const e=a.offset-l;if(zi(S,k)!=ke&&c!=e){const t=c;c=e,y+=c-t,v=await On(i,c,l,g),S=Ti(v)}}const R=a.offset-c-(i.lastDiskOffset||0);if(l==R||0>R||(l=R,v=await On(i,c,l,g),S=Ti(v)),0>c||c>=i.size)throw new f(ni);const z=xi(t,e,"filenameEncoding"),D=xi(t,e,"commentEncoding");for(let a=0;m>a;a++){const o=new bi(i,r,t.options);if(zi(S,k)!=ke)throw new f(ai);gi(o,S,k+6);const l=!!o.bitFlag.languageEncodingFlag,c=k+46,d=c+o.filenameLength,u=d+o.extraFieldLength,h=Ri(S,k+4),w=!0,_=v.subarray(c,d),p=Ri(S,k+32),b=u+p,g=v.subarray(u,b),R=l,T=l,E=w&&!(16&~Si(S,k+38)),A=zi(S,k+42)+y;n.assign(o,{versionMadeBy:h,msDosCompatible:w,compressedSize:0,uncompressedSize:0,commentLength:p,directory:E,offset:A,diskNumberStart:Ri(S,k+34),internalFileAttribute:Ri(S,k+36),externalFileAttribute:zi(S,k+38),rawFilename:_,filenameUTF8:R,commentUTF8:T,rawExtraField:v.subarray(d,u)});const C=xi(t,e,"decodeText")||qn,F=R?fi:z||hi,U=T?fi:D||hi;let W=C(_,F);W===Re&&(W=qn(_,F));let L=C(g,U);L===Re&&(L=qn(g,U)),n.assign(o,{rawComment:g,filename:W,comment:L,directory:E||W.endsWith("/")}),x=s.max(A,x),await mi(o,o,S,k+6);const O=new ti(o);O.getData=(e,t)=>o.getData(e,O,t),k=b;const{onprogress:I}=e;if(I)try{await I(a+1,m,new ti(o))}catch(e){}yield O}const T=xi(t,e,"extractPrependedData"),E=xi(t,e,"extractAppendedData");return T&&(t.prependedData=x>0?await On(i,0,x):new h),t.comment=w?await On(i,u+Se,w):new h,E&&(t.appendedData=_<i.size?await On(i,_,i.size-_):new h),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class bi{constructor(e,t,i){n.assign(this,{reader:e,config:t,options:i})}async getData(e,t,i={}){const a=this,{reader:s,offset:o,diskNumberStart:l,extraFieldAES:c,compressionMethod:d,config:u,bitFlag:w,signature:_,rawLastModDate:p,uncompressedSize:b,compressedSize:m}=a,y=t.localDirectory={},x=Ti(await On(s,o,30,l));let k=xi(a,i,"password"),v=xi(a,i,"rawPassword");if(k=k&&k.length&&k,v=v&&v.length&&v,c&&99!=c.originalCompressionMethod)throw new f(di);if(0!=d&&8!=d)throw new f(di);if(67324752!=zi(x,0))throw new f(si);gi(y,x,4),y.rawExtraField=y.extraFieldLength?await On(s,o+30+y.filenameLength,y.extraFieldLength,l):new h,await mi(a,y,x,4,!0),n.assign(t,{lastAccessDate:y.lastAccessDate,creationDate:y.creationDate});const S=a.encrypted&&y.encrypted,R=S&&!c;if(S){if(!R&&c.strength===Re)throw new f(ci);if(!k&&!v)throw new f(li)}const D=o+30+y.filenameLength+y.extraFieldLength,T=m,E=s.readable;n.assign(E,{diskNumberStart:l,offset:D,size:T});const A=xi(a,i,"signal"),C=xi(a,i,"checkPasswordOnly");C&&(e=new z),e=Ln(e),await Un(e,b);const{writable:F}=e,{onstart:U,onprogress:W,onend:L}=i,O={options:{codecType:Pt,password:k,rawPassword:v,zipCrypto:R,encryptionStrength:c&&c.strength,signed:xi(a,i,"checkSignature"),passwordVerification:R&&(w.dataDescriptor?p>>>8&255:_>>>24&255),signature:_,compressed:0!=d,encrypted:S,useWebWorkers:xi(a,i,"useWebWorkers"),useCompressionStream:xi(a,i,"useCompressionStream"),transferStreams:xi(a,i,"transferStreams"),checkPasswordOnly:C},config:u,streamOptions:{signal:A,size:T,onstart:U,onprogress:W,onend:L}};let I=0;try{({outputSize:I}=await(async(e,t)=>{const{options:n,config:i}=t,{transferStreams:a,useWebWorkers:s,useCompressionStream:o,codecType:l,compressed:c,signed:d,encrypted:u}=n,{workerScripts:f,maxWorkers:h}=i;t.transferStreams=a||a===Re;const w=!(c||d||u||t.transferStreams);return t.useWebWorkers=!w&&(s||s===Re&&i.useWebWorkers),t.scripts=t.useWebWorkers&&f?f[l]:[],n.useCompressionStream=o||o===Re&&i.useCompressionStream,(await(async()=>{const n=Jt.find((e=>!e.busy));if(n)return en(n),new Mt(n,e,t,_);if(Jt.length<h){const n={indexWorker:$t};return $t++,Jt.push(n),new Mt(n,e,t,_)}return new g((n=>Qt.push({resolve:n,stream:e,workerOptions:t})))})()).run();function _(e){if(Qt.length){const[{resolve:t,stream:n,workerOptions:i}]=Qt.splice(0,1);t(new Mt(e,n,i,_))}else e.worker?(en(e),((e,t)=>{const{config:n}=t,{terminateWorkerTimeout:i}=n;r.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout((async()=>{Jt=Jt.filter((t=>t!=e));try{await e.terminate()}catch(e){}}),i))})(e,t)):Jt=Jt.filter((t=>t!=e))}})({readable:E,writable:F},O))}catch(e){if(!C||e.message!=Ze)throw e}finally{const e=xi(a,i,"preventClose");F.size+=I,e||F.locked||await F.getWriter().close()}return C?Re:e.getData?e.getData():F}}function gi(e,t,i){const r=e.rawBitFlag=Ri(t,i+2),a=!(1&~r),s=zi(t,i+6);n.assign(e,{encrypted:a,version:Ri(t,i),bitFlag:{level:(6&r)>>1,dataDescriptor:!(8&~r),languageEncodingFlag:!(2048&~r)},rawLastModDate:s,lastModDate:ki(s),filenameLength:Ri(t,i+22),extraFieldLength:Ri(t,i+24)})}async function mi(e,t,i,r,a){const{rawExtraField:s}=t,c=t.extraField=new l,d=Ti(new h(s));let u=0;try{for(;u<s.length;){const e=Ri(d,u),t=Ri(d,u+2);c.set(e,{type:e,data:s.slice(u+4,u+4+t)}),u+=4+t}}catch(e){}const w=Ri(i,r+4);n.assign(t,{signature:zi(i,r+10),uncompressedSize:zi(i,r+18),compressedSize:zi(i,r+14)});const _=c.get(1);_&&(((e,t)=>{t.zip64=!0;const n=Ti(e.data),i=wi.filter((([e,n])=>t[e]==n));for(let r=0,a=0;r<i.length;r++){const[s,o]=i[r];if(t[s]==o){const i=_i[o];t[s]=e[s]=i.getValue(n,a),a+=i.bytes}else if(e[s])throw new f(oi)}})(_,t),t.extraFieldZip64=_);const p=c.get(28789);p&&(await yi(p,Bn,Mn,t,e),t.extraFieldUnicodePath=p);const b=c.get(25461);b&&(await yi(b,Vn,Kn,t,e),t.extraFieldUnicodeComment=b);const g=c.get(39169);g?(((e,t,i)=>{const r=Ti(e.data),a=Si(r,4);n.assign(e,{vendorVersion:Si(r,0),vendorId:Si(r,2),strength:a,originalCompressionMethod:i,compressionMethod:Ri(r,5)}),t.compressionMethod=e.compressionMethod})(g,t,w),t.extraFieldAES=g):t.compressionMethod=w;const m=c.get(10);m&&(((e,t)=>{const i=Ti(e.data);let r,a=4;try{for(;a<e.data.length&&!r;){const t=Ri(i,a),n=Ri(i,a+2);1==t&&(r=e.data.slice(a+4,a+4+n)),a+=4+n}}catch(e){}try{if(r&&24==r.length){const i=Ti(r),a=i.getBigUint64(0,!0),s=i.getBigUint64(8,!0),o=i.getBigUint64(16,!0);n.assign(e,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:o});const l={lastModDate:vi(a),lastAccessDate:vi(s),creationDate:vi(o)};n.assign(e,l),n.assign(t,l)}}catch(e){}})(m,t),t.extraFieldNTFS=m);const y=c.get(21589);y&&(((e,t,n)=>{const i=Ti(e.data),r=Si(i,0),a=[],s=[];n?(1&~r||(a.push(Yn),s.push(Jn)),2&~r||(a.push(Qn),s.push("rawLastAccessDate")),4&~r||(a.push($n),s.push("rawCreationDate"))):5>e.data.length||(a.push(Yn),s.push(Jn));let l=1;a.forEach(((n,r)=>{if(e.data.length>=l+4){const a=zi(i,l);t[n]=e[n]=new o(1e3*a);const c=s[r];e[c]=a}l+=4}))})(y,t,a),t.extraFieldExtendedTimestamp=y);const x=c.get(6534);x&&(t.extraFieldUSDZ=x)}async function yi(e,t,i,r,a){const s=Ti(e.data),o=new Oe;o.append(a[i]);const l=Ti(new h(4));l.setUint32(0,o.get(),!0);const c=zi(s,1);n.assign(e,{version:Si(s,0),[t]:qn(e.data.subarray(5)),valid:!a.bitFlag.languageEncodingFlag&&c==zi(l,0)}),e.valid&&(r[t]=e[t],r[t+"UTF8"]=!0)}function xi(e,t,n){return t[n]===Re?e.options[n]:t[n]}function ki(e){const t=(4294901760&e)>>16,n=65535&e;try{return new o(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}catch(e){}}function vi(e){return new o(r(e/a(1e4)-a(116444736e5)))}function Si(e,t){return e.getUint8(t)}function Ri(e,t){return e.getUint16(t,!0)}function zi(e,t){return e.getUint32(t,!0)}function Di(e,t){return r(e.getBigUint64(t,!0))}function Ti(e){return new p(e.buffer)}Ue({Inflate:function(e){const t=new me,n=e&&e.chunkSize?s.floor(2*e.chunkSize):131072,i=new h(n);let r=!1;t.inflateInit(),t.next_out=i,this.append=(e,a)=>{const s=[];let o,l,c=0,d=0,u=0;if(0!==e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=n,0!==t.avail_in||r||(t.next_in_index=0,r=!0),o=t.inflate(0),r&&o===O){if(0!==t.avail_in)throw new f("inflating: bad input")}else if(o!==C&&o!==F)throw new f("inflating: "+t.msg);if((r||o===F)&&t.avail_in===e.length)throw new f("inflating: bad input");t.next_out_index&&(t.next_out_index===n?s.push(new h(i)):s.push(i.subarray(0,t.next_out_index))),u+=t.next_out_index,a&&t.next_in_index>0&&t.next_in_index!=c&&(a(t.next_in_index),c=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return s.length>1?(l=new h(u),s.forEach((e=>{l.set(e,d),d+=e.length}))):l=s[0]?new h(s[0]):new h,l}},this.flush=()=>{t.inflateEnd()}}}),e.BlobReader=_n,e.BlobWriter=pn,e.Data64URIReader=class extends hn{constructor(e){super();let t=e.length;for(;"="==e.charAt(t-1);)t--;const i=e.indexOf(",")+1;n.assign(this,{dataURI:e,dataStart:i,size:s.floor(.75*(t-i))})}readUint8Array(e,t){const{dataStart:n,dataURI:i}=this,r=new h(t),a=4*s.floor(e/3),o=atob(i.substring(a+n,4*s.ceil((e+t)/3)+n)),l=e-3*s.floor(a/4);for(let e=l;l+t>e;e++)r[e-l]=o.charCodeAt(e);return r}},e.Data64URIWriter=class extends wn{constructor(e){super(),n.assign(this,{data:"data:"+(e||"")+";base64,",pending:[]})}writeUint8Array(e){const t=this;let n=0,r=t.pending;const a=t.pending.length;for(t.pending="",n=0;n<3*s.floor((a+e.length)/3)-a;n++)r+=i.fromCharCode(e[n]);for(;n<e.length;n++)t.pending+=i.fromCharCode(e[n]);r.length>2?t.data+=v(r):t.pending=r}getData(){return this.data+v(this.pending)}},e.ERR_BAD_FORMAT=ni,e.ERR_CENTRAL_DIRECTORY_NOT_FOUND=ai,e.ERR_ENCRYPTED=li,e.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=ri,e.ERR_EOCDR_NOT_FOUND=ii,e.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=oi,e.ERR_HTTP_RANGE=nn,e.ERR_INVALID_PASSWORD=Ve,e.ERR_INVALID_SIGNATURE=Ke,e.ERR_ITERATOR_COMPLETED_TOO_SOON=rn,e.ERR_LOCAL_FILE_HEADER_NOT_FOUND=si,e.ERR_SPLIT_ZIP_FILE=ui,e.ERR_UNSUPPORTED_COMPRESSION=di,e.ERR_UNSUPPORTED_ENCRYPTION=ci,e.HttpRangeReader=class extends An{constructor(e,t={}){t.useRangeHeader=!0,super(e,t)}},e.HttpReader=An,e.Reader=hn,e.SplitDataReader=Cn,e.SplitDataWriter=Fn,e.SplitZipReader=In,e.SplitZipWriter=Nn,e.TextReader=class extends _n{constructor(e){super(new b([e],{type:"text/plain"}))}},e.TextWriter=class extends pn{constructor(e){super(e),n.assign(this,{encoding:e,utf8:!e||"utf-8"==e.toLowerCase()})}async getData(){const{encoding:e,utf8:t}=this,i=await super.getData();if(i.text&&t)return i.text();{const t=new FileReader;return new g(((r,a)=>{n.assign(t,{onload:({target:e})=>r(e.result),onerror:()=>a(t.error)}),t.readAsText(i,e)}))}}},e.Uint8ArrayReader=class extends hn{constructor(e){super(),n.assign(this,{array:e,size:e.length})}readUint8Array(e,t){return this.array.slice(e,e+t)}},e.Uint8ArrayWriter=class extends wn{init(e=0){n.assign(this,{offset:0,array:new h(e)}),super.init()}writeUint8Array(e){const t=this;if(t.offset+e.length>t.array.length){const n=t.array;t.array=new h(n.length+e.length),t.array.set(n)}t.array.set(e,t.offset),t.offset+=e.length}getData(){return this.array}},e.Writer=wn,e.ZipReader=pi,e.ZipReaderStream=class{constructor(e={}){const{readable:t,writable:n}=new S,i=new pi(t,e).getEntriesGenerator();this.readable=new R({async pull(e){const{done:t,value:n}=await i.next();if(t)return e.close();const r={...n,readable:(()=>{const{readable:e,writable:t}=new S;if(n.getData)return n.getData(t),e})()};delete r.getData,e.enqueue(r)}}),this.writable=n}},e.configure=Ue,e.getMimeType=()=>"application/octet-stream",e.initReader=Wn,e.initStream=Un,e.initWriter=Ln,e.readUint8Array=On,e.terminateWorkers=async()=>{await g.allSettled(Jt.map((e=>(en(e),e.terminate()))))}})); |
@@ -35,6 +35,9 @@ /* | ||
function configureWebWorker(configure) { | ||
function configureWebWorker(configure, options = {}) { | ||
// eslint-disable-next-line quotes | ||
const uri = () => URL.createObjectURL(new Blob([`__workerCode__`], { type: "text/javascript" })); | ||
const code = `__workerCode__`; | ||
const uri = () => options.useDataURI ? | ||
`data:text/javascript,${encodeURIComponent(code)}` : | ||
URL.createObjectURL(new Blob([code], { type: "text/javascript" })); | ||
configure({ workerScripts: { inflate: [uri], deflate: [uri] } }); | ||
} |
@@ -1,1 +0,1 @@ | ||
function e(e){const t=()=>URL.createObjectURL(new Blob(['const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self,k=void 0,v="undefined",S="function";class z{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const C=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;C[e]=t}class x{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^C[255&(t^e[n])];this.t=t}get(){return~this.t}}class A extends p{constructor(){let e;const t=new x;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const _={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=_.i(n);return 32===r?e.concat(t):_.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+_.i(n)},u(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,r.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=_.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s<e.length;s++)r.push(n|e[s]>>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=_.i(s);return r.push(_.h(t+i&31,t+i>32?n:r.pop(),1)),r}},I={p:{m(e){const t=_.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)3&s||(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},k(e){const t=[];let n,r=0;for(n=0;n<e.length;n++)r=r<<8|e[n],3&~n||(t.push(r),r=0);return 3&n&&t.push(_.h(8*(3&n),r)),t}}},P=class{constructor(e){const t=this;t.blockSize=512,t.v=[1732584193,4023233417,2562383102,271733878,3285377520],t.S=[1518500249,1859775393,2400959708,3395469782],e?(t.C=e.C.slice(0),t.A=e.A.slice(0),t._=e._):t.reset()}reset(){const e=this;return e.C=e.v.slice(0),e.A=[],e._=0,e}update(e){const t=this;"string"==typeof e&&(e=I.I.k(e));const n=t.A=_.concat(t.A,e),r=t._,i=t._=r+_.l(e);if(i>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.P(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}D(){const e=this;let t=e.A;const n=e.C;t=_.concat(t,[_.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e._/4294967296)),t.push(0|e._);t.length;)e.P(t.splice(0,16));return e.reset(),n}V(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}R(e,t){return t<<e|t>>>32-e}P(t){const n=this,s=n.C,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.R(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.R(5,o)+n.V(e,c,f,a)+l+i[e]+n.S[r.floor(e/20)]|0;l=a,a=f,f=n.R(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},D={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;i<e.length;i+=4){const e=n(4294967296*(s||r.random()));s=987654071*e(),t[i/4]=4294967296*e()|0}return e}},V={importKey:e=>new V.B(I.p.k(e)),M(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=_;for(t=I.p.k(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;a<c.length;a++)o[a]^=c[a];for(f=0;(i||1)>d&&f<o.length;f++)h.setInt32(d,o[f]),d+=4}return w.slice(0,r/8)},B:class{constructor(e){const t=this,n=t.U=P,r=[[],[]];t.K=[new n,new n];const s=t.K[0].blockSize/32;e.length>s&&(e=(new n).update(e).D());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.K[0].update(r[0]),t.K[1].update(r[1]),t.N=new n(t.K[0])}reset(){const e=this;e.N=new e.U(e.K[0]),e.O=!1}update(e){this.O=!0,this.N.update(e)}digest(){const e=this,t=e.N.D(),n=new e.U(e.K[1]).update(t).D();return e.reset(),n}encrypt(e){if(this.O)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},R=typeof h!=v&&typeof h.getRandomValues==S,B="Invalid password",E="Invalid signature",M="zipjs-abort-check-password";function U(e){return R?h.getRandomValues(e):D.getRandomValues(e)}const K=16,N={name:"PBKDF2"},O=t.assign({hash:{name:"HMAC"}},N),T=t.assign({iterations:1e3,hash:{name:"SHA-1"}},N),W=["deriveBits"],j=[8,12,16],H=[16,24,32],L=10,F=[0,0,0,0],q=typeof h!=v,G=q&&h.subtle,J=q&&typeof G!=v,Q=I.p,X=class{constructor(e){const t=this;t.T=[[[],[],[],[],[]],[[],[],[],[],[]]],t.T[0][0][0]||t.W();const n=t.T[0][4],r=t.T[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s("invalid aes key size");for(t.S=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.j(e,0)}decrypt(e){return this.j(e,1)}W(){const e=this.T[0],t=this.T[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}j(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this.S[t],r=n.length/4-2,i=[0,0,0,0],o=this.T[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},Y=class{constructor(e,t){this.H=e,this.L=t,this.F=t}reset(){this.F=this.L}update(e){return this.q(this.H,e,this.F)}G(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}return e}J(e){0===(e[0]=this.G(e[0]))&&(e[1]=this.G(e[1]))}q(e,t,n){let r;if(!(r=t.length))return[];const s=_.l(t);for(let s=0;r>s;s+=4){this.J(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return _.u(t,s)}},Z=V.B;let $=q&&J&&typeof G.importKey==S,ee=q&&J&&typeof G.deriveBits==S;class te extends p{constructor({password:e,rawPassword:n,signed:r,encryptionStrength:o,checkPasswordOnly:c}){super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),signed:r,Y:o-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:o,X:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await se(e,t,n,ce(r,0,j[t])),o=ce(r,j[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(B)})(n,o,r,ce(e,0,j[o]+2)),e=ce(e,j[o]+2),c?t.error(new s(M)):f()):await a;const l=new i(e.length-L-(e.length-L)%K);t.enqueue(re(n,e,l,0,L,!0))},async flush(e){const{signed:t,Z:n,$:r,pending:o,ready:c}=this;if(r&&n){await c;const f=ce(o,0,o.length-L),a=ce(o,o.length-L);let l=new i;if(f.length){const e=ae(Q,f);r.update(e);const t=n.update(e);l=fe(Q,t)}if(t){const e=ce(fe(Q,r.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=a[t])throw new s(E)}e.enqueue(l)}}})}}class ne extends p{constructor({password:e,rawPassword:n,encryptionStrength:r}){let s;super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),Y:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:s,X:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=U(new i(j[t]));return oe(r,await se(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%K);a.set(f,0),t.enqueue(re(n,e,a,f.length,0))},async flush(e){const{Z:t,$:n,pending:r,ready:o}=this;if(n&&t){await o;let c=new i;if(r.length){const e=t.update(ae(Q,r));n.update(e),c=fe(Q,e)}s.signature=fe(Q,n.digest()).slice(0,L),e.enqueue(oe(c,s.signature))}}}),s=this}}function re(e,t,n,r,s,o){const{Z:c,$:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=oe(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%K)),u=0;l-K>=u;u+=K){const e=ae(Q,ce(t,u,u+K));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(fe(Q,s),u+r)}return e.pending=ce(t,u),n}async function se(n,r,s,o){n.password=null;const c=await(async(e,t,n,r,s)=>{if(!$)return V.importKey(t);try{return await G.importKey("raw",t,n,!1,s)}catch(e){return $=!1,V.importKey(t)}})(0,s,O,0,W),f=await(async(e,t,n)=>{if(!ee)return V.M(t,e.salt,T.iterations,n);try{return await G.deriveBits(e,t,n)}catch(r){return ee=!1,V.M(t,e.salt,T.iterations,n)}})(t.assign({salt:o},T),c,8*(2*H[r]+2)),a=new i(f),l=ae(Q,ce(a,0,H[r])),u=ae(Q,ce(a,H[r],2*H[r])),w=ce(a,2*H[r]);return t.assign(n,{keys:{key:l,ee:u,passwordVerification:w},Z:new Y(new X(l),e.from(F)),$:new Z(u)}),w}function ie(e,t){return t===k?(e=>{if(typeof w==v){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new w).encode(e)})(e):t}function oe(e,t){let n=e;return e.length+t.length&&(n=new i(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ce(e,t,n){return e.subarray(t,n)}function fe(e,t){return e.m(t)}function ae(e,t){return e.k(t)}class le extends p{constructor({password:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;if(n.password){const t=we(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(B);e=e.subarray(12)}r?t.error(new s(M)):t.enqueue(we(n,e))}})}}class ue extends p{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;let r,s;if(n.password){n.password=null;const t=U(new i(12));t[11]=n.passwordVerification,r=new i(e.length+t.length),r.set(he(n,t),0),s=12}else r=new i(e.length),s=0;r.set(he(n,e),s),t.enqueue(r)}})}}function we(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,n[r]);return n}function he(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,t[r]);return n}function de(e,n){const r=[305419896,591751049,878082192];t.assign(e,{keys:r,te:new x(r[0]),ne:new x(r[2])});for(let t=0;t<n.length;t++)pe(e,n.charCodeAt(t))}function pe(e,t){let[n,s,i]=e.keys;e.te.append([t]),n=~e.te.get(),s=be(r.imul(be(s+me(n)),134775813)+1),e.ne.append([s>>>24]),i=~e.ne.get(),e.keys=[n,s,i]}function ye(e){const t=2|e.keys[2];return me(r.imul(t,1^t)>>>8)}function me(e){return 255&e}function be(e){return 4294967295&e}const ge="deflate-raw";class ke extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=Se(super.readable);i&&!c||!f||(w=new A,d=xe(d,w)),s&&(d=Ce(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=xe(d,new ue(e)):(h=new ne(e),d=xe(d,h))),ze(u,d,(()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ve extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=Se(super.readable);o&&(i?d=xe(d,new le(e)):(h=new te(e),d=xe(d,h))),a&&(d=Ce(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new A,d=xe(d,w)),ze(this,d,(()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(E)}}))}}function Se(e){return xe(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ze(e,n,r){n=xe(n,new p({flush:r})),t.defineProperty(e,"readable",{get:()=>n})}function Ce(e,t,n,r,s){try{e=xe(e,new(t&&r?r:s)(ge,n))}catch(r){if(!t)return e;try{e=xe(e,new s(ge,n))}catch(t){return e}}return e}function xe(e,t){return e.pipeThrough(t)}const Ae="data",_e="close";class Ie extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith("deflate")?i=ke:s.startsWith("inflate")&&(i=ve);let o=0,c=0;const f=new i(e,n),a=super.readable,l=new p({transform(e,t){e&&e.length&&(c+=e.length,t.enqueue(e))},flush(){t.assign(r,{inputSize:c})}}),u=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=f;t.assign(r,{signature:e,outputSize:o,inputSize:c})}});t.defineProperty(r,"readable",{get:()=>a.pipeThrough(l).pipeThrough(f).pipeThrough(u)})}}class Pe extends p{constructor(e){let t;super({transform:function n(r,s){if(t){const e=new i(t.length+r.length);e.set(t),e.set(r,t.length),r=e,t=null}r.length>e?(s.enqueue(r.slice(0,e)),n(r.slice(e),s)):t=r},flush(e){t&&t.length&&e.enqueue(t)}})}}const De=new a,Ve=new a;let Re,Be=0,Ee=!0;async function Me(e){try{const{options:t,scripts:r,config:s}=e;if(r&&r.length)try{Ee?importScripts.apply(k,r):await Ue(r)}catch(e){Ee=!1,await Ue(r)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new z(self.Deflate)),self.Inflate&&(s.DecompressionStream=new z(self.Inflate));const i={highWaterMark:1},o=e.readable||new y({async pull(e){const t=new u((e=>De.set(Be,e)));Ke({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ve.set(Be,t),Ke({type:Ae,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new Ie(t,s);Re=new AbortController;const{signal:a}=Re;await o.pipeThrough(f).pipeThrough(new Pe(s.chunkSize)).pipeTo(c,{signal:a,preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{signature:l,inputSize:w,outputSize:h}=f;Ke({type:_e,result:{signature:l,inputSize:w,outputSize:h}})}catch(e){Ne(e)}}async function Ue(e){for(const t of e)await import(t)}function Ke(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ne(e=new s("Unknown error")){const{message:t,stack:n,code:r,name:i}=e;d({error:{message:t,stack:n,code:r,name:i}})}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if("start"==t&&Me(e),t==Ae){const e=De.get(n);De.delete(n),e({value:new i(r),done:s})}if("ack"==t){const e=Ve.get(n);Ve.delete(n),e()}t==_e&&Re.abort()}catch(e){Ne(e)}}));const Oe=15,Te=573,We=-2;function je(t){return He(t.map((([t,n])=>new e(t).fill(n,0,t))))}function He(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?He(n):n)),[])}const Le=[0,1,2,3].concat(...je([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function Fe(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.re=n=>{const s=e.se,i=e.oe.ie,o=e.oe.ce;let c,f,a,l=-1;for(n.fe=0,n.ae=Te,c=0;o>c;c++)0!==s[2*c]?(n.le[++n.fe]=l=c,n.ue[c]=0):s[2*c+1]=0;for(;2>n.fe;)a=n.le[++n.fe]=2>l?++l:0,s[2*a]=1,n.ue[a]=0,n.we--,i&&(n.he-=i[2*a+1]);for(e.de=l,c=r.floor(n.fe/2);c>=1;c--)n.pe(s,c);a=o;do{c=n.le[1],n.le[1]=n.le[n.fe--],n.pe(s,1),f=n.le[1],n.le[--n.ae]=c,n.le[--n.ae]=f,s[2*a]=s[2*c]+s[2*f],n.ue[a]=r.max(n.ue[c],n.ue[f])+1,s[2*c+1]=s[2*f+1]=a,n.le[1]=a++,n.pe(s,1)}while(n.fe>=2);n.le[--n.ae]=n.le[1],(t=>{const n=e.se,r=e.oe.ie,s=e.oe.ye,i=e.oe.me,o=e.oe.be;let c,f,a,l,u,w,h=0;for(l=0;Oe>=l;l++)t.ge[l]=0;for(n[2*t.le[t.ae]+1]=0,c=t.ae+1;Te>c;c++)f=t.le[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.de||(t.ge[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.we+=w*(l+u),r&&(t.he+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.ge[l];)l--;t.ge[l]--,t.ge[l+1]+=2,t.ge[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.ge[l];0!==f;)a=t.le[--c],a>e.de||(n[2*a+1]!=l&&(t.we+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;Oe>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.de,n.ge)}}function qe(e,t,n,r,s){const i=this;i.ie=e,i.ye=t,i.me=n,i.ce=r,i.be=s}Fe.ke=[0,1,2,3,4,5,6,7].concat(...je([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),Fe.ve=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],Fe.Se=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],Fe.ze=e=>256>e?Le[e]:Le[256+(e>>>7)],Fe.Ce=[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],Fe.xe=[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],Fe.Ae=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Fe._e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Ge=je([[144,8],[112,9],[24,7],[8,8]]);qe.Ie=He([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Ge[t]])));const Je=je([[30,5]]);function Qe(e,t,n,r,s){const i=this;i.Pe=e,i.De=t,i.Ve=n,i.Re=r,i.Be=s}qe.Ee=He([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,Je[t]]))),qe.Me=new qe(qe.Ie,Fe.Ce,257,286,Oe),qe.Ue=new qe(qe.Ee,Fe.xe,0,30,Oe),qe.Ke=new qe(null,Fe.Ae,0,19,7);const Xe=[new Qe(0,0,0,0,0),new Qe(4,4,8,4,1),new Qe(4,5,16,8,1),new Qe(4,6,32,32,1),new Qe(4,4,16,16,2),new Qe(8,16,32,32,2),new Qe(8,16,128,128,2),new Qe(8,32,128,256,2),new Qe(32,128,258,1024,2),new Qe(32,258,258,4096,2)],Ye=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Ze=113,$e=666,et=262;function tt(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function nt(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,A,_,I,P,D,V,R,B,E,M,U;const K=new Fe,N=new Fe,O=new Fe;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)U[2*t]=0;E[512]=1,e.we=e.he=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++i<o&&n==s||(c>i?U[2*n]+=i:0!==n?(n!=r&&U[2*n]++,U[32]++):i>10?U[36]++:U[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ne[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<<F&65535,Q(L),L=n>>>16-F,F+=r-16):(L|=e<<F&65535,F+=r)}function Y(e,t){const n=2*e;X(65535&t[n],65535&t[n+1])}function Z(e,t){let n,r,s=-1,i=e[1],o=0,c=7,f=4;for(0===i&&(c=138,f=3),n=0;t>=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,U)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,U),o--),Y(16,U),X(o-3,2)):o>10?(Y(18,U),X(o-11,7)):(Y(17,U),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Oe[W]=t,e.Te[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(Fe.ke[n]+256+1)]++,M[2*Fe.ze(t)]++),!(8191&W)&&D>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+Fe.xe[o]);if(s>>>=3,j<r.floor(W/2)&&s<r.floor(i/2))return!0}return W==T-1}function te(t,n){let r,s,i,o,c=0;if(0!==W)do{r=e.Oe[c],s=e.Te[c],c++,0===r?Y(s,t):(i=Fe.ke[s],Y(i+256+1,t),o=Fe.Ce[i],0!==o&&(s-=Fe.ve[i],X(s,o)),r--,i=Fe.ze(r),Y(i,n),o=Fe.xe[i],0!==o&&(r-=Fe.Se[i],X(r,o)))}while(W>c);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ne.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;D>0?(K.re(e),N.re(e),o=(()=>{let t;for(G(E,K.de),G(M,N.de),O.re(e),t=18;t>=3&&0===U[2*Fe._e[t]+1];t--);return e.we+=14+3*(t+1),t})(),s=e.we+3+7>>>3,i=e.he+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(qe.Ie,qe.Ee)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(U[2*Fe._e[r]+1],3);Z(E,e-1),Z(M,t-1)})(K.de+1,N.de+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.We()}function ie(){let e,n,r,s;do{if(s=w-A-C,0===s&&0===C&&0===A)s=f;else if(-1==s)s--;else if(C>=f+f-et){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.je)return;e=t.He(u,C+A,s),A+=e,3>A||(p=255&u[C],p=(p<<g^255&u[C+1])&b)}while(et>A&&0!==t.je)}function oe(e){let t,n,r=I,s=C,i=_;const o=C>f-et?C-(f-et):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>_||(r>>=2),c>A&&(c=A);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>A?A:i}e.ue=[],e.ge=[],e.le=[],E=[],M=[],U=[],e.pe=(t,n)=>{const r=e.le,s=r[n];let i=n<<1;for(;i<=e.fe&&(i<e.fe&&tt(t,r[i+1],r[i],e.ue)&&i++,!tt(t,s,r[i],e.ue));)r[n]=r[i],n=i,i<<=1;r[n]=s},e.Le=(t,S,x,W,j,G)=>(W||(W=8),j||(j=8),G||(G=0),t.Fe=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?We:(t.qe=e,a=x,f=1<<a,l=f-1,m=j+7,y=1<<m,b=y-1,g=r.floor((m+3-1)/3),u=new i(2*f),h=[],d=[],T=1<<j+6,e.Ne=new i(4*T),s=4*T,e.Oe=new o(T),e.Te=new i(T),D=S,V=G,(t=>(t.Ge=t.Je=0,t.Fe=null,e.pending=0,e.Qe=0,n=Ze,c=0,K.se=E,K.oe=qe.Me,N.se=M,N.oe=qe.Ue,O.se=U,O.oe=qe.Ke,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;P=Xe[D].De,R=Xe[D].Pe,B=Xe[D].Ve,I=Xe[D].Re,C=0,k=0,A=0,v=_=2,z=0,p=0})(),0))(t))),e.Xe=()=>42!=n&&n!=Ze&&n!=$e?We:(e.Te=null,e.Oe=null,e.Ne=null,d=null,h=null,u=null,e.qe=null,n==Ze?-3:0),e.Ye=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?We:(Xe[D].Be!=Xe[t].Be&&0!==e.Ge&&(r=e.Ze(1)),D!=t&&(D=t,P=Xe[D].De,R=Xe[D].Pe,B=Xe[D].Ve,I=Xe[D].Re),V=n,r)},e.$e=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return We;if(3>i)return 0;for(i>f-et&&(i=f-et,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<<g^255&u[1])&b,s=0;i-3>=s;s++)p=(p<<g^255&u[s+2])&b,h[s&l]=d[p],d[p]=s;return 0},e.Ze=(r,i)=>{let o,w,m,I,R;if(i>4||0>i)return We;if(!r.et||!r.tt&&0!==r.je||n==$e&&4!=i)return r.Fe=Ye[4],We;if(0===r.nt)return r.Fe=Ye[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(D-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=Ze,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.We(),0===t.nt)return c=-1,0}else if(0===t.je&&I>=i&&4!=i)return t.Fe=Ye[7],-5;if(n==$e&&0!==t.je)return r.Fe=Ye[7],-5;if(0!==t.je||0!==A||0!=i&&n!=$e){switch(R=-1,Xe[D].Be){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=A){if(ie(),0===A&&0==e)return 0;if(0===A)break}if(C+=A,A=0,n=k+r,(0===C||C>=n)&&(A=C-n,C=n,se(!1),0===t.nt))return 0;if(C-k>=f-et&&(se(!1),0===t.nt))return 0}return se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(et>A){if(ie(),et>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C),0===r||(C-r&65535)>f-et||2!=V&&(v=oe(r)),3>v)n=ee(0,255&u[C]),A--,C++;else if(n=ee(C-x,v-3),A-=v,v>P||3>A)C+=v,v=0,p=255&u[C],p=(p<<g^255&u[C+1])&b;else{v--;do{C++,p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C}while(0!=--v);C++}if(n&&(se(!1),0===t.nt))return 0}return se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i);break;case 2:R=(e=>{let n,r,s=0;for(;;){if(et>A){if(ie(),et>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C),_=v,S=x,v=2,0!==s&&P>_&&f-et>=(C-s&65535)&&(2!=V&&(v=oe(s)),5>=v&&(1==V||3==v&&C-x>4096)&&(v=2)),3>_||v>_)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,A--,0===t.nt)return 0}else z=1,C++,A--;else{r=C+A-3,n=ee(C-1-S,_-3),A-=_-1,_-=2;do{++C>r||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C)}while(0!=--_);if(z=0,v=2,C++,n&&(se(!1),0===t.nt))return 0}}return 0!==z&&(n=ee(0,255&u[C-1]),z=0),se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i)}if(2!=R&&3!=R||(n=$e),0==R||2==R)return 0===t.nt&&(c=-1),0;if(1==R){if(1==i)X(2,3),Y(256,qe.Ie),$(),9>1+H+10-F&&(X(2,3),Y(256,qe.Ie),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.We(),0===t.nt)return c=-1,0}}return 4!=i?0:1}}function rt(){const e=this;e.rt=0,e.st=0,e.je=0,e.Ge=0,e.nt=0,e.Je=0}function st(e){const t=new rt,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.Le(f),t.et=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,o=t.Ze(0),0!=o)throw new s("deflating: "+t.Fe);t.st&&(t.st==n?w.push(new i(c)):w.push(c.subarray(0,t.st))),u+=t.st,r&&t.rt>0&&t.rt!=a&&(r(t.rt),a=t.rt)}while(t.je>0||0===t.nt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.st=0,t.nt=n,e=t.Ze(4),1!=e&&0!=e)throw new s("deflating: "+t.Fe);n-t.nt>0&&a.push(c.slice(0,t.st)),f+=t.st}while(t.je>0||0===t.nt);return t.Xe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}rt.prototype={Le(e,t){const n=this;return n.qe=new nt,t||(t=Oe),n.qe.Le(n,e,t)},Ze(e){const t=this;return t.qe?t.qe.Ze(t,e):We},Xe(){const e=this;if(!e.qe)return We;const t=e.qe.Xe();return e.qe=null,t},Ye(e,t){const n=this;return n.qe?n.qe.Ye(n,e,t):We},$e(e,t){const n=this;return n.qe?n.qe.$e(n,e,t):We},He(e,t,n){const r=this;let s=r.je;return s>n&&(s=n),0===s?0:(r.je-=s,e.set(r.tt.subarray(r.rt,r.rt+s),t),r.rt+=s,r.Ge+=s,s)},We(){const e=this;let t=e.qe.pending;t>e.nt&&(t=e.nt),0!==t&&(e.et.set(e.qe.Ne.subarray(e.qe.Qe,e.qe.Qe+t),e.st),e.st+=t,e.qe.Qe+=t,e.Je+=t,e.nt-=t,e.qe.pending-=t,0===e.qe.pending&&(e.qe.Qe=0))}};const it=0,ot=1,ct=-2,ft=-3,at=-4,lt=-5,ut=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],wt=1440,ht=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],dt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],pt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],yt=[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,112,112],mt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],bt=[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],gt=15;function kt(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,A,_,I,P;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,it;for(S=u[0],k=1;gt>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=gt;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<<k;g>k;k++,I<<=1)if(0>(I-=n[k]))return ft;if(0>(I-=n[g]))return ft;for(n[g]+=I,i[1]=k=0,C=1,_=2;0!=--g;)i[_]=k+=n[C],_++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g<o);for(o=i[m],i[0]=g=0,C=0,b=-1,A=-S,s[0]=0,x=0,P=0;m>=v;v++)for(p=n[v];0!=p--;){for(;v>A+S;){if(b++,A+=S,P=m-A,P=P>S?S:P,(y=1<<(k=v-A))>p+1&&(y-=p+1,_=v,P>k))for(;++k<P&&(y<<=1)>n[++_];)y-=n[_];if(P=1<<k,h[0]+P>wt)return ft;s[b]=x=h[0],h[0]+=P,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>A-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-A,o>C?d[C]<c?(r[0]=256>d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<<v-A,k=g>>>A;P>k;k+=y)w.set(r,3*(x+k));for(k=1<<v-1;g&k;k>>>=1)g^=k;for(g^=k,z=(1<<A)-1;(g&z)!=i[b];)b--,A-=S,z=(1<<A)-1}return 0!==I&&1!=m?lt:it}function c(o){let c;for(e||(e=[],t=[],n=new f(gt+1),r=[],s=new f(gt),i=new f(gt+1)),t.length<o&&(t=[]),c=0;o>c;c++)t[c]=0;for(c=0;gt+1>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,gt),0),i.set(n.subarray(0,gt+1),0)}this.it=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==ft?f.Fe="oversubscribed dynamic bit lengths tree":a!=lt&&0!==r[0]||(f.Fe="incomplete dynamic bit lengths tree",a=ft),a},this.ot=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,pt,yt,a,i,u,e,t),h!=it||0===i[0]?(h==ft?w.Fe="oversubscribed literal/length tree":h!=at&&(w.Fe="incomplete literal/length tree",h=ft),h):(c(288),h=o(s,n,r,0,mt,bt,l,f,u,e,t),h!=it||0===f[0]&&n>257?(h==ft?w.Fe="oversubscribed distance tree":h==lt?(w.Fe="incomplete distance tree",h=ft):h!=at&&(w.Fe="empty distance tree with lengths",h=ft),h):it)}}kt.ct=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=ht,r[0]=dt,it);const vt=0,St=1,zt=2,Ct=3,xt=4,At=5,_t=6,It=7,Pt=8,Dt=9;function Vt(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.rt,p=c.je,w=o.ft,h=o.lt,y=o.write,m=y<o.read?o.read-y-1:o.end-y,b=ut[e],g=ut[t];do{for(;20>h;)p--,w|=(255&c.ut(d++))<<h,h+=8;if(f=w&b,a=n,l=r,z=3*(l+f),0!==(u=a[z]))for(;;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15,k=a[z+2]+(w&ut[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.ut(d++))<<h,h+=8;for(f=w&g,a=s,l=i,z=3*(l+f),u=a[z];;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15;u>h;)p--,w|=(255&c.ut(d++))<<h,h+=8;if(v=a[z+2]+(w&ut[u]),w>>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.wt[y++]=o.wt[S++]}while(0!=--u);else o.wt.set(o.wt.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.wt[y++]=o.wt[S++],o.wt[y++]=o.wt[S++],k-=2):(o.wt.set(o.wt.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.wt[y++]=o.wt[S++]}while(0!=--k);else o.wt.set(o.wt.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(64&u)return c.Fe="invalid distance code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,ft;f+=a[z+2],f+=w&ut[u],z=3*(l+f),u=a[z]}break}if(64&u)return 32&u?(k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,ot):(c.Fe="invalid literal/length code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,ft);if(f+=a[z+2],f+=w&ut[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.wt[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.wt[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,it}e.init=(e,i,o,c,f,a)=>{t=vt,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.ht=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,A=0,_=0;for(_=y.rt,v=y.je,x=e.ft,A=e.lt,S=e.write,z=S<e.read?e.read-S-1:e.end-S;;)switch(t){case vt:if(z>=258&&v>=10&&(e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,m=p(u,w,r,h,s,d,e,y),_=y.rt,v=y.je,x=e.ft,A=e.lt,S=e.write,z=S<e.read?e.read-S-1:e.end-S,m!=it)){t=m==ot?It:Dt;break}c=u,n=r,o=h,t=St;case St:for(b=c;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<<A,A+=8}if(g=3*(o+(x&ut[b])),x>>>=n[g+1],A-=n[g+1],k=n[g],0===k){f=n[g+2],t=_t;break}if(16&k){a=15&k,i=n[g+2],t=zt;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}if(32&k){t=It;break}return t=Dt,y.Fe="invalid literal/length code",m=ft,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);case zt:for(b=a;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<<A,A+=8}i+=x&ut[b],x>>=b,A-=b,c=w,n=s,o=d,t=Ct;case Ct:for(b=c;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<<A,A+=8}if(g=3*(o+(x&ut[b])),x>>=n[g+1],A-=n[g+1],k=n[g],16&k){a=15&k,l=n[g+2],t=xt;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}return t=Dt,y.Fe="invalid distance code",m=ft,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);case xt:for(b=a;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<<A,A+=8}l+=x&ut[b],x>>=b,A-=b,t=At;case At:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.dt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);e.wt[S++]=e.wt[C++],z--,C==e.end&&(C=0),i--}t=vt;break;case _t:if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.dt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,e.wt[S++]=f,z--,t=vt;break;case It:if(A>7&&(A-=8,v++,_--),e.write=S,m=e.dt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,e.read!=e.write)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);t=Pt;case Pt:return m=ot,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);case Dt:return m=ft,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);default:return m=ct,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m)}},e.yt=()=>{}}const Rt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Bt=0,Et=1,Mt=2,Ut=3,Kt=4,Nt=5,Ot=6,Tt=7,Wt=8,jt=9;function Ht(e,t){const n=this;let r,s=Bt,o=0,c=0,a=0;const l=[0],u=[0],w=new Vt;let h=0,d=new f(3*wt);const p=new kt;n.lt=0,n.ft=0,n.wt=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),s==Ot&&w.yt(e),s=Bt,n.lt=0,n.ft=0,n.read=n.write=0},n.reset(e,null),n.dt=(e,t)=>{let r,s,i;return s=e.st,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.nt&&(r=e.nt),0!==r&&t==lt&&(t=it),e.nt-=r,e.Je+=r,e.et.set(n.wt.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.nt&&(r=e.nt),0!==r&&t==lt&&(t=it),e.nt-=r,e.Je+=r,e.et.set(n.wt.subarray(i,i+r),s),s+=r,i+=r),e.st=s,n.read=i,t},n.ht=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.rt,b=e.je,f=n.ft,y=n.lt,g=n.write,k=g<n.read?n.read-g-1:n.end-g;;){let S,z,C,x,A,_,I,P;switch(s){case Bt:for(;3>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}switch(i=7&f,h=1&i,i>>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=Et;break;case 1:S=[],z=[],C=[[]],x=[[]],kt.ct(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=Ot;break;case 2:f>>>=3,y-=3,s=Ut;break;case 3:return f>>>=3,y-=3,s=jt,e.Fe="invalid block type",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t)}break;case Et:for(;32>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}if((~f>>>16&65535)!=(65535&f))return s=jt,e.Fe="invalid stored block lengths",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);o=65535&f,f=y=0,s=0!==o?Mt:0!==h?Tt:Bt;break;case Mt:if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k&&(n.write=g,t=n.dt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k)))return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);if(t=it,i=o,i>b&&(i=b),i>k&&(i=k),n.wt.set(e.He(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?Tt:Bt;break;case Ut:for(;14>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}if(c=i=16383&f,(31&i)>29||(i>>5&31)>29)return s=jt,e.Fe="too many length or distance symbols",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.length<i)r=[];else for(v=0;i>v;v++)r[v]=0;f>>>=14,y-=14,a=0,s=Kt;case Kt:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}r[Rt[a++]]=7&f,f>>>=3,y-=3}for(;19>a;)r[Rt[a++]]=0;if(l[0]=7,i=p.it(r,l,u,d,e),i!=it)return(t=i)==ft&&(r=null,s=jt),n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);a=0,s=Nt;case Nt:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}if(i=d[3*(u[0]+(f&ut[i]))+1],w=d[3*(u[0]+(f&ut[i]))+2],16>w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}if(f>>>=i,y-=i,o+=f&ut[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=jt,e.Fe="invalid bit length repeat",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,A=[],_=[],I=[],P=[],A[0]=9,_[0]=6,i=c,i=p.ot(257+(31&i),1+(i>>5&31),r,A,_,I,P,d,e),i!=it)return i==ft&&(r=null,s=jt),t=i,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);w.init(A[0],_[0],d,I[0],d,P[0]),s=Ot;case Ot:if(n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,(t=w.ht(n,e,t))!=ot)return n.dt(e,t);if(t=it,w.yt(e),m=e.rt,b=e.je,f=n.ft,y=n.lt,g=n.write,k=g<n.read?n.read-g-1:n.end-g,0===h){s=Bt;break}s=Tt;case Tt:if(n.write=g,t=n.dt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,n.read!=n.write)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);s=Wt;case Wt:return t=ot,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);case jt:return t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);default:return t=ct,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t)}}},n.yt=e=>{n.reset(e,null),n.wt=null,d=null},n.bt=(e,t,r)=>{n.wt.set(e.subarray(t,t+r),0),n.read=n.write=r},n.gt=()=>s==Et?1:0}const Lt=13,Ft=[0,0,255,255];function qt(){const e=this;function t(e){return e&&e.kt?(e.Ge=e.Je=0,e.Fe=null,e.kt.mode=7,e.kt.vt.reset(e,null),it):ct}e.mode=0,e.method=0,e.St=[0],e.zt=0,e.marker=0,e.Ct=0,e.xt=t=>(e.vt&&e.vt.yt(t),e.vt=null,it),e.At=(n,r)=>(n.Fe=null,e.vt=null,8>r||r>15?(e.xt(n),ct):(e.Ct=r,n.kt.vt=new Ht(n,1<<r),t(n),it)),e._t=(e,t)=>{let n,r;if(!e||!e.kt||!e.tt)return ct;const s=e.kt;for(t=4==t?lt:it,n=lt;;)switch(s.mode){case 0:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,8!=(15&(s.method=e.ut(e.rt++)))){s.mode=Lt,e.Fe="unknown compression method",s.marker=5;break}if(8+(s.method>>4)>s.Ct){s.mode=Lt,e.Fe="invalid win size",s.marker=5;break}s.mode=1;case 1:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,r=255&e.ut(e.rt++),((s.method<<8)+r)%31!=0){s.mode=Lt,e.Fe="incorrect header check",s.marker=5;break}if(!(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt=(255&e.ut(e.rt++))<<24&4278190080,s.mode=3;case 3:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.ut(e.rt++))<<16&16711680,s.mode=4;case 4:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.ut(e.rt++))<<8&65280,s.mode=5;case 5:return 0===e.je?n:(n=t,e.je--,e.Ge++,s.zt+=255&e.ut(e.rt++),s.mode=6,2);case 6:return s.mode=Lt,e.Fe="need dictionary",s.marker=0,ct;case 7:if(n=s.vt.ht(e,n),n==ft){s.mode=Lt,s.marker=0;break}if(n==it&&(n=t),n!=ot)return n;n=t,s.vt.reset(e,s.St),s.mode=12;case 12:return e.je=0,ot;case Lt:return ft;default:return ct}},e.It=(e,t,n)=>{let r=0,s=n;if(!e||!e.kt||6!=e.kt.mode)return ct;const i=e.kt;return s<1<<i.Ct||(s=(1<<i.Ct)-1,r=n-s),i.vt.bt(t,r,s),i.mode=7,it},e.Pt=e=>{let n,r,s,i,o;if(!e||!e.kt)return ct;const c=e.kt;if(c.mode!=Lt&&(c.mode=Lt,c.marker=0),0===(n=e.je))return lt;for(r=e.rt,s=c.marker;0!==n&&4>s;)e.ut(r)==Ft[s]?s++:s=0!==e.ut(r)?0:4-s,r++,n--;return e.Ge+=r-e.rt,e.rt=r,e.je=n,c.marker=s,4!=s?ft:(i=e.Ge,o=e.Je,t(e),e.Ge=i,e.Je=o,c.mode=7,it)},e.Dt=e=>e&&e.kt&&e.kt.vt?e.kt.vt.gt():ct}function Gt(){}function Jt(e){const t=new Gt,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.At(),t.et=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,0!==t.je||c||(t.rt=0,c=!0),a=t._t(0),c&&a===lt){if(0!==t.je)throw new s("inflating: bad input")}else if(a!==it&&a!==ot)throw new s("inflating: "+t.Fe);if((c||a===ot)&&t.je===e.length)throw new s("inflating: bad input");t.st&&(t.st===n?f.push(new i(o)):f.push(o.subarray(0,t.st))),h+=t.st,r&&t.rt>0&&t.rt!=u&&(r(t.rt),u=t.rt)}while(t.je>0||0===t.nt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.xt()}}Gt.prototype={At(e){const t=this;return t.kt=new qt,e||(e=15),t.kt.At(t,e)},_t(e){const t=this;return t.kt?t.kt._t(t,e):ct},xt(){const e=this;if(!e.kt)return ct;const t=e.kt.xt(e);return e.kt=null,t},Pt(){const e=this;return e.kt?e.kt.Pt(e):ct},It(e,t){const n=this;return n.kt?n.kt.It(n,e,t):ct},ut(e){return this.tt[e]},He(e,t){return this.tt.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=st,self.Inflate=Jt};\n'],{type:"text/javascript"}));e({workerScripts:{inflate:[t],deflate:[t]}})}export{e as configureWebWorker}; | ||
function e(e,t={}){const n='const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self,k=void 0,v="undefined",S="function";class z{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const C=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;C[e]=t}class x{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^C[255&(t^e[n])];this.t=t}get(){return~this.t}}class A extends p{constructor(){let e;const t=new x;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const _={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=_.i(n);return 32===r?e.concat(t):_.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+_.i(n)},u(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,r.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=_.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s<e.length;s++)r.push(n|e[s]>>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=_.i(s);return r.push(_.h(t+i&31,t+i>32?n:r.pop(),1)),r}},I={p:{m(e){const t=_.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)3&s||(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},k(e){const t=[];let n,r=0;for(n=0;n<e.length;n++)r=r<<8|e[n],3&~n||(t.push(r),r=0);return 3&n&&t.push(_.h(8*(3&n),r)),t}}},P=class{constructor(e){const t=this;t.blockSize=512,t.v=[1732584193,4023233417,2562383102,271733878,3285377520],t.S=[1518500249,1859775393,2400959708,3395469782],e?(t.C=e.C.slice(0),t.A=e.A.slice(0),t._=e._):t.reset()}reset(){const e=this;return e.C=e.v.slice(0),e.A=[],e._=0,e}update(e){const t=this;"string"==typeof e&&(e=I.I.k(e));const n=t.A=_.concat(t.A,e),r=t._,i=t._=r+_.l(e);if(i>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.P(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}D(){const e=this;let t=e.A;const n=e.C;t=_.concat(t,[_.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e._/4294967296)),t.push(0|e._);t.length;)e.P(t.splice(0,16));return e.reset(),n}V(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}R(e,t){return t<<e|t>>>32-e}P(t){const n=this,s=n.C,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.R(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.R(5,o)+n.V(e,c,f,a)+l+i[e]+n.S[r.floor(e/20)]|0;l=a,a=f,f=n.R(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},D={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;i<e.length;i+=4){const e=n(4294967296*(s||r.random()));s=987654071*e(),t[i/4]=4294967296*e()|0}return e}},V={importKey:e=>new V.B(I.p.k(e)),M(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=_;for(t=I.p.k(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;a<c.length;a++)o[a]^=c[a];for(f=0;(i||1)>d&&f<o.length;f++)h.setInt32(d,o[f]),d+=4}return w.slice(0,r/8)},B:class{constructor(e){const t=this,n=t.U=P,r=[[],[]];t.K=[new n,new n];const s=t.K[0].blockSize/32;e.length>s&&(e=(new n).update(e).D());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.K[0].update(r[0]),t.K[1].update(r[1]),t.N=new n(t.K[0])}reset(){const e=this;e.N=new e.U(e.K[0]),e.O=!1}update(e){this.O=!0,this.N.update(e)}digest(){const e=this,t=e.N.D(),n=new e.U(e.K[1]).update(t).D();return e.reset(),n}encrypt(e){if(this.O)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},R=typeof h!=v&&typeof h.getRandomValues==S,B="Invalid password",E="Invalid signature",M="zipjs-abort-check-password";function U(e){return R?h.getRandomValues(e):D.getRandomValues(e)}const K=16,N={name:"PBKDF2"},O=t.assign({hash:{name:"HMAC"}},N),T=t.assign({iterations:1e3,hash:{name:"SHA-1"}},N),W=["deriveBits"],j=[8,12,16],H=[16,24,32],L=10,F=[0,0,0,0],q=typeof h!=v,G=q&&h.subtle,J=q&&typeof G!=v,Q=I.p,X=class{constructor(e){const t=this;t.T=[[[],[],[],[],[]],[[],[],[],[],[]]],t.T[0][0][0]||t.W();const n=t.T[0][4],r=t.T[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s("invalid aes key size");for(t.S=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.j(e,0)}decrypt(e){return this.j(e,1)}W(){const e=this.T[0],t=this.T[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}j(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this.S[t],r=n.length/4-2,i=[0,0,0,0],o=this.T[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},Y=class{constructor(e,t){this.H=e,this.L=t,this.F=t}reset(){this.F=this.L}update(e){return this.q(this.H,e,this.F)}G(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}return e}J(e){0===(e[0]=this.G(e[0]))&&(e[1]=this.G(e[1]))}q(e,t,n){let r;if(!(r=t.length))return[];const s=_.l(t);for(let s=0;r>s;s+=4){this.J(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return _.u(t,s)}},Z=V.B;let $=q&&J&&typeof G.importKey==S,ee=q&&J&&typeof G.deriveBits==S;class te extends p{constructor({password:e,rawPassword:n,signed:r,encryptionStrength:o,checkPasswordOnly:c}){super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),signed:r,Y:o-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:o,X:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await se(e,t,n,ce(r,0,j[t])),o=ce(r,j[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(B)})(n,o,r,ce(e,0,j[o]+2)),e=ce(e,j[o]+2),c?t.error(new s(M)):f()):await a;const l=new i(e.length-L-(e.length-L)%K);t.enqueue(re(n,e,l,0,L,!0))},async flush(e){const{signed:t,Z:n,$:r,pending:o,ready:c}=this;if(r&&n){await c;const f=ce(o,0,o.length-L),a=ce(o,o.length-L);let l=new i;if(f.length){const e=ae(Q,f);r.update(e);const t=n.update(e);l=fe(Q,t)}if(t){const e=ce(fe(Q,r.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=a[t])throw new s(E)}e.enqueue(l)}}})}}class ne extends p{constructor({password:e,rawPassword:n,encryptionStrength:r}){let s;super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),Y:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:s,X:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=U(new i(j[t]));return oe(r,await se(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%K);a.set(f,0),t.enqueue(re(n,e,a,f.length,0))},async flush(e){const{Z:t,$:n,pending:r,ready:o}=this;if(n&&t){await o;let c=new i;if(r.length){const e=t.update(ae(Q,r));n.update(e),c=fe(Q,e)}s.signature=fe(Q,n.digest()).slice(0,L),e.enqueue(oe(c,s.signature))}}}),s=this}}function re(e,t,n,r,s,o){const{Z:c,$:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=oe(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%K)),u=0;l-K>=u;u+=K){const e=ae(Q,ce(t,u,u+K));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(fe(Q,s),u+r)}return e.pending=ce(t,u),n}async function se(n,r,s,o){n.password=null;const c=await(async(e,t,n,r,s)=>{if(!$)return V.importKey(t);try{return await G.importKey("raw",t,n,!1,s)}catch(e){return $=!1,V.importKey(t)}})(0,s,O,0,W),f=await(async(e,t,n)=>{if(!ee)return V.M(t,e.salt,T.iterations,n);try{return await G.deriveBits(e,t,n)}catch(r){return ee=!1,V.M(t,e.salt,T.iterations,n)}})(t.assign({salt:o},T),c,8*(2*H[r]+2)),a=new i(f),l=ae(Q,ce(a,0,H[r])),u=ae(Q,ce(a,H[r],2*H[r])),w=ce(a,2*H[r]);return t.assign(n,{keys:{key:l,ee:u,passwordVerification:w},Z:new Y(new X(l),e.from(F)),$:new Z(u)}),w}function ie(e,t){return t===k?(e=>{if(typeof w==v){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new w).encode(e)})(e):t}function oe(e,t){let n=e;return e.length+t.length&&(n=new i(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ce(e,t,n){return e.subarray(t,n)}function fe(e,t){return e.m(t)}function ae(e,t){return e.k(t)}class le extends p{constructor({password:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;if(n.password){const t=we(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(B);e=e.subarray(12)}r?t.error(new s(M)):t.enqueue(we(n,e))}})}}class ue extends p{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;let r,s;if(n.password){n.password=null;const t=U(new i(12));t[11]=n.passwordVerification,r=new i(e.length+t.length),r.set(he(n,t),0),s=12}else r=new i(e.length),s=0;r.set(he(n,e),s),t.enqueue(r)}})}}function we(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,n[r]);return n}function he(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,t[r]);return n}function de(e,n){const r=[305419896,591751049,878082192];t.assign(e,{keys:r,te:new x(r[0]),ne:new x(r[2])});for(let t=0;t<n.length;t++)pe(e,n.charCodeAt(t))}function pe(e,t){let[n,s,i]=e.keys;e.te.append([t]),n=~e.te.get(),s=be(r.imul(be(s+me(n)),134775813)+1),e.ne.append([s>>>24]),i=~e.ne.get(),e.keys=[n,s,i]}function ye(e){const t=2|e.keys[2];return me(r.imul(t,1^t)>>>8)}function me(e){return 255&e}function be(e){return 4294967295&e}const ge="deflate-raw";class ke extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=Se(super.readable);i&&!c||!f||(w=new A,d=xe(d,w)),s&&(d=Ce(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=xe(d,new ue(e)):(h=new ne(e),d=xe(d,h))),ze(u,d,(()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ve extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=Se(super.readable);o&&(i?d=xe(d,new le(e)):(h=new te(e),d=xe(d,h))),a&&(d=Ce(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new A,d=xe(d,w)),ze(this,d,(()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(E)}}))}}function Se(e){return xe(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ze(e,n,r){n=xe(n,new p({flush:r})),t.defineProperty(e,"readable",{get:()=>n})}function Ce(e,t,n,r,s){try{e=xe(e,new(t&&r?r:s)(ge,n))}catch(r){if(!t)return e;try{e=xe(e,new s(ge,n))}catch(t){return e}}return e}function xe(e,t){return e.pipeThrough(t)}const Ae="data",_e="close";class Ie extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith("deflate")?i=ke:s.startsWith("inflate")&&(i=ve);let o=0,c=0;const f=new i(e,n),a=super.readable,l=new p({transform(e,t){e&&e.length&&(c+=e.length,t.enqueue(e))},flush(){t.assign(r,{inputSize:c})}}),u=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=f;t.assign(r,{signature:e,outputSize:o,inputSize:c})}});t.defineProperty(r,"readable",{get:()=>a.pipeThrough(l).pipeThrough(f).pipeThrough(u)})}}class Pe extends p{constructor(e){let t;super({transform:function n(r,s){if(t){const e=new i(t.length+r.length);e.set(t),e.set(r,t.length),r=e,t=null}r.length>e?(s.enqueue(r.slice(0,e)),n(r.slice(e),s)):t=r},flush(e){t&&t.length&&e.enqueue(t)}})}}const De=new a,Ve=new a;let Re,Be=0,Ee=!0;async function Me(e){try{const{options:t,scripts:r,config:s}=e;if(r&&r.length)try{Ee?importScripts.apply(k,r):await Ue(r)}catch(e){Ee=!1,await Ue(r)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new z(self.Deflate)),self.Inflate&&(s.DecompressionStream=new z(self.Inflate));const i={highWaterMark:1},o=e.readable||new y({async pull(e){const t=new u((e=>De.set(Be,e)));Ke({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ve.set(Be,t),Ke({type:Ae,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new Ie(t,s);Re=new AbortController;const{signal:a}=Re;await o.pipeThrough(f).pipeThrough(new Pe(s.chunkSize)).pipeTo(c,{signal:a,preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{signature:l,inputSize:w,outputSize:h}=f;Ke({type:_e,result:{signature:l,inputSize:w,outputSize:h}})}catch(e){Ne(e)}}async function Ue(e){for(const t of e)await import(t)}function Ke(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ne(e=new s("Unknown error")){const{message:t,stack:n,code:r,name:i}=e;d({error:{message:t,stack:n,code:r,name:i}})}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if("start"==t&&Me(e),t==Ae){const e=De.get(n);De.delete(n),e({value:new i(r),done:s})}if("ack"==t){const e=Ve.get(n);Ve.delete(n),e()}t==_e&&Re.abort()}catch(e){Ne(e)}}));const Oe=15,Te=573,We=-2;function je(t){return He(t.map((([t,n])=>new e(t).fill(n,0,t))))}function He(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?He(n):n)),[])}const Le=[0,1,2,3].concat(...je([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function Fe(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.re=n=>{const s=e.se,i=e.oe.ie,o=e.oe.ce;let c,f,a,l=-1;for(n.fe=0,n.ae=Te,c=0;o>c;c++)0!==s[2*c]?(n.le[++n.fe]=l=c,n.ue[c]=0):s[2*c+1]=0;for(;2>n.fe;)a=n.le[++n.fe]=2>l?++l:0,s[2*a]=1,n.ue[a]=0,n.we--,i&&(n.he-=i[2*a+1]);for(e.de=l,c=r.floor(n.fe/2);c>=1;c--)n.pe(s,c);a=o;do{c=n.le[1],n.le[1]=n.le[n.fe--],n.pe(s,1),f=n.le[1],n.le[--n.ae]=c,n.le[--n.ae]=f,s[2*a]=s[2*c]+s[2*f],n.ue[a]=r.max(n.ue[c],n.ue[f])+1,s[2*c+1]=s[2*f+1]=a,n.le[1]=a++,n.pe(s,1)}while(n.fe>=2);n.le[--n.ae]=n.le[1],(t=>{const n=e.se,r=e.oe.ie,s=e.oe.ye,i=e.oe.me,o=e.oe.be;let c,f,a,l,u,w,h=0;for(l=0;Oe>=l;l++)t.ge[l]=0;for(n[2*t.le[t.ae]+1]=0,c=t.ae+1;Te>c;c++)f=t.le[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.de||(t.ge[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.we+=w*(l+u),r&&(t.he+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.ge[l];)l--;t.ge[l]--,t.ge[l+1]+=2,t.ge[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.ge[l];0!==f;)a=t.le[--c],a>e.de||(n[2*a+1]!=l&&(t.we+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;Oe>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.de,n.ge)}}function qe(e,t,n,r,s){const i=this;i.ie=e,i.ye=t,i.me=n,i.ce=r,i.be=s}Fe.ke=[0,1,2,3,4,5,6,7].concat(...je([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),Fe.ve=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],Fe.Se=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],Fe.ze=e=>256>e?Le[e]:Le[256+(e>>>7)],Fe.Ce=[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],Fe.xe=[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],Fe.Ae=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Fe._e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Ge=je([[144,8],[112,9],[24,7],[8,8]]);qe.Ie=He([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Ge[t]])));const Je=je([[30,5]]);function Qe(e,t,n,r,s){const i=this;i.Pe=e,i.De=t,i.Ve=n,i.Re=r,i.Be=s}qe.Ee=He([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,Je[t]]))),qe.Me=new qe(qe.Ie,Fe.Ce,257,286,Oe),qe.Ue=new qe(qe.Ee,Fe.xe,0,30,Oe),qe.Ke=new qe(null,Fe.Ae,0,19,7);const Xe=[new Qe(0,0,0,0,0),new Qe(4,4,8,4,1),new Qe(4,5,16,8,1),new Qe(4,6,32,32,1),new Qe(4,4,16,16,2),new Qe(8,16,32,32,2),new Qe(8,16,128,128,2),new Qe(8,32,128,256,2),new Qe(32,128,258,1024,2),new Qe(32,258,258,4096,2)],Ye=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Ze=113,$e=666,et=262;function tt(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function nt(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,A,_,I,P,D,V,R,B,E,M,U;const K=new Fe,N=new Fe,O=new Fe;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)U[2*t]=0;E[512]=1,e.we=e.he=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++i<o&&n==s||(c>i?U[2*n]+=i:0!==n?(n!=r&&U[2*n]++,U[32]++):i>10?U[36]++:U[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ne[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<<F&65535,Q(L),L=n>>>16-F,F+=r-16):(L|=e<<F&65535,F+=r)}function Y(e,t){const n=2*e;X(65535&t[n],65535&t[n+1])}function Z(e,t){let n,r,s=-1,i=e[1],o=0,c=7,f=4;for(0===i&&(c=138,f=3),n=0;t>=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,U)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,U),o--),Y(16,U),X(o-3,2)):o>10?(Y(18,U),X(o-11,7)):(Y(17,U),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Oe[W]=t,e.Te[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(Fe.ke[n]+256+1)]++,M[2*Fe.ze(t)]++),!(8191&W)&&D>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+Fe.xe[o]);if(s>>>=3,j<r.floor(W/2)&&s<r.floor(i/2))return!0}return W==T-1}function te(t,n){let r,s,i,o,c=0;if(0!==W)do{r=e.Oe[c],s=e.Te[c],c++,0===r?Y(s,t):(i=Fe.ke[s],Y(i+256+1,t),o=Fe.Ce[i],0!==o&&(s-=Fe.ve[i],X(s,o)),r--,i=Fe.ze(r),Y(i,n),o=Fe.xe[i],0!==o&&(r-=Fe.Se[i],X(r,o)))}while(W>c);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ne.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;D>0?(K.re(e),N.re(e),o=(()=>{let t;for(G(E,K.de),G(M,N.de),O.re(e),t=18;t>=3&&0===U[2*Fe._e[t]+1];t--);return e.we+=14+3*(t+1),t})(),s=e.we+3+7>>>3,i=e.he+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(qe.Ie,qe.Ee)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(U[2*Fe._e[r]+1],3);Z(E,e-1),Z(M,t-1)})(K.de+1,N.de+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.We()}function ie(){let e,n,r,s;do{if(s=w-A-C,0===s&&0===C&&0===A)s=f;else if(-1==s)s--;else if(C>=f+f-et){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.je)return;e=t.He(u,C+A,s),A+=e,3>A||(p=255&u[C],p=(p<<g^255&u[C+1])&b)}while(et>A&&0!==t.je)}function oe(e){let t,n,r=I,s=C,i=_;const o=C>f-et?C-(f-et):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>_||(r>>=2),c>A&&(c=A);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>A?A:i}e.ue=[],e.ge=[],e.le=[],E=[],M=[],U=[],e.pe=(t,n)=>{const r=e.le,s=r[n];let i=n<<1;for(;i<=e.fe&&(i<e.fe&&tt(t,r[i+1],r[i],e.ue)&&i++,!tt(t,s,r[i],e.ue));)r[n]=r[i],n=i,i<<=1;r[n]=s},e.Le=(t,S,x,W,j,G)=>(W||(W=8),j||(j=8),G||(G=0),t.Fe=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?We:(t.qe=e,a=x,f=1<<a,l=f-1,m=j+7,y=1<<m,b=y-1,g=r.floor((m+3-1)/3),u=new i(2*f),h=[],d=[],T=1<<j+6,e.Ne=new i(4*T),s=4*T,e.Oe=new o(T),e.Te=new i(T),D=S,V=G,(t=>(t.Ge=t.Je=0,t.Fe=null,e.pending=0,e.Qe=0,n=Ze,c=0,K.se=E,K.oe=qe.Me,N.se=M,N.oe=qe.Ue,O.se=U,O.oe=qe.Ke,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;P=Xe[D].De,R=Xe[D].Pe,B=Xe[D].Ve,I=Xe[D].Re,C=0,k=0,A=0,v=_=2,z=0,p=0})(),0))(t))),e.Xe=()=>42!=n&&n!=Ze&&n!=$e?We:(e.Te=null,e.Oe=null,e.Ne=null,d=null,h=null,u=null,e.qe=null,n==Ze?-3:0),e.Ye=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?We:(Xe[D].Be!=Xe[t].Be&&0!==e.Ge&&(r=e.Ze(1)),D!=t&&(D=t,P=Xe[D].De,R=Xe[D].Pe,B=Xe[D].Ve,I=Xe[D].Re),V=n,r)},e.$e=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return We;if(3>i)return 0;for(i>f-et&&(i=f-et,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<<g^255&u[1])&b,s=0;i-3>=s;s++)p=(p<<g^255&u[s+2])&b,h[s&l]=d[p],d[p]=s;return 0},e.Ze=(r,i)=>{let o,w,m,I,R;if(i>4||0>i)return We;if(!r.et||!r.tt&&0!==r.je||n==$e&&4!=i)return r.Fe=Ye[4],We;if(0===r.nt)return r.Fe=Ye[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(D-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=Ze,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.We(),0===t.nt)return c=-1,0}else if(0===t.je&&I>=i&&4!=i)return t.Fe=Ye[7],-5;if(n==$e&&0!==t.je)return r.Fe=Ye[7],-5;if(0!==t.je||0!==A||0!=i&&n!=$e){switch(R=-1,Xe[D].Be){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=A){if(ie(),0===A&&0==e)return 0;if(0===A)break}if(C+=A,A=0,n=k+r,(0===C||C>=n)&&(A=C-n,C=n,se(!1),0===t.nt))return 0;if(C-k>=f-et&&(se(!1),0===t.nt))return 0}return se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(et>A){if(ie(),et>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C),0===r||(C-r&65535)>f-et||2!=V&&(v=oe(r)),3>v)n=ee(0,255&u[C]),A--,C++;else if(n=ee(C-x,v-3),A-=v,v>P||3>A)C+=v,v=0,p=255&u[C],p=(p<<g^255&u[C+1])&b;else{v--;do{C++,p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C}while(0!=--v);C++}if(n&&(se(!1),0===t.nt))return 0}return se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i);break;case 2:R=(e=>{let n,r,s=0;for(;;){if(et>A){if(ie(),et>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C),_=v,S=x,v=2,0!==s&&P>_&&f-et>=(C-s&65535)&&(2!=V&&(v=oe(s)),5>=v&&(1==V||3==v&&C-x>4096)&&(v=2)),3>_||v>_)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,A--,0===t.nt)return 0}else z=1,C++,A--;else{r=C+A-3,n=ee(C-1-S,_-3),A-=_-1,_-=2;do{++C>r||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C)}while(0!=--_);if(z=0,v=2,C++,n&&(se(!1),0===t.nt))return 0}}return 0!==z&&(n=ee(0,255&u[C-1]),z=0),se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i)}if(2!=R&&3!=R||(n=$e),0==R||2==R)return 0===t.nt&&(c=-1),0;if(1==R){if(1==i)X(2,3),Y(256,qe.Ie),$(),9>1+H+10-F&&(X(2,3),Y(256,qe.Ie),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.We(),0===t.nt)return c=-1,0}}return 4!=i?0:1}}function rt(){const e=this;e.rt=0,e.st=0,e.je=0,e.Ge=0,e.nt=0,e.Je=0}function st(e){const t=new rt,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.Le(f),t.et=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,o=t.Ze(0),0!=o)throw new s("deflating: "+t.Fe);t.st&&(t.st==n?w.push(new i(c)):w.push(c.subarray(0,t.st))),u+=t.st,r&&t.rt>0&&t.rt!=a&&(r(t.rt),a=t.rt)}while(t.je>0||0===t.nt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.st=0,t.nt=n,e=t.Ze(4),1!=e&&0!=e)throw new s("deflating: "+t.Fe);n-t.nt>0&&a.push(c.slice(0,t.st)),f+=t.st}while(t.je>0||0===t.nt);return t.Xe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}rt.prototype={Le(e,t){const n=this;return n.qe=new nt,t||(t=Oe),n.qe.Le(n,e,t)},Ze(e){const t=this;return t.qe?t.qe.Ze(t,e):We},Xe(){const e=this;if(!e.qe)return We;const t=e.qe.Xe();return e.qe=null,t},Ye(e,t){const n=this;return n.qe?n.qe.Ye(n,e,t):We},$e(e,t){const n=this;return n.qe?n.qe.$e(n,e,t):We},He(e,t,n){const r=this;let s=r.je;return s>n&&(s=n),0===s?0:(r.je-=s,e.set(r.tt.subarray(r.rt,r.rt+s),t),r.rt+=s,r.Ge+=s,s)},We(){const e=this;let t=e.qe.pending;t>e.nt&&(t=e.nt),0!==t&&(e.et.set(e.qe.Ne.subarray(e.qe.Qe,e.qe.Qe+t),e.st),e.st+=t,e.qe.Qe+=t,e.Je+=t,e.nt-=t,e.qe.pending-=t,0===e.qe.pending&&(e.qe.Qe=0))}};const it=0,ot=1,ct=-2,ft=-3,at=-4,lt=-5,ut=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],wt=1440,ht=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],dt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],pt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],yt=[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,112,112],mt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],bt=[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],gt=15;function kt(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,A,_,I,P;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,it;for(S=u[0],k=1;gt>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=gt;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<<k;g>k;k++,I<<=1)if(0>(I-=n[k]))return ft;if(0>(I-=n[g]))return ft;for(n[g]+=I,i[1]=k=0,C=1,_=2;0!=--g;)i[_]=k+=n[C],_++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g<o);for(o=i[m],i[0]=g=0,C=0,b=-1,A=-S,s[0]=0,x=0,P=0;m>=v;v++)for(p=n[v];0!=p--;){for(;v>A+S;){if(b++,A+=S,P=m-A,P=P>S?S:P,(y=1<<(k=v-A))>p+1&&(y-=p+1,_=v,P>k))for(;++k<P&&(y<<=1)>n[++_];)y-=n[_];if(P=1<<k,h[0]+P>wt)return ft;s[b]=x=h[0],h[0]+=P,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>A-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-A,o>C?d[C]<c?(r[0]=256>d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<<v-A,k=g>>>A;P>k;k+=y)w.set(r,3*(x+k));for(k=1<<v-1;g&k;k>>>=1)g^=k;for(g^=k,z=(1<<A)-1;(g&z)!=i[b];)b--,A-=S,z=(1<<A)-1}return 0!==I&&1!=m?lt:it}function c(o){let c;for(e||(e=[],t=[],n=new f(gt+1),r=[],s=new f(gt),i=new f(gt+1)),t.length<o&&(t=[]),c=0;o>c;c++)t[c]=0;for(c=0;gt+1>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,gt),0),i.set(n.subarray(0,gt+1),0)}this.it=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==ft?f.Fe="oversubscribed dynamic bit lengths tree":a!=lt&&0!==r[0]||(f.Fe="incomplete dynamic bit lengths tree",a=ft),a},this.ot=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,pt,yt,a,i,u,e,t),h!=it||0===i[0]?(h==ft?w.Fe="oversubscribed literal/length tree":h!=at&&(w.Fe="incomplete literal/length tree",h=ft),h):(c(288),h=o(s,n,r,0,mt,bt,l,f,u,e,t),h!=it||0===f[0]&&n>257?(h==ft?w.Fe="oversubscribed distance tree":h==lt?(w.Fe="incomplete distance tree",h=ft):h!=at&&(w.Fe="empty distance tree with lengths",h=ft),h):it)}}kt.ct=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=ht,r[0]=dt,it);const vt=0,St=1,zt=2,Ct=3,xt=4,At=5,_t=6,It=7,Pt=8,Dt=9;function Vt(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.rt,p=c.je,w=o.ft,h=o.lt,y=o.write,m=y<o.read?o.read-y-1:o.end-y,b=ut[e],g=ut[t];do{for(;20>h;)p--,w|=(255&c.ut(d++))<<h,h+=8;if(f=w&b,a=n,l=r,z=3*(l+f),0!==(u=a[z]))for(;;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15,k=a[z+2]+(w&ut[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.ut(d++))<<h,h+=8;for(f=w&g,a=s,l=i,z=3*(l+f),u=a[z];;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15;u>h;)p--,w|=(255&c.ut(d++))<<h,h+=8;if(v=a[z+2]+(w&ut[u]),w>>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.wt[y++]=o.wt[S++]}while(0!=--u);else o.wt.set(o.wt.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.wt[y++]=o.wt[S++],o.wt[y++]=o.wt[S++],k-=2):(o.wt.set(o.wt.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.wt[y++]=o.wt[S++]}while(0!=--k);else o.wt.set(o.wt.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(64&u)return c.Fe="invalid distance code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,ft;f+=a[z+2],f+=w&ut[u],z=3*(l+f),u=a[z]}break}if(64&u)return 32&u?(k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,ot):(c.Fe="invalid literal/length code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,ft);if(f+=a[z+2],f+=w&ut[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.wt[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.wt[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,it}e.init=(e,i,o,c,f,a)=>{t=vt,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.ht=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,A=0,_=0;for(_=y.rt,v=y.je,x=e.ft,A=e.lt,S=e.write,z=S<e.read?e.read-S-1:e.end-S;;)switch(t){case vt:if(z>=258&&v>=10&&(e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,m=p(u,w,r,h,s,d,e,y),_=y.rt,v=y.je,x=e.ft,A=e.lt,S=e.write,z=S<e.read?e.read-S-1:e.end-S,m!=it)){t=m==ot?It:Dt;break}c=u,n=r,o=h,t=St;case St:for(b=c;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<<A,A+=8}if(g=3*(o+(x&ut[b])),x>>>=n[g+1],A-=n[g+1],k=n[g],0===k){f=n[g+2],t=_t;break}if(16&k){a=15&k,i=n[g+2],t=zt;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}if(32&k){t=It;break}return t=Dt,y.Fe="invalid literal/length code",m=ft,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);case zt:for(b=a;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<<A,A+=8}i+=x&ut[b],x>>=b,A-=b,c=w,n=s,o=d,t=Ct;case Ct:for(b=c;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<<A,A+=8}if(g=3*(o+(x&ut[b])),x>>=n[g+1],A-=n[g+1],k=n[g],16&k){a=15&k,l=n[g+2],t=xt;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}return t=Dt,y.Fe="invalid distance code",m=ft,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);case xt:for(b=a;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<<A,A+=8}l+=x&ut[b],x>>=b,A-=b,t=At;case At:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.dt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);e.wt[S++]=e.wt[C++],z--,C==e.end&&(C=0),i--}t=vt;break;case _t:if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.dt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,e.wt[S++]=f,z--,t=vt;break;case It:if(A>7&&(A-=8,v++,_--),e.write=S,m=e.dt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,e.read!=e.write)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);t=Pt;case Pt:return m=ot,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);case Dt:return m=ft,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);default:return m=ct,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m)}},e.yt=()=>{}}const Rt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Bt=0,Et=1,Mt=2,Ut=3,Kt=4,Nt=5,Ot=6,Tt=7,Wt=8,jt=9;function Ht(e,t){const n=this;let r,s=Bt,o=0,c=0,a=0;const l=[0],u=[0],w=new Vt;let h=0,d=new f(3*wt);const p=new kt;n.lt=0,n.ft=0,n.wt=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),s==Ot&&w.yt(e),s=Bt,n.lt=0,n.ft=0,n.read=n.write=0},n.reset(e,null),n.dt=(e,t)=>{let r,s,i;return s=e.st,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.nt&&(r=e.nt),0!==r&&t==lt&&(t=it),e.nt-=r,e.Je+=r,e.et.set(n.wt.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.nt&&(r=e.nt),0!==r&&t==lt&&(t=it),e.nt-=r,e.Je+=r,e.et.set(n.wt.subarray(i,i+r),s),s+=r,i+=r),e.st=s,n.read=i,t},n.ht=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.rt,b=e.je,f=n.ft,y=n.lt,g=n.write,k=g<n.read?n.read-g-1:n.end-g;;){let S,z,C,x,A,_,I,P;switch(s){case Bt:for(;3>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}switch(i=7&f,h=1&i,i>>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=Et;break;case 1:S=[],z=[],C=[[]],x=[[]],kt.ct(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=Ot;break;case 2:f>>>=3,y-=3,s=Ut;break;case 3:return f>>>=3,y-=3,s=jt,e.Fe="invalid block type",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t)}break;case Et:for(;32>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}if((~f>>>16&65535)!=(65535&f))return s=jt,e.Fe="invalid stored block lengths",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);o=65535&f,f=y=0,s=0!==o?Mt:0!==h?Tt:Bt;break;case Mt:if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k&&(n.write=g,t=n.dt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k)))return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);if(t=it,i=o,i>b&&(i=b),i>k&&(i=k),n.wt.set(e.He(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?Tt:Bt;break;case Ut:for(;14>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}if(c=i=16383&f,(31&i)>29||(i>>5&31)>29)return s=jt,e.Fe="too many length or distance symbols",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.length<i)r=[];else for(v=0;i>v;v++)r[v]=0;f>>>=14,y-=14,a=0,s=Kt;case Kt:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}r[Rt[a++]]=7&f,f>>>=3,y-=3}for(;19>a;)r[Rt[a++]]=0;if(l[0]=7,i=p.it(r,l,u,d,e),i!=it)return(t=i)==ft&&(r=null,s=jt),n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);a=0,s=Nt;case Nt:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}if(i=d[3*(u[0]+(f&ut[i]))+1],w=d[3*(u[0]+(f&ut[i]))+2],16>w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<<y,y+=8}if(f>>>=i,y-=i,o+=f&ut[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=jt,e.Fe="invalid bit length repeat",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,A=[],_=[],I=[],P=[],A[0]=9,_[0]=6,i=c,i=p.ot(257+(31&i),1+(i>>5&31),r,A,_,I,P,d,e),i!=it)return i==ft&&(r=null,s=jt),t=i,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);w.init(A[0],_[0],d,I[0],d,P[0]),s=Ot;case Ot:if(n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,(t=w.ht(n,e,t))!=ot)return n.dt(e,t);if(t=it,w.yt(e),m=e.rt,b=e.je,f=n.ft,y=n.lt,g=n.write,k=g<n.read?n.read-g-1:n.end-g,0===h){s=Bt;break}s=Tt;case Tt:if(n.write=g,t=n.dt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,n.read!=n.write)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);s=Wt;case Wt:return t=ot,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);case jt:return t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);default:return t=ct,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t)}}},n.yt=e=>{n.reset(e,null),n.wt=null,d=null},n.bt=(e,t,r)=>{n.wt.set(e.subarray(t,t+r),0),n.read=n.write=r},n.gt=()=>s==Et?1:0}const Lt=13,Ft=[0,0,255,255];function qt(){const e=this;function t(e){return e&&e.kt?(e.Ge=e.Je=0,e.Fe=null,e.kt.mode=7,e.kt.vt.reset(e,null),it):ct}e.mode=0,e.method=0,e.St=[0],e.zt=0,e.marker=0,e.Ct=0,e.xt=t=>(e.vt&&e.vt.yt(t),e.vt=null,it),e.At=(n,r)=>(n.Fe=null,e.vt=null,8>r||r>15?(e.xt(n),ct):(e.Ct=r,n.kt.vt=new Ht(n,1<<r),t(n),it)),e._t=(e,t)=>{let n,r;if(!e||!e.kt||!e.tt)return ct;const s=e.kt;for(t=4==t?lt:it,n=lt;;)switch(s.mode){case 0:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,8!=(15&(s.method=e.ut(e.rt++)))){s.mode=Lt,e.Fe="unknown compression method",s.marker=5;break}if(8+(s.method>>4)>s.Ct){s.mode=Lt,e.Fe="invalid win size",s.marker=5;break}s.mode=1;case 1:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,r=255&e.ut(e.rt++),((s.method<<8)+r)%31!=0){s.mode=Lt,e.Fe="incorrect header check",s.marker=5;break}if(!(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt=(255&e.ut(e.rt++))<<24&4278190080,s.mode=3;case 3:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.ut(e.rt++))<<16&16711680,s.mode=4;case 4:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.ut(e.rt++))<<8&65280,s.mode=5;case 5:return 0===e.je?n:(n=t,e.je--,e.Ge++,s.zt+=255&e.ut(e.rt++),s.mode=6,2);case 6:return s.mode=Lt,e.Fe="need dictionary",s.marker=0,ct;case 7:if(n=s.vt.ht(e,n),n==ft){s.mode=Lt,s.marker=0;break}if(n==it&&(n=t),n!=ot)return n;n=t,s.vt.reset(e,s.St),s.mode=12;case 12:return e.je=0,ot;case Lt:return ft;default:return ct}},e.It=(e,t,n)=>{let r=0,s=n;if(!e||!e.kt||6!=e.kt.mode)return ct;const i=e.kt;return s<1<<i.Ct||(s=(1<<i.Ct)-1,r=n-s),i.vt.bt(t,r,s),i.mode=7,it},e.Pt=e=>{let n,r,s,i,o;if(!e||!e.kt)return ct;const c=e.kt;if(c.mode!=Lt&&(c.mode=Lt,c.marker=0),0===(n=e.je))return lt;for(r=e.rt,s=c.marker;0!==n&&4>s;)e.ut(r)==Ft[s]?s++:s=0!==e.ut(r)?0:4-s,r++,n--;return e.Ge+=r-e.rt,e.rt=r,e.je=n,c.marker=s,4!=s?ft:(i=e.Ge,o=e.Je,t(e),e.Ge=i,e.Je=o,c.mode=7,it)},e.Dt=e=>e&&e.kt&&e.kt.vt?e.kt.vt.gt():ct}function Gt(){}function Jt(e){const t=new Gt,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.At(),t.et=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,0!==t.je||c||(t.rt=0,c=!0),a=t._t(0),c&&a===lt){if(0!==t.je)throw new s("inflating: bad input")}else if(a!==it&&a!==ot)throw new s("inflating: "+t.Fe);if((c||a===ot)&&t.je===e.length)throw new s("inflating: bad input");t.st&&(t.st===n?f.push(new i(o)):f.push(o.subarray(0,t.st))),h+=t.st,r&&t.rt>0&&t.rt!=u&&(r(t.rt),u=t.rt)}while(t.je>0||0===t.nt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.xt()}}Gt.prototype={At(e){const t=this;return t.kt=new qt,e||(e=15),t.kt.At(t,e)},_t(e){const t=this;return t.kt?t.kt._t(t,e):ct},xt(){const e=this;if(!e.kt)return ct;const t=e.kt.xt(e);return e.kt=null,t},Pt(){const e=this;return e.kt?e.kt.Pt(e):ct},It(e,t){const n=this;return n.kt?n.kt.It(n,e,t):ct},ut(e){return this.tt[e]},He(e,t){return this.tt.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=st,self.Inflate=Jt};\n',r=()=>t.useDataURI?"data:text/javascript,"+encodeURIComponent(n):URL.createObjectURL(new Blob([n],{type:"text/javascript"}));e({workerScripts:{inflate:[r],deflate:[r]}})}export{e as configureWebWorker}; |
@@ -6,3 +6,3 @@ { | ||
"license": "BSD-3-Clause", | ||
"version": "2.7.45", | ||
"version": "2.7.47", | ||
"type": "module", | ||
@@ -63,2 +63,3 @@ "keywords": [ | ||
}, | ||
"./data-uri.js": "./lib/zip-data-uri.js", | ||
"./lib/zip-fs.js": "./lib/zip-fs.js", | ||
@@ -81,8 +82,8 @@ "./lib/zip-full.js": "./lib/zip-full.js", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-replace": "^5.0.5", | ||
"@rollup/plugin-replace": "^5.0.7", | ||
"@rollup/plugin-terser": "^0.4.4", | ||
"http-server": "^14.1.1", | ||
"rollup": "^4.17.2", | ||
"typedoc": "^0.25.13" | ||
"rollup": "^4.18.1", | ||
"typedoc": "^0.26.4" | ||
} | ||
} |
@@ -7,3 +7,3 @@ HOW TO CONTRIBUTE | ||
* issues | ||
* help answering questions in [issues](https://github.com/dfahlander/Dexie.js/issues) and on [stackoverflow](https://stackexchange.com/filters/233583/dexie-stackoverflow) | ||
* help answering questions in [issues](https://github.com/dexie/Dexie.js/issues) and on [stackoverflow](https://stackexchange.com/filters/233583/dexie-stackoverflow) | ||
* fixing bugs via pull-requests | ||
@@ -17,4 +17,6 @@ * developing addons or other [derived work](https://dexie.org/docs/DerivedWork) | ||
Here is a little cheat-sheet for how to symlink your app's `node_modules/dexie` to a place where you can edit the source, version control your changes and create pull requests back to Dexie. Assuming you've already ran `npm install dexie --save` for the app your are developing. | ||
Dexie uses pnpm package manager. Refer to [pnpm.io/installation](https://pnpm.io/installation) for how to install pnpm. | ||
Here is a little cheat-sheet for how to symlink your app's `node_modules/dexie` to a place where you can edit the source, version control your changes and create pull requests back to Dexie. Assuming you've already ran `npm install dexie` for the app your are developing. | ||
1. Fork Dexie.js from the web gui on github | ||
@@ -27,18 +29,20 @@ 2. Clone your fork locally by launching a shell/command window and cd to a neutral place (like `~repos/`, `c:\repos` or whatever) | ||
cd dexie | ||
npm install | ||
npm run build | ||
npm link | ||
pnpm install | ||
pnpm run build | ||
npm link # Or yarn link or pnpm link --global depending on what package manager you are using. | ||
``` | ||
3. cd to your app directory and write: | ||
``` | ||
npm link dexie | ||
npm link dexie # Or yarn link dexie / pnpm link dexie depending on your package manager. | ||
``` | ||
Your app's `node_modules/dexie/` is now sym-linked to the Dexie.js clone on your hard drive so any change you do there will propagate to your app. Build dexie.js using `npm run build` or `npm run watch`. The latter will react on any source file change and rebuild the dist files. | ||
Your app's `node_modules/dexie/` is now sym-linked to the Dexie.js clone on your hard drive so any change you do there will propagate to your app. Build dexie.js using `pnpm run build` or `pnpm run watch`. The latter will react on any source file change and rebuild the dist files. | ||
That's it. Now you're up and running to test and commit changes to files under dexie/src/* or dexie/test/* and the changes will instantly affect the app you are developing. | ||
If you're on yarn or pnpm, do the same procedures using yarn link / pnpm link. | ||
Pull requests are more than welcome. Some advices are: | ||
* Run npm test before making a pull request. | ||
* Run pnpm test before making a pull request. | ||
* If you find an issue, a unit test that reproduces it is lovely ;). If you don't know where to put it, put it in `test/tests-misc.js`. We use qunit. Just look at existing tests in `tests-misc.js` to see how they should be written. Tests are transpiled in the build script so you can use ES6 if you like. | ||
@@ -49,4 +53,5 @@ | ||
``` | ||
npm install | ||
npm run build | ||
# To install pnpm, see https://pnpm.io/installation | ||
pnpm install | ||
pnpm run build | ||
``` | ||
@@ -57,3 +62,3 @@ | ||
``` | ||
npm test | ||
pnpm test | ||
``` | ||
@@ -64,3 +69,3 @@ | ||
``` | ||
npm run watch | ||
pnpm run watch | ||
``` |
@@ -7,3 +7,3 @@ /* | ||
* | ||
* Version 3.2.7, Wed Mar 20 2024 | ||
* Version 4.0.8, Wed Jul 10 2024 | ||
* | ||
@@ -55,3 +55,77 @@ * https://dexie.org | ||
} | ||
export type TransactionMode = "readonly" | "readwrite" | "r" | "r!" | "r?" | "rw" | "rw!" | "rw?"; | ||
export interface TransactionEvents extends DexieEventSet { | ||
(eventName: "complete", subscriber: () => any): void; | ||
(eventName: "abort", subscriber: () => any): void; | ||
(eventName: "error", subscriber: (error: any) => any): void; | ||
complete: DexieEvent; | ||
abort: DexieEvent; | ||
error: DexieEvent; | ||
} | ||
export interface Transaction { | ||
db: Dexie; | ||
active: boolean; | ||
mode: IDBTransactionMode; | ||
idbtrans: IDBTransaction; | ||
//tables: { [type: string]: Table<any, any> }; Deprecated since 2.0. Obsolete from v3.0. | ||
storeNames: Array<string>; | ||
explicit?: boolean; | ||
parent?: Transaction; | ||
on: TransactionEvents; | ||
abort(): void; | ||
table(tableName: string): Table<any, any>; | ||
table<T>(tableName: string): Table<T, any>; | ||
table<T, Key>(tableName: string): Table<T, Key>; | ||
table<T, Key, TInsertType>(tableName: string): Table<T, Key, TInsertType>; | ||
} | ||
export interface CreatingHookContext<T, Key> { | ||
onsuccess?: (primKey: Key) => void; | ||
onerror?: (err: any) => void; | ||
} | ||
export interface UpdatingHookContext<T, Key> { | ||
onsuccess?: (updatedObj: T) => void; | ||
onerror?: (err: any) => void; | ||
} | ||
export interface DeletingHookContext<T, Key> { | ||
onsuccess?: () => void; | ||
onerror?: (err: any) => void; | ||
} | ||
export interface TableHooks<T = any, TKey = IndexableType, TInsertType = T> extends DexieEventSet { | ||
(eventName: "creating", subscriber: (this: CreatingHookContext<T, TKey>, primKey: TKey, obj: T, transaction: Transaction) => void | undefined | TKey): void; | ||
(eventName: "reading", subscriber: (obj: T) => T | any): void; | ||
(eventName: "updating", subscriber: (this: UpdatingHookContext<T, TKey>, modifications: Object, primKey: TKey, obj: T, transaction: Transaction) => any): void; | ||
(eventName: "deleting", subscriber: (this: DeletingHookContext<T, TKey>, primKey: TKey, obj: T, transaction: Transaction) => any): void; | ||
creating: DexieEvent; | ||
reading: DexieEvent; | ||
updating: DexieEvent; | ||
deleting: DexieEvent; | ||
} | ||
export type ThenShortcut<T, TResult> = (value: T) => TResult | PromiseLike<TResult>; | ||
export interface WhereClause<T = any, TKey = IndexableType, TInsertType = T> { | ||
above(key: any): Collection<T, TKey, TInsertType>; | ||
aboveOrEqual(key: any): Collection<T, TKey, TInsertType>; | ||
anyOf(keys: ReadonlyArray<IndexableType>): Collection<T, TKey, TInsertType>; | ||
anyOf(...keys: Array<IndexableType>): Collection<T, TKey, TInsertType>; | ||
anyOfIgnoreCase(keys: string[]): Collection<T, TKey, TInsertType>; | ||
anyOfIgnoreCase(...keys: string[]): Collection<T, TKey, TInsertType>; | ||
below(key: any): Collection<T, TKey, TInsertType>; | ||
belowOrEqual(key: any): Collection<T, TKey, TInsertType>; | ||
between(lower: any, upper: any, includeLower?: boolean, includeUpper?: boolean): Collection<T, TKey, TInsertType>; | ||
equals(key: IndexableType): Collection<T, TKey, TInsertType>; | ||
equalsIgnoreCase(key: string): Collection<T, TKey, TInsertType>; | ||
inAnyRange(ranges: ReadonlyArray<{ | ||
0: any; | ||
1: any; | ||
}>, options?: { | ||
includeLowers?: boolean; | ||
includeUppers?: boolean; | ||
}): Collection<T, TKey, TInsertType>; | ||
startsWith(key: string): Collection<T, TKey, TInsertType>; | ||
startsWithAnyOf(prefixes: string[]): Collection<T, TKey, TInsertType>; | ||
startsWithAnyOf(...prefixes: string[]): Collection<T, TKey, TInsertType>; | ||
startsWithIgnoreCase(key: string): Collection<T, TKey, TInsertType>; | ||
startsWithAnyOfIgnoreCase(prefixes: string[]): Collection<T, TKey, TInsertType>; | ||
startsWithAnyOfIgnoreCase(...prefixes: string[]): Collection<T, TKey, TInsertType>; | ||
noneOf(keys: ReadonlyArray<IndexableType>): Collection<T, TKey, TInsertType>; | ||
notEqual(key: IndexableType): Collection<T, TKey, TInsertType>; | ||
} | ||
export interface PromiseExtendedConstructor extends PromiseConstructor { | ||
@@ -290,10 +364,39 @@ readonly prototype: PromiseExtended; | ||
} | ||
export type ThenShortcut<T, TResult> = (value: T) => TResult | PromiseLike<TResult>; | ||
export interface Collection<T = any, TKey = IndexableType> { | ||
//db: Database; | ||
and(filter: (x: T) => boolean): Collection<T, TKey>; | ||
clone(props?: Object): Collection<T, TKey>; | ||
export type KeyPaths<T> = { | ||
[P in keyof T]: P extends string ? T[P] extends Array<infer K> ? K extends any[] // Array of arrays (issue #2026) | ||
? P | `${P}.${number}` | `${P}.${number}.${number}` : K extends object // only drill into the array element if it's an object | ||
? P | `${P}.${number}` | `${P}.${number}.${KeyPaths<K>}` : P | `${P}.${number}` : T[P] extends (...args: any[]) => any // Method | ||
? never : T[P] extends object ? P | `${P}.${KeyPaths<T[P]>}` : P : never; | ||
}[keyof T]; | ||
export type KeyPathValue<T, PATH> = PATH extends `${infer R}.${infer S}` ? R extends keyof T ? KeyPathValue<T[R], S> : T extends any[] ? PATH extends `${number}.${infer S}` ? KeyPathValue<T[number], S> : void : void : PATH extends `${number}` ? T extends any[] ? T[number] : void : PATH extends keyof T ? T[PATH] : any; | ||
export declare const PropModSymbol: unique symbol; | ||
export type PropModSpec = { | ||
replacePrefix?: [ | ||
string, | ||
string | ||
]; | ||
add?: number | bigint | Array<string | number>; | ||
remove?: number | bigint | Array<string | number>; | ||
}; | ||
export class PropModification implements PropModSpec { | ||
[PropModSymbol]?: true; | ||
replacePrefix?: [ | ||
string, | ||
string | ||
]; | ||
add?: number | bigint | Array<string | number>; | ||
remove?: number | bigint | Array<string | number>; | ||
execute<T>(value: T): T; | ||
constructor(spec: PropModSpec); | ||
} | ||
export type UpdateSpec<T> = { | ||
[KP in KeyPaths<T>]?: KeyPathValue<T, KP> | PropModification; | ||
}; | ||
export interface Collection<T = any, TKey = IndexableType, TInsertType = T> { | ||
db: Dexie; | ||
and(filter: (x: T) => boolean): Collection<T, TKey, TInsertType>; | ||
clone(props?: Object): Collection<T, TKey, TInsertType>; | ||
count(): PromiseExtended<number>; | ||
count<R>(thenShortcut: ThenShortcut<number, R>): PromiseExtended<R>; | ||
distinct(): Collection<T, TKey>; | ||
distinct(): Collection<T, TKey, TInsertType>; | ||
each(callback: (obj: T, cursor: { | ||
@@ -315,3 +418,4 @@ key: IndexableType; | ||
}) => any): PromiseExtended<void>; | ||
filter(filter: (x: T) => boolean): Collection<T, TKey>; | ||
filter<S extends T>(filter: (x: T) => x is S): Collection<S, TKey>; | ||
filter(filter: (x: T) => boolean): Collection<T, TKey, TInsertType>; | ||
first(): PromiseExtended<T | undefined>; | ||
@@ -325,7 +429,7 @@ first<R>(thenShortcut: ThenShortcut<T | undefined, R>): PromiseExtended<R>; | ||
last<R>(thenShortcut: ThenShortcut<T | undefined, R>): PromiseExtended<R>; | ||
limit(n: number): Collection<T, TKey>; | ||
offset(n: number): Collection<T, TKey>; | ||
or(indexOrPrimayKey: string): WhereClause<T, TKey>; | ||
raw(): Collection<T, TKey>; | ||
reverse(): Collection<T, TKey>; | ||
limit(n: number): Collection<T, TKey, TInsertType>; | ||
offset(n: number): Collection<T, TKey, TInsertType>; | ||
or(indexOrPrimayKey: string): WhereClause<T, TKey, TInsertType>; | ||
raw(): Collection<T, TKey, TInsertType>; | ||
reverse(): Collection<T, TKey, TInsertType>; | ||
sortBy(keyPath: string): PromiseExtended<T[]>; | ||
@@ -337,94 +441,92 @@ sortBy<R>(keyPath: string, thenShortcut: ThenShortcut<T[], R>): PromiseExtended<R>; | ||
uniqueKeys<R>(thenShortcut: ThenShortcut<IndexableTypeArray, R>): PromiseExtended<R>; | ||
until(filter: (value: T) => boolean, includeStopEntry?: boolean): Collection<T, TKey>; | ||
until(filter: (value: T) => boolean, includeStopEntry?: boolean): Collection<T, TKey, TInsertType>; | ||
// Mutating methods | ||
delete(): PromiseExtended<number>; | ||
modify(changeCallback: (obj: T, ctx: { | ||
value: T; | ||
value: TInsertType; | ||
}) => void | boolean): PromiseExtended<number>; | ||
modify(changes: { | ||
[keyPath: string]: any; | ||
}): PromiseExtended<number>; | ||
modify(changes: UpdateSpec<TInsertType>): PromiseExtended<number>; | ||
} | ||
export interface WhereClause<T = any, TKey = IndexableType> { | ||
above(key: any): Collection<T, TKey>; | ||
aboveOrEqual(key: any): Collection<T, TKey>; | ||
anyOf(keys: ReadonlyArray<IndexableType>): Collection<T, TKey>; | ||
anyOf(...keys: Array<IndexableType>): Collection<T, TKey>; | ||
anyOfIgnoreCase(keys: string[]): Collection<T, TKey>; | ||
anyOfIgnoreCase(...keys: string[]): Collection<T, TKey>; | ||
below(key: any): Collection<T, TKey>; | ||
belowOrEqual(key: any): Collection<T, TKey>; | ||
between(lower: any, upper: any, includeLower?: boolean, includeUpper?: boolean): Collection<T, TKey>; | ||
equals(key: IndexableType): Collection<T, TKey>; | ||
equalsIgnoreCase(key: string): Collection<T, TKey>; | ||
inAnyRange(ranges: ReadonlyArray<{ | ||
0: any; | ||
1: any; | ||
}>, options?: { | ||
includeLowers?: boolean; | ||
includeUppers?: boolean; | ||
}): Collection<T, TKey>; | ||
startsWith(key: string): Collection<T, TKey>; | ||
startsWithAnyOf(prefixes: string[]): Collection<T, TKey>; | ||
startsWithAnyOf(...prefixes: string[]): Collection<T, TKey>; | ||
startsWithIgnoreCase(key: string): Collection<T, TKey>; | ||
startsWithAnyOfIgnoreCase(prefixes: string[]): Collection<T, TKey>; | ||
startsWithAnyOfIgnoreCase(...prefixes: string[]): Collection<T, TKey>; | ||
noneOf(keys: ReadonlyArray<IndexableType>): Collection<T, TKey>; | ||
notEqual(key: IndexableType): Collection<T, TKey>; | ||
export type IntervalTree = IntervalTreeNode | EmptyRange; | ||
export interface IntervalTreeNode { | ||
from: IndexableType; // lower bound | ||
to: IndexableType; // upper bound | ||
l?: IntervalTreeNode | null; // left | ||
r?: IntervalTreeNode | null; // right | ||
d: number; // depth | ||
} | ||
export interface Database { | ||
readonly name: string; | ||
readonly tables: Table[]; | ||
table<T = any, TKey = any>(tableName: string): Table<T, TKey>; | ||
transaction<U>(mode: TransactionMode, table: Table, scope: () => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: Table, table2: Table, scope: () => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: Table, table2: Table, table3: Table, scope: () => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: Table, table2: Table, table3: Table, table4: Table, scope: () => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: Table, table2: Table, table3: Table, table4: Table, table5: Table, scope: () => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, tables: Table[], scope: () => PromiseLike<U> | U): PromiseExtended<U>; | ||
export interface EmptyRange { | ||
d: 0; | ||
} | ||
export interface TransactionEvents extends DexieEventSet { | ||
(eventName: "complete", subscriber: () => any): void; | ||
(eventName: "abort", subscriber: () => any): void; | ||
(eventName: "error", subscriber: (error: any) => any): void; | ||
complete: DexieEvent; | ||
abort: DexieEvent; | ||
error: DexieEvent; | ||
export interface DexieOnReadyEvent { | ||
subscribe(fn: (vipDb: Dexie) => any, bSticky: boolean): void; | ||
unsubscribe(fn: (vipDb: Dexie) => any): void; | ||
fire(vipDb: Dexie): any; | ||
} | ||
export interface Transaction { | ||
db: Database; | ||
active: boolean; | ||
mode: IDBTransactionMode; | ||
//tables: { [type: string]: Table<any, any> }; Deprecated since 2.0. Obsolete from v3.0. | ||
storeNames: Array<string>; | ||
parent?: Transaction; | ||
on: TransactionEvents; | ||
abort(): void; | ||
table(tableName: string): Table<any, any>; | ||
table<T>(tableName: string): Table<T, any>; | ||
table<T, Key>(tableName: string): Table<T, Key>; | ||
export interface DexieVersionChangeEvent { | ||
subscribe(fn: (event: IDBVersionChangeEvent) => any): void; | ||
unsubscribe(fn: (event: IDBVersionChangeEvent) => any): void; | ||
fire(event: IDBVersionChangeEvent): any; | ||
} | ||
export interface CreatingHookContext<T, Key> { | ||
onsuccess?: (primKey: Key) => void; | ||
onerror?: (err: any) => void; | ||
export interface DexiePopulateEvent { | ||
subscribe(fn: (trans: Transaction) => any): void; | ||
unsubscribe(fn: (trans: Transaction) => any): void; | ||
fire(trans: Transaction): any; | ||
} | ||
export interface UpdatingHookContext<T, Key> { | ||
onsuccess?: (updatedObj: T) => void; | ||
onerror?: (err: any) => void; | ||
export interface DexieCloseEvent { | ||
subscribe(fn: (event: Event) => any): void; | ||
unsubscribe(fn: (event: Event) => any): void; | ||
fire(event: Event): any; | ||
} | ||
export interface DeletingHookContext<T, Key> { | ||
onsuccess?: () => void; | ||
onerror?: (err: any) => void; | ||
export interface DbEvents extends DexieEventSet { | ||
(eventName: "ready", subscriber: (vipDb: Dexie) => any, bSticky?: boolean): void; | ||
(eventName: "populate", subscriber: (trans: Transaction) => any): void; | ||
(eventName: "blocked", subscriber: (event: IDBVersionChangeEvent) => any): void; | ||
(eventName: "versionchange", subscriber: (event: IDBVersionChangeEvent) => any): void; | ||
(eventName: "close", subscriber: (event: Event) => any): void; | ||
ready: DexieOnReadyEvent; | ||
populate: DexiePopulateEvent; | ||
blocked: DexieEvent; | ||
versionchange: DexieVersionChangeEvent; | ||
close: DexieCloseEvent; | ||
} | ||
export interface TableHooks<T = any, TKey = IndexableType> extends DexieEventSet { | ||
(eventName: "creating", subscriber: (this: CreatingHookContext<T, TKey>, primKey: TKey, obj: T, transaction: Transaction) => any): void; | ||
(eventName: "reading", subscriber: (obj: T) => T | any): void; | ||
(eventName: "updating", subscriber: (this: UpdatingHookContext<T, TKey>, modifications: Object, primKey: TKey, obj: T, transaction: Transaction) => any): void; | ||
(eventName: "deleting", subscriber: (this: DeletingHookContext<T, TKey>, primKey: TKey, obj: T, transaction: Transaction) => any): void; | ||
creating: DexieEvent; | ||
reading: DexieEvent; | ||
updating: DexieEvent; | ||
deleting: DexieEvent; | ||
/** Set of mutated parts of the database | ||
*/ | ||
export type ObservabilitySet = { | ||
/** Database part having been mutated. | ||
* | ||
* This structure is produced in observability-middleware.ts | ||
* and consumed in live-query.ts. | ||
* | ||
* Format of 'part': | ||
* | ||
* `idb://${dbName}/${tableName}/${indexName}` | ||
* | ||
* * dbName is the database name | ||
* * tableName is the table name | ||
* * indexName is any of: | ||
* 1. An empty string - represents the primary keys of the affected objs | ||
* 2. ":dels" - represents primary keys of deleted objects in the table | ||
* 3. The keyPath of an index, such as "name", "age" or "address.city" - | ||
* represents indexes that, if used in a query, might affect the | ||
* result of that query. | ||
* | ||
* IntervalTree | ||
* * See definition of IntervalTree type in rangeset.d.ts | ||
* * See rangesOverlap() in rangeset.ts that can be used to compare two | ||
* IntervalTrees and detect collissions. | ||
* * See RangeSet class that can be used to create an IntervalTree and add | ||
* ranges to it. | ||
*/ | ||
[part: string]: IntervalTree; | ||
}; | ||
export interface DexieOnStorageMutatedEvent { | ||
subscribe(fn: (parts: ObservabilitySet) => any): void; | ||
unsubscribe(fn: (parts: ObservabilitySet) => any): void; | ||
fire(parts: ObservabilitySet): any; | ||
} | ||
export interface GlobalDexieEvents extends DexieEventSet { | ||
(eventName: "storagemutated", subscriber: (parts: ObservabilitySet) => any): void; | ||
storagemutated: DexieOnStorageMutatedEvent; | ||
} | ||
export const enum DBCoreRangeType { | ||
@@ -461,4 +563,5 @@ Equal = 1, | ||
trans: DBCoreTransaction; | ||
values: any[]; | ||
values: readonly any[]; | ||
keys?: any[]; | ||
mutatedParts?: ObservabilitySet; | ||
/** @deprecated Will always get results since 3.1.0-alpha.5 */ | ||
@@ -470,4 +573,5 @@ wantResults?: boolean; | ||
trans: DBCoreTransaction; | ||
values: any[]; | ||
values: readonly any[]; | ||
keys?: any[]; | ||
mutatedParts?: ObservabilitySet; | ||
criteria?: { | ||
@@ -480,5 +584,9 @@ index: string | null; | ||
}; // Common changeSpec for each key | ||
changeSpecs?: { | ||
[keyPath: string]: any; | ||
}[]; // changeSpec per key. | ||
isAdditionalChunk?: boolean; | ||
updates?: { | ||
keys: any[]; | ||
changeSpecs: { | ||
[keyPath: string]: any; | ||
}[]; // changeSpec per key. | ||
}; | ||
/** @deprecated Will always get results since 3.1.0-alpha.5 */ | ||
@@ -491,2 +599,3 @@ wantResults?: boolean; | ||
keys: any[]; | ||
mutatedParts?: ObservabilitySet; | ||
criteria?: { | ||
@@ -496,2 +605,3 @@ index: string | null; | ||
}; | ||
isAdditionalChunk?: boolean; | ||
} | ||
@@ -502,2 +612,3 @@ export interface DBCoreDeleteRangeRequest { | ||
range: DBCoreKeyRange; | ||
mutatedParts?: ObservabilitySet; | ||
} | ||
@@ -508,2 +619,3 @@ export interface DBCoreGetManyRequest { | ||
cache?: "immutable" | "clone"; | ||
obsSet?: ObservabilitySet; | ||
} | ||
@@ -513,2 +625,3 @@ export interface DBCoreGetRequest { | ||
key: any; | ||
obsSet?: ObservabilitySet; | ||
} | ||
@@ -524,2 +637,3 @@ export interface DBCoreQuery { | ||
query: DBCoreQuery; | ||
obsSet?: ObservabilitySet; | ||
} | ||
@@ -535,2 +649,3 @@ export interface DBCoreQueryResponse { | ||
query: DBCoreQuery; | ||
obsSet?: ObservabilitySet; | ||
} | ||
@@ -540,2 +655,3 @@ export interface DBCoreCountRequest { | ||
query: DBCoreQuery; | ||
obsSet?: ObservabilitySet; | ||
} | ||
@@ -585,2 +701,4 @@ export interface DBCoreCursor { | ||
readonly extractKey: ((value: any) => any) | null; | ||
/** If this index is a virtual index, lowLevelIndex represents the actual IndexedDB index behind it */ | ||
readonly lowLevelIndex?: DBCoreIndex; | ||
} | ||
@@ -607,7 +725,7 @@ export interface DBCore { | ||
} | ||
export interface Table<T = any, TKey = IndexableType> { | ||
db: Database; | ||
export interface Table<T = any, TKey = any, TInsertType = T> { | ||
db: Dexie; | ||
name: string; | ||
schema: TableSchema; | ||
hook: TableHooks<T, TKey>; | ||
hook: TableHooks<T, TKey, TInsertType>; | ||
core: DBCoreTable; | ||
@@ -622,11 +740,11 @@ get(key: TKey): PromiseExtended<T | undefined>; | ||
}, thenShortcut: ThenShortcut<T | undefined, R>): PromiseExtended<R>; | ||
where(index: string | string[]): WhereClause<T, TKey>; | ||
where(index: string | string[]): WhereClause<T, TKey, TInsertType>; | ||
where(equalityCriterias: { | ||
[key: string]: any; | ||
}): Collection<T, TKey>; | ||
filter(fn: (obj: T) => boolean): Collection<T, TKey>; | ||
}): Collection<T, TKey, TInsertType>; | ||
filter(fn: (obj: T) => boolean): Collection<T, TKey, TInsertType>; | ||
count(): PromiseExtended<number>; | ||
count<R>(thenShortcut: ThenShortcut<number, R>): PromiseExtended<R>; | ||
offset(n: number): Collection<T, TKey>; | ||
limit(n: number): Collection<T, TKey>; | ||
offset(n: number): Collection<T, TKey, TInsertType>; | ||
limit(n: number): Collection<T, TKey, TInsertType>; | ||
each(callback: (obj: T, cursor: { | ||
@@ -638,32 +756,38 @@ key: any; | ||
toArray<R>(thenShortcut: ThenShortcut<T[], R>): PromiseExtended<R>; | ||
toCollection(): Collection<T, TKey>; | ||
orderBy(index: string | string[]): Collection<T, TKey>; | ||
reverse(): Collection<T, TKey>; | ||
toCollection(): Collection<T, TKey, TInsertType>; | ||
orderBy(index: string | string[]): Collection<T, TKey, TInsertType>; | ||
reverse(): Collection<T, TKey, TInsertType>; | ||
mapToClass(constructor: Function): Function; | ||
add(item: T, key?: TKey): PromiseExtended<TKey>; | ||
update(key: TKey | T, changes: { | ||
[keyPath: string]: any; | ||
}): PromiseExtended<number>; | ||
put(item: T, key?: TKey): PromiseExtended<TKey>; | ||
add(item: TInsertType, key?: TKey): PromiseExtended<TKey>; | ||
update(key: TKey | T, changes: ((obj: T, ctx: { | ||
value: any; | ||
primKey: IndexableType; | ||
}) => void | boolean)): PromiseExtended<number>; | ||
update(key: TKey | T, changes: UpdateSpec<TInsertType>): PromiseExtended<number>; | ||
put(item: TInsertType, key?: TKey): PromiseExtended<TKey>; | ||
delete(key: TKey): PromiseExtended<void>; | ||
clear(): PromiseExtended<void>; | ||
bulkGet(keys: TKey[]): PromiseExtended<(T | undefined)[]>; | ||
bulkAdd<B extends boolean>(items: readonly T[], keys: IndexableTypeArrayReadonly, options: { | ||
bulkAdd<B extends boolean>(items: readonly TInsertType[], keys: IndexableTypeArrayReadonly, options: { | ||
allKeys: B; | ||
}): PromiseExtended<B extends true ? TKey[] : TKey>; | ||
bulkAdd<B extends boolean>(items: readonly T[], options: { | ||
bulkAdd<B extends boolean>(items: readonly TInsertType[], options: { | ||
allKeys: B; | ||
}): PromiseExtended<B extends true ? TKey[] : TKey>; | ||
bulkAdd(items: readonly T[], keys?: IndexableTypeArrayReadonly, options?: { | ||
bulkAdd(items: readonly TInsertType[], keys?: IndexableTypeArrayReadonly, options?: { | ||
allKeys: boolean; | ||
}): PromiseExtended<TKey>; | ||
bulkPut<B extends boolean>(items: readonly T[], keys: IndexableTypeArrayReadonly, options: { | ||
bulkPut<B extends boolean>(items: readonly TInsertType[], keys: IndexableTypeArrayReadonly, options: { | ||
allKeys: B; | ||
}): PromiseExtended<B extends true ? TKey[] : TKey>; | ||
bulkPut<B extends boolean>(items: readonly T[], options: { | ||
bulkPut<B extends boolean>(items: readonly TInsertType[], options: { | ||
allKeys: B; | ||
}): PromiseExtended<B extends true ? TKey[] : TKey>; | ||
bulkPut(items: readonly T[], keys?: IndexableTypeArrayReadonly, options?: { | ||
bulkPut(items: readonly TInsertType[], keys?: IndexableTypeArrayReadonly, options?: { | ||
allKeys: boolean; | ||
}): PromiseExtended<TKey>; | ||
bulkUpdate(keysAndChanges: ReadonlyArray<{ | ||
key: TKey; | ||
changes: UpdateSpec<T>; | ||
}>): PromiseExtended<number>; | ||
bulkDelete(keys: TKey[]): PromiseExtended<void>; | ||
@@ -677,59 +801,3 @@ } | ||
} | ||
export type IntervalTree = IntervalTreeNode | EmptyRange; | ||
export interface IntervalTreeNode { | ||
from: IndexableType; // lower bound | ||
to: IndexableType; // upper bound | ||
l: IntervalTreeNode | null; // left | ||
r: IntervalTreeNode | null; // right | ||
d: number; // depth | ||
} | ||
export interface EmptyRange { | ||
d: 0; | ||
} | ||
export interface DexieOnReadyEvent { | ||
subscribe(fn: (vipDb: Dexie) => any, bSticky: boolean): void; | ||
unsubscribe(fn: (vipDb: Dexie) => any): void; | ||
fire(vipDb: Dexie): any; | ||
} | ||
export interface DexieVersionChangeEvent { | ||
subscribe(fn: (event: IDBVersionChangeEvent) => any): void; | ||
unsubscribe(fn: (event: IDBVersionChangeEvent) => any): void; | ||
fire(event: IDBVersionChangeEvent): any; | ||
} | ||
export interface DexiePopulateEvent { | ||
subscribe(fn: (trans: Transaction) => any): void; | ||
unsubscribe(fn: (trans: Transaction) => any): void; | ||
fire(trans: Transaction): any; | ||
} | ||
export interface DexieCloseEvent { | ||
subscribe(fn: (event: Event) => any): void; | ||
unsubscribe(fn: (event: Event) => any): void; | ||
fire(event: Event): any; | ||
} | ||
export interface DbEvents extends DexieEventSet { | ||
(eventName: "ready", subscriber: (vipDb: Dexie) => any, bSticky?: boolean): void; | ||
(eventName: "populate", subscriber: (trans: Transaction) => any): void; | ||
(eventName: "blocked", subscriber: (event: IDBVersionChangeEvent) => any): void; | ||
(eventName: "versionchange", subscriber: (event: IDBVersionChangeEvent) => any): void; | ||
(eventName: "close", subscriber: (event: Event) => any): void; | ||
ready: DexieOnReadyEvent; | ||
populate: DexiePopulateEvent; | ||
blocked: DexieEvent; | ||
versionchange: DexieVersionChangeEvent; | ||
close: DexieCloseEvent; | ||
} | ||
export type ObservabilitySet = { | ||
// `idb:${dbName}/${tableName}/changedRowContents` - keys. | ||
// `idb:${dbName}/${tableName}/changedIndexes/${indexName}` - indexes | ||
[part: string]: IntervalTree; | ||
}; | ||
export interface DexieOnStorageMutatedEvent { | ||
subscribe(fn: (parts: ObservabilitySet) => any): void; | ||
unsubscribe(fn: (parts: ObservabilitySet) => any): void; | ||
fire(parts: ObservabilitySet): any; | ||
} | ||
export interface GlobalDexieEvents extends DexieEventSet { | ||
(eventName: "storagemutated", subscriber: (parts: ObservabilitySet) => any): void; | ||
storagemutated: DexieOnStorageMutatedEvent; | ||
} | ||
export type TransactionMode = "readonly" | "readwrite" | "r" | "r!" | "r?" | "rw" | "rw!" | "rw?"; | ||
export type DbSchema = { | ||
@@ -749,3 +817,16 @@ [tableName: string]: TableSchema; | ||
} | ||
export interface Dexie extends Database { | ||
export type TableProp<DX extends Dexie> = { | ||
[K in keyof DX]: DX[K] extends { | ||
schema: any; | ||
get: any; | ||
put: any; | ||
add: any; | ||
where: any; | ||
} ? K : never; | ||
}[keyof DX] & string; | ||
export type TXWithTables<DX extends Dexie> = Dexie extends DX ? Transaction // If not subclassed, just expect a Transaction without table props | ||
: Transaction & { | ||
[P in TableProp<DX>]: DX[P]; | ||
}; | ||
export interface Dexie { | ||
readonly name: string; | ||
@@ -760,2 +841,3 @@ readonly tables: Table[]; | ||
_createTransaction: (this: Dexie, mode: IDBTransactionMode, storeNames: ArrayLike<string>, dbschema: DbSchema, parentTransaction?: Transaction | null) => Transaction; | ||
readonly _novip: Dexie; | ||
_dbSchema: DbSchema; | ||
@@ -765,17 +847,15 @@ version(versionNumber: number): Version; | ||
open(): PromiseExtended<Dexie>; | ||
table<T = any, TKey = IndexableType>(tableName: string): Table<T, TKey>; | ||
transaction<U>(mode: TransactionMode, table: Table, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: Table, table2: Table, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string, table2: string, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: Table, table2: Table, table3: Table, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string, table2: string, table3: string, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: Table, table2: Table, table3: Table, table4: Table, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string, table2: string, table3: string, table4: string, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: Table, table2: Table, table3: Table, table4: Table, table5: Table, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string, table2: string, table3: string, table4: string, table5: string, scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, tables: Table[], scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, tables: string[], scope: (trans: Transaction) => PromiseLike<U> | U): PromiseExtended<U>; | ||
close(): void; | ||
delete(): PromiseExtended<void>; | ||
table<T = any, TKey = IndexableType, TInsertType = T>(tableName: string): Table<T, TKey, TInsertType>; | ||
transaction<U>(mode: TransactionMode, tables: readonly (string | Table)[], scope: (trans: TXWithTables<this>) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string | Table, scope: (trans: TXWithTables<this>) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string | Table, table2: string | Table, scope: (trans: TXWithTables<this>) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string | Table, table2: string | Table, table3: string | Table, scope: (trans: TXWithTables<this>) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string | Table, table2: string | Table, table3: string | Table, table4: string | Table, scope: (trans: TXWithTables<this>) => PromiseLike<U> | U): PromiseExtended<U>; | ||
transaction<U>(mode: TransactionMode, table: string | Table, table2: string | Table, table3: string | Table, table5: string | Table, scope: (trans: TXWithTables<this>) => PromiseLike<U> | U): PromiseExtended<U>; | ||
close(closeOptions?: { | ||
disableAutoOpen: boolean; | ||
}): void; | ||
delete(closeOptions?: { | ||
disableAutoOpen: boolean; | ||
}): PromiseExtended<void>; | ||
isOpen(): boolean; | ||
@@ -981,2 +1061,36 @@ hasBeenClosed(): boolean; | ||
} | ||
export type GlobalQueryCache = { | ||
// TODO: Change to parts: {[part: string]: TblQueryCache} | ||
// och unsignaledParts: ObservabilitySet; | ||
[part: string]: TblQueryCache; // part is `idb://${dbName}/${tableName}` | ||
}; | ||
export interface TblQueryCache { | ||
queries: { | ||
query: { | ||
[indexName: string]: CacheEntry[]; | ||
}; | ||
count: { | ||
[indexName: string]: CacheEntry[]; | ||
}; | ||
}; | ||
objs: Map<string | number, object>; | ||
optimisticOps: DBCoreMutateRequest[]; | ||
unsignaledParts: ObservabilitySet; | ||
} | ||
export interface CacheEntryCommon { | ||
subscribers: Set<() => void>; | ||
obsSet: ObservabilitySet; | ||
//txObsSet: ObservabilitySet; | ||
promise: Promise<any>; | ||
dirty: boolean; | ||
} | ||
export type CacheEntry = CacheEntryCommon & ({ | ||
type: "query"; | ||
req: DBCoreQueryRequest; | ||
res?: readonly any[]; | ||
} | { | ||
type: "count"; | ||
req: DBCoreCountRequest; | ||
res?: number; | ||
}); | ||
export type ChromeTransactionDurability = "default" | "strict" | "relaxed"; | ||
@@ -997,2 +1111,3 @@ export interface DexieOptions { | ||
chromeTransactionDurability?: ChromeTransactionDurability; | ||
cache?: "immutable" | "cloned" | "disabled"; | ||
} | ||
@@ -1011,8 +1126,9 @@ export interface DexieConstructor extends DexieExceptionClasses { | ||
ignoreTransaction<U>(fn: () => U): U; | ||
disableBfCache?: boolean; | ||
liveQuery<T>(fn: () => T | Promise<T>): Observable<T>; | ||
extendObservabilitySet(target: ObservabilitySet, newSet: ObservabilitySet): ObservabilitySet; | ||
override<F>(origFunc: F, overridedFactory: (fn: any) => any): F; // ? | ||
getByKeyPath(obj: Object, keyPath: string): any; | ||
setByKeyPath(obj: Object, keyPath: string, value: any): void; | ||
delByKeyPath(obj: Object, keyPath: string): void; | ||
getByKeyPath(obj: Object, keyPath: string | string[]): any; | ||
setByKeyPath(obj: Object, keyPath: string | string[], value: any): void; | ||
delByKeyPath(obj: Object, keyPath: string | string[]): void; | ||
shallowClone<T>(obj: T): T; | ||
@@ -1027,2 +1143,4 @@ deepClone<T>(obj: T): T; | ||
default: Dexie; // Work-around for different build tools handling default imports differently. | ||
cache: GlobalQueryCache; | ||
debug: false | true | "dexie"; | ||
Promise: PromiseExtendedConstructor; | ||
@@ -1035,4 +1153,30 @@ //TableSchema: {}; // Deprecate! | ||
} | ||
export class Entity<TDexieSubClass extends Dexie = Dexie> { | ||
protected constructor(); | ||
protected readonly db: TDexieSubClass; | ||
table(): TableProp<TDexieSubClass>; | ||
} | ||
export type IsStrictlyAny<T> = (T extends never ? true : false) extends false ? false : true; | ||
/** Extract the union of literal method names in T | ||
*/ | ||
export type MethodProps<T> = { | ||
[P in keyof T]: IsStrictlyAny<T[P]> extends true ? never // Plain property of type any (not method) | ||
: T[P] extends (...args: any[]) => any ? P // a function (method) | ||
: never; | ||
}[keyof T]; | ||
/** Default insert type of T is a subset of T where: | ||
* * given optional props (such as an auto-generated primary key) are made optional | ||
* * methods are omitted | ||
*/ | ||
export type InsertType<T, OptionalProps extends keyof T> = Omit<T, OptionalProps | MethodProps<T>> & { | ||
[P in OptionalProps]?: T[P]; | ||
}; | ||
/** IDType extract the actual type of the primary key: | ||
* * If TKey is a literal type that names a property of T, extract the type using T[TKey] | ||
* * Else, use TKey as is. | ||
*/ | ||
export type IDType<T, TKeyPropNameOrKeyType> = IsStrictlyAny<T> extends true ? TKeyPropNameOrKeyType : TKeyPropNameOrKeyType extends string ? TKeyPropNameOrKeyType extends keyof T ? T[TKeyPropNameOrKeyType] : TKeyPropNameOrKeyType : TKeyPropNameOrKeyType; | ||
export type EntityTable<T, TKeyPropName extends keyof T = never, TInsertType = InsertType<T, TKeyPropName>> = Table<T, IDType<T, TKeyPropName>, TInsertType>; | ||
export declare var Dexie: DexieConstructor; | ||
export interface _Table<T, TKey> extends Table<T, TKey> { | ||
export interface _Table<T, TKey, TInsertType> extends Table<T, TKey, TInsertType> { | ||
} | ||
@@ -1045,3 +1189,3 @@ export interface _Collection<T, TKey> extends Collection<T, TKey> { | ||
// The "Dexie.Table" interface. Same as named exported interface Table. | ||
interface Table<T = any, Key = any> extends _Table<T, Key> { | ||
interface Table<T = any, Key = any, TInsertType = T> extends _Table<T, Key, TInsertType> { | ||
} // Because all samples have been Dexie.Table<...> | ||
@@ -1055,2 +1199,6 @@ // The "Dexie.Collection" interface. Same as named exported interface Collection. | ||
export function rangesOverlap(rangeSet1: IntervalTree, rangeSet2: IntervalTree): boolean; | ||
export function cmp(a: any, b: any): number; | ||
export function replacePrefix(a: string, b: string): PropModification; | ||
export function add(num: number | bigint | any[]): PropModification; | ||
export function remove(num: number | bigint | any[]): PropModification; | ||
/** Exporting 'Dexie' as the default export. | ||
@@ -1057,0 +1205,0 @@ **/ |
{ | ||
"name": "dexie", | ||
"version": "3.2.7", | ||
"version": "4.0.8", | ||
"description": "A Minimalistic Wrapper for IndexedDB", | ||
@@ -11,4 +11,3 @@ "main": "dist/dexie.js", | ||
"production": { | ||
"browser": "./dist/modern/dexie.min.mjs", | ||
"module": "./dist/modern/dexie.min.mjs", | ||
"module": "./import-wrapper-prod.mjs", | ||
"import": "./import-wrapper-prod.mjs", | ||
@@ -19,4 +18,3 @@ "require": "./dist/dexie.min.js", | ||
"development": { | ||
"browser": "./dist/modern/dexie.mjs", | ||
"module": "./dist/modern/dexie.mjs", | ||
"module": "./import-wrapper.mjs", | ||
"import": "./import-wrapper.mjs", | ||
@@ -27,4 +25,3 @@ "require": "./dist/dexie.js", | ||
"default": { | ||
"browser": "./dist/modern/dexie.mjs", | ||
"module": "./dist/modern/dexie.mjs", | ||
"module": "./import-wrapper.mjs", | ||
"import": "./import-wrapper.mjs", | ||
@@ -35,3 +32,4 @@ "require": "./dist/dexie.js", | ||
}, | ||
"./package.json": "./package.json" | ||
"./package.json": "./package.json", | ||
"./dist/*": "./dist/*" | ||
}, | ||
@@ -47,3 +45,3 @@ "typings": "dist/dexie.d.ts", | ||
"type": "git", | ||
"url": "https://github.com/dfahlander/Dexie.js.git" | ||
"url": "https://github.com/dexie/Dexie.js.git" | ||
}, | ||
@@ -65,13 +63,4 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/dfahlander/Dexie.js/issues" | ||
"url": "https://github.com/dexie/Dexie.js/issues" | ||
}, | ||
"scripts": { | ||
"build": "just-build", | ||
"watch": "just-build --watch", | ||
"clean": "rm -rf tools/tmp && rm dist/*.js && rm dist/*.map && rm dist/*.ts && rm dist/*.mjs", | ||
"test": "npm run build && npm run test:typings && npm run test:unit", | ||
"test:unit": "karma start test/karma.conf.js --single-run", | ||
"test:typings": "tsc -p test/typings-test/", | ||
"test:debug": "karma start test/karma.conf.js --log-level debug" | ||
}, | ||
"just-build": { | ||
@@ -86,3 +75,3 @@ "default": [ | ||
"tsc [--watch 'Watching for file changes']", | ||
"tsc --target es2018 --outdir ../tools/tmp/modern/src/", | ||
"tsc --target es2020 --outdir ../tools/tmp/modern/src/", | ||
"rollup -c ../tools/build-configs/rollup.config.js", | ||
@@ -124,11 +113,9 @@ "rollup -c ../tools/build-configs/rollup.umd.config.js", | ||
}, | ||
"engines": { | ||
"node": ">=6.0" | ||
}, | ||
"homepage": "https://dexie.org", | ||
"devDependencies": { | ||
"@lambdatest/node-tunnel": "^4.0.7", | ||
"cross-env": "^7.0.3", | ||
"dts-bundle-generator": "^5.9.0", | ||
"just-build": "^0.9.19", | ||
"just-build": "^0.9.24", | ||
"karma": "^6.1.1", | ||
"karma-browserstack-launcher": "^1.5.2", | ||
"karma-chrome-launcher": "^3.1.0", | ||
@@ -138,3 +125,3 @@ "karma-firefox-launcher": "^2.1.0", | ||
"karma-qunit": "^4.1.1", | ||
"karma-safari-launcher": "^1.0.0", | ||
"karma-webdriver-launcher": "^1.0.8", | ||
"qunit": "^2.10.0", | ||
@@ -153,5 +140,16 @@ "qunitjs": "^1.23.1", | ||
"tslib": "^2.1.0", | ||
"typescript": "^4.3.4", | ||
"typescript": "^5.3.3", | ||
"uglify-js": "^3.9.2" | ||
}, | ||
"scripts": { | ||
"build": "just-build", | ||
"watch": "just-build --watch", | ||
"clean": "rm -rf tools/tmp && rm dist/*.js && rm dist/*.map && rm dist/*.ts && rm dist/*.mjs", | ||
"test": "pnpm run build && pnpm run test:typings && pnpm run test:unit", | ||
"test:unit": "karma start test/karma.conf.js --single-run", | ||
"test:typings": "tsc -p test/typings-test/", | ||
"test:debug": "karma start test/karma.conf.js --log-level debug", | ||
"test:ltcloud": "cross-env LAMBDATEST=true pnpm run test:ltTunnel & sleep 10 && pnpm run test:unit; UNIT_STATUS=$?; kill $(cat tunnel.pid); exit $UNIT_STATUS", | ||
"test:ltTunnel": "node test/lt-local" | ||
} | ||
} | ||
} |
@@ -7,4 +7,5 @@ # Security Policy | ||
| ------- | ------------------ | -------- | ||
| 3.x | :white_check_mark: | master | ||
| 2.0.x | :thinking: | master-2 | ||
| 4.x | :white_check_mark: | master | ||
| 3.x | :white_check_mark: | master-3 | ||
| 2.0.x | :x: | master-2 | ||
| 1.5.x | :x: | master-1 | ||
@@ -15,3 +16,3 @@ | < 1.5.1 | :x: | | ||
To report a security vulnerability in Dexie.js, just file an issue in this repo. | ||
To report a security vulnerability in Dexie.js, please send an email to code@dexie.org describing the vulnerability and how to reproduce it. | ||
@@ -18,0 +19,0 @@ If we find an issue to be regarded as a security vulnerability, we will patch and release a new version in all the supported versions as soon as possible. |
@@ -206,3 +206,3 @@ /*! ***************************************************************************** | ||
*/ | ||
toReversed(): Uint8Array; | ||
toReversed(): Int8Array; | ||
@@ -215,7 +215,7 @@ /** | ||
* ```ts | ||
* const myNums = Uint8Array.from([11, 2, 22, 1]); | ||
* myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22] | ||
* const myNums = Int8Array.from([11, 2, 22, 1]); | ||
* myNums.toSorted((a, b) => a - b) // Int8Array(4) [1, 2, 11, 22] | ||
* ``` | ||
*/ | ||
toSorted(compareFn?: (a: number, b: number) => number): Uint8Array; | ||
toSorted(compareFn?: (a: number, b: number) => number): Int8Array; | ||
@@ -229,3 +229,3 @@ /** | ||
*/ | ||
with(index: number, value: number): Uint8Array; | ||
with(index: number, value: number): Int8Array; | ||
} | ||
@@ -232,0 +232,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://www.typescriptlang.org/", | ||
"version": "5.5.3", | ||
"version": "5.5.4", | ||
"license": "Apache-2.0", | ||
@@ -116,3 +116,3 @@ "description": "TypeScript is a language for application scale JavaScript development", | ||
}, | ||
"gitHead": "f0e992167440686f948965e5441a918b34251886" | ||
"gitHead": "c8a7d589e647e19c94150d9892909f3aa93e48eb" | ||
} |
@@ -193,4 +193,6 @@ /* | ||
_prettyRegExp(regexString, stripSlash = true) { | ||
const str = (regexString + "").replace(/!/g, "%21").replace(/\|/g, "%7C"); | ||
return stripSlash ? str.substring(1, str.length - 1) : str; | ||
const str = stripSlash | ||
? regexString.source + regexString.flags | ||
: regexString + ""; | ||
return str.replace(/!/g, "%21").replace(/\|/g, "%7C"); | ||
} | ||
@@ -197,0 +199,0 @@ |
@@ -13,3 +13,2 @@ /* | ||
const Template = require("../Template"); | ||
const { cssExportConvention } = require("../util/conventions"); | ||
@@ -139,16 +138,14 @@ /** @typedef {import("webpack-sources").Source} Source */ | ||
for (const [name, v] of cssExportsData.exports) { | ||
for (let k of cssExportConvention(name, this.convention)) { | ||
let identifier = Template.toIdentifier(k); | ||
let i = 0; | ||
while (usedIdentifiers.has(identifier)) { | ||
identifier = Template.toIdentifier(k + i); | ||
} | ||
usedIdentifiers.add(identifier); | ||
generateContext.concatenationScope.registerExport(k, identifier); | ||
source.add( | ||
`${ | ||
generateContext.runtimeTemplate.supportsConst() ? "const" : "var" | ||
} ${identifier} = ${JSON.stringify(v)};\n` | ||
); | ||
let identifier = Template.toIdentifier(name); | ||
let i = 0; | ||
while (usedIdentifiers.has(identifier)) { | ||
identifier = Template.toIdentifier(name + i); | ||
} | ||
usedIdentifiers.add(identifier); | ||
generateContext.concatenationScope.registerExport(name, identifier); | ||
source.add( | ||
`${ | ||
generateContext.runtimeTemplate.supportsConst() ? "const" : "var" | ||
} ${identifier} = ${JSON.stringify(v)};\n` | ||
); | ||
} | ||
@@ -168,7 +165,5 @@ return source; | ||
} | ||
const newExports = []; | ||
for (let [k, v] of cssExportsData.exports) { | ||
for (let name of cssExportConvention(k, this.convention)) { | ||
newExports.push(`\t${JSON.stringify(name)}: ${JSON.stringify(v)}`); | ||
} | ||
const exports = []; | ||
for (let [name, v] of cssExportsData.exports) { | ||
exports.push(`\t${JSON.stringify(name)}: ${JSON.stringify(v)}`); | ||
} | ||
@@ -178,3 +173,3 @@ return new RawSource( | ||
module.moduleArgument | ||
}.exports = {\n${newExports.join(",\n")}\n}${needNsObj ? ")" : ""};` | ||
}.exports = {\n${exports.join(",\n")}\n}${needNsObj ? ")" : ""};` | ||
); | ||
@@ -205,5 +200,7 @@ } | ||
*/ | ||
updateHash(hash, { module }) {} | ||
updateHash(hash, { module }) { | ||
hash.update(this.esModule.toString()); | ||
} | ||
} | ||
module.exports = CssExportsGenerator; |
@@ -12,3 +12,2 @@ /* | ||
const RuntimeGlobals = require("../RuntimeGlobals"); | ||
const { cssExportConvention } = require("../util/conventions"); | ||
@@ -110,11 +109,2 @@ /** @typedef {import("webpack-sources").Source} Source */ | ||
if (cssExportsData.exports.size > 0) { | ||
const newExports = new Map(); | ||
for (let [name, v] of cssExportsData.exports) { | ||
for (let newName of cssExportConvention(name, this.convention)) { | ||
newExports.set(newName, v); | ||
} | ||
} | ||
cssExportsData.exports = newExports; | ||
} | ||
const data = generateContext.getData(); | ||
@@ -153,5 +143,7 @@ data.set("css-exports", cssExportsData); | ||
*/ | ||
updateHash(hash, { module }) {} | ||
updateHash(hash, { module }) { | ||
hash.update(this.esModule.toString()); | ||
} | ||
} | ||
module.exports = CssGenerator; |
@@ -275,3 +275,3 @@ /* | ||
logger.log(`Replaced "${key}" with "${strCode}"`); | ||
logger.debug(`Replaced "${key}" with "${strCode}"`); | ||
@@ -278,0 +278,0 @@ return strCode; |
@@ -8,2 +8,3 @@ /* | ||
const { cssExportConvention } = require("../util/conventions"); | ||
const makeSerializable = require("../util/makeSerializable"); | ||
@@ -13,8 +14,14 @@ const NullDependency = require("./NullDependency"); | ||
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ | ||
/** @typedef {import("../../declarations/WebpackOptions").CssGeneratorExportsConvention} CssGeneratorExportsConvention */ | ||
/** @typedef {import("../CssModule")} CssModule */ | ||
/** @typedef {import("../Dependency")} Dependency */ | ||
/** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ | ||
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ | ||
/** @typedef {import("../DependencyTemplate").CssDependencyTemplateContext} DependencyTemplateContext */ | ||
/** @typedef {import("../ModuleGraph")} ModuleGraph */ | ||
/** @typedef {import("../css/CssExportsGenerator")} CssExportsGenerator */ | ||
/** @typedef {import("../css/CssGenerator")} CssGenerator */ | ||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ | ||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ | ||
/** @typedef {import("../util/Hash")} Hash */ | ||
@@ -37,2 +44,15 @@ class CssExportDependency extends NullDependency { | ||
/** | ||
* @param {string} name export name | ||
* @param {CssGeneratorExportsConvention} convention convention of the export name | ||
* @returns {string[]} convention results | ||
*/ | ||
getExportsConventionNames(name, convention) { | ||
if (this._conventionNames) { | ||
return this._conventionNames; | ||
} | ||
this._conventionNames = cssExportConvention(name, convention); | ||
return this._conventionNames; | ||
} | ||
/** | ||
* Returns the exported names | ||
@@ -43,10 +63,12 @@ * @param {ModuleGraph} moduleGraph module graph | ||
getExports(moduleGraph) { | ||
const name = this.name; | ||
const module = /** @type {CssModule} */ (moduleGraph.getParentModule(this)); | ||
const convention = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
).convention; | ||
const names = this.getExportsConventionNames(this.name, convention); | ||
return { | ||
exports: [ | ||
{ | ||
name, | ||
canMangle: true | ||
} | ||
], | ||
exports: names.map(name => ({ | ||
name, | ||
canMangle: true | ||
})), | ||
dependencies: undefined | ||
@@ -57,2 +79,23 @@ }; | ||
/** | ||
* Update the hash | ||
* @param {Hash} hash hash to be updated | ||
* @param {UpdateHashContext} context context | ||
* @returns {void} | ||
*/ | ||
updateHash(hash, { chunkGraph }) { | ||
const module = /** @type {CssModule} */ ( | ||
chunkGraph.moduleGraph.getParentModule(this) | ||
); | ||
const generator = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
); | ||
const names = this.getExportsConventionNames( | ||
this.name, | ||
generator.convention | ||
); | ||
hash.update(`exportsConvention`); | ||
hash.update(JSON.stringify(names)); | ||
} | ||
/** | ||
* @param {ObjectSerializerContext} context context | ||
@@ -87,5 +130,25 @@ */ | ||
*/ | ||
apply(dependency, source, { cssExportsData }) { | ||
apply( | ||
dependency, | ||
source, | ||
{ cssExportsData, module: m, runtime, moduleGraph } | ||
) { | ||
const dep = /** @type {CssExportDependency} */ (dependency); | ||
cssExportsData.exports.set(dep.name, dep.value); | ||
const module = /** @type {CssModule} */ (m); | ||
const convention = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
).convention; | ||
const names = dep.getExportsConventionNames(dep.name, convention); | ||
const usedNames = /** @type {string[]} */ ( | ||
names | ||
.map(name => | ||
moduleGraph.getExportInfo(module, name).getUsedName(name, runtime) | ||
) | ||
.filter(Boolean) | ||
); | ||
if (usedNames.length === 0) return; | ||
for (const used of usedNames) { | ||
cssExportsData.exports.set(used, dep.value); | ||
} | ||
} | ||
@@ -92,0 +155,0 @@ }; |
@@ -8,2 +8,3 @@ /* | ||
const { cssExportConvention } = require("../util/conventions"); | ||
const createHash = require("../util/createHash"); | ||
@@ -21,2 +22,3 @@ const { makePathsRelative } = require("../util/identifier"); | ||
/** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ | ||
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ | ||
/** @typedef {import("../DependencyTemplate").CssDependencyTemplateContext} DependencyTemplateContext */ | ||
@@ -30,2 +32,3 @@ /** @typedef {import("../ModuleGraph")} ModuleGraph */ | ||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ | ||
/** @typedef {import("../util/Hash")} Hash */ | ||
@@ -95,2 +98,15 @@ /** | ||
/** | ||
* @param {string} name export name | ||
* @param {CssGeneratorExportsConvention} convention convention of the export name | ||
* @returns {string[]} convention results | ||
*/ | ||
getExportsConventionNames(name, convention) { | ||
if (this._conventionNames) { | ||
return this._conventionNames; | ||
} | ||
this._conventionNames = cssExportConvention(this.name, convention); | ||
return this._conventionNames; | ||
} | ||
/** | ||
* Returns the exported names | ||
@@ -101,10 +117,12 @@ * @param {ModuleGraph} moduleGraph module graph | ||
getExports(moduleGraph) { | ||
const name = this.name; | ||
const module = /** @type {CssModule} */ (moduleGraph.getParentModule(this)); | ||
const convention = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
).convention; | ||
const names = this.getExportsConventionNames(this.name, convention); | ||
return { | ||
exports: [ | ||
{ | ||
name, | ||
canMangle: true | ||
} | ||
], | ||
exports: names.map(name => ({ | ||
name, | ||
canMangle: true | ||
})), | ||
dependencies: undefined | ||
@@ -115,2 +133,25 @@ }; | ||
/** | ||
* Update the hash | ||
* @param {Hash} hash hash to be updated | ||
* @param {UpdateHashContext} context context | ||
* @returns {void} | ||
*/ | ||
updateHash(hash, { chunkGraph }) { | ||
const module = /** @type {CssModule} */ ( | ||
chunkGraph.moduleGraph.getParentModule(this) | ||
); | ||
const generator = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
); | ||
const names = this.getExportsConventionNames( | ||
this.name, | ||
generator.convention | ||
); | ||
hash.update(`exportsConvention`); | ||
hash.update(JSON.stringify(names)); | ||
hash.update(`localIdentName`); | ||
hash.update(generator.localIdentName); | ||
} | ||
/** | ||
* @param {ObjectSerializerContext} context context | ||
@@ -167,3 +208,3 @@ */ | ||
{ | ||
module, | ||
module: m, | ||
moduleGraph, | ||
@@ -177,16 +218,20 @@ chunkGraph, | ||
const dep = /** @type {CssLocalIdentifierDependency} */ (dependency); | ||
const used = moduleGraph | ||
.getExportInfo(module, dep.name) | ||
.getUsedName(dep.name, runtime); | ||
const module = /** @type {CssModule} */ (m); | ||
const convention = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
).convention; | ||
const names = dep.getExportsConventionNames(dep.name, convention); | ||
const usedNames = /** @type {string[]} */ ( | ||
names | ||
.map(name => | ||
moduleGraph.getExportInfo(module, name).getUsedName(name, runtime) | ||
) | ||
.filter(Boolean) | ||
); | ||
if (usedNames.length === 0) return; | ||
if (!used) return; | ||
// use the first usedName to generate localIdent, it's shorter when mangle exports enabled | ||
const localIdent = | ||
dep.prefix + | ||
getLocalIdent( | ||
used, | ||
/** @type {CssModule} */ (module), | ||
chunkGraph, | ||
runtimeTemplate | ||
); | ||
getLocalIdent(usedNames[0], module, chunkGraph, runtimeTemplate); | ||
source.replace( | ||
@@ -197,3 +242,5 @@ dep.range[0], | ||
); | ||
if (used) cssExportsData.exports.set(used, localIdent); | ||
for (const used of usedNames) { | ||
cssExportsData.exports.set(used, localIdent); | ||
} | ||
} | ||
@@ -200,0 +247,0 @@ }; |
@@ -347,2 +347,3 @@ /* | ||
if (dep.referencedPropertiesInDestructuring) { | ||
const prefixedIds = ids[0] === "default" ? ids.slice(1) : ids; | ||
for (let { | ||
@@ -353,4 +354,3 @@ id, | ||
} of dep.referencedPropertiesInDestructuring) { | ||
const concatedIds = ids.concat([id]); | ||
if (concatedIds[0] === "default") concatedIds.shift(); | ||
const concatedIds = prefixedIds.concat([id]); | ||
const module = moduleGraph.getModule(dep); | ||
@@ -357,0 +357,0 @@ const used = moduleGraph |
@@ -19,2 +19,3 @@ /* | ||
const { updateHashForEntryStartup } = require("../javascript/StartupHelpers"); | ||
const { getUndoPath } = require("../util/identifier"); | ||
@@ -90,7 +91,5 @@ /** @typedef {import("../Chunk")} Chunk */ | ||
) | ||
.replace(/^\/+/g, "") | ||
.split("/"); | ||
// remove filename, we only need the directory | ||
currentOutputName.pop(); | ||
/** | ||
@@ -113,8 +112,9 @@ * @param {Chunk} chunk the chunk | ||
) | ||
.replace(/^\/+/g, "") | ||
.split("/"); | ||
// remove common parts | ||
// remove common parts except filename | ||
while ( | ||
baseOutputName.length > 0 && | ||
chunkOutputName.length > 0 && | ||
baseOutputName.length > 1 && | ||
chunkOutputName.length > 1 && | ||
baseOutputName[0] === chunkOutputName[0] | ||
@@ -125,7 +125,6 @@ ) { | ||
} | ||
const last = chunkOutputName.join("/"); | ||
// create final path | ||
return ( | ||
(baseOutputName.length > 0 | ||
? "../".repeat(baseOutputName.length) | ||
: "./") + chunkOutputName.join("/") | ||
getUndoPath(baseOutputName.join("/"), last, true) + last | ||
); | ||
@@ -132,0 +131,0 @@ }; |
@@ -36,2 +36,3 @@ /* | ||
set.add(RuntimeGlobals.onChunksLoaded); | ||
set.add(RuntimeGlobals.exports); | ||
set.add(RuntimeGlobals.require); | ||
@@ -38,0 +39,0 @@ } |
@@ -11,2 +11,3 @@ /* | ||
const Template = require("../Template"); | ||
const { getUndoPath } = require("../util/identifier"); | ||
const { | ||
@@ -83,2 +84,3 @@ getChunkFilenameTemplate, | ||
) | ||
.replace(/^\/+/g, "") | ||
.split("/"); | ||
@@ -96,11 +98,9 @@ const runtimeOutputName = compilation | ||
) | ||
.replace(/^\/+/g, "") | ||
.split("/"); | ||
// remove filename, we only need the directory | ||
currentOutputName.pop(); | ||
// remove common parts | ||
while ( | ||
currentOutputName.length > 0 && | ||
runtimeOutputName.length > 0 && | ||
currentOutputName.length > 1 && | ||
runtimeOutputName.length > 1 && | ||
currentOutputName[0] === runtimeOutputName[0] | ||
@@ -111,8 +111,6 @@ ) { | ||
} | ||
const last = runtimeOutputName.join("/"); | ||
// create final path | ||
const runtimePath = | ||
(currentOutputName.length > 0 | ||
? "../".repeat(currentOutputName.length) | ||
: "./") + runtimeOutputName.join("/"); | ||
getUndoPath(currentOutputName.join("/"), last, true) + last; | ||
@@ -119,0 +117,0 @@ const entrySource = new ConcatSource(); |
@@ -438,2 +438,3 @@ /* | ||
set.add(RuntimeGlobals.onChunksLoaded); | ||
set.add(RuntimeGlobals.exports); | ||
set.add(RuntimeGlobals.require); | ||
@@ -825,3 +826,7 @@ } | ||
const startupSource = new ConcatSource(); | ||
startupSource.add(`var ${RuntimeGlobals.exports} = {};\n`); | ||
if (runtimeRequirements.has(RuntimeGlobals.exports)) { | ||
startupSource.add(`var ${RuntimeGlobals.exports} = {};\n`); | ||
} | ||
const renamedInlinedModule = this.renameInlineModule( | ||
@@ -828,0 +833,0 @@ allModules, |
@@ -359,3 +359,3 @@ /* | ||
runtimeRequirements(chunk, set, libraryContext) { | ||
// we don't need to return exports from runtime | ||
set.add(RuntimeGlobals.exports); | ||
} | ||
@@ -362,0 +362,0 @@ |
@@ -81,3 +81,4 @@ /* | ||
type, | ||
nsObjectUsed: type !== "module" | ||
nsObjectUsed: !["module", "modern-module"].includes(type), | ||
runtimeExportsUsed: type !== "modern-module" | ||
}).apply(compiler); | ||
@@ -242,2 +243,10 @@ }; | ||
} | ||
case "modern-module": { | ||
enableExportProperty(); | ||
const ModernModuleLibraryPlugin = require("./ModernModuleLibraryPlugin"); | ||
new ModernModuleLibraryPlugin({ | ||
type | ||
}).apply(compiler); | ||
break; | ||
} | ||
default: | ||
@@ -244,0 +253,0 @@ throw new Error(`Unsupported library type ${type}. |
@@ -33,2 +33,3 @@ /* | ||
* @property {boolean} nsObjectUsed the namespace object is used | ||
* @property {boolean} runtimeExportsUsed runtime exports are used | ||
*/ | ||
@@ -43,3 +44,3 @@ /** | ||
*/ | ||
constructor({ type, nsObjectUsed }) { | ||
constructor({ type, nsObjectUsed, runtimeExportsUsed }) { | ||
super({ | ||
@@ -50,2 +51,3 @@ pluginName: "ExportPropertyLibraryPlugin", | ||
this.nsObjectUsed = nsObjectUsed; | ||
this.runtimeExportsUsed = runtimeExportsUsed; | ||
} | ||
@@ -99,3 +101,7 @@ | ||
*/ | ||
runtimeRequirements(chunk, set, libraryContext) {} | ||
runtimeRequirements(chunk, set, libraryContext) { | ||
if (this.runtimeExportsUsed) { | ||
set.add(RuntimeGlobals.exports); | ||
} | ||
} | ||
@@ -102,0 +108,0 @@ /** |
@@ -870,5 +870,10 @@ /* | ||
const isBinaryModule = | ||
this.generatorOptions && this.generatorOptions.binary !== undefined | ||
? this.generatorOptions.binary | ||
: this.binary; | ||
this._source = this.createSource( | ||
/** @type {string} */ (options.context), | ||
this.binary ? asBuffer(source) : asString(source), | ||
isBinaryModule ? asBuffer(source) : asString(source), | ||
sourceMap, | ||
@@ -875,0 +880,0 @@ compilation.compiler.root |
@@ -10,2 +10,3 @@ /* | ||
const Referencer = require("eslint-scope/lib/referencer"); | ||
const { SyncBailHook } = require("tapable"); | ||
const { | ||
@@ -632,2 +633,10 @@ CachedSource, | ||
/** | ||
* @typedef {object} ConcatenateModuleHooks | ||
* @property {SyncBailHook<[Record<string, string>]>} exportsDefinitions | ||
*/ | ||
/** @type {WeakMap<Compilation, ConcatenateModuleHooks>} */ | ||
const compilationHooksMap = new WeakMap(); | ||
class ConcatenatedModule extends Module { | ||
@@ -638,2 +647,3 @@ /** | ||
* @param {RuntimeSpec} runtime the runtime | ||
* @param {Compilation} compilation the compilation | ||
* @param {object=} associatedObjectForCache object for caching | ||
@@ -647,2 +657,3 @@ * @param {string | HashConstructor=} hashFunction hash function to use | ||
runtime, | ||
compilation, | ||
associatedObjectForCache, | ||
@@ -661,3 +672,4 @@ hashFunction = "md4" | ||
modules, | ||
runtime | ||
runtime, | ||
compilation | ||
}); | ||
@@ -667,2 +679,17 @@ } | ||
/** | ||
* @param {Compilation} compilation the compilation | ||
* @returns {ConcatenateModuleHooks} the attached hooks | ||
*/ | ||
static getCompilationHooks(compilation) { | ||
let hooks = compilationHooksMap.get(compilation); | ||
if (hooks === undefined) { | ||
hooks = { | ||
exportsDefinitions: new SyncBailHook(["definitions"]) | ||
}; | ||
compilationHooksMap.set(compilation, hooks); | ||
} | ||
return hooks; | ||
} | ||
/** | ||
* @param {object} options options | ||
@@ -673,4 +700,5 @@ * @param {string} options.identifier the identifier of the module | ||
* @param {Set<Module>=} options.modules all concatenated modules | ||
* @param {Compilation} options.compilation the compilation | ||
*/ | ||
constructor({ identifier, rootModule, modules, runtime }) { | ||
constructor({ identifier, rootModule, modules, runtime, compilation }) { | ||
super(JAVASCRIPT_MODULE_TYPE_ESM, null, rootModule && rootModule.layer); | ||
@@ -687,2 +715,4 @@ | ||
this.factoryMeta = rootModule && rootModule.factoryMeta; | ||
/** @type {Compilation | undefined} */ | ||
this.compilation = compilation; | ||
} | ||
@@ -1438,2 +1468,4 @@ | ||
const exportsInfo = moduleGraph.getExportsInfo(rootInfo.module); | ||
/** @type {Record<string, string>} */ | ||
const exportsFinalName = {}; | ||
for (const exportInfo of exportsInfo.orderedExports) { | ||
@@ -1463,2 +1495,3 @@ const name = exportInfo.name; | ||
); | ||
exportsFinalName[used] = finalName; | ||
return `/* ${ | ||
@@ -1479,2 +1512,3 @@ exportInfo.isReexport() ? "reexport" : "binding" | ||
// add harmony compatibility flag (must be first because of possible circular dependencies) | ||
let shouldAddHarmonyFlag = false; | ||
if ( | ||
@@ -1484,9 +1518,3 @@ moduleGraph.getExportsInfo(this).otherExportsInfo.getUsed(runtime) !== | ||
) { | ||
result.add(`// ESM COMPAT FLAG\n`); | ||
result.add( | ||
runtimeTemplate.defineEsModuleFlagStatement({ | ||
exportsArgument: this.exportsArgument, | ||
runtimeRequirements | ||
}) | ||
); | ||
shouldAddHarmonyFlag = true; | ||
} | ||
@@ -1496,4 +1524,6 @@ | ||
if (exportsMap.size > 0) { | ||
runtimeRequirements.add(RuntimeGlobals.exports); | ||
runtimeRequirements.add(RuntimeGlobals.definePropertyGetters); | ||
const { exportsDefinitions } = ConcatenatedModule.getCompilationHooks( | ||
this.compilation | ||
); | ||
const definitions = []; | ||
@@ -1507,8 +1537,28 @@ for (const [key, value] of exportsMap) { | ||
} | ||
result.add(`\n// EXPORTS\n`); | ||
result.add( | ||
`${RuntimeGlobals.definePropertyGetters}(${ | ||
this.exportsArgument | ||
}, {${definitions.join(",")}\n});\n` | ||
); | ||
const shouldSkipRenderDefinitions = | ||
exportsDefinitions.call(exportsFinalName); | ||
if (!shouldSkipRenderDefinitions) { | ||
runtimeRequirements.add(RuntimeGlobals.exports); | ||
runtimeRequirements.add(RuntimeGlobals.definePropertyGetters); | ||
if (shouldAddHarmonyFlag) { | ||
result.add(`// ESM COMPAT FLAG\n`); | ||
result.add( | ||
runtimeTemplate.defineEsModuleFlagStatement({ | ||
exportsArgument: this.exportsArgument, | ||
runtimeRequirements | ||
}) | ||
); | ||
} | ||
result.add(`\n// EXPORTS\n`); | ||
result.add( | ||
`${RuntimeGlobals.definePropertyGetters}(${ | ||
this.exportsArgument | ||
}, {${definitions.join(",")}\n});\n` | ||
); | ||
} else { | ||
this.buildMeta.exportsFinalName = exportsFinalName; | ||
} | ||
} | ||
@@ -1930,3 +1980,4 @@ | ||
modules: undefined, | ||
runtime: undefined | ||
runtime: undefined, | ||
compilation: undefined | ||
}); | ||
@@ -1933,0 +1984,0 @@ obj.deserialize(context); |
@@ -401,2 +401,3 @@ /* | ||
// Create a new ConcatenatedModule | ||
ConcatenatedModule.getCompilationHooks(compilation); | ||
let newModule = ConcatenatedModule.create( | ||
@@ -406,2 +407,3 @@ rootModule, | ||
concatConfiguration.runtime, | ||
compilation, | ||
compiler.root, | ||
@@ -408,0 +410,0 @@ compilation.outputOptions.hashFunction |
@@ -38,2 +38,3 @@ /* | ||
set.add(RuntimeGlobals.onChunksLoaded); | ||
set.add(RuntimeGlobals.exports); | ||
compilation.addRuntimeModule( | ||
@@ -40,0 +41,0 @@ chunk, |
@@ -210,22 +210,27 @@ /* | ||
} | ||
let fn = "load"; | ||
const args = [JSON.stringify(shareScope), JSON.stringify(shareKey)]; | ||
const args = [ | ||
JSON.stringify(shareScope), | ||
JSON.stringify(shareKey), | ||
JSON.stringify(eager) | ||
]; | ||
if (requiredVersion) { | ||
if (strictVersion) { | ||
fn += "Strict"; | ||
} | ||
if (singleton) { | ||
fn += "Singleton"; | ||
} | ||
args.push(stringifyHoley(requiredVersion)); | ||
fn += "VersionCheck"; | ||
} else { | ||
if (singleton) { | ||
fn += "Singleton"; | ||
} | ||
} | ||
if (fallbackCode) { | ||
fn += "Fallback"; | ||
args.push(fallbackCode); | ||
} | ||
let fn; | ||
if (requiredVersion) { | ||
if (strictVersion) { | ||
fn = singleton ? "loadStrictSingletonVersion" : "loadStrictVersion"; | ||
} else { | ||
fn = singleton ? "loadSingletonVersion" : "loadVersion"; | ||
} | ||
} else { | ||
fn = singleton ? "loadSingleton" : "load"; | ||
} | ||
const code = runtimeTemplate.returningFunction(`${fn}(${args.join(", ")})`); | ||
@@ -232,0 +237,0 @@ const sources = new Map(); |
@@ -98,59 +98,35 @@ /* | ||
satisfyRuntimeCode(runtimeTemplate), | ||
`var ensureExistence = ${runtimeTemplate.basicFunction("scopeName, key", [ | ||
`var scope = ${RuntimeGlobals.shareScopeMap}[scopeName];`, | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) throw new Error("Shared module " + key + " doesn't exist in shared scope " + scopeName);`, | ||
"return scope;" | ||
`var exists = ${runtimeTemplate.basicFunction("scope, key", [ | ||
`return scope && ${RuntimeGlobals.hasOwnProperty}(scope, key);` | ||
])}`, | ||
`var get = ${runtimeTemplate.basicFunction("entry", [ | ||
"entry.loaded = 1;", | ||
"return entry.get()" | ||
])};`, | ||
`var findVersion = ${runtimeTemplate.basicFunction("scope, key", [ | ||
"var versions = scope[key];", | ||
`var key = Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"a, b", | ||
["return !a || versionLt(a, b) ? b : a;"] | ||
)}, 0);`, | ||
"return key && versions[key]" | ||
`var eagerOnly = ${runtimeTemplate.basicFunction("versions", [ | ||
`return Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"filtered, version", | ||
Template.indent([ | ||
"if (versions[version].eager) {", | ||
Template.indent(["filtered[version] = versions[version];"]), | ||
"}", | ||
"return filtered;" | ||
]) | ||
)}, {});` | ||
])};`, | ||
`var findSingletonVersionKey = ${runtimeTemplate.basicFunction( | ||
"scope, key", | ||
`var findLatestVersion = ${runtimeTemplate.basicFunction( | ||
"scope, key, eager", | ||
[ | ||
"var versions = scope[key];", | ||
`return Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"var versions = eager ? eagerOnly(scope[key]) : scope[key];", | ||
`var key = Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"a, b", | ||
["return !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;"] | ||
)}, 0);` | ||
["return !a || versionLt(a, b) ? b : a;"] | ||
)}, 0);`, | ||
"return key && versions[key];" | ||
] | ||
)};`, | ||
`var getInvalidSingletonVersionMessage = ${runtimeTemplate.basicFunction( | ||
"scope, key, version, requiredVersion", | ||
`var findSatisfyingVersion = ${runtimeTemplate.basicFunction( | ||
"scope, key, requiredVersion, eager", | ||
[ | ||
`return "Unsatisfied version " + version + " from " + (version && scope[key][version].from) + " of shared singleton module " + key + " (required " + rangeToString(requiredVersion) + ")"` | ||
] | ||
)};`, | ||
`var getSingleton = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"var version = findSingletonVersionKey(scope, key);", | ||
"return get(scope[key][version]);" | ||
] | ||
)};`, | ||
`var getSingletonVersion = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"var version = findSingletonVersionKey(scope, key);", | ||
"if (!satisfy(requiredVersion, version)) warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));", | ||
"return get(scope[key][version]);" | ||
] | ||
)};`, | ||
`var getStrictSingletonVersion = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"var version = findSingletonVersionKey(scope, key);", | ||
"if (!satisfy(requiredVersion, version)) " + | ||
"throw new Error(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));", | ||
"return get(scope[key][version]);" | ||
] | ||
)};`, | ||
`var findValidVersion = ${runtimeTemplate.basicFunction( | ||
"scope, key, requiredVersion", | ||
[ | ||
"var versions = scope[key];", | ||
"var versions = eager ? eagerOnly(scope[key]) : scope[key];", | ||
`var key = Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
@@ -166,7 +142,23 @@ "a, b", | ||
)};`, | ||
`var findSingletonVersionKey = ${runtimeTemplate.basicFunction( | ||
"scope, key, eager", | ||
[ | ||
"var versions = eager ? eagerOnly(scope[key]) : scope[key];", | ||
`return Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"a, b", | ||
["return !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;"] | ||
)}, 0);` | ||
] | ||
)};`, | ||
`var getInvalidSingletonVersionMessage = ${runtimeTemplate.basicFunction( | ||
"scope, key, version, requiredVersion", | ||
[ | ||
'return "Unsatisfied version " + version + " from " + (version && scope[key][version].from) + " of shared singleton module " + key + " (required " + rangeToString(requiredVersion) + ")"' | ||
] | ||
)};`, | ||
`var getInvalidVersionMessage = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
"scope, scopeName, key, requiredVersion, eager", | ||
[ | ||
"var versions = scope[key];", | ||
'return "No satisfying version (" + rangeToString(requiredVersion) + ") of shared module " + key + " found in shared scope " + scopeName + ".\\n" +', | ||
'return "No satisfying version (" + rangeToString(requiredVersion) + ")" + (eager ? " for eager consumption" : "") + " of shared module " + key + " found in shared scope " + scopeName + ".\\n" +', | ||
`\t"Available versions: " + Object.keys(versions).map(${runtimeTemplate.basicFunction( | ||
@@ -178,11 +170,9 @@ "key", | ||
)};`, | ||
`var getValidVersion = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"var entry = findValidVersion(scope, key, requiredVersion);", | ||
"if(entry) return get(entry);", | ||
"throw new Error(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));" | ||
] | ||
)};`, | ||
`var warn = ${ | ||
`var fail = ${runtimeTemplate.basicFunction("msg", [ | ||
"throw new Error(msg);" | ||
])}`, | ||
`var failAsNotExist = ${runtimeTemplate.basicFunction("scopeName, key", [ | ||
'return fail("Shared module " + key + " doesn\'t exist in shared scope " + scopeName);' | ||
])}`, | ||
`var warn = /*#__PURE__*/ ${ | ||
compilation.outputOptions.ignoreBrowserWarnings | ||
@@ -194,19 +184,14 @@ ? runtimeTemplate.basicFunction("", "") | ||
};`, | ||
`var warnInvalidVersion = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"warn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));" | ||
] | ||
)};`, | ||
`var get = ${runtimeTemplate.basicFunction("entry", [ | ||
"entry.loaded = 1;", | ||
"return entry.get()" | ||
])};`, | ||
`var init = ${runtimeTemplate.returningFunction( | ||
Template.asString([ | ||
"function(scopeName, a, b, c) {", | ||
"function(scopeName, key, eager, c, d) {", | ||
Template.indent([ | ||
`var promise = ${RuntimeGlobals.initializeSharing}(scopeName);`, | ||
`if (promise && promise.then) return promise.then(fn.bind(fn, scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], a, b, c));`, | ||
`return fn(scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], a, b, c);` | ||
// if we require eager shared, we expect it to be already loaded before it requested, no need to wait the whole scope loaded. | ||
"if (promise && promise.then && !eager) { ", | ||
Template.indent([ | ||
`return promise.then(fn.bind(fn, scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], key, false, c, d));` | ||
]), | ||
"}", | ||
`return fn(scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], key, eager, c, d);` | ||
]), | ||
@@ -218,85 +203,67 @@ "}" | ||
"", | ||
`var useFallback = ${runtimeTemplate.basicFunction( | ||
"scopeName, key, fallback", | ||
["return fallback ? fallback() : failAsNotExist(scopeName, key);"] | ||
)}`, | ||
`var load = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key", | ||
"scopeName, scope, key, eager, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return get(findVersion(scope, key));" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"return get(findLatestVersion(scope, key, eager));" | ||
] | ||
)});`, | ||
`var loadFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, fallback", | ||
`var loadVersion = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, eager, requiredVersion, fallback", | ||
[ | ||
`return scope && ${RuntimeGlobals.hasOwnProperty}(scope, key) ? get(findVersion(scope, key)) : fallback();` | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);", | ||
"if (satisfyingVersion) return get(satisfyingVersion);", | ||
"warn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager))", | ||
"return get(findLatestVersion(scope, key, eager));" | ||
] | ||
)});`, | ||
`var loadVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version", | ||
`var loadStrictVersion = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, eager, requiredVersion, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);", | ||
"if (satisfyingVersion) return get(satisfyingVersion);", | ||
"if (fallback) return fallback();", | ||
"fail(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager));" | ||
] | ||
)});`, | ||
`var loadSingleton = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key", | ||
"scopeName, scope, key, eager, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return getSingleton(scope, scopeName, key);" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var version = findSingletonVersionKey(scope, key, eager);", | ||
"return get(scope[key][version]);" | ||
] | ||
)});`, | ||
`var loadSingletonVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version", | ||
`var loadSingletonVersion = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, eager, requiredVersion, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return getSingletonVersion(scope, scopeName, key, version);" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var version = findSingletonVersionKey(scope, key, eager);", | ||
"if (!satisfy(requiredVersion, version)) {", | ||
Template.indent([ | ||
"warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));" | ||
]), | ||
"}", | ||
"return get(scope[key][version]);" | ||
] | ||
)});`, | ||
`var loadStrictVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version", | ||
`var loadStrictSingletonVersion = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, eager, requiredVersion, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return getValidVersion(scope, scopeName, key, version);" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var version = findSingletonVersionKey(scope, key, eager);", | ||
"if (!satisfy(requiredVersion, version)) {", | ||
Template.indent([ | ||
"fail(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));" | ||
]), | ||
"}", | ||
"return get(scope[key][version]);" | ||
] | ||
)});`, | ||
`var loadStrictSingletonVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return getStrictSingletonVersion(scope, scopeName, key, version);" | ||
] | ||
)});`, | ||
`var loadVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version, fallback", | ||
[ | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, | ||
"return get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));" | ||
] | ||
)});`, | ||
`var loadSingletonFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, fallback", | ||
[ | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, | ||
"return getSingleton(scope, scopeName, key);" | ||
] | ||
)});`, | ||
`var loadSingletonVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version, fallback", | ||
[ | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, | ||
"return getSingletonVersion(scope, scopeName, key, version);" | ||
] | ||
)});`, | ||
`var loadStrictVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version, fallback", | ||
[ | ||
`var entry = scope && ${RuntimeGlobals.hasOwnProperty}(scope, key) && findValidVersion(scope, key, version);`, | ||
`return entry ? get(entry) : fallback();` | ||
] | ||
)});`, | ||
`var loadStrictSingletonVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version, fallback", | ||
[ | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, | ||
"return getStrictSingletonVersion(scope, scopeName, key, version);" | ||
] | ||
)});`, | ||
"var installedModules = {};", | ||
@@ -303,0 +270,0 @@ "var moduleToHandlerMapping = {", |
@@ -15,2 +15,3 @@ /* | ||
/** @typedef {import("../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ | ||
/** @typedef {import("./Compiler")} Compiler */ | ||
@@ -36,4 +37,5 @@ /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ | ||
* @param {JavascriptParser} parser the parser | ||
* @param {JavascriptParserOptions} parserOptions the javascript parser options | ||
*/ | ||
const handler = parser => { | ||
const handler = (parser, parserOptions) => { | ||
parser.hooks.program.tap(PLUGIN_NAME, ast => { | ||
@@ -59,2 +61,7 @@ const firstNode = ast.body[0]; | ||
} | ||
if (parserOptions.overrideStrict) { | ||
/** @type {BuildInfo} */ | ||
(parser.state.module.buildInfo).strict = | ||
parserOptions.overrideStrict === "strict"; | ||
} | ||
}); | ||
@@ -61,0 +68,0 @@ }; |
@@ -13,3 +13,3 @@ /* | ||
* @param {CssGeneratorExportsConvention | undefined} convention convention | ||
* @returns {Set<string>} results | ||
* @returns {string[]} results | ||
*/ | ||
@@ -46,3 +46,3 @@ exports.cssExportConvention = (input, convention) => { | ||
} | ||
return set; | ||
return Array.from(set); | ||
}; | ||
@@ -49,0 +49,0 @@ |
@@ -289,2 +289,7 @@ /* | ||
} | ||
if (options.output.enabledLibraryTypes.includes("modern-module")) { | ||
throw new Error( | ||
"library type \"modern-module\" is only allowed when 'experiments.outputModule' is enabled" | ||
); | ||
} | ||
if (options.externalsType === "module") { | ||
@@ -291,0 +296,0 @@ throw new Error( |
{ | ||
"name": "webpack", | ||
"version": "5.92.1", | ||
"version": "5.93.0", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -41,3 +41,3 @@ "description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", | ||
"@babel/preset-react": "^7.24.7", | ||
"@eslint/js": "^9.4.0", | ||
"@eslint/js": "^9.5.0", | ||
"@types/glob-to-regexp": "^0.4.4", | ||
@@ -60,3 +60,3 @@ "@types/jest": "^29.5.11", | ||
"es6-promise-polyfill": "^1.2.0", | ||
"eslint": "^9.4.0", | ||
"eslint": "^9.5.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
@@ -63,0 +63,0 @@ "eslint-plugin-jest": "^28.6.0", |
@@ -6,2 +6,2 @@ /* | ||
*/ | ||
const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function n(t,{instancePath:r="",parentData:e,parentDataProperty:a,rootData:s=t}={}){let o=null,l=0;const i=l;let p=!1;const u=l;if(l==l)if(t&&"object"==typeof t&&!Array.isArray(t)){const n=l;for(const n in t)if("encoding"!==n&&"mimetype"!==n){const t={params:{additionalProperty:n}};null===o?o=[t]:o.push(t),l++;break}if(n===l){if(void 0!==t.encoding){let n=t.encoding;const r=l;if(!1!==n&&"base64"!==n){const t={params:{}};null===o?o=[t]:o.push(t),l++}var c=r===l}else c=!0;if(c)if(void 0!==t.mimetype){const n=l;if("string"!=typeof t.mimetype){const t={params:{type:"string"}};null===o?o=[t]:o.push(t),l++}c=n===l}else c=!0}}else{const t={params:{type:"object"}};null===o?o=[t]:o.push(t),l++}var f=u===l;if(p=p||f,!p){const n=l;if(!(t instanceof Function)){const t={params:{}};null===o?o=[t]:o.push(t),l++}f=n===l,p=p||f}if(!p){const t={params:{}};return null===o?o=[t]:o.push(t),l++,n.errors=o,!1}return l=i,null!==o&&(i?o.length=i:o=null),n.errors=o,0===l}function r(e,{instancePath:a="",parentData:s,parentDataProperty:o,rootData:l=e}={}){let i=null,p=0;if(0===p){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{const s=p;for(const t in e)if("dataUrl"!==t&&"emit"!==t&&"filename"!==t&&"outputPath"!==t&&"publicPath"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(s===p){if(void 0!==e.dataUrl){const t=p;n(e.dataUrl,{instancePath:a+"/dataUrl",parentData:e,parentDataProperty:"dataUrl",rootData:l})||(i=null===i?n.errors:i.concat(n.errors),p=i.length);var u=t===p}else u=!0;if(u){if(void 0!==e.emit){const t=p;if("boolean"!=typeof e.emit)return r.errors=[{params:{type:"boolean"}}],!1;u=t===p}else u=!0;if(u){if(void 0!==e.filename){let n=e.filename;const a=p,s=p;let o=!1;const l=p;if(p===l)if("string"==typeof n){if(n.includes("!")||!1!==t.test(n)){const t={params:{}};null===i?i=[t]:i.push(t),p++}else if(n.length<1){const t={params:{}};null===i?i=[t]:i.push(t),p++}}else{const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var c=l===p;if(o=o||c,!o){const t=p;if(!(n instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}c=t===p,o=o||c}if(!o){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),u=a===p}else u=!0;if(u){if(void 0!==e.outputPath){let n=e.outputPath;const a=p,s=p;let o=!1;const l=p;if(p===l)if("string"==typeof n){if(n.includes("!")||!1!==t.test(n)){const t={params:{}};null===i?i=[t]:i.push(t),p++}}else{const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var f=l===p;if(o=o||f,!o){const t=p;if(!(n instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}f=t===p,o=o||f}if(!o){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),u=a===p}else u=!0;if(u)if(void 0!==e.publicPath){let t=e.publicPath;const n=p,a=p;let s=!1;const o=p;if("string"!=typeof t){const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var h=o===p;if(s=s||h,!s){const n=p;if(!(t instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}h=n===p,s=s||h}if(!s){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=a,null!==i&&(a?i.length=a:i=null),u=n===p}else u=!0}}}}}}return r.errors=i,0===p}function e(t,{instancePath:n="",parentData:a,parentDataProperty:s,rootData:o=t}={}){let l=null,i=0;return r(t,{instancePath:n,parentData:a,parentDataProperty:s,rootData:o})||(l=null===l?r.errors:l.concat(r.errors),i=l.length),e.errors=l,0===i}module.exports=e,module.exports.default=e; | ||
const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function n(t,{instancePath:r="",parentData:e,parentDataProperty:a,rootData:s=t}={}){let o=null,l=0;const i=l;let p=!1;const u=l;if(l==l)if(t&&"object"==typeof t&&!Array.isArray(t)){const n=l;for(const n in t)if("encoding"!==n&&"mimetype"!==n){const t={params:{additionalProperty:n}};null===o?o=[t]:o.push(t),l++;break}if(n===l){if(void 0!==t.encoding){let n=t.encoding;const r=l;if(!1!==n&&"base64"!==n){const t={params:{}};null===o?o=[t]:o.push(t),l++}var c=r===l}else c=!0;if(c)if(void 0!==t.mimetype){const n=l;if("string"!=typeof t.mimetype){const t={params:{type:"string"}};null===o?o=[t]:o.push(t),l++}c=n===l}else c=!0}}else{const t={params:{type:"object"}};null===o?o=[t]:o.push(t),l++}var f=u===l;if(p=p||f,!p){const n=l;if(!(t instanceof Function)){const t={params:{}};null===o?o=[t]:o.push(t),l++}f=n===l,p=p||f}if(!p){const t={params:{}};return null===o?o=[t]:o.push(t),l++,n.errors=o,!1}return l=i,null!==o&&(i?o.length=i:o=null),n.errors=o,0===l}function r(e,{instancePath:a="",parentData:s,parentDataProperty:o,rootData:l=e}={}){let i=null,p=0;if(0===p){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{const s=p;for(const t in e)if("binary"!==t&&"dataUrl"!==t&&"emit"!==t&&"filename"!==t&&"outputPath"!==t&&"publicPath"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(s===p){if(void 0!==e.binary){const t=p;if("boolean"!=typeof e.binary)return r.errors=[{params:{type:"boolean"}}],!1;var u=t===p}else u=!0;if(u){if(void 0!==e.dataUrl){const t=p;n(e.dataUrl,{instancePath:a+"/dataUrl",parentData:e,parentDataProperty:"dataUrl",rootData:l})||(i=null===i?n.errors:i.concat(n.errors),p=i.length),u=t===p}else u=!0;if(u){if(void 0!==e.emit){const t=p;if("boolean"!=typeof e.emit)return r.errors=[{params:{type:"boolean"}}],!1;u=t===p}else u=!0;if(u){if(void 0!==e.filename){let n=e.filename;const a=p,s=p;let o=!1;const l=p;if(p===l)if("string"==typeof n){if(n.includes("!")||!1!==t.test(n)){const t={params:{}};null===i?i=[t]:i.push(t),p++}else if(n.length<1){const t={params:{}};null===i?i=[t]:i.push(t),p++}}else{const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var c=l===p;if(o=o||c,!o){const t=p;if(!(n instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}c=t===p,o=o||c}if(!o){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),u=a===p}else u=!0;if(u){if(void 0!==e.outputPath){let n=e.outputPath;const a=p,s=p;let o=!1;const l=p;if(p===l)if("string"==typeof n){if(n.includes("!")||!1!==t.test(n)){const t={params:{}};null===i?i=[t]:i.push(t),p++}}else{const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var f=l===p;if(o=o||f,!o){const t=p;if(!(n instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}f=t===p,o=o||f}if(!o){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),u=a===p}else u=!0;if(u)if(void 0!==e.publicPath){let t=e.publicPath;const n=p,a=p;let s=!1;const o=p;if("string"!=typeof t){const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var h=o===p;if(s=s||h,!s){const n=p;if(!(t instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}h=n===p,s=s||h}if(!s){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=a,null!==i&&(a?i.length=a:i=null),u=n===p}else u=!0}}}}}}}return r.errors=i,0===p}function e(t,{instancePath:n="",parentData:a,parentDataProperty:s,rootData:o=t}={}){let l=null,i=0;return r(t,{instancePath:n,parentData:a,parentDataProperty:s,rootData:o})||(l=null===l?r.errors:l.concat(r.errors),i=l.length),e.errors=l,0===i}module.exports=e,module.exports.default=e; |
@@ -6,2 +6,2 @@ /* | ||
*/ | ||
"use strict";function t(r,{instancePath:a="",parentData:n,parentDataProperty:e,rootData:o=r}={}){let s=null,l=0;const i=l;let p=!1;const c=l;if(l==l)if(r&&"object"==typeof r&&!Array.isArray(r)){const t=l;for(const t in r)if("encoding"!==t&&"mimetype"!==t){const r={params:{additionalProperty:t}};null===s?s=[r]:s.push(r),l++;break}if(t===l){if(void 0!==r.encoding){let t=r.encoding;const a=l;if(!1!==t&&"base64"!==t){const t={params:{}};null===s?s=[t]:s.push(t),l++}var u=a===l}else u=!0;if(u)if(void 0!==r.mimetype){const t=l;if("string"!=typeof r.mimetype){const t={params:{type:"string"}};null===s?s=[t]:s.push(t),l++}u=t===l}else u=!0}}else{const t={params:{type:"object"}};null===s?s=[t]:s.push(t),l++}var f=c===l;if(p=p||f,!p){const t=l;if(!(r instanceof Function)){const t={params:{}};null===s?s=[t]:s.push(t),l++}f=t===l,p=p||f}if(!p){const r={params:{}};return null===s?s=[r]:s.push(r),l++,t.errors=s,!1}return l=i,null!==s&&(i?s.length=i:s=null),t.errors=s,0===l}function r(a,{instancePath:n="",parentData:e,parentDataProperty:o,rootData:s=a}={}){let l=null,i=0;if(0===i){if(!a||"object"!=typeof a||Array.isArray(a))return r.errors=[{params:{type:"object"}}],!1;{const e=i;for(const t in a)if("dataUrl"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;e===i&&void 0!==a.dataUrl&&(t(a.dataUrl,{instancePath:n+"/dataUrl",parentData:a,parentDataProperty:"dataUrl",rootData:s})||(l=null===l?t.errors:l.concat(t.errors),i=l.length))}}return r.errors=l,0===i}function a(t,{instancePath:n="",parentData:e,parentDataProperty:o,rootData:s=t}={}){let l=null,i=0;return r(t,{instancePath:n,parentData:e,parentDataProperty:o,rootData:s})||(l=null===l?r.errors:l.concat(r.errors),i=l.length),a.errors=l,0===i}module.exports=a,module.exports.default=a; | ||
"use strict";function t(r,{instancePath:a="",parentData:e,parentDataProperty:n,rootData:o=r}={}){let s=null,i=0;const l=i;let p=!1;const c=i;if(i==i)if(r&&"object"==typeof r&&!Array.isArray(r)){const t=i;for(const t in r)if("encoding"!==t&&"mimetype"!==t){const r={params:{additionalProperty:t}};null===s?s=[r]:s.push(r),i++;break}if(t===i){if(void 0!==r.encoding){let t=r.encoding;const a=i;if(!1!==t&&"base64"!==t){const t={params:{}};null===s?s=[t]:s.push(t),i++}var u=a===i}else u=!0;if(u)if(void 0!==r.mimetype){const t=i;if("string"!=typeof r.mimetype){const t={params:{type:"string"}};null===s?s=[t]:s.push(t),i++}u=t===i}else u=!0}}else{const t={params:{type:"object"}};null===s?s=[t]:s.push(t),i++}var f=c===i;if(p=p||f,!p){const t=i;if(!(r instanceof Function)){const t={params:{}};null===s?s=[t]:s.push(t),i++}f=t===i,p=p||f}if(!p){const r={params:{}};return null===s?s=[r]:s.push(r),i++,t.errors=s,!1}return i=l,null!==s&&(l?s.length=l:s=null),t.errors=s,0===i}function r(a,{instancePath:e="",parentData:n,parentDataProperty:o,rootData:s=a}={}){let i=null,l=0;if(0===l){if(!a||"object"!=typeof a||Array.isArray(a))return r.errors=[{params:{type:"object"}}],!1;{const n=l;for(const t in a)if("binary"!==t&&"dataUrl"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(n===l){if(void 0!==a.binary){const t=l;if("boolean"!=typeof a.binary)return r.errors=[{params:{type:"boolean"}}],!1;var p=t===l}else p=!0;if(p)if(void 0!==a.dataUrl){const r=l;t(a.dataUrl,{instancePath:e+"/dataUrl",parentData:a,parentDataProperty:"dataUrl",rootData:s})||(i=null===i?t.errors:i.concat(t.errors),l=i.length),p=r===l}else p=!0}}}return r.errors=i,0===l}function a(t,{instancePath:e="",parentData:n,parentDataProperty:o,rootData:s=t}={}){let i=null,l=0;return r(t,{instancePath:e,parentData:n,parentDataProperty:o,rootData:s})||(i=null===i?r.errors:i.concat(r.errors),l=i.length),a.errors=i,0===l}module.exports=a,module.exports.default=a; |
@@ -6,2 +6,2 @@ /* | ||
*/ | ||
const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function n(r,{instancePath:e="",parentData:s,parentDataProperty:a,rootData:o=r}={}){let l=null,i=0;if(0===i){if(!r||"object"!=typeof r||Array.isArray(r))return n.errors=[{params:{type:"object"}}],!1;{const e=i;for(const t in r)if("emit"!==t&&"filename"!==t&&"outputPath"!==t&&"publicPath"!==t)return n.errors=[{params:{additionalProperty:t}}],!1;if(e===i){if(void 0!==r.emit){const t=i;if("boolean"!=typeof r.emit)return n.errors=[{params:{type:"boolean"}}],!1;var u=t===i}else u=!0;if(u){if(void 0!==r.filename){let e=r.filename;const s=i,a=i;let o=!1;const c=i;if(i===c)if("string"==typeof e){if(e.includes("!")||!1!==t.test(e)){const t={params:{}};null===l?l=[t]:l.push(t),i++}else if(e.length<1){const t={params:{}};null===l?l=[t]:l.push(t),i++}}else{const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var p=c===i;if(o=o||p,!o){const t=i;if(!(e instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}p=t===i,o=o||p}if(!o){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=a,null!==l&&(a?l.length=a:l=null),u=s===i}else u=!0;if(u){if(void 0!==r.outputPath){let e=r.outputPath;const s=i,a=i;let o=!1;const p=i;if(i===p)if("string"==typeof e){if(e.includes("!")||!1!==t.test(e)){const t={params:{}};null===l?l=[t]:l.push(t),i++}}else{const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var c=p===i;if(o=o||c,!o){const t=i;if(!(e instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}c=t===i,o=o||c}if(!o){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=a,null!==l&&(a?l.length=a:l=null),u=s===i}else u=!0;if(u)if(void 0!==r.publicPath){let t=r.publicPath;const e=i,s=i;let a=!1;const o=i;if("string"!=typeof t){const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var f=o===i;if(a=a||f,!a){const n=i;if(!(t instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}f=n===i,a=a||f}if(!a){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=s,null!==l&&(s?l.length=s:l=null),u=e===i}else u=!0}}}}}return n.errors=l,0===i}function r(t,{instancePath:e="",parentData:s,parentDataProperty:a,rootData:o=t}={}){let l=null,i=0;return n(t,{instancePath:e,parentData:s,parentDataProperty:a,rootData:o})||(l=null===l?n.errors:l.concat(n.errors),i=l.length),r.errors=l,0===i}module.exports=r,module.exports.default=r; | ||
const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function n(r,{instancePath:e="",parentData:a,parentDataProperty:s,rootData:o=r}={}){let l=null,i=0;if(0===i){if(!r||"object"!=typeof r||Array.isArray(r))return n.errors=[{params:{type:"object"}}],!1;{const e=i;for(const t in r)if("binary"!==t&&"emit"!==t&&"filename"!==t&&"outputPath"!==t&&"publicPath"!==t)return n.errors=[{params:{additionalProperty:t}}],!1;if(e===i){if(void 0!==r.binary){const t=i;if("boolean"!=typeof r.binary)return n.errors=[{params:{type:"boolean"}}],!1;var u=t===i}else u=!0;if(u){if(void 0!==r.emit){const t=i;if("boolean"!=typeof r.emit)return n.errors=[{params:{type:"boolean"}}],!1;u=t===i}else u=!0;if(u){if(void 0!==r.filename){let e=r.filename;const a=i,s=i;let o=!1;const f=i;if(i===f)if("string"==typeof e){if(e.includes("!")||!1!==t.test(e)){const t={params:{}};null===l?l=[t]:l.push(t),i++}else if(e.length<1){const t={params:{}};null===l?l=[t]:l.push(t),i++}}else{const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var p=f===i;if(o=o||p,!o){const t=i;if(!(e instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}p=t===i,o=o||p}if(!o){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=s,null!==l&&(s?l.length=s:l=null),u=a===i}else u=!0;if(u){if(void 0!==r.outputPath){let e=r.outputPath;const a=i,s=i;let o=!1;const p=i;if(i===p)if("string"==typeof e){if(e.includes("!")||!1!==t.test(e)){const t={params:{}};null===l?l=[t]:l.push(t),i++}}else{const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var f=p===i;if(o=o||f,!o){const t=i;if(!(e instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}f=t===i,o=o||f}if(!o){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=s,null!==l&&(s?l.length=s:l=null),u=a===i}else u=!0;if(u)if(void 0!==r.publicPath){let t=r.publicPath;const e=i,a=i;let s=!1;const o=i;if("string"!=typeof t){const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var c=o===i;if(s=s||c,!s){const n=i;if(!(t instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}c=n===i,s=s||c}if(!s){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=a,null!==l&&(a?l.length=a:l=null),u=e===i}else u=!0}}}}}}return n.errors=l,0===i}function r(t,{instancePath:e="",parentData:a,parentDataProperty:s,rootData:o=t}={}){let l=null,i=0;return n(t,{instancePath:e,parentData:a,parentDataProperty:s,rootData:o})||(l=null===l?n.errors:l.concat(n.errors),i=l.length),r.errors=l,0===i}module.exports=r,module.exports.default=r; |
@@ -15,4 +15,4 @@ { | ||
"dependencies": { | ||
"@zip.js/zip.js": "2.7.45", | ||
"dexie": "3.2.7" | ||
"@zip.js/zip.js": "2.7.47", | ||
"dexie": "4.0.8" | ||
}, | ||
@@ -22,4 +22,4 @@ "devDependencies": { | ||
"ts-loader": "^9.5.1", | ||
"typescript": "^5.5.3", | ||
"webpack": "^5.92.1", | ||
"typescript": "^5.5.4", | ||
"webpack": "^5.93.0", | ||
"webpack-cli": "^5.1.4", | ||
@@ -26,0 +26,0 @@ "workers-preview": "^1.0.6" |
@@ -84,3 +84,3 @@ import type { IncomingMessage, ServerResponse } from "node:http"; | ||
function parseContentType(value: unknown): string { | ||
const firstValue = Array.isArray(value) ? value[0] ?? "" : value; | ||
const firstValue = Array.isArray(value) ? (value[0] ?? "") : value; | ||
@@ -87,0 +87,0 @@ return typeof firstValue === "string" ? firstValue : ""; |
@@ -37,7 +37,9 @@ import { createRequire } from "node:module"; | ||
) { | ||
const target = REDIRECTS[source] + suffix + parsedUrl.search; | ||
return redirect(res, target, { | ||
status: 301, | ||
cacheControlSeconds: THIRTY_DAYS, | ||
}); | ||
const target = joinPath(REDIRECTS[source], suffix) + parsedUrl.search; | ||
if (pathname !== target) { | ||
return redirect(res, target, { | ||
status: 301, | ||
cacheControlSeconds: THIRTY_DAYS, | ||
}); | ||
} | ||
} | ||
@@ -48,1 +50,9 @@ } | ||
} | ||
function joinPath(a: string, b: string) { | ||
if (a.endsWith("/") && b.startsWith("/")) { | ||
return a + b.slice(1); | ||
} else { | ||
return a + b; | ||
} | ||
} |
@@ -84,3 +84,3 @@ import fs from "node:fs"; | ||
node.children[0].children[0].value = | ||
node.children[0].children[0].value.replace(/\[!\w+\]\n/, ""); | ||
node.children[0].children[0].value.replace(/\[!\w+\]\n?/, ""); | ||
// If the type isn't a callout, add the magic keyword | ||
@@ -101,2 +101,7 @@ if (!isCallout) { | ||
} | ||
// Remove blank line if there is one | ||
if (node.children[0].children.length === 1 && | ||
node.children[0].children[0].value === "") { | ||
node.children.splice(0, 1); | ||
} | ||
} | ||
@@ -103,0 +108,0 @@ else { |
@@ -123,3 +123,3 @@ import fs from "node:fs"; | ||
node.children[0].children[0].value = | ||
node.children[0].children[0].value.replace(/\[!\w+\]\n/, ""); | ||
node.children[0].children[0].value.replace(/\[!\w+\]\n?/, ""); | ||
@@ -141,2 +141,10 @@ // If the type isn't a callout, add the magic keyword | ||
} | ||
// Remove blank line if there is one | ||
if ( | ||
node.children[0].children.length === 1 && | ||
node.children[0].children[0].value === "" | ||
) { | ||
node.children.splice(0, 1); | ||
} | ||
} else { | ||
@@ -143,0 +151,0 @@ // Remove "Callout:" text |
{ | ||
"name": "@mdn/yari", | ||
"version": "2.60.0", | ||
"version": "2.60.1", | ||
"repository": "https://github.com/mdn/yari", | ||
@@ -48,3 +48,2 @@ "license": "MPL-2.0", | ||
"start:static-server": "cross-env NODE_OPTIONS='--no-warnings=ExperimentalWarning --loader ts-node/esm' node server/static.ts", | ||
"style-dictionary": "style-dictionary build -c sd-config.js", | ||
"stylelint": "stylelint \"**/*.scss\"", | ||
@@ -77,9 +76,9 @@ "test": "yarn prettier-check && yarn test:client && yarn test:kumascript && yarn test:libs && yarn test:content && yarn test:testing", | ||
"@mdn/bcd-utils-api": "^0.0.7", | ||
"@mdn/browser-compat-data": "^5.5.37", | ||
"@mdn/browser-compat-data": "^5.5.40", | ||
"@mozilla/glean": "5.0.2", | ||
"@sentry/node": "^8.15.0", | ||
"@sentry/node": "^8.19.0", | ||
"@stripe/stripe-js": "^4.1.0", | ||
"@use-it/interval": "^1.0.0", | ||
"@vscode/ripgrep": "^1.15.9", | ||
"@webref/css": "^6.13.0", | ||
"@webref/css": "^6.13.1", | ||
"accept-language-parser": "^1.5.0", | ||
@@ -95,10 +94,10 @@ "async": "^3.2.5", | ||
"css-tree": "^2.3.1", | ||
"dayjs": "^1.11.11", | ||
"dexie": "^3.2.7", | ||
"dayjs": "^1.11.12", | ||
"dexie": "^4.0.8", | ||
"dotenv": "^16.4.5", | ||
"ejs": "^3.1.10", | ||
"express": "^4.19.2", | ||
"fdir": "^6.1.1", | ||
"fdir": "^6.2.0", | ||
"feed": "^4.2.2", | ||
"file-type": "^19.1.0", | ||
"file-type": "^19.3.0", | ||
"front-matter": "^4.0.2", | ||
@@ -119,3 +118,3 @@ "fs-extra": "^11.2.0", | ||
"loglevel": "^1.9.1", | ||
"lru-cache": "^10.4.0", | ||
"lru-cache": "^10.4.3", | ||
"md5-file": "^5.0.0", | ||
@@ -126,4 +125,4 @@ "mdast-util-from-markdown": "^2.0.1", | ||
"open": "^10.1.0", | ||
"open-editor": "^4.1.1", | ||
"openai": "^4.52.4", | ||
"open-editor": "^5.0.0", | ||
"openai": "^4.53.0", | ||
"pg": "^8.12.0", | ||
@@ -155,15 +154,15 @@ "pgvector": "^0.2.0", | ||
"web-features": "^0.9.0", | ||
"web-specs": "^3.13.0" | ||
"web-specs": "^3.13.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.24.7", | ||
"@babel/eslint-parser": "^7.24.7", | ||
"@babel/core": "^7.24.9", | ||
"@babel/eslint-parser": "^7.24.8", | ||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11", | ||
"@babel/preset-env": "^7.24.7", | ||
"@babel/preset-env": "^7.24.8", | ||
"@mdn/dinocons": "^0.5.5", | ||
"@mdn/minimalist": "^2.0.4", | ||
"@playwright/test": "^1.45.1", | ||
"@playwright/test": "^1.45.3", | ||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15", | ||
"@svgr/webpack": "^8.1.0", | ||
"@swc/core": "^1.6.13", | ||
"@swc/core": "^1.7.0", | ||
"@testing-library/react": "^15.0.7", | ||
@@ -185,3 +184,3 @@ "@types/async": "^3.2.24", | ||
"braces": "^3.0.3", | ||
"browserslist": "^4.23.1", | ||
"browserslist": "^4.23.2", | ||
"camelcase": "^8.0.0", | ||
@@ -202,3 +201,3 @@ "case-sensitive-paths-webpack-plugin": "^2.4.0", | ||
"eslint-plugin-n": "^17.9.0", | ||
"eslint-plugin-react": "^7.34.3", | ||
"eslint-plugin-react": "^7.35.0", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
@@ -212,5 +211,5 @@ "eslint-plugin-unicorn": "^54.0.0", | ||
"history": "^5.2.0", | ||
"html-validate": "^8.20.1", | ||
"html-validate": "^8.21.0", | ||
"html-webpack-plugin": "^5.6.0", | ||
"husky": "^9.0.11", | ||
"husky": "^9.1.1", | ||
"identity-obj-proxy": "^3.0.0", | ||
@@ -223,3 +222,3 @@ "ignore-loader": "^0.1.2", | ||
"jest-watch-typeahead": "^2.2.2", | ||
"jsdom": "^24.1.0", | ||
"jsdom": "^24.1.1", | ||
"lint-staged": "^13.2.3", | ||
@@ -235,4 +234,4 @@ "mdast-util-to-hast": "^13.2.0", | ||
"postcss-preset-env": "^9.6.0", | ||
"prettier": "^3.3.2", | ||
"prettier-plugin-packagejson": "^2.5.0", | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-packagejson": "^2.5.1", | ||
"prompts": "^2.4.2", | ||
@@ -245,3 +244,3 @@ "react": "^18.3.1", | ||
"react-router": "^6.17.0", | ||
"react-router-dom": "^6.24.1", | ||
"react-router-dom": "^6.25.1", | ||
"remark-prettier": "^2.0.0", | ||
@@ -255,3 +254,2 @@ "resolve": "^1.22.8", | ||
"source-map-loader": "^5.0.0", | ||
"style-dictionary": "^3.9.2", | ||
"style-loader": "^3.3.4", | ||
@@ -271,5 +269,5 @@ "stylelint": "^15.11.0", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.5.3", | ||
"typescript-eslint": "^7.16.0", | ||
"webpack": "^5.92.1", | ||
"typescript": "^5.5.4", | ||
"typescript-eslint": "^7.17.0", | ||
"webpack": "^5.93.0", | ||
"webpack-cli": "^5.1.4", | ||
@@ -276,0 +274,0 @@ "webpack-dev-server": "^5.0.4", |
@@ -6,10 +6,18 @@ import express from "express"; | ||
import { getLocale } from "../libs/locale-utils/index.js"; | ||
// Lowercase every request because every possible file we might have | ||
// on disk is always in lowercase. | ||
// This only helps when you're on a filesystem (e.g. Linux) that is case | ||
// sensitive. | ||
const slugRewrite = (req, res, next) => { | ||
const slugLowercase = (req, res, next) => { | ||
req.url = req.url.toLowerCase(); | ||
next(); | ||
}; | ||
const staticServer = express.static(STATIC_ROOT, { | ||
setHeaders: (res) => { | ||
if (res.req.path.endsWith("/runner.html")) { | ||
res.setHeader("Content-Security-Policy", PLAYGROUND_UNSAFE_CSP_VALUE); | ||
} | ||
else { | ||
res.setHeader("Content-Security-Policy", CSP_VALUE); | ||
} | ||
}, | ||
}); | ||
// This is necessary for case-sensitive filesystems, such as on Linux 🐧 | ||
export const staticMiddlewares = [staticServer, slugLowercase, staticServer]; | ||
/** | ||
@@ -19,3 +27,3 @@ * This function is returns an object with {url:string, status:number} | ||
*/ | ||
const originRequest = (req, res, next) => { | ||
export const originRequestMiddleware = (req, res, next) => { | ||
const { url: fundamentalRedirectUrl, status } = resolveFundamental(req.url); | ||
@@ -51,16 +59,2 @@ if (fundamentalRedirectUrl && status) { | ||
}; | ||
export const staticMiddlewares = [ | ||
slugRewrite, | ||
express.static(STATIC_ROOT, { | ||
setHeaders: (res) => { | ||
if (res.req.path.endsWith("/runner.html")) { | ||
res.setHeader("Content-Security-Policy", PLAYGROUND_UNSAFE_CSP_VALUE); | ||
} | ||
else { | ||
res.setHeader("Content-Security-Policy", CSP_VALUE); | ||
} | ||
}, | ||
}), | ||
]; | ||
export const originRequestMiddleware = originRequest; | ||
//# sourceMappingURL=middlewares.js.map |
@@ -11,7 +11,3 @@ import express from "express"; | ||
// Lowercase every request because every possible file we might have | ||
// on disk is always in lowercase. | ||
// This only helps when you're on a filesystem (e.g. Linux) that is case | ||
// sensitive. | ||
const slugRewrite = (req, res, next) => { | ||
const slugLowercase = (req, res, next) => { | ||
req.url = req.url.toLowerCase(); | ||
@@ -21,2 +17,15 @@ next(); | ||
const staticServer = express.static(STATIC_ROOT, { | ||
setHeaders: (res) => { | ||
if (res.req.path.endsWith("/runner.html")) { | ||
res.setHeader("Content-Security-Policy", PLAYGROUND_UNSAFE_CSP_VALUE); | ||
} else { | ||
res.setHeader("Content-Security-Policy", CSP_VALUE); | ||
} | ||
}, | ||
}); | ||
// This is necessary for case-sensitive filesystems, such as on Linux 🐧 | ||
export const staticMiddlewares = [staticServer, slugLowercase, staticServer]; | ||
/** | ||
@@ -26,3 +35,3 @@ * This function is returns an object with {url:string, status:number} | ||
*/ | ||
const originRequest = (req, res, next) => { | ||
export const originRequestMiddleware = (req, res, next) => { | ||
const { url: fundamentalRedirectUrl, status } = resolveFundamental(req.url); | ||
@@ -56,15 +65,1 @@ if (fundamentalRedirectUrl && status) { | ||
}; | ||
export const staticMiddlewares = [ | ||
slugRewrite, | ||
express.static(STATIC_ROOT, { | ||
setHeaders: (res) => { | ||
if (res.req.path.endsWith("/runner.html")) { | ||
res.setHeader("Content-Security-Policy", PLAYGROUND_UNSAFE_CSP_VALUE); | ||
} else { | ||
res.setHeader("Content-Security-Policy", CSP_VALUE); | ||
} | ||
}, | ||
}), | ||
]; | ||
export const originRequestMiddleware = originRequest; |
@@ -90,3 +90,3 @@ /*! | ||
/** | ||
* @remix-run/router v1.17.1 | ||
* @remix-run/router v1.18.0 | ||
* | ||
@@ -111,3 +111,3 @@ * Copyright (c) Remix Software Inc. | ||
/** | ||
* React Router DOM v6.24.1 | ||
* React Router DOM v6.25.1 | ||
* | ||
@@ -123,3 +123,3 @@ * Copyright (c) Remix Software Inc. | ||
/** | ||
* React Router v6.24.1 | ||
* React Router v6.25.1 | ||
* | ||
@@ -126,0 +126,0 @@ * Copyright (c) Remix Software Inc. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
96200858
111
4549
681358
375
+ Added@sindresorhus/merge-streams@4.0.0(transitive)
+ Addeddexie@4.0.9(transitive)
+ Addedexeca@9.5.1(transitive)
+ Addedfigures@6.1.0(transitive)
+ Addedhuman-signals@8.0.0(transitive)
+ Addedis-unicode-supported@2.1.0(transitive)
+ Addednpm-run-path@6.0.0(transitive)
+ Addedopen-editor@5.0.0(transitive)
+ Addedparse-ms@4.0.0(transitive)
+ Addedpretty-ms@9.1.0(transitive)
+ Addedstrip-final-newline@4.0.0(transitive)
+ Addedunicorn-magic@0.3.0(transitive)
+ Addedyoctocolors@2.1.1(transitive)
- Removeddefine-lazy-prop@2.0.0(transitive)
- Removeddexie@3.2.7(transitive)
- Removedis-docker@2.2.1(transitive)
- Removedis-wsl@2.2.0(transitive)
- Removedopen@8.4.2(transitive)
- Removedopen-editor@4.1.1(transitive)
Updated@sentry/node@^8.19.0
Updated@webref/css@^6.13.1
Updateddayjs@^1.11.12
Updateddexie@^4.0.8
Updatedfdir@^6.2.0
Updatedfile-type@^19.3.0
Updatedlru-cache@^10.4.3
Updatedopen-editor@^5.0.0
Updatedopenai@^4.53.0
Updatedweb-specs@^3.13.1