From 810e6fbc74192ce6943bcf9ee639faace4a8a9de Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 5 Jul 2021 14:21:59 +0900 Subject: [PATCH 01/87] =?UTF-8?q?spotlig=20=E3=83=91=E3=83=A9=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=83=BC=E3=81=AE=E5=9E=8B=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 980e3207..abc68fac 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -45,7 +45,7 @@ export type SignalingConnectMessage = { metadata?: JSONType; signaling_notify_metadata?: JSONType; multistream?: boolean; - spotlight?: number | boolean; + spotlight?: boolean; spotlight_number?: number; simulcast?: Simulcast; simulcast_rid?: SimulcastRid; @@ -247,7 +247,7 @@ export type ConnectionOptions = { videoCodecType?: VideoCodecType; videoBitRate?: number; multistream?: boolean; - spotlight?: boolean | number; + spotlight?: boolean; spotlightNumber?: number; spotlightFocusRid?: SpotlightFocusRid; spotlightUnfocusRid?: SpotlightFocusRid; From baed584f50081c7bc89a527739d2ecd3d50f5907 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 5 Jul 2021 14:22:19 +0900 Subject: [PATCH 02/87] =?UTF-8?q?=E6=88=90=E6=9E=9C=E7=89=A9=E3=82=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/types.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/types.d.ts b/dist/types.d.ts index fdeaefe3..4b7f6d68 100644 --- a/dist/types.d.ts +++ b/dist/types.d.ts @@ -36,7 +36,7 @@ export declare type SignalingConnectMessage = { metadata?: JSONType; signaling_notify_metadata?: JSONType; multistream?: boolean; - spotlight?: number | boolean; + spotlight?: boolean; spotlight_number?: number; simulcast?: Simulcast; simulcast_rid?: SimulcastRid; @@ -205,7 +205,7 @@ export declare type ConnectionOptions = { videoCodecType?: VideoCodecType; videoBitRate?: number; multistream?: boolean; - spotlight?: boolean | number; + spotlight?: boolean; spotlightNumber?: number; spotlightFocusRid?: SpotlightFocusRid; spotlightUnfocusRid?: SpotlightFocusRid; From 46eb6c264440d1c1d62d7dc9309e786a9d844d2f Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 5 Jul 2021 14:22:37 +0900 Subject: [PATCH 03/87] =?UTF-8?q?spotlight=20example=20=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/spotlight_recvonly.html | 5 ++--- example/spotlight_sendrecv.html | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/example/spotlight_recvonly.html b/example/spotlight_recvonly.html index 080fb944..7df88e26 100644 --- a/example/spotlight_recvonly.html +++ b/example/spotlight_recvonly.html @@ -20,7 +20,8 @@

Spotlight Recvonly test

const sora = Sora.connection('ws://127.0.0.1:5000/signaling', debug); const options = { multistream: true, - spotlight: 2 + simulcast: true, + spotlight: true, } const recvonly = sora.recvonly(channelId, null, options); @@ -42,8 +43,6 @@

Spotlight Recvonly test

remoteVideo.autoplay = true; remoteVideo.playsinline = true; remoteVideo.controls = true; - remoteVideo.width = '320'; - remoteVideo.height = '240'; remoteVideo.srcObject = stream; remoteVideos.appendChild(remoteVideo); } diff --git a/example/spotlight_sendrecv.html b/example/spotlight_sendrecv.html index 37d16a77..a5cd820d 100644 --- a/example/spotlight_sendrecv.html +++ b/example/spotlight_sendrecv.html @@ -31,7 +31,9 @@

sendrecv2

const sora = Sora.connection('ws://127.0.0.1:5000/signaling', debug); const options = { multistream: true, - spotlight: 2 + simulcast: true, + spotlight: true, + spotlightNumber: 1, } const sendrecv1 = sora.sendrecv(channelId, null, options); const sendrecv2 = sora.sendrecv(channelId, null, options); @@ -60,8 +62,6 @@

sendrecv2

remoteVideo.autoplay = true; remoteVideo.playsinline = true; remoteVideo.controls = true; - remoteVideo.width = '160'; - remoteVideo.height = '120'; remoteVideo.srcObject = stream; remoteVideos.appendChild(remoteVideo); } From 1908fc42a8af2033885ec101b701a241e54fd178 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 5 Jul 2021 14:52:00 +0900 Subject: [PATCH 04/87] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/tests/utils.test.ts | 55 -------------------------------- 1 file changed, 55 deletions(-) diff --git a/packages/sdk/tests/utils.test.ts b/packages/sdk/tests/utils.test.ts index 49e2436f..4c934ce5 100644 --- a/packages/sdk/tests/utils.test.ts +++ b/packages/sdk/tests/utils.test.ts @@ -94,61 +94,6 @@ test("createSignalingMessage multistream option", () => { expect(createSignalingMessage(sdp, role, channelId, null, options1)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); - // multistream spotlight - const options2 = { - multistream: true, - spotlight: 1, - }; - const diff2 = { - multistream: true, - spotlight: 1, - }; - expect(createSignalingMessage(sdp, role, channelId, null, options2)).toEqual( - Object.assign({}, baseExpectedMessage, diff2) - ); - // multistream new spotlight - const options3 = { - multistream: true, - spotlight: true, - spotlightNumber: 2, - }; - const diff3 = { - multistream: true, - spotlight: true, - spotlight_number: 2, - }; - expect(createSignalingMessage(sdp, role, channelId, null, options3)).toEqual( - Object.assign({}, baseExpectedMessage, diff3) - ); - // multistream spotlight focus rid - const spotlightFocusRid: SpotlightFocusRid = "r0"; - const options4 = { - multistream: true, - spotlight: true, - spotlightFocusRid: spotlightFocusRid, - }; - const diff4 = { - multistream: true, - spotlight: true, - spotlight_focus_rid: spotlightFocusRid, - }; - expect(createSignalingMessage(sdp, role, channelId, null, options4)).toEqual( - Object.assign({}, baseExpectedMessage, diff4) - ); - // multistream spotlight unfocus rid - const options5 = { - multistream: true, - spotlight: true, - spotlightUnfocusRid: spotlightFocusRid, - }; - const diff5 = { - multistream: true, - spotlight: true, - spotlight_unfocus_rid: spotlightFocusRid, - }; - expect(createSignalingMessage(sdp, role, channelId, null, options5)).toEqual( - Object.assign({}, baseExpectedMessage, diff5) - ); }); test("createSignalingMessage audio option", () => { From b0d317cbcf1f5508e5e04f6939543f3bd7575692 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 5 Jul 2021 15:57:42 +0900 Subject: [PATCH 05/87] =?UTF-8?q?CHANGES=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index af27efde..72304645 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,9 +9,16 @@ - FIX - バグ修正 +## develop + +- [CHANGE] spotlight_legacy 対応を削除する + - ConnectionOptions の spotlight オプションの型を boolean のみに変更する + - @yuitowest + ## 2021.1.1 - [FIX] 接続処理が途中で失敗した場合の timeline ログに connected のログが出力されていた問題を修正する + - @yuitowest ## 2021.1.0 From 2a43653e165d04f1e7d0e5027e44ee89dbefd3d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Aug 2021 20:25:36 +0000 Subject: [PATCH 06/87] Bump tar from 4.4.13 to 4.4.15 Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-tar/compare/v4.4.13...v4.4.15) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index b8f39396..65e0ad44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2194,7 +2194,7 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.1" -get-pkg-repo@4.2.0, get-pkg-repo@^1.0.0: +get-pkg-repo@4.1.2, get-pkg-repo@^1.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-4.1.2.tgz#c4ffd60015cf091be666a0212753fc158f01a4c0" integrity sha512-/FjamZL9cBYllEbReZkxF2IMh80d8TJoC4e3bmLNif8ibHw95aj0N/tzqK0kZz9eU/3w3dL6lF4fnnX/sDdW3A== @@ -4888,9 +4888,9 @@ supports-color@^7.1.0: has-flag "^4.0.0" tar@^4.4.12: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== + version "4.4.15" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.15.tgz#3caced4f39ebd46ddda4d6203d48493a919697f8" + integrity sha512-ItbufpujXkry7bHH9NpQyTXPbJ72iTlXgkBAYsAjDXk3Ds8t/3NfO5P4xZGy7u+sYuQUbimgzswX4uQIEeNVOA== dependencies: chownr "^1.1.1" fs-minipass "^1.2.5" From e87b4a8b4685760231bd4e9a9e5053581adbc2fd Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 4 Aug 2021 10:18:05 +0900 Subject: [PATCH 07/87] =?UTF-8?q?=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +- yarn.lock | 536 +++++++++++++++++++++++++-------------------------- 2 files changed, 260 insertions(+), 280 deletions(-) diff --git a/package.json b/package.json index 429a389c..f5e6fdc4 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ ], "devDependencies": { "lerna": "^4.0.0", - "npm-check-updates": "^11.6.0", - "serve": "^11.3.2" + "npm-check-updates": "^11.8.3", + "serve": "^12.0.0" }, "resolutions": { "get-pkg-repo": "4.1.2" diff --git a/yarn.lock b/yarn.lock index 65e0ad44..4f0b2e3b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,23 +3,23 @@ "@babel/code-frame@^7.0.0": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" - integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" + integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== dependencies: - "@babel/highlight" "^7.12.13" + "@babel/highlight" "^7.14.5" -"@babel/helper-validator-identifier@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" - integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== +"@babel/helper-validator-identifier@^7.14.5": + version "7.14.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" + integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== -"@babel/highlight@^7.12.13": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" - integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== +"@babel/highlight@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== dependencies: - "@babel/helper-validator-identifier" "^7.14.0" + "@babel/helper-validator-identifier" "^7.14.5" chalk "^2.0.0" js-tokens "^4.0.0" @@ -713,9 +713,9 @@ integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== "@nodelib/fs.walk@^1.2.3": - version "1.2.7" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz#94c23db18ee4653e129abd26fb06f870ac9e1ee2" - integrity sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA== + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" @@ -725,10 +725,10 @@ resolved "https://registry.yarnpkg.com/@npmcli/ci-detect/-/ci-detect-1.3.0.tgz#6c1d2c625fb6ef1b9dea85ad0a5afcbef85ef22a" integrity sha512-oN3y7FAROHhrAt7Rr7PnTSwrHrZVRTS2ZbyxeQwSSYD0ifwM3YNgQqbaRmjcWoPyq77MjchusjJDspbzMmip1Q== -"@npmcli/git@^2.0.1": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-2.0.9.tgz#915bbfe66300e67b4da5ef765a4475ffb2ca5b6b" - integrity sha512-hTMbMryvOqGLwnmMBKs5usbPsJtyEsMsgXwJbmNrsEuQQh1LAIMDU77IoOrwkCg+NgQWl+ySlarJASwM3SutCA== +"@npmcli/git@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-2.1.0.tgz#2fbd77e147530247d37f325930d457b3ebe894f6" + integrity sha512-/hBFX/QG1b+N7PZBFs0bi+evgRZcK9nWBxQKZkGoXUT5hJSwl5c4d7y8/hm+NQZRPhQ67RzFaj5UM9YeyKoryw== dependencies: "@npmcli/promise-spawn" "^1.3.2" lru-cache "^6.0.0" @@ -785,41 +785,41 @@ dependencies: "@octokit/types" "^6.0.3" -"@octokit/core@^3.2.3": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.4.0.tgz#b48aa27d755b339fe7550548b340dcc2b513b742" - integrity sha512-6/vlKPP8NF17cgYXqucdshWqmMZGXkuvtcrWCgU5NOI0Pl2GjlmZyWgBMrU8zJ3v2MJlM6++CiB45VKYmhiWWg== +"@octokit/core@^3.5.0": + version "3.5.1" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" + integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== dependencies: "@octokit/auth-token" "^2.4.4" "@octokit/graphql" "^4.5.8" - "@octokit/request" "^5.4.12" + "@octokit/request" "^5.6.0" "@octokit/request-error" "^2.0.5" "@octokit/types" "^6.0.3" before-after-hook "^2.2.0" universal-user-agent "^6.0.0" "@octokit/endpoint@^6.0.1": - version "6.0.11" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.11.tgz#082adc2aebca6dcefa1fb383f5efb3ed081949d1" - integrity sha512-fUIPpx+pZyoLW4GCs3yMnlj2LfoXTWDUVPTC4V3MUEKZm48W+XYpeWSZCv+vYF1ZABUm2CqnDVf1sFtIYrj7KQ== + version "6.0.12" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" + integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== dependencies: "@octokit/types" "^6.0.3" is-plain-object "^5.0.0" universal-user-agent "^6.0.0" "@octokit/graphql@^4.5.8": - version "4.6.2" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.6.2.tgz#ec44abdfa87f2b9233282136ae33e4ba446a04e7" - integrity sha512-WmsIR1OzOr/3IqfG9JIczI8gMJUMzzyx5j0XXQ4YihHtKlQc+u35VpVoOXhlKAlaBntvry1WpAzPl/a+s3n89Q== + version "4.6.4" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.6.4.tgz#0c3f5bed440822182e972317122acb65d311a5ed" + integrity sha512-SWTdXsVheRmlotWNjKzPOb6Js6tjSqA2a8z9+glDJng0Aqjzti8MEWOtuT8ZSu6wHnci7LZNuarE87+WJBG4vg== dependencies: - "@octokit/request" "^5.3.0" + "@octokit/request" "^5.6.0" "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^7.2.3": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-7.3.0.tgz#1d9ed79828513c57a95e6360b7c9b4749503e79d" - integrity sha512-o00X2FCLiEeXZkm1Ab5nvPUdVOlrpediwWZkpizUJ/xtZQsJ4FiQ2RB/dJEmb0Nk+NIz7zyDePcSCu/Y/0M3Ew== +"@octokit/openapi-types@^9.4.0": + version "9.4.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-9.4.0.tgz#31a76fb4c0f2e15af300edd880cedf4f75be212b" + integrity sha512-rKRkXikOJgDNImPl49IJuECLVXjj+t4qOXHhl8SBjMQCGGp1w4m5Ud/0kfdUx+zCpTvBN8vaOUDF4nnboZoOtQ== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -827,62 +827,62 @@ integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== "@octokit/plugin-paginate-rest@^2.6.2": - version "2.13.3" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.3.tgz#f0f1792230805108762d87906fb02d573b9e070a" - integrity sha512-46lptzM9lTeSmIBt/sVP/FLSTPGx6DCzAdSX3PfeJ3mTf4h9sGC26WpaQzMEq/Z44cOcmx8VsOhO+uEgE3cjYg== + version "2.15.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.15.0.tgz#9c956c3710b2bd786eb3814eaf5a2b17392c150d" + integrity sha512-/vjcb0w6ggVRtsb8OJBcRR9oEm+fpdo8RJk45khaWw/W0c8rlB2TLCLyZt/knmC17NkX7T9XdyQeEY7OHLSV1g== dependencies: - "@octokit/types" "^6.11.0" + "@octokit/types" "^6.23.0" "@octokit/plugin-request-log@^1.0.2": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.3.tgz#70a62be213e1edc04bb8897ee48c311482f9700d" - integrity sha512-4RFU4li238jMJAzLgAwkBAw+4Loile5haQMQr+uhFq27BmyJXcXSKvoQKqh0agsZEiUlW6iSv3FAgvmGkur7OQ== + version "1.0.4" + resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" + integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== -"@octokit/plugin-rest-endpoint-methods@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.1.tgz#deddce769b4ec3179170709ab42e4e9e6195aaa9" - integrity sha512-3B2iguGmkh6bQQaVOtCsS0gixrz8Lg0v4JuXPqBcFqLKuJtxAUf3K88RxMEf/naDOI73spD+goJ/o7Ie7Cvdjg== +"@octokit/plugin-rest-endpoint-methods@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.7.0.tgz#80b69452c17597738d4692c79829b72d9e72ccec" + integrity sha512-G7sgccWRYQMwcHJXkDY/sDxbXeKiZkFQqUtzBCwmrzCNj2GQf3VygQ4T/BFL2crLVpIbenkE/c0ErhYOte2MPw== dependencies: - "@octokit/types" "^6.16.2" + "@octokit/types" "^6.24.0" deprecation "^2.3.1" -"@octokit/request-error@^2.0.0", "@octokit/request-error@^2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.0.5.tgz#72cc91edc870281ad583a42619256b380c600143" - integrity sha512-T/2wcCFyM7SkXzNoyVNWjyVlUwBvW3igM3Btr/eKYiPmucXTtkxt2RBsf6gn3LTzaLSLTQtNmvg+dGsOxQrjZg== +"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" + integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== dependencies: "@octokit/types" "^6.0.3" deprecation "^2.0.0" once "^1.4.0" -"@octokit/request@^5.3.0", "@octokit/request@^5.4.12": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.5.0.tgz#6588c532255b8e71886cefa0d2b64b4ad73bf18c" - integrity sha512-jxbMLQdQ3heFMZUaTLSCqcKs2oAHEYh7SnLLXyxbZmlULExZ/RXai7QUWWFKowcGGPlCZuKTZg0gSKHWrfYEoQ== +"@octokit/request@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.0.tgz#6084861b6e4fa21dc40c8e2a739ec5eff597e672" + integrity sha512-4cPp/N+NqmaGQwbh3vUsYqokQIzt7VjsgTYVXiwpUP2pxd5YiZB2XuTedbb0SPtv9XS7nzAKjAuQxmY8/aZkiA== dependencies: "@octokit/endpoint" "^6.0.1" - "@octokit/request-error" "^2.0.0" + "@octokit/request-error" "^2.1.0" "@octokit/types" "^6.16.1" is-plain-object "^5.0.0" node-fetch "^2.6.1" universal-user-agent "^6.0.0" "@octokit/rest@^18.1.0": - version "18.5.6" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.5.6.tgz#8c9a7c9329c7bbf478af20df78ddeab0d21f6d89" - integrity sha512-8HdG6ZjQdZytU6tCt8BQ2XLC7EJ5m4RrbyU/EARSkAM1/HP3ceOzMG/9atEfe17EDMer3IVdHWLedz2wDi73YQ== + version "18.9.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.9.0.tgz#e5cc23fa199a2bdeea9efbe6096f81d7d6156fe9" + integrity sha512-VrmrE8gjpuOoDAGjrQq2j9ZhOE6LxaqxaQg0yMrrEnnQZy2ZcAnr5qbVfKsMF0up/48PRV/VFS/2GSMhA7nTdA== dependencies: - "@octokit/core" "^3.2.3" + "@octokit/core" "^3.5.0" "@octokit/plugin-paginate-rest" "^2.6.2" "@octokit/plugin-request-log" "^1.0.2" - "@octokit/plugin-rest-endpoint-methods" "5.3.1" + "@octokit/plugin-rest-endpoint-methods" "5.7.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.16.1", "@octokit/types@^6.16.2": - version "6.16.2" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.16.2.tgz#62242e0565a3eb99ca2fd376283fe78b4ea057b4" - integrity sha512-wWPSynU4oLy3i4KGyk+J1BLwRKyoeW2TwRHgwbDz17WtVFzSK2GOErGliruIx8c+MaYtHSYTx36DSmLNoNbtgA== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.23.0", "@octokit/types@^6.24.0": + version "6.24.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.24.0.tgz#d7858ceae8ac29256da85dcfcb9acbae28e6ba22" + integrity sha512-MfEimJeQ8AV1T2nI5kOfHqsqPHaAnG0Dw3MVoHSEsEq6iLKx2N91o+k2uAgXhPYeSE76LVBqjgTShnFFgNwe0A== dependencies: - "@octokit/openapi-types" "^7.2.3" + "@octokit/openapi-types" "^9.4.0" "@sindresorhus/is@^0.14.0": version "0.14.0" @@ -902,19 +902,19 @@ integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@types/minimatch@^3.0.3": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" - integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" + integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/minimist@^1.2.0": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256" - integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg== + version "1.2.2" + resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" + integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== "@types/normalize-package-data@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" - integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + version "2.4.1" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" + integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== "@types/parse-json@^4.0.0": version "4.0.0" @@ -952,7 +952,7 @@ add-stream@^1.0.0: resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= -agent-base@6: +agent-base@6, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== @@ -976,17 +976,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@6.5.3: - version "6.5.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.3.tgz#71a569d189ecf4f4f321224fecb166f071dd90f9" - integrity sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^6.12.3: +ajv@6.12.6, ajv@^6.12.3: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1061,7 +1051,7 @@ aproba@^2.0.0: resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== -arch@^2.1.0: +arch@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== @@ -1206,9 +1196,9 @@ braces@^3.0.1: fill-range "^7.0.1" buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== builtins@^1.0.3: version "1.0.3" @@ -1327,9 +1317,9 @@ chalk@^2.0.0, chalk@^2.0.1: supports-color "^5.3.0" chalk@^4.1.0, chalk@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" - integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -1393,13 +1383,14 @@ cli-width@^3.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== -clipboardy@1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-1.2.3.tgz#0526361bf78724c1f20be248d428e365433c07ef" - integrity sha512-2WNImOvCRe6r63Gk9pShfkwXsVtKCroMAevIbiae021mS850UkWPbevxsBz3tnvjZIEGvlwaqCPsw+4ulzNgJA== +clipboardy@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-2.3.0.tgz#3c2903650c68e46a91b388985bc2774287dba290" + integrity sha512-mKhiIL2DrQIsuXMgBgnfEHOZOryC7kY7YO//TN6c63wlEm3NG5tz+YgY5rVi29KCmq/QQjKYvM7a19+MDOTHOQ== dependencies: - arch "^2.1.0" - execa "^0.8.0" + arch "^2.1.1" + execa "^1.0.0" + is-wsl "^2.1.1" cliui@^7.0.2: version "7.0.4" @@ -1574,15 +1565,15 @@ conventional-changelog-angular@^5.0.12: q "^1.5.1" conventional-changelog-core@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.2.tgz#f0897df6d53b5d63dec36b9442bd45354f8b3ce5" - integrity sha512-7pDpRUiobQDNkwHyJG7k9f6maPo9tfPzkSWbRq97GGiZqisElhnvUZSvyQH20ogfOjntB5aadvv6NNcKL1sReg== + version "4.2.3" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.3.tgz#ce44d4bbba4032e3dc14c00fcd5b53fc00b66433" + integrity sha512-MwnZjIoMRL3jtPH5GywVNqetGILC7g6RQFvdb8LRU/fA/338JbeWAku3PZ8yQ+mtVRViiISqJlb0sOz0htBZig== dependencies: add-stream "^1.0.0" - conventional-changelog-writer "^4.0.18" + conventional-changelog-writer "^5.0.0" conventional-commits-parser "^3.2.0" dateformat "^3.0.0" - get-pkg-repo "^1.0.0" + get-pkg-repo "^4.0.0" git-raw-commits "^2.0.8" git-remote-origin-url "^2.0.0" git-semver-tags "^4.1.1" @@ -1591,7 +1582,6 @@ conventional-changelog-core@^4.2.2: q "^1.5.1" read-pkg "^3.0.0" read-pkg-up "^3.0.0" - shelljs "^0.8.3" through2 "^4.0.0" conventional-changelog-preset-loader@^2.3.4: @@ -1599,12 +1589,11 @@ conventional-changelog-preset-loader@^2.3.4: resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz#14a855abbffd59027fd602581f1f34d9862ea44c" integrity sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g== -conventional-changelog-writer@^4.0.18: - version "4.1.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.1.0.tgz#1ca7880b75aa28695ad33312a1f2366f4b12659f" - integrity sha512-WwKcUp7WyXYGQmkLsX4QmU42AZ1lqlvRW9mqoyiQzdD+rJWbTepdWoKJuwXTS+yq79XKnQNa93/roViPQrAQgw== +conventional-changelog-writer@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.0.tgz#c4042f3f1542f2f41d7d2e0d6cad23aba8df8eec" + integrity sha512-HnDh9QHLNWfL6E1uHz6krZEQOgm8hN7z/m7tT16xwd802fwgMN0Wqd7AQYVkhpsjDUx/99oo+nGgvKF657XP5g== dependencies: - compare-func "^2.0.0" conventional-commits-filter "^2.0.7" dateformat "^3.0.0" handlebars "^4.7.6" @@ -1675,6 +1664,17 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1714,9 +1714,9 @@ debug@2.6.9: ms "2.0.0" debug@4, debug@^4.1.0, debug@^4.1.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== dependencies: ms "2.1.2" @@ -1903,9 +1903,9 @@ error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.18.0-next.2: - version "1.18.3" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.3.tgz#25c4c3380a27aa203c44b2b685bba94da31b63e0" - integrity sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw== + version "1.18.5" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.5.tgz#9b10de7d4c206a3581fd5b2124233e04db49ae19" + integrity sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" @@ -1913,11 +1913,12 @@ es-abstract@^1.18.0-next.2: get-intrinsic "^1.1.1" has "^1.0.3" has-symbols "^1.0.2" + internal-slot "^1.0.3" is-callable "^1.2.3" is-negative-zero "^2.0.1" is-regex "^1.1.3" is-string "^1.0.6" - object-inspect "^1.10.3" + object-inspect "^1.11.0" object-keys "^1.1.1" object.assign "^4.1.2" string.prototype.trimend "^1.0.4" @@ -1966,13 +1967,13 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" - integrity sha1-2NdrvBtVIX7RkP1t1J08d07PyNo= +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" + cross-spawn "^6.0.0" + get-stream "^4.0.0" is-stream "^1.1.0" npm-run-path "^2.0.0" p-finally "^1.0.0" @@ -2018,33 +2019,32 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-glob@^3.1.1: - version "3.2.5" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" - integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== + version "3.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" + integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.0" + glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.2" - picomatch "^2.2.1" + micromatch "^4.0.4" fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-memoize@^2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/fast-memoize/-/fast-memoize-2.5.2.tgz#79e3bb6a4ec867ea40ba0e7146816f6cdce9b57e" + integrity sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw== + fast-url-parser@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d" @@ -2053,9 +2053,9 @@ fast-url-parser@1.1.3: punycode "^1.3.2" fastq@^1.6.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" - integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== + version "1.11.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.1.tgz#5d8175aae17db61947f8b162cfc7f63264d22807" + integrity sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw== dependencies: reusify "^1.0.4" @@ -2185,7 +2185,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== @@ -2194,7 +2194,7 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.1" -get-pkg-repo@4.1.2, get-pkg-repo@^1.0.0: +get-pkg-repo@4.1.2, get-pkg-repo@^4.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-4.1.2.tgz#c4ffd60015cf091be666a0212753fc158f01a4c0" integrity sha512-/FjamZL9cBYllEbReZkxF2IMh80d8TJoC4e3bmLNif8ibHw95aj0N/tzqK0kZz9eU/3w3dL6lF4fnnX/sDdW3A== @@ -2219,7 +2219,7 @@ get-stream@^3.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= -get-stream@^4.1.0: +get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== @@ -2271,17 +2271,17 @@ git-semver-tags@^4.1.1: semver "^6.0.0" git-up@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/git-up/-/git-up-4.0.2.tgz#10c3d731051b366dc19d3df454bfca3f77913a7c" - integrity sha512-kbuvus1dWQB2sSW4cbfTeGpCMd8ge9jx9RKnhXhuJ7tnvT+NIrTVfYZxjtflZddQYcmdOTlkAcjmx7bor+15AQ== + version "4.0.5" + resolved "https://registry.yarnpkg.com/git-up/-/git-up-4.0.5.tgz#e7bb70981a37ea2fb8fe049669800a1f9a01d759" + integrity sha512-YUvVDg/vX3d0syBsk/CKUTib0srcQME0JyHkL5BaYdwLsiCslPWmDSi8PUMo9pXYjrryMcmsCoCgsTpSCJEQaA== dependencies: is-ssh "^1.3.0" - parse-url "^5.0.0" + parse-url "^6.0.0" git-url-parse@^11.4.4: - version "11.4.4" - resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.4.4.tgz#5d747debc2469c17bc385719f7d0427802d83d77" - integrity sha512-Y4o9o7vQngQDIU9IjyCmRJBin5iYjI5u9ZITnddRZpD7dcCFQj2sL2XuMNbLRE4b4B/4ENPsp2Q8P44fjAZ0Pw== + version "11.5.0" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.5.0.tgz#acaaf65239cb1536185b19165a24bbc754b3f764" + integrity sha512-TZYSMDeM37r71Lqg1mbnMlOqlHd7BSij9qN7XwTkRqSAYFMihGLGhfHwgqQob3GUhEneKnV4nskN9rbQw2KGxA== dependencies: git-up "^4.0.0" @@ -2292,14 +2292,14 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -glob-parent@^5.1.0, glob-parent@^5.1.1: +glob-parent@^5.1.1, glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob@^7.0.0, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: +glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== @@ -2318,10 +2318,10 @@ global-dirs@^3.0.0: dependencies: ini "2.0.0" -globby@^11.0.2, globby@^11.0.3: - version "11.0.3" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" - integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== +globby@^11.0.2, globby@^11.0.4: + version "11.0.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" @@ -2592,10 +2592,14 @@ inquirer@^7.3.3: strip-ansi "^6.0.0" through "^2.3.6" -interpret@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" ip@^1.1.5: version "1.1.5" @@ -2632,9 +2636,9 @@ is-ci@^2.0.0: ci-info "^2.0.0" is-core-module@^2.2.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" - integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== + version "2.5.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.5.0.tgz#f754843617c70bfd29b7bd87327400cda5c18491" + integrity sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg== dependencies: has "^1.0.3" @@ -2643,6 +2647,11 @@ is-date-object@^1.0.1: resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== +is-docker@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -2758,9 +2767,9 @@ is-stream@^1.1.0: integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== is-string@^1.0.5, is-string@^1.0.6: version "1.0.6" @@ -2786,6 +2795,13 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= +is-wsl@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + is-yarn-global@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" @@ -3131,9 +3147,9 @@ make-fetch-happen@^8.0.9: ssri "^8.0.0" make-fetch-happen@^9.0.1: - version "9.0.2" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.0.2.tgz#aa8c0e4a5e3a5f2be86c54d3abed44fe5a32ad5d" - integrity sha512-UkAWAuXPXSSlVviTjH2We20mtj1NnZW2Qq/oTY2dyMbRQ5CR3Xed3akCDMnM7j6axrMY80lhgM7loNE132PfAw== + version "9.0.4" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.0.4.tgz#ceaa100e60e0ef9e8d1ede94614bb2ba83c8bb24" + integrity sha512-sQWNKMYqSmbAGXqJg2jZ+PmHh5JAybvwu0xM8mZR/bsTjGiTASj3ldXJV7KFHy1k/IJIBkjxQFoWIVsv9+PQMg== dependencies: agentkeepalive "^4.1.3" cacache "^15.2.0" @@ -3152,13 +3168,6 @@ make-fetch-happen@^9.0.1: socks-proxy-agent "^5.0.0" ssri "^8.0.0" -map-age-cleaner@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - map-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" @@ -3169,14 +3178,6 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.2.1.tgz#e4ea399dbc979ae735c83c863dd31bdf364277b7" integrity sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ== -mem@^8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/mem/-/mem-8.1.1.tgz#cf118b357c65ab7b7e0817bdf00c8062297c0122" - integrity sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA== - dependencies: - map-age-cleaner "^0.1.3" - mimic-fn "^3.1.0" - meow@^7.0.0: version "7.1.1" resolved "https://registry.yarnpkg.com/meow/-/meow-7.1.1.tgz#7c01595e3d337fcb0ec4e8eed1666ea95903d306" @@ -3221,7 +3222,7 @@ merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.2: +micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -3229,10 +3230,10 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.48.0, "mime-db@>= 1.43.0 < 2": - version "1.48.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d" - integrity sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ== +mime-db@1.49.0, "mime-db@>= 1.43.0 < 2": + version "1.49.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" + integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== mime-db@~1.33.0: version "1.33.0" @@ -3247,22 +3248,17 @@ mime-types@2.1.18: mime-db "~1.33.0" mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.31" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b" - integrity sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg== + version "2.1.32" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" + integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== dependencies: - mime-db "1.48.0" + mime-db "1.49.0" mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -mimic-fn@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-3.1.0.tgz#65755145bbf3e36954b949c16450427451d5ca74" - integrity sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ== - mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -3302,9 +3298,9 @@ minipass-collect@^1.0.2: minipass "^3.0.0" minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.3.3.tgz#34c7cea038c817a8658461bf35174551dce17a0a" - integrity sha512-akCrLDWfbdAWkMLBxJEeWTdNsjML+dt5YgOI4gJ53vuO0vrmYQkUPxa6j6V65s9CcePIr2SSWqjT2EcrNseryQ== + version "1.3.4" + resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.3.4.tgz#63f5af868a38746ca7b33b03393ddf8c291244fe" + integrity sha512-TielGogIzbUEtd1LsjZFs47RWuHHfhl6TiCx1InVxApBAmQ8bL0dL5ilkLGcRvuyW/A9nE+Lvn855Ewz8S0PnQ== dependencies: minipass "^3.1.0" minipass-sized "^1.0.3" @@ -3438,6 +3434,11 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" @@ -3516,10 +3517,10 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== -normalize-url@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.0.1.tgz#a4f27f58cf8c7b287b440b8a8201f42d0b00d256" - integrity sha512-VU4pzAuh7Kip71XEmO9aNREYAdMHFGTVj/i+CaTImS8x0i1d3jUZkXhqluy/PRgjPLMgsLQulYY3PJ/aSbSjpQ== +normalize-url@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" + integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== npm-bundled@^1.1.1: version "1.1.2" @@ -3528,28 +3529,28 @@ npm-bundled@^1.1.1: dependencies: npm-normalize-package-bin "^1.0.1" -npm-check-updates@^11.6.0: - version "11.6.0" - resolved "https://registry.yarnpkg.com/npm-check-updates/-/npm-check-updates-11.6.0.tgz#fa9cce88138e46b02ca34f54232493b2fdadb5ae" - integrity sha512-/l4S7Gh+8+Rg5itWsqFya5RRSHtPzw5neyAlbWNJfBfEeRX6lYVxKgs85QFBOKrZj3eL5MGBaUW8228TmjMhrw== +npm-check-updates@^11.8.3: + version "11.8.3" + resolved "https://registry.yarnpkg.com/npm-check-updates/-/npm-check-updates-11.8.3.tgz#3c3541ad855bbc42b0d60e8eb293d3f6125c80e5" + integrity sha512-NslIB6Af7GagVrN+bvBkObLyawIZfOnDnl8n9MHE+dFt0aChRYtvR6T2BLJKzOPIepCLmmh0NRR/qha0ExAELQ== dependencies: chalk "^4.1.1" cint "^8.2.1" cli-table "^0.3.6" commander "^6.2.1" + fast-memoize "^2.5.2" find-up "5.0.0" fp-and-or "^0.1.3" get-stdin "^8.0.0" - globby "^11.0.3" + globby "^11.0.4" hosted-git-info "^4.0.2" json-parse-helpfulerror "^1.0.3" jsonlines "^0.1.1" libnpmconfig "^1.2.1" lodash "^4.17.21" - mem "^8.1.1" minimatch "^3.0.4" p-map "^4.0.0" - pacote "^11.3.3" + pacote "^11.3.4" parse-github-url "^1.0.2" progress "^2.0.3" prompts "^2.4.1" @@ -3588,9 +3589,9 @@ npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-package-arg@^8.1.2: - version "8.1.4" - resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.4.tgz#8001cdbc4363997b8ef6c6cf7aaf543c5805879d" - integrity sha512-xLokoCFqj/rPdr3LvcdDL6Kj6ipXGEDHD/QGpzwU6/pibYUOXmp5DBmg76yukFyx4ZDbrXNOTn+BPyd8TD4Jlw== + version "8.1.5" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.5.tgz#3369b2d5fe8fdc674baa7f1786514ddc15466e44" + integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q== dependencies: hosted-git-info "^4.0.1" semver "^7.3.4" @@ -3681,10 +3682,10 @@ object-assign@^4.1.0: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-inspect@^1.10.3, object-inspect@^1.9.0: - version "1.10.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369" - integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw== +object-inspect@^1.11.0, object-inspect@^1.9.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" + integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" @@ -3752,11 +3753,6 @@ p-cancelable@^1.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= - p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -3875,12 +3871,12 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" -pacote@^11.2.6, pacote@^11.3.3: - version "11.3.4" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.4.tgz#c290b790a5cee3082bb8fa223f3f3e2fdf3d0bfc" - integrity sha512-RfahPCunM9GI7ryJV/zY0bWQiokZyLqaSNHXtbNSoLb7bwTvBbJBEyCJ01KWs4j1Gj7GmX8crYXQ1sNX6P2VKA== +pacote@^11.2.6, pacote@^11.3.4: + version "11.3.5" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.5.tgz#73cf1fc3772b533f575e39efa96c50be8c3dc9d2" + integrity sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg== dependencies: - "@npmcli/git" "^2.0.1" + "@npmcli/git" "^2.1.0" "@npmcli/installed-package-contents" "^1.0.6" "@npmcli/promise-spawn" "^1.2.0" "@npmcli/run-script" "^1.8.2" @@ -3940,13 +3936,13 @@ parse-path@^4.0.0: qs "^6.9.4" query-string "^6.13.8" -parse-url@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-5.0.3.tgz#c158560f14cb1560917e0b7fd8b01adc1e9d3cab" - integrity sha512-nrLCVMJpqo12X8uUJT4GJPd5AFaTOrGx/QpJy3HNcVtq0AZSstVIsnxS5fqNPuoqMUs3MyfBoOP6Zvu2Arok5A== +parse-url@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-6.0.0.tgz#f5dd262a7de9ec00914939220410b66cff09107d" + integrity sha512-cYyojeX7yIIwuJzledIHeLUBVJ6COVLeT4eF+2P6aKVzwvgKQPndCBv3+yQ7pcWjqToYwaligxzSYNNmGoMAvw== dependencies: is-ssh "^1.3.0" - normalize-url "^6.0.1" + normalize-url "^6.1.0" parse-path "^4.0.0" protocols "^1.4.0" @@ -3970,7 +3966,7 @@ path-is-inside@1.0.2: resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= -path-key@^2.0.0: +path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= @@ -4007,7 +4003,7 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picomatch@^2.2.1, picomatch@^2.2.3: +picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== @@ -4195,9 +4191,9 @@ read-cmd-shim@^2.0.0: integrity sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw== read-package-json-fast@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/read-package-json-fast/-/read-package-json-fast-2.0.2.tgz#2dcb24d9e8dd50fb322042c8c35a954e6cc7ac9e" - integrity sha512-5fyFUyO9B799foVk4n6ylcoAktG/FbE3jwRKxvwaeSrIunaoMc0u81dzXxjeAFKOce7O5KncdfwpGvvs6r5PsQ== + version "2.0.3" + resolved "https://registry.yarnpkg.com/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz#323ca529630da82cb34b36cc0b996693c98c2b83" + integrity sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ== dependencies: json-parse-even-better-errors "^2.3.0" npm-normalize-package-bin "^1.0.1" @@ -4306,13 +4302,6 @@ readdir-scoped-modules@^1.0.0: graceful-fs "^4.1.2" once "^1.3.0" -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= - dependencies: - resolve "^1.1.6" - redent@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" @@ -4408,7 +4397,7 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.20.0: +resolve@^1.10.0, resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -4501,7 +4490,7 @@ semver-utils@^1.1.4: resolved "https://registry.yarnpkg.com/semver-utils/-/semver-utils-1.1.4.tgz#cf0405e669a57488913909fc1c3f29bf2a4871e2" integrity sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA== -"semver@2 || 3 || 4 || 5", semver@^5.6.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -4532,17 +4521,17 @@ serve-handler@6.1.3: path-to-regexp "2.2.1" range-parser "1.2.0" -serve@^11.3.2: - version "11.3.2" - resolved "https://registry.yarnpkg.com/serve/-/serve-11.3.2.tgz#b905e980616feecd170e51c8f979a7b2374098f5" - integrity sha512-yKWQfI3xbj/f7X1lTBg91fXBP0FqjJ4TEi+ilES5yzH0iKJpN5LjNb1YzIfQg9Rqn4ECUS2SOf2+Kmepogoa5w== +serve@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/serve/-/serve-12.0.0.tgz#122962f712b57660059de9d109c82599280e4949" + integrity sha512-BkTsETQYynAZ7rXX414kg4X6EvuZQS3UVs1NY0VQYdRHSTYWPYcH38nnDh48D0x6ONuislgjag8uKlU2gTBImA== dependencies: "@zeit/schemas" "2.6.0" - ajv "6.5.3" + ajv "6.12.6" arg "2.0.0" boxen "1.3.0" chalk "2.4.1" - clipboardy "1.2.3" + clipboardy "2.3.0" compression "1.7.3" serve-handler "6.1.3" update-check "1.5.2" @@ -4583,15 +4572,6 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shelljs@^0.8.3: - version "0.8.4" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" - integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -4627,11 +4607,11 @@ smart-buffer@^4.1.0: integrity sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw== socks-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-5.0.0.tgz#7c0f364e7b1cf4a7a437e71253bed72e9004be60" - integrity sha512-lEpa1zsWCChxiynk+lCycKuC502RxDWLKJZoIhnxrWNjLSDGYRFflHA1/228VkRcnv9TIb8w98derGbpKxJRgA== + version "5.0.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz#032fb583048a29ebffec2e6a73fca0761f48177e" + integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== dependencies: - agent-base "6" + agent-base "^6.0.2" debug "4" socks "^2.3.3" @@ -4901,9 +4881,9 @@ tar@^4.4.12: yallist "^3.0.3" tar@^6.0.2, tar@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.0.tgz#d1724e9bcc04b977b18d5c573b333a2207229a83" - integrity sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA== + version "6.1.5" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.5.tgz#6e25bee1cfda94317aedc3f5d49290ae68361d73" + integrity sha512-FiK6MQyyaqd5vHuUjbg/NpO8BuEGeSXcmlH7Pt/JkugWS8s0w8nKybWjHDJiwzCAIKZ66uof4ghm4tBADjcqRA== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -5069,9 +5049,9 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= uglify-js@^3.1.4: - version "3.13.9" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.9.tgz#4d8d21dcd497f29cfd8e9378b9df123ad025999b" - integrity sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g== + version "3.14.1" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.1.tgz#e2cb9fe34db9cb4cf7e35d1d26dfea28e09a7d06" + integrity sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g== uid-number@0.0.6: version "0.0.6" @@ -5230,9 +5210,9 @@ webidl-conversions@^6.1.0: integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== whatwg-url@^8.4.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.6.0.tgz#27c0205a4902084b872aecb97cf0f2a7a3011f4c" - integrity sha512-os0KkeeqUOl7ccdDT1qqUcS4KH4tcBTSKK5Nl5WKb2lyxInIZ/CpjkqKa1Ss12mjfdcRX9mHmPPs7/SxG1Hbdw== + version "8.7.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" + integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" tr46 "^2.1.0" @@ -5404,9 +5384,9 @@ yargs-parser@^18.1.3: decamelize "^1.2.0" yargs-parser@^20.2.2, yargs-parser@^20.2.3: - version "20.2.7" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" - integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs@^16.2.0: version "16.2.0" From 504093566f9ee02a1040eaac876f73cc3905f4bc Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 2 Sep 2021 10:18:38 +0900 Subject: [PATCH 08/87] =?UTF-8?q?=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn.lock | 313 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 184 insertions(+), 129 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4f0b2e3b..e5818d9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,6 +23,11 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@gar/promisify@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210" + integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw== + "@hutson/parse-repository-url@^3.0.0": version "3.0.2" resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" @@ -725,6 +730,14 @@ resolved "https://registry.yarnpkg.com/@npmcli/ci-detect/-/ci-detect-1.3.0.tgz#6c1d2c625fb6ef1b9dea85ad0a5afcbef85ef22a" integrity sha512-oN3y7FAROHhrAt7Rr7PnTSwrHrZVRTS2ZbyxeQwSSYD0ifwM3YNgQqbaRmjcWoPyq77MjchusjJDspbzMmip1Q== +"@npmcli/fs@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.0.0.tgz#589612cfad3a6ea0feafcb901d29c63fd52db09f" + integrity sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ== + dependencies: + "@gar/promisify" "^1.0.1" + semver "^7.3.5" + "@npmcli/git@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-2.1.0.tgz#2fbd77e147530247d37f325930d457b3ebe894f6" @@ -768,13 +781,12 @@ infer-owner "^1.0.4" "@npmcli/run-script@^1.8.2": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-1.8.5.tgz#f250a0c5e1a08a792d775a315d0ff42fc3a51e1d" - integrity sha512-NQspusBCpTjNwNRFMtz2C5MxoxyzlbuJ4YEhxAKrIonTiirKDtatsZictx9RgamQIx6+QuHMNmPl0wQdoESs9A== + version "1.8.6" + resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-1.8.6.tgz#18314802a6660b0d4baa4c3afe7f1ad39d8c28b7" + integrity sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g== dependencies: "@npmcli/node-gyp" "^1.0.2" "@npmcli/promise-spawn" "^1.3.2" - infer-owner "^1.0.4" node-gyp "^7.1.0" read-package-json-fast "^2.0.1" @@ -785,7 +797,7 @@ dependencies: "@octokit/types" "^6.0.3" -"@octokit/core@^3.5.0": +"@octokit/core@^3.5.1": version "3.5.1" resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== @@ -808,42 +820,42 @@ universal-user-agent "^6.0.0" "@octokit/graphql@^4.5.8": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.6.4.tgz#0c3f5bed440822182e972317122acb65d311a5ed" - integrity sha512-SWTdXsVheRmlotWNjKzPOb6Js6tjSqA2a8z9+glDJng0Aqjzti8MEWOtuT8ZSu6wHnci7LZNuarE87+WJBG4vg== + version "4.8.0" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" + integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== dependencies: "@octokit/request" "^5.6.0" "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^9.4.0": - version "9.4.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-9.4.0.tgz#31a76fb4c0f2e15af300edd880cedf4f75be212b" - integrity sha512-rKRkXikOJgDNImPl49IJuECLVXjj+t4qOXHhl8SBjMQCGGp1w4m5Ud/0kfdUx+zCpTvBN8vaOUDF4nnboZoOtQ== +"@octokit/openapi-types@^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.0.0.tgz#db4335de99509021f501fc4e026e6ff495fe1e62" + integrity sha512-k1iO2zKuEjjRS1EJb4FwSLk+iF6EGp+ZV0OMRViQoWhQ1fZTk9hg1xccZII5uyYoiqcbC73MRBmT45y1vp2PPg== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== -"@octokit/plugin-paginate-rest@^2.6.2": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.15.0.tgz#9c956c3710b2bd786eb3814eaf5a2b17392c150d" - integrity sha512-/vjcb0w6ggVRtsb8OJBcRR9oEm+fpdo8RJk45khaWw/W0c8rlB2TLCLyZt/knmC17NkX7T9XdyQeEY7OHLSV1g== +"@octokit/plugin-paginate-rest@^2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.0.tgz#09dbda2e5fbca022e3cdf76b63618f7b357c9f0c" + integrity sha512-8YYzALPMvEZ35kgy5pdYvQ22Roz+BIuEaedO575GwE2vb/ACDqQn0xQrTJR4tnZCJn7pi8+AWPVjrFDaERIyXQ== dependencies: - "@octokit/types" "^6.23.0" + "@octokit/types" "^6.26.0" -"@octokit/plugin-request-log@^1.0.2": +"@octokit/plugin-request-log@^1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== -"@octokit/plugin-rest-endpoint-methods@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.7.0.tgz#80b69452c17597738d4692c79829b72d9e72ccec" - integrity sha512-G7sgccWRYQMwcHJXkDY/sDxbXeKiZkFQqUtzBCwmrzCNj2GQf3VygQ4T/BFL2crLVpIbenkE/c0ErhYOte2MPw== +"@octokit/plugin-rest-endpoint-methods@^5.9.0": + version "5.9.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.9.0.tgz#f9a7d8411e7e4e49a65fc95b5cc23cf96bf05e1f" + integrity sha512-Rz67pg+rEJq2Qn/qfHsMiBoP7GL5NDn8Gg0ezGznZ745Ixn1gPusZYZqCXNhICYrIZaVXmusNP0iwPdphJneqQ== dependencies: - "@octokit/types" "^6.24.0" + "@octokit/types" "^6.26.0" deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": @@ -856,9 +868,9 @@ once "^1.4.0" "@octokit/request@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.0.tgz#6084861b6e4fa21dc40c8e2a739ec5eff597e672" - integrity sha512-4cPp/N+NqmaGQwbh3vUsYqokQIzt7VjsgTYVXiwpUP2pxd5YiZB2XuTedbb0SPtv9XS7nzAKjAuQxmY8/aZkiA== + version "5.6.1" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.1.tgz#f97aff075c37ab1d427c49082fefeef0dba2d8ce" + integrity sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ== dependencies: "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.1.0" @@ -868,21 +880,21 @@ universal-user-agent "^6.0.0" "@octokit/rest@^18.1.0": - version "18.9.0" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.9.0.tgz#e5cc23fa199a2bdeea9efbe6096f81d7d6156fe9" - integrity sha512-VrmrE8gjpuOoDAGjrQq2j9ZhOE6LxaqxaQg0yMrrEnnQZy2ZcAnr5qbVfKsMF0up/48PRV/VFS/2GSMhA7nTdA== + version "18.10.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.10.0.tgz#8a0add9611253e0e31d3ed5b4bc941a3795a7648" + integrity sha512-esHR5OKy38bccL/sajHqZudZCvmv4yjovMJzyXlphaUo7xykmtOdILGJ3aAm0mFHmMLmPFmDMJXf39cAjNJsrw== dependencies: - "@octokit/core" "^3.5.0" - "@octokit/plugin-paginate-rest" "^2.6.2" - "@octokit/plugin-request-log" "^1.0.2" - "@octokit/plugin-rest-endpoint-methods" "5.7.0" + "@octokit/core" "^3.5.1" + "@octokit/plugin-paginate-rest" "^2.16.0" + "@octokit/plugin-request-log" "^1.0.4" + "@octokit/plugin-rest-endpoint-methods" "^5.9.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.23.0", "@octokit/types@^6.24.0": - version "6.24.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.24.0.tgz#d7858ceae8ac29256da85dcfcb9acbae28e6ba22" - integrity sha512-MfEimJeQ8AV1T2nI5kOfHqsqPHaAnG0Dw3MVoHSEsEq6iLKx2N91o+k2uAgXhPYeSE76LVBqjgTShnFFgNwe0A== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.26.0": + version "6.26.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.26.0.tgz#b8af298485d064ad9424cb41520541c1bf820346" + integrity sha512-RDxZBAFMtqs1ZPnbUu1e7ohPNfoNhTiep4fErY7tZs995BeHu369Vsh5woMIaFbllRWEZBfvTCS4hvDnMPiHrA== dependencies: - "@octokit/openapi-types" "^9.4.0" + "@octokit/openapi-types" "^10.0.0" "@sindresorhus/is@^0.14.0": version "0.14.0" @@ -1057,12 +1069,12 @@ arch@^2.1.1: integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + version "1.1.6" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.6.tgz#bc9101d19670c7bdb1546ed036568a6c9879ee79" + integrity sha512-+1byPnimWdGcKFRS48zG73nxM08kamPFReUYvEmRXI3E8E4YhF4voMRDaGlfGD1UeRHEgs4NhQCE28KI8JVj1A== dependencies: delegates "^1.0.0" - readable-stream "^2.0.6" + readable-stream "^3.6.0" arg@2.0.0: version "2.0.0" @@ -1221,10 +1233,11 @@ bytes@3.0.0: integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= cacache@^15.0.5, cacache@^15.2.0: - version "15.2.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.2.0.tgz#73af75f77c58e72d8c630a7a2858cb18ef523389" - integrity sha512-uKoJSHmnrqXgthDFx/IU6ED/5xd+NNGe+Bb+kLZy7Ku4P+BaiWEUflAKPZ7eAzsYGcsAGASJZsybXp+quEcHTw== + version "15.3.0" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" + integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== dependencies: + "@npmcli/fs" "^1.0.0" "@npmcli/move-file" "^1.0.1" chownr "^2.0.0" fs-minipass "^2.0.0" @@ -1329,7 +1342,7 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chownr@^1.1.1: +chownr@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== @@ -1639,15 +1652,20 @@ conventional-recommended-bump@^6.1.0: meow "^8.0.0" q "^1.5.1" -core-util-is@1.0.2, core-util-is@~1.0.0: +core-util-is@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + cosmiconfig@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3" - integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA== + version "7.0.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" + integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== dependencies: "@types/parse-json" "^4.0.0" import-fresh "^3.2.1" @@ -1713,7 +1731,7 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -2053,9 +2071,9 @@ fast-url-parser@1.1.3: punycode "^1.3.2" fastq@^1.6.0: - version "1.11.1" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.1.tgz#5d8175aae17db61947f8b162cfc7f63264d22807" - integrity sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw== + version "1.12.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.12.0.tgz#ed7b6ab5d62393fb2cc591c853652a5c318bf794" + integrity sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg== dependencies: reusify "^1.0.4" @@ -2142,7 +2160,7 @@ fs-extra@^9.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-minipass@^1.2.5: +fs-minipass@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== @@ -2223,6 +2241,8 @@ get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" get-stream@^5.1.0: version "5.2.0" @@ -2348,9 +2368,9 @@ got@^9.6.0: url-parse-lax "^3.0.0" graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== + version "4.2.8" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== handlebars@^4.7.6: version "4.7.7" @@ -2402,6 +2422,13 @@ has-symbols@^1.0.1, has-symbols@^1.0.2: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -2560,15 +2587,15 @@ ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== init-package-json@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-2.0.3.tgz#c8ae4f2a4ad353bcbc089e5ffe98a8f1a314e8fd" - integrity sha512-tk/gAgbMMxR6fn1MgMaM1HpU1ryAmBWWitnxG5OhuNXeX0cbpbgV5jA4AIpQJVNoyOfOevTtO6WX+rPs+EFqaQ== + version "2.0.4" + resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-2.0.4.tgz#9f9f66cd5934e6d5f645150e15013d384d0b90d2" + integrity sha512-gUACSdZYka+VvnF90TsQorC+1joAVWNI724vBNj3RD0LLMeDss2IuzaeiQs0T4YzKs76BPHtrp/z3sn2p+KDTw== dependencies: glob "^7.1.1" npm-package-arg "^8.1.2" promzard "^0.3.0" read "~1.0.1" - read-package-json "^3.0.1" + read-package-json "^4.0.0" semver "^7.3.5" validate-npm-package-license "^3.0.4" validate-npm-package-name "^3.0.0" @@ -2612,21 +2639,24 @@ is-arrayish@^0.2.1: integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-bigint@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" - integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" is-boolean-object@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8" - integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng== + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== dependencies: call-bind "^1.0.2" + has-tostringtag "^1.0.0" is-callable@^1.1.4, is-callable@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" - integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== is-ci@^2.0.0: version "2.0.0" @@ -2635,17 +2665,19 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.2.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.5.0.tgz#f754843617c70bfd29b7bd87327400cda5c18491" - integrity sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg== +is-core-module@^2.2.0, is-core-module@^2.5.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" + integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== dependencies: has "^1.0.3" is-date-object@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" - integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" is-docker@^2.0.0: version "2.2.1" @@ -2705,9 +2737,11 @@ is-npm@^5.0.0: integrity sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA== is-number-object@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb" - integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw== + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" + integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== + dependencies: + has-tostringtag "^1.0.0" is-number@^7.0.0: version "7.0.0" @@ -2747,12 +2781,12 @@ is-plain-object@^5.0.0: integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== is-regex@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" - integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== dependencies: call-bind "^1.0.2" - has-symbols "^1.0.2" + has-tostringtag "^1.0.0" is-ssh@^1.3.0: version "1.3.3" @@ -2772,9 +2806,11 @@ is-stream@^2.0.0: integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== is-string@^1.0.5, is-string@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" - integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.4" @@ -3147,9 +3183,9 @@ make-fetch-happen@^8.0.9: ssri "^8.0.0" make-fetch-happen@^9.0.1: - version "9.0.4" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.0.4.tgz#ceaa100e60e0ef9e8d1ede94614bb2ba83c8bb24" - integrity sha512-sQWNKMYqSmbAGXqJg2jZ+PmHh5JAybvwu0xM8mZR/bsTjGiTASj3ldXJV7KFHy1k/IJIBkjxQFoWIVsv9+PQMg== + version "9.1.0" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" + integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== dependencies: agentkeepalive "^4.1.3" cacache "^15.2.0" @@ -3165,7 +3201,7 @@ make-fetch-happen@^9.0.1: minipass-pipeline "^1.2.4" negotiator "^0.6.2" promise-retry "^2.0.1" - socks-proxy-agent "^5.0.0" + socks-proxy-agent "^6.0.0" ssri "^8.0.0" map-obj@^1.0.0: @@ -3298,9 +3334,9 @@ minipass-collect@^1.0.2: minipass "^3.0.0" minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: - version "1.3.4" - resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.3.4.tgz#63f5af868a38746ca7b33b03393ddf8c291244fe" - integrity sha512-TielGogIzbUEtd1LsjZFs47RWuHHfhl6TiCx1InVxApBAmQ8bL0dL5ilkLGcRvuyW/A9nE+Lvn855Ewz8S0PnQ== + version "1.4.1" + resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.4.1.tgz#d75e0091daac1b0ffd7e9d41629faff7d0c1f1b6" + integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw== dependencies: minipass "^3.1.0" minipass-sized "^1.0.3" @@ -3337,7 +3373,7 @@ minipass-sized@^1.0.3: dependencies: minipass "^3.0.0" -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: +minipass@^2.6.0, minipass@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== @@ -3352,7 +3388,7 @@ minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3: dependencies: yallist "^4.0.0" -minizlib@^1.2.1: +minizlib@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== @@ -3376,7 +3412,7 @@ mkdirp-infer-owner@^2.0.0: infer-owner "^1.0.4" mkdirp "^1.0.3" -mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@^0.5.1, mkdirp@^0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -3503,12 +3539,12 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package- validate-npm-package-license "^3.0.1" normalize-package-data@^3.0.0, normalize-package-data@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.2.tgz#cae5c410ae2434f9a6c1baa65d5bc3b9366c8699" - integrity sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg== + version "3.0.3" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" + integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== dependencies: hosted-git-info "^4.0.1" - resolve "^1.20.0" + is-core-module "^2.5.0" semver "^7.3.4" validate-npm-package-license "^3.0.1" @@ -4208,7 +4244,7 @@ read-package-json@^2.0.0: normalize-package-data "^2.0.0" npm-normalize-package-bin "^1.0.0" -read-package-json@^3.0.0, read-package-json@^3.0.1: +read-package-json@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-3.0.1.tgz#c7108f0b9390257b08c21e3004d2404c806744b9" integrity sha512-aLcPqxovhJTVJcsnROuuzQvv6oziQx4zd3JvG0vGCL5MjTONUc4uJ90zCBC6R7W7oUKBNoR/F8pkyfVwlbxqng== @@ -4218,6 +4254,16 @@ read-package-json@^3.0.0, read-package-json@^3.0.1: normalize-package-data "^3.0.0" npm-normalize-package-bin "^1.0.0" +read-package-json@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-4.1.1.tgz#153be72fce801578c1c86b8ef2b21188df1b9eea" + integrity sha512-P82sbZJ3ldDrWCOSKxJT0r/CXMWR0OR3KRh55SgKo3p91GSIEEC32v3lSHAvO/UcH3/IoL7uqhOFBduAnwdldw== + dependencies: + glob "^7.1.1" + json-parse-even-better-errors "^2.3.0" + normalize-package-data "^3.0.0" + npm-normalize-package-bin "^1.0.0" + read-package-tree@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.3.1.tgz#a32cb64c7f31eb8a6f31ef06f9cedf74068fe636" @@ -4270,7 +4316,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -4279,7 +4325,7 @@ readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@^2.0.6, readable-stream@~2.3.6: +readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -4397,7 +4443,7 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.10.0, resolve@^1.20.0: +resolve@^1.10.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -4468,7 +4514,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -4602,9 +4648,9 @@ slide@^1.1.6: integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= smart-buffer@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.1.0.tgz#91605c25d91652f4661ea69ccf45f1b331ca21ba" - integrity sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw== + version "4.2.0" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" + integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== socks-proxy-agent@^5.0.0: version "5.0.1" @@ -4615,7 +4661,16 @@ socks-proxy-agent@^5.0.0: debug "4" socks "^2.3.3" -socks@^2.3.3: +socks-proxy-agent@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.0.0.tgz#9f8749cdc05976505fa9f9a958b1818d0e60573b" + integrity sha512-FIgZbQWlnjVEQvMkylz64/rUggGtrKstPnx8OZyYFG0tAFR8CSBtpXxSwbFLHyeXFn/cunFL7MpuSOvDSOPo9g== + dependencies: + agent-base "^6.0.2" + debug "^4.3.1" + socks "^2.6.1" + +socks@^2.3.3, socks@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.1.tgz#989e6534a07cf337deb1b1c94aaa44296520d30e" integrity sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA== @@ -4669,9 +4724,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz#8a595135def9592bda69709474f1cbeea7c2467f" - integrity sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ== + version "3.0.10" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" + integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== split-on-first@^1.0.0: version "1.1.0" @@ -4868,22 +4923,22 @@ supports-color@^7.1.0: has-flag "^4.0.0" tar@^4.4.12: - version "4.4.15" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.15.tgz#3caced4f39ebd46ddda4d6203d48493a919697f8" - integrity sha512-ItbufpujXkry7bHH9NpQyTXPbJ72iTlXgkBAYsAjDXk3Ds8t/3NfO5P4xZGy7u+sYuQUbimgzswX4uQIEeNVOA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" + version "4.4.19" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" + integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== + dependencies: + chownr "^1.1.4" + fs-minipass "^1.2.7" + minipass "^2.9.0" + minizlib "^1.3.3" + mkdirp "^0.5.5" + safe-buffer "^5.2.1" + yallist "^3.1.1" tar@^6.0.2, tar@^6.1.0: - version "6.1.5" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.5.tgz#6e25bee1cfda94317aedc3f5d49290ae68361d73" - integrity sha512-FiK6MQyyaqd5vHuUjbg/NpO8BuEGeSXcmlH7Pt/JkugWS8s0w8nKybWjHDJiwzCAIKZ66uof4ghm4tBADjcqRA== + version "6.1.11" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" + integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -5355,7 +5410,7 @@ yallist@^2.1.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= -yallist@^3.0.0, yallist@^3.0.3: +yallist@^3.0.0, yallist@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== From dfdcca48dc1efc48d2ef267d257fe0bae7796474 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 6 Sep 2021 14:12:19 +0900 Subject: [PATCH 09/87] =?UTF-8?q?=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- packages/e2ee/package.json | 16 +- packages/e2ee/yarn.lock | 397 ++++---- packages/sdk/package.json | 28 +- packages/sdk/yarn.lock | 1797 ++++++++++++++++++------------------ yarn.lock | 54 +- 6 files changed, 1131 insertions(+), 1163 deletions(-) diff --git a/package.json b/package.json index aa727aad..e728f295 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ ], "devDependencies": { "lerna": "^4.0.0", - "npm-check-updates": "^11.8.3", + "npm-check-updates": "^11.8.5", "serve": "^12.0.0" }, "resolutions": { diff --git a/packages/e2ee/package.json b/packages/e2ee/package.json index 80382178..16441768 100644 --- a/packages/e2ee/package.json +++ b/packages/e2ee/package.json @@ -16,16 +16,16 @@ "test": "echo \"no test\"" }, "devDependencies": { - "@rollup/plugin-replace": "^2.4.2", - "@typescript-eslint/eslint-plugin": "^4.25.0", - "@typescript-eslint/parser": "^4.25.0", - "eslint": "^7.27.0", + "@rollup/plugin-replace": "^3.0.0", + "@typescript-eslint/eslint-plugin": "^4.30.0", + "@typescript-eslint/parser": "^4.30.0", + "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-prettier": "^3.4.0", - "prettier": "^2.3.0", - "rollup": "^2.50.5", + "eslint-plugin-prettier": "^4.0.0", + "prettier": "^2.3.2", + "rollup": "^2.56.3", "rollup-plugin-typescript2": "^0.30.0", - "typescript": "^4.3.2" + "typescript": "^4.4.2" }, "dependencies": { "@sora/go-wasm": "^2021.1.0" diff --git a/packages/e2ee/yarn.lock b/packages/e2ee/yarn.lock index 4bd7c7db..a8b435cd 100644 --- a/packages/e2ee/yarn.lock +++ b/packages/e2ee/yarn.lock @@ -9,60 +9,74 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/helper-validator-identifier@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" - integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== +"@babel/helper-validator-identifier@^7.14.5": + version "7.14.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" + integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== "@babel/highlight@^7.10.4": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" - integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== dependencies: - "@babel/helper-validator-identifier" "^7.14.0" + "@babel/helper-validator-identifier" "^7.14.5" chalk "^2.0.0" js-tokens "^4.0.0" -"@eslint/eslintrc@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.1.tgz#442763b88cecbe3ee0ec7ca6d6dd6168550cbf14" - integrity sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ== +"@eslint/eslintrc@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" + integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== dependencies: ajv "^6.12.4" debug "^4.1.1" espree "^7.3.0" - globals "^12.1.0" + globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" js-yaml "^3.13.1" minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@nodelib/fs.scandir@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" - integrity sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA== +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" + integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== dependencies: - "@nodelib/fs.stat" "2.0.4" + "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.4", "@nodelib/fs.stat@^2.0.2": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" - integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== "@nodelib/fs.walk@^1.2.3": - version "1.2.6" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" - integrity sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow== + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: - "@nodelib/fs.scandir" "2.1.4" + "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@rollup/plugin-replace@^2.4.2": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" - integrity sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg== +"@rollup/plugin-replace@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-3.0.0.tgz#3a4c9665d4e7a4ce2c360cf021232784892f3fac" + integrity sha512-3c7JCbMuYXM4PbPWT4+m/4Y6U60SgsnDT/cCyAyUKwFHg7pTSfsSQzIpETha3a3ig6OdOKzZz87D9ZXIK3qsDg== dependencies: "@rollup/pluginutils" "^3.1.0" magic-string "^0.25.7" @@ -77,9 +91,9 @@ picomatch "^2.2.2" "@rollup/pluginutils@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.0.tgz#0dcc61c780e39257554feb7f77207dceca13c838" - integrity sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ== + version "4.1.1" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" + integrity sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ== dependencies: estree-walker "^2.0.1" picomatch "^2.2.2" @@ -89,85 +103,84 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== -"@types/json-schema@^7.0.3": - version "7.0.7" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" - integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== +"@types/json-schema@^7.0.7": + version "7.0.9" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== -"@typescript-eslint/eslint-plugin@^4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.25.0.tgz#d82657b6ab4caa4c3f888ff923175fadc2f31f2a" - integrity sha512-Qfs3dWkTMKkKwt78xp2O/KZQB8MPS1UQ5D3YW2s6LQWBE1074BE+Rym+b1pXZIX3M3fSvPUDaCvZLKV2ylVYYQ== +"@typescript-eslint/eslint-plugin@^4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz#4a0c1ae96b953f4e67435e20248d812bfa55e4fb" + integrity sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g== dependencies: - "@typescript-eslint/experimental-utils" "4.25.0" - "@typescript-eslint/scope-manager" "4.25.0" - debug "^4.1.1" + "@typescript-eslint/experimental-utils" "4.30.0" + "@typescript-eslint/scope-manager" "4.30.0" + debug "^4.3.1" functional-red-black-tree "^1.0.1" - lodash "^4.17.15" - regexpp "^3.0.0" - semver "^7.3.2" - tsutils "^3.17.1" - -"@typescript-eslint/experimental-utils@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.25.0.tgz#b2febcfa715d2c1806fd5f0335193a6cd270df54" - integrity sha512-f0doRE76vq7NEEU0tw+ajv6CrmPelw5wLoaghEHkA2dNLFb3T/zJQqGPQ0OYt5XlZaS13MtnN+GTPCuUVg338w== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.25.0" - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/typescript-estree" "4.25.0" - eslint-scope "^5.0.0" - eslint-utils "^2.0.0" - -"@typescript-eslint/parser@^4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.25.0.tgz#6b2cb6285aa3d55bfb263c650739091b0f19aceb" - integrity sha512-OZFa1SKyEJpAhDx8FcbWyX+vLwh7OEtzoo2iQaeWwxucyfbi0mT4DijbOSsTgPKzGHr6GrF2V5p/CEpUH/VBxg== - dependencies: - "@typescript-eslint/scope-manager" "4.25.0" - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/typescript-estree" "4.25.0" - debug "^4.1.1" - -"@typescript-eslint/scope-manager@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.25.0.tgz#9d86a5bcc46ef40acd03d85ad4e908e5aab8d4ca" - integrity sha512-2NElKxMb/0rya+NJG1U71BuNnp1TBd1JgzYsldsdA83h/20Tvnf/HrwhiSlNmuq6Vqa0EzidsvkTArwoq+tH6w== - dependencies: - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/visitor-keys" "4.25.0" - -"@typescript-eslint/types@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.25.0.tgz#0e444a5c5e3c22d7ffa5e16e0e60510b3de5af87" - integrity sha512-+CNINNvl00OkW6wEsi32wU5MhHti2J25TJsJJqgQmJu3B3dYDBcmOxcE5w9cgoM13TrdE/5ND2HoEnBohasxRQ== - -"@typescript-eslint/typescript-estree@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.25.0.tgz#942e4e25888736bff5b360d9b0b61e013d0cfa25" - integrity sha512-1B8U07TGNAFMxZbSpF6jqiDs1cVGO0izVkf18Q/SPcUAc9LhHxzvSowXDTvkHMWUVuPpagupaW63gB6ahTXVlg== - dependencies: - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/visitor-keys" "4.25.0" - debug "^4.1.1" - globby "^11.0.1" + regexpp "^3.1.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/experimental-utils@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz#9e49704fef568432ae16fc0d6685c13d67db0fd5" + integrity sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw== + dependencies: + "@types/json-schema" "^7.0.7" + "@typescript-eslint/scope-manager" "4.30.0" + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/typescript-estree" "4.30.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@^4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.30.0.tgz#6abd720f66bd790f3e0e80c3be77180c8fcb192d" + integrity sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg== + dependencies: + "@typescript-eslint/scope-manager" "4.30.0" + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/typescript-estree" "4.30.0" + debug "^4.3.1" + +"@typescript-eslint/scope-manager@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz#1a3ffbb385b1a06be85cd5165a22324f069a85ee" + integrity sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A== + dependencies: + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/visitor-keys" "4.30.0" + +"@typescript-eslint/types@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.30.0.tgz#fb9d9b0358426f18687fba82eb0b0f869780204f" + integrity sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw== + +"@typescript-eslint/typescript-estree@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz#ae57833da72a753f4846cd3053758c771670c2ac" + integrity sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg== + dependencies: + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/visitor-keys" "4.30.0" + debug "^4.3.1" + globby "^11.0.3" is-glob "^4.0.1" - semver "^7.3.2" - tsutils "^3.17.1" + semver "^7.3.5" + tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.25.0.tgz#863e7ed23da4287c5b469b13223255d0fde6aaa7" - integrity sha512-AmkqV9dDJVKP/TcZrbf6s6i1zYXt5Hl8qOLrRDTFfRNae4+LB8A4N3i+FLZPW85zIxRy39BgeWOfMS3HoH5ngg== +"@typescript-eslint/visitor-keys@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz#a47c6272fc71b0c627d1691f68eaecf4ad71445e" + integrity sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw== dependencies: - "@typescript-eslint/types" "4.25.0" + "@typescript-eslint/types" "4.30.0" eslint-visitor-keys "^2.0.0" acorn-jsx@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn@^7.4.0: version "7.4.1" @@ -185,9 +198,9 @@ ajv@^6.10.0, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.5.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.5.0.tgz#695528274bcb5afc865446aa275484049a18ae4b" - integrity sha512-Y2l399Tt1AguU3BPRP9Fn4eN+Or+StUGWCUpbnFyXSo8NZ9S4uj+AG2pjs5apK+ZMOwYOz1+a+VKvKH7CudXgQ== + version "8.6.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.2.tgz#2fb45e0e5fcbc0813326c1c3da535d1881bb0571" + integrity sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -270,9 +283,9 @@ chalk@^2.0.0: supports-color "^5.3.0" chalk@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" - integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -320,17 +333,17 @@ cross-spawn@^7.0.2: shebang-command "^2.0.0" which "^2.0.1" -debug@^4.0.1, debug@^4.1.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== +debug@^4.0.1, debug@^4.1.1, debug@^4.3.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== dependencies: ms "2.1.2" deep-is@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== dir-glob@^3.0.1: version "3.0.1" @@ -373,14 +386,14 @@ eslint-config-prettier@^8.3.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== -eslint-plugin-prettier@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7" - integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw== +eslint-plugin-prettier@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" + integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== dependencies: prettier-linter-helpers "^1.0.0" -eslint-scope@^5.0.0, eslint-scope@^5.1.1: +eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -388,13 +401,20 @@ eslint-scope@^5.0.0, eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-utils@^2.0.0, eslint-utils@^2.1.0: +eslint-utils@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: eslint-visitor-keys "^1.1.0" +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" @@ -405,13 +425,14 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint@^7.27.0: - version "7.27.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.27.0.tgz#665a1506d8f95655c9274d84bd78f7166b07e9c7" - integrity sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA== +eslint@^7.32.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" + integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== dependencies: "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.1" + "@eslint/eslintrc" "^0.4.3" + "@humanwhocodes/config-array" "^0.5.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -428,7 +449,7 @@ eslint@^7.27.0: fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" + glob-parent "^5.1.2" globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" @@ -514,16 +535,15 @@ fast-diff@^1.1.2: integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== fast-glob@^3.1.1: - version "3.2.5" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" - integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== + version "3.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" + integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.0" + glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.2" - picomatch "^2.2.1" + micromatch "^4.0.4" fast-json-stable-stringify@^2.0.0: version "2.1.0" @@ -536,9 +556,9 @@ fast-levenshtein@^2.0.6: integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastq@^1.6.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" - integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== + version "1.12.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.12.0.tgz#ed7b6ab5d62393fb2cc591c853652a5c318bf794" + integrity sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg== dependencies: reusify "^1.0.4" @@ -557,9 +577,9 @@ fill-range@^7.0.1: to-regex-range "^5.0.1" find-cache-dir@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" - integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== + version "3.3.2" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" + integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== dependencies: commondir "^1.0.1" make-dir "^3.0.2" @@ -582,9 +602,9 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" - integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== + version "3.2.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" + integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== fs-extra@8.1.0: version "8.1.0" @@ -600,7 +620,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@~2.3.1: +fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -615,7 +635,7 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -glob-parent@^5.0.0, glob-parent@^5.1.0: +glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -634,24 +654,17 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - dependencies: - type-fest "^0.8.1" - -globals@^13.6.0: - version "13.9.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.9.0.tgz#4bf2bf635b334a173fb1daf7c5e6b218ecdc06cb" - integrity sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA== +globals@^13.6.0, globals@^13.9.0: + version "13.11.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" + integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== dependencies: type-fest "^0.20.2" -globby@^11.0.1: - version "11.0.3" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" - integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== +globby@^11.0.3: + version "11.0.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" @@ -661,9 +674,9 @@ globby@^11.0.1: slash "^3.0.0" graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== + version "4.2.8" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== has-flag@^3.0.0: version "3.0.0" @@ -719,9 +732,9 @@ inherits@2: integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-core-module@^2.2.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" - integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== + version "2.6.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" + integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== dependencies: has "^1.0.3" @@ -817,11 +830,6 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@^4.17.15: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -848,7 +856,7 @@ merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.2: +micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -943,7 +951,7 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: +picomatch@^2.2.2, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== @@ -967,10 +975,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" - integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== +prettier@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" + integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== progress@^2.0.0: version "2.0.3" @@ -987,10 +995,10 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -regexpp@^3.0.0, regexpp@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" - integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== +regexpp@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== require-from-string@^2.0.2: version "2.0.2" @@ -1033,12 +1041,12 @@ rollup-plugin-typescript2@^0.30.0: resolve "1.20.0" tslib "2.1.0" -rollup@^2.50.5: - version "2.50.5" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.50.5.tgz#bbee9d6411af3f5fa5c6e7e2c69f7a65b753e568" - integrity sha512-Ztz4NurU2LbS3Jn5rlhnYv35z6pkjBUmYKr94fOBIKINKRO6kug9NTFHArT7jqwMP2kqEZ39jJuEtkk91NBltQ== +rollup@^2.56.3: + version "2.56.3" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.56.3.tgz#b63edadd9851b0d618a6d0e6af8201955a77aeff" + integrity sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg== optionalDependencies: - fsevents "~2.3.1" + fsevents "~2.3.2" run-parallel@^1.1.9: version "1.2.0" @@ -1052,7 +1060,7 @@ semver@^6.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.2: +semver@^7.2.1, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -1164,7 +1172,7 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tsutils@^3.17.1: +tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== @@ -1183,15 +1191,10 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -typescript@^4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805" - integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw== +typescript@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86" + integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ== universalify@^0.1.0: version "0.1.2" diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 2f2c9f91..35e698c8 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -17,25 +17,25 @@ "test": "jest --detectOpenHandles --forceExit" }, "devDependencies": { - "@rollup/plugin-commonjs": "^19.0.0", - "@rollup/plugin-node-resolve": "^13.0.0", - "@rollup/plugin-replace": "^2.4.2", - "@types/jest": "^26.0.23", - "@typescript-eslint/eslint-plugin": "4.25.0", - "@typescript-eslint/parser": "4.25.0", - "eslint": "7.27.0", + "@rollup/plugin-commonjs": "^20.0.0", + "@rollup/plugin-node-resolve": "^13.0.4", + "@rollup/plugin-replace": "^3.0.0", + "@types/jest": "^27.0.1", + "@typescript-eslint/eslint-plugin": "4.30.0", + "@typescript-eslint/parser": "4.30.0", + "eslint": "7.32.0", "eslint-config-prettier": "8.3.0", - "eslint-plugin-prettier": "3.4.0", - "jest": "^27.0.3", - "prettier": "^2.3.0", - "rollup": "^2.50.5", + "eslint-plugin-prettier": "4.0.0", + "jest": "^27.1.0", + "prettier": "^2.3.2", + "rollup": "^2.56.3", "rollup-plugin-babel-minify": "^10.0.0", "rollup-plugin-typescript2": "^0.30.0", - "ts-jest": "^27.0.1", - "typescript": "^4.3.2" + "ts-jest": "^27.0.5", + "typescript": "^4.4.2" }, "dependencies": { "@sora/e2ee": "^2021.1.0", - "fflate": "^0.7.0" + "fflate": "^0.7.1" } } diff --git a/packages/sdk/yarn.lock b/packages/sdk/yarn.lock index b9a91280..89cd0725 100644 --- a/packages/sdk/yarn.lock +++ b/packages/sdk/yarn.lock @@ -9,32 +9,32 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" - integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== +"@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" + integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== dependencies: - "@babel/highlight" "^7.12.13" + "@babel/highlight" "^7.14.5" -"@babel/compat-data@^7.14.4": - version "7.14.4" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.4.tgz#45720fe0cecf3fd42019e1d12cc3d27fadc98d58" - integrity sha512-i2wXrWQNkH6JplJQGn3Rd2I4Pij8GdHkXwHMxm+zV5YG/Jci+bCNrWZEWC4o+umiDkRrRs4dVzH3X4GP7vyjQQ== +"@babel/compat-data@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" + integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== "@babel/core@^7.1.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.8.7": - version "7.14.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.3.tgz#5395e30405f0776067fbd9cf0884f15bfb770a38" - integrity sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.14.3" - "@babel/helper-compilation-targets" "^7.13.16" - "@babel/helper-module-transforms" "^7.14.2" - "@babel/helpers" "^7.14.0" - "@babel/parser" "^7.14.3" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.2" - "@babel/types" "^7.14.2" + version "7.15.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" + integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.4" + "@babel/helper-compilation-targets" "^7.15.4" + "@babel/helper-module-transforms" "^7.15.4" + "@babel/helpers" "^7.15.4" + "@babel/parser" "^7.15.5" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -42,137 +42,144 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.14.2", "@babel/generator@^7.14.3", "@babel/generator@^7.7.2": - version "7.14.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" - integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== +"@babel/generator@^7.15.4", "@babel/generator@^7.7.2": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" + integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== dependencies: - "@babel/types" "^7.14.2" + "@babel/types" "^7.15.4" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-compilation-targets@^7.13.16": - version "7.14.4" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.4.tgz#33ebd0ffc34248051ee2089350a929ab02f2a516" - integrity sha512-JgdzOYZ/qGaKTVkn5qEDV/SXAh8KcyUVkCoSWGN8T3bwrgd6m+/dJa2kVGi6RJYJgEYPBdZ84BZp9dUjNWkBaA== +"@babel/helper-compilation-targets@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" + integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== dependencies: - "@babel/compat-data" "^7.14.4" - "@babel/helper-validator-option" "^7.12.17" + "@babel/compat-data" "^7.15.0" + "@babel/helper-validator-option" "^7.14.5" browserslist "^4.16.6" semver "^6.3.0" -"@babel/helper-function-name@^7.14.2": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz#397688b590760b6ef7725b5f0860c82427ebaac2" - integrity sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ== - dependencies: - "@babel/helper-get-function-arity" "^7.12.13" - "@babel/template" "^7.12.13" - "@babel/types" "^7.14.2" - -"@babel/helper-get-function-arity@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" - integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-member-expression-to-functions@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" - integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== - dependencies: - "@babel/types" "^7.13.12" - -"@babel/helper-module-imports@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" - integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== - dependencies: - "@babel/types" "^7.13.12" - -"@babel/helper-module-transforms@^7.14.2": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz#ac1cc30ee47b945e3e0c4db12fa0c5389509dfe5" - integrity sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA== - dependencies: - "@babel/helper-module-imports" "^7.13.12" - "@babel/helper-replace-supers" "^7.13.12" - "@babel/helper-simple-access" "^7.13.12" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/helper-validator-identifier" "^7.14.0" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.2" - "@babel/types" "^7.14.2" - -"@babel/helper-optimise-call-expression@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" - integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.8.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" - integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== - -"@babel/helper-replace-supers@^7.13.12": - version "7.14.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.14.4.tgz#b2ab16875deecfff3ddfcd539bc315f72998d836" - integrity sha512-zZ7uHCWlxfEAAOVDYQpEf/uyi1dmeC7fX4nCf2iz9drnCwi1zvwXL3HwWWNXUQEJ1k23yVn3VbddiI9iJEXaTQ== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.13.12" - "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/traverse" "^7.14.2" - "@babel/types" "^7.14.4" - -"@babel/helper-simple-access@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" - integrity sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== - dependencies: - "@babel/types" "^7.13.12" - -"@babel/helper-split-export-declaration@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" - integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-validator-identifier@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" - integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== - -"@babel/helper-validator-option@^7.12.17": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" - integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== - -"@babel/helpers@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.0.tgz#ea9b6be9478a13d6f961dbb5f36bf75e2f3b8f62" - integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg== - dependencies: - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.0" - "@babel/types" "^7.14.0" - -"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" - integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.0" +"@babel/helper-function-name@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" + integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== + dependencies: + "@babel/helper-get-function-arity" "^7.15.4" + "@babel/template" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/helper-get-function-arity@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" + integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-hoist-variables@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" + integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-member-expression-to-functions@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" + integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-module-imports@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" + integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-module-transforms@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.4.tgz#962cc629a7f7f9a082dd62d0307fa75fe8788d7c" + integrity sha512-9fHHSGE9zTC++KuXLZcB5FKgvlV83Ox+NLUmQTawovwlJ85+QMhk1CnVk406CQVj97LaWod6KVjl2Sfgw9Aktw== + dependencies: + "@babel/helper-module-imports" "^7.15.4" + "@babel/helper-replace-supers" "^7.15.4" + "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-validator-identifier" "^7.14.9" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/helper-optimise-call-expression@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" + integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" + integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== + +"@babel/helper-replace-supers@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" + integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.15.4" + "@babel/helper-optimise-call-expression" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/helper-simple-access@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" + integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-split-export-declaration@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" + integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9": + version "7.14.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" + integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== + +"@babel/helper-validator-option@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" + integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== + +"@babel/helpers@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" + integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== + dependencies: + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.5" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.14.2", "@babel/parser@^7.14.3", "@babel/parser@^7.7.2": - version "7.14.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.4.tgz#a5c560d6db6cd8e6ed342368dea8039232cbab18" - integrity sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA== +"@babel/parser@^7.1.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.2": + version "7.15.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.5.tgz#d33a58ca69facc05b26adfe4abebfed56c1c2dac" + integrity sha512-2hQstc6I7T6tQsWzlboMh3SgMRPaS4H6H7cPQsJkdzTzEGqQrpLDsE2BGASU5sBPoEQyHzeqU6C8uKbFeEk6sg== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -259,48 +266,49 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178" - integrity sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ== + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.13.tgz#9dff111ca64154cef0f4dc52cf843d9f12ce4474" - integrity sha512-cHP3u1JiUiG2LFDKbXnwVad81GvfyIOmCD6HIEId6ojrY0Drfy2q1jw7BwN7dE84+kTnBjLkXoL3IEy/3JPu2w== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/template@^7.12.13", "@babel/template@^7.3.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" - integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/parser" "^7.12.13" - "@babel/types" "^7.12.13" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.2", "@babel/traverse@^7.7.2": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" - integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.14.2" - "@babel/helper-function-name" "^7.14.2" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.14.2" - "@babel/types" "^7.14.2" + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz#b82c6ce471b165b5ce420cf92914d6fb46225716" + integrity sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/template@^7.15.4", "@babel/template@^7.3.3": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" + integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.7.2": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" + integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.4" + "@babel/helper-function-name" "^7.15.4" + "@babel/helper-hoist-variables" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.13.12", "@babel/types@^7.14.0", "@babel/types@^7.14.2", "@babel/types@^7.14.4", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.14.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.4.tgz#bfd6980108168593b38b3eb48a24aa026b919bc0" - integrity sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw== +"@babel/types@^7.0.0", "@babel/types@^7.15.4", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.4.tgz#74eeb86dbd6748d2741396557b9860e57fce0a0d" + integrity sha512-0f1HJFuGmmbrKTCZtbm3cU+b/AqdEYk5toj5iQur58xkVMlS0JWaKxTBSmCXd47uiN7vbcozAupm6Mvs80GNhw== dependencies: - "@babel/helper-validator-identifier" "^7.14.0" + "@babel/helper-validator-identifier" "^7.14.9" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -313,21 +321,35 @@ resolved "https://registry.yarnpkg.com/@comandeer/babel-plugin-banner/-/babel-plugin-banner-5.0.0.tgz#30969cb08e810b67810d41761d0cfac292231ea9" integrity sha512-sR9Go0U6puXoXyW9UgIiIQhRcJ8jVOvGl4BptUiXAtheMs72WcakZ1udh6J0ZOivr3o8jAM+MTCHLP8FZMbVpQ== -"@eslint/eslintrc@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.1.tgz#442763b88cecbe3ee0ec7ca6d6dd6168550cbf14" - integrity sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ== +"@eslint/eslintrc@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" + integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== dependencies: ajv "^6.12.4" debug "^4.1.1" espree "^7.3.0" - globals "^12.1.0" + globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" js-yaml "^3.13.1" minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" + integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -344,94 +366,94 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.0.2.tgz#b8eeff8f21ac51d224c851e1729d2630c18631e6" - integrity sha512-/zYigssuHLImGeMAACkjI4VLAiiJznHgAl3xnFT19iWyct2LhrH3KXOjHRmxBGTkiPLZKKAJAgaPpiU9EZ9K+w== +"@jest/console@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.1.0.tgz#de13b603cb1d389b50c0dc6296e86e112381e43c" + integrity sha512-+Vl+xmLwAXLNlqT61gmHEixeRbS4L8MUzAjtpBCOPWH+izNI/dR16IeXjkXJdRtIVWVSf9DO1gdp67B1XorZhQ== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.0.2" - jest-util "^27.0.2" + jest-message-util "^27.1.0" + jest-util "^27.1.0" slash "^3.0.0" -"@jest/core@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.3.tgz#b5a38675fa0466450a7fd465f4b226762cb592a2" - integrity sha512-rN8lr/OJ8iApcQUh4khnMaOCVX4oRnLwy2tPW3Vh70y62K8Da8fhkxMUq0xX9VPa4+yWUm0tGc/jUSJi+Jzuwg== +"@jest/core@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.1.0.tgz#622220f18032f5869e579cecbe744527238648bf" + integrity sha512-3l9qmoknrlCFKfGdrmiQiPne+pUR4ALhKwFTYyOeKw6egfDwJkO21RJ1xf41rN8ZNFLg5W+w6+P4fUqq4EMRWA== dependencies: - "@jest/console" "^27.0.2" - "@jest/reporters" "^27.0.2" - "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/console" "^27.1.0" + "@jest/reporters" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.0.2" - jest-config "^27.0.3" - jest-haste-map "^27.0.2" - jest-message-util "^27.0.2" - jest-regex-util "^27.0.1" - jest-resolve "^27.0.2" - jest-resolve-dependencies "^27.0.3" - jest-runner "^27.0.3" - jest-runtime "^27.0.3" - jest-snapshot "^27.0.2" - jest-util "^27.0.2" - jest-validate "^27.0.2" - jest-watcher "^27.0.2" + jest-changed-files "^27.1.0" + jest-config "^27.1.0" + jest-haste-map "^27.1.0" + jest-message-util "^27.1.0" + jest-regex-util "^27.0.6" + jest-resolve "^27.1.0" + jest-resolve-dependencies "^27.1.0" + jest-runner "^27.1.0" + jest-runtime "^27.1.0" + jest-snapshot "^27.1.0" + jest-util "^27.1.0" + jest-validate "^27.1.0" + jest-watcher "^27.1.0" micromatch "^4.0.4" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.3.tgz#68769b1dfdd213e3456169d64fbe9bd63a5fda92" - integrity sha512-pN9m7fbKsop5vc3FOfH8NF7CKKdRbEZzcxfIo1n2TT6ucKWLFq0P6gCJH0GpnQp036++yY9utHOxpeT1WnkWTA== +"@jest/environment@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.1.0.tgz#c7224a67004759ec203d8fa44e8bc0db93f66c44" + integrity sha512-wRp50aAMY2w1U2jP1G32d6FUVBNYqmk8WaGkiIEisU48qyDV0WPtw3IBLnl7orBeggveommAkuijY+RzVnNDOQ== dependencies: - "@jest/fake-timers" "^27.0.3" - "@jest/types" "^27.0.2" + "@jest/fake-timers" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" - jest-mock "^27.0.3" + jest-mock "^27.1.0" -"@jest/fake-timers@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.3.tgz#9899ba6304cc636734c74478df502e18136461dd" - integrity sha512-fQ+UCKRIYKvTCEOyKPnaPnomLATIhMnHC/xPZ7yT1Uldp7yMgMxoYIFidDbpSTgB79+/U+FgfoD30c6wg3IUjA== +"@jest/fake-timers@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.1.0.tgz#c0b343d8a16af17eab2cb6862e319947c0ea2abe" + integrity sha512-22Zyn8il8DzpS+30jJNVbTlm7vAtnfy1aYvNeOEHloMlGy1PCYLHa4PWlSws0hvNsMM5bON6GISjkLoQUV3oMA== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" "@sinonjs/fake-timers" "^7.0.2" "@types/node" "*" - jest-message-util "^27.0.2" - jest-mock "^27.0.3" - jest-util "^27.0.2" + jest-message-util "^27.1.0" + jest-mock "^27.1.0" + jest-util "^27.1.0" -"@jest/globals@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.3.tgz#1cf8933b7791bba0b99305cbf39fd4d2e3fe4060" - integrity sha512-OzsIuf7uf+QalqAGbjClyezzEcLQkdZ+7PejUrZgDs+okdAK8GwRCGcYCirHvhMBBQh60Jr3NlIGbn/KBPQLEQ== +"@jest/globals@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.1.0.tgz#e093a49c718dd678a782c197757775534c88d3f2" + integrity sha512-73vLV4aNHAlAgjk0/QcSIzzCZSqVIPbmFROJJv9D3QUR7BI4f517gVdJpSrCHxuRH3VZFhe0yGG/tmttlMll9g== dependencies: - "@jest/environment" "^27.0.3" - "@jest/types" "^27.0.2" - expect "^27.0.2" + "@jest/environment" "^27.1.0" + "@jest/types" "^27.1.0" + expect "^27.1.0" -"@jest/reporters@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.2.tgz#ad73835d1cd54da08b0998a70b14446405e8e0d9" - integrity sha512-SVQjew/kafNxSN1my4praGQP+VPVGHsU8zqiEDppLvq6j1lryIjdNb9P+bZSsKeifU4bIoaPnf9Ui0tK9WOpFA== +"@jest/reporters@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.1.0.tgz#02ed1e6601552c2f6447378533f77aad002781d4" + integrity sha512-5T/zlPkN2HnK3Sboeg64L5eC8iiaZueLpttdktWTJsvALEtP2YMkC5BQxwjRWQACG9SwDmz+XjjkoxXUDMDgdw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.0.2" - "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/console" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -442,81 +464,70 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.0.2" - jest-resolve "^27.0.2" - jest-util "^27.0.2" - jest-worker "^27.0.2" + jest-haste-map "^27.1.0" + jest-resolve "^27.1.0" + jest-util "^27.1.0" + jest-worker "^27.1.0" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^7.0.0" + v8-to-istanbul "^8.0.0" -"@jest/source-map@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.1.tgz#2afbf73ddbaddcb920a8e62d0238a0a9e0a8d3e4" - integrity sha512-yMgkF0f+6WJtDMdDYNavmqvbHtiSpwRN2U/W+6uztgfqgkq/PXdKPqjBTUF1RD/feth4rH5N3NW0T5+wIuln1A== +"@jest/source-map@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.6.tgz#be9e9b93565d49b0548b86e232092491fb60551f" + integrity sha512-Fek4mi5KQrqmlY07T23JRi0e7Z9bXTOOD86V/uS0EIW4PClvPDqZOyFlLpNJheS6QI0FNX1CgmPjtJ4EA/2M+g== dependencies: callsites "^3.0.0" graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.2.tgz#0451049e32ceb609b636004ccc27c8fa22263f10" - integrity sha512-gcdWwL3yP5VaIadzwQtbZyZMgpmes8ryBAJp70tuxghiA8qL4imJyZex+i+USQH2H4jeLVVszhwntgdQ97fccA== +"@jest/test-result@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.1.0.tgz#9345ae5f97f6a5287af9ebd54716cd84331d42e8" + integrity sha512-Aoz00gpDL528ODLghat3QSy6UBTD5EmmpjrhZZMK/v1Q2/rRRqTGnFxHuEkrD4z/Py96ZdOHxIWkkCKRpmnE1A== dependencies: - "@jest/console" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/console" "^27.1.0" + "@jest/types" "^27.1.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.3.tgz#2a8632b86a9a6f8900e514917cdab6a062e71049" - integrity sha512-DcLTzraZ8xLr5fcIl+CF14vKeBBpBrn55wFxI9Ju+dhEBdjRdJQ/Z/pLkMehkPZWIQ+rR23J8e+wFDkfjree0Q== +"@jest/test-sequencer@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.1.0.tgz#04e8b3bd735570d3d48865e74977a14dc99bff2d" + integrity sha512-lnCWawDr6Z1DAAK9l25o3AjmKGgcutq1iIbp+hC10s/HxnB8ZkUsYq1FzjOoxxZ5hW+1+AthBtvS4x9yno3V1A== dependencies: - "@jest/test-result" "^27.0.2" + "@jest/test-result" "^27.1.0" graceful-fs "^4.2.4" - jest-haste-map "^27.0.2" - jest-runtime "^27.0.3" + jest-haste-map "^27.1.0" + jest-runtime "^27.1.0" -"@jest/transform@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.2.tgz#b073b7c589e3f4b842102468875def2bb722d6b5" - integrity sha512-H8sqKlgtDfVog/s9I4GG2XMbi4Ar7RBxjsKQDUhn2XHAi3NG+GoQwWMER+YfantzExbjNqQvqBHzo/G2pfTiPw== +"@jest/transform@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.1.0.tgz#962e385517e3d1f62827fa39c305edcc3ca8544b" + integrity sha512-ZRGCA2ZEVJ00ubrhkTG87kyLbN6n55g1Ilq0X9nJb5bX3MhMp3O6M7KG+LvYu+nZRqG5cXsQnJEdZbdpTAV8pQ== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.0.2" - jest-regex-util "^27.0.1" - jest-util "^27.0.2" + jest-haste-map "^27.1.0" + jest-regex-util "^27.0.6" + jest-util "^27.1.0" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" - integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^15.0.0" - chalk "^4.0.0" - -"@jest/types@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.0.2.tgz#e153d6c46bda0f2589f0702b071f9898c7bbd37e" - integrity sha512-XpjCtJ/99HB4PmyJ2vgmN7vT+JLP7RW1FBT9RgnMFS4Dt7cvIyBee8O3/j98aUZ34ZpenPZFqmaaObWSeL65dg== +"@jest/types@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.0.tgz#674a40325eab23c857ebc0689e7e191a3c5b10cc" + integrity sha512-pRP5cLIzN7I7Vp6mHKRSaZD7YpBTK7hawx5si8trMKqk4+WOdK8NEKOTO2G8PKWD1HbKMVckVB6/XHh/olhf2g== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -524,31 +535,31 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@nodelib/fs.scandir@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" - integrity sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA== +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== dependencies: - "@nodelib/fs.stat" "2.0.4" + "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.4", "@nodelib/fs.stat@^2.0.2": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" - integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== "@nodelib/fs.walk@^1.2.3": - version "1.2.6" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" - integrity sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow== + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: - "@nodelib/fs.scandir" "2.1.4" + "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@rollup/plugin-commonjs@^19.0.0": - version "19.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.0.tgz#8c3e71f9a66908e60d70cc1be205834ef3e45f71" - integrity sha512-adTpD6ATGbehdaQoZQ6ipDFhdjqsTgpOAhFiPwl+dzre4pPshsecptDPyEFb61JMJ1+mGljktaC4jI8ARMSNyw== +"@rollup/plugin-commonjs@^20.0.0": + version "20.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-20.0.0.tgz#3246872dcbcb18a54aaa6277a8c7d7f1b155b745" + integrity sha512-5K0g5W2Ol8hAcTHqcTBHiA7M58tfmYi1o9KxeJuuRNpGaTa5iLjcyemBitCBcKXaHamOBBEH2dGom6v6Unmqjg== dependencies: "@rollup/pluginutils" "^3.1.0" commondir "^1.0.1" @@ -558,10 +569,10 @@ magic-string "^0.25.7" resolve "^1.17.0" -"@rollup/plugin-node-resolve@^13.0.0": - version "13.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.0.tgz#352f07e430ff377809ec8ec8a6fd636547162dc4" - integrity sha512-41X411HJ3oikIDivT5OKe9EZ6ud6DXudtfNrGbC4nniaxx2esiWjkLOzgnZsWq1IM8YIeL2rzRGLZLBjlhnZtQ== +"@rollup/plugin-node-resolve@^13.0.4": + version "13.0.4" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.4.tgz#b10222f4145a019740acb7738402130d848660c0" + integrity sha512-eYq4TFy40O8hjeDs+sIxEH/jc9lyuI2k9DM557WN6rO5OpnC2qXMBNj4IKH1oHrnAazL49C5p0tgP0/VpqJ+/w== dependencies: "@rollup/pluginutils" "^3.1.0" "@types/resolve" "1.17.1" @@ -570,10 +581,10 @@ is-module "^1.0.0" resolve "^1.19.0" -"@rollup/plugin-replace@^2.4.2": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" - integrity sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg== +"@rollup/plugin-replace@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-3.0.0.tgz#3a4c9665d4e7a4ce2c360cf021232784892f3fac" + integrity sha512-3c7JCbMuYXM4PbPWT4+m/4Y6U60SgsnDT/cCyAyUKwFHg7pTSfsSQzIpETha3a3ig6OdOKzZz87D9ZXIK3qsDg== dependencies: "@rollup/pluginutils" "^3.1.0" magic-string "^0.25.7" @@ -588,9 +599,9 @@ picomatch "^2.2.2" "@rollup/pluginutils@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.0.tgz#0dcc61c780e39257554feb7f77207dceca13c838" - integrity sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ== + version "4.1.1" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" + integrity sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ== dependencies: estree-walker "^2.0.1" picomatch "^2.2.2" @@ -615,9 +626,9 @@ integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": - version "7.1.14" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz#faaeefc4185ec71c389f4501ee5ec84b170cc402" - integrity sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g== + version "7.1.15" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.15.tgz#2ccfb1ad55a02c83f8e0ad327cbc332f55eb1024" + integrity sha512-bxlMKPDbY8x5h6HBwVzEOk2C8fb6SLfYQ5Jw3uBYuYF1lfWk/kbLd81la82vrIkBb0l+JdmrZaDikPrNxpS/Ew== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -626,31 +637,31 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.2.tgz#f3d71178e187858f7c45e30380f8f1b7415a12d8" - integrity sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ== + version "7.6.3" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.3.tgz#f456b4b2ce79137f768aa130d2423d2f0ccfaba5" + integrity sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.0.tgz#0c888dd70b3ee9eebb6e4f200e809da0076262be" - integrity sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A== + version "7.4.1" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" + integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.11.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.1.tgz#654f6c4f67568e24c23b367e947098c6206fa639" - integrity sha512-Vs0hm0vPahPMYi9tDjtP66llufgO3ST16WXaSTtDGEl9cewAl3AibmxWw6TINOqHPT9z0uABKAYjT9jNSg4npw== + version "7.14.2" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43" + integrity sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA== dependencies: "@babel/types" "^7.3.0" "@types/estree@*": - version "0.0.47" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.47.tgz#d7a51db20f0650efec24cd04994f523d93172ed4" - integrity sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg== + version "0.0.50" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== "@types/estree@0.0.39": version "0.0.39" @@ -677,34 +688,34 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz#508b13aa344fa4976234e75dddcc34925737d821" - integrity sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA== + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" + integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^26.0.23": - version "26.0.23" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.23.tgz#a1b7eab3c503b80451d019efb588ec63522ee4e7" - integrity sha512-ZHLmWMJ9jJ9PTiT58juykZpL7KjwJywFN3Rr2pTSkyQfydf/rk22yS7W8p5DaVUMQ2BQC7oYiU3FjbTM/mYrOA== +"@types/jest@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.1.tgz#fafcc997da0135865311bb1215ba16dba6bdf4ca" + integrity sha512-HTLpVXHrY69556ozYkcq47TtQJXpcWAWfkoqz+ZGz2JnmZhzlRjprCIyFnetSy8gpDWwTTGBcRVv1J1I1vBrHw== dependencies: - jest-diff "^26.0.0" - pretty-format "^26.0.0" + jest-diff "^27.0.0" + pretty-format "^27.0.0" -"@types/json-schema@^7.0.3": - version "7.0.7" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" - integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== +"@types/json-schema@^7.0.7": + version "7.0.9" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== "@types/node@*": - version "15.6.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.6.1.tgz#32d43390d5c62c5b6ec486a9bc9c59544de39a08" - integrity sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA== + version "16.7.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.10.tgz#7aa732cc47341c12a16b7d562f519c2383b6d4fc" + integrity sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA== "@types/prettier@^2.1.5": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" - integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== + version "2.3.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" + integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== "@types/resolve@1.17.1": version "1.17.1" @@ -714,97 +725,89 @@ "@types/node" "*" "@types/stack-utils@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" - integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" + integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/yargs-parser@*": - version "20.2.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" - integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== - -"@types/yargs@^15.0.0": - version "15.0.13" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.13.tgz#34f7fec8b389d7f3c1fd08026a5763e072d3c6dc" - integrity sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ== - dependencies: - "@types/yargs-parser" "*" + version "20.2.1" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" + integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== "@types/yargs@^16.0.0": - version "16.0.3" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.3.tgz#4b6d35bb8e680510a7dc2308518a80ee1ef27e01" - integrity sha512-YlFfTGS+zqCgXuXNV26rOIeETOkXnGQXP/pjjL9P0gO/EP9jTmc7pUBhx+jVEIxpq41RX33GQ7N3DzOSfZoglQ== + version "16.0.4" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" + integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.25.0.tgz#d82657b6ab4caa4c3f888ff923175fadc2f31f2a" - integrity sha512-Qfs3dWkTMKkKwt78xp2O/KZQB8MPS1UQ5D3YW2s6LQWBE1074BE+Rym+b1pXZIX3M3fSvPUDaCvZLKV2ylVYYQ== +"@typescript-eslint/eslint-plugin@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz#4a0c1ae96b953f4e67435e20248d812bfa55e4fb" + integrity sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g== dependencies: - "@typescript-eslint/experimental-utils" "4.25.0" - "@typescript-eslint/scope-manager" "4.25.0" - debug "^4.1.1" + "@typescript-eslint/experimental-utils" "4.30.0" + "@typescript-eslint/scope-manager" "4.30.0" + debug "^4.3.1" functional-red-black-tree "^1.0.1" - lodash "^4.17.15" - regexpp "^3.0.0" - semver "^7.3.2" - tsutils "^3.17.1" - -"@typescript-eslint/experimental-utils@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.25.0.tgz#b2febcfa715d2c1806fd5f0335193a6cd270df54" - integrity sha512-f0doRE76vq7NEEU0tw+ajv6CrmPelw5wLoaghEHkA2dNLFb3T/zJQqGPQ0OYt5XlZaS13MtnN+GTPCuUVg338w== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.25.0" - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/typescript-estree" "4.25.0" - eslint-scope "^5.0.0" - eslint-utils "^2.0.0" - -"@typescript-eslint/parser@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.25.0.tgz#6b2cb6285aa3d55bfb263c650739091b0f19aceb" - integrity sha512-OZFa1SKyEJpAhDx8FcbWyX+vLwh7OEtzoo2iQaeWwxucyfbi0mT4DijbOSsTgPKzGHr6GrF2V5p/CEpUH/VBxg== - dependencies: - "@typescript-eslint/scope-manager" "4.25.0" - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/typescript-estree" "4.25.0" - debug "^4.1.1" - -"@typescript-eslint/scope-manager@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.25.0.tgz#9d86a5bcc46ef40acd03d85ad4e908e5aab8d4ca" - integrity sha512-2NElKxMb/0rya+NJG1U71BuNnp1TBd1JgzYsldsdA83h/20Tvnf/HrwhiSlNmuq6Vqa0EzidsvkTArwoq+tH6w== - dependencies: - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/visitor-keys" "4.25.0" - -"@typescript-eslint/types@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.25.0.tgz#0e444a5c5e3c22d7ffa5e16e0e60510b3de5af87" - integrity sha512-+CNINNvl00OkW6wEsi32wU5MhHti2J25TJsJJqgQmJu3B3dYDBcmOxcE5w9cgoM13TrdE/5ND2HoEnBohasxRQ== - -"@typescript-eslint/typescript-estree@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.25.0.tgz#942e4e25888736bff5b360d9b0b61e013d0cfa25" - integrity sha512-1B8U07TGNAFMxZbSpF6jqiDs1cVGO0izVkf18Q/SPcUAc9LhHxzvSowXDTvkHMWUVuPpagupaW63gB6ahTXVlg== - dependencies: - "@typescript-eslint/types" "4.25.0" - "@typescript-eslint/visitor-keys" "4.25.0" - debug "^4.1.1" - globby "^11.0.1" + regexpp "^3.1.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/experimental-utils@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz#9e49704fef568432ae16fc0d6685c13d67db0fd5" + integrity sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw== + dependencies: + "@types/json-schema" "^7.0.7" + "@typescript-eslint/scope-manager" "4.30.0" + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/typescript-estree" "4.30.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.30.0.tgz#6abd720f66bd790f3e0e80c3be77180c8fcb192d" + integrity sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg== + dependencies: + "@typescript-eslint/scope-manager" "4.30.0" + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/typescript-estree" "4.30.0" + debug "^4.3.1" + +"@typescript-eslint/scope-manager@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz#1a3ffbb385b1a06be85cd5165a22324f069a85ee" + integrity sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A== + dependencies: + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/visitor-keys" "4.30.0" + +"@typescript-eslint/types@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.30.0.tgz#fb9d9b0358426f18687fba82eb0b0f869780204f" + integrity sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw== + +"@typescript-eslint/typescript-estree@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz#ae57833da72a753f4846cd3053758c771670c2ac" + integrity sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg== + dependencies: + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/visitor-keys" "4.30.0" + debug "^4.3.1" + globby "^11.0.3" is-glob "^4.0.1" - semver "^7.3.2" - tsutils "^3.17.1" + semver "^7.3.5" + tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.25.0": - version "4.25.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.25.0.tgz#863e7ed23da4287c5b469b13223255d0fde6aaa7" - integrity sha512-AmkqV9dDJVKP/TcZrbf6s6i1zYXt5Hl8qOLrRDTFfRNae4+LB8A4N3i+FLZPW85zIxRy39BgeWOfMS3HoH5ngg== +"@typescript-eslint/visitor-keys@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz#a47c6272fc71b0c627d1691f68eaecf4ad71445e" + integrity sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw== dependencies: - "@typescript-eslint/types" "4.25.0" + "@typescript-eslint/types" "4.30.0" eslint-visitor-keys "^2.0.0" abab@^2.0.3, abab@^2.0.5: @@ -821,9 +824,9 @@ acorn-globals@^6.0.0: acorn-walk "^7.1.1" acorn-jsx@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-walk@^7.1.1: version "7.2.0" @@ -836,9 +839,9 @@ acorn@^7.1.1, acorn@^7.4.0: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.2.4: - version "8.2.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.4.tgz#caba24b08185c3b56e3168e97d15ed17f4d31fd0" - integrity sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg== + version "8.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c" + integrity sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA== agent-base@6: version "6.0.2" @@ -858,9 +861,9 @@ ajv@^6.10.0, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.5.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.5.0.tgz#695528274bcb5afc865446aa275484049a18ae4b" - integrity sha512-Y2l399Tt1AguU3BPRP9Fn4eN+Or+StUGWCUpbnFyXSo8NZ9S4uj+AG2pjs5apK+ZMOwYOz1+a+VKvKH7CudXgQ== + version "8.6.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.2.tgz#2fb45e0e5fcbc0813326c1c3da535d1881bb0571" + integrity sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -968,16 +971,16 @@ babel-helper-to-multiple-sequence-expressions@^0.5.0: resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" integrity sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA== -babel-jest@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.2.tgz#7dc18adb01322acce62c2af76ea2c7cd186ade37" - integrity sha512-9OThPl3/IQbo4Yul2vMz4FYwILPQak8XelX4YGowygfHaOl5R5gfjm4iVx4d8aUugkW683t8aq0A74E7b5DU1Q== +babel-jest@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.1.0.tgz#e96ca04554fd32274439869e2b6d24de9d91bc4e" + integrity sha512-6NrdqzaYemALGCuR97QkC/FkFIEBWP5pw5TMJoUHZTVXyOgocujp6A0JE2V6gE0HtqAAv6VKU/nI+OCR1Z4gHA== dependencies: - "@jest/transform" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^27.0.1" + babel-preset-jest "^27.0.6" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -993,10 +996,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.1.tgz#a6d10e484c93abff0f4e95f437dad26e5736ea11" - integrity sha512-sqBF0owAcCDBVEDtxqfYr2F36eSHdx7lAVGyYuOBRnKdD6gzcy0I0XrAYCZgOA3CRrLhmR+Uae9nogPzmAtOfQ== +babel-plugin-jest-hoist@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.6.tgz#f7c6b3d764af21cb4a2a1ab6870117dbde15b456" + integrity sha512-CewFeM9Vv2gM7Yr9n5eyyLVPRSiBnk6lKZRjgwYnGKSl9M14TMn2vkN02wTF04OGuSDLEzlWiMzvjXuW9mB6Gw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -1156,12 +1159,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.1.tgz#7a50c75d16647c23a2cf5158d5bb9eb206b10e20" - integrity sha512-nIBIqCEpuiyhvjQs2mVNwTxQQa2xk70p9Dd/0obQGBf8FBzbnI8QhQKzLsWMN2i6q+5B0OcWDtrboBX5gmOLyA== +babel-preset-jest@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.6.tgz#909ef08e9f24a4679768be2f60a3df0856843f9d" + integrity sha512-WObA0/Biw2LrVVwZkF/2GqbOdzhKD6Fkdwhoy9ASIrOWr/zodcSpQh72JOkEn6NWyjmnPDjNSqaGN4KnpKzhXw== dependencies: - babel-plugin-jest-hoist "^27.0.1" + babel-plugin-jest-hoist "^27.0.6" babel-preset-current-node-syntax "^1.0.0" babel-preset-minify@^0.5.1: @@ -1219,15 +1222,15 @@ browser-process-hrtime@^1.0.0: integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserslist@^4.16.6: - version "4.16.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" - integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== + version "4.17.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.0.tgz#1fcd81ec75b41d6d4994fb0831b92ac18c01649c" + integrity sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g== dependencies: - caniuse-lite "^1.0.30001219" - colorette "^1.2.2" - electron-to-chromium "^1.3.723" + caniuse-lite "^1.0.30001254" + colorette "^1.3.0" + electron-to-chromium "^1.3.830" escalade "^3.1.1" - node-releases "^1.1.71" + node-releases "^1.1.75" bs-logger@0.x: version "0.2.6" @@ -1243,10 +1246,10 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" -buffer-from@1.x, buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== builtin-modules@^3.1.0: version "3.2.0" @@ -1268,10 +1271,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001219: - version "1.0.30001230" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz#8135c57459854b2240b57a4a6786044bdc5a9f71" - integrity sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ== +caniuse-lite@^1.0.30001254: + version "1.0.30001255" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001255.tgz#f3b09b59ab52e39e751a569523618f47c4298ca0" + integrity sha512-F+A3N9jTZL882f/fg/WWVnKSu6IOo3ueLz4zwaOPbPYHNmM/ZaDUyzyJwS1mZhX7Ex5jqTyW599Gdelh5PDYLQ== chalk@^2.0.0: version "2.4.2" @@ -1283,9 +1286,9 @@ chalk@^2.0.0: supports-color "^5.3.0" chalk@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" - integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -1301,9 +1304,9 @@ ci-info@^3.1.1: integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== cjs-module-lexer@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.1.tgz#2fd46d9906a126965aa541345c499aaa18e8cd73" - integrity sha512-jVamGdJPDeuQilKhvVn1h3knuMOZzr8QDnpk+M9aMlCaMkTDd6fBWPhiDqFvFZ07pL0liqabAiuy8SY4jGHeaw== + version "1.2.2" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" + integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== cliui@^7.0.2: version "7.0.4" @@ -1348,10 +1351,10 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" - integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== +colorette@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.3.0.tgz#ff45d2f0edb244069d3b772adeb04fed38d0a0af" + integrity sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w== combined-stream@^1.0.8: version "1.0.8" @@ -1371,9 +1374,9 @@ concat-map@0.0.1: integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + version "1.8.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" + integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== dependencies: safe-buffer "~5.1.1" @@ -1412,17 +1415,17 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== dependencies: ms "2.1.2" decimal.js@^10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" - integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== + version "10.3.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" + integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== dedent@^0.7.0: version "0.7.0" @@ -1430,9 +1433,9 @@ dedent@^0.7.0: integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= deep-is@^0.1.3, deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.2.2: version "4.2.2" @@ -1449,15 +1452,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" - integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== - -diff-sequences@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.1.tgz#9c9801d52ed5f576ff0a20e3022a13ee6e297e7c" - integrity sha512-XPLijkfJUh/PIBnfkcSHgvD6tlYixmcMAn3osTk6jt+H0v/mgURto1XUiD9DKuGX5NDoVS6dSlA23gd9FUaCFg== +diff-sequences@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" + integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== dir-glob@^3.0.1: version "3.0.1" @@ -1480,10 +1478,10 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -electron-to-chromium@^1.3.723: - version "1.3.742" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.742.tgz#7223215acbbd3a5284962ebcb6df85d88b95f200" - integrity sha512-ihL14knI9FikJmH2XUIDdZFWJxvr14rPSdOhJ7PpS27xbz8qmaRwCwyg/bmFwjWKmWK9QyamiCZVCvXm5CH//Q== +electron-to-chromium@^1.3.830: + version "1.3.830" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.830.tgz#40e3144204f8ca11b2cebec83cf14c20d3499236" + integrity sha512-gBN7wNAxV5vl1430dG+XRcQhD4pIeYeak6p6rjdCtlz5wWNwDad8jwvphe5oi1chL5MV6RNRikfffBBiFuj+rQ== emittery@^0.8.1: version "0.8.1" @@ -1539,14 +1537,14 @@ eslint-config-prettier@8.3.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== -eslint-plugin-prettier@3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7" - integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw== +eslint-plugin-prettier@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" + integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== dependencies: prettier-linter-helpers "^1.0.0" -eslint-scope@^5.0.0, eslint-scope@^5.1.1: +eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -1554,13 +1552,20 @@ eslint-scope@^5.0.0, eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-utils@^2.0.0, eslint-utils@^2.1.0: +eslint-utils@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: eslint-visitor-keys "^1.1.0" +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" @@ -1571,13 +1576,14 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint@7.27.0: - version "7.27.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.27.0.tgz#665a1506d8f95655c9274d84bd78f7166b07e9c7" - integrity sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA== +eslint@7.32.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" + integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== dependencies: "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.1" + "@eslint/eslintrc" "^0.4.3" + "@humanwhocodes/config-array" "^0.5.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1594,7 +1600,7 @@ eslint@7.27.0: fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" + glob-parent "^5.1.2" globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" @@ -1670,9 +1676,9 @@ esutils@^2.0.2: integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== execa@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.1.tgz#aee63b871c9b2cb56bc9addcd3c70a785c6bf0d1" - integrity sha512-4hFTjFbFzQa3aCLobpbPJR/U+VoL1wdV5ozOWjeet0AWDeYr9UFGM1eUFWHX+VtOWFq4p0xXUXfW1YxUaP4fpw== + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== dependencies: cross-spawn "^7.0.3" get-stream "^6.0.0" @@ -1689,17 +1695,17 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.2.tgz#e66ca3a4c9592f1c019fa1d46459a9d2084f3422" - integrity sha512-YJFNJe2+P2DqH+ZrXy+ydRQYO87oxRUonZImpDodR1G7qo3NYd3pL+NQ9Keqpez3cehczYwZDBC3A7xk3n7M/w== +expect@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.1.0.tgz#380de0abb3a8f2299c4c6c66bbe930483b5dba9b" + integrity sha512-9kJngV5hOJgkFil4F/uXm3hVBubUK2nERVfvqNNwxxuW8ZOUwSTTSysgfzckYtv/LBzj/LJXbiAF7okHCXgdug== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" ansi-styles "^5.0.0" - jest-get-type "^27.0.1" - jest-matcher-utils "^27.0.2" - jest-message-util "^27.0.2" - jest-regex-util "^27.0.1" + jest-get-type "^27.0.6" + jest-matcher-utils "^27.1.0" + jest-message-util "^27.1.0" + jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1712,16 +1718,15 @@ fast-diff@^1.1.2: integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== fast-glob@^3.1.1: - version "3.2.5" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" - integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== + version "3.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" + integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.0" + glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.2" - picomatch "^2.2.1" + micromatch "^4.0.4" fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" @@ -1734,9 +1739,9 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastq@^1.6.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" - integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== + version "1.12.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.12.0.tgz#ed7b6ab5d62393fb2cc591c853652a5c318bf794" + integrity sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg== dependencies: reusify "^1.0.4" @@ -1747,10 +1752,10 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fflate@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.7.0.tgz#b589a7ec7cb4ea989573d1063777a355606b4fe1" - integrity sha512-rL8N1NGlP36Hj8S+h6cyQs1RLKNp40e+BjAelaT738RrhSr9Ud99imQ2be9OYrCsIlnVcTM/Ru6c01YN5cK+dQ== +fflate@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.7.1.tgz#56e87e87c3f2fe01b025fbb1c4ea835990c02fa2" + integrity sha512-VYM2Xy1gSA5MerKzCnmmuV2XljkpKwgJBKezW+495TTnTCh1x5HcYa1aH8wRU/MfTGhW4ziXqgwprgQUVl3Ohw== file-entry-cache@^6.0.1: version "6.0.1" @@ -1767,9 +1772,9 @@ fill-range@^7.0.1: to-regex-range "^5.0.1" find-cache-dir@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" - integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== + version "3.3.2" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" + integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== dependencies: commondir "^1.0.1" make-dir "^3.0.2" @@ -1792,9 +1797,9 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" - integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== + version "3.2.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" + integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== form-data@^3.0.0: version "3.0.1" @@ -1819,7 +1824,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^2.3.2, fsevents@~2.3.1: +fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -1854,7 +1859,7 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-parent@^5.0.0, glob-parent@^5.1.0: +glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -1878,24 +1883,17 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - dependencies: - type-fest "^0.8.1" - -globals@^13.6.0: - version "13.9.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.9.0.tgz#4bf2bf635b334a173fb1daf7c5e6b218ecdc06cb" - integrity sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA== +globals@^13.6.0, globals@^13.9.0: + version "13.11.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" + integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== dependencies: type-fest "^0.20.2" -globby@^11.0.1: - version "11.0.3" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" - integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== +globby@^11.0.3: + version "11.0.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" @@ -1905,9 +1903,9 @@ globby@^11.0.1: slash "^3.0.0" graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== + version "4.2.8" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== has-flag@^3.0.0: version "3.0.0" @@ -2019,9 +2017,9 @@ is-ci@^3.0.0: ci-info "^3.1.1" is-core-module@^2.2.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" - integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== + version "2.6.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" + integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== dependencies: has "^1.0.3" @@ -2070,9 +2068,9 @@ is-reference@^1.2.1: "@types/estree" "*" is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== is-typedarray@^1.0.0: version "1.0.0" @@ -2125,241 +2123,226 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.0.2.tgz#997253042b4a032950fc5f56abf3c5d1f8560801" - integrity sha512-eMeb1Pn7w7x3wue5/vF73LPCJ7DKQuC9wQUR5ebP9hDPpk5hzcT/3Hmz3Q5BOFpR3tgbmaWhJcMTVgC8Z1NuMw== +jest-changed-files@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.1.0.tgz#42da6ea00f06274172745729d55f42b60a9dffe0" + integrity sha512-eRcb13TfQw0xiV2E98EmiEgs9a5uaBIqJChyl0G7jR9fCIvGjXovnDS6Zbku3joij4tXYcSK4SE1AXqOlUxjWg== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.3.tgz#32006967de484e03589da944064d72e172ce3261" - integrity sha512-tdMfzs7SgD5l7jRcI1iB3vtQi5fHwCgo4RlO8bzZnYc05PZ+tlAOMZeS8eGYkZ2tPaRY/aRLMFWQp/8zXBrolQ== +jest-circus@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.1.0.tgz#24c280c90a625ea57da20ee231d25b1621979a57" + integrity sha512-6FWtHs3nZyZlMBhRf1wvAC5CirnflbGJAY1xssSAnERLiiXQRH+wY2ptBVtXjX4gz4AA2EwRV57b038LmifRbA== dependencies: - "@jest/environment" "^27.0.3" - "@jest/test-result" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/environment" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.0.2" + expect "^27.1.0" is-generator-fn "^2.0.0" - jest-each "^27.0.2" - jest-matcher-utils "^27.0.2" - jest-message-util "^27.0.2" - jest-runtime "^27.0.3" - jest-snapshot "^27.0.2" - jest-util "^27.0.2" - pretty-format "^27.0.2" + jest-each "^27.1.0" + jest-matcher-utils "^27.1.0" + jest-message-util "^27.1.0" + jest-runtime "^27.1.0" + jest-snapshot "^27.1.0" + jest-util "^27.1.0" + pretty-format "^27.1.0" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.3.tgz#b733871acb526054a0f8c971d0466595c5f8316d" - integrity sha512-7bt9Sgv4nWH5pUnyJfdLf8CHWfo4+7lSPxeBwQx4r0vBj9jweJam/piE2U91SXtQI+ckm+TIN97OVnqIYpVhSg== +jest-cli@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.1.0.tgz#118438e4d11cf6fb66cb2b2eb5778817eab3daeb" + integrity sha512-h6zPUOUu+6oLDrXz0yOWY2YXvBLk8gQinx4HbZ7SF4V3HzasQf+ncoIbKENUMwXyf54/6dBkYXvXJos+gOHYZw== dependencies: - "@jest/core" "^27.0.3" - "@jest/test-result" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/core" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/types" "^27.1.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.0.3" - jest-util "^27.0.2" - jest-validate "^27.0.2" + jest-config "^27.1.0" + jest-util "^27.1.0" + jest-validate "^27.1.0" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.3.tgz#31871583573c6d669dcdb5bb2d1a8738f3b91c20" - integrity sha512-zgtI2YQo+ekKsmYNyDlXFY/7w7WWBSJFoj/WRe173WB88CDUrEYWr0sLdbLOQe+sRu6l1Y2S0MCS6BOJm5jkoA== +jest-config@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.1.0.tgz#e6826e2baaa34c07c3839af86466870e339d9ada" + integrity sha512-GMo7f76vMYUA3b3xOdlcKeKQhKcBIgurjERO2hojo0eLkKPGcw7fyIoanH+m6KOP2bLad+fGnF8aWOJYxzNPeg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.0.3" - "@jest/types" "^27.0.2" - babel-jest "^27.0.2" + "@jest/test-sequencer" "^27.1.0" + "@jest/types" "^27.1.0" + babel-jest "^27.1.0" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.0.3" - jest-environment-jsdom "^27.0.3" - jest-environment-node "^27.0.3" - jest-get-type "^27.0.1" - jest-jasmine2 "^27.0.3" - jest-regex-util "^27.0.1" - jest-resolve "^27.0.2" - jest-runner "^27.0.3" - jest-util "^27.0.2" - jest-validate "^27.0.2" + jest-circus "^27.1.0" + jest-environment-jsdom "^27.1.0" + jest-environment-node "^27.1.0" + jest-get-type "^27.0.6" + jest-jasmine2 "^27.1.0" + jest-regex-util "^27.0.6" + jest-resolve "^27.1.0" + jest-runner "^27.1.0" + jest-util "^27.1.0" + jest-validate "^27.1.0" micromatch "^4.0.4" - pretty-format "^27.0.2" + pretty-format "^27.1.0" -jest-diff@^26.0.0: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" - integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== +jest-diff@^27.0.0, jest-diff@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.1.0.tgz#c7033f25add95e2218f3c7f4c3d7b634ab6b3cd2" + integrity sha512-rjfopEYl58g/SZTsQFmspBODvMSytL16I+cirnScWTLkQVXYVZfxm78DFfdIIXc05RCYuGjxJqrdyG4PIFzcJg== dependencies: chalk "^4.0.0" - diff-sequences "^26.6.2" - jest-get-type "^26.3.0" - pretty-format "^26.6.2" + diff-sequences "^27.0.6" + jest-get-type "^27.0.6" + pretty-format "^27.1.0" -jest-diff@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.2.tgz#f315b87cee5dc134cf42c2708ab27375cc3f5a7e" - integrity sha512-BFIdRb0LqfV1hBt8crQmw6gGQHVDhM87SpMIZ45FPYKReZYG5er1+5pIn2zKqvrJp6WNox0ylR8571Iwk2Dmgw== - dependencies: - chalk "^4.0.0" - diff-sequences "^27.0.1" - jest-get-type "^27.0.1" - pretty-format "^27.0.2" - -jest-docblock@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.1.tgz#bd9752819b49fa4fab1a50b73eb58c653b962e8b" - integrity sha512-TA4+21s3oebURc7VgFV4r7ltdIJ5rtBH1E3Tbovcg7AV+oLfD5DcJ2V2vJ5zFA9sL5CFd/d2D6IpsAeSheEdrA== +jest-docblock@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" + integrity sha512-Fid6dPcjwepTFraz0YxIMCi7dejjJ/KL9FBjPYhBp4Sv1Y9PdhImlKZqYU555BlN4TQKaTc+F2Av1z+anVyGkA== dependencies: detect-newline "^3.0.0" -jest-each@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.2.tgz#865ddb4367476ced752167926b656fa0dcecd8c7" - integrity sha512-OLMBZBZ6JkoXgUenDtseFRWA43wVl2BwmZYIWQws7eS7pqsIvePqj/jJmEnfq91ALk3LNphgwNK/PRFBYi7ITQ== +jest-each@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.1.0.tgz#36ac75f7aeecb3b8da2a8e617ccb30a446df408c" + integrity sha512-K/cNvQlmDqQMRHF8CaQ0XPzCfjP5HMJc2bIJglrIqI9fjwpNqITle63IWE+wq4p+3v+iBgh7Wq0IdGpLx5xjDg== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" chalk "^4.0.0" - jest-get-type "^27.0.1" - jest-util "^27.0.2" - pretty-format "^27.0.2" - -jest-environment-jsdom@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.3.tgz#ed73e913ddc03864eb9f934b5cbabf1b63504e2e" - integrity sha512-5KLmgv1bhiimpSA8oGTnZYk6g4fsNyZiA/6gI2tAZUgrufd7heRUSVh4gRokzZVEj8zlwAQYT0Zs6tuJSW/ECA== - dependencies: - "@jest/environment" "^27.0.3" - "@jest/fake-timers" "^27.0.3" - "@jest/types" "^27.0.2" + jest-get-type "^27.0.6" + jest-util "^27.1.0" + pretty-format "^27.1.0" + +jest-environment-jsdom@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.1.0.tgz#5fb3eb8a67e02e6cc623640388d5f90e33075f18" + integrity sha512-JbwOcOxh/HOtsj56ljeXQCUJr3ivnaIlM45F5NBezFLVYdT91N5UofB1ux2B1CATsQiudcHdgTaeuqGXJqjJYQ== + dependencies: + "@jest/environment" "^27.1.0" + "@jest/fake-timers" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" - jest-mock "^27.0.3" - jest-util "^27.0.2" + jest-mock "^27.1.0" + jest-util "^27.1.0" jsdom "^16.6.0" -jest-environment-node@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.3.tgz#b4acb3679d2552a4215732cab8b0ca7ec4398ee0" - integrity sha512-co2/IVnIFL3cItpFULCvXFg9us4gvWXgs7mutAMPCbFhcqh56QAOdKhNzC2+RycsC/k4mbMj1VF+9F/NzA0ROg== +jest-environment-node@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.1.0.tgz#feea6b765f1fd4582284d4f1007df2b0a8d15b7f" + integrity sha512-JIyJ8H3wVyM4YCXp7njbjs0dIT87yhGlrXCXhDKNIg1OjurXr6X38yocnnbXvvNyqVTqSI4M9l+YfPKueqL1lw== dependencies: - "@jest/environment" "^27.0.3" - "@jest/fake-timers" "^27.0.3" - "@jest/types" "^27.0.2" + "@jest/environment" "^27.1.0" + "@jest/fake-timers" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" - jest-mock "^27.0.3" - jest-util "^27.0.2" + jest-mock "^27.1.0" + jest-util "^27.1.0" -jest-get-type@^26.3.0: - version "26.3.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" - integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== +jest-get-type@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" + integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-get-type@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.1.tgz#34951e2b08c8801eb28559d7eb732b04bbcf7815" - integrity sha512-9Tggo9zZbu0sHKebiAijyt1NM77Z0uO4tuWOxUCujAiSeXv30Vb5D4xVF4UR4YWNapcftj+PbByU54lKD7/xMg== - -jest-haste-map@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.2.tgz#3f1819400c671237e48b4d4b76a80a0dbed7577f" - integrity sha512-37gYfrYjjhEfk37C4bCMWAC0oPBxDpG0qpl8lYg8BT//wf353YT/fzgA7+Dq0EtM7rPFS3JEcMsxdtDwNMi2cA== +jest-haste-map@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.1.0.tgz#a39f456823bd6a74e3c86ad25f6fa870428326bf" + integrity sha512-7mz6LopSe+eA6cTFMf10OfLLqRoIPvmMyz5/OnSXnHO7hB0aDP1iIeLWCXzAcYU5eIJVpHr12Bk9yyq2fTW9vg== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.4" - jest-regex-util "^27.0.1" - jest-serializer "^27.0.1" - jest-util "^27.0.2" - jest-worker "^27.0.2" + jest-regex-util "^27.0.6" + jest-serializer "^27.0.6" + jest-util "^27.1.0" + jest-worker "^27.1.0" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.3.tgz#fa6f6499566ea1b01b68b3ad13f49d1592b02c85" - integrity sha512-odJ2ia8P5c+IsqOcWJPmku4AqbXIfTVLRjYTKHri3TEvbmTdLw0ghy13OAPIl/0v7cVH0TURK7+xFOHKDLvKIA== +jest-jasmine2@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.1.0.tgz#324a3de0b2ee20d238b2b5b844acc4571331a206" + integrity sha512-Z/NIt0wBDg3przOW2FCWtYjMn3Ip68t0SL60agD/e67jlhTyV3PIF8IzT9ecwqFbeuUSO2OT8WeJgHcalDGFzQ== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.0.3" - "@jest/source-map" "^27.0.1" - "@jest/test-result" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/environment" "^27.1.0" + "@jest/source-map" "^27.0.6" + "@jest/test-result" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.0.2" + expect "^27.1.0" is-generator-fn "^2.0.0" - jest-each "^27.0.2" - jest-matcher-utils "^27.0.2" - jest-message-util "^27.0.2" - jest-runtime "^27.0.3" - jest-snapshot "^27.0.2" - jest-util "^27.0.2" - pretty-format "^27.0.2" + jest-each "^27.1.0" + jest-matcher-utils "^27.1.0" + jest-message-util "^27.1.0" + jest-runtime "^27.1.0" + jest-snapshot "^27.1.0" + jest-util "^27.1.0" + pretty-format "^27.1.0" throat "^6.0.1" -jest-leak-detector@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.2.tgz#ce19aa9dbcf7a72a9d58907a970427506f624e69" - integrity sha512-TZA3DmCOfe8YZFIMD1GxFqXUkQnIoOGQyy4hFCA2mlHtnAaf+FeOMxi0fZmfB41ZL+QbFG6BVaZF5IeFIVy53Q== +jest-leak-detector@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.1.0.tgz#fe7eb633c851e06280ec4dd248067fe232c00a79" + integrity sha512-oHvSkz1E80VyeTKBvZNnw576qU+cVqRXUD3/wKXh1zpaki47Qty2xeHg2HKie9Hqcd2l4XwircgNOWb/NiGqdA== dependencies: - jest-get-type "^27.0.1" - pretty-format "^27.0.2" + jest-get-type "^27.0.6" + pretty-format "^27.1.0" -jest-matcher-utils@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.2.tgz#f14c060605a95a466cdc759acc546c6f4cbfc4f0" - integrity sha512-Qczi5xnTNjkhcIB0Yy75Txt+Ez51xdhOxsukN7awzq2auZQGPHcQrJ623PZj0ECDEMOk2soxWx05EXdXGd1CbA== +jest-matcher-utils@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.1.0.tgz#68afda0885db1f0b9472ce98dc4c535080785301" + integrity sha512-VmAudus2P6Yt/JVBRdTPFhUzlIN8DYJd+et5Rd9QDsO/Z82Z4iwGjo43U8Z+PTiz8CBvKvlb6Fh3oKy39hykkQ== dependencies: chalk "^4.0.0" - jest-diff "^27.0.2" - jest-get-type "^27.0.1" - pretty-format "^27.0.2" + jest-diff "^27.1.0" + jest-get-type "^27.0.6" + pretty-format "^27.1.0" -jest-message-util@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.2.tgz#181c9b67dff504d8f4ad15cba10d8b80f272048c" - integrity sha512-rTqWUX42ec2LdMkoUPOzrEd1Tcm+R1KfLOmFK+OVNo4MnLsEaxO5zPDb2BbdSmthdM/IfXxOZU60P/WbWF8BTw== +jest-message-util@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.1.0.tgz#e77692c84945d1d10ef00afdfd3d2c20bd8fb468" + integrity sha512-Eck8NFnJ5Sg36R9XguD65cf2D5+McC+NF5GIdEninoabcuoOfWrID5qJhufq5FB0DRKoiyxB61hS7MKoMD0trQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.0.2" + pretty-format "^27.1.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.3.tgz#5591844f9192b3335c0dca38e8e45ed297d4d23d" - integrity sha512-O5FZn5XDzEp+Xg28mUz4ovVcdwBBPfAhW9+zJLO0Efn2qNbYcDaJvSlRiQ6BCZUCVOJjALicuJQI9mRFjv1o9Q== +jest-mock@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.1.0.tgz#7ca6e4d09375c071661642d1c14c4711f3ab4b4f" + integrity sha512-iT3/Yhu7DwAg/0HvvLCqLvrTKTRMyJlrrfJYWzuLSf9RCAxBoIXN3HoymZxMnYsC3eD8ewGbUa9jUknwBenx2w== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -2367,105 +2350,109 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.1.tgz#69d4b1bf5b690faa3490113c47486ed85dd45b68" - integrity sha512-6nY6QVcpTgEKQy1L41P4pr3aOddneK17kn3HJw6SdwGiKfgCGTvH02hVXL0GU8GEKtPH83eD2DIDgxHXOxVohQ== +jest-regex-util@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" + integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.3.tgz#7e258f7d0458bb910855f8a50f5c1e9d92c319dc" - integrity sha512-HdjWOvFAgT5CYChF2eiBN2rRKicjaTCCtA3EtH47REIdGzEHGUhYrWYgLahXsiOovvWN6edhcHL5WCa3gbc04A== +jest-resolve-dependencies@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.1.0.tgz#d32ea4a2c82f76410f6157d0ec6cde24fbff2317" + integrity sha512-Kq5XuDAELuBnrERrjFYEzu/A+i2W7l9HnPWqZEeKGEQ7m1R+6ndMbdXCVCx29Se1qwLZLgvoXwinB3SPIaitMQ== dependencies: - "@jest/types" "^27.0.2" - jest-regex-util "^27.0.1" - jest-snapshot "^27.0.2" + "@jest/types" "^27.1.0" + jest-regex-util "^27.0.6" + jest-snapshot "^27.1.0" -jest-resolve@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.2.tgz#087a3ed17182722a3415f92bfacc99c49cf8a965" - integrity sha512-rmfLGyZhwAUR5z3EwPAW7LQTorWAuCYCcsQJoQxT2it+BOgX3zKxa67r1pfpK3ihy2k9TjYD3/lMp5rPm/CL1Q== +jest-resolve@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.1.0.tgz#bb22303c9e240cccdda28562e3c6fbcc6a23ac86" + integrity sha512-TXvzrLyPg0vLOwcWX38ZGYeEztSEmW+cQQKqc4HKDUwun31wsBXwotRlUz4/AYU/Fq4GhbMd/ileIWZEtcdmIA== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" + jest-haste-map "^27.1.0" jest-pnp-resolver "^1.2.2" - jest-util "^27.0.2" - jest-validate "^27.0.2" + jest-util "^27.1.0" + jest-validate "^27.1.0" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.3.tgz#d9747af3bee5a6ffaeb9e10b653263b780258b54" - integrity sha512-zH23uIIh1ro1JCD7XX1bQ0bQwXEsBzLX2UJVE/AVLsk4YJRmTfyXIzzRzBWRdnMHHg1NWkJ4fGs7eFP15IqZpQ== +jest-runner@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.1.0.tgz#1b28d114fb3b67407b8354c9385d47395e8ff83f" + integrity sha512-ZWPKr9M5w5gDplz1KsJ6iRmQaDT/yyAFLf18fKbb/+BLWsR1sCNC2wMT0H7pP3gDcBz0qZ6aJraSYUNAGSJGaw== dependencies: - "@jest/console" "^27.0.2" - "@jest/environment" "^27.0.3" - "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/console" "^27.1.0" + "@jest/environment" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-docblock "^27.0.1" - jest-haste-map "^27.0.2" - jest-leak-detector "^27.0.2" - jest-message-util "^27.0.2" - jest-resolve "^27.0.2" - jest-runtime "^27.0.3" - jest-util "^27.0.2" - jest-worker "^27.0.2" + jest-docblock "^27.0.6" + jest-environment-jsdom "^27.1.0" + jest-environment-node "^27.1.0" + jest-haste-map "^27.1.0" + jest-leak-detector "^27.1.0" + jest-message-util "^27.1.0" + jest-resolve "^27.1.0" + jest-runtime "^27.1.0" + jest-util "^27.1.0" + jest-worker "^27.1.0" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.3.tgz#32499c1047e5d953cfbb67fe790ab0167a614d28" - integrity sha512-k1Hl2pWWHBkSXdCggX2lyLRuDnnnmMlnJd+DPLb8LmmAeHW87WgGC6TplD377VxY3KQu73sklkhGUIdwFgsRVQ== - dependencies: - "@jest/console" "^27.0.2" - "@jest/environment" "^27.0.3" - "@jest/fake-timers" "^27.0.3" - "@jest/globals" "^27.0.3" - "@jest/source-map" "^27.0.1" - "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.2" - "@jest/types" "^27.0.2" +jest-runtime@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.1.0.tgz#1a98d984ffebc16a0b4f9eaad8ab47c00a750cf5" + integrity sha512-okiR2cpGjY0RkWmUGGado6ETpFOi9oG3yV0CioYdoktkVxy5Hv0WRLWnJFuArSYS8cHMCNcceUUMGiIfgxCO9A== + dependencies: + "@jest/console" "^27.1.0" + "@jest/environment" "^27.1.0" + "@jest/fake-timers" "^27.1.0" + "@jest/globals" "^27.1.0" + "@jest/source-map" "^27.0.6" + "@jest/test-result" "^27.1.0" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" + execa "^5.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.0.2" - jest-message-util "^27.0.2" - jest-mock "^27.0.3" - jest-regex-util "^27.0.1" - jest-resolve "^27.0.2" - jest-snapshot "^27.0.2" - jest-util "^27.0.2" - jest-validate "^27.0.2" + jest-haste-map "^27.1.0" + jest-message-util "^27.1.0" + jest-mock "^27.1.0" + jest-regex-util "^27.0.6" + jest-resolve "^27.1.0" + jest-snapshot "^27.1.0" + jest-util "^27.1.0" + jest-validate "^27.1.0" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.0.3" -jest-serializer@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.1.tgz#2464d04dcc33fb71dc80b7c82e3c5e8a08cb1020" - integrity sha512-svy//5IH6bfQvAbkAEg1s7xhhgHTtXu0li0I2fdKHDsLP2P2MOiscPQIENQep8oU2g2B3jqLyxKKzotZOz4CwQ== +jest-serializer@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.6.tgz#93a6c74e0132b81a2d54623251c46c498bb5bec1" + integrity sha512-PtGdVK9EGC7dsaziskfqaAPib6wTViY3G8E5wz9tLVPhHyiDNTZn/xjZ4khAw+09QkoOVpn7vF5nPSN6dtBexA== dependencies: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.2.tgz#40c48dc6afd3cbc5d3d07c061f20fc10d94ca0cd" - integrity sha512-4RcgvZbPrrbEE/hT6XQ4hr+NVVLNrmsgUnYSnZRT6UAvW9Q2yzGMS+tfJh+xlQJAapnnkNJzsMn6vUa+yfiVHA== +jest-snapshot@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.1.0.tgz#2a063ab90064017a7e9302528be7eaea6da12d17" + integrity sha512-eaeUBoEjuuRwmiRI51oTldUsKOohB1F6fPqWKKILuDi/CStxzp2IWekVUXbuHHoz5ik33ioJhshiHpgPFbYgcA== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2473,79 +2460,79 @@ jest-snapshot@^27.0.2: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.0.2" + expect "^27.1.0" graceful-fs "^4.2.4" - jest-diff "^27.0.2" - jest-get-type "^27.0.1" - jest-haste-map "^27.0.2" - jest-matcher-utils "^27.0.2" - jest-message-util "^27.0.2" - jest-resolve "^27.0.2" - jest-util "^27.0.2" + jest-diff "^27.1.0" + jest-get-type "^27.0.6" + jest-haste-map "^27.1.0" + jest-matcher-utils "^27.1.0" + jest-message-util "^27.1.0" + jest-resolve "^27.1.0" + jest-util "^27.1.0" natural-compare "^1.4.0" - pretty-format "^27.0.2" + pretty-format "^27.1.0" semver "^7.3.2" -jest-util@^27.0.0, jest-util@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.0.2.tgz#fc2c7ace3c75ae561cf1e5fdb643bf685a5be7c7" - integrity sha512-1d9uH3a00OFGGWSibpNYr+jojZ6AckOMCXV2Z4K3YXDnzpkAaXQyIpY14FOJPiUmil7CD+A6Qs+lnnh6ctRbIA== +jest-util@^27.0.0, jest-util@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.1.0.tgz#06a53777a8cb7e4940ca8e20bf9c67dd65d9bd68" + integrity sha512-edSLD2OneYDKC6gZM1yc+wY/877s/fuJNoM1k3sOEpzFyeptSmke3SLnk1dDHk9CgTA+58mnfx3ew3J11Kes/w== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.2.tgz#7fe2c100089449cd5cbb47a5b0b6cb7cda5beee5" - integrity sha512-UgBF6/oVu1ofd1XbaSotXKihi8nZhg0Prm8twQ9uCuAfo59vlxCXMPI/RKmrZEVgi3Nd9dS0I8A0wzWU48pOvg== +jest-validate@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.1.0.tgz#d9e82024c5e3f5cef52a600cfc456793a84c0998" + integrity sha512-QiJ+4XuSuMsfPi9zvdO//IrSRSlG6ybJhOpuqYSsuuaABaNT84h0IoD6vvQhThBOKT+DIKvl5sTM0l6is9+SRA== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.0.1" + jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.0.2" + pretty-format "^27.1.0" -jest-watcher@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.0.2.tgz#dab5f9443e2d7f52597186480731a8c6335c5deb" - integrity sha512-8nuf0PGuTxWj/Ytfw5fyvNn/R80iXY8QhIT0ofyImUvdnoaBdT6kob0GmhXR+wO+ALYVnh8bQxN4Tjfez0JgkA== +jest-watcher@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.1.0.tgz#2511fcddb0e969a400f3d1daa74265f93f13ce93" + integrity sha512-ivaWTrA46aHWdgPDgPypSHiNQjyKnLBpUIHeBaGg11U+pDzZpkffGlcB1l1a014phmG0mHgkOHtOgiqJQM6yKQ== dependencies: - "@jest/test-result" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/test-result" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.0.2" + jest-util "^27.1.0" string-length "^4.0.1" -jest-worker@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.2.tgz#4ebeb56cef48b3e7514552f80d0d80c0129f0b05" - integrity sha512-EoBdilOTTyOgmHXtw/cPc+ZrCA0KJMrkXzkrPGNwLmnvvlN1nj7MPrxpT7m+otSv2e1TLaVffzDnE/LB14zJMg== +jest-worker@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.1.0.tgz#65f4a88e37148ed984ba8ca8492d6b376938c0aa" + integrity sha512-mO4PHb2QWLn9yRXGp7rkvXLAYuxwhq1ZYUo0LoDhg8wqvv4QizP1ZWEJOeolgbEgAWZLIEU0wsku8J+lGWfBhg== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.3.tgz#0b4ac738c93612f778d58250aee026220487e5a4" - integrity sha512-0G9+QqXFIZWgf5rs3yllpaA+13ZawVHfyuhuCV1EnoFbX++rVMRrYWCAnk+dfhwyv9/VTQvn+XG969u8aPRsBg== +jest@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.1.0.tgz#eaab62dfdc02d8b7c814cd27b8d2d92bc46d3d69" + integrity sha512-pSQDVwRSwb109Ss13lcMtdfS9r8/w2Zz8+mTUA9VORD66GflCdl8nUFCqM96geOD2EBwWCNURrNAfQsLIDNBdg== dependencies: - "@jest/core" "^27.0.3" + "@jest/core" "^27.1.0" import-local "^3.0.2" - jest-cli "^27.0.3" + jest-cli "^27.1.0" js-tokens@^4.0.0: version "4.0.0" @@ -2561,9 +2548,9 @@ js-yaml@^3.13.1: esprima "^4.0.0" jsdom@^16.6.0: - version "16.6.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.6.0.tgz#f79b3786682065492a3da6a60a4695da983805ac" - integrity sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg== + version "16.7.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" + integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== dependencies: abab "^2.0.5" acorn "^8.2.4" @@ -2590,7 +2577,7 @@ jsdom@^16.6.0: whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" whatwg-url "^8.5.0" - ws "^7.4.5" + ws "^7.4.6" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -2675,7 +2662,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@4.x, lodash@^4.17.11, lodash@^4.17.15, lodash@^4.7.0: +lodash@4.x, lodash@^4.17.11, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -2723,7 +2710,7 @@ merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.2, micromatch@^4.0.4: +micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -2731,17 +2718,17 @@ micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.47.0: - version "1.47.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" - integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw== +mime-db@1.49.0: + version "1.49.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" + integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== mime-types@^2.1.12: - version "2.1.30" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d" - integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg== + version "2.1.32" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" + integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== dependencies: - mime-db "1.47.0" + mime-db "1.49.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2760,11 +2747,6 @@ minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -mkdirp@1.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -2785,10 +2767,10 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-releases@^1.1.71: - version "1.1.72" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe" - integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw== +node-releases@^1.1.75: + version "1.1.75" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.75.tgz#6dd8c876b9897a1b8e5a02de26afa79bb54ebbfe" + integrity sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw== normalize-path@^3.0.0: version "3.0.0" @@ -2906,7 +2888,7 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: +picomatch@^2.0.4, picomatch@^2.2.2, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== @@ -2942,27 +2924,17 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" - integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== - -pretty-format@^26.0.0, pretty-format@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" - integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== - dependencies: - "@jest/types" "^26.6.2" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^17.0.1" +prettier@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" + integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== -pretty-format@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.2.tgz#9283ff8c4f581b186b2d4da461617143dca478a4" - integrity sha512-mXKbbBPnYTG7Yra9qFBtqj+IXcsvxsvOBco3QHxtxTl+hHKq6QdzMZ+q0CtL4ORHZgwGImRr2XZUX2EWzORxig== +pretty-format@^27.0.0, pretty-format@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.1.0.tgz#022f3fdb19121e0a2612f3cff8d724431461b9ca" + integrity sha512-4aGaud3w3rxAO6OXmK3fwBFQ0bctIOG3/if+jYEFGNGIs0EvuidQm3bZ9mlP2/t9epLNC/12czabfy7TZNSwVA== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.1.0" ansi-regex "^5.0.0" ansi-styles "^5.0.0" react-is "^17.0.1" @@ -3000,10 +2972,10 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -regexpp@^3.0.0, regexpp@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" - integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== +regexpp@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== require-directory@^2.1.1: version "2.1.1" @@ -3074,12 +3046,12 @@ rollup-plugin-typescript2@^0.30.0: resolve "1.20.0" tslib "2.1.0" -rollup@^2.50.5: - version "2.50.5" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.50.5.tgz#bbee9d6411af3f5fa5c6e7e2c69f7a65b753e568" - integrity sha512-Ztz4NurU2LbS3Jn5rlhnYv35z6pkjBUmYKr94fOBIKINKRO6kug9NTFHArT7jqwMP2kqEZ39jJuEtkk91NBltQ== +rollup@^2.56.3: + version "2.56.3" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.56.3.tgz#b63edadd9851b0d618a6d0e6af8201955a77aeff" + integrity sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg== optionalDependencies: - fsevents "~2.3.1" + fsevents "~2.3.2" run-parallel@^1.1.9: version "1.2.0" @@ -3105,7 +3077,7 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -semver@7.x, semver@^7.2.1, semver@^7.3.2: +semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -3331,26 +3303,24 @@ tough-cookie@^4.0.0: punycode "^2.1.1" universalify "^0.1.2" -tr46@^2.0.2: +tr46@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== dependencies: punycode "^2.1.1" -ts-jest@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.1.tgz#3cd174561c4bb311e0187a5837543fb858c60d16" - integrity sha512-03qAt77QjhxyM5Bt2KrrT1WbdumiwLz989sD3IUznSp3GIFQrx76kQqSMLF7ynnxrF3/1ipzABnHxMlU8PD4Vw== +ts-jest@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.5.tgz#0b0604e2271167ec43c12a69770f0bb65ad1b750" + integrity sha512-lIJApzfTaSSbtlksfFNHkWOzLJuuSm4faFAfo5kvzOiRAuoN4/eKxVJ2zEAho8aecE04qX6K1pAzfH5QHL1/8w== dependencies: bs-logger "0.x" - buffer-from "1.x" fast-json-stable-stringify "2.x" jest-util "^27.0.0" json5 "2.x" lodash "4.x" make-error "1.x" - mkdirp "1.x" semver "7.x" yargs-parser "20.x" @@ -3364,7 +3334,7 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tsutils@^3.17.1: +tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== @@ -3400,11 +3370,6 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -3412,10 +3377,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805" - integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw== +typescript@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86" + integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ== universalify@^0.1.0, universalify@^0.1.2: version "0.1.2" @@ -3434,10 +3399,10 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -v8-to-istanbul@^7.0.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz#30898d1a7fa0c84d225a2c1434fb958f290883c1" - integrity sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow== +v8-to-istanbul@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.0.0.tgz#4229f2a99e367f3f018fa1d5c2b8ec684667c69c" + integrity sha512-LkmXi8UUNxnCC+JlH7/fsfsKr5AU110l+SYGJimWNkWhxbN5EyeOtm1MJ0hhvqMMOhGwBj1Fp70Yv9i+hX0QAg== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -3487,12 +3452,12 @@ whatwg-mimetype@^2.3.0: integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== whatwg-url@^8.0.0, whatwg-url@^8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.5.0.tgz#7752b8464fc0903fec89aa9846fc9efe07351fd3" - integrity sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg== + version "8.7.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" + integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" - tr46 "^2.0.2" + tr46 "^2.1.0" webidl-conversions "^6.1.0" which@^2.0.1: @@ -3531,10 +3496,10 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@^7.4.5: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@^7.4.6: + version "7.5.4" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.4.tgz#56bfa20b167427e138a7795de68d134fe92e21f9" + integrity sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg== xml-name-validator@^3.0.0: version "3.0.0" @@ -3557,9 +3522,9 @@ yallist@^4.0.0: integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yargs-parser@20.x, yargs-parser@^20.2.2: - version "20.2.7" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" - integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs@^16.0.3: version "16.2.0" diff --git a/yarn.lock b/yarn.lock index e5818d9e..3ef36dc5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -828,10 +828,10 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^10.0.0": - version "10.0.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.0.0.tgz#db4335de99509021f501fc4e026e6ff495fe1e62" - integrity sha512-k1iO2zKuEjjRS1EJb4FwSLk+iF6EGp+ZV0OMRViQoWhQ1fZTk9hg1xccZII5uyYoiqcbC73MRBmT45y1vp2PPg== +"@octokit/openapi-types@^10.1.0": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.1.1.tgz#74607482d193e9c9cc7e23ecf04b1bde3eabb6d8" + integrity sha512-ygp/6r25Ezb1CJuVMnFfOsScEtPF0zosdTJDZ7mZ+I8IULl7DP1BS5ZvPRwglcarGPXOvS5sHdR0bjnVDDfQdQ== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -851,11 +851,11 @@ integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== "@octokit/plugin-rest-endpoint-methods@^5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.9.0.tgz#f9a7d8411e7e4e49a65fc95b5cc23cf96bf05e1f" - integrity sha512-Rz67pg+rEJq2Qn/qfHsMiBoP7GL5NDn8Gg0ezGznZ745Ixn1gPusZYZqCXNhICYrIZaVXmusNP0iwPdphJneqQ== + version "5.10.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.10.0.tgz#8058acf408d518defa2dc59a46777adbcd7ee8e8" + integrity sha512-HiUZliq5wNg15cevJlTo9zDnPXAD0BMRhLxbRNPnq9J3HELKesDTOiou56ax2jC/rECUkK/uJTugrizYKSo/jg== dependencies: - "@octokit/types" "^6.26.0" + "@octokit/types" "^6.27.0" deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": @@ -889,12 +889,12 @@ "@octokit/plugin-request-log" "^1.0.4" "@octokit/plugin-rest-endpoint-methods" "^5.9.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.26.0": - version "6.26.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.26.0.tgz#b8af298485d064ad9424cb41520541c1bf820346" - integrity sha512-RDxZBAFMtqs1ZPnbUu1e7ohPNfoNhTiep4fErY7tZs995BeHu369Vsh5woMIaFbllRWEZBfvTCS4hvDnMPiHrA== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.26.0", "@octokit/types@^6.27.0": + version "6.27.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.27.0.tgz#2ffcd4d1cf344285f4151978c6fd36a2edcdf922" + integrity sha512-ha27f8DToxXBPEJdzHCCuqpw7AgKfjhWGdNf3yIlBAhAsaexBXTfWw36zNSsncALXGvJq4EjLy1p3Wz45Aqb4A== dependencies: - "@octokit/openapi-types" "^10.0.0" + "@octokit/openapi-types" "^10.1.0" "@sindresorhus/is@^0.14.0": version "0.14.0" @@ -1069,12 +1069,12 @@ arch@^2.1.1: integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== are-we-there-yet@~1.1.2: - version "1.1.6" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.6.tgz#bc9101d19670c7bdb1546ed036568a6c9879ee79" - integrity sha512-+1byPnimWdGcKFRS48zG73nxM08kamPFReUYvEmRXI3E8E4YhF4voMRDaGlfGD1UeRHEgs4NhQCE28KI8JVj1A== + version "1.1.7" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146" + integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g== dependencies: delegates "^1.0.0" - readable-stream "^3.6.0" + readable-stream "^2.0.6" arg@2.0.0: version "2.0.0" @@ -1329,7 +1329,7 @@ chalk@^2.0.0, chalk@^2.0.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.1.0, chalk@^4.1.1: +chalk@^4.1.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3565,12 +3565,12 @@ npm-bundled@^1.1.1: dependencies: npm-normalize-package-bin "^1.0.1" -npm-check-updates@^11.8.3: - version "11.8.3" - resolved "https://registry.yarnpkg.com/npm-check-updates/-/npm-check-updates-11.8.3.tgz#3c3541ad855bbc42b0d60e8eb293d3f6125c80e5" - integrity sha512-NslIB6Af7GagVrN+bvBkObLyawIZfOnDnl8n9MHE+dFt0aChRYtvR6T2BLJKzOPIepCLmmh0NRR/qha0ExAELQ== +npm-check-updates@^11.8.5: + version "11.8.5" + resolved "https://registry.yarnpkg.com/npm-check-updates/-/npm-check-updates-11.8.5.tgz#8dec7fd255a437264742c15f9c0bb29f4eceaf55" + integrity sha512-IYSHjlWe8UEugDy7X0qjBeJwcni4DlcWdBK4QQEbwgkNlEDlXyd4yQJYWFumKaJzrp/n5/EcvaboXsBD1Er/pw== dependencies: - chalk "^4.1.1" + chalk "^4.1.2" cint "^8.2.1" cli-table "^0.3.6" commander "^6.2.1" @@ -3586,7 +3586,7 @@ npm-check-updates@^11.8.3: lodash "^4.17.21" minimatch "^3.0.4" p-map "^4.0.0" - pacote "^11.3.4" + pacote "^11.3.5" parse-github-url "^1.0.2" progress "^2.0.3" prompts "^2.4.1" @@ -3907,7 +3907,7 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" -pacote@^11.2.6, pacote@^11.3.4: +pacote@^11.2.6, pacote@^11.3.5: version "11.3.5" resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.5.tgz#73cf1fc3772b533f575e39efa96c50be8c3dc9d2" integrity sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg== @@ -4316,7 +4316,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.6.0: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -4325,7 +4325,7 @@ readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stre string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@~2.3.6: +readable-stream@^2.0.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== From afc44dc015bebb11767944a04d99d73fa35ba263 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 6 Sep 2021 14:12:55 +0900 Subject: [PATCH 10/87] =?UTF-8?q?=E6=88=90=E6=9E=9C=E7=89=A9=E3=82=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/helper.d.ts | 5 ----- dist/sora.js | 12 ++++++------ dist/sora.min.js | 2 +- dist/sora.min.js.map | 2 +- dist/sora.mjs | 14 +++++++------- 5 files changed, 15 insertions(+), 20 deletions(-) delete mode 100644 dist/helper.d.ts diff --git a/dist/helper.d.ts b/dist/helper.d.ts deleted file mode 100644 index 6a084257..00000000 --- a/dist/helper.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare function stopVideoMediaDevice(mediastream: MediaStream): void; -declare function startVideoMediaDevice(mediastream: MediaStream, peerConnection: RTCPeerConnection): Promise; -declare function stopAudioMediaDevice(mediastream: MediaStream): void; -declare function startAudioMediaDevice(mediastream: MediaStream, peerConnection: RTCPeerConnection): Promise; -export { stopVideoMediaDevice, startVideoMediaDevice, stopAudioMediaDevice, startAudioMediaDevice }; diff --git a/dist/sora.js b/dist/sora.js index cdadfe81..94b4b619 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -906,7 +906,7 @@ return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7)); }; // get end of byte - var shft = function (p) { return ((p / 8) | 0) + (p & 7 && 1); }; + var shft = function (p) { return ((p + 7) / 8) | 0; }; // typed array slice - allows garbage collector to free original reference, // while being more compatible than .slice var slc = function (v, s, e) { @@ -950,7 +950,7 @@ var inflt = function (dat, buf, st) { // source length var sl = dat.length; - if (!sl || (st && !st.l && sl < 5)) + if (!sl || (st && st.f && !st.l)) return buf || new u8(0); // have to estimate size var noBuf = !buf || st; @@ -979,7 +979,7 @@ do { if (!lm) { // BFINAL - this is only 1 when last chunk is next - st.f = final = bits(dat, pos, 1); + final = bits(dat, pos, 1); // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman var type = bits(dat, pos + 1, 3); pos += 3; @@ -997,7 +997,7 @@ // Copy over uncompressed data buf.set(dat.subarray(s, t), bt); // Get new bitpos, update byte count - st.b = bt += l, st.p = pos = t * 8; + st.b = bt += l, st.p = pos = t * 8, st.f = final; continue; } else if (type == 1) @@ -1119,7 +1119,7 @@ bt = end; } } - st.l = lm, st.p = lpos, st.b = bt; + st.l = lm, st.p = lpos, st.b = bt, st.f = final; if (lm) final = 1, st.m = lbt, st.d = dm, st.n = dbt; } while (!final); @@ -1479,7 +1479,7 @@ p: function (d) { // closures have awful performance var n = a, m = b; - var l = d.length; + var l = d.length | 0; for (var i = 0; i != l;) { var e = Math.min(i + 2655, l); for (; i < e; ++i) diff --git a/dist/sora.min.js b/dist/sora.min.js index 71fde73a..1707c154 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -4,5 +4,5 @@ * @version: 2021.1.6 * @author: Shiguredo Inc. * @license: Apache-2.0 - **/(function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"==typeof globalThis?e||self:globalThis,e.Sora=n())})(this,function(){'use strict';var n=Math.min,t=Math.ceil,a=Math.max;function g(){(()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,t){n+=i.decode(t);const a=n.lastIndexOf("\n");return-1!=a&&(console.log(n.substr(0,a)),n=n.substr(a+1)),t.length},write(i,t,a,g,o,l){if(0!==a||g!==t.length||null!==o)return void l(e());const d=this.writeSync(i,t);l(null,d)},chmod(n,i,t){t(e())},chown(n,i,t,a){a(e())},close(n,i){i(e())},fchmod(n,i,t){t(e())},fchown(n,i,t,a){a(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,t){t(e())},lchown(n,i,t,a){a(e())},link(n,i,t){t(e())},lstat(n,i){i(e())},mkdir(n,i,t){t(e())},open(n,i,t,a){a(e())},read(n,i,t,a,g,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,t){t(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,t){t(e())},truncate(n,i,t){t(e())},unlink(n,i){i(e())},utimes(n,i,t,a){a(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},t=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},g=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let t=0;switch(typeof n){case"object":null!==n&&(t=1);break;case"string":t=2;break;case"symbol":t=3;break;case"function":t=4;}this.mem.setUint32(e+4,2146959360|t,!0),this.mem.setUint32(e,i,!0)},l=e=>{const n=t(e+0),i=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},d=e=>{const n=t(e+0),o=t(e+8),l=Array(o);for(let t=0;t{const n=t(e+0),a=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},s=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=t(e+8),a=t(e+16),g=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,g))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(s+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},t(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,c(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(g(e+8),c(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(g(e+8),c(e+16),g(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(g(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(g(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(g(e+8),t(e+16),g(e+24))},"syscall/js.valueCall":e=>{try{const n=g(e+8),i=Reflect.get(n,c(e+16)),t=d(e+32),a=Reflect.apply(i,n,t);e=this._inst.exports.getsp(),o(e+56,a),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=g(e+8),i=d(e+16),t=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,t),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=g(e+8),i=d(e+16),t=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,t),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(g(n+8).length))},"syscall/js.valuePrepareString":i=>{const t=n.encode(g(i+8)+"");o(i+16,t),e(i+24,t.length)},"syscall/js.valueLoadString":e=>{const n=g(e+8);l(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,g(e+8)instanceof g(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=l(n+8),t=g(n+32);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const a=t.subarray(0,i.length);i.set(a),e(n+40,a.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=g(n+8),t=l(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const a=t.subarray(0,i.length);i.set(a),e(n+40,a.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const t=e=>{const t=i,a=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,a.length).set(a),i+=a.length,0!=i%8&&(i+=8-i%8),t},a=this.argv.length,g=[];this.argv.forEach(e=>{g.push(t(e))}),g.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{g.push(t(`${e}=${this.env[e]}`))}),g.push(0);const l=i;g.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(a,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=de();i.p(e);var t=ce(e,n,2,4);return Ce(t,n),se(t,t.length-4,i.d()),t}function l(e,n){return z((Ie(e),e.subarray(2,-4)),n)}function d(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function c(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function s(){return"safari"===d()}function C(e,n,i,t,a){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const g={type:"connect",sora_client:"Sora JavaScript SDK 2021.1.6",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==t&&(g.metadata=t),"signalingNotifyMetadata"in a&&(g.signaling_notify_metadata=a.signalingNotifyMetadata),"multistream"in a&&!0===a.multistream&&(g.multistream=!0,"spotlight"in a&&(g.spotlight=a.spotlight,"spotlightNumber"in a&&(g.spotlight_number=a.spotlightNumber)),!0===g.spotlight)){const e=["none","r0","r1","r2"];void 0!==a.spotlightFocusRid&&0<=e.indexOf(a.spotlightFocusRid)&&(g.spotlight_focus_rid=a.spotlightFocusRid),void 0!==a.spotlightUnfocusRid&&0<=e.indexOf(a.spotlightUnfocusRid)&&(g.spotlight_unfocus_rid=a.spotlightUnfocusRid)}if("simulcast"in a||"simulcastRid"in a){"simulcast"in a&&!0===a.simulcast&&(g.simulcast=!0);void 0!==a.simulcastRid&&0<=["r0","r1","r2"].indexOf(a.simulcastRid)&&(g.simulcast_rid=a.simulcastRid)}"clientId"in a&&void 0!==a.clientId&&(g.client_id=a.clientId),"dataChannelSignaling"in a&&"boolean"==typeof a.dataChannelSignaling&&(g.data_channel_signaling=a.dataChannelSignaling),"ignoreDisconnectWebSocket"in a&&"boolean"==typeof a.ignoreDisconnectWebSocket&&(g.ignore_disconnect_websocket=a.ignoreDisconnectWebSocket);const o=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],d=["videoCodecType","videoBitRate"],s=Object.assign({},a);Object.keys(s).forEach(e=>{"audio"===e&&"boolean"==typeof s[e]||"video"===e&&"boolean"==typeof s[e]||0<=o.indexOf(e)&&null!==s[e]||0<=l.indexOf(e)&&null!==s[e]||0<=d.indexOf(e)&&null!==s[e]||delete s[e]}),void 0!==s.audio&&(g.audio=s.audio);const C=Object.keys(s).some(e=>0<=o.indexOf(e));g.audio&&C&&(g.audio={},"audioCodecType"in s&&(g.audio.codec_type=s.audioCodecType),"audioBitRate"in s&&(g.audio.bit_rate=s.audioBitRate));const I=Object.keys(s).some(e=>0<=l.indexOf(e));g.audio&&I&&("object"!=typeof g.audio&&(g.audio={}),g.audio.opus_params={},"audioOpusParamsChannels"in s&&(g.audio.opus_params.channels=s.audioOpusParamsChannels),"audioOpusParamsClockRate"in s&&(g.audio.opus_params.clock_rate=s.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in s&&(g.audio.opus_params.maxplaybackrate=s.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in s&&(g.audio.opus_params.stereo=s.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in s&&(g.audio.opus_params.sprop_stereo=s.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in s&&(g.audio.opus_params.minptime=s.audioOpusParamsMinptime),"audioOpusParamsPtime"in s&&(g.audio.opus_params.ptime=s.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in s&&(g.audio.opus_params.useinbandfec=s.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in s&&(g.audio.opus_params.usedtx=s.audioOpusParamsUsedtx)),void 0!==s.video&&(g.video=s.video);const r=Object.keys(s).some(e=>0<=d.indexOf(e));if(g.video&&r&&(g.video={},"videoCodecType"in s&&(g.video.codec_type=s.videoCodecType),"videoBitRate"in s&&(g.video.bit_rate=s.videoBitRate)),g.simulcast&&!c()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===a.e2ee){if(void 0===g.signaling_notify_metadata&&(g.signaling_notify_metadata={}),null===g.signaling_notify_metadata||"object"!=typeof g.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===g.video&&(g.video={}),g.video&&(g.video.codec_type="VP8"),g.e2ee=!0}return g}function I(e){if(e.authn_metadata!==void 0)return e.authn_metadata;return void 0===e.metadata?null:e.metadata}function r(e){if(e.data&&Array.isArray(e.data))return e.data;return e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}function m(e){return"object"==typeof e&&null!==e&&"pre_key_bundle"in e?e.pre_key_bundle:null}function A(e,n,i){const t=e=>{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),t(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let a="";window.performance&&(a="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(a=a+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(a+" "+n),t(i),console.groupEnd()):console.log(a+" "+n+"\n",i)}function Z(e,n,i){const t=new Event(e);try{t.data=JSON.parse(JSON.stringify(n))}catch(e){t.data=n}return t.transportType=i,t}function u(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function b(e,n,i,t,a){const g=new Event(e);try{g.data=JSON.parse(JSON.stringify(n))}catch(e){g.data=n}return g.logType=i,g.dataChannelId=t,g.dataChannelLabel=a,g}class p{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY29uc3QgcGFkZGluZ0xlbmd0aCA9IFVpbnQzMkFycmF5LkJZVEVTX1BFUl9FTEVNRU5UIC0gZGF0YVZpZXcuYnl0ZUxlbmd0aDsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGFkZGluZ0xlbmd0aDsgaSArPSAxKSB7CiAgICAgICAgbmV3RGF0YVZpZXcuc2V0VWludDgoaSwgMCk7CiAgICB9CiAgICBmb3IgKGxldCBpID0gcGFkZGluZ0xlbmd0aCwgaiA9IDA7IGkgPC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jb2RlZEZyYW1lLnR5cGVdKSk7CiAgICAgICAgY29uc3Qgc2ZyYW1lSGVhZGVyID0gbmV3IFVpbnQ4QXJyYXkoc2ZyYW1lSGVhZGVyQnVmZmVyKTsKICAgICAgICBjb25zdCBjb25uZWN0aW9uSWQgPSB0ZXh0RGVjb2Rlci5kZWNvZGUoY29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJh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KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0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HJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,t=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:t},[i,t])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,t=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:t},[i,t])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,t=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:t})}startSession(e,n){const[i,t]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(t)throw t;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(g(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var V=Uint8Array,S=Uint16Array,G=Uint32Array,W=new V([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h=new 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,0,0]),y=new V([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),k=function(e,n){for(var t=new S(31),a=0;31>a;++a)t[a]=n+=1<a;++a)for(var o=t[a];oN;++N)X=(43690&N)>>>1|(21845&N)<<1,X=(52428&X)>>>2|(13107&X)<<2,X=(61680&X)>>>4|(3855&X)<<4,Y[N]=((65280&X)>>>8|(255&X)<<8)>>>1;for(var E=function(e,n,t){for(var a=e.length,g=0,o=new S(n);g>>15-n]=c}else for(d=new S(a),g=0;g>>15-e[g]);return d},v=new V(288),N=0;144>N;++N)v[N]=8;for(var N=144;256>N;++N)v[N]=9;for(var N=256;280>N;++N)v[N]=7;for(var N=280;288>N;++N)v[N]=8;for(var O=new V(32),N=0;32>N;++N)O[N]=5;var K=E(v,9,0),L=E(v,9,1),F=E(O,5,0),J=E(O,5,1),U=function(e){for(var n=e[0],t=1;tn&&(n=e[t]);return n},Q=function(e,n,i){var t=0|n/8;return(e[t]|e[t+1]<<8)>>(7&n)&i},D=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},H=function(e){return(0|e/8)+(7&e&&1)},M=function(i,t,a){(null==t||0>t)&&(t=0),(null==a||a>i.length)&&(a=i.length);var g=new(i instanceof S?S:i instanceof G?G:V)(a-t);return g.set(i.subarray(t,a)),g},P=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],j=function(n,i,t){var a=new Error(i||P[n]);if(a.code=n,Error.captureStackTrace&&Error.captureStackTrace(a,j),!t)throw a;return a},z=function(g,o,C){var I=g.length;if(!I||C&&!C.l&&5>I)return o||new V(0);var m=!o||C,A=!C||C.i;C||(C={}),o||(o=new V(3*I));var Z=function(e){var n=o.length;if(e>n){var i=new V(a(2*n,e));i.set(o),o=i}},u=C.f||0,p=C.p||0,S=C.b||0,G=C.l,k=C.d,w=C.m,R=C.n,X=8*I;do{if(!G){C.f=u=Q(g,p,1);var f=Q(g,p+1,3);if(p+=3,!f){var T=H(p)+4,Y=g[T-4]|g[T-3]<<8,l=T+Y;if(l>I){A&&j(0);break}m&&Z(S+Y),o.set(g.subarray(T,l),S),C.b=S+=Y,C.p=p=8*l;continue}else if(1==f)G=L,k=J,w=9,R=5;else if(2==f){var t=Q(g,p,31)+257,N=Q(g,p+10,15)+4,v=t+Q(g,p+5,31)+1;p+=14;for(var O=new V(v),K=new V(19),F=0;F>>4;if(16>T)O[F++]=T;else{var _=0,q=0;for(16==T?(q=3+Q(g,p,3),p+=2,_=O[F-1]):17==T?(q=3+Q(g,p,7),p+=3):18==T&&(q=11+Q(g,p,127),p+=7);q--;)O[F++]=_}}var $=O.subarray(0,t),ee=O.subarray(t);w=U($),R=U(ee),G=E($,w,1),k=E(ee,R,1)}else j(1);if(p>X){A&&j(0);break}}m&&Z(S+131072);for(var ne=(1<>>4;if(p+=15&_,p>X){A&&j(0);break}if(_||j(2),256>ae)o[S++]=ae;else if(256==ae){te=p,G=null;break}else{var ge=ae-254;if(264>>4;le||j(3),p+=15≤var ee=B[d];if(3X){A&&j(0);break}m&&Z(S+131072);for(var de=S+ge;S>>8},q=function(e,n,i){i<<=7&n;var t=0|n/8;e[t]|=i,e[t+1]|=i>>>8,e[t+2]|=i>>>16},$=function(e,n){for(var a=[],t=0;tA&&(A=o[t].s);var Z=new S(A+1),u=ee(a[I-1],Z,0);if(u>n){var t=0,b=0,p=u-n;for(o.sort(function(e,n){return Z[n.s]-Z[e.s]||e.f-n.f});tn)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var ee,f=0;f>>5),C+=x[f]>>>12)}}else Q=K,D=v,j=F,H=O;for(var f=0;f>>18;q(n,C,Q[ee+257]),C+=D[ee+257],7>>23),C+=W[ee]);var ae=31&a[f];q(n,C,j[ae]),C+=H[ae],3>>5),C+=h[ae])}else q(n,C,Q[a[f]]),C+=D[a[f]];return q(n,C,Q[256]),C+D[256]},ge=new G([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oe=new V(0),le=function(a,g,c,C,I,r){var m=a.length,s=new V(C+m+5*(1+t(m/7e3))+I),o=s.subarray(C,s.length-I),A=0;if(!g||8>m)for(var Z,u=0;u<=m;u+=65535)Z=u+65535,ZQ;++Q)B[Q]=0;for(var Q=0;30>Q;++Q)Y[Q]=0}var D=2,x=0,P=8191&b,z=32767&F-J;if(2>>13,U)-1,q=n(32767,u),$=n(258,U);z<=q&&--P&&F!=J;){if(a[u+D]==a[u+D-z]){for(var ee=0;ee<$&&a[u+ee]==a[u+ee-z];++ee);if(ee>D){if(D=ee,x=z,ee>_)break;for(var ne=n(z,ee-2),ie=0,Q=0;Qie&&(ie=ce,J=le)}}}F=J,J=y[F],z+=32767&F-J+32768}if(x){f[v++]=268435456|R[D]<<18|T[x];var se=31&R[D],Ce=31&T[x];E+=W[se]+h[Ce],++B[257+se],++Y[Ce],O=u+D,++N}else f[v++]=a[u],++B[a[u]]}}A=ae(a,o,r,f,B,Y,E,v,K,u-K,A),!r&&7&A&&(A=te(o,A+1,oe))}return M(s,0,C+H(A)+I)},de=function(){var t=1,g=0;return{p:function(a){for(var o,d=t,c=g,s=a.length,l=0;l!=s;){for(o=n(l+2655,s);l>16),c=(65535&c)+15*(c>>16)}t=d,g=c},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},ce=function(e,i,g,o,l){return le(e,null==i.level?6:i.level,null==i.mem?t(1.5*a(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!l)},se=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},Ce=function(e,n){var i=n.level,t=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=t<<6|(t?32-2*t:1)},Ie=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&j(6,"invalid zlib data"),32&e[1]&&j(6,"invalid zlib data: preset dictionaries not supported")},re="undefined"!=typeof TextDecoder&&new TextDecoder,me=0;try{re.decode(oe,{stream:!0}),me=1}catch(n){}class Ae extends Error{}class Ze{constructor(e,n,i,t,a,g){this.role=n,this.channelId=i,this.metadata=t,this.signalingUrl=e,this.options=a,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.dataChannelsCompress={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const t={type:"disconnect",reason:e};this.ws.send(JSON.stringify(t)),this.writeWebSocketSignalingLog("send-disconnect",t),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const t=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),a=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(t),e(),n({code:4999,reason:""}));a.push((()=>new Promise(e=>{let n=0;const t=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(t),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(t))},100)}))())}}Promise.all(a).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(t)});const g={type:"disconnect",reason:"NO-ERROR"};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new p,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}signaling(e){return this.trace("CREATE OFFER",e),new Promise((n,i)=>{null===this.ws&&(this.ws=new WebSocket(this.signalingUrl),this.writeWebSocketSignalingLog("new-websocket",this.signalingUrl)),this.ws.binaryType="arraybuffer",this.ws.onclose=async e=>{const n=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),i(n)},this.ws.onopen=async()=>{this.writeWebSocketSignalingLog("onopen");let n;try{n=C(e.sdp||"",this.role,this.channelId,this.metadata,this.options)}catch(e){return void i(e)}if(n.e2ee&&this.e2ee){const e=await this.e2ee.init();n.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",n),this.ws&&(this.ws.send(JSON.stringify(n)),this.writeWebSocketSignalingLog(`send-${n.type}`,n))},this.ws.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const i=JSON.parse(e.data);"offer"==i.type?(this.writeWebSocketSignalingLog("onmessage-offer",i),this.signalingOnMessageTypeOffer(i),n(i)):"update"==i.type?(this.writeWebSocketSignalingLog("onmessage-update",i),await this.signalingOnMessageTypeUpdate(i)):"re-offer"==i.type?(this.writeWebSocketSignalingLog("onmessage-re-offer",i),await this.signalingOnMessageTypeReOffer(i)):"ping"==i.type?await this.signalingOnMessageTypePing(i):"push"==i.type?this.callbacks.push(i,"websocket"):"notify"==i.type?("connection.created"===i.event_type?this.writeWebSocketTimelineLog("notify-connection.created",i):"connection.destroyed"===i.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",i),this.signalingOnMessageTypeNotify(i,"websocket")):"switched"==i.type&&(this.writeWebSocketSignalingLog("onmessage-switched",i),this.signalingOnMessageTypeSwitched(i))}})}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(s()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new Ae(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&A(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(Z(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(Z(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=b(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const t=b(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(t)}writePeerConnectionTimelineLog(e,n){const i=b(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=b(e,n,"sora");this.callbacks.timeline(i)}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.dataChannelsCompress[n.label]=n.compress;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=I(e),t=m(i);if(t&&this.e2ee&&n){const e=this.e2ee.startSession(n,t);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=r(e);i.forEach(e=>{const n=I(e),i=m(n),t=e.connection_id;t&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(t,i)})}else if("connection.destroyed"===e.event_type){const n=I(e),i=m(n),t=e.connection_id;if(i&&this.e2ee&&t){const e=this.e2ee.stopSession(t);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(t)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,u(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.signaling){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const t=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${t.type}`,n,t),"re-offer"===t.type&&(await this.signalingOnMessageTypeReOffer(t))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.notify){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const t=JSON.parse(i);"connection.created"===t.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,t):"connection.destroyed"===t.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,t),this.signalingOnMessageTypeNotify(t,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(!0===this.dataChannelsCompress.push){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label&&(e.channel.onmessage=async e=>{let n=e.data;if(!0===this.dataChannelsCompress.stats){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}})}sendMessage(e){if(this.dataChannels.signaling){if(!0===this.dataChannelsCompress.signaling){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(!0===this.dataChannelsCompress.stats){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const t=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new t(e,n,i)}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}}class ue extends Ze{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.createOffer(),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.createOffer(),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class be extends Ze{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.createOffer(),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,t){n+=i.decode(t);const a=n.lastIndexOf("\n");return-1!=a&&(console.log(n.substr(0,a)),n=n.substr(a+1)),t.length},write(i,t,a,g,o,l){if(0!==a||g!==t.length||null!==o)return void l(e());const d=this.writeSync(i,t);l(null,d)},chmod(n,i,t){t(e())},chown(n,i,t,a){a(e())},close(n,i){i(e())},fchmod(n,i,t){t(e())},fchown(n,i,t,a){a(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,t){t(e())},lchown(n,i,t,a){a(e())},link(n,i,t){t(e())},lstat(n,i){i(e())},mkdir(n,i,t){t(e())},open(n,i,t,a){a(e())},read(n,i,t,a,g,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,t){t(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,t){t(e())},truncate(n,i,t){t(e())},unlink(n,i){i(e())},utimes(n,i,t,a){a(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},t=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},g=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let t=0;switch(typeof n){case"object":null!==n&&(t=1);break;case"string":t=2;break;case"symbol":t=3;break;case"function":t=4;}this.mem.setUint32(e+4,2146959360|t,!0),this.mem.setUint32(e,i,!0)},l=e=>{const n=t(e+0),i=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},d=e=>{const n=t(e+0),o=t(e+8),l=Array(o);for(let t=0;t{const n=t(e+0),a=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},s=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=t(e+8),a=t(e+16),g=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,g))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(s+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},t(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,c(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(g(e+8),c(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(g(e+8),c(e+16),g(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(g(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(g(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(g(e+8),t(e+16),g(e+24))},"syscall/js.valueCall":e=>{try{const n=g(e+8),i=Reflect.get(n,c(e+16)),t=d(e+32),a=Reflect.apply(i,n,t);e=this._inst.exports.getsp(),o(e+56,a),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=g(e+8),i=d(e+16),t=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,t),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=g(e+8),i=d(e+16),t=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,t),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(g(n+8).length))},"syscall/js.valuePrepareString":i=>{const t=n.encode(g(i+8)+"");o(i+16,t),e(i+24,t.length)},"syscall/js.valueLoadString":e=>{const n=g(e+8);l(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,g(e+8)instanceof g(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=l(n+8),t=g(n+32);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const a=t.subarray(0,i.length);i.set(a),e(n+40,a.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=g(n+8),t=l(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const a=t.subarray(0,i.length);i.set(a),e(n+40,a.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const t=e=>{const t=i,a=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,a.length).set(a),i+=a.length,0!=i%8&&(i+=8-i%8),t},a=this.argv.length,g=[];this.argv.forEach(e=>{g.push(t(e))}),g.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{g.push(t(`${e}=${this.env[e]}`))}),g.push(0);const l=i;g.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(a,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=de();i.p(e);var t=ce(e,n,2,4);return Ce(t,n),se(t,t.length-4,i.d()),t}function l(e,n){return z((Ie(e),e.subarray(2,-4)),n)}function d(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function c(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function s(){return"safari"===d()}function C(e,n,i,t,a){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const g={type:"connect",sora_client:"Sora JavaScript SDK 2021.1.6",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==t&&(g.metadata=t),"signalingNotifyMetadata"in a&&(g.signaling_notify_metadata=a.signalingNotifyMetadata),"multistream"in a&&!0===a.multistream&&(g.multistream=!0,"spotlight"in a&&(g.spotlight=a.spotlight,"spotlightNumber"in a&&(g.spotlight_number=a.spotlightNumber)),!0===g.spotlight)){const e=["none","r0","r1","r2"];void 0!==a.spotlightFocusRid&&0<=e.indexOf(a.spotlightFocusRid)&&(g.spotlight_focus_rid=a.spotlightFocusRid),void 0!==a.spotlightUnfocusRid&&0<=e.indexOf(a.spotlightUnfocusRid)&&(g.spotlight_unfocus_rid=a.spotlightUnfocusRid)}if("simulcast"in a||"simulcastRid"in a){"simulcast"in a&&!0===a.simulcast&&(g.simulcast=!0);void 0!==a.simulcastRid&&0<=["r0","r1","r2"].indexOf(a.simulcastRid)&&(g.simulcast_rid=a.simulcastRid)}"clientId"in a&&void 0!==a.clientId&&(g.client_id=a.clientId),"dataChannelSignaling"in a&&"boolean"==typeof a.dataChannelSignaling&&(g.data_channel_signaling=a.dataChannelSignaling),"ignoreDisconnectWebSocket"in a&&"boolean"==typeof a.ignoreDisconnectWebSocket&&(g.ignore_disconnect_websocket=a.ignoreDisconnectWebSocket);const o=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],d=["videoCodecType","videoBitRate"],s=Object.assign({},a);Object.keys(s).forEach(e=>{"audio"===e&&"boolean"==typeof s[e]||"video"===e&&"boolean"==typeof s[e]||0<=o.indexOf(e)&&null!==s[e]||0<=l.indexOf(e)&&null!==s[e]||0<=d.indexOf(e)&&null!==s[e]||delete s[e]}),void 0!==s.audio&&(g.audio=s.audio);const C=Object.keys(s).some(e=>0<=o.indexOf(e));g.audio&&C&&(g.audio={},"audioCodecType"in s&&(g.audio.codec_type=s.audioCodecType),"audioBitRate"in s&&(g.audio.bit_rate=s.audioBitRate));const I=Object.keys(s).some(e=>0<=l.indexOf(e));g.audio&&I&&("object"!=typeof g.audio&&(g.audio={}),g.audio.opus_params={},"audioOpusParamsChannels"in s&&(g.audio.opus_params.channels=s.audioOpusParamsChannels),"audioOpusParamsClockRate"in s&&(g.audio.opus_params.clock_rate=s.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in s&&(g.audio.opus_params.maxplaybackrate=s.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in s&&(g.audio.opus_params.stereo=s.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in s&&(g.audio.opus_params.sprop_stereo=s.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in s&&(g.audio.opus_params.minptime=s.audioOpusParamsMinptime),"audioOpusParamsPtime"in s&&(g.audio.opus_params.ptime=s.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in s&&(g.audio.opus_params.useinbandfec=s.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in s&&(g.audio.opus_params.usedtx=s.audioOpusParamsUsedtx)),void 0!==s.video&&(g.video=s.video);const r=Object.keys(s).some(e=>0<=d.indexOf(e));if(g.video&&r&&(g.video={},"videoCodecType"in s&&(g.video.codec_type=s.videoCodecType),"videoBitRate"in s&&(g.video.bit_rate=s.videoBitRate)),g.simulcast&&!c()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===a.e2ee){if(void 0===g.signaling_notify_metadata&&(g.signaling_notify_metadata={}),null===g.signaling_notify_metadata||"object"!=typeof g.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===g.video&&(g.video={}),g.video&&(g.video.codec_type="VP8"),g.e2ee=!0}return g}function I(e){if(e.authn_metadata!==void 0)return e.authn_metadata;return void 0===e.metadata?null:e.metadata}function r(e){if(e.data&&Array.isArray(e.data))return e.data;return e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}function m(e){return"object"==typeof e&&null!==e&&"pre_key_bundle"in e?e.pre_key_bundle:null}function A(e,n,i){const t=e=>{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),t(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let a="";window.performance&&(a="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(a=a+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(a+" "+n),t(i),console.groupEnd()):console.log(a+" "+n+"\n",i)}function Z(e,n,i){const t=new Event(e);try{t.data=JSON.parse(JSON.stringify(n))}catch(e){t.data=n}return t.transportType=i,t}function u(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function b(e,n,i,t,a){const g=new Event(e);try{g.data=JSON.parse(JSON.stringify(n))}catch(e){g.data=n}return g.logType=i,g.dataChannelId=t,g.dataChannelLabel=a,g}class p{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludD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YWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,t=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:t},[i,t])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,t=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:t},[i,t])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,t=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:t})}startSession(e,n){const[i,t]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(t)throw t;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(g(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var V=Uint8Array,S=Uint16Array,G=Uint32Array,W=new V([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h=new 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,0,0]),y=new V([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),k=function(e,n){for(var t=new S(31),a=0;31>a;++a)t[a]=n+=1<a;++a)for(var o=t[a];oN;++N)X=(43690&N)>>>1|(21845&N)<<1,X=(52428&X)>>>2|(13107&X)<<2,X=(61680&X)>>>4|(3855&X)<<4,Y[N]=((65280&X)>>>8|(255&X)<<8)>>>1;for(var E=function(e,n,t){for(var a=e.length,g=0,o=new S(n);g>>15-n]=c}else for(d=new S(a),g=0;g>>15-e[g]);return d},v=new V(288),N=0;144>N;++N)v[N]=8;for(var N=144;256>N;++N)v[N]=9;for(var N=256;280>N;++N)v[N]=7;for(var N=280;288>N;++N)v[N]=8;for(var O=new V(32),N=0;32>N;++N)O[N]=5;var K=E(v,9,0),L=E(v,9,1),F=E(O,5,0),J=E(O,5,1),U=function(e){for(var n=e[0],t=1;tn&&(n=e[t]);return n},Q=function(e,n,i){var t=0|n/8;return(e[t]|e[t+1]<<8)>>(7&n)&i},D=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},H=function(e){return 0|(e+7)/8},M=function(i,t,a){(null==t||0>t)&&(t=0),(null==a||a>i.length)&&(a=i.length);var g=new(i instanceof S?S:i instanceof G?G:V)(a-t);return g.set(i.subarray(t,a)),g},P=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],j=function(n,i,t){var a=new Error(i||P[n]);if(a.code=n,Error.captureStackTrace&&Error.captureStackTrace(a,j),!t)throw a;return a},z=function(g,o,C){var I=g.length;if(!I||C&&C.f&&!C.l)return o||new V(0);var m=!o||C,A=!C||C.i;C||(C={}),o||(o=new V(3*I));var Z=function(e){var n=o.length;if(e>n){var i=new V(a(2*n,e));i.set(o),o=i}},u=C.f||0,p=C.p||0,S=C.b||0,G=C.l,k=C.d,w=C.m,R=C.n,X=8*I;do{if(!G){u=Q(g,p,1);var f=Q(g,p+1,3);if(p+=3,!f){var T=H(p)+4,Y=g[T-4]|g[T-3]<<8,l=T+Y;if(l>I){A&&j(0);break}m&&Z(S+Y),o.set(g.subarray(T,l),S),C.b=S+=Y,C.p=p=8*l,C.f=u;continue}else if(1==f)G=L,k=J,w=9,R=5;else if(2==f){var t=Q(g,p,31)+257,N=Q(g,p+10,15)+4,v=t+Q(g,p+5,31)+1;p+=14;for(var O=new V(v),K=new V(19),F=0;F>>4;if(16>T)O[F++]=T;else{var _=0,q=0;for(16==T?(q=3+Q(g,p,3),p+=2,_=O[F-1]):17==T?(q=3+Q(g,p,7),p+=3):18==T&&(q=11+Q(g,p,127),p+=7);q--;)O[F++]=_}}var $=O.subarray(0,t),ee=O.subarray(t);w=U($),R=U(ee),G=E($,w,1),k=E(ee,R,1)}else j(1);if(p>X){A&&j(0);break}}m&&Z(S+131072);for(var ne=(1<>>4;if(p+=15&_,p>X){A&&j(0);break}if(_||j(2),256>ae)o[S++]=ae;else if(256==ae){te=p,G=null;break}else{var ge=ae-254;if(264>>4;le||j(3),p+=15≤var ee=B[d];if(3X){A&&j(0);break}m&&Z(S+131072);for(var de=S+ge;S>>8},q=function(e,n,i){i<<=7&n;var t=0|n/8;e[t]|=i,e[t+1]|=i>>>8,e[t+2]|=i>>>16},$=function(e,n){for(var a=[],t=0;tA&&(A=o[t].s);var Z=new S(A+1),u=ee(a[I-1],Z,0);if(u>n){var t=0,b=0,p=u-n;for(o.sort(function(e,n){return Z[n.s]-Z[e.s]||e.f-n.f});tn)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var ee,f=0;f>>5),C+=x[f]>>>12)}}else Q=K,D=v,j=F,H=O;for(var f=0;f>>18;q(n,C,Q[ee+257]),C+=D[ee+257],7>>23),C+=W[ee]);var ae=31&a[f];q(n,C,j[ae]),C+=H[ae],3>>5),C+=h[ae])}else q(n,C,Q[a[f]]),C+=D[a[f]];return q(n,C,Q[256]),C+D[256]},ge=new G([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oe=new V(0),le=function(a,g,c,C,I,r){var m=a.length,s=new V(C+m+5*(1+t(m/7e3))+I),o=s.subarray(C,s.length-I),A=0;if(!g||8>m)for(var Z,u=0;u<=m;u+=65535)Z=u+65535,ZQ;++Q)B[Q]=0;for(var Q=0;30>Q;++Q)Y[Q]=0}var D=2,x=0,P=8191&b,z=32767&F-J;if(2>>13,U)-1,q=n(32767,u),$=n(258,U);z<=q&&--P&&F!=J;){if(a[u+D]==a[u+D-z]){for(var ee=0;ee<$&&a[u+ee]==a[u+ee-z];++ee);if(ee>D){if(D=ee,x=z,ee>_)break;for(var ne=n(z,ee-2),ie=0,Q=0;Qie&&(ie=ce,J=le)}}}F=J,J=y[F],z+=32767&F-J+32768}if(x){f[v++]=268435456|R[D]<<18|T[x];var se=31&R[D],Ce=31&T[x];E+=W[se]+h[Ce],++B[257+se],++Y[Ce],O=u+D,++N}else f[v++]=a[u],++B[a[u]]}}A=ae(a,o,r,f,B,Y,E,v,K,u-K,A),!r&&7&A&&(A=te(o,A+1,oe))}return M(s,0,C+H(A)+I)},de=function(){var t=1,g=0;return{p:function(a){for(var o,d=t,c=g,s=0|a.length,l=0;l!=s;){for(o=n(l+2655,s);l>16),c=(65535&c)+15*(c>>16)}t=d,g=c},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},ce=function(e,i,g,o,l){return le(e,null==i.level?6:i.level,null==i.mem?t(1.5*a(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!l)},se=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},Ce=function(e,n){var i=n.level,t=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=t<<6|(t?32-2*t:1)},Ie=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&j(6,"invalid zlib data"),32&e[1]&&j(6,"invalid zlib data: preset dictionaries not supported")},re="undefined"!=typeof TextDecoder&&new TextDecoder,me=0;try{re.decode(oe,{stream:!0}),me=1}catch(n){}class Ae extends Error{}class Ze{constructor(e,n,i,t,a,g){this.role=n,this.channelId=i,this.metadata=t,this.signalingUrl=e,this.options=a,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.dataChannelsCompress={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const t={type:"disconnect",reason:e};this.ws.send(JSON.stringify(t)),this.writeWebSocketSignalingLog("send-disconnect",t),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const t=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),a=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(t),e(),n({code:4999,reason:""}));a.push((()=>new Promise(e=>{let n=0;const t=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(t),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(t))},100)}))())}}Promise.all(a).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(t)});const g={type:"disconnect",reason:"NO-ERROR"};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new p,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}signaling(e){return this.trace("CREATE OFFER",e),new Promise((n,i)=>{null===this.ws&&(this.ws=new WebSocket(this.signalingUrl),this.writeWebSocketSignalingLog("new-websocket",this.signalingUrl)),this.ws.binaryType="arraybuffer",this.ws.onclose=async e=>{const n=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),i(n)},this.ws.onopen=async()=>{this.writeWebSocketSignalingLog("onopen");let n;try{n=C(e.sdp||"",this.role,this.channelId,this.metadata,this.options)}catch(e){return void i(e)}if(n.e2ee&&this.e2ee){const e=await this.e2ee.init();n.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",n),this.ws&&(this.ws.send(JSON.stringify(n)),this.writeWebSocketSignalingLog(`send-${n.type}`,n))},this.ws.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const i=JSON.parse(e.data);"offer"==i.type?(this.writeWebSocketSignalingLog("onmessage-offer",i),this.signalingOnMessageTypeOffer(i),n(i)):"update"==i.type?(this.writeWebSocketSignalingLog("onmessage-update",i),await this.signalingOnMessageTypeUpdate(i)):"re-offer"==i.type?(this.writeWebSocketSignalingLog("onmessage-re-offer",i),await this.signalingOnMessageTypeReOffer(i)):"ping"==i.type?await this.signalingOnMessageTypePing(i):"push"==i.type?this.callbacks.push(i,"websocket"):"notify"==i.type?("connection.created"===i.event_type?this.writeWebSocketTimelineLog("notify-connection.created",i):"connection.destroyed"===i.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",i),this.signalingOnMessageTypeNotify(i,"websocket")):"switched"==i.type&&(this.writeWebSocketSignalingLog("onmessage-switched",i),this.signalingOnMessageTypeSwitched(i))}})}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(s()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new Ae(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&A(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(Z(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(Z(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=b(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const t=b(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(t)}writePeerConnectionTimelineLog(e,n){const i=b(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=b(e,n,"sora");this.callbacks.timeline(i)}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.dataChannelsCompress[n.label]=n.compress;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=I(e),t=m(i);if(t&&this.e2ee&&n){const e=this.e2ee.startSession(n,t);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=r(e);i.forEach(e=>{const n=I(e),i=m(n),t=e.connection_id;t&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(t,i)})}else if("connection.destroyed"===e.event_type){const n=I(e),i=m(n),t=e.connection_id;if(i&&this.e2ee&&t){const e=this.e2ee.stopSession(t);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(t)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,u(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.signaling){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const t=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${t.type}`,n,t),"re-offer"===t.type&&(await this.signalingOnMessageTypeReOffer(t))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.notify){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const t=JSON.parse(i);"connection.created"===t.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,t):"connection.destroyed"===t.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,t),this.signalingOnMessageTypeNotify(t,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(!0===this.dataChannelsCompress.push){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label&&(e.channel.onmessage=async e=>{let n=e.data;if(!0===this.dataChannelsCompress.stats){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}})}sendMessage(e){if(this.dataChannels.signaling){if(!0===this.dataChannelsCompress.signaling){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(!0===this.dataChannelsCompress.stats){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const t=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new t(e,n,i)}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}}class ue extends Ze{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.createOffer(),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.createOffer(),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class be extends Ze{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.createOffer(),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p / 8) | 0) + (p & 7 && 1); };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && !st.l && sl < 5))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n st.f = final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, data, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : setTimeout;\n/**\n * Asynchronously decompresses a ZIP archive\n * @param data The raw compressed ZIP file\n * @param cb The callback to call with the decompressed files\n * @returns A function that can be used to immediately terminate the unzipping\n */\nexport function unzip(data, cb) {\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @returns The decompressed files\n */\nexport function unzipSync(data) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.1.0\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ub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ci5kZWNvZGUoY29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5U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ZGF0YTsKICAgIGlmICh0eXBlID09PSAic2VsZlNlY3JldEtleU1hdGVyaWFsIikgewogICAgICAgIGNvbnN0IHsgc2VsZlNlY3JldEtleU1hdGVyaWFsLCBzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdhaXRpbmdUaW1lIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIG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gICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.1.0\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport default SoraE2EE;\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAAX,CACNA,MAAM,CAACD,MAAP,CAAgBC,MADV,KAEA,IAAoB,WAAhB,QAAOC,CAAAA,IAAX,CACNA,IAAI,CAACF,MAAL,CAAcE,IADR,KAGN,MAAM,IAAIC,CAAAA,KAAJ,CAAU,+DAAV,CAAN,CAOD,GAJKH,MAAM,CAACI,OAAR,EAAsC,WAAnB,QAAOA,CAAAA,OAI9B,GAHCJ,MAAM,CAACI,OAAP,CAAiBA,OAGlB,EAAI,CAACJ,MAAM,CAACK,EAAR,EAAcL,MAAM,CAACI,OAAzB,CAAkC,CACjC,KAAMC,CAAAA,CAAE,CAAGD,OAAO,CAAC,IAAD,CAAlB,CACwB,CAApB,GAAAE,MAAM,CAACC,IAAP,CAAYF,CAAZ,CAF6B,GAGhCL,MAAM,CAACK,EAAP,CAAYA,CAHoB,CAKjC,CAED,KAAMG,CAAAA,CAAM,CAAG,IAAM,CACpB,KAAMC,CAAAA,CAAG,CAAG,GAAIN,CAAAA,KAAJ,CAAU,iBAAV,CAAZ,CAEA,MADAM,CAAAA,CAAG,CAACC,IAAJ,CAAW,QACX,CAAOD,CACP,CAJD,CAMA,GAAI,CAACT,MAAM,CAACK,EAAZ,CAAgB,CACf,GAAIM,CAAAA,CAAS,CAAG,EAAhB,CACAX,MAAM,CAACK,EAAP,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c,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file +{"version":3,"file":"sora.min.js","sources":["../packages/sdk/node_modules/fflate/esm/browser.js","../packages/go-wasm/src/wasm_exec.js","../packages/e2ee/dist/sora_e2ee.mjs"],"sourcesContent":["// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([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, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([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, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.1.0\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY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CwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.1.0\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAAX,CACNA,MAAM,CAACD,MAAP,CAAgBC,MADV,KAEA,IAAoB,WAAhB,QAAOC,CAAAA,IAAX,CACNA,IAAI,CAACF,MAAL,CAAcE,IADR,KAGN,MAAM,IAAIC,CAAAA,KAAJ,CAAU,+DAAV,CAAN,CAOD,GAJKH,MAAM,CAACI,OAAR,EAAsC,WAAnB,QAAOA,CAAAA,OAI9B,GAHCJ,MAAM,CAACI,OAAP,CAAiBA,OAGlB,EA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mB,CAAlC,CACtB,EAEG5E,EAAG,CAAG,SAAUP,CAAV,CAAa,EACA,CAAf,GAAQ,EAAP,CAAAA,CAAC,CAAC,CAAD,CAAF,GAAmC,CAAf,CAACA,CAAC,CAAC,CAAD,CAAD,GAAS,CAA9B,EAAyC,CAACA,CAAC,CAAC,CAAD,CAAD,EAAQ,CAAR,CAAYA,CAAC,CAAC,CAAD,CAAd,EAAqB,EAD/C,GAEfhN,CAAG,CAAC,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file diff --git a/dist/sora.mjs b/dist/sora.mjs index 4ef69ee2..9c54ce3c 100644 --- a/dist/sora.mjs +++ b/dist/sora.mjs @@ -900,7 +900,7 @@ var bits16 = function (d, p) { return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7)); }; // get end of byte -var shft = function (p) { return ((p / 8) | 0) + (p & 7 && 1); }; +var shft = function (p) { return ((p + 7) / 8) | 0; }; // typed array slice - allows garbage collector to free original reference, // while being more compatible than .slice var slc = function (v, s, e) { @@ -944,7 +944,7 @@ var err = function (ind, msg, nt) { var inflt = function (dat, buf, st) { // source length var sl = dat.length; - if (!sl || (st && !st.l && sl < 5)) + if (!sl || (st && st.f && !st.l)) return buf || new u8(0); // have to estimate size var noBuf = !buf || st; @@ -973,7 +973,7 @@ var inflt = function (dat, buf, st) { do { if (!lm) { // BFINAL - this is only 1 when last chunk is next - st.f = final = bits(dat, pos, 1); + final = bits(dat, pos, 1); // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman var type = bits(dat, pos + 1, 3); pos += 3; @@ -991,7 +991,7 @@ var inflt = function (dat, buf, st) { // Copy over uncompressed data buf.set(dat.subarray(s, t), bt); // Get new bitpos, update byte count - st.b = bt += l, st.p = pos = t * 8; + st.b = bt += l, st.p = pos = t * 8, st.f = final; continue; } else if (type == 1) @@ -1113,7 +1113,7 @@ var inflt = function (dat, buf, st) { bt = end; } } - st.l = lm, st.p = lpos, st.b = bt; + st.l = lm, st.p = lpos, st.b = bt, st.f = final; if (lm) final = 1, st.m = lbt, st.d = dm, st.n = dbt; } while (!final); @@ -1473,7 +1473,7 @@ var adler = function () { p: function (d) { // closures have awful performance var n = a, m = b; - var l = d.length; + var l = d.length | 0; for (var i = 0; i != l;) { var e = Math.min(i + 2655, l); for (; i < e; ++i) @@ -3517,4 +3517,4 @@ var sora = { }, }; -export default sora; +export { sora as default }; From 15ba0c8a389a3417dddc4533ebeaaf0a208d2eec Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 27 Aug 2021 12:46:40 +0900 Subject: [PATCH 11/87] =?UTF-8?q?type:=20redirect=20=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 18 ++++++++++++++++++ packages/sdk/src/types.ts | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 9e9dc677..452b35ec 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -23,6 +23,7 @@ import { SignalingPingMessage, SignalingPushMessage, SignalingReOfferMessage, + SignalingRedirectMessage, SignalingReqStatsMessage, SignalingSwitchedMessage, SignalingUpdateMessage, @@ -738,6 +739,10 @@ export default class ConnectionBase { } else if (message.type == "switched") { this.writeWebSocketSignalingLog("onmessage-switched", message); this.signalingOnMessageTypeSwitched(message); + } else if (message.type == "redirect") { + this.writeWebSocketSignalingLog("onmessage-redirect", message); + const redirectMessage = await this.signalingOnMessageTypeRedirect(message); + resolve(redirectMessage); } }; }); @@ -1226,6 +1231,19 @@ export default class ConnectionBase { } } + private async signalingOnMessageTypeRedirect(message: SignalingRedirectMessage): Promise { + if (this.ws) { + this.ws.onclose = null; + this.ws.onerror = null; + this.ws.close(); + this.ws = null; + } + this.signalingUrl = message.location; + const offer = await this.createOffer(); + const signalingMessage = await this.signaling(offer); + return signalingMessage; + } + private async setSenderParameters( transceiver: RTCRtpTransceiver, encodings: RTCRtpEncodingParameters[] diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 60534778..7f1cce38 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -69,7 +69,8 @@ export type SignalingMessage = | SignalingPushMessage | SignalingNotifyMessage | SignalingReqStatsMessage - | SignalingSwitchedMessage; + | SignalingSwitchedMessage + | SignalingRedirectMessage; export type SignalingOfferMessage = { type: "offer"; @@ -120,6 +121,11 @@ export type SignalingSwitchedMessage = { ignore_disconnect_websocket: boolean; }; +export type SignalingRedirectMessage = { + type: "redirect"; + location: string; +}; + export type SignalingNotifyMessage = | SignalingNotifyConnectionCreated | SignalingNotifyConnectionUpdated From 65389c1182924d8a872cee04865a7d39c854781c Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 27 Aug 2021 13:44:39 +0900 Subject: [PATCH 12/87] =?UTF-8?q?type:=20connect=20=E3=81=AE=20JSON=20?= =?UTF-8?q?=E3=81=AB=20redirect=20=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 7 ++++--- packages/sdk/src/types.ts | 1 + packages/sdk/src/utils.ts | 7 ++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 452b35ec..3e9fa8b0 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -663,7 +663,7 @@ export default class ConnectionBase { } } - protected signaling(offer: RTCSessionDescriptionInit): Promise { + protected signaling(offer: RTCSessionDescriptionInit, redirect = false): Promise { this.trace("CREATE OFFER", offer); return new Promise((resolve, reject) => { if (this.ws === null) { @@ -690,7 +690,8 @@ export default class ConnectionBase { this.role, this.channelId, this.metadata, - this.options + this.options, + redirect ); } catch (error) { reject(error); @@ -1240,7 +1241,7 @@ export default class ConnectionBase { } this.signalingUrl = message.location; const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const signalingMessage = await this.signaling(offer, true); return signalingMessage; } diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 7f1cce38..cb9c1298 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -59,6 +59,7 @@ export type SignalingConnectMessage = { spotlight_unfocus_rid?: SpotlightFocusRid; data_channel_signaling?: boolean; ignore_disconnect_websocket?: boolean; + redirect?: true; }; export type SignalingMessage = diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index b94ebee2..b5e904ed 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -64,7 +64,8 @@ export function createSignalingMessage( role: string, channelId: string | null | undefined, metadata: JSONType | undefined, - options: ConnectionOptions + options: ConnectionOptions, + redirect: boolean ): SignalingConnectMessage { if (role !== "sendrecv" && role !== "sendonly" && role !== "recvonly") { throw new Error("Unknown role type"); @@ -87,6 +88,10 @@ export function createSignalingMessage( message.metadata = metadata; } + if (redirect) { + message.redirect = true; + } + if ("signalingNotifyMetadata" in options) { message.signaling_notify_metadata = options.signalingNotifyMetadata; } From 2261782bbd22071c92268693104a5128e3896212 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 27 Aug 2021 14:02:40 +0900 Subject: [PATCH 13/87] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/tests/utils.test.ts | 93 +++++++++++++++++--------------- 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/packages/sdk/tests/utils.test.ts b/packages/sdk/tests/utils.test.ts index 4c934ce5..521c724b 100644 --- a/packages/sdk/tests/utils.test.ts +++ b/packages/sdk/tests/utils.test.ts @@ -1,6 +1,5 @@ -/* eslint @typescript-eslint/camelcase: 0 */ import { createSignalingMessage } from "../src/utils"; -import { AudioCodecType, SpotlightFocusRid, VideoCodecType } from "../src/types"; +import { AudioCodecType, VideoCodecType } from "../src/types"; const channelId = "7N3fsMHob"; const role = "sendonly"; @@ -22,29 +21,29 @@ const baseExpectedMessage = Object.freeze({ test("createSignalingMessage simple", () => { // sendonly - expect(createSignalingMessage(sdp, role, channelId, null, {})).toEqual(baseExpectedMessage); + expect(createSignalingMessage(sdp, role, channelId, null, {}, false)).toEqual(baseExpectedMessage); // recvonly const diff = { role: "recvonly", }; - expect(createSignalingMessage(sdp, "recvonly", channelId, null, {})).toEqual( + expect(createSignalingMessage(sdp, "recvonly", channelId, null, {}, false)).toEqual( Object.assign({}, baseExpectedMessage, diff) ); }); test("createSignalingMessage role", () => { expect(() => { - createSignalingMessage(sdp, "test", channelId, metadata, {}); + createSignalingMessage(sdp, "test", channelId, metadata, {}, false); }).toThrow(Error("Unknown role type")); }); test("createSignalingMessage channelId", () => { expect(() => { - createSignalingMessage(sdp, role, null, metadata, {}); + createSignalingMessage(sdp, role, null, metadata, {}, false); }).toThrow(Error("channelId can not be null or undefined")); expect(() => { - createSignalingMessage(sdp, role, undefined, metadata, {}); + createSignalingMessage(sdp, role, undefined, metadata, {}, false); }).toThrow(Error("channelId can not be null or undefined")); }); @@ -52,10 +51,10 @@ test("createSignalingMessage metadata", () => { const diff = { metadata: metadata, }; - expect(createSignalingMessage(sdp, role, channelId, metadata, {})).toEqual( + expect(createSignalingMessage(sdp, role, channelId, metadata, {}, false)).toEqual( Object.assign({}, baseExpectedMessage, diff) ); - expect(createSignalingMessage(sdp, role, channelId, null, {})).toEqual(baseExpectedMessage); + expect(createSignalingMessage(sdp, role, channelId, null, {}, false)).toEqual(baseExpectedMessage); }); test("createSignalingMessage clientId option", () => { @@ -65,7 +64,7 @@ test("createSignalingMessage clientId option", () => { const diff1 = { client_id: option1.clientId, }; - expect(createSignalingMessage(sdp, role, channelId, null, option1)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, option1, false)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); const option2 = { @@ -74,13 +73,13 @@ test("createSignalingMessage clientId option", () => { const diff2 = { client_id: option2.clientId, }; - expect(createSignalingMessage(sdp, role, channelId, null, option2)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, option2, false)).toEqual( Object.assign({}, baseExpectedMessage, diff2) ); const option3 = { clientId: undefined, }; - expect(createSignalingMessage(sdp, role, channelId, null, option3)).toEqual(baseExpectedMessage); + expect(createSignalingMessage(sdp, role, channelId, null, option3, false)).toEqual(baseExpectedMessage); }); test("createSignalingMessage multistream option", () => { @@ -91,7 +90,7 @@ test("createSignalingMessage multistream option", () => { const diff1 = { multistream: true, }; - expect(createSignalingMessage(sdp, role, channelId, null, options1)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); }); @@ -106,17 +105,17 @@ test("createSignalingMessage audio option", () => { const diff1 = { audio: false, }; - expect(createSignalingMessage(sdp, role, channelId, null, options1)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); const options2 = { audio: true, }; - expect(createSignalingMessage(sdp, role, channelId, null, options2)).toEqual(baseExpectedMessage); + expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual(baseExpectedMessage); const options3 = { audio: undefined, }; - expect(createSignalingMessage(sdp, role, channelId, null, options3)).toEqual(baseExpectedMessage); + expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual(baseExpectedMessage); const options4 = { audioCodecType: audioCodecType, audioBitRate: 100, @@ -127,7 +126,7 @@ test("createSignalingMessage audio option", () => { bit_rate: options4.audioBitRate, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options4)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options4, false)).toEqual( Object.assign({}, baseExpectedMessage, diff4) ); }); @@ -140,7 +139,7 @@ test("createSignalingMessage audio opus params option", () => { const diff1 = { audio: false, }; - expect(createSignalingMessage(sdp, role, channelId, null, options1)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); @@ -154,7 +153,7 @@ test("createSignalingMessage audio opus params option", () => { }, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options2)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual( Object.assign({}, baseExpectedMessage, diff2) ); @@ -168,7 +167,7 @@ test("createSignalingMessage audio opus params option", () => { }, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options3)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual( Object.assign({}, baseExpectedMessage, diff3) ); @@ -182,7 +181,7 @@ test("createSignalingMessage audio opus params option", () => { }, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options4)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options4, false)).toEqual( Object.assign({}, baseExpectedMessage, diff4) ); @@ -196,7 +195,7 @@ test("createSignalingMessage audio opus params option", () => { }, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options5)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options5, false)).toEqual( Object.assign({}, baseExpectedMessage, diff5) ); @@ -210,7 +209,7 @@ test("createSignalingMessage audio opus params option", () => { }, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options6)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options6, false)).toEqual( Object.assign({}, baseExpectedMessage, diff6) ); @@ -224,7 +223,7 @@ test("createSignalingMessage audio opus params option", () => { }, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options7)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options7, false)).toEqual( Object.assign({}, baseExpectedMessage, diff7) ); @@ -238,7 +237,7 @@ test("createSignalingMessage audio opus params option", () => { }, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options8)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options8, false)).toEqual( Object.assign({}, baseExpectedMessage, diff8) ); @@ -252,7 +251,7 @@ test("createSignalingMessage audio opus params option", () => { }, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options9)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options9, false)).toEqual( Object.assign({}, baseExpectedMessage, diff9) ); @@ -266,7 +265,7 @@ test("createSignalingMessage audio opus params option", () => { }, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options10)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options10, false)).toEqual( Object.assign({}, baseExpectedMessage, diff10) ); }); @@ -281,17 +280,17 @@ test("createSignalingMessage video option", () => { const diff1 = { video: false, }; - expect(createSignalingMessage(sdp, role, channelId, null, options1)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); const options2 = { video: true, }; - expect(createSignalingMessage(sdp, role, channelId, null, options2)).toEqual(baseExpectedMessage); + expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual(baseExpectedMessage); const options3 = { video: undefined, }; - expect(createSignalingMessage(sdp, role, channelId, null, options3)).toEqual(baseExpectedMessage); + expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual(baseExpectedMessage); const options4 = { videoCodecType: videoCodecType, videoBitRate: 100, @@ -302,7 +301,7 @@ test("createSignalingMessage video option", () => { bit_rate: options4.videoBitRate, }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options4)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options4, false)).toEqual( Object.assign({}, baseExpectedMessage, diff4) ); }); @@ -319,7 +318,7 @@ test("createSignalingMessage e2ee option", () => { }, signaling_notify_metadata: {}, }; - expect(createSignalingMessage(sdp, role, channelId, null, options1)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); const options2 = { @@ -332,7 +331,7 @@ test("createSignalingMessage e2ee option", () => { video: false, signaling_notify_metadata: {}, }; - expect(createSignalingMessage(sdp, role, channelId, null, options2)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual( Object.assign({}, baseExpectedMessage, diff2) ); const options3 = { @@ -347,7 +346,7 @@ test("createSignalingMessage e2ee option", () => { }, signaling_notify_metadata: {}, }; - expect(createSignalingMessage(sdp, role, channelId, null, options3)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual( Object.assign({}, baseExpectedMessage, diff3) ); const options4 = { @@ -362,7 +361,7 @@ test("createSignalingMessage e2ee option", () => { }, signaling_notify_metadata: {}, }; - expect(createSignalingMessage(sdp, role, channelId, null, options4)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options4, false)).toEqual( Object.assign({}, baseExpectedMessage, diff4) ); }); @@ -374,7 +373,7 @@ test("createSignalingMessage signalingMetadata option", () => { const diff1 = { signaling_notify_metadata: "metadata", }; - expect(createSignalingMessage(sdp, role, channelId, null, options1)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); const options2 = { @@ -383,7 +382,7 @@ test("createSignalingMessage signalingMetadata option", () => { const diff2 = { signaling_notify_metadata: { key: "value" }, }; - expect(createSignalingMessage(sdp, role, channelId, null, options2)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual( Object.assign({}, baseExpectedMessage, diff2) ); const options3 = { @@ -392,7 +391,7 @@ test("createSignalingMessage signalingMetadata option", () => { const diff3 = { signaling_notify_metadata: null, }; - expect(createSignalingMessage(sdp, role, channelId, null, options3)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual( Object.assign({}, baseExpectedMessage, diff3) ); }); @@ -404,7 +403,7 @@ test("createSignalingMessage dataChannelSignaling option", () => { const diff1 = { data_channel_signaling: true, }; - expect(createSignalingMessage(sdp, role, channelId, null, options1)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); const options2 = { @@ -413,7 +412,7 @@ test("createSignalingMessage dataChannelSignaling option", () => { const diff2 = { data_channel_signaling: false, }; - expect(createSignalingMessage(sdp, role, channelId, null, options2)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual( Object.assign({}, baseExpectedMessage, diff2) ); const options3 = { @@ -421,7 +420,7 @@ test("createSignalingMessage dataChannelSignaling option", () => { }; const diff3 = { }; - expect(createSignalingMessage(sdp, role, channelId, null, options3)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual( Object.assign({}, baseExpectedMessage, diff3) ); }); @@ -433,7 +432,7 @@ test("createSignalingMessage ignoreDisconnectWebSocket option", () => { const diff1 = { ignore_disconnect_websocket: true, }; - expect(createSignalingMessage(sdp, role, channelId, null, options1)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual( Object.assign({}, baseExpectedMessage, diff1) ); const options2 = { @@ -442,7 +441,7 @@ test("createSignalingMessage ignoreDisconnectWebSocket option", () => { const diff2 = { ignore_disconnect_websocket: false, }; - expect(createSignalingMessage(sdp, role, channelId, null, options2)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual( Object.assign({}, baseExpectedMessage, diff2) ); const options3 = { @@ -450,7 +449,13 @@ test("createSignalingMessage ignoreDisconnectWebSocket option", () => { }; const diff3 = { }; - expect(createSignalingMessage(sdp, role, channelId, null, options3)).toEqual( + expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual( Object.assign({}, baseExpectedMessage, diff3) ); }); + +test("createSignalingMessage redirect", () => { + expect(createSignalingMessage(sdp, role, channelId, null, {}, true)).toEqual( + Object.assign({}, baseExpectedMessage, { redirect: true }) + ); +}); From 8307a71dca084566523b00d16b3eb97ea22b69c7 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 30 Aug 2021 10:55:25 +0900 Subject: [PATCH 14/87] =?UTF-8?q?createOffer=20=E3=82=92=20signaling=20?= =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E5=86=85=E3=81=A7=E5=91=BC?= =?UTF-8?q?=E3=81=B6=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 40 +++++++++++++++++----------------- packages/sdk/src/publisher.ts | 6 ++--- packages/sdk/src/subscriber.ts | 6 ++--- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 3e9fa8b0..545d6495 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -663,7 +663,8 @@ export default class ConnectionBase { } } - protected signaling(offer: RTCSessionDescriptionInit, redirect = false): Promise { + protected async signaling(redirect = false): Promise { + const offer = await this.createOffer(); this.trace("CREATE OFFER", offer); return new Promise((resolve, reject) => { if (this.ws === null) { @@ -749,23 +750,6 @@ export default class ConnectionBase { }); } - protected async createOffer(): Promise { - const config = { iceServers: [] }; - const pc = new window.RTCPeerConnection(config); - if (isSafari()) { - pc.addTransceiver("video", { direction: "recvonly" }); - pc.addTransceiver("audio", { direction: "recvonly" }); - const offer = await pc.createOffer(); - pc.close(); - this.writePeerConnectionTimelineLog("create-offer", offer); - return offer; - } - const offer = await pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: true }); - pc.close(); - this.writePeerConnectionTimelineLog("create-offer", offer); - return offer; - } - protected async connectPeerConnection(message: SignalingOfferMessage): Promise { let config = Object.assign({}, message.config); if (this.e2ee) { @@ -1095,6 +1079,23 @@ export default class ConnectionBase { this.callbacks.timeline(event); } + private async createOffer(): Promise { + const config = { iceServers: [] }; + const pc = new window.RTCPeerConnection(config); + if (isSafari()) { + pc.addTransceiver("video", { direction: "recvonly" }); + pc.addTransceiver("audio", { direction: "recvonly" }); + const offer = await pc.createOffer(); + pc.close(); + this.writePeerConnectionTimelineLog("create-offer", offer); + return offer; + } + const offer = await pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: true }); + pc.close(); + this.writePeerConnectionTimelineLog("create-offer", offer); + return offer; + } + private signalingOnMessageE2EE(data: ArrayBuffer): void { if (this.e2ee) { const message = new Uint8Array(data); @@ -1240,8 +1241,7 @@ export default class ConnectionBase { this.ws = null; } this.signalingUrl = message.location; - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer, true); + const signalingMessage = await this.signaling(true); return signalingMessage; } diff --git a/packages/sdk/src/publisher.ts b/packages/sdk/src/publisher.ts index 20fe7f5b..23a266e3 100644 --- a/packages/sdk/src/publisher.ts +++ b/packages/sdk/src/publisher.ts @@ -29,8 +29,7 @@ export default class ConnectionPublisher extends ConnectionBase { private async singleStream(stream: MediaStream): Promise { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const signalingMessage = await this.signaling(); this.startE2EE(); await this.connectPeerConnection(signalingMessage); await this.setRemoteDescription(signalingMessage); @@ -57,8 +56,7 @@ export default class ConnectionPublisher extends ConnectionBase { private async multiStream(stream: MediaStream): Promise { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const signalingMessage = await this.signaling(); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { diff --git a/packages/sdk/src/subscriber.ts b/packages/sdk/src/subscriber.ts index f7f9b2a2..54f77711 100644 --- a/packages/sdk/src/subscriber.ts +++ b/packages/sdk/src/subscriber.ts @@ -32,8 +32,7 @@ export default class ConnectionSubscriber extends ConnectionBase { private async singleStream(): Promise { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const signalingMessage = await this.signaling(); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { @@ -90,8 +89,7 @@ export default class ConnectionSubscriber extends ConnectionBase { private async multiStream(): Promise { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const signalingMessage = await this.signaling(); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { From c0c731efb26296638fd5d8ee96e050117b60f90c Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Tue, 7 Sep 2021 12:12:31 +0900 Subject: [PATCH 15/87] =?UTF-8?q?signalingUrlCandidates=20=E5=AE=9F?= =?UTF-8?q?=E8=A3=85=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 202 ++++++++++++++++++++++++++------- packages/sdk/src/publisher.ts | 6 +- packages/sdk/src/sora.ts | 21 ++-- packages/sdk/src/subscriber.ts | 6 +- packages/sdk/src/types.ts | 1 + 5 files changed, 184 insertions(+), 52 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 545d6495..6e66ee77 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -45,7 +45,7 @@ export default class ConnectionBase { role: string; channelId: string; metadata: JSONType | undefined; - signalingUrl: string; + signalingUrlCandidates: string | string[]; options: ConnectionOptions; // eslint-disable-next-line @typescript-eslint/no-explicit-any constraints: any; @@ -70,6 +70,7 @@ export default class ConnectionBase { [key in string]?: boolean; }; private connectionTimeout: number; + private signalingCandidateTimeout: number; private disconnectWaitTimeout: number; private mids: { audio: string; @@ -77,7 +78,7 @@ export default class ConnectionBase { }; private signalingSwitched: boolean; constructor( - signalingUrl: string, + signalingUrlCandidates: string | string[], role: string, channelId: string, metadata: JSONType, @@ -87,7 +88,7 @@ export default class ConnectionBase { this.role = role; this.channelId = channelId; this.metadata = metadata; - this.signalingUrl = signalingUrl; + this.signalingUrlCandidates = signalingUrlCandidates; this.options = options; // connection timeout の初期値をセットする this.connectionTimeout = 60000; @@ -103,6 +104,11 @@ export default class ConnectionBase { if (typeof this.options.disconnectWaitTimeout === "number") { this.disconnectWaitTimeout = this.options.disconnectWaitTimeout; } + // signalingUrlCandidates に設定されている URL への接続チェック timeout の初期値をセットする + this.signalingCandidateTimeout = 3000; + if (typeof this.options.signalingCandidateTimeout === "number") { + this.signalingCandidateTimeout = this.options.signalingCandidateTimeout; + } this.constraints = null; this.debug = debug; this.clientId = null; @@ -663,16 +669,120 @@ export default class ConnectionBase { } } - protected async signaling(redirect = false): Promise { + protected async getSignalingWebSocket(signalingUrlCandidates: string | string[]): Promise { + if (typeof signalingUrlCandidates === "string") { + // signaling url の候補が文字列の場合 + const signalingUrl = signalingUrlCandidates; + return new Promise((resolve, reject) => { + const ws = new WebSocket(signalingUrl); + ws.onclose = (event): void => { + const error = new ConnectError( + `Signaling failed. CloseEventCode:${event.code} CloseEventReason:'${event.reason}'` + ); + error.code = event.code; + error.reason = event.reason; + this.writeWebSocketTimelineLog("onclose", error); + reject(error); + }; + ws.onopen = (_): void => { + resolve(ws); + }; + }); + } else if (Array.isArray(signalingUrlCandidates)) { + // signaling url の候補が Array の場合 + // すでに候補の WebSocket が発見されているかどうかのフラグ + let resolved = false; + const testSignalingUrlCandidate = (signalingUrl: string): Promise => { + return new Promise((resolve, reject) => { + const ws = new WebSocket(signalingUrl); + // 一定時間経過しても反応がなかった場合は処理を中断する + const timerId = setTimeout(() => { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "timeout", + url: ws.url, + }); + if (ws && !resolved) { + ws.onclose = null; + ws.onerror = null; + ws.onopen = null; + ws.close(); + reject(); + } + }, this.signalingCandidateTimeout); + ws.onclose = (event): void => { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "close", + url: ws.url, + message: `WebSocket closed`, + code: event.code, + reason: event.reason, + }); + if (ws) { + ws.close(); + } + clearInterval(timerId); + reject(); + }; + ws.onerror = (_): void => { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "error", + url: ws.url, + message: `Failed to connect WebSocket`, + }); + if (ws) { + ws.onclose = null; + ws.close(); + } + clearInterval(timerId); + reject(); + }; + ws.onopen = (_): void => { + if (ws) { + clearInterval(timerId); + if (resolved) { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "open", + url: ws.url, + selected: false, + }); + ws.onerror = null; + ws.onclose = null; + ws.onopen = null; + ws.close(); + reject(); + } else { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "open", + url: ws.url, + selected: true, + }); + ws.onerror = null; + ws.onclose = null; + ws.onopen = null; + resolved = true; + resolve(ws); + } + } + }; + }); + }; + try { + return await Promise.any(signalingUrlCandidates.map((signalingUrl) => testSignalingUrlCandidate(signalingUrl))); + } catch (e) { + throw new ConnectError("Signaling failed. All signaling URL candidates failed to connect"); + } + } + throw new ConnectError("Signaling failed. Invalid format signaling URL candidates"); + } + + protected async signaling(ws: WebSocket, redirect = false): Promise { const offer = await this.createOffer(); this.trace("CREATE OFFER", offer); return new Promise((resolve, reject) => { - if (this.ws === null) { - this.ws = new WebSocket(this.signalingUrl); - this.writeWebSocketSignalingLog("new-websocket", this.signalingUrl); - } - this.ws.binaryType = "arraybuffer"; - this.ws.onclose = async (event): Promise => { + this.writeWebSocketSignalingLog("new-websocket", ws.url); + // websocket の各 callback を設定する + ws.binaryType = "arraybuffer"; + ws.onclose = async (event): Promise => { const error = new ConnectError( `Signaling failed. CloseEventCode:${event.code} CloseEventReason:'${event.reason}'` ); @@ -682,34 +792,7 @@ export default class ConnectionBase { await this.signalingTerminate(); reject(error); }; - this.ws.onopen = async (_): Promise => { - this.writeWebSocketSignalingLog("onopen"); - let signalingMessage: SignalingConnectMessage; - try { - signalingMessage = createSignalingMessage( - offer.sdp || "", - this.role, - this.channelId, - this.metadata, - this.options, - redirect - ); - } catch (error) { - reject(error); - return; - } - if (signalingMessage.e2ee && this.e2ee) { - const initResult = await this.e2ee.init(); - // @ts-ignore signalingMessage の e2ee が true の場合は signalingNotifyMetadata が必ず object になる - signalingMessage["signaling_notify_metadata"]["pre_key_bundle"] = initResult; - } - this.trace("SIGNALING CONNECT MESSAGE", signalingMessage); - if (this.ws) { - this.ws.send(JSON.stringify(signalingMessage)); - this.writeWebSocketSignalingLog(`send-${signalingMessage.type}`, signalingMessage); - } - }; - this.ws.onmessage = async (event): Promise => { + ws.onmessage = async (event): Promise => { // E2EE 時専用処理 if (event.data instanceof ArrayBuffer) { this.writeWebSocketSignalingLog("onmessage-e2ee", event.data); @@ -747,6 +830,34 @@ export default class ConnectionBase { resolve(redirectMessage); } }; + // eslint-disable-next-line @typescript-eslint/no-floating-promises + (async () => { + let signalingMessage: SignalingConnectMessage; + try { + signalingMessage = createSignalingMessage( + offer.sdp || "", + this.role, + this.channelId, + this.metadata, + this.options, + redirect + ); + } catch (error) { + reject(error); + return; + } + if (signalingMessage.e2ee && this.e2ee) { + const initResult = await this.e2ee.init(); + // @ts-ignore signalingMessage の e2ee が true の場合は signalingNotifyMetadata が必ず object になる + signalingMessage["signaling_notify_metadata"]["pre_key_bundle"] = initResult; + } + this.trace("SIGNALING CONNECT MESSAGE", signalingMessage); + if (ws) { + ws.send(JSON.stringify(signalingMessage)); + this.writeWebSocketSignalingLog(`send-${signalingMessage.type}`, signalingMessage); + this.ws = ws; + } + })(); }); } @@ -1240,8 +1351,8 @@ export default class ConnectionBase { this.ws.close(); this.ws = null; } - this.signalingUrl = message.location; - const signalingMessage = await this.signaling(true); + const ws = await this.getSignalingWebSocket(message.location); + const signalingMessage = await this.signaling(ws, true); return signalingMessage; } @@ -1478,4 +1589,15 @@ export default class ConnectionBase { get video(): boolean { return this.getVideoTransceiver() !== null; } + + get signalingUrl(): string | string[] { + return this.signalingUrlCandidates; + } + + get connectedSignalingUrl(): string { + if (!this.ws) { + return ""; + } + return this.ws.url; + } } diff --git a/packages/sdk/src/publisher.ts b/packages/sdk/src/publisher.ts index 23a266e3..0c585955 100644 --- a/packages/sdk/src/publisher.ts +++ b/packages/sdk/src/publisher.ts @@ -29,7 +29,8 @@ export default class ConnectionPublisher extends ConnectionBase { private async singleStream(stream: MediaStream): Promise { await this.disconnect(); this.setupE2EE(); - const signalingMessage = await this.signaling(); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); await this.setRemoteDescription(signalingMessage); @@ -56,7 +57,8 @@ export default class ConnectionPublisher extends ConnectionBase { private async multiStream(stream: MediaStream): Promise { await this.disconnect(); this.setupE2EE(); - const signalingMessage = await this.signaling(); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { diff --git a/packages/sdk/src/sora.ts b/packages/sdk/src/sora.ts index 01c5c746..2f9bffe4 100644 --- a/packages/sdk/src/sora.ts +++ b/packages/sdk/src/sora.ts @@ -30,11 +30,11 @@ import type { } from "./types"; class SoraConnection { - signalingUrl: string; + signalingUrlCandidates: string | string[]; debug: boolean; - constructor(signalingUrl: string, debug = false) { - this.signalingUrl = signalingUrl; + constructor(signalingUrlCandidates: string | string[], debug = false) { + this.signalingUrlCandidates = signalingUrlCandidates; this.debug = debug; } @@ -43,7 +43,7 @@ class SoraConnection { metadata: JSONType = null, options: ConnectionOptions = { audio: true, video: true } ): ConnectionPublisher { - return new ConnectionPublisher(this.signalingUrl, "sendrecv", channelId, metadata, options, this.debug); + return new ConnectionPublisher(this.signalingUrlCandidates, "sendrecv", channelId, metadata, options, this.debug); } sendonly( @@ -51,7 +51,7 @@ class SoraConnection { metadata: JSONType = null, options: ConnectionOptions = { audio: true, video: true } ): ConnectionPublisher { - return new ConnectionPublisher(this.signalingUrl, "sendonly", channelId, metadata, options, this.debug); + return new ConnectionPublisher(this.signalingUrlCandidates, "sendonly", channelId, metadata, options, this.debug); } recvonly( @@ -59,7 +59,12 @@ class SoraConnection { metadata: JSONType = null, options: ConnectionOptions = { audio: true, video: true } ): ConnectionSubscriber { - return new ConnectionSubscriber(this.signalingUrl, "recvonly", channelId, metadata, options, this.debug); + return new ConnectionSubscriber(this.signalingUrlCandidates, "recvonly", channelId, metadata, options, this.debug); + } + + // @deprecated 後方互換のため残す + get signalingUrl(): string | string[] { + return this.signalingUrlCandidates; } } @@ -67,8 +72,8 @@ export default { initE2EE: async function (wasmUrl: string): Promise { await SoraE2EE.loadWasm(wasmUrl); }, - connection: function (signalingUrl: string, debug = false): SoraConnection { - return new SoraConnection(signalingUrl, debug); + connection: function (signalingUrlCandidates: string | string[], debug = false): SoraConnection { + return new SoraConnection(signalingUrlCandidates, debug); }, version: function (): string { return "__SORA_JS_SDK_VERSION__"; diff --git a/packages/sdk/src/subscriber.ts b/packages/sdk/src/subscriber.ts index 54f77711..934c174c 100644 --- a/packages/sdk/src/subscriber.ts +++ b/packages/sdk/src/subscriber.ts @@ -32,7 +32,8 @@ export default class ConnectionSubscriber extends ConnectionBase { private async singleStream(): Promise { await this.disconnect(); this.setupE2EE(); - const signalingMessage = await this.signaling(); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { @@ -89,7 +90,8 @@ export default class ConnectionSubscriber extends ConnectionBase { private async multiStream(): Promise { await this.disconnect(); this.setupE2EE(); - const signalingMessage = await this.signaling(); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index cb9c1298..129b14cf 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -268,6 +268,7 @@ export type ConnectionOptions = { dataChannelSignaling?: boolean; ignoreDisconnectWebSocket?: boolean; disconnectWaitTimeout?: number; + signalingCandidateTimeout?: number; }; export type Callbacks = { From 4be5ad5852cd237506a828e3e6d00d08839fc436 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Tue, 7 Sep 2021 12:12:41 +0900 Subject: [PATCH 16/87] =?UTF-8?q?CHANGES=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 046124fc..24e8c69b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,8 +10,20 @@ - バグ修正 ## develop +- [CHANGE] 複数 Signaling URL への接続に対応する + - Connection オブジェクト第一引数の type を `string` から `string | string[]` に変更する + - Connection オブジェクト signalingUrl プロパティの戻り値の type を `string` から `string | string[]` に変更する + - SendRecv オブジェクト signalingUrl プロパティの戻り値の type を `string` から `string | string[]` に変更する + - Connection オブジェクトに signalingUrlCandidates プロパティを追加する + - SendRecv オブジェクト に signalingUrlCandidates プロパティを追加する + - SendRecv オブジェクト に connectedSignalingUrl プロパティを追加する + - SendRecv オブジェクト に signalingCandidateTimeout オプションを追加する + - @yuitowest +- [UPDATE] type redirect 対応を追加する + - @yuitowest - [CHANGE] spotlight_legacy 対応を削除する - ConnectionOptions の spotlight オプションの型を boolean のみに変更する + - @yuitowest ## 2021.1.6 - [FIX] timeline ログに re-answer のログが出力されていなかったので修正する From 1e9a9905df6d8679922a91283b923ba1c366fa4e Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 8 Sep 2021 11:36:56 +0900 Subject: [PATCH 17/87] 2021.2.0-canary.0 --- dist/base.d.ts | 13 +- dist/sora.d.ts | 7 +- dist/sora.js | 279 +++++++++++++++++++++++++--------- dist/sora.min.js | 4 +- dist/sora.min.js.map | 2 +- dist/sora.mjs | 279 +++++++++++++++++++++++++--------- dist/types.d.ts | 8 +- dist/utils.d.ts | 2 +- lerna.json | 2 +- package.json | 2 +- packages/e2ee/package.json | 4 +- packages/go-wasm/package.json | 2 +- packages/sdk/package.json | 4 +- 13 files changed, 453 insertions(+), 155 deletions(-) diff --git a/dist/base.d.ts b/dist/base.d.ts index 77eee9a1..2eea0b4d 100644 --- a/dist/base.d.ts +++ b/dist/base.d.ts @@ -9,7 +9,7 @@ export default class ConnectionBase { role: string; channelId: string; metadata: JSONType | undefined; - signalingUrl: string; + signalingUrlCandidates: string | string[]; options: ConnectionOptions; constraints: any; debug: boolean; @@ -31,10 +31,11 @@ export default class ConnectionBase { }; private dataChannelsCompress; private connectionTimeout; + private signalingCandidateTimeout; private disconnectWaitTimeout; private mids; private signalingSwitched; - constructor(signalingUrl: string, role: string, channelId: string, metadata: JSONType, options: ConnectionOptions, debug: boolean); + constructor(signalingUrlCandidates: string | string[], role: string, channelId: string, metadata: JSONType, options: ConnectionOptions, debug: boolean); on(kind: T, callback: U): void; stopAudioTrack(stream: MediaStream): Promise; stopVideoTrack(stream: MediaStream): Promise; @@ -60,8 +61,8 @@ export default class ConnectionBase { disconnect(): Promise; protected setupE2EE(): void; protected startE2EE(): void; - protected signaling(offer: RTCSessionDescriptionInit): Promise; - protected createOffer(): Promise; + protected getSignalingWebSocket(signalingUrlCandidates: string | string[]): Promise; + protected signaling(ws: WebSocket, redirect?: boolean): Promise; protected connectPeerConnection(message: SignalingOfferMessage): Promise; protected setRemoteDescription(message: SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage): Promise; protected createAnswer(message: SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage): Promise; @@ -82,6 +83,7 @@ export default class ConnectionBase { protected writeDataChannelTimelineLog(eventType: string, channel: RTCDataChannel, data?: unknown): void; protected writePeerConnectionTimelineLog(eventType: string, data?: unknown): void; protected writeSoraTimelineLog(eventType: string, data?: unknown): void; + private createOffer; private signalingOnMessageE2EE; private signalingOnMessageTypeOffer; private sendUpdateAnswer; @@ -91,6 +93,7 @@ export default class ConnectionBase { private signalingOnMessageTypePing; private signalingOnMessageTypeNotify; private signalingOnMessageTypeSwitched; + private signalingOnMessageTypeRedirect; private setSenderParameters; private getStats; private onDataChannel; @@ -104,4 +107,6 @@ export default class ConnectionBase { get e2eeRemoteFingerprints(): Record | undefined; get audio(): boolean; get video(): boolean; + get signalingUrl(): string | string[]; + get connectedSignalingUrl(): string; } diff --git a/dist/sora.d.ts b/dist/sora.d.ts index 56b8393c..3ac63c87 100644 --- a/dist/sora.d.ts +++ b/dist/sora.d.ts @@ -4,16 +4,17 @@ import ConnectionSubscriber from "./subscriber"; import { applyMediaStreamConstraints } from "./helpers"; import type { AudioCodecType, Callbacks, ConnectionOptions, JSONType, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; declare class SoraConnection { - signalingUrl: string; + signalingUrlCandidates: string | string[]; debug: boolean; - constructor(signalingUrl: string, debug?: boolean); + constructor(signalingUrlCandidates: string | string[], debug?: boolean); sendrecv(channelId: string, metadata?: JSONType, options?: ConnectionOptions): ConnectionPublisher; sendonly(channelId: string, metadata?: JSONType, options?: ConnectionOptions): ConnectionPublisher; recvonly(channelId: string, metadata?: JSONType, options?: ConnectionOptions): ConnectionSubscriber; + get signalingUrl(): string | string[]; } declare const _default: { initE2EE: (wasmUrl: string) => Promise; - connection: (signalingUrl: string, debug?: boolean) => SoraConnection; + connection: (signalingUrlCandidates: string | string[], debug?: boolean) => SoraConnection; version: () => string; helpers: { applyMediaStreamConstraints: typeof applyMediaStreamConstraints; diff --git a/dist/sora.js b/dist/sora.js index 94b4b619..47fcbef6 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * @sora/sdk * undefined - * @version: 2021.1.6 + * @version: 2021.2.0-canary.0 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -604,7 +604,7 @@ /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.1.0 + * @version: 2021.2.0-canary.0 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -772,7 +772,7 @@ } } static version() { - return "2021.1.0"; + return "2021.2.0-canary.0"; } static wasmVersion() { return window.e2ee.version(); @@ -1590,7 +1590,7 @@ function isSafari() { return browser() === "safari"; } - function createSignalingMessage(offerSDP, role, channelId, metadata, options) { + function createSignalingMessage(offerSDP, role, channelId, metadata, options, redirect) { if (role !== "sendrecv" && role !== "sendonly" && role !== "recvonly") { throw new Error("Unknown role type"); } @@ -1599,7 +1599,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.1.6", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.0", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1610,6 +1610,9 @@ if (metadata !== undefined) { message.metadata = metadata; } + if (redirect) { + message.redirect = true; + } if ("signalingNotifyMetadata" in options) { message.signaling_notify_metadata = options.signalingNotifyMetadata; } @@ -1884,11 +1887,11 @@ } class ConnectionBase { - constructor(signalingUrl, role, channelId, metadata, options, debug) { + constructor(signalingUrlCandidates, role, channelId, metadata, options, debug) { this.role = role; this.channelId = channelId; this.metadata = metadata; - this.signalingUrl = signalingUrl; + this.signalingUrlCandidates = signalingUrlCandidates; this.options = options; // connection timeout の初期値をセットする this.connectionTimeout = 60000; @@ -1904,6 +1907,11 @@ if (typeof this.options.disconnectWaitTimeout === "number") { this.disconnectWaitTimeout = this.options.disconnectWaitTimeout; } + // signalingUrlCandidates に設定されている URL への接続チェック timeout の初期値をセットする + this.signalingCandidateTimeout = 3000; + if (typeof this.options.signalingCandidateTimeout === "number") { + this.signalingCandidateTimeout = this.options.signalingCandidateTimeout; + } this.constraints = null; this.debug = debug; this.clientId = null; @@ -2456,15 +2464,120 @@ this.e2ee.postSelfSecretKeyMaterial(this.connectionId, result.selfKeyId, result.selfSecretKeyMaterial); } } - signaling(offer) { + async getSignalingWebSocket(signalingUrlCandidates) { + if (typeof signalingUrlCandidates === "string") { + // signaling url の候補が文字列の場合 + const signalingUrl = signalingUrlCandidates; + return new Promise((resolve, reject) => { + const ws = new WebSocket(signalingUrl); + ws.onclose = (event) => { + const error = new ConnectError(`Signaling failed. CloseEventCode:${event.code} CloseEventReason:'${event.reason}'`); + error.code = event.code; + error.reason = event.reason; + this.writeWebSocketTimelineLog("onclose", error); + reject(error); + }; + ws.onopen = (_) => { + resolve(ws); + }; + }); + } + else if (Array.isArray(signalingUrlCandidates)) { + // signaling url の候補が Array の場合 + // すでに候補の WebSocket が発見されているかどうかのフラグ + let resolved = false; + const testSignalingUrlCandidate = (signalingUrl) => { + return new Promise((resolve, reject) => { + const ws = new WebSocket(signalingUrl); + // 一定時間経過しても反応がなかった場合は処理を中断する + const timerId = setTimeout(() => { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "timeout", + url: ws.url, + }); + if (ws && !resolved) { + ws.onclose = null; + ws.onerror = null; + ws.onopen = null; + ws.close(); + reject(); + } + }, this.signalingCandidateTimeout); + ws.onclose = (event) => { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "close", + url: ws.url, + message: `WebSocket closed`, + code: event.code, + reason: event.reason, + }); + if (ws) { + ws.close(); + } + clearInterval(timerId); + reject(); + }; + ws.onerror = (_) => { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "error", + url: ws.url, + message: `Failed to connect WebSocket`, + }); + if (ws) { + ws.onclose = null; + ws.close(); + } + clearInterval(timerId); + reject(); + }; + ws.onopen = (_) => { + if (ws) { + clearInterval(timerId); + if (resolved) { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "open", + url: ws.url, + selected: false, + }); + ws.onerror = null; + ws.onclose = null; + ws.onopen = null; + ws.close(); + reject(); + } + else { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "open", + url: ws.url, + selected: true, + }); + ws.onerror = null; + ws.onclose = null; + ws.onopen = null; + resolved = true; + resolve(ws); + } + } + }; + }); + }; + try { + return await Promise.any(signalingUrlCandidates.map((signalingUrl) => testSignalingUrlCandidate(signalingUrl))); + } + catch (e) { + throw new ConnectError("Signaling failed. All signaling URL candidates failed to connect"); + } + } + throw new ConnectError("Signaling failed. Invalid format signaling URL candidates"); + } + async signaling(ws, redirect = false) { + const offer = await this.createOffer(); this.trace("CREATE OFFER", offer); return new Promise((resolve, reject) => { - if (this.ws === null) { - this.ws = new WebSocket(this.signalingUrl); - this.writeWebSocketSignalingLog("new-websocket", this.signalingUrl); - } - this.ws.binaryType = "arraybuffer"; - this.ws.onclose = async (event) => { + this.writeWebSocketSignalingLog("new-websocket", ws.url); + // websocket の各 callback を設定する + ws.binaryType = "arraybuffer"; + ws.onclose = async (event) => { const error = new ConnectError(`Signaling failed. CloseEventCode:${event.code} CloseEventReason:'${event.reason}'`); error.code = event.code; error.reason = event.reason; @@ -2472,28 +2585,7 @@ await this.signalingTerminate(); reject(error); }; - this.ws.onopen = async (_) => { - this.writeWebSocketSignalingLog("onopen"); - let signalingMessage; - try { - signalingMessage = createSignalingMessage(offer.sdp || "", this.role, this.channelId, this.metadata, this.options); - } - catch (error) { - reject(error); - return; - } - if (signalingMessage.e2ee && this.e2ee) { - const initResult = await this.e2ee.init(); - // @ts-ignore signalingMessage の e2ee が true の場合は signalingNotifyMetadata が必ず object になる - signalingMessage["signaling_notify_metadata"]["pre_key_bundle"] = initResult; - } - this.trace("SIGNALING CONNECT MESSAGE", signalingMessage); - if (this.ws) { - this.ws.send(JSON.stringify(signalingMessage)); - this.writeWebSocketSignalingLog(`send-${signalingMessage.type}`, signalingMessage); - } - }; - this.ws.onmessage = async (event) => { + ws.onmessage = async (event) => { // E2EE 時専用処理 if (event.data instanceof ArrayBuffer) { this.writeWebSocketSignalingLog("onmessage-e2ee", event.data); @@ -2533,25 +2625,36 @@ this.writeWebSocketSignalingLog("onmessage-switched", message); this.signalingOnMessageTypeSwitched(message); } + else if (message.type == "redirect") { + this.writeWebSocketSignalingLog("onmessage-redirect", message); + const redirectMessage = await this.signalingOnMessageTypeRedirect(message); + resolve(redirectMessage); + } }; + // eslint-disable-next-line @typescript-eslint/no-floating-promises + (async () => { + let signalingMessage; + try { + signalingMessage = createSignalingMessage(offer.sdp || "", this.role, this.channelId, this.metadata, this.options, redirect); + } + catch (error) { + reject(error); + return; + } + if (signalingMessage.e2ee && this.e2ee) { + const initResult = await this.e2ee.init(); + // @ts-ignore signalingMessage の e2ee が true の場合は signalingNotifyMetadata が必ず object になる + signalingMessage["signaling_notify_metadata"]["pre_key_bundle"] = initResult; + } + this.trace("SIGNALING CONNECT MESSAGE", signalingMessage); + if (ws) { + ws.send(JSON.stringify(signalingMessage)); + this.writeWebSocketSignalingLog(`send-${signalingMessage.type}`, signalingMessage); + this.ws = ws; + } + })(); }); } - async createOffer() { - const config = { iceServers: [] }; - const pc = new window.RTCPeerConnection(config); - if (isSafari()) { - pc.addTransceiver("video", { direction: "recvonly" }); - pc.addTransceiver("audio", { direction: "recvonly" }); - const offer = await pc.createOffer(); - pc.close(); - this.writePeerConnectionTimelineLog("create-offer", offer); - return offer; - } - const offer = await pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: true }); - pc.close(); - this.writePeerConnectionTimelineLog("create-offer", offer); - return offer; - } async connectPeerConnection(message) { let config = Object.assign({}, message.config); if (this.e2ee) { @@ -2853,6 +2956,22 @@ const event = createTimelineEvent(eventType, data, "sora"); this.callbacks.timeline(event); } + async createOffer() { + const config = { iceServers: [] }; + const pc = new window.RTCPeerConnection(config); + if (isSafari()) { + pc.addTransceiver("video", { direction: "recvonly" }); + pc.addTransceiver("audio", { direction: "recvonly" }); + const offer = await pc.createOffer(); + pc.close(); + this.writePeerConnectionTimelineLog("create-offer", offer); + return offer; + } + const offer = await pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: true }); + pc.close(); + this.writePeerConnectionTimelineLog("create-offer", offer); + return offer; + } signalingOnMessageE2EE(data) { if (this.e2ee) { const message = new Uint8Array(data); @@ -2977,6 +3096,17 @@ this.writeWebSocketSignalingLog("close"); } } + async signalingOnMessageTypeRedirect(message) { + if (this.ws) { + this.ws.onclose = null; + this.ws.onerror = null; + this.ws.close(); + this.ws = null; + } + const ws = await this.getSignalingWebSocket(message.location); + const signalingMessage = await this.signaling(ws, true); + return signalingMessage; + } async setSenderParameters(transceiver, encodings) { const originalParameters = transceiver.sender.getParameters(); // @ts-ignore @@ -3200,6 +3330,15 @@ get video() { return this.getVideoTransceiver() !== null; } + get signalingUrl() { + return this.signalingUrlCandidates; + } + get connectedSignalingUrl() { + if (!this.ws) { + return ""; + } + return this.ws.url; + } } class ConnectionPublisher extends ConnectionBase { @@ -3231,8 +3370,8 @@ async singleStream(stream) { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); await this.setRemoteDescription(signalingMessage); @@ -3258,8 +3397,8 @@ async multiStream(stream) { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { @@ -3364,8 +3503,8 @@ async singleStream() { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { @@ -3421,8 +3560,8 @@ async multiStream() { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { @@ -3494,29 +3633,33 @@ } class SoraConnection { - constructor(signalingUrl, debug = false) { - this.signalingUrl = signalingUrl; + constructor(signalingUrlCandidates, debug = false) { + this.signalingUrlCandidates = signalingUrlCandidates; this.debug = debug; } sendrecv(channelId, metadata = null, options = { audio: true, video: true }) { - return new ConnectionPublisher(this.signalingUrl, "sendrecv", channelId, metadata, options, this.debug); + return new ConnectionPublisher(this.signalingUrlCandidates, "sendrecv", channelId, metadata, options, this.debug); } sendonly(channelId, metadata = null, options = { audio: true, video: true }) { - return new ConnectionPublisher(this.signalingUrl, "sendonly", channelId, metadata, options, this.debug); + return new ConnectionPublisher(this.signalingUrlCandidates, "sendonly", channelId, metadata, options, this.debug); } recvonly(channelId, metadata = null, options = { audio: true, video: true }) { - return new ConnectionSubscriber(this.signalingUrl, "recvonly", channelId, metadata, options, this.debug); + return new ConnectionSubscriber(this.signalingUrlCandidates, "recvonly", channelId, metadata, options, this.debug); + } + // @deprecated 後方互換のため残す + get signalingUrl() { + return this.signalingUrlCandidates; } } var sora = { initE2EE: async function (wasmUrl) { await SoraE2EE.loadWasm(wasmUrl); }, - connection: function (signalingUrl, debug = false) { - return new SoraConnection(signalingUrl, debug); + connection: function (signalingUrlCandidates, debug = false) { + return new SoraConnection(signalingUrlCandidates, debug); }, version: function () { - return "2021.1.6"; + return "2021.2.0-canary.0"; }, helpers: { applyMediaStreamConstraints, diff --git a/dist/sora.min.js b/dist/sora.min.js index 1707c154..75229044 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,8 +1,8 @@ /** * @sora/sdk * undefined - * @version: 2021.1.6 + * @version: 2021.2.0-canary.0 * @author: Shiguredo Inc. * @license: Apache-2.0 - **/(function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"==typeof globalThis?e||self:globalThis,e.Sora=n())})(this,function(){'use strict';var n=Math.min,t=Math.ceil,a=Math.max;function g(){(()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,t){n+=i.decode(t);const a=n.lastIndexOf("\n");return-1!=a&&(console.log(n.substr(0,a)),n=n.substr(a+1)),t.length},write(i,t,a,g,o,l){if(0!==a||g!==t.length||null!==o)return void l(e());const d=this.writeSync(i,t);l(null,d)},chmod(n,i,t){t(e())},chown(n,i,t,a){a(e())},close(n,i){i(e())},fchmod(n,i,t){t(e())},fchown(n,i,t,a){a(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,t){t(e())},lchown(n,i,t,a){a(e())},link(n,i,t){t(e())},lstat(n,i){i(e())},mkdir(n,i,t){t(e())},open(n,i,t,a){a(e())},read(n,i,t,a,g,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,t){t(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,t){t(e())},truncate(n,i,t){t(e())},unlink(n,i){i(e())},utimes(n,i,t,a){a(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},t=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},g=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let t=0;switch(typeof n){case"object":null!==n&&(t=1);break;case"string":t=2;break;case"symbol":t=3;break;case"function":t=4;}this.mem.setUint32(e+4,2146959360|t,!0),this.mem.setUint32(e,i,!0)},l=e=>{const n=t(e+0),i=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},d=e=>{const n=t(e+0),o=t(e+8),l=Array(o);for(let t=0;t{const n=t(e+0),a=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},s=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=t(e+8),a=t(e+16),g=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,g))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(s+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},t(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,c(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(g(e+8),c(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(g(e+8),c(e+16),g(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(g(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(g(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(g(e+8),t(e+16),g(e+24))},"syscall/js.valueCall":e=>{try{const n=g(e+8),i=Reflect.get(n,c(e+16)),t=d(e+32),a=Reflect.apply(i,n,t);e=this._inst.exports.getsp(),o(e+56,a),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=g(e+8),i=d(e+16),t=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,t),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=g(e+8),i=d(e+16),t=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,t),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(g(n+8).length))},"syscall/js.valuePrepareString":i=>{const t=n.encode(g(i+8)+"");o(i+16,t),e(i+24,t.length)},"syscall/js.valueLoadString":e=>{const n=g(e+8);l(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,g(e+8)instanceof g(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=l(n+8),t=g(n+32);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const a=t.subarray(0,i.length);i.set(a),e(n+40,a.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=g(n+8),t=l(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const a=t.subarray(0,i.length);i.set(a),e(n+40,a.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const t=e=>{const t=i,a=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,a.length).set(a),i+=a.length,0!=i%8&&(i+=8-i%8),t},a=this.argv.length,g=[];this.argv.forEach(e=>{g.push(t(e))}),g.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{g.push(t(`${e}=${this.env[e]}`))}),g.push(0);const l=i;g.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(a,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=de();i.p(e);var t=ce(e,n,2,4);return Ce(t,n),se(t,t.length-4,i.d()),t}function l(e,n){return z((Ie(e),e.subarray(2,-4)),n)}function d(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function c(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function s(){return"safari"===d()}function C(e,n,i,t,a){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const g={type:"connect",sora_client:"Sora JavaScript SDK 2021.1.6",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==t&&(g.metadata=t),"signalingNotifyMetadata"in a&&(g.signaling_notify_metadata=a.signalingNotifyMetadata),"multistream"in a&&!0===a.multistream&&(g.multistream=!0,"spotlight"in a&&(g.spotlight=a.spotlight,"spotlightNumber"in a&&(g.spotlight_number=a.spotlightNumber)),!0===g.spotlight)){const e=["none","r0","r1","r2"];void 0!==a.spotlightFocusRid&&0<=e.indexOf(a.spotlightFocusRid)&&(g.spotlight_focus_rid=a.spotlightFocusRid),void 0!==a.spotlightUnfocusRid&&0<=e.indexOf(a.spotlightUnfocusRid)&&(g.spotlight_unfocus_rid=a.spotlightUnfocusRid)}if("simulcast"in a||"simulcastRid"in a){"simulcast"in a&&!0===a.simulcast&&(g.simulcast=!0);void 0!==a.simulcastRid&&0<=["r0","r1","r2"].indexOf(a.simulcastRid)&&(g.simulcast_rid=a.simulcastRid)}"clientId"in a&&void 0!==a.clientId&&(g.client_id=a.clientId),"dataChannelSignaling"in a&&"boolean"==typeof a.dataChannelSignaling&&(g.data_channel_signaling=a.dataChannelSignaling),"ignoreDisconnectWebSocket"in a&&"boolean"==typeof a.ignoreDisconnectWebSocket&&(g.ignore_disconnect_websocket=a.ignoreDisconnectWebSocket);const o=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],d=["videoCodecType","videoBitRate"],s=Object.assign({},a);Object.keys(s).forEach(e=>{"audio"===e&&"boolean"==typeof s[e]||"video"===e&&"boolean"==typeof s[e]||0<=o.indexOf(e)&&null!==s[e]||0<=l.indexOf(e)&&null!==s[e]||0<=d.indexOf(e)&&null!==s[e]||delete s[e]}),void 0!==s.audio&&(g.audio=s.audio);const C=Object.keys(s).some(e=>0<=o.indexOf(e));g.audio&&C&&(g.audio={},"audioCodecType"in s&&(g.audio.codec_type=s.audioCodecType),"audioBitRate"in s&&(g.audio.bit_rate=s.audioBitRate));const I=Object.keys(s).some(e=>0<=l.indexOf(e));g.audio&&I&&("object"!=typeof g.audio&&(g.audio={}),g.audio.opus_params={},"audioOpusParamsChannels"in s&&(g.audio.opus_params.channels=s.audioOpusParamsChannels),"audioOpusParamsClockRate"in s&&(g.audio.opus_params.clock_rate=s.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in s&&(g.audio.opus_params.maxplaybackrate=s.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in s&&(g.audio.opus_params.stereo=s.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in s&&(g.audio.opus_params.sprop_stereo=s.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in s&&(g.audio.opus_params.minptime=s.audioOpusParamsMinptime),"audioOpusParamsPtime"in s&&(g.audio.opus_params.ptime=s.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in s&&(g.audio.opus_params.useinbandfec=s.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in s&&(g.audio.opus_params.usedtx=s.audioOpusParamsUsedtx)),void 0!==s.video&&(g.video=s.video);const r=Object.keys(s).some(e=>0<=d.indexOf(e));if(g.video&&r&&(g.video={},"videoCodecType"in s&&(g.video.codec_type=s.videoCodecType),"videoBitRate"in s&&(g.video.bit_rate=s.videoBitRate)),g.simulcast&&!c()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===a.e2ee){if(void 0===g.signaling_notify_metadata&&(g.signaling_notify_metadata={}),null===g.signaling_notify_metadata||"object"!=typeof g.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===g.video&&(g.video={}),g.video&&(g.video.codec_type="VP8"),g.e2ee=!0}return g}function I(e){if(e.authn_metadata!==void 0)return e.authn_metadata;return void 0===e.metadata?null:e.metadata}function r(e){if(e.data&&Array.isArray(e.data))return e.data;return e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}function m(e){return"object"==typeof e&&null!==e&&"pre_key_bundle"in e?e.pre_key_bundle:null}function A(e,n,i){const t=e=>{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),t(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let a="";window.performance&&(a="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(a=a+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(a+" "+n),t(i),console.groupEnd()):console.log(a+" "+n+"\n",i)}function Z(e,n,i){const t=new Event(e);try{t.data=JSON.parse(JSON.stringify(n))}catch(e){t.data=n}return t.transportType=i,t}function u(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function b(e,n,i,t,a){const g=new Event(e);try{g.data=JSON.parse(JSON.stringify(n))}catch(e){g.data=n}return g.logType=i,g.dataChannelId=t,g.dataChannelLabel=a,g}class p{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY29uc3QgcGFkZGluZ0xlbmd0aCA9IFVpbnQzMkFycmF5LkJZVEVTX1BFUl9FTEVNRU5UIC0gZGF0YVZpZXcuYnl0ZUxlbmd0aDsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGFkZGluZ0xlbmd0aDsgaSArPSAxKSB7CiAgICAgICAgbmV3RGF0YVZpZXcuc2V0VWludDgoaSwgMCk7CiAgICB9CiAgICBmb3IgKGxldCBpID0gcGFkZGluZ0xlbmd0aCwgaiA9IDA7IGkgPCBVaW50MzJBcnJheS5CWVRFU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0KZnVuY3Rpb24gc2lsZW5jZUZyYW1lKGVuY29kZWRGcmFtZSkgewogICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkLCByZWNlaXZlTWVzc2FnZSDlj5fkv6HliY3jga7loLTlkIgKICAgIGlmIChlbmNvZGVkRnJhbWUudHlwZSA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgLy8g6Z+z5aOw44Gv5pqX5Y+35YyW44Gv44GE44KL44Go6IGe44GR44Gf44KC44Gu44GY44KD44Gq44GE44Gu44Gn572u44GN5o+b44GI44KLCiAgICAgICAgY29uc3QgbmV3RGF0YSA9IG5ldyBBcnJheUJ1ZmZlcigzKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIE9wdXMg44K144Kk44Os44Oz44K544OV44Os44O844OgCiAgICAgICAgbmV3VWludDguc2V0KFsweGQ4LCAweGZmLCAweGZlXSk7CiAgICAgICAgZW5jb2RlZEZyYW1lLmRhdGEgPSBuZXdEYXRhOwogICAgfQogICAgZWxzZSB7CiAgICAgICAgLy8g5pig5YOP44GM5q2j5bi444GY44KD44Gq44GE44Gf44KBIFBMSSDjgrnjg4jjg7zjg6DjgYznmbrnlJ/jgZfjgabjgZfjgb7jgYYKICAgICAgICAvLyDjgZ3jga7jgZ/jgoEgMzIweDI0MCDjga7nnJ/jgaPpu5LjgarnlLvpnaLjgavnva7jgY3mj5vjgYjjgosKICAgICAgICBjb25zdCBuZXdEYXRhID0gbmV3IEFycmF5QnVmZmVyKDYwKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIHByZXR0aWVyLWlnbm9yZQogICAgICAgIG5ld1VpbnQ4LnNldChbMHhiMCwgMHgwNSwgMHgwMCwgMHg5ZCwgMHgwMSwgMHgyYSwgMHhhMCwgMHgwMCwgMHg1YSwgMHgwMCwKICAgICAgICAgICAgMHgzO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KSk7CiAgICAgICAgY29uc3Qgc2ZyYW1lSGVhZGVyID0gbmV3IFVpbnQ4QXJyYXkoc2ZyYW1lSGVhZGVyQnVmZmVyKTsKICAgICAgICBjb25zdCBjb25uZWN0aW9uSWQgPSB0ZXh0RGVjb2Rlci5kZWNvZGUoY29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAg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iAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgIC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5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,t=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:t},[i,t])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,t=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:t},[i,t])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,t=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:t})}startSession(e,n){const[i,t]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(t)throw t;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(g(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var V=Uint8Array,S=Uint16Array,G=Uint32Array,W=new V([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h=new 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,0,0]),y=new V([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),k=function(e,n){for(var t=new S(31),a=0;31>a;++a)t[a]=n+=1<a;++a)for(var o=t[a];oN;++N)X=(43690&N)>>>1|(21845&N)<<1,X=(52428&X)>>>2|(13107&X)<<2,X=(61680&X)>>>4|(3855&X)<<4,Y[N]=((65280&X)>>>8|(255&X)<<8)>>>1;for(var E=function(e,n,t){for(var a=e.length,g=0,o=new S(n);g>>15-n]=c}else for(d=new S(a),g=0;g>>15-e[g]);return d},v=new V(288),N=0;144>N;++N)v[N]=8;for(var N=144;256>N;++N)v[N]=9;for(var N=256;280>N;++N)v[N]=7;for(var N=280;288>N;++N)v[N]=8;for(var O=new V(32),N=0;32>N;++N)O[N]=5;var K=E(v,9,0),L=E(v,9,1),F=E(O,5,0),J=E(O,5,1),U=function(e){for(var n=e[0],t=1;tn&&(n=e[t]);return n},Q=function(e,n,i){var t=0|n/8;return(e[t]|e[t+1]<<8)>>(7&n)&i},D=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},H=function(e){return 0|(e+7)/8},M=function(i,t,a){(null==t||0>t)&&(t=0),(null==a||a>i.length)&&(a=i.length);var g=new(i instanceof S?S:i instanceof G?G:V)(a-t);return g.set(i.subarray(t,a)),g},P=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],j=function(n,i,t){var a=new Error(i||P[n]);if(a.code=n,Error.captureStackTrace&&Error.captureStackTrace(a,j),!t)throw a;return a},z=function(g,o,C){var I=g.length;if(!I||C&&C.f&&!C.l)return o||new V(0);var m=!o||C,A=!C||C.i;C||(C={}),o||(o=new V(3*I));var Z=function(e){var n=o.length;if(e>n){var i=new V(a(2*n,e));i.set(o),o=i}},u=C.f||0,p=C.p||0,S=C.b||0,G=C.l,k=C.d,w=C.m,R=C.n,X=8*I;do{if(!G){u=Q(g,p,1);var f=Q(g,p+1,3);if(p+=3,!f){var T=H(p)+4,Y=g[T-4]|g[T-3]<<8,l=T+Y;if(l>I){A&&j(0);break}m&&Z(S+Y),o.set(g.subarray(T,l),S),C.b=S+=Y,C.p=p=8*l,C.f=u;continue}else if(1==f)G=L,k=J,w=9,R=5;else if(2==f){var t=Q(g,p,31)+257,N=Q(g,p+10,15)+4,v=t+Q(g,p+5,31)+1;p+=14;for(var O=new V(v),K=new V(19),F=0;F>>4;if(16>T)O[F++]=T;else{var _=0,q=0;for(16==T?(q=3+Q(g,p,3),p+=2,_=O[F-1]):17==T?(q=3+Q(g,p,7),p+=3):18==T&&(q=11+Q(g,p,127),p+=7);q--;)O[F++]=_}}var $=O.subarray(0,t),ee=O.subarray(t);w=U($),R=U(ee),G=E($,w,1),k=E(ee,R,1)}else j(1);if(p>X){A&&j(0);break}}m&&Z(S+131072);for(var ne=(1<>>4;if(p+=15&_,p>X){A&&j(0);break}if(_||j(2),256>ae)o[S++]=ae;else if(256==ae){te=p,G=null;break}else{var ge=ae-254;if(264>>4;le||j(3),p+=15≤var ee=B[d];if(3X){A&&j(0);break}m&&Z(S+131072);for(var de=S+ge;S>>8},q=function(e,n,i){i<<=7&n;var t=0|n/8;e[t]|=i,e[t+1]|=i>>>8,e[t+2]|=i>>>16},$=function(e,n){for(var a=[],t=0;tA&&(A=o[t].s);var Z=new S(A+1),u=ee(a[I-1],Z,0);if(u>n){var t=0,b=0,p=u-n;for(o.sort(function(e,n){return Z[n.s]-Z[e.s]||e.f-n.f});tn)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var ee,f=0;f>>5),C+=x[f]>>>12)}}else Q=K,D=v,j=F,H=O;for(var f=0;f>>18;q(n,C,Q[ee+257]),C+=D[ee+257],7>>23),C+=W[ee]);var ae=31&a[f];q(n,C,j[ae]),C+=H[ae],3>>5),C+=h[ae])}else q(n,C,Q[a[f]]),C+=D[a[f]];return q(n,C,Q[256]),C+D[256]},ge=new G([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oe=new V(0),le=function(a,g,c,C,I,r){var m=a.length,s=new V(C+m+5*(1+t(m/7e3))+I),o=s.subarray(C,s.length-I),A=0;if(!g||8>m)for(var Z,u=0;u<=m;u+=65535)Z=u+65535,ZQ;++Q)B[Q]=0;for(var Q=0;30>Q;++Q)Y[Q]=0}var D=2,x=0,P=8191&b,z=32767&F-J;if(2>>13,U)-1,q=n(32767,u),$=n(258,U);z<=q&&--P&&F!=J;){if(a[u+D]==a[u+D-z]){for(var ee=0;ee<$&&a[u+ee]==a[u+ee-z];++ee);if(ee>D){if(D=ee,x=z,ee>_)break;for(var ne=n(z,ee-2),ie=0,Q=0;Qie&&(ie=ce,J=le)}}}F=J,J=y[F],z+=32767&F-J+32768}if(x){f[v++]=268435456|R[D]<<18|T[x];var se=31&R[D],Ce=31&T[x];E+=W[se]+h[Ce],++B[257+se],++Y[Ce],O=u+D,++N}else f[v++]=a[u],++B[a[u]]}}A=ae(a,o,r,f,B,Y,E,v,K,u-K,A),!r&&7&A&&(A=te(o,A+1,oe))}return M(s,0,C+H(A)+I)},de=function(){var t=1,g=0;return{p:function(a){for(var o,d=t,c=g,s=0|a.length,l=0;l!=s;){for(o=n(l+2655,s);l>16),c=(65535&c)+15*(c>>16)}t=d,g=c},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},ce=function(e,i,g,o,l){return le(e,null==i.level?6:i.level,null==i.mem?t(1.5*a(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!l)},se=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},Ce=function(e,n){var i=n.level,t=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=t<<6|(t?32-2*t:1)},Ie=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&j(6,"invalid zlib data"),32&e[1]&&j(6,"invalid zlib data: preset dictionaries not supported")},re="undefined"!=typeof TextDecoder&&new TextDecoder,me=0;try{re.decode(oe,{stream:!0}),me=1}catch(n){}class Ae extends Error{}class Ze{constructor(e,n,i,t,a,g){this.role=n,this.channelId=i,this.metadata=t,this.signalingUrl=e,this.options=a,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.dataChannelsCompress={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const t={type:"disconnect",reason:e};this.ws.send(JSON.stringify(t)),this.writeWebSocketSignalingLog("send-disconnect",t),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const t=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),a=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(t),e(),n({code:4999,reason:""}));a.push((()=>new Promise(e=>{let n=0;const t=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(t),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(t))},100)}))())}}Promise.all(a).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(t)});const g={type:"disconnect",reason:"NO-ERROR"};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new p,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}signaling(e){return this.trace("CREATE OFFER",e),new Promise((n,i)=>{null===this.ws&&(this.ws=new WebSocket(this.signalingUrl),this.writeWebSocketSignalingLog("new-websocket",this.signalingUrl)),this.ws.binaryType="arraybuffer",this.ws.onclose=async e=>{const n=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),i(n)},this.ws.onopen=async()=>{this.writeWebSocketSignalingLog("onopen");let n;try{n=C(e.sdp||"",this.role,this.channelId,this.metadata,this.options)}catch(e){return void i(e)}if(n.e2ee&&this.e2ee){const e=await this.e2ee.init();n.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",n),this.ws&&(this.ws.send(JSON.stringify(n)),this.writeWebSocketSignalingLog(`send-${n.type}`,n))},this.ws.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const i=JSON.parse(e.data);"offer"==i.type?(this.writeWebSocketSignalingLog("onmessage-offer",i),this.signalingOnMessageTypeOffer(i),n(i)):"update"==i.type?(this.writeWebSocketSignalingLog("onmessage-update",i),await this.signalingOnMessageTypeUpdate(i)):"re-offer"==i.type?(this.writeWebSocketSignalingLog("onmessage-re-offer",i),await this.signalingOnMessageTypeReOffer(i)):"ping"==i.type?await this.signalingOnMessageTypePing(i):"push"==i.type?this.callbacks.push(i,"websocket"):"notify"==i.type?("connection.created"===i.event_type?this.writeWebSocketTimelineLog("notify-connection.created",i):"connection.destroyed"===i.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",i),this.signalingOnMessageTypeNotify(i,"websocket")):"switched"==i.type&&(this.writeWebSocketSignalingLog("onmessage-switched",i),this.signalingOnMessageTypeSwitched(i))}})}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(s()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new Ae(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&A(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(Z(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(Z(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=b(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const t=b(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(t)}writePeerConnectionTimelineLog(e,n){const i=b(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=b(e,n,"sora");this.callbacks.timeline(i)}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.dataChannelsCompress[n.label]=n.compress;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=I(e),t=m(i);if(t&&this.e2ee&&n){const e=this.e2ee.startSession(n,t);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=r(e);i.forEach(e=>{const n=I(e),i=m(n),t=e.connection_id;t&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(t,i)})}else if("connection.destroyed"===e.event_type){const n=I(e),i=m(n),t=e.connection_id;if(i&&this.e2ee&&t){const e=this.e2ee.stopSession(t);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(t)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,u(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.signaling){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const t=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${t.type}`,n,t),"re-offer"===t.type&&(await this.signalingOnMessageTypeReOffer(t))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.notify){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const t=JSON.parse(i);"connection.created"===t.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,t):"connection.destroyed"===t.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,t),this.signalingOnMessageTypeNotify(t,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(!0===this.dataChannelsCompress.push){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label&&(e.channel.onmessage=async e=>{let n=e.data;if(!0===this.dataChannelsCompress.stats){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}})}sendMessage(e){if(this.dataChannels.signaling){if(!0===this.dataChannelsCompress.signaling){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(!0===this.dataChannelsCompress.stats){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const t=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new t(e,n,i)}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}}class ue extends Ze{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.createOffer(),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.createOffer(),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class be extends Ze{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.createOffer(),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,a){n+=i.decode(a);const t=n.lastIndexOf("\n");return-1!=t&&(console.log(n.substr(0,t)),n=n.substr(t+1)),a.length},write(i,a,t,g,o,d){if(0!==t||g!==a.length||null!==o)return void d(e());const l=this.writeSync(i,a);d(null,l)},chmod(n,i,a){a(e())},chown(n,i,a,t){t(e())},close(n,i){i(e())},fchmod(n,i,a){a(e())},fchown(n,i,a,t){t(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,a){a(e())},lchown(n,i,a,t){t(e())},link(n,i,a){a(e())},lstat(n,i){i(e())},mkdir(n,i,a){a(e())},open(n,i,a,t){t(e())},read(n,i,a,t,g,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,a){a(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,a){a(e())},truncate(n,i,a){a(e())},unlink(n,i){i(e())},utimes(n,i,a,t){t(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},t=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},g=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let a=0;switch(typeof n){case"object":null!==n&&(a=1);break;case"string":a=2;break;case"symbol":a=3;break;case"function":a=4;}this.mem.setUint32(e+4,2146959360|a,!0),this.mem.setUint32(e,i,!0)},d=e=>{const n=t(e+0),i=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},l=e=>{const n=t(e+0),o=t(e+8),d=Array(o);for(let a=0;a{const n=t(e+0),a=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},s=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=t(e+8),a=t(e+16),g=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,g))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(s+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},t(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(d(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,c(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(g(e+8),c(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(g(e+8),c(e+16),g(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(g(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(g(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(g(e+8),t(e+16),g(e+24))},"syscall/js.valueCall":e=>{try{const n=g(e+8),i=Reflect.get(n,c(e+16)),a=l(e+32),t=Reflect.apply(i,n,a);e=this._inst.exports.getsp(),o(e+56,t),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=g(e+8),i=l(e+16),a=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=g(e+8),i=l(e+16),a=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(g(n+8).length))},"syscall/js.valuePrepareString":i=>{const a=n.encode(g(i+8)+"");o(i+16,a),e(i+24,a.length)},"syscall/js.valueLoadString":e=>{const n=g(e+8);d(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,g(e+8)instanceof g(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=d(n+8),a=g(n+32);if(!(a instanceof Uint8Array||a instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=g(n+8),a=d(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const a=e=>{const a=i,t=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,0!=i%8&&(i+=8-i%8),a},t=this.argv.length,g=[];this.argv.forEach(e=>{g.push(a(e))}),g.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{g.push(a(`${e}=${this.env[e]}`))}),g.push(0);const d=i;g.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(t,d),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=le();i.p(e);var a=ce(e,n,2,4);return Ce(a,n),se(a,a.length-4,i.d()),a}function d(e,n){return z((Ie(e),e.subarray(2,-4)),n)}function l(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function c(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function s(){return"safari"===l()}function C(e,n,i,a,t,g){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.0",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==a&&(o.metadata=a),g&&(o.redirect=!0),"signalingNotifyMetadata"in t&&(o.signaling_notify_metadata=t.signalingNotifyMetadata),"multistream"in t&&!0===t.multistream&&(o.multistream=!0,"spotlight"in t&&(o.spotlight=t.spotlight,"spotlightNumber"in t&&(o.spotlight_number=t.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==t.spotlightFocusRid&&0<=e.indexOf(t.spotlightFocusRid)&&(o.spotlight_focus_rid=t.spotlightFocusRid),void 0!==t.spotlightUnfocusRid&&0<=e.indexOf(t.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=t.spotlightUnfocusRid)}if("simulcast"in t||"simulcastRid"in t){"simulcast"in t&&!0===t.simulcast&&(o.simulcast=!0);void 0!==t.simulcastRid&&0<=["r0","r1","r2"].indexOf(t.simulcastRid)&&(o.simulcast_rid=t.simulcastRid)}"clientId"in t&&void 0!==t.clientId&&(o.client_id=t.clientId),"dataChannelSignaling"in t&&"boolean"==typeof t.dataChannelSignaling&&(o.data_channel_signaling=t.dataChannelSignaling),"ignoreDisconnectWebSocket"in t&&"boolean"==typeof t.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=t.ignoreDisconnectWebSocket);const d=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],s=["videoCodecType","videoBitRate"],C=Object.assign({},t);Object.keys(C).forEach(e=>{"audio"===e&&"boolean"==typeof C[e]||"video"===e&&"boolean"==typeof C[e]||0<=d.indexOf(e)&&null!==C[e]||0<=l.indexOf(e)&&null!==C[e]||0<=s.indexOf(e)&&null!==C[e]||delete C[e]}),void 0!==C.audio&&(o.audio=C.audio);const I=Object.keys(C).some(e=>0<=d.indexOf(e));o.audio&&I&&(o.audio={},"audioCodecType"in C&&(o.audio.codec_type=C.audioCodecType),"audioBitRate"in C&&(o.audio.bit_rate=C.audioBitRate));const r=Object.keys(C).some(e=>0<=l.indexOf(e));o.audio&&r&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in C&&(o.audio.opus_params.channels=C.audioOpusParamsChannels),"audioOpusParamsClockRate"in C&&(o.audio.opus_params.clock_rate=C.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in C&&(o.audio.opus_params.maxplaybackrate=C.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in C&&(o.audio.opus_params.stereo=C.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in C&&(o.audio.opus_params.sprop_stereo=C.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in C&&(o.audio.opus_params.minptime=C.audioOpusParamsMinptime),"audioOpusParamsPtime"in C&&(o.audio.opus_params.ptime=C.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in C&&(o.audio.opus_params.useinbandfec=C.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in C&&(o.audio.opus_params.usedtx=C.audioOpusParamsUsedtx)),void 0!==C.video&&(o.video=C.video);const m=Object.keys(C).some(e=>0<=s.indexOf(e));if(o.video&&m&&(o.video={},"videoCodecType"in C&&(o.video.codec_type=C.videoCodecType),"videoBitRate"in C&&(o.video.bit_rate=C.videoBitRate)),o.simulcast&&!c()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===t.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return o}function I(e){if(e.authn_metadata!==void 0)return e.authn_metadata;return void 0===e.metadata?null:e.metadata}function r(e){if(e.data&&Array.isArray(e.data))return e.data;return e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}function m(e){return"object"==typeof e&&null!==e&&"pre_key_bundle"in e?e.pre_key_bundle:null}function A(e,n,i){const a=e=>{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),a(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let t="";window.performance&&(t="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(t=t+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(t+" "+n),a(i),console.groupEnd()):console.log(t+" "+n+"\n",i)}function u(e,n,i){const a=new Event(e);try{a.data=JSON.parse(JSON.stringify(n))}catch(e){a.data=n}return a.transportType=i,a}function Z(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function b(e,n,i,a,t){const g=new Event(e);try{g.data=JSON.parse(JSON.stringify(n))}catch(e){g.data=n}return g.logType=i,g.dataChannelId=a,g.dataChannelLabel=t,g}class p{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQ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pID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:a},[i,a])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:a},[i,a])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,a=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:a})}startSession(e,n){const[i,a]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(a)throw a;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(g(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.2.0-canary.0"}static wasmVersion(){return window.e2ee.version()}}var V=Uint8Array,S=Uint16Array,W=Uint32Array,G=new V([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h=new 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,0,0]),y=new V([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),k=function(e,n){for(var a=new S(31),t=0;31>t;++t)a[t]=n+=1<t;++t)for(var o=a[t];oN;++N)X=(43690&N)>>>1|(21845&N)<<1,X=(52428&X)>>>2|(13107&X)<<2,X=(61680&X)>>>4|(3855&X)<<4,Y[N]=((65280&X)>>>8|(255&X)<<8)>>>1;for(var v=function(e,n,a){for(var t=e.length,g=0,o=new S(n);g>>15-n]=c}else for(l=new S(t),g=0;g>>15-e[g]);return l},E=new V(288),N=0;144>N;++N)E[N]=8;for(var N=144;256>N;++N)E[N]=9;for(var N=256;280>N;++N)E[N]=7;for(var N=280;288>N;++N)E[N]=8;for(var O=new V(32),N=0;32>N;++N)O[N]=5;var K=v(E,9,0),L=v(E,9,1),F=v(O,5,0),J=v(O,5,1),U=function(e){for(var n=e[0],a=1;an&&(n=e[a]);return n},Q=function(e,n,i){var a=0|n/8;return(e[a]|e[a+1]<<8)>>(7&n)&i},D=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},H=function(e){return 0|(e+7)/8},M=function(i,a,t){(null==a||0>a)&&(a=0),(null==t||t>i.length)&&(t=i.length);var g=new(i instanceof S?S:i instanceof W?W:V)(t-a);return g.set(i.subarray(a,t)),g},P=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],j=function(n,i,a){var t=new Error(i||P[n]);if(t.code=n,Error.captureStackTrace&&Error.captureStackTrace(t,j),!a)throw t;return t},z=function(a,g,o){var C=a.length;if(!C||o&&o.f&&!o.l)return g||new V(0);var I=!g||o,m=!o||o.i;o||(o={}),g||(g=new V(3*C));var A=function(e){var n=g.length;if(e>n){var i=new V(t(2*n,e));i.set(g),g=i}},u=o.f||0,Z=o.p||0,p=o.b||0,S=o.l,W=o.d,k=o.m,w=o.n,R=8*C;do{if(!S){u=Q(a,Z,1);var X=Q(a,Z+1,3);if(Z+=3,!X){var f=H(Z)+4,T=a[f-4]|a[f-3]<<8,l=f+T;if(l>C){m&&j(0);break}I&&A(p+T),g.set(a.subarray(f,l),p),o.b=p+=T,o.p=Z=8*l,o.f=u;continue}else if(1==X)S=L,W=J,k=9,w=5;else if(2==X){var Y=Q(a,Z,31)+257,N=Q(a,Z+10,15)+4,E=Y+Q(a,Z+5,31)+1;Z+=14;for(var O=new V(E),K=new V(19),F=0;F>>4;if(16>f)O[F++]=f;else{var _=0,q=0;for(16==f?(q=3+Q(a,Z,3),Z+=2,_=O[F-1]):17==f?(q=3+Q(a,Z,7),Z+=3):18==f&&(q=11+Q(a,Z,127),Z+=7);q--;)O[F++]=_}}var $=O.subarray(0,Y),ee=O.subarray(Y);k=U($),w=U(ee),S=v($,k,1),W=v(ee,w,1)}else j(1);if(Z>R){m&&j(0);break}}I&&A(p+131072);for(var ne=(1<>>4;if(Z+=15&_,Z>R){m&&j(0);break}if(_||j(2),256>te)g[p++]=te;else if(256==te){ae=Z,S=null;break}else{var ge=te-254;if(264>>4;de||j(3),Z+=15&de;var ee=B[d];if(3R){m&&j(0);break}I&&A(p+131072);for(var le=p+ge;p>>8},q=function(e,n,i){i<<=7&n;var a=0|n/8;e[a]|=i,e[a+1]|=i>>>8,e[a+2]|=i>>>16},$=function(e,n){for(var a=[],t=0;tA&&(A=o[t].s);var u=new S(A+1),Z=ee(a[I-1],u,0);if(Z>n){var t=0,b=0,p=Z-n;for(o.sort(function(e,n){return u[n.s]-u[e.s]||e.f-n.f});tn)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var ee,f=0;f>>5),C+=x[f]>>>12)}}else Q=K,D=E,j=F,H=O;for(var f=0;f>>18;q(n,C,Q[ee+257]),C+=D[ee+257],7>>23),C+=G[ee]);var te=31&t[f];q(n,C,j[te]),C+=H[te],3>>5),C+=h[te])}else q(n,C,Q[t[f]]),C+=D[t[f]];return q(n,C,Q[256]),C+D[256]},ge=new W([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oe=new V(0),de=function(t,g,c,C,I,r){var m=t.length,s=new V(C+m+5*(1+a(m/7e3))+I),o=s.subarray(C,s.length-I),A=0;if(!g||8>m)for(var u,Z=0;Z<=m;Z+=65535)u=Z+65535,uQ;++Q)B[Q]=0;for(var Q=0;30>Q;++Q)Y[Q]=0}var D=2,x=0,P=8191&b,z=32767&F-J;if(2>>13,U)-1,q=n(32767,Z),$=n(258,U);z<=q&&--P&&F!=J;){if(t[Z+D]==t[Z+D-z]){for(var ee=0;ee<$&&t[Z+ee]==t[Z+ee-z];++ee);if(ee>D){if(D=ee,x=z,ee>_)break;for(var ne=n(z,ee-2),ie=0,Q=0;Qie&&(ie=ce,J=de)}}}F=J,J=y[F],z+=32767&F-J+32768}if(x){f[E++]=268435456|R[D]<<18|T[x];var se=31&R[D],Ce=31&T[x];v+=G[se]+h[Ce],++B[257+se],++Y[Ce],O=Z+D,++N}else f[E++]=t[Z],++B[t[Z]]}}A=te(t,o,r,f,B,Y,v,E,K,Z-K,A),!r&&7&A&&(A=ae(o,A+1,oe))}return M(s,0,C+H(A)+I)},le=function(){var t=1,g=0;return{p:function(a){for(var o,d=t,c=g,s=0|a.length,l=0;l!=s;){for(o=n(l+2655,s);l>16),c=(65535&c)+15*(c>>16)}t=d,g=c},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},ce=function(e,i,g,o,d){return de(e,null==i.level?6:i.level,null==i.mem?a(1.5*t(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!d)},se=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},Ce=function(e,n){var i=n.level,a=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},Ie=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&j(6,"invalid zlib data"),32&e[1]&&j(6,"invalid zlib data: preset dictionaries not supported")},re="undefined"!=typeof TextDecoder&&new TextDecoder,me=0;try{re.decode(oe,{stream:!0}),me=1}catch(n){}class Ae extends Error{}class ue{constructor(e,n,i,a,t,g){this.role=n,this.channelId=i,this.metadata=a,this.signalingUrlCandidates=e,this.options=t,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.dataChannelsCompress={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const a={type:"disconnect",reason:e};this.ws.send(JSON.stringify(a)),this.writeWebSocketSignalingLog("send-disconnect",a),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const a=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),t=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(a),e(),n({code:4999,reason:""}));t.push((()=>new Promise(e=>{let n=0;const a=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(a),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(a))},100)}))())}}Promise.all(t).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(a)});const g={type:"disconnect",reason:"NO-ERROR"};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new p,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){return new Promise((n,i)=>{const a=new WebSocket(e);a.onclose=e=>{const n=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),i(n)},a.onopen=()=>{n(a)}})}if(Array.isArray(e)){let n=!1;const i=e=>new Promise((i,a)=>{const t=new WebSocket(e),g=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:t.url}),t&&!n&&(t.onclose=null,t.onerror=null,t.onopen=null,t.close(),a())},this.signalingCandidateTimeout);t.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:t.url,message:`WebSocket closed`,code:e.code,reason:e.reason}),t&&t.close(),clearInterval(g),a()},t.onerror=()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:t.url,message:`Failed to connect WebSocket`}),t&&(t.onclose=null,t.close()),clearInterval(g),a()},t.onopen=()=>{t&&(clearInterval(g),n?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!1}),t.onerror=null,t.onclose=null,t.onopen=null,t.close(),a()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!0}),t.onerror=null,t.onclose=null,t.onopen=null,n=!0,i(t)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(n){throw new Ae("Signaling failed. All signaling URL candidates failed to connect")}}throw new Ae("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,n=!1){const i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((a,t)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const n=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const n=JSON.parse(e.data);if("offer"==n.type)this.writeWebSocketSignalingLog("onmessage-offer",n),this.signalingOnMessageTypeOffer(n),a(n);else if("update"==n.type)this.writeWebSocketSignalingLog("onmessage-update",n),await this.signalingOnMessageTypeUpdate(n);else if("re-offer"==n.type)this.writeWebSocketSignalingLog("onmessage-re-offer",n),await this.signalingOnMessageTypeReOffer(n);else if("ping"==n.type)await this.signalingOnMessageTypePing(n);else if("push"==n.type)this.callbacks.push(n,"websocket");else if("notify"==n.type)"connection.created"===n.event_type?this.writeWebSocketTimelineLog("notify-connection.created",n):"connection.destroyed"===n.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",n),this.signalingOnMessageTypeNotify(n,"websocket");else if("switched"==n.type)this.writeWebSocketSignalingLog("onmessage-switched",n),this.signalingOnMessageTypeSwitched(n);else if("redirect"==n.type){this.writeWebSocketSignalingLog("onmessage-redirect",n);const e=await this.signalingOnMessageTypeRedirect(n);a(e)}},(async()=>{let a;try{a=C(i.sdp||"",this.role,this.channelId,this.metadata,this.options,n)}catch(e){return void t(e)}if(a.e2ee&&this.e2ee){const e=await this.e2ee.init();a.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",a),e&&(e.send(JSON.stringify(a)),this.writeWebSocketSignalingLog(`send-${a.type}`,a),this.ws=e)})()})}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new Ae(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&A(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(u(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(u(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=b(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const a=b(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(a)}writePeerConnectionTimelineLog(e,n){const i=b(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=b(e,n,"sora");this.callbacks.timeline(i)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(s()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.dataChannelsCompress[n.label]=n.compress;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=I(e),a=m(i);if(a&&this.e2ee&&n){const e=this.e2ee.startSession(n,a);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=r(e);i.forEach(e=>{const n=I(e),i=m(n),a=e.connection_id;a&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(a,i)})}else if("connection.destroyed"===e.event_type){const n=I(e),i=m(n),a=e.connection_id;if(i&&this.e2ee&&a){const e=this.e2ee.stopSession(a);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(a)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const n=await this.getSignalingWebSocket(e.location),i=await this.signaling(n,!0);return i}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,Z(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.signaling){const n=d(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${a.type}`,n,a),"re-offer"===a.type&&(await this.signalingOnMessageTypeReOffer(a))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.notify){const n=d(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(!0===this.dataChannelsCompress.push){const i=d(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label&&(e.channel.onmessage=async e=>{let n=e.data;if(!0===this.dataChannelsCompress.stats){const i=d(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}})}sendMessage(e){if(this.dataChannels.signaling){if(!0===this.dataChannelsCompress.signaling){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(!0===this.dataChannelsCompress.stats){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const a=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new a(e,n,i)}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}}class Ze extends ue{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class be extends ue{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.1.0\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY29uc3QgcGFkZGluZ0xlbmd0aCA9IFVpbnQzMkFycmF5LkJZVEVTX1BFUl9FTEVNRU5UIC0gZGF0YVZpZXcuYnl0ZUxlbmd0aDsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGFkZGluZ0xlbmd0aDsgaSArPSAxKSB7CiAgICAgICAgbmV3RGF0YVZpZXcuc2V0VWludDgoaSwgMCk7CiAgICB9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Y29kZWRGcmFtZS5kYXRhLnNsaWNlKHVuZW5jcnlwdGVkQnl0ZXNbZW5jb2RlZEZyYW1lLnR5cGVdKSk7CiAgICAgICAgY29uc3Qgc2ZyYW1lSGVhZGVyID0gbmV3IFVpbnQ4QXJyYXkoc2ZyYW1lSGVhZGVyQnVmZmVyKTsKICAgICAgICBjb25zdCBjb25uZWN0aW9uSWQgPSB0ZXh0RGVjb2Rlci5kZWNvZGUoY29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgI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ICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBn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AgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.1.0\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAAX,CACNA,MAAM,CAACD,MAAP,CAAgBC,MADV,KAEA,IAAoB,WAAhB,QAAOC,CAAAA,IAAX,CACNA,IAAI,CAACF,MAAL,CAAcE,IADR,KAGN,MAAM,IAAIC,CAAAA,KAAJ,CAAU,+DAAV,CAAN,CAOD,GAJKH,MAAM,CAACI,OAAR,EAAsC,WAAnB,QAAOA,CAAAA,OAI9B,GAHCJ,MAAM,CAACI,OAAP,CAAiBA,OAGlB,EAAI,CAACJ,MAAM,CAACK,EAAR,EAAcL,MAAM,CAACI,OAAzB,CAAkC,CACjC,KAAMC,CAAAA,CAAE,CAAGD,OAAO,CAAC,IAAD,CAAlB,CACwB,CAApB,GAAAE,MAAM,CAACC,IAAP,CAAYF,CAAZ,CAF6B,GAGhCL,MAAM,CAACK,EAAP,CAAYA,CAHoB,CAKjC,CAED,KAAMG,CAAAA,CAA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AAqB,EAD/C,GAEfhN,CAAG,CAAC,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file +{"version":3,"file":"sora.min.js","sources":["../packages/sdk/node_modules/fflate/esm/browser.js","../packages/go-wasm/src/wasm_exec.js","../packages/e2ee/dist/sora_e2ee.mjs"],"sourcesContent":["// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([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, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([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, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.2.0-canary.0\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN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iSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.2.0-canary.0\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,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lI,CAAC,CAACiI,KAAX,CAAkBvJ,CAAE,CAAS,CAAN,EAAAwJ,CAAE,CAAQ,CAAR,CAAiB,CAAL,CAAAA,CAAE,CAAO,CAAP,CAAiB,CAAN,EAAAA,CAAE,CAAQ,CAAR,CAAY,CAAhE,CACAhG,CAAC,CAAC,CAAD,CAAD,CAAO,GAAP,CAAYA,CAAC,CAAC,CAAD,CAAD,CAAQxD,CAAE,EAAI,CAAP,EAAaA,CAAE,CAAI,GAAK,EAAIA,CAAb,CAAmB,CAAlC,CACtB,EAEG5E,EAAG,CAAG,SAAUP,CAAV,CAAa,EACA,CAAf,GAAQ,EAAP,CAAAA,CAAC,CAAC,CAAD,CAAF,GAAmC,CAAf,CAACA,CAAC,CAAC,CAAD,CAAD,GAAS,CAA9B,EAAyC,CAACA,CAAC,CAAC,CAAD,CAAD,EAAQ,CAAR,CAAYA,CAAC,CAAC,CAAD,CAAd,EAAqB,EAD/C,GAEfhN,CAAG,CAAC,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file diff --git a/dist/sora.mjs b/dist/sora.mjs index 9c54ce3c..0be2391d 100644 --- a/dist/sora.mjs +++ b/dist/sora.mjs @@ -1,7 +1,7 @@ /** * @sora/sdk * undefined - * @version: 2021.1.6 + * @version: 2021.2.0-canary.0 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -598,7 +598,7 @@ function WasmExec () { /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.1.0 + * @version: 2021.2.0-canary.0 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -766,7 +766,7 @@ class SoraE2EE { } } static version() { - return "2021.1.0"; + return "2021.2.0-canary.0"; } static wasmVersion() { return window.e2ee.version(); @@ -1584,7 +1584,7 @@ function enabledSimulcast() { function isSafari() { return browser() === "safari"; } -function createSignalingMessage(offerSDP, role, channelId, metadata, options) { +function createSignalingMessage(offerSDP, role, channelId, metadata, options, redirect) { if (role !== "sendrecv" && role !== "sendonly" && role !== "recvonly") { throw new Error("Unknown role type"); } @@ -1593,7 +1593,7 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options) { } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.1.6", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.0", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1604,6 +1604,9 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options) { if (metadata !== undefined) { message.metadata = metadata; } + if (redirect) { + message.redirect = true; + } if ("signalingNotifyMetadata" in options) { message.signaling_notify_metadata = options.signalingNotifyMetadata; } @@ -1878,11 +1881,11 @@ function createTimelineEvent(eventType, data, logType, dataChannelId, dataChanne } class ConnectionBase { - constructor(signalingUrl, role, channelId, metadata, options, debug) { + constructor(signalingUrlCandidates, role, channelId, metadata, options, debug) { this.role = role; this.channelId = channelId; this.metadata = metadata; - this.signalingUrl = signalingUrl; + this.signalingUrlCandidates = signalingUrlCandidates; this.options = options; // connection timeout の初期値をセットする this.connectionTimeout = 60000; @@ -1898,6 +1901,11 @@ class ConnectionBase { if (typeof this.options.disconnectWaitTimeout === "number") { this.disconnectWaitTimeout = this.options.disconnectWaitTimeout; } + // signalingUrlCandidates に設定されている URL への接続チェック timeout の初期値をセットする + this.signalingCandidateTimeout = 3000; + if (typeof this.options.signalingCandidateTimeout === "number") { + this.signalingCandidateTimeout = this.options.signalingCandidateTimeout; + } this.constraints = null; this.debug = debug; this.clientId = null; @@ -2450,15 +2458,120 @@ class ConnectionBase { this.e2ee.postSelfSecretKeyMaterial(this.connectionId, result.selfKeyId, result.selfSecretKeyMaterial); } } - signaling(offer) { + async getSignalingWebSocket(signalingUrlCandidates) { + if (typeof signalingUrlCandidates === "string") { + // signaling url の候補が文字列の場合 + const signalingUrl = signalingUrlCandidates; + return new Promise((resolve, reject) => { + const ws = new WebSocket(signalingUrl); + ws.onclose = (event) => { + const error = new ConnectError(`Signaling failed. CloseEventCode:${event.code} CloseEventReason:'${event.reason}'`); + error.code = event.code; + error.reason = event.reason; + this.writeWebSocketTimelineLog("onclose", error); + reject(error); + }; + ws.onopen = (_) => { + resolve(ws); + }; + }); + } + else if (Array.isArray(signalingUrlCandidates)) { + // signaling url の候補が Array の場合 + // すでに候補の WebSocket が発見されているかどうかのフラグ + let resolved = false; + const testSignalingUrlCandidate = (signalingUrl) => { + return new Promise((resolve, reject) => { + const ws = new WebSocket(signalingUrl); + // 一定時間経過しても反応がなかった場合は処理を中断する + const timerId = setTimeout(() => { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "timeout", + url: ws.url, + }); + if (ws && !resolved) { + ws.onclose = null; + ws.onerror = null; + ws.onopen = null; + ws.close(); + reject(); + } + }, this.signalingCandidateTimeout); + ws.onclose = (event) => { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "close", + url: ws.url, + message: `WebSocket closed`, + code: event.code, + reason: event.reason, + }); + if (ws) { + ws.close(); + } + clearInterval(timerId); + reject(); + }; + ws.onerror = (_) => { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "error", + url: ws.url, + message: `Failed to connect WebSocket`, + }); + if (ws) { + ws.onclose = null; + ws.close(); + } + clearInterval(timerId); + reject(); + }; + ws.onopen = (_) => { + if (ws) { + clearInterval(timerId); + if (resolved) { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "open", + url: ws.url, + selected: false, + }); + ws.onerror = null; + ws.onclose = null; + ws.onopen = null; + ws.close(); + reject(); + } + else { + this.writeWebSocketSignalingLog("signaling-url-canidate", { + type: "open", + url: ws.url, + selected: true, + }); + ws.onerror = null; + ws.onclose = null; + ws.onopen = null; + resolved = true; + resolve(ws); + } + } + }; + }); + }; + try { + return await Promise.any(signalingUrlCandidates.map((signalingUrl) => testSignalingUrlCandidate(signalingUrl))); + } + catch (e) { + throw new ConnectError("Signaling failed. All signaling URL candidates failed to connect"); + } + } + throw new ConnectError("Signaling failed. Invalid format signaling URL candidates"); + } + async signaling(ws, redirect = false) { + const offer = await this.createOffer(); this.trace("CREATE OFFER", offer); return new Promise((resolve, reject) => { - if (this.ws === null) { - this.ws = new WebSocket(this.signalingUrl); - this.writeWebSocketSignalingLog("new-websocket", this.signalingUrl); - } - this.ws.binaryType = "arraybuffer"; - this.ws.onclose = async (event) => { + this.writeWebSocketSignalingLog("new-websocket", ws.url); + // websocket の各 callback を設定する + ws.binaryType = "arraybuffer"; + ws.onclose = async (event) => { const error = new ConnectError(`Signaling failed. CloseEventCode:${event.code} CloseEventReason:'${event.reason}'`); error.code = event.code; error.reason = event.reason; @@ -2466,28 +2579,7 @@ class ConnectionBase { await this.signalingTerminate(); reject(error); }; - this.ws.onopen = async (_) => { - this.writeWebSocketSignalingLog("onopen"); - let signalingMessage; - try { - signalingMessage = createSignalingMessage(offer.sdp || "", this.role, this.channelId, this.metadata, this.options); - } - catch (error) { - reject(error); - return; - } - if (signalingMessage.e2ee && this.e2ee) { - const initResult = await this.e2ee.init(); - // @ts-ignore signalingMessage の e2ee が true の場合は signalingNotifyMetadata が必ず object になる - signalingMessage["signaling_notify_metadata"]["pre_key_bundle"] = initResult; - } - this.trace("SIGNALING CONNECT MESSAGE", signalingMessage); - if (this.ws) { - this.ws.send(JSON.stringify(signalingMessage)); - this.writeWebSocketSignalingLog(`send-${signalingMessage.type}`, signalingMessage); - } - }; - this.ws.onmessage = async (event) => { + ws.onmessage = async (event) => { // E2EE 時専用処理 if (event.data instanceof ArrayBuffer) { this.writeWebSocketSignalingLog("onmessage-e2ee", event.data); @@ -2527,25 +2619,36 @@ class ConnectionBase { this.writeWebSocketSignalingLog("onmessage-switched", message); this.signalingOnMessageTypeSwitched(message); } + else if (message.type == "redirect") { + this.writeWebSocketSignalingLog("onmessage-redirect", message); + const redirectMessage = await this.signalingOnMessageTypeRedirect(message); + resolve(redirectMessage); + } }; + // eslint-disable-next-line @typescript-eslint/no-floating-promises + (async () => { + let signalingMessage; + try { + signalingMessage = createSignalingMessage(offer.sdp || "", this.role, this.channelId, this.metadata, this.options, redirect); + } + catch (error) { + reject(error); + return; + } + if (signalingMessage.e2ee && this.e2ee) { + const initResult = await this.e2ee.init(); + // @ts-ignore signalingMessage の e2ee が true の場合は signalingNotifyMetadata が必ず object になる + signalingMessage["signaling_notify_metadata"]["pre_key_bundle"] = initResult; + } + this.trace("SIGNALING CONNECT MESSAGE", signalingMessage); + if (ws) { + ws.send(JSON.stringify(signalingMessage)); + this.writeWebSocketSignalingLog(`send-${signalingMessage.type}`, signalingMessage); + this.ws = ws; + } + })(); }); } - async createOffer() { - const config = { iceServers: [] }; - const pc = new window.RTCPeerConnection(config); - if (isSafari()) { - pc.addTransceiver("video", { direction: "recvonly" }); - pc.addTransceiver("audio", { direction: "recvonly" }); - const offer = await pc.createOffer(); - pc.close(); - this.writePeerConnectionTimelineLog("create-offer", offer); - return offer; - } - const offer = await pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: true }); - pc.close(); - this.writePeerConnectionTimelineLog("create-offer", offer); - return offer; - } async connectPeerConnection(message) { let config = Object.assign({}, message.config); if (this.e2ee) { @@ -2847,6 +2950,22 @@ class ConnectionBase { const event = createTimelineEvent(eventType, data, "sora"); this.callbacks.timeline(event); } + async createOffer() { + const config = { iceServers: [] }; + const pc = new window.RTCPeerConnection(config); + if (isSafari()) { + pc.addTransceiver("video", { direction: "recvonly" }); + pc.addTransceiver("audio", { direction: "recvonly" }); + const offer = await pc.createOffer(); + pc.close(); + this.writePeerConnectionTimelineLog("create-offer", offer); + return offer; + } + const offer = await pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: true }); + pc.close(); + this.writePeerConnectionTimelineLog("create-offer", offer); + return offer; + } signalingOnMessageE2EE(data) { if (this.e2ee) { const message = new Uint8Array(data); @@ -2971,6 +3090,17 @@ class ConnectionBase { this.writeWebSocketSignalingLog("close"); } } + async signalingOnMessageTypeRedirect(message) { + if (this.ws) { + this.ws.onclose = null; + this.ws.onerror = null; + this.ws.close(); + this.ws = null; + } + const ws = await this.getSignalingWebSocket(message.location); + const signalingMessage = await this.signaling(ws, true); + return signalingMessage; + } async setSenderParameters(transceiver, encodings) { const originalParameters = transceiver.sender.getParameters(); // @ts-ignore @@ -3194,6 +3324,15 @@ class ConnectionBase { get video() { return this.getVideoTransceiver() !== null; } + get signalingUrl() { + return this.signalingUrlCandidates; + } + get connectedSignalingUrl() { + if (!this.ws) { + return ""; + } + return this.ws.url; + } } class ConnectionPublisher extends ConnectionBase { @@ -3225,8 +3364,8 @@ class ConnectionPublisher extends ConnectionBase { async singleStream(stream) { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); await this.setRemoteDescription(signalingMessage); @@ -3252,8 +3391,8 @@ class ConnectionPublisher extends ConnectionBase { async multiStream(stream) { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { @@ -3358,8 +3497,8 @@ class ConnectionSubscriber extends ConnectionBase { async singleStream() { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { @@ -3415,8 +3554,8 @@ class ConnectionSubscriber extends ConnectionBase { async multiStream() { await this.disconnect(); this.setupE2EE(); - const offer = await this.createOffer(); - const signalingMessage = await this.signaling(offer); + const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates); + const signalingMessage = await this.signaling(ws); this.startE2EE(); await this.connectPeerConnection(signalingMessage); if (this.pc) { @@ -3488,29 +3627,33 @@ async function applyMediaStreamConstraints(mediastream, constraints) { } class SoraConnection { - constructor(signalingUrl, debug = false) { - this.signalingUrl = signalingUrl; + constructor(signalingUrlCandidates, debug = false) { + this.signalingUrlCandidates = signalingUrlCandidates; this.debug = debug; } sendrecv(channelId, metadata = null, options = { audio: true, video: true }) { - return new ConnectionPublisher(this.signalingUrl, "sendrecv", channelId, metadata, options, this.debug); + return new ConnectionPublisher(this.signalingUrlCandidates, "sendrecv", channelId, metadata, options, this.debug); } sendonly(channelId, metadata = null, options = { audio: true, video: true }) { - return new ConnectionPublisher(this.signalingUrl, "sendonly", channelId, metadata, options, this.debug); + return new ConnectionPublisher(this.signalingUrlCandidates, "sendonly", channelId, metadata, options, this.debug); } recvonly(channelId, metadata = null, options = { audio: true, video: true }) { - return new ConnectionSubscriber(this.signalingUrl, "recvonly", channelId, metadata, options, this.debug); + return new ConnectionSubscriber(this.signalingUrlCandidates, "recvonly", channelId, metadata, options, this.debug); + } + // @deprecated 後方互換のため残す + get signalingUrl() { + return this.signalingUrlCandidates; } } var sora = { initE2EE: async function (wasmUrl) { await SoraE2EE.loadWasm(wasmUrl); }, - connection: function (signalingUrl, debug = false) { - return new SoraConnection(signalingUrl, debug); + connection: function (signalingUrlCandidates, debug = false) { + return new SoraConnection(signalingUrlCandidates, debug); }, version: function () { - return "2021.1.6"; + return "2021.2.0-canary.0"; }, helpers: { applyMediaStreamConstraints, diff --git a/dist/types.d.ts b/dist/types.d.ts index 2c66429a..1f1435df 100644 --- a/dist/types.d.ts +++ b/dist/types.d.ts @@ -50,8 +50,9 @@ export declare type SignalingConnectMessage = { spotlight_unfocus_rid?: SpotlightFocusRid; data_channel_signaling?: boolean; ignore_disconnect_websocket?: boolean; + redirect?: true; }; -export declare type SignalingMessage = SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage | SignalingPingMessage | SignalingPushMessage | SignalingNotifyMessage | SignalingReqStatsMessage | SignalingSwitchedMessage; +export declare type SignalingMessage = SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage | SignalingPingMessage | SignalingPushMessage | SignalingNotifyMessage | SignalingReqStatsMessage | SignalingSwitchedMessage | SignalingRedirectMessage; export declare type SignalingOfferMessage = { type: "offer"; sdp: string; @@ -94,6 +95,10 @@ export declare type SignalingSwitchedMessage = { type: "switched"; ignore_disconnect_websocket: boolean; }; +export declare type SignalingRedirectMessage = { + type: "redirect"; + location: string; +}; export declare type SignalingNotifyMessage = SignalingNotifyConnectionCreated | SignalingNotifyConnectionUpdated | SignalingNotifyConnectionDestroyed | SignalingNotifySpotlightChanged | SignalingNotifySpotlightFocused | SignalingNotifySpotlightUnfocused | SignalingNotifyNetworkStatus; export declare type SignalingNotifyMetadata = { client_id?: string; @@ -219,6 +224,7 @@ export declare type ConnectionOptions = { dataChannelSignaling?: boolean; ignoreDisconnectWebSocket?: boolean; disconnectWaitTimeout?: number; + signalingCandidateTimeout?: number; }; export declare type Callbacks = { disconnect: (event: SoraCloseEvent) => void; diff --git a/dist/utils.d.ts b/dist/utils.d.ts index f932f528..cea8f516 100644 --- a/dist/utils.d.ts +++ b/dist/utils.d.ts @@ -1,7 +1,7 @@ import { ConnectionOptions, JSONType, PreKeyBundle, SignalingConnectMessage, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, TimelineEvent, TimelineEventLogType, TransportType } from "./types"; export declare function isSafari(): boolean; export declare function isChrome(): boolean; -export declare function createSignalingMessage(offerSDP: string, role: string, channelId: string | null | undefined, metadata: JSONType | undefined, options: ConnectionOptions): SignalingConnectMessage; +export declare function createSignalingMessage(offerSDP: string, role: string, channelId: string | null | undefined, metadata: JSONType | undefined, options: ConnectionOptions, redirect: boolean): SignalingConnectMessage; export declare function getSignalingNotifyAuthnMetadata(message: SignalingNotifyConnectionCreated | SignalingNotifyConnectionDestroyed | SignalingNotifyMetadata): JSONType; export declare function getSignalingNotifyData(message: SignalingNotifyConnectionCreated): SignalingNotifyMetadata[]; export declare function getPreKeyBundle(message: JSONType): PreKeyBundle | null; diff --git a/lerna.json b/lerna.json index 674e7c92..6f2a6db8 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": [ "packages/*" ], - "version": "2021.1.6" + "version": "2021.2.0-canary.0" } diff --git a/package.json b/package.json index e728f295..515b5f4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.1.6", + "version": "2021.2.0-canary.0", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", diff --git a/packages/e2ee/package.json b/packages/e2ee/package.json index 16441768..cc09a524 100644 --- a/packages/e2ee/package.json +++ b/packages/e2ee/package.json @@ -1,6 +1,6 @@ { "name": "@sora/e2ee", - "version": "2021.1.0", + "version": "2021.2.0-canary.0", "description": "WebRTC SFU Sora JavaScript E2EE Library", "author": "Shiguredo Inc.", "license": "Apache-2.0", @@ -28,6 +28,6 @@ "typescript": "^4.4.2" }, "dependencies": { - "@sora/go-wasm": "^2021.1.0" + "@sora/go-wasm": "^2021.2.0-canary.0" } } diff --git a/packages/go-wasm/package.json b/packages/go-wasm/package.json index b13bfde5..5462098e 100644 --- a/packages/go-wasm/package.json +++ b/packages/go-wasm/package.json @@ -1,6 +1,6 @@ { "name": "@sora/go-wasm", - "version": "2021.1.0", + "version": "2021.2.0-canary.0", "main": "src/wasm_exec.js", "module": "src/wasm_exec.js", "types": "src/wasm_exec.d.ts", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 35e698c8..644eade1 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@sora/sdk", - "version": "2021.1.6", + "version": "2021.2.0-canary.0", "author": "Shiguredo Inc.", "license": "Apache-2.0", "main": "dist/sora.min.js", @@ -35,7 +35,7 @@ "typescript": "^4.4.2" }, "dependencies": { - "@sora/e2ee": "^2021.1.0", + "@sora/e2ee": "^2021.2.0-canary.0", "fflate": "^0.7.1" } } From 7a4f11721520130a2bef263b7371b6c2b800687e Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 15 Sep 2021 10:52:55 +0900 Subject: [PATCH 18/87] =?UTF-8?q?messaging=20data=20channel=20=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 38 ++++++++++++++++++++++++++++---- packages/sdk/src/types.ts | 32 +++++++++++++++++++++++++++ packages/sdk/src/utils.ts | 46 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+), 4 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 6e66ee77..69ce8749 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -3,6 +3,7 @@ import { unzlibSync, zlibSync } from "fflate"; import { ConnectError, createDataChannelData, + createMessagingEvent, createSignalingEvent, createSignalingMessage, createTimelineEvent, @@ -130,6 +131,7 @@ export default class ConnectionBase { timeout: (): void => {}, timeline: (): void => {}, signaling: (): void => {}, + messaging: (): void => {}, }; this.authMetadata = null; this.e2ee = null; @@ -1003,7 +1005,7 @@ export default class ConnectionBase { const candidate = event.candidate.toJSON(); const message = Object.assign(candidate, { type: "candidate" }) as { type: string; [key: string]: unknown }; this.trace("ONICECANDIDATE CANDIDATE MESSAGE", message); - this.sendMessage(message); + this.sendSignalingMessage(message); } }; } @@ -1245,14 +1247,14 @@ export default class ConnectionBase { private sendUpdateAnswer(): void { if (this.pc && this.ws && this.pc.localDescription) { this.trace("ANSWER SDP", this.pc.localDescription.sdp); - this.sendMessage({ type: "update", sdp: this.pc.localDescription.sdp }); + this.sendSignalingMessage({ type: "update", sdp: this.pc.localDescription.sdp }); } } private sendReAnswer(): void { if (this.pc && this.pc.localDescription) { this.trace("RE ANSWER SDP", this.pc.localDescription.sdp); - this.sendMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp }); + this.sendSignalingMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp }); } } @@ -1477,10 +1479,24 @@ export default class ConnectionBase { this.sendStatsMessage(stats); } }; + } else if (/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(dataChannelEvent.channel.label)) { + dataChannelEvent.channel.onmessage = (event): void => { + if (event.target === null) { + return; + } + const dataChannel = event.target as RTCDataChannel; + let data = event.data as string; + if (this.dataChannelsCompress[dataChannel.label] === true) { + const unzlibMessage = unzlibSync(new Uint8Array(event.data)); + data = new TextDecoder().decode(unzlibMessage); + } + const message = JSON.parse(data) as JSONType; + this.callbacks.messaging(createMessagingEvent(dataChannel.label, message)); + }; } } - private sendMessage(message: { type: string; [key: string]: unknown }): void { + private sendSignalingMessage(message: { type: string; [key: string]: unknown }): void { if (this.dataChannels.signaling) { if (this.dataChannelsCompress.signaling === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); @@ -1568,6 +1584,20 @@ export default class ConnectionBase { return new soraCloseEvent(type, title, initDict); } + sendMessage(label: string, message: JSONType): void { + const dataChannel = this.dataChannels[label]; + if (dataChannel === undefined) { + throw new Error("error5"); + } + if (this.dataChannelsCompress[label] === true) { + const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); + const zlibMessage = zlibSync(binaryMessage, {}); + dataChannel.send(zlibMessage); + } else { + dataChannel.send(JSON.stringify(message)); + } + } + get e2eeSelfFingerprint(): string | undefined { if (this.options.e2ee && this.e2ee) { return this.e2ee.selfFingerprint(); diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 129b14cf..564c4737 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -37,6 +37,16 @@ export type SignalingVideo = export type Role = "sendrecv" | "sendonly" | "recvonly"; +export type SignalingConnectMessagingDataChannel = { + label?: string; + direction?: MessagingDataChannelDirection; + compress?: boolean; + max_packet_life_time?: number; + max_retransmits?: number; + protocol?: string; + ordered?: boolean; +}; + export type SignalingConnectMessage = { type: "connect"; role: Role; @@ -60,6 +70,7 @@ export type SignalingConnectMessage = { data_channel_signaling?: boolean; ignore_disconnect_websocket?: boolean; redirect?: true; + data_channel_messaging?: SignalingConnectMessagingDataChannel[]; }; export type SignalingMessage = @@ -237,6 +248,20 @@ export type SignalingNotifyNetworkStatus = { unstable_level: 0 | 1 | 2 | 3; }; +const messagingDataChannelDirections = ["sendonly", "sendrecv", "recvonly"] as const; + +export type MessagingDataChannelDirection = typeof messagingDataChannelDirections[number]; + +export type MessagingDataChannel = { + label: string; + direction: MessagingDataChannelDirection; + compress?: boolean; + maxPacketLifeTime?: number; + maxRetransmits?: number; + protocol?: string; + ordered?: boolean; +}; + export type ConnectionOptions = { audio?: boolean; audioCodecType?: AudioCodecType; @@ -269,6 +294,7 @@ export type ConnectionOptions = { ignoreDisconnectWebSocket?: boolean; disconnectWaitTimeout?: number; signalingCandidateTimeout?: number; + messagingDataChannels?: MessagingDataChannel[]; }; export type Callbacks = { @@ -283,6 +309,7 @@ export type Callbacks = { timeout: () => void; timeline: (event: TimelineEvent) => void; signaling: (event: SignalingEvent) => void; + messaging: (event: MessagingEvent) => void; }; export type PreKeyBundle = { @@ -303,6 +330,11 @@ export interface SignalingEvent extends Event { data?: any; } +export interface MessagingEvent extends Event { + label: string; + data: JSONType; +} + export interface TimelineEvent extends Event { logType: TimelineEventLogType; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index b5e904ed..dc2a3077 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -2,8 +2,11 @@ import { ConnectionOptions, Browser, JSONType, + MessagingDataChannel, + MessagingEvent, PreKeyBundle, SignalingConnectMessage, + SignalingConnectMessagingDataChannel, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, @@ -51,6 +54,38 @@ function enabledSimulcast(): boolean { return hasAllRequiredHeaderExtensions; } +function parseMessagingDataChannel(params: unknown): SignalingConnectMessagingDataChannel { + if (typeof params !== "object" || params === null) { + throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); + } + const messagingDataChannel = params as MessagingDataChannel; + const result: SignalingConnectMessagingDataChannel = {}; + if (typeof messagingDataChannel.label === "string") { + result.label = messagingDataChannel.label; + } + if (typeof messagingDataChannel.direction === "string") { + result.direction = messagingDataChannel.direction; + } + if (typeof messagingDataChannel.ordered === "boolean") { + result.ordered = messagingDataChannel.ordered; + } + if (typeof messagingDataChannel.compress === "boolean") { + result.compress = messagingDataChannel.compress; + } + if (typeof messagingDataChannel.maxPacketLifeTime === "number") { + result.max_packet_life_time = messagingDataChannel.maxPacketLifeTime; + } + return result; +} + +function parseMessagingDataChannels(messagingDataChannels: unknown[]): SignalingConnectMessagingDataChannel[] { + const result: SignalingConnectMessagingDataChannel[] = []; + for (const messagingDataChannel of messagingDataChannels) { + result.push(parseMessagingDataChannel(messagingDataChannel)); + } + return result; +} + export function isSafari(): boolean { return browser() === "safari"; } @@ -263,6 +298,10 @@ export function createSignalingMessage( message.e2ee = true; } + if (Array.isArray(options.messagingDataChannels) && 0 < options.messagingDataChannels.length) { + message.data_channel_messaging = parseMessagingDataChannels(options.messagingDataChannels); + } + return message; } @@ -386,3 +425,10 @@ export function createTimelineEvent( event.dataChannelLabel = dataChannelLabel; return event; } + +export function createMessagingEvent(label: string, data: JSONType): MessagingEvent { + const event = new Event("messaging") as MessagingEvent; + event.label = label; + event.data = data; + return event; +} From cd9936531a25fa540b7beb3e0ec032cb0b37b2c5 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 17 Sep 2021 11:33:25 +0900 Subject: [PATCH 19/87] =?UTF-8?q?parser=20=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index dc2a3077..257fe5b2 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -75,6 +75,12 @@ function parseMessagingDataChannel(params: unknown): SignalingConnectMessagingDa if (typeof messagingDataChannel.maxPacketLifeTime === "number") { result.max_packet_life_time = messagingDataChannel.maxPacketLifeTime; } + if (typeof messagingDataChannel.maxRetransmits === "number") { + result.max_retransmits = messagingDataChannel.maxRetransmits; + } + if (typeof messagingDataChannel.protocol === "string") { + result.protocol = messagingDataChannel.protocol; + } return result; } From 8773660c3ce679133a2bc922099f89d95b2e2910 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 17 Sep 2021 11:33:46 +0900 Subject: [PATCH 20/87] =?UTF-8?q?direction=20=E3=81=AE=E5=9E=8B=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/types.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 564c4737..4e4056bd 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -248,9 +248,7 @@ export type SignalingNotifyNetworkStatus = { unstable_level: 0 | 1 | 2 | 3; }; -const messagingDataChannelDirections = ["sendonly", "sendrecv", "recvonly"] as const; - -export type MessagingDataChannelDirection = typeof messagingDataChannelDirections[number]; +export type MessagingDataChannelDirection = "sendonly" | "sendrecv" | "recvonly"; export type MessagingDataChannel = { label: string; From f9afe4683ae8f6b971f536c0bb526f9d4f48f215 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 17 Sep 2021 11:33:58 +0900 Subject: [PATCH 21/87] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/tests/utils.test.ts | 74 +++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/packages/sdk/tests/utils.test.ts b/packages/sdk/tests/utils.test.ts index 521c724b..eca4304f 100644 --- a/packages/sdk/tests/utils.test.ts +++ b/packages/sdk/tests/utils.test.ts @@ -1,5 +1,5 @@ import { createSignalingMessage } from "../src/utils"; -import { AudioCodecType, VideoCodecType } from "../src/types"; +import { AudioCodecType, MessagingDataChannelDirection, VideoCodecType } from "../src/types"; const channelId = "7N3fsMHob"; const role = "sendonly"; @@ -418,8 +418,7 @@ test("createSignalingMessage dataChannelSignaling option", () => { const options3 = { dataChannelSignaling: undefined, }; - const diff3 = { - }; + const diff3 = {}; expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual( Object.assign({}, baseExpectedMessage, diff3) ); @@ -447,8 +446,7 @@ test("createSignalingMessage ignoreDisconnectWebSocket option", () => { const options3 = { ignoreDisconnectWebSocket: undefined, }; - const diff3 = { - }; + const diff3 = {}; expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual( Object.assign({}, baseExpectedMessage, diff3) ); @@ -459,3 +457,69 @@ test("createSignalingMessage redirect", () => { Object.assign({}, baseExpectedMessage, { redirect: true }) ); }); + +test("createSignalingMessage messagingDataChannels option", () => { + // array 以外の場合は無視 + const options1 = { + messagingDataChannels: "test", + }; + // @ts-ignore option で指定されている型以外を引数に指定する + expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual(baseExpectedMessage); + + // array が空の場合は追加されない + const options2 = { + messagingDataChannels: [], + }; + expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual(baseExpectedMessage); + + // messagingDataChannel に object 以外が含まれる場合は例外が発生する + const options3 = { + messagingDataChannels: [{ label: "test", direction: "sendrecv" }, "test"], + }; + expect(() => { + // @ts-ignore option で指定されている型以外を引数に指定する + createSignalingMessage(sdp, role, channelId, null, options3, false); + }).toThrow("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); + + // messagingDataChannel に null が含まれる場合は例外が発生する + const options4 = { + messagingDataChannels: [{ label: "test", direction: "sendrecv" }, null], + }; + expect(() => { + // @ts-ignore option で指定されている型以外を引数に指定する + createSignalingMessage(sdp, role, channelId, null, options4, false); + }).toThrow("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); + + // 正常系 + const options5 = { + messagingDataChannels: [ + { label: "test", direction: "sendrecv" as MessagingDataChannelDirection }, + { + label: "test2", + direction: "sendonly" as MessagingDataChannelDirection, + ordered: true, + maxPacketLifeTime: 100, + maxRetransmits: 100, + protocol: "protocol", + compress: false, + }, + ], + }; + const diff5 = { + data_channel_messaging: [ + { label: "test", direction: "sendrecv" }, + { + label: "test2", + direction: "sendonly", + ordered: true, + max_packet_life_time: 100, + max_retransmits: 100, + protocol: "protocol", + compress: false, + }, + ], + }; + expect(createSignalingMessage(sdp, role, channelId, null, options5, false)).toEqual( + Object.assign({}, baseExpectedMessage, diff5) + ); +}); From d46550000c24722cda01e72a7b35d1f5aef6b9d5 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 17 Sep 2021 12:07:32 +0900 Subject: [PATCH 22/87] =?UTF-8?q?=E6=8E=A5=E7=B6=9A=E5=89=8D=E3=81=AE=20se?= =?UTF-8?q?ndMessage=20=E5=87=A6=E7=90=86=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 69ce8749..13f63176 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -1586,8 +1586,12 @@ export default class ConnectionBase { sendMessage(label: string, message: JSONType): void { const dataChannel = this.dataChannels[label]; + // 接続していない場合は何もしない + if (this.pc === null) { + return; + } if (dataChannel === undefined) { - throw new Error("error5"); + throw new Error("Could not find DataChannel"); } if (this.dataChannelsCompress[label] === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); From 72397e505a56cd0dea16ae6f9a57c31b4ecf5e1b Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 17 Sep 2021 12:08:01 +0900 Subject: [PATCH 23/87] =?UTF-8?q?example=20=E3=81=AB=20Messaging=20DataCha?= =?UTF-8?q?nnel=20=E3=81=AE=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/index.html | 1 + example/messaging_data_channel.html | 106 ++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 example/messaging_data_channel.html diff --git a/example/index.html b/example/index.html index 940da79b..623dbaff 100644 --- a/example/index.html +++ b/example/index.html @@ -14,6 +14,7 @@
  • スポットライト配信視聴サンプル
  • スポットライト視聴サンプル
  • サイマルキャスト配信/視聴サンプル
  • +
  • メッセージングデータチャネルサンプル
  • diff --git a/example/messaging_data_channel.html b/example/messaging_data_channel.html new file mode 100644 index 00000000..76de24ee --- /dev/null +++ b/example/messaging_data_channel.html @@ -0,0 +1,106 @@ + + + + Messaging DataChannel + + +
    +

    Messaging DataChannel test

    +

    複数のブラウザで開いて sendMessage することで動作確認できます

    +
    +
    +
    + +
    +
    + +
    + +
    +
    +

    messages

    +
      +
    +
    +
    +
    +
    + + + + + From d0d823265d107308bd74a0eb5dcc18b97f9c5a47 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 17 Sep 2021 14:33:34 +0900 Subject: [PATCH 24/87] =?UTF-8?q?CHANGES=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index bac1e97b..2780b975 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,9 @@ - バグ修正 ## develop +- [ADD] DataChannel メッセージング機能を追加する + - sendrecv オブジェクトに sendMessage API を追加する + - on callback に "message" を追加する - [CHANGE] 複数 Signaling URL への接続に対応する - Connection オブジェクト第一引数の type を `string` から `string | string[]` に変更する - Connection オブジェクト signalingUrl プロパティの戻り値の type を `string` から `string | string[]` に変更する From 0e7f0a8c3257590fd7804c6b8e24c243240054ec Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 17 Sep 2021 14:36:21 +0900 Subject: [PATCH 25/87] 2021.2.0-canary.1 --- dist/base.d.ts | 3 +- dist/sora.js | 97 +++++++++++++++++++++++++++++++---- dist/sora.min.js | 4 +- dist/sora.min.js.map | 2 +- dist/sora.mjs | 97 +++++++++++++++++++++++++++++++---- dist/types.d.ts | 26 ++++++++++ dist/utils.d.ts | 3 +- lerna.json | 2 +- package.json | 2 +- packages/e2ee/package.json | 4 +- packages/go-wasm/package.json | 2 +- packages/sdk/package.json | 4 +- 12 files changed, 216 insertions(+), 30 deletions(-) diff --git a/dist/base.d.ts b/dist/base.d.ts index 2eea0b4d..1f8428e5 100644 --- a/dist/base.d.ts +++ b/dist/base.d.ts @@ -97,12 +97,13 @@ export default class ConnectionBase { private setSenderParameters; private getStats; private onDataChannel; - private sendMessage; + private sendSignalingMessage; private sendE2EEMessage; private sendStatsMessage; private getAudioTransceiver; private getVideoTransceiver; private soraCloseEvent; + sendMessage(label: string, message: JSONType): void; get e2eeSelfFingerprint(): string | undefined; get e2eeRemoteFingerprints(): Record | undefined; get audio(): boolean; diff --git a/dist/sora.js b/dist/sora.js index 47fcbef6..bd997a36 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * @sora/sdk * undefined - * @version: 2021.2.0-canary.0 + * @version: 2021.2.0-canary.1 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -604,7 +604,7 @@ /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.2.0-canary.0 + * @version: 2021.2.0-canary.1 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -772,7 +772,7 @@ } } static version() { - return "2021.2.0-canary.0"; + return "2021.2.0-canary.1"; } static wasmVersion() { return window.e2ee.version(); @@ -1587,6 +1587,42 @@ const hasAllRequiredHeaderExtensions = REQUIRED_HEADER_EXTEMSIONS.every((h) => headerExtensions.includes(h)); return hasAllRequiredHeaderExtensions; } + function parseMessagingDataChannel(params) { + if (typeof params !== "object" || params === null) { + throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); + } + const messagingDataChannel = params; + const result = {}; + if (typeof messagingDataChannel.label === "string") { + result.label = messagingDataChannel.label; + } + if (typeof messagingDataChannel.direction === "string") { + result.direction = messagingDataChannel.direction; + } + if (typeof messagingDataChannel.ordered === "boolean") { + result.ordered = messagingDataChannel.ordered; + } + if (typeof messagingDataChannel.compress === "boolean") { + result.compress = messagingDataChannel.compress; + } + if (typeof messagingDataChannel.maxPacketLifeTime === "number") { + result.max_packet_life_time = messagingDataChannel.maxPacketLifeTime; + } + if (typeof messagingDataChannel.maxRetransmits === "number") { + result.max_retransmits = messagingDataChannel.maxRetransmits; + } + if (typeof messagingDataChannel.protocol === "string") { + result.protocol = messagingDataChannel.protocol; + } + return result; + } + function parseMessagingDataChannels(messagingDataChannels) { + const result = []; + for (const messagingDataChannel of messagingDataChannels) { + result.push(parseMessagingDataChannel(messagingDataChannel)); + } + return result; + } function isSafari() { return browser() === "safari"; } @@ -1599,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.0", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.1", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1773,6 +1809,9 @@ } message.e2ee = true; } + if (Array.isArray(options.messagingDataChannels) && 0 < options.messagingDataChannels.length) { + message.data_channel_messaging = parseMessagingDataChannels(options.messagingDataChannels); + } return message; } function getSignalingNotifyAuthnMetadata(message) { @@ -1885,6 +1924,12 @@ event.dataChannelLabel = dataChannelLabel; return event; } + function createMessagingEvent(label, data) { + const event = new Event("messaging"); + event.label = label; + event.data = data; + return event; + } class ConnectionBase { constructor(signalingUrlCandidates, role, channelId, metadata, options, debug) { @@ -1933,6 +1978,7 @@ timeout: () => { }, timeline: () => { }, signaling: () => { }, + messaging: () => { }, }; this.authMetadata = null; this.e2ee = null; @@ -2788,7 +2834,7 @@ const candidate = event.candidate.toJSON(); const message = Object.assign(candidate, { type: "candidate" }); this.trace("ONICECANDIDATE CANDIDATE MESSAGE", message); - this.sendMessage(message); + this.sendSignalingMessage(message); } }; } @@ -3008,13 +3054,13 @@ sendUpdateAnswer() { if (this.pc && this.ws && this.pc.localDescription) { this.trace("ANSWER SDP", this.pc.localDescription.sdp); - this.sendMessage({ type: "update", sdp: this.pc.localDescription.sdp }); + this.sendSignalingMessage({ type: "update", sdp: this.pc.localDescription.sdp }); } } sendReAnswer() { if (this.pc && this.pc.localDescription) { this.trace("RE ANSWER SDP", this.pc.localDescription.sdp); - this.sendMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp }); + this.sendSignalingMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp }); } } async signalingOnMessageTypeUpdate(message) { @@ -3230,8 +3276,23 @@ } }; } + else if (/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(dataChannelEvent.channel.label)) { + dataChannelEvent.channel.onmessage = (event) => { + if (event.target === null) { + return; + } + const dataChannel = event.target; + let data = event.data; + if (this.dataChannelsCompress[dataChannel.label] === true) { + const unzlibMessage = unzlibSync(new Uint8Array(event.data)); + data = new TextDecoder().decode(unzlibMessage); + } + const message = JSON.parse(data); + this.callbacks.messaging(createMessagingEvent(dataChannel.label, message)); + }; + } } - sendMessage(message) { + sendSignalingMessage(message) { if (this.dataChannels.signaling) { if (this.dataChannelsCompress.signaling === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); @@ -3312,6 +3373,24 @@ }; return new soraCloseEvent(type, title, initDict); } + sendMessage(label, message) { + const dataChannel = this.dataChannels[label]; + // 接続していない場合は何もしない + if (this.pc === null) { + return; + } + if (dataChannel === undefined) { + throw new Error("Could not find DataChannel"); + } + if (this.dataChannelsCompress[label] === true) { + const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); + const zlibMessage = zlibSync(binaryMessage, {}); + dataChannel.send(zlibMessage); + } + else { + dataChannel.send(JSON.stringify(message)); + } + } get e2eeSelfFingerprint() { if (this.options.e2ee && this.e2ee) { return this.e2ee.selfFingerprint(); @@ -3659,7 +3738,7 @@ return new SoraConnection(signalingUrlCandidates, debug); }, version: function () { - return "2021.2.0-canary.0"; + return "2021.2.0-canary.1"; }, helpers: { applyMediaStreamConstraints, diff --git a/dist/sora.min.js b/dist/sora.min.js index 75229044..cddbfcc0 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,8 +1,8 @@ /** * @sora/sdk * undefined - * @version: 2021.2.0-canary.0 + * @version: 2021.2.0-canary.1 * @author: Shiguredo Inc. * @license: Apache-2.0 - **/(function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"==typeof globalThis?e||self:globalThis,e.Sora=n())})(this,function(){'use strict';var n=Math.min,a=Math.ceil,t=Math.max;function g(){(()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,a){n+=i.decode(a);const t=n.lastIndexOf("\n");return-1!=t&&(console.log(n.substr(0,t)),n=n.substr(t+1)),a.length},write(i,a,t,g,o,d){if(0!==t||g!==a.length||null!==o)return void d(e());const l=this.writeSync(i,a);d(null,l)},chmod(n,i,a){a(e())},chown(n,i,a,t){t(e())},close(n,i){i(e())},fchmod(n,i,a){a(e())},fchown(n,i,a,t){t(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,a){a(e())},lchown(n,i,a,t){t(e())},link(n,i,a){a(e())},lstat(n,i){i(e())},mkdir(n,i,a){a(e())},open(n,i,a,t){t(e())},read(n,i,a,t,g,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,a){a(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,a){a(e())},truncate(n,i,a){a(e())},unlink(n,i){i(e())},utimes(n,i,a,t){t(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},t=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},g=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let a=0;switch(typeof n){case"object":null!==n&&(a=1);break;case"string":a=2;break;case"symbol":a=3;break;case"function":a=4;}this.mem.setUint32(e+4,2146959360|a,!0),this.mem.setUint32(e,i,!0)},d=e=>{const n=t(e+0),i=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},l=e=>{const n=t(e+0),o=t(e+8),d=Array(o);for(let a=0;a{const n=t(e+0),a=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},s=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=t(e+8),a=t(e+16),g=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,g))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(s+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},t(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(d(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,c(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(g(e+8),c(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(g(e+8),c(e+16),g(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(g(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(g(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(g(e+8),t(e+16),g(e+24))},"syscall/js.valueCall":e=>{try{const n=g(e+8),i=Reflect.get(n,c(e+16)),a=l(e+32),t=Reflect.apply(i,n,a);e=this._inst.exports.getsp(),o(e+56,t),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=g(e+8),i=l(e+16),a=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=g(e+8),i=l(e+16),a=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(g(n+8).length))},"syscall/js.valuePrepareString":i=>{const a=n.encode(g(i+8)+"");o(i+16,a),e(i+24,a.length)},"syscall/js.valueLoadString":e=>{const n=g(e+8);d(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,g(e+8)instanceof g(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=d(n+8),a=g(n+32);if(!(a instanceof Uint8Array||a instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=g(n+8),a=d(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const a=e=>{const a=i,t=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,0!=i%8&&(i+=8-i%8),a},t=this.argv.length,g=[];this.argv.forEach(e=>{g.push(a(e))}),g.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{g.push(a(`${e}=${this.env[e]}`))}),g.push(0);const d=i;g.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(t,d),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=le();i.p(e);var a=ce(e,n,2,4);return Ce(a,n),se(a,a.length-4,i.d()),a}function d(e,n){return z((Ie(e),e.subarray(2,-4)),n)}function l(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function c(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function s(){return"safari"===l()}function C(e,n,i,a,t,g){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.0",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==a&&(o.metadata=a),g&&(o.redirect=!0),"signalingNotifyMetadata"in t&&(o.signaling_notify_metadata=t.signalingNotifyMetadata),"multistream"in t&&!0===t.multistream&&(o.multistream=!0,"spotlight"in t&&(o.spotlight=t.spotlight,"spotlightNumber"in t&&(o.spotlight_number=t.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==t.spotlightFocusRid&&0<=e.indexOf(t.spotlightFocusRid)&&(o.spotlight_focus_rid=t.spotlightFocusRid),void 0!==t.spotlightUnfocusRid&&0<=e.indexOf(t.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=t.spotlightUnfocusRid)}if("simulcast"in t||"simulcastRid"in t){"simulcast"in t&&!0===t.simulcast&&(o.simulcast=!0);void 0!==t.simulcastRid&&0<=["r0","r1","r2"].indexOf(t.simulcastRid)&&(o.simulcast_rid=t.simulcastRid)}"clientId"in t&&void 0!==t.clientId&&(o.client_id=t.clientId),"dataChannelSignaling"in t&&"boolean"==typeof t.dataChannelSignaling&&(o.data_channel_signaling=t.dataChannelSignaling),"ignoreDisconnectWebSocket"in t&&"boolean"==typeof t.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=t.ignoreDisconnectWebSocket);const d=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],s=["videoCodecType","videoBitRate"],C=Object.assign({},t);Object.keys(C).forEach(e=>{"audio"===e&&"boolean"==typeof C[e]||"video"===e&&"boolean"==typeof C[e]||0<=d.indexOf(e)&&null!==C[e]||0<=l.indexOf(e)&&null!==C[e]||0<=s.indexOf(e)&&null!==C[e]||delete C[e]}),void 0!==C.audio&&(o.audio=C.audio);const I=Object.keys(C).some(e=>0<=d.indexOf(e));o.audio&&I&&(o.audio={},"audioCodecType"in C&&(o.audio.codec_type=C.audioCodecType),"audioBitRate"in C&&(o.audio.bit_rate=C.audioBitRate));const r=Object.keys(C).some(e=>0<=l.indexOf(e));o.audio&&r&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in C&&(o.audio.opus_params.channels=C.audioOpusParamsChannels),"audioOpusParamsClockRate"in C&&(o.audio.opus_params.clock_rate=C.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in C&&(o.audio.opus_params.maxplaybackrate=C.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in C&&(o.audio.opus_params.stereo=C.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in C&&(o.audio.opus_params.sprop_stereo=C.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in C&&(o.audio.opus_params.minptime=C.audioOpusParamsMinptime),"audioOpusParamsPtime"in C&&(o.audio.opus_params.ptime=C.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in C&&(o.audio.opus_params.useinbandfec=C.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in C&&(o.audio.opus_params.usedtx=C.audioOpusParamsUsedtx)),void 0!==C.video&&(o.video=C.video);const m=Object.keys(C).some(e=>0<=s.indexOf(e));if(o.video&&m&&(o.video={},"videoCodecType"in C&&(o.video.codec_type=C.videoCodecType),"videoBitRate"in C&&(o.video.bit_rate=C.videoBitRate)),o.simulcast&&!c()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===t.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return o}function I(e){if(e.authn_metadata!==void 0)return e.authn_metadata;return void 0===e.metadata?null:e.metadata}function r(e){if(e.data&&Array.isArray(e.data))return e.data;return e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}function m(e){return"object"==typeof e&&null!==e&&"pre_key_bundle"in e?e.pre_key_bundle:null}function A(e,n,i){const a=e=>{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),a(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let t="";window.performance&&(t="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(t=t+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(t+" "+n),a(i),console.groupEnd()):console.log(t+" "+n+"\n",i)}function u(e,n,i){const a=new Event(e);try{a.data=JSON.parse(JSON.stringify(n))}catch(e){a.data=n}return a.transportType=i,a}function Z(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function b(e,n,i,a,t){const g=new Event(e);try{g.data=JSON.parse(JSON.stringify(n))}catch(e){g.data=n}return g.logType=i,g.dataChannelId=a,g.dataChannelLabel=t,g}class p{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNT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CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5UZXh0LmJ5dGVMZW5ndGgpOwogICAgICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgICAgICBuZXdVaW50OC5zZXQobmV3IFVpbnQ4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CBzZWxmS2V5SWQsIHdhaXRpbmdUaW1lIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5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wogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:a},[i,a])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:a},[i,a])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,a=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:a})}startSession(e,n){const[i,a]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(a)throw a;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(g(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.2.0-canary.0"}static wasmVersion(){return window.e2ee.version()}}var V=Uint8Array,S=Uint16Array,W=Uint32Array,G=new V([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h=new 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,0,0]),y=new V([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),k=function(e,n){for(var a=new S(31),t=0;31>t;++t)a[t]=n+=1<t;++t)for(var o=a[t];oN;++N)X=(43690&N)>>>1|(21845&N)<<1,X=(52428&X)>>>2|(13107&X)<<2,X=(61680&X)>>>4|(3855&X)<<4,Y[N]=((65280&X)>>>8|(255&X)<<8)>>>1;for(var v=function(e,n,a){for(var t=e.length,g=0,o=new S(n);g>>15-n]=c}else for(l=new S(t),g=0;g>>15-e[g]);return l},E=new V(288),N=0;144>N;++N)E[N]=8;for(var N=144;256>N;++N)E[N]=9;for(var N=256;280>N;++N)E[N]=7;for(var N=280;288>N;++N)E[N]=8;for(var O=new V(32),N=0;32>N;++N)O[N]=5;var K=v(E,9,0),L=v(E,9,1),F=v(O,5,0),J=v(O,5,1),U=function(e){for(var n=e[0],a=1;an&&(n=e[a]);return n},Q=function(e,n,i){var a=0|n/8;return(e[a]|e[a+1]<<8)>>(7&n)&i},D=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},H=function(e){return 0|(e+7)/8},M=function(i,a,t){(null==a||0>a)&&(a=0),(null==t||t>i.length)&&(t=i.length);var g=new(i instanceof S?S:i instanceof W?W:V)(t-a);return g.set(i.subarray(a,t)),g},P=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],j=function(n,i,a){var t=new Error(i||P[n]);if(t.code=n,Error.captureStackTrace&&Error.captureStackTrace(t,j),!a)throw t;return t},z=function(a,g,o){var C=a.length;if(!C||o&&o.f&&!o.l)return g||new V(0);var I=!g||o,m=!o||o.i;o||(o={}),g||(g=new V(3*C));var A=function(e){var n=g.length;if(e>n){var i=new V(t(2*n,e));i.set(g),g=i}},u=o.f||0,Z=o.p||0,p=o.b||0,S=o.l,W=o.d,k=o.m,w=o.n,R=8*C;do{if(!S){u=Q(a,Z,1);var X=Q(a,Z+1,3);if(Z+=3,!X){var f=H(Z)+4,T=a[f-4]|a[f-3]<<8,l=f+T;if(l>C){m&&j(0);break}I&&A(p+T),g.set(a.subarray(f,l),p),o.b=p+=T,o.p=Z=8*l,o.f=u;continue}else if(1==X)S=L,W=J,k=9,w=5;else if(2==X){var Y=Q(a,Z,31)+257,N=Q(a,Z+10,15)+4,E=Y+Q(a,Z+5,31)+1;Z+=14;for(var O=new V(E),K=new V(19),F=0;F>>4;if(16>f)O[F++]=f;else{var _=0,q=0;for(16==f?(q=3+Q(a,Z,3),Z+=2,_=O[F-1]):17==f?(q=3+Q(a,Z,7),Z+=3):18==f&&(q=11+Q(a,Z,127),Z+=7);q--;)O[F++]=_}}var $=O.subarray(0,Y),ee=O.subarray(Y);k=U($),w=U(ee),S=v($,k,1),W=v(ee,w,1)}else j(1);if(Z>R){m&&j(0);break}}I&&A(p+131072);for(var ne=(1<>>4;if(Z+=15&_,Z>R){m&&j(0);break}if(_||j(2),256>te)g[p++]=te;else if(256==te){ae=Z,S=null;break}else{var ge=te-254;if(264>>4;de||j(3),Z+=15&de;var ee=B[d];if(3R){m&&j(0);break}I&&A(p+131072);for(var le=p+ge;p>>8},q=function(e,n,i){i<<=7&n;var a=0|n/8;e[a]|=i,e[a+1]|=i>>>8,e[a+2]|=i>>>16},$=function(e,n){for(var a=[],t=0;tA&&(A=o[t].s);var u=new S(A+1),Z=ee(a[I-1],u,0);if(Z>n){var t=0,b=0,p=Z-n;for(o.sort(function(e,n){return u[n.s]-u[e.s]||e.f-n.f});tn)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var ee,f=0;f>>5),C+=x[f]>>>12)}}else Q=K,D=E,j=F,H=O;for(var f=0;f>>18;q(n,C,Q[ee+257]),C+=D[ee+257],7>>23),C+=G[ee]);var te=31&t[f];q(n,C,j[te]),C+=H[te],3>>5),C+=h[te])}else q(n,C,Q[t[f]]),C+=D[t[f]];return q(n,C,Q[256]),C+D[256]},ge=new W([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oe=new V(0),de=function(t,g,c,C,I,r){var m=t.length,s=new V(C+m+5*(1+a(m/7e3))+I),o=s.subarray(C,s.length-I),A=0;if(!g||8>m)for(var u,Z=0;Z<=m;Z+=65535)u=Z+65535,uQ;++Q)B[Q]=0;for(var Q=0;30>Q;++Q)Y[Q]=0}var D=2,x=0,P=8191&b,z=32767&F-J;if(2>>13,U)-1,q=n(32767,Z),$=n(258,U);z<=q&&--P&&F!=J;){if(t[Z+D]==t[Z+D-z]){for(var ee=0;ee<$&&t[Z+ee]==t[Z+ee-z];++ee);if(ee>D){if(D=ee,x=z,ee>_)break;for(var ne=n(z,ee-2),ie=0,Q=0;Qie&&(ie=ce,J=de)}}}F=J,J=y[F],z+=32767&F-J+32768}if(x){f[E++]=268435456|R[D]<<18|T[x];var se=31&R[D],Ce=31&T[x];v+=G[se]+h[Ce],++B[257+se],++Y[Ce],O=Z+D,++N}else f[E++]=t[Z],++B[t[Z]]}}A=te(t,o,r,f,B,Y,v,E,K,Z-K,A),!r&&7&A&&(A=ae(o,A+1,oe))}return M(s,0,C+H(A)+I)},le=function(){var t=1,g=0;return{p:function(a){for(var o,d=t,c=g,s=0|a.length,l=0;l!=s;){for(o=n(l+2655,s);l>16),c=(65535&c)+15*(c>>16)}t=d,g=c},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},ce=function(e,i,g,o,d){return de(e,null==i.level?6:i.level,null==i.mem?a(1.5*t(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!d)},se=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},Ce=function(e,n){var i=n.level,a=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},Ie=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&j(6,"invalid zlib data"),32&e[1]&&j(6,"invalid zlib data: preset dictionaries not supported")},re="undefined"!=typeof TextDecoder&&new TextDecoder,me=0;try{re.decode(oe,{stream:!0}),me=1}catch(n){}class Ae extends Error{}class ue{constructor(e,n,i,a,t,g){this.role=n,this.channelId=i,this.metadata=a,this.signalingUrlCandidates=e,this.options=t,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.dataChannelsCompress={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const a={type:"disconnect",reason:e};this.ws.send(JSON.stringify(a)),this.writeWebSocketSignalingLog("send-disconnect",a),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const a=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),t=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(a),e(),n({code:4999,reason:""}));t.push((()=>new Promise(e=>{let n=0;const a=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(a),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(a))},100)}))())}}Promise.all(t).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(a)});const g={type:"disconnect",reason:"NO-ERROR"};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new p,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){return new Promise((n,i)=>{const a=new WebSocket(e);a.onclose=e=>{const n=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),i(n)},a.onopen=()=>{n(a)}})}if(Array.isArray(e)){let n=!1;const i=e=>new Promise((i,a)=>{const t=new WebSocket(e),g=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:t.url}),t&&!n&&(t.onclose=null,t.onerror=null,t.onopen=null,t.close(),a())},this.signalingCandidateTimeout);t.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:t.url,message:`WebSocket closed`,code:e.code,reason:e.reason}),t&&t.close(),clearInterval(g),a()},t.onerror=()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:t.url,message:`Failed to connect WebSocket`}),t&&(t.onclose=null,t.close()),clearInterval(g),a()},t.onopen=()=>{t&&(clearInterval(g),n?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!1}),t.onerror=null,t.onclose=null,t.onopen=null,t.close(),a()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!0}),t.onerror=null,t.onclose=null,t.onopen=null,n=!0,i(t)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(n){throw new Ae("Signaling failed. All signaling URL candidates failed to connect")}}throw new Ae("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,n=!1){const i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((a,t)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const n=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const n=JSON.parse(e.data);if("offer"==n.type)this.writeWebSocketSignalingLog("onmessage-offer",n),this.signalingOnMessageTypeOffer(n),a(n);else if("update"==n.type)this.writeWebSocketSignalingLog("onmessage-update",n),await this.signalingOnMessageTypeUpdate(n);else if("re-offer"==n.type)this.writeWebSocketSignalingLog("onmessage-re-offer",n),await this.signalingOnMessageTypeReOffer(n);else if("ping"==n.type)await this.signalingOnMessageTypePing(n);else if("push"==n.type)this.callbacks.push(n,"websocket");else if("notify"==n.type)"connection.created"===n.event_type?this.writeWebSocketTimelineLog("notify-connection.created",n):"connection.destroyed"===n.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",n),this.signalingOnMessageTypeNotify(n,"websocket");else if("switched"==n.type)this.writeWebSocketSignalingLog("onmessage-switched",n),this.signalingOnMessageTypeSwitched(n);else if("redirect"==n.type){this.writeWebSocketSignalingLog("onmessage-redirect",n);const e=await this.signalingOnMessageTypeRedirect(n);a(e)}},(async()=>{let a;try{a=C(i.sdp||"",this.role,this.channelId,this.metadata,this.options,n)}catch(e){return void t(e)}if(a.e2ee&&this.e2ee){const e=await this.e2ee.init();a.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",a),e&&(e.send(JSON.stringify(a)),this.writeWebSocketSignalingLog(`send-${a.type}`,a),this.ws=e)})()})}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new Ae(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&A(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(u(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(u(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=b(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const a=b(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(a)}writePeerConnectionTimelineLog(e,n){const i=b(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=b(e,n,"sora");this.callbacks.timeline(i)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(s()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.dataChannelsCompress[n.label]=n.compress;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=I(e),a=m(i);if(a&&this.e2ee&&n){const e=this.e2ee.startSession(n,a);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=r(e);i.forEach(e=>{const n=I(e),i=m(n),a=e.connection_id;a&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(a,i)})}else if("connection.destroyed"===e.event_type){const n=I(e),i=m(n),a=e.connection_id;if(i&&this.e2ee&&a){const e=this.e2ee.stopSession(a);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(a)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const n=await this.getSignalingWebSocket(e.location),i=await this.signaling(n,!0);return i}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,Z(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.signaling){const n=d(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${a.type}`,n,a),"re-offer"===a.type&&(await this.signalingOnMessageTypeReOffer(a))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.notify){const n=d(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(!0===this.dataChannelsCompress.push){const i=d(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label&&(e.channel.onmessage=async e=>{let n=e.data;if(!0===this.dataChannelsCompress.stats){const i=d(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}})}sendMessage(e){if(this.dataChannels.signaling){if(!0===this.dataChannelsCompress.signaling){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(!0===this.dataChannelsCompress.stats){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const a=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new a(e,n,i)}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}}class Ze extends ue{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class be extends ue{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,a){n+=i.decode(a);const t=n.lastIndexOf("\n");return-1!=t&&(console.log(n.substr(0,t)),n=n.substr(t+1)),a.length},write(i,a,t,g,o,l){if(0!==t||g!==a.length||null!==o)return void l(e());const d=this.writeSync(i,a);l(null,d)},chmod(n,i,a){a(e())},chown(n,i,a,t){t(e())},close(n,i){i(e())},fchmod(n,i,a){a(e())},fchown(n,i,a,t){t(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,a){a(e())},lchown(n,i,a,t){t(e())},link(n,i,a){a(e())},lstat(n,i){i(e())},mkdir(n,i,a){a(e())},open(n,i,a,t){t(e())},read(n,i,a,t,g,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,a){a(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,a){a(e())},truncate(n,i,a){a(e())},unlink(n,i){i(e())},utimes(n,i,a,t){t(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},t=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},g=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let a=0;switch(typeof n){case"object":null!==n&&(a=1);break;case"string":a=2;break;case"symbol":a=3;break;case"function":a=4;}this.mem.setUint32(e+4,2146959360|a,!0),this.mem.setUint32(e,i,!0)},l=e=>{const n=t(e+0),i=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},d=e=>{const n=t(e+0),o=t(e+8),l=Array(o);for(let a=0;a{const n=t(e+0),a=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},s=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=t(e+8),a=t(e+16),g=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,g))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(s+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},t(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,c(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(g(e+8),c(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(g(e+8),c(e+16),g(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(g(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(g(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(g(e+8),t(e+16),g(e+24))},"syscall/js.valueCall":e=>{try{const n=g(e+8),i=Reflect.get(n,c(e+16)),a=d(e+32),t=Reflect.apply(i,n,a);e=this._inst.exports.getsp(),o(e+56,t),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=g(e+8),i=d(e+16),a=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=g(e+8),i=d(e+16),a=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(g(n+8).length))},"syscall/js.valuePrepareString":i=>{const a=n.encode(g(i+8)+"");o(i+16,a),e(i+24,a.length)},"syscall/js.valueLoadString":e=>{const n=g(e+8);l(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,g(e+8)instanceof g(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=l(n+8),a=g(n+32);if(!(a instanceof Uint8Array||a instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=g(n+8),a=l(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const a=e=>{const a=i,t=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,0!=i%8&&(i+=8-i%8),a},t=this.argv.length,g=[];this.argv.forEach(e=>{g.push(a(e))}),g.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{g.push(a(`${e}=${this.env[e]}`))}),g.push(0);const l=i;g.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(t,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=Ce();i.p(e);var a=Ie(e,n,2,4);return me(a,n),re(a,a.length-4,i.d()),a}function l(e,n){return $((Ae(e),e.subarray(2,-4)),n)}function d(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function c(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function s(e){if("object"!=typeof e||null===e)throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'");const n=e,i={};return"string"==typeof n.label&&(i.label=n.label),"string"==typeof n.direction&&(i.direction=n.direction),"boolean"==typeof n.ordered&&(i.ordered=n.ordered),"boolean"==typeof n.compress&&(i.compress=n.compress),"number"==typeof n.maxPacketLifeTime&&(i.max_packet_life_time=n.maxPacketLifeTime),"number"==typeof n.maxRetransmits&&(i.max_retransmits=n.maxRetransmits),"string"==typeof n.protocol&&(i.protocol=n.protocol),i}function C(e){const n=[];for(const i of e)n.push(s(i));return n}function I(){return"safari"===d()}function r(e,n,i,a,t,g){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.1",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==a&&(o.metadata=a),g&&(o.redirect=!0),"signalingNotifyMetadata"in t&&(o.signaling_notify_metadata=t.signalingNotifyMetadata),"multistream"in t&&!0===t.multistream&&(o.multistream=!0,"spotlight"in t&&(o.spotlight=t.spotlight,"spotlightNumber"in t&&(o.spotlight_number=t.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==t.spotlightFocusRid&&0<=e.indexOf(t.spotlightFocusRid)&&(o.spotlight_focus_rid=t.spotlightFocusRid),void 0!==t.spotlightUnfocusRid&&0<=e.indexOf(t.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=t.spotlightUnfocusRid)}if("simulcast"in t||"simulcastRid"in t){"simulcast"in t&&!0===t.simulcast&&(o.simulcast=!0);void 0!==t.simulcastRid&&0<=["r0","r1","r2"].indexOf(t.simulcastRid)&&(o.simulcast_rid=t.simulcastRid)}"clientId"in t&&void 0!==t.clientId&&(o.client_id=t.clientId),"dataChannelSignaling"in t&&"boolean"==typeof t.dataChannelSignaling&&(o.data_channel_signaling=t.dataChannelSignaling),"ignoreDisconnectWebSocket"in t&&"boolean"==typeof t.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=t.ignoreDisconnectWebSocket);const l=["audioCodecType","audioBitRate"],d=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],s=["videoCodecType","videoBitRate"],I=Object.assign({},t);Object.keys(I).forEach(e=>{"audio"===e&&"boolean"==typeof I[e]||"video"===e&&"boolean"==typeof I[e]||0<=l.indexOf(e)&&null!==I[e]||0<=d.indexOf(e)&&null!==I[e]||0<=s.indexOf(e)&&null!==I[e]||delete I[e]}),void 0!==I.audio&&(o.audio=I.audio);const r=Object.keys(I).some(e=>0<=l.indexOf(e));o.audio&&r&&(o.audio={},"audioCodecType"in I&&(o.audio.codec_type=I.audioCodecType),"audioBitRate"in I&&(o.audio.bit_rate=I.audioBitRate));const m=Object.keys(I).some(e=>0<=d.indexOf(e));o.audio&&m&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in I&&(o.audio.opus_params.channels=I.audioOpusParamsChannels),"audioOpusParamsClockRate"in I&&(o.audio.opus_params.clock_rate=I.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in I&&(o.audio.opus_params.maxplaybackrate=I.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in I&&(o.audio.opus_params.stereo=I.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in I&&(o.audio.opus_params.sprop_stereo=I.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in I&&(o.audio.opus_params.minptime=I.audioOpusParamsMinptime),"audioOpusParamsPtime"in I&&(o.audio.opus_params.ptime=I.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in I&&(o.audio.opus_params.useinbandfec=I.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in I&&(o.audio.opus_params.usedtx=I.audioOpusParamsUsedtx)),void 0!==I.video&&(o.video=I.video);const A=Object.keys(I).some(e=>0<=s.indexOf(e));if(o.video&&A&&(o.video={},"videoCodecType"in I&&(o.video.codec_type=I.videoCodecType),"videoBitRate"in I&&(o.video.bit_rate=I.videoBitRate)),o.simulcast&&!c()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===t.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(t.messagingDataChannels)&&0{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),a(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let t="";window.performance&&(t="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(t=t+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(t+" "+n),a(i),console.groupEnd()):console.log(t+" "+n+"\n",i)}function b(e,n,i){const a=new Event(e);try{a.data=JSON.parse(JSON.stringify(n))}catch(e){a.data=n}return a.transportType=i,a}function p(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function V(e,n,i,a,t){const g=new Event(e);try{g.data=JSON.parse(JSON.stringify(n))}catch(e){g.data=n}return g.logType=i,g.dataChannelId=a,g.dataChannelLabel=t,g}function S(e,n){const i=new Event("messaging");return i.label=e,i.data=n,i}class W{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXk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sKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:a},[i,a])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:a},[i,a])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,a=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:a})}startSession(e,n){const[i,a]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(a)throw a;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(g(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.2.0-canary.1"}static wasmVersion(){return window.e2ee.version()}}var G=Uint8Array,h=Uint16Array,y=Uint32Array,k=new G([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),w=new G([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),R=new G([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),X=function(e,n){for(var a=new h(31),t=0;31>t;++t)a[t]=n+=1<t;++t)for(var o=a[t];oO;++O)T=(43690&O)>>>1|(21845&O)<<1,T=(52428&T)>>>2|(13107&T)<<2,T=(61680&T)>>>4|(3855&T)<<4,E[O]=((65280&T)>>>8|(255&T)<<8)>>>1;for(var K=function(e,n,a){for(var t=e.length,g=0,o=new h(n);g>>15-n]=c}else for(d=new h(t),g=0;g>>15-e[g]);return d},L=new G(288),O=0;144>O;++O)L[O]=8;for(var O=144;256>O;++O)L[O]=9;for(var O=256;280>O;++O)L[O]=7;for(var O=280;288>O;++O)L[O]=8;for(var F=new G(32),O=0;32>O;++O)F[O]=5;var J=K(L,9,0),U=K(L,9,1),D=K(F,5,0),Q=K(F,5,1),j=function(e){for(var n=e[0],a=1;an&&(n=e[a]);return n},H=function(e,n,i){var a=0|n/8;return(e[a]|e[a+1]<<8)>>(7&n)&i},M=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},P=function(e){return 0|(e+7)/8},z=function(i,a,t){(null==a||0>a)&&(a=0),(null==t||t>i.length)&&(t=i.length);var g=new(i instanceof h?h:i instanceof y?y:G)(t-a);return g.set(i.subarray(a,t)),g},_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],q=function(n,i,a){var t=new Error(i||_[n]);if(t.code=n,Error.captureStackTrace&&Error.captureStackTrace(t,q),!a)throw t;return t},$=function(a,g,o){var C=a.length;if(!C||o&&o.f&&!o.l)return g||new G(0);var I=!g||o,m=!o||o.i;o||(o={}),g||(g=new G(3*C));var A=function(e){var n=g.length;if(e>n){var i=new G(t(2*n,e));i.set(g),g=i}},u=o.f||0,Z=o.p||0,p=o.b||0,V=o.l,S=o.d,W=o.m,h=o.n,y=8*C;do{if(!V){u=H(a,Z,1);var X=H(a,Z+1,3);if(Z+=3,!X){var f=P(Z)+4,B=a[f-4]|a[f-3]<<8,l=f+B;if(l>C){m&&q(0);break}I&&A(p+B),g.set(a.subarray(f,l),p),o.b=p+=B,o.p=Z=8*l,o.f=u;continue}else if(1==X)V=U,S=Q,W=9,h=5;else if(2==X){var T=H(a,Z,31)+257,Y=H(a,Z+10,15)+4,v=T+H(a,Z+5,31)+1;Z+=14;for(var E=new G(v),O=new G(19),L=0;L>>4;if(16>f)E[L++]=f;else{var x=0,_=0;for(16==f?(_=3+H(a,Z,3),Z+=2,x=E[L-1]):17==f?(_=3+H(a,Z,7),Z+=3):18==f&&(_=11+H(a,Z,127),Z+=7);_--;)E[L++]=x}}var $=E.subarray(0,T),ee=E.subarray(T);W=j($),h=j(ee),V=K($,W,1),S=K(ee,h,1)}else q(1);if(Z>y){m&&q(0);break}}I&&A(p+131072);for(var ne=(1<>>4;if(Z+=15&x,Z>y){m&&q(0);break}if(x||q(2),256>te)g[p++]=te;else if(256==te){ae=Z,V=null;break}else{var ge=te-254;if(264>>4;le||q(3),Z+=15≤var ee=N[d];if(3y){m&&q(0);break}I&&A(p+131072);for(var de=p+ge;p>>8},ne=function(e,n,i){i<<=7&n;var a=0|n/8;e[a]|=i,e[a+1]|=i>>>8,e[a+2]|=i>>>16},ie=function(e,n){for(var a=[],t=0;tA&&(A=o[t].s);var u=new h(A+1),Z=ae(a[I-1],u,0);if(Z>n){var t=0,b=0,p=Z-n;for(o.sort(function(e,n){return u[n.s]-u[e.s]||e.f-n.f});tn)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var _,f=0;f>>5),C+=x[f]>>>12)}}else U=J,Q=L,j=D,H=F;for(var f=0;f>>18;ne(n,C,U[_+257]),C+=Q[_+257],7<_&&(ee(n,C,31&t[f]>>>23),C+=k[_]);var q=31&t[f];ne(n,C,j[q]),C+=H[q],3>>5),C+=w[q])}else ne(n,C,U[t[f]]),C+=Q[t[f]];return ne(n,C,U[256]),C+Q[256]},de=new y([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ce=new G(0),se=function(t,g,c,C,I,r){var m=t.length,s=new G(C+m+5*(1+a(m/7e3))+I),o=s.subarray(C,s.length-I),A=0;if(!g||8>m)for(var u,Z=0;Z<=m;Z+=65535)u=Z+65535,uD;++D)f[D]=0;for(var D=0;30>D;++D)T[D]=0}var Q=2,H=0,M=8191&b,x=32767&F-J;if(2>>13,U)-1,q=n(32767,Z),$=n(258,U);x<=q&&--M&&F!=J;){if(t[Z+Q]==t[Z+Q-x]){for(var ee=0;ee<$&&t[Z+ee]==t[Z+ee-x];++ee);if(ee>Q){if(Q=ee,H=x,ee>_)break;for(var ne=n(x,ee-2),ie=0,D=0;Die&&(ie=ge,J=ae)}}}F=J,J=V[F],x+=32767&F-J+32768}if(H){X[E++]=268435456|B[Q]<<18|v[H];var se=31&B[Q],Ce=31&v[H];N+=k[se]+w[Ce],++f[257+se],++T[Ce],O=Z+Q,++Y}else X[E++]=t[Z],++f[t[Z]]}}A=le(t,o,r,X,f,T,N,E,K,Z-K,A),!r&&7&A&&(A=oe(o,A+1,ce))}return z(s,0,C+P(A)+I)},Ce=function(){var t=1,g=0;return{p:function(a){for(var o,d=t,c=g,s=0|a.length,l=0;l!=s;){for(o=n(l+2655,s);l>16),c=(65535&c)+15*(c>>16)}t=d,g=c},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},Ie=function(e,i,g,o,l){return se(e,null==i.level?6:i.level,null==i.mem?a(1.5*t(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!l)},re=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},me=function(e,n){var i=n.level,a=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},Ae=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&q(6,"invalid zlib data"),32&e[1]&&q(6,"invalid zlib data: preset dictionaries not supported")},ue="undefined"!=typeof TextDecoder&&new TextDecoder,Ze=0;try{ue.decode(ce,{stream:!0}),Ze=1}catch(n){}class be extends Error{}class pe{constructor(e,n,i,a,t,g){this.role=n,this.channelId=i,this.metadata=a,this.signalingUrlCandidates=e,this.options=t,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},messaging:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.dataChannelsCompress={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const a={type:"disconnect",reason:e};this.ws.send(JSON.stringify(a)),this.writeWebSocketSignalingLog("send-disconnect",a),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const a=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),t=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(a),e(),n({code:4999,reason:""}));t.push((()=>new Promise(e=>{let n=0;const a=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(a),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(a))},100)}))())}}Promise.all(t).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(a)});const g={type:"disconnect",reason:"NO-ERROR"};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new W,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){return new Promise((n,i)=>{const a=new WebSocket(e);a.onclose=e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),i(n)},a.onopen=()=>{n(a)}})}if(Array.isArray(e)){let n=!1;const i=e=>new Promise((i,a)=>{const t=new WebSocket(e),g=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:t.url}),t&&!n&&(t.onclose=null,t.onerror=null,t.onopen=null,t.close(),a())},this.signalingCandidateTimeout);t.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:t.url,message:`WebSocket closed`,code:e.code,reason:e.reason}),t&&t.close(),clearInterval(g),a()},t.onerror=()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:t.url,message:`Failed to connect WebSocket`}),t&&(t.onclose=null,t.close()),clearInterval(g),a()},t.onopen=()=>{t&&(clearInterval(g),n?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!1}),t.onerror=null,t.onclose=null,t.onopen=null,t.close(),a()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!0}),t.onerror=null,t.onclose=null,t.onopen=null,n=!0,i(t)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(n){throw new be("Signaling failed. All signaling URL candidates failed to connect")}}throw new be("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,n=!1){const i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((a,t)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const n=JSON.parse(e.data);if("offer"==n.type)this.writeWebSocketSignalingLog("onmessage-offer",n),this.signalingOnMessageTypeOffer(n),a(n);else if("update"==n.type)this.writeWebSocketSignalingLog("onmessage-update",n),await this.signalingOnMessageTypeUpdate(n);else if("re-offer"==n.type)this.writeWebSocketSignalingLog("onmessage-re-offer",n),await this.signalingOnMessageTypeReOffer(n);else if("ping"==n.type)await this.signalingOnMessageTypePing(n);else if("push"==n.type)this.callbacks.push(n,"websocket");else if("notify"==n.type)"connection.created"===n.event_type?this.writeWebSocketTimelineLog("notify-connection.created",n):"connection.destroyed"===n.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",n),this.signalingOnMessageTypeNotify(n,"websocket");else if("switched"==n.type)this.writeWebSocketSignalingLog("onmessage-switched",n),this.signalingOnMessageTypeSwitched(n);else if("redirect"==n.type){this.writeWebSocketSignalingLog("onmessage-redirect",n);const e=await this.signalingOnMessageTypeRedirect(n);a(e)}},(async()=>{let a;try{a=r(i.sdp||"",this.role,this.channelId,this.metadata,this.options,n)}catch(e){return void t(e)}if(a.e2ee&&this.e2ee){const e=await this.e2ee.init();a.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",a),e&&(e.send(JSON.stringify(a)),this.writeWebSocketSignalingLog(`send-${a.type}`,a),this.ws=e)})()})}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendSignalingMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new be(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&Z(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(b(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(b(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=V(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const a=V(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(a)}writePeerConnectionTimelineLog(e,n){const i=V(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=V(e,n,"sora");this.callbacks.timeline(i)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(I()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.dataChannelsCompress[n.label]=n.compress;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=m(e),a=u(i);if(a&&this.e2ee&&n){const e=this.e2ee.startSession(n,a);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=A(e);i.forEach(e=>{const n=m(e),i=u(n),a=e.connection_id;a&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(a,i)})}else if("connection.destroyed"===e.event_type){const n=m(e),i=u(n),a=e.connection_id;if(i&&this.e2ee&&a){const e=this.e2ee.stopSession(a);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(a)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const n=await this.getSignalingWebSocket(e.location),i=await this.signaling(n,!0);return i}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,p(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.signaling){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${a.type}`,n,a),"re-offer"===a.type&&(await this.signalingOnMessageTypeReOffer(a))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.notify){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(!0===this.dataChannelsCompress.push){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let n=e.data;if(!0===this.dataChannelsCompress.stats){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const n=e.target;let i=e.data;if(!0===this.dataChannelsCompress[n.label]){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.callbacks.messaging(S(n.label,a))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(!0===this.dataChannelsCompress.signaling){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(!0===this.dataChannelsCompress.stats){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const a=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new a(e,n,i)}sendMessage(e,n){const i=this.dataChannels[e];if(null!==this.pc){if(void 0===i)throw new Error("Could not find DataChannel");if(!0===this.dataChannelsCompress[e]){const e=new TextEncoder().encode(JSON.stringify(n)),a=o(e,{});i.send(a)}else i.send(JSON.stringify(n))}}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}}class Ve extends pe{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class Se extends pe{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.2.0-canary.0\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0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VLZXlbImtleUlkIl0gPCBrZXlJZCkgewogICAgICAgICAgICBjb25zdCBuZXh0U2VsZkRlcml2ZUtleSA9IHsgY29ubmVjdGlvbklkLCBrZXlJZCwgZGVyaXZlS2V5IH07CiAgICAgICAgICAgIHNlbGZEZXJpdmVLZXlNYXAuc2V0KCJsYXRlc3QiLCBuZXh0U2VsZkRlcml2ZUtleSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSB7CiAgICAgICAgY29uc3QgbmV4dFNlbGZEZXJpdmVLZXkgPSB7IGNvbm5lY3Rpb25JZCwga2V5SWQsIGRlcml2ZUtleSB9OwogICAgICAgIHNlbGZEZXJpdmVLZXlNYXAuc2V0KCJsYXRlc3QiLCBuZXh0U2VsZkRlcml2ZUtleSk7CiAgICB9Cn0KZnVuY3Rpb24gc2lsZW5jZUZyYW1lKGVuY29kZWRGcmFtZSkgewogICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkLCByZWNlaXZlTWVzc2FnZSDlj5fkv6HliY3jga7loLTlkIgKICAgIGlmIChlbmNvZGVkRnJhbWUudHlwZSA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgLy8g6Z+z5aOw44Gv5pqX5Y+35YyW44Gv44GE44KL44Go6IGe44GR44Gf44KC44Gu44GY44KD44Gq44GE44Gu44Gn572u44GN5o+b44GI44KLCiAgICAgICAgY29uc3QgbmV3RGF0YSA9IG5ldyBBcnJheUJ1ZmZlcigzKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIE9wdXMg44K144Kk44Os44Oz44K544OV44Os44O844OgCiAgICAgICAgbmV3VWludDguc2V0KFsweGQ4LCAweGZmLCAweGZlXSk7CiAgICAgICAgZW5jb2RlZEZyYW1lLmRhdGEgPSBuZXdEYXRhOwogICAgfQogICAgZWxzZSB7CiAgICAgICAgLy8g5pig5YOP44GM5q2j5bi444GY44KD44Gq44GE44Gf44KBIFBMSSDjgrnjg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hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.2.0-canary.0\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAAX,CACNA,MAAM,CAACD,MAAP,CAAgBC,MADV,KAEA,IAAoB,WAAhB,QAAOC,CAAAA,IAAX,CACNA,IAAI,CAACF,MAAL,CAAcE,IADR,KAGN,MAAM,IAAIC,C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E,CACAhG,CAAC,CAAC,CAAD,CAAD,CAAO,GAAP,CAAYA,CAAC,CAAC,CAAD,CAAD,CAAQxD,CAAE,EAAI,CAAP,EAAaA,CAAE,CAAI,GAAK,EAAIA,CAAb,CAAmB,CAAlC,CACtB,EAEG5E,EAAG,CAAG,SAAUP,CAAV,CAAa,EACA,CAAf,GAAQ,EAAP,CAAAA,CAAC,CAAC,CAAD,CAAF,GAAmC,CAAf,CAACA,CAAC,CAAC,CAAD,CAAD,GAAS,CAA9B,EAAyC,CAACA,CAAC,CAAC,CAAD,CAAD,EAAQ,CAAR,CAAYA,CAAC,CAAC,CAAD,CAAd,EAAqB,EAD/C,GAEfhN,CAAG,CAAC,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file +{"version":3,"file":"sora.min.js","sources":["../packages/sdk/node_modules/fflate/esm/browser.js","../packages/go-wasm/src/wasm_exec.js","../packages/e2ee/dist/sora_e2ee.mjs"],"sourcesContent":["// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([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, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([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, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.2.0-canary.1\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTG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29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5UZXh0LmJ5dGV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GlmICh0eXBlID09PSAic2VsZlNlY3JldEtleU1hdGVyaWFsIikgewogICAgICAgIGNvbnN0IHsgc2VsZlNlY3JldEtleU1hdGVyaWFsLCBzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdhaXRpbmdUaW1lIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAg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ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.2.0-canary.1\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAAX,CACNA,MAAM,CAACD,MAAP,CAAgBC,MADV,KAEA,IAAoB,WAAhB,QAAOC,CAAAA,IAAX,CACNA,IAAI,CAACF,MAAL,CAAcE,IADR,KAGN,MAAM,IAAIC,CAAAA,KAAJ,CAAU,+DAAV,CAAN,CAOD,GAJKH,MAAM,CAACI,OAAR,EAAsC,WAAnB,QAAOA,CAAAA,OAI9B,GAHCJ,MAAM,CAACI,OAAP,CAAiBA,OAGlB,EAAI,CAACJ,MAAM,CAACK,EAAR,EAAcL,MAAM,CAACI,OAAzB,CAAkC,CACjC,KAAMC,CAAAA,CAAE,CAAGD,OAAO,CAAC,IAAD,CAAlB,CACwB,CAApB,GAAAE,MAAM,CAACC,IAAP,CAAYF,CAAZ,CAF6B,GAGhCL,MAAM,CAACK,EAAP,CAAYA,CAHoB,CAKjC,CAED,KAAMG,CAAAA,CAAM,CAAG,IAAM,CACpB,KAAMC,CAAAA,CAAG,CAAG,GAAIN,CAAAA,KAAJ,CAAU,iBAAV,CAAZ,CAEA,MADAM,CAAAA,CAAG,CAACC,IAAJ,CAAW,QACX,CAAOD,CACP,CAJD,CAMA,GAAI,CAACT,MAAM,CAACK,EAAZ,CAAgB,CACf,GAAIM,CAAAA,CAAS,CAAG,EAAhB,CACAX,MAAM,CAACK,EAAP,CAAY,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CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file diff --git a/dist/sora.mjs b/dist/sora.mjs index 0be2391d..8d1142e1 100644 --- a/dist/sora.mjs +++ b/dist/sora.mjs @@ -1,7 +1,7 @@ /** * @sora/sdk * undefined - * @version: 2021.2.0-canary.0 + * @version: 2021.2.0-canary.1 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -598,7 +598,7 @@ function WasmExec () { /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.2.0-canary.0 + * @version: 2021.2.0-canary.1 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -766,7 +766,7 @@ class SoraE2EE { } } static version() { - return "2021.2.0-canary.0"; + return "2021.2.0-canary.1"; } static wasmVersion() { return window.e2ee.version(); @@ -1581,6 +1581,42 @@ function enabledSimulcast() { const hasAllRequiredHeaderExtensions = REQUIRED_HEADER_EXTEMSIONS.every((h) => headerExtensions.includes(h)); return hasAllRequiredHeaderExtensions; } +function parseMessagingDataChannel(params) { + if (typeof params !== "object" || params === null) { + throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); + } + const messagingDataChannel = params; + const result = {}; + if (typeof messagingDataChannel.label === "string") { + result.label = messagingDataChannel.label; + } + if (typeof messagingDataChannel.direction === "string") { + result.direction = messagingDataChannel.direction; + } + if (typeof messagingDataChannel.ordered === "boolean") { + result.ordered = messagingDataChannel.ordered; + } + if (typeof messagingDataChannel.compress === "boolean") { + result.compress = messagingDataChannel.compress; + } + if (typeof messagingDataChannel.maxPacketLifeTime === "number") { + result.max_packet_life_time = messagingDataChannel.maxPacketLifeTime; + } + if (typeof messagingDataChannel.maxRetransmits === "number") { + result.max_retransmits = messagingDataChannel.maxRetransmits; + } + if (typeof messagingDataChannel.protocol === "string") { + result.protocol = messagingDataChannel.protocol; + } + return result; +} +function parseMessagingDataChannels(messagingDataChannels) { + const result = []; + for (const messagingDataChannel of messagingDataChannels) { + result.push(parseMessagingDataChannel(messagingDataChannel)); + } + return result; +} function isSafari() { return browser() === "safari"; } @@ -1593,7 +1629,7 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options, re } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.0", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.1", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1767,6 +1803,9 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options, re } message.e2ee = true; } + if (Array.isArray(options.messagingDataChannels) && 0 < options.messagingDataChannels.length) { + message.data_channel_messaging = parseMessagingDataChannels(options.messagingDataChannels); + } return message; } function getSignalingNotifyAuthnMetadata(message) { @@ -1879,6 +1918,12 @@ function createTimelineEvent(eventType, data, logType, dataChannelId, dataChanne event.dataChannelLabel = dataChannelLabel; return event; } +function createMessagingEvent(label, data) { + const event = new Event("messaging"); + event.label = label; + event.data = data; + return event; +} class ConnectionBase { constructor(signalingUrlCandidates, role, channelId, metadata, options, debug) { @@ -1927,6 +1972,7 @@ class ConnectionBase { timeout: () => { }, timeline: () => { }, signaling: () => { }, + messaging: () => { }, }; this.authMetadata = null; this.e2ee = null; @@ -2782,7 +2828,7 @@ class ConnectionBase { const candidate = event.candidate.toJSON(); const message = Object.assign(candidate, { type: "candidate" }); this.trace("ONICECANDIDATE CANDIDATE MESSAGE", message); - this.sendMessage(message); + this.sendSignalingMessage(message); } }; } @@ -3002,13 +3048,13 @@ class ConnectionBase { sendUpdateAnswer() { if (this.pc && this.ws && this.pc.localDescription) { this.trace("ANSWER SDP", this.pc.localDescription.sdp); - this.sendMessage({ type: "update", sdp: this.pc.localDescription.sdp }); + this.sendSignalingMessage({ type: "update", sdp: this.pc.localDescription.sdp }); } } sendReAnswer() { if (this.pc && this.pc.localDescription) { this.trace("RE ANSWER SDP", this.pc.localDescription.sdp); - this.sendMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp }); + this.sendSignalingMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp }); } } async signalingOnMessageTypeUpdate(message) { @@ -3224,8 +3270,23 @@ class ConnectionBase { } }; } + else if (/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(dataChannelEvent.channel.label)) { + dataChannelEvent.channel.onmessage = (event) => { + if (event.target === null) { + return; + } + const dataChannel = event.target; + let data = event.data; + if (this.dataChannelsCompress[dataChannel.label] === true) { + const unzlibMessage = unzlibSync(new Uint8Array(event.data)); + data = new TextDecoder().decode(unzlibMessage); + } + const message = JSON.parse(data); + this.callbacks.messaging(createMessagingEvent(dataChannel.label, message)); + }; + } } - sendMessage(message) { + sendSignalingMessage(message) { if (this.dataChannels.signaling) { if (this.dataChannelsCompress.signaling === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); @@ -3306,6 +3367,24 @@ class ConnectionBase { }; return new soraCloseEvent(type, title, initDict); } + sendMessage(label, message) { + const dataChannel = this.dataChannels[label]; + // 接続していない場合は何もしない + if (this.pc === null) { + return; + } + if (dataChannel === undefined) { + throw new Error("Could not find DataChannel"); + } + if (this.dataChannelsCompress[label] === true) { + const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); + const zlibMessage = zlibSync(binaryMessage, {}); + dataChannel.send(zlibMessage); + } + else { + dataChannel.send(JSON.stringify(message)); + } + } get e2eeSelfFingerprint() { if (this.options.e2ee && this.e2ee) { return this.e2ee.selfFingerprint(); @@ -3653,7 +3732,7 @@ var sora = { return new SoraConnection(signalingUrlCandidates, debug); }, version: function () { - return "2021.2.0-canary.0"; + return "2021.2.0-canary.1"; }, helpers: { applyMediaStreamConstraints, diff --git a/dist/types.d.ts b/dist/types.d.ts index 1f1435df..7bed8b16 100644 --- a/dist/types.d.ts +++ b/dist/types.d.ts @@ -28,6 +28,15 @@ export declare type SignalingVideo = boolean | { bit_rate?: number; }; export declare type Role = "sendrecv" | "sendonly" | "recvonly"; +export declare type SignalingConnectMessagingDataChannel = { + label?: string; + direction?: MessagingDataChannelDirection; + compress?: boolean; + max_packet_life_time?: number; + max_retransmits?: number; + protocol?: string; + ordered?: boolean; +}; export declare type SignalingConnectMessage = { type: "connect"; role: Role; @@ -51,6 +60,7 @@ export declare type SignalingConnectMessage = { data_channel_signaling?: boolean; ignore_disconnect_websocket?: boolean; redirect?: true; + data_channel_messaging?: SignalingConnectMessagingDataChannel[]; }; export declare type SignalingMessage = SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage | SignalingPingMessage | SignalingPushMessage | SignalingNotifyMessage | SignalingReqStatsMessage | SignalingSwitchedMessage | SignalingRedirectMessage; export declare type SignalingOfferMessage = { @@ -193,6 +203,16 @@ export declare type SignalingNotifyNetworkStatus = { event_type: "network.status"; unstable_level: 0 | 1 | 2 | 3; }; +export declare type MessagingDataChannelDirection = "sendonly" | "sendrecv" | "recvonly"; +export declare type MessagingDataChannel = { + label: string; + direction: MessagingDataChannelDirection; + compress?: boolean; + maxPacketLifeTime?: number; + maxRetransmits?: number; + protocol?: string; + ordered?: boolean; +}; export declare type ConnectionOptions = { audio?: boolean; audioCodecType?: AudioCodecType; @@ -225,6 +245,7 @@ export declare type ConnectionOptions = { ignoreDisconnectWebSocket?: boolean; disconnectWaitTimeout?: number; signalingCandidateTimeout?: number; + messagingDataChannels?: MessagingDataChannel[]; }; export declare type Callbacks = { disconnect: (event: SoraCloseEvent) => void; @@ -238,6 +259,7 @@ export declare type Callbacks = { timeout: () => void; timeline: (event: TimelineEvent) => void; signaling: (event: SignalingEvent) => void; + messaging: (event: MessagingEvent) => void; }; export declare type PreKeyBundle = { identityKey: string; @@ -251,6 +273,10 @@ export interface SignalingEvent extends Event { transportType: TransportType; data?: any; } +export interface MessagingEvent extends Event { + label: string; + data: JSONType; +} export interface TimelineEvent extends Event { logType: TimelineEventLogType; data?: any; diff --git a/dist/utils.d.ts b/dist/utils.d.ts index cea8f516..b0edc647 100644 --- a/dist/utils.d.ts +++ b/dist/utils.d.ts @@ -1,4 +1,4 @@ -import { ConnectionOptions, JSONType, PreKeyBundle, SignalingConnectMessage, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, TimelineEvent, TimelineEventLogType, TransportType } from "./types"; +import { ConnectionOptions, JSONType, MessagingEvent, PreKeyBundle, SignalingConnectMessage, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, TimelineEvent, TimelineEventLogType, TransportType } from "./types"; export declare function isSafari(): boolean; export declare function isChrome(): boolean; export declare function createSignalingMessage(offerSDP: string, role: string, channelId: string | null | undefined, metadata: JSONType | undefined, options: ConnectionOptions, redirect: boolean): SignalingConnectMessage; @@ -13,3 +13,4 @@ export declare class ConnectError extends Error { export declare function createSignalingEvent(eventType: string, data: unknown, transportType: TransportType): SignalingEvent; export declare function createDataChannelData(channel: RTCDataChannel): Record; export declare function createTimelineEvent(eventType: string, data: unknown, logType: TimelineEventLogType, dataChannelId?: number | null, dataChannelLabel?: string): TimelineEvent; +export declare function createMessagingEvent(label: string, data: JSONType): MessagingEvent; diff --git a/lerna.json b/lerna.json index 6f2a6db8..de2d0ec0 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": [ "packages/*" ], - "version": "2021.2.0-canary.0" + "version": "2021.2.0-canary.1" } diff --git a/package.json b/package.json index 515b5f4a..62cdb7cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.0", + "version": "2021.2.0-canary.1", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", diff --git a/packages/e2ee/package.json b/packages/e2ee/package.json index cc09a524..f7157e60 100644 --- a/packages/e2ee/package.json +++ b/packages/e2ee/package.json @@ -1,6 +1,6 @@ { "name": "@sora/e2ee", - "version": "2021.2.0-canary.0", + "version": "2021.2.0-canary.1", "description": "WebRTC SFU Sora JavaScript E2EE Library", "author": "Shiguredo Inc.", "license": "Apache-2.0", @@ -28,6 +28,6 @@ "typescript": "^4.4.2" }, "dependencies": { - "@sora/go-wasm": "^2021.2.0-canary.0" + "@sora/go-wasm": "^2021.2.0-canary.1" } } diff --git a/packages/go-wasm/package.json b/packages/go-wasm/package.json index 5462098e..9edca2fd 100644 --- a/packages/go-wasm/package.json +++ b/packages/go-wasm/package.json @@ -1,6 +1,6 @@ { "name": "@sora/go-wasm", - "version": "2021.2.0-canary.0", + "version": "2021.2.0-canary.1", "main": "src/wasm_exec.js", "module": "src/wasm_exec.js", "types": "src/wasm_exec.d.ts", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 644eade1..15e489a3 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@sora/sdk", - "version": "2021.2.0-canary.0", + "version": "2021.2.0-canary.1", "author": "Shiguredo Inc.", "license": "Apache-2.0", "main": "dist/sora.min.js", @@ -35,7 +35,7 @@ "typescript": "^4.4.2" }, "dependencies": { - "@sora/e2ee": "^2021.2.0-canary.0", + "@sora/e2ee": "^2021.2.0-canary.1", "fflate": "^0.7.1" } } From 4bc4b391fc65459a932c915684f00d442a96ad37 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 27 Sep 2021 14:44:52 +0900 Subject: [PATCH 26/87] =?UTF-8?q?messaging=20=E3=81=AB=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=20DataChannel=20=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=82=92=E8=BF=94=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 93 ++++++++++++++++++++++++++++++++------- packages/sdk/src/sora.ts | 2 + packages/sdk/src/types.ts | 11 +++-- 3 files changed, 86 insertions(+), 20 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 13f63176..a1ca650e 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -17,10 +17,12 @@ import { Callbacks, ConnectionOptions, JSONType, + MessagingDataChannel, SignalingConnectMessage, SignalingMessage, SignalingNotifyMessage, SignalingOfferMessage, + SignalingOfferMessageDataChannel, SignalingPingMessage, SignalingPushMessage, SignalingReOfferMessage, @@ -67,9 +69,6 @@ export default class ConnectionBase { protected dataChannels: { [key in string]?: RTCDataChannel; }; - private dataChannelsCompress: { - [key in string]?: boolean; - }; private connectionTimeout: number; private signalingCandidateTimeout: number; private disconnectWaitTimeout: number; @@ -78,6 +77,9 @@ export default class ConnectionBase { video: string; }; private signalingSwitched: boolean; + private signalingOfferMessageDataChannels: { + [key in string]?: SignalingOfferMessageDataChannel; + }; constructor( signalingUrlCandidates: string | string[], role: string, @@ -144,7 +146,7 @@ export default class ConnectionBase { video: "", }; this.signalingSwitched = false; - this.dataChannelsCompress = {}; + this.signalingOfferMessageDataChannels = {}; } on(kind: T, callback: U): void { @@ -368,7 +370,10 @@ export default class ConnectionBase { // 終了処理を開始する if (this.dataChannels.signaling) { const message = { type: "disconnect", reason: title }; - if (this.dataChannelsCompress.signaling === true) { + if ( + this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true + ) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); if (this.dataChannels.signaling.readyState === "open") { @@ -435,6 +440,7 @@ export default class ConnectionBase { video: "", }; this.signalingSwitched = false; + this.signalingOfferMessageDataChannels = {}; this.clearConnectionTimeout(); } @@ -553,7 +559,10 @@ export default class ConnectionBase { clearTimeout(disconnectWaitTimeoutId); }); const message = { type: "disconnect", reason: "NO-ERROR" }; - if (this.dataChannelsCompress.signaling === true) { + if ( + this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true + ) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); if (this.dataChannels.signaling.readyState === "open") { @@ -1236,8 +1245,8 @@ export default class ConnectionBase { this.mids.video = message.mid.video; } if (message.data_channels) { - for (const o of message.data_channels) { - this.dataChannelsCompress[o.label] = o.compress; + for (const dc of message.data_channels) { + this.signalingOfferMessageDataChannels[dc.label] = dc; } } this.trace("SIGNALING OFFER MESSAGE", message); @@ -1423,7 +1432,10 @@ export default class ConnectionBase { dataChannelEvent.channel.onmessage = async (event): Promise => { const channel = event.currentTarget as RTCDataChannel; let data = event.data as string; - if (this.dataChannelsCompress.signaling === true) { + if ( + this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true + ) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -1437,7 +1449,10 @@ export default class ConnectionBase { dataChannelEvent.channel.onmessage = (event): void => { const channel = event.currentTarget as RTCDataChannel; let data = event.data as string; - if (this.dataChannelsCompress.notify === true) { + if ( + this.signalingOfferMessageDataChannels.notify && + this.signalingOfferMessageDataChannels.notify.compress === true + ) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -1452,7 +1467,10 @@ export default class ConnectionBase { } else if (dataChannelEvent.channel.label === "push") { dataChannelEvent.channel.onmessage = (event): void => { let data = event.data as string; - if (this.dataChannelsCompress.push === true) { + if ( + this.signalingOfferMessageDataChannels.push && + this.signalingOfferMessageDataChannels.push.compress === true + ) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -1469,7 +1487,10 @@ export default class ConnectionBase { } else if (dataChannelEvent.channel.label === "stats") { dataChannelEvent.channel.onmessage = async (event): Promise => { let data = event.data as string; - if (this.dataChannelsCompress.stats === true) { + if ( + this.signalingOfferMessageDataChannels.stats && + this.signalingOfferMessageDataChannels.stats.compress === true + ) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -1486,7 +1507,8 @@ export default class ConnectionBase { } const dataChannel = event.target as RTCDataChannel; let data = event.data as string; - if (this.dataChannelsCompress[dataChannel.label] === true) { + const settings = this.signalingOfferMessageDataChannels[dataChannel.label]; + if (settings !== undefined && settings.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -1498,7 +1520,10 @@ export default class ConnectionBase { private sendSignalingMessage(message: { type: string; [key: string]: unknown }): void { if (this.dataChannels.signaling) { - if (this.dataChannelsCompress.signaling === true) { + if ( + this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true + ) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); this.dataChannels.signaling.send(zlibMessage); @@ -1528,7 +1553,10 @@ export default class ConnectionBase { type: "stats", reports: reports, }; - if (this.dataChannelsCompress.stats === true) { + if ( + this.signalingOfferMessageDataChannels.stats && + this.signalingOfferMessageDataChannels.stats.compress === true + ) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); this.dataChannels.stats.send(zlibMessage); @@ -1593,7 +1621,8 @@ export default class ConnectionBase { if (dataChannel === undefined) { throw new Error("Could not find DataChannel"); } - if (this.dataChannelsCompress[label] === true) { + const settings = this.signalingOfferMessageDataChannels[label]; + if (settings !== undefined && settings.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); dataChannel.send(zlibMessage); @@ -1634,4 +1663,36 @@ export default class ConnectionBase { } return this.ws.url; } + + get messagingDataChannels(): MessagingDataChannel[] { + const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { + return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); + }); + const result: MessagingDataChannel[] = []; + for (const label of messagingDataChannellabels) { + const dataChannel = this.dataChannels[label]; + if (!dataChannel) { + continue; + } + const settings = this.signalingOfferMessageDataChannels[label]; + if (!settings) { + continue; + } + const messagingDataChannel: MessagingDataChannel = { + label: dataChannel.label, + ordered: dataChannel.ordered, + protocol: dataChannel.protocol, + compress: settings.compress, + direction: settings.direction, + }; + if (typeof dataChannel.maxPacketLifeTime === "number") { + messagingDataChannel.maxPacketLifeTime = dataChannel.maxPacketLifeTime; + } + if (typeof dataChannel.maxRetransmits === "number") { + messagingDataChannel.maxRetransmits = dataChannel.maxRetransmits; + } + result.push(messagingDataChannel); + } + return result; + } } diff --git a/packages/sdk/src/sora.ts b/packages/sdk/src/sora.ts index 6edb1ff8..9a9993c4 100644 --- a/packages/sdk/src/sora.ts +++ b/packages/sdk/src/sora.ts @@ -9,6 +9,7 @@ import type { Callbacks, ConnectionOptions, JSONType, + MessagingDataChannel, Role, SignalingEvent, SignalingNotifyConnectionCreated, @@ -94,6 +95,7 @@ export type { ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, + MessagingDataChannel, Role, SignalingEvent, SignalingNotifyConnectionCreated, diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 4e4056bd..49697fde 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -84,6 +84,12 @@ export type SignalingMessage = | SignalingSwitchedMessage | SignalingRedirectMessage; +export type SignalingOfferMessageDataChannel = { + label: string; + direction: MessagingDataChannelDirection; + compress: boolean; +}; + export type SignalingOfferMessage = { type: "offer"; sdp: string; @@ -94,10 +100,7 @@ export type SignalingOfferMessage = { encodings?: RTCRtpEncodingParameters[]; ignore_disconnect_websocket?: boolean; data_channel_signaling?: boolean; - data_channels?: Array<{ - label: string; - compress: boolean; - }>; + data_channels?: SignalingOfferMessageDataChannel[]; mid?: { audio?: string; video?: string; From b004c56de48aa146ecec58b11846ca72109b93b4 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 27 Sep 2021 14:51:10 +0900 Subject: [PATCH 27/87] 2021.2.0-canary.2 --- dist/base.d.ts | 5 ++- dist/sora.d.ts | 4 +- dist/sora.js | 78 +++++++++++++++++++++++++++-------- dist/sora.min.js | 4 +- dist/sora.min.js.map | 2 +- dist/sora.mjs | 78 +++++++++++++++++++++++++++-------- dist/types.d.ts | 10 +++-- lerna.json | 2 +- package.json | 2 +- packages/e2ee/package.json | 4 +- packages/go-wasm/package.json | 2 +- packages/sdk/package.json | 4 +- 12 files changed, 141 insertions(+), 54 deletions(-) diff --git a/dist/base.d.ts b/dist/base.d.ts index 1f8428e5..57c5d22a 100644 --- a/dist/base.d.ts +++ b/dist/base.d.ts @@ -1,4 +1,4 @@ -import { Callbacks, ConnectionOptions, JSONType, SignalingOfferMessage, SignalingReOfferMessage, SignalingUpdateMessage } from "./types"; +import { Callbacks, ConnectionOptions, JSONType, MessagingDataChannel, SignalingOfferMessage, SignalingReOfferMessage, SignalingUpdateMessage } from "./types"; import SoraE2EE from "@sora/e2ee"; declare global { interface Algorithm { @@ -29,12 +29,12 @@ export default class ConnectionBase { protected dataChannels: { [key in string]?: RTCDataChannel; }; - private dataChannelsCompress; private connectionTimeout; private signalingCandidateTimeout; private disconnectWaitTimeout; private mids; private signalingSwitched; + private signalingOfferMessageDataChannels; constructor(signalingUrlCandidates: string | string[], role: string, channelId: string, metadata: JSONType, options: ConnectionOptions, debug: boolean); on(kind: T, callback: U): void; stopAudioTrack(stream: MediaStream): Promise; @@ -110,4 +110,5 @@ export default class ConnectionBase { get video(): boolean; get signalingUrl(): string | string[]; get connectedSignalingUrl(): string; + get messagingDataChannels(): MessagingDataChannel[]; } diff --git a/dist/sora.d.ts b/dist/sora.d.ts index 29ec16dd..9ecb936f 100644 --- a/dist/sora.d.ts +++ b/dist/sora.d.ts @@ -2,7 +2,7 @@ import ConnectionBase from "./base"; import ConnectionPublisher from "./publisher"; import ConnectionSubscriber from "./subscriber"; import { applyMediaStreamConstraints } from "./helpers"; -import type { AudioCodecType, Callbacks, ConnectionOptions, JSONType, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; +import type { AudioCodecType, Callbacks, ConnectionOptions, JSONType, MessagingDataChannel, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; declare class SoraConnection { signalingUrlCandidates: string | string[]; debug: boolean; @@ -21,4 +21,4 @@ declare const _default: { }; }; export default _default; -export type { AudioCodecType, Callbacks, ConnectionBase, ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SoraConnection, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType, }; +export type { AudioCodecType, Callbacks, ConnectionBase, ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, MessagingDataChannel, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SoraConnection, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType, }; diff --git a/dist/sora.js b/dist/sora.js index bd997a36..9fc0077f 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * @sora/sdk * undefined - * @version: 2021.2.0-canary.1 + * @version: 2021.2.0-canary.2 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -604,7 +604,7 @@ /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.2.0-canary.1 + * @version: 2021.2.0-canary.2 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -772,7 +772,7 @@ } } static version() { - return "2021.2.0-canary.1"; + return "2021.2.0-canary.2"; } static wasmVersion() { return window.e2ee.version(); @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.1", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.2", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1991,7 +1991,7 @@ video: "", }; this.signalingSwitched = false; - this.dataChannelsCompress = {}; + this.signalingOfferMessageDataChannels = {}; } on(kind, callback) { // @deprecated message @@ -2205,7 +2205,8 @@ // 終了処理を開始する if (this.dataChannels.signaling) { const message = { type: "disconnect", reason: title }; - if (this.dataChannelsCompress.signaling === true) { + if (this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); if (this.dataChannels.signaling.readyState === "open") { @@ -2274,6 +2275,7 @@ video: "", }; this.signalingSwitched = false; + this.signalingOfferMessageDataChannels = {}; this.clearConnectionTimeout(); } disconnectWebSocket(title) { @@ -2391,7 +2393,8 @@ clearTimeout(disconnectWaitTimeoutId); }); const message = { type: "disconnect", reason: "NO-ERROR" }; - if (this.dataChannelsCompress.signaling === true) { + if (this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); if (this.dataChannels.signaling.readyState === "open") { @@ -3044,8 +3047,8 @@ this.mids.video = message.mid.video; } if (message.data_channels) { - for (const o of message.data_channels) { - this.dataChannelsCompress[o.label] = o.compress; + for (const dc of message.data_channels) { + this.signalingOfferMessageDataChannels[dc.label] = dc; } } this.trace("SIGNALING OFFER MESSAGE", message); @@ -3214,7 +3217,8 @@ dataChannelEvent.channel.onmessage = async (event) => { const channel = event.currentTarget; let data = event.data; - if (this.dataChannelsCompress.signaling === true) { + if (this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3229,7 +3233,8 @@ dataChannelEvent.channel.onmessage = (event) => { const channel = event.currentTarget; let data = event.data; - if (this.dataChannelsCompress.notify === true) { + if (this.signalingOfferMessageDataChannels.notify && + this.signalingOfferMessageDataChannels.notify.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3246,7 +3251,8 @@ else if (dataChannelEvent.channel.label === "push") { dataChannelEvent.channel.onmessage = (event) => { let data = event.data; - if (this.dataChannelsCompress.push === true) { + if (this.signalingOfferMessageDataChannels.push && + this.signalingOfferMessageDataChannels.push.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3265,7 +3271,8 @@ else if (dataChannelEvent.channel.label === "stats") { dataChannelEvent.channel.onmessage = async (event) => { let data = event.data; - if (this.dataChannelsCompress.stats === true) { + if (this.signalingOfferMessageDataChannels.stats && + this.signalingOfferMessageDataChannels.stats.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3283,7 +3290,8 @@ } const dataChannel = event.target; let data = event.data; - if (this.dataChannelsCompress[dataChannel.label] === true) { + const settings = this.signalingOfferMessageDataChannels[dataChannel.label]; + if (settings !== undefined && settings.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3294,7 +3302,8 @@ } sendSignalingMessage(message) { if (this.dataChannels.signaling) { - if (this.dataChannelsCompress.signaling === true) { + if (this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); this.dataChannels.signaling.send(zlibMessage); @@ -3325,7 +3334,8 @@ type: "stats", reports: reports, }; - if (this.dataChannelsCompress.stats === true) { + if (this.signalingOfferMessageDataChannels.stats && + this.signalingOfferMessageDataChannels.stats.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); this.dataChannels.stats.send(zlibMessage); @@ -3382,7 +3392,8 @@ if (dataChannel === undefined) { throw new Error("Could not find DataChannel"); } - if (this.dataChannelsCompress[label] === true) { + const settings = this.signalingOfferMessageDataChannels[label]; + if (settings !== undefined && settings.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); dataChannel.send(zlibMessage); @@ -3418,6 +3429,37 @@ } return this.ws.url; } + get messagingDataChannels() { + const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { + return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); + }); + const result = []; + for (const label of messagingDataChannellabels) { + const dataChannel = this.dataChannels[label]; + if (!dataChannel) { + continue; + } + const settings = this.signalingOfferMessageDataChannels[label]; + if (!settings) { + continue; + } + const messagingDataChannel = { + label: dataChannel.label, + ordered: dataChannel.ordered, + protocol: dataChannel.protocol, + compress: settings.compress, + direction: settings.direction, + }; + if (typeof dataChannel.maxPacketLifeTime === "number") { + messagingDataChannel.maxPacketLifeTime = dataChannel.maxPacketLifeTime; + } + if (typeof dataChannel.maxRetransmits === "number") { + messagingDataChannel.maxRetransmits = dataChannel.maxRetransmits; + } + result.push(messagingDataChannel); + } + return result; + } } class ConnectionPublisher extends ConnectionBase { @@ -3738,7 +3780,7 @@ return new SoraConnection(signalingUrlCandidates, debug); }, version: function () { - return "2021.2.0-canary.1"; + return "2021.2.0-canary.2"; }, helpers: { applyMediaStreamConstraints, diff --git a/dist/sora.min.js b/dist/sora.min.js index cddbfcc0..db558d24 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,8 +1,8 @@ /** * @sora/sdk * undefined - * @version: 2021.2.0-canary.1 + * @version: 2021.2.0-canary.2 * @author: Shiguredo Inc. * @license: Apache-2.0 - **/(function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"==typeof globalThis?e||self:globalThis,e.Sora=n())})(this,function(){'use strict';var n=Math.min,a=Math.ceil,t=Math.max;function g(){(()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,a){n+=i.decode(a);const t=n.lastIndexOf("\n");return-1!=t&&(console.log(n.substr(0,t)),n=n.substr(t+1)),a.length},write(i,a,t,g,o,l){if(0!==t||g!==a.length||null!==o)return void l(e());const d=this.writeSync(i,a);l(null,d)},chmod(n,i,a){a(e())},chown(n,i,a,t){t(e())},close(n,i){i(e())},fchmod(n,i,a){a(e())},fchown(n,i,a,t){t(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,a){a(e())},lchown(n,i,a,t){t(e())},link(n,i,a){a(e())},lstat(n,i){i(e())},mkdir(n,i,a){a(e())},open(n,i,a,t){t(e())},read(n,i,a,t,g,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,a){a(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,a){a(e())},truncate(n,i,a){a(e())},unlink(n,i){i(e())},utimes(n,i,a,t){t(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},t=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},g=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let a=0;switch(typeof n){case"object":null!==n&&(a=1);break;case"string":a=2;break;case"symbol":a=3;break;case"function":a=4;}this.mem.setUint32(e+4,2146959360|a,!0),this.mem.setUint32(e,i,!0)},l=e=>{const n=t(e+0),i=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},d=e=>{const n=t(e+0),o=t(e+8),l=Array(o);for(let a=0;a{const n=t(e+0),a=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},s=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=t(e+8),a=t(e+16),g=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,g))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(s+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},t(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,c(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(g(e+8),c(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(g(e+8),c(e+16),g(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(g(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(g(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(g(e+8),t(e+16),g(e+24))},"syscall/js.valueCall":e=>{try{const n=g(e+8),i=Reflect.get(n,c(e+16)),a=d(e+32),t=Reflect.apply(i,n,a);e=this._inst.exports.getsp(),o(e+56,t),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=g(e+8),i=d(e+16),a=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=g(e+8),i=d(e+16),a=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(g(n+8).length))},"syscall/js.valuePrepareString":i=>{const a=n.encode(g(i+8)+"");o(i+16,a),e(i+24,a.length)},"syscall/js.valueLoadString":e=>{const n=g(e+8);l(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,g(e+8)instanceof g(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=l(n+8),a=g(n+32);if(!(a instanceof Uint8Array||a instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=g(n+8),a=l(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const a=e=>{const a=i,t=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,0!=i%8&&(i+=8-i%8),a},t=this.argv.length,g=[];this.argv.forEach(e=>{g.push(a(e))}),g.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{g.push(a(`${e}=${this.env[e]}`))}),g.push(0);const l=i;g.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(t,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=Ce();i.p(e);var a=Ie(e,n,2,4);return me(a,n),re(a,a.length-4,i.d()),a}function l(e,n){return $((Ae(e),e.subarray(2,-4)),n)}function d(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function c(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function s(e){if("object"!=typeof e||null===e)throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'");const n=e,i={};return"string"==typeof n.label&&(i.label=n.label),"string"==typeof n.direction&&(i.direction=n.direction),"boolean"==typeof n.ordered&&(i.ordered=n.ordered),"boolean"==typeof n.compress&&(i.compress=n.compress),"number"==typeof n.maxPacketLifeTime&&(i.max_packet_life_time=n.maxPacketLifeTime),"number"==typeof n.maxRetransmits&&(i.max_retransmits=n.maxRetransmits),"string"==typeof n.protocol&&(i.protocol=n.protocol),i}function C(e){const n=[];for(const i of e)n.push(s(i));return n}function I(){return"safari"===d()}function r(e,n,i,a,t,g){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.1",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==a&&(o.metadata=a),g&&(o.redirect=!0),"signalingNotifyMetadata"in t&&(o.signaling_notify_metadata=t.signalingNotifyMetadata),"multistream"in t&&!0===t.multistream&&(o.multistream=!0,"spotlight"in t&&(o.spotlight=t.spotlight,"spotlightNumber"in t&&(o.spotlight_number=t.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==t.spotlightFocusRid&&0<=e.indexOf(t.spotlightFocusRid)&&(o.spotlight_focus_rid=t.spotlightFocusRid),void 0!==t.spotlightUnfocusRid&&0<=e.indexOf(t.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=t.spotlightUnfocusRid)}if("simulcast"in t||"simulcastRid"in t){"simulcast"in t&&!0===t.simulcast&&(o.simulcast=!0);void 0!==t.simulcastRid&&0<=["r0","r1","r2"].indexOf(t.simulcastRid)&&(o.simulcast_rid=t.simulcastRid)}"clientId"in t&&void 0!==t.clientId&&(o.client_id=t.clientId),"dataChannelSignaling"in t&&"boolean"==typeof t.dataChannelSignaling&&(o.data_channel_signaling=t.dataChannelSignaling),"ignoreDisconnectWebSocket"in t&&"boolean"==typeof t.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=t.ignoreDisconnectWebSocket);const l=["audioCodecType","audioBitRate"],d=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],s=["videoCodecType","videoBitRate"],I=Object.assign({},t);Object.keys(I).forEach(e=>{"audio"===e&&"boolean"==typeof I[e]||"video"===e&&"boolean"==typeof I[e]||0<=l.indexOf(e)&&null!==I[e]||0<=d.indexOf(e)&&null!==I[e]||0<=s.indexOf(e)&&null!==I[e]||delete I[e]}),void 0!==I.audio&&(o.audio=I.audio);const r=Object.keys(I).some(e=>0<=l.indexOf(e));o.audio&&r&&(o.audio={},"audioCodecType"in I&&(o.audio.codec_type=I.audioCodecType),"audioBitRate"in I&&(o.audio.bit_rate=I.audioBitRate));const m=Object.keys(I).some(e=>0<=d.indexOf(e));o.audio&&m&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in I&&(o.audio.opus_params.channels=I.audioOpusParamsChannels),"audioOpusParamsClockRate"in I&&(o.audio.opus_params.clock_rate=I.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in I&&(o.audio.opus_params.maxplaybackrate=I.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in I&&(o.audio.opus_params.stereo=I.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in I&&(o.audio.opus_params.sprop_stereo=I.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in I&&(o.audio.opus_params.minptime=I.audioOpusParamsMinptime),"audioOpusParamsPtime"in I&&(o.audio.opus_params.ptime=I.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in I&&(o.audio.opus_params.useinbandfec=I.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in I&&(o.audio.opus_params.usedtx=I.audioOpusParamsUsedtx)),void 0!==I.video&&(o.video=I.video);const A=Object.keys(I).some(e=>0<=s.indexOf(e));if(o.video&&A&&(o.video={},"videoCodecType"in I&&(o.video.codec_type=I.videoCodecType),"videoBitRate"in I&&(o.video.bit_rate=I.videoBitRate)),o.simulcast&&!c()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===t.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(t.messagingDataChannels)&&0{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),a(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let t="";window.performance&&(t="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(t=t+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(t+" "+n),a(i),console.groupEnd()):console.log(t+" "+n+"\n",i)}function b(e,n,i){const a=new Event(e);try{a.data=JSON.parse(JSON.stringify(n))}catch(e){a.data=n}return a.transportType=i,a}function p(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function V(e,n,i,a,t){const g=new Event(e);try{g.data=JSON.parse(JSON.stringify(n))}catch(e){g.data=n}return g.logType=i,g.dataChannelId=a,g.dataChannelLabel=t,g}function S(e,n){const i=new Event("messaging");return i.label=e,i.data=n,i}class W{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1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AgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5UZXh0LmJ5dGVMZW5ndGgpOwogICAgICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgICAgICBuZXdVaW50OC5zZXQobmV3IFVpbnQ4QXJyYXkoZnJhbWVNZXRhZGF0YUJ1ZmZlciwgMCwgdW5lbmNyeXB0ZWRCeXRlc1tlbmNvZGVkRnJhbWUudHlwZV0pKTsKICAgICAgICAgICAgbmV3VWludDguc2V0KG5ldyBVaW50OEFycmF5KHBsYWluVGV4dCksI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AuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:a},[i,a])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:a},[i,a])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,a=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:a})}startSession(e,n){const[i,a]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(a)throw a;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(g(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.2.0-canary.1"}static wasmVersion(){return window.e2ee.version()}}var G=Uint8Array,h=Uint16Array,y=Uint32Array,k=new G([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),w=new G([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),R=new G([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),X=function(e,n){for(var a=new h(31),t=0;31>t;++t)a[t]=n+=1<t;++t)for(var o=a[t];oO;++O)T=(43690&O)>>>1|(21845&O)<<1,T=(52428&T)>>>2|(13107&T)<<2,T=(61680&T)>>>4|(3855&T)<<4,E[O]=((65280&T)>>>8|(255&T)<<8)>>>1;for(var K=function(e,n,a){for(var t=e.length,g=0,o=new h(n);g>>15-n]=c}else for(d=new h(t),g=0;g>>15-e[g]);return d},L=new G(288),O=0;144>O;++O)L[O]=8;for(var O=144;256>O;++O)L[O]=9;for(var O=256;280>O;++O)L[O]=7;for(var O=280;288>O;++O)L[O]=8;for(var F=new G(32),O=0;32>O;++O)F[O]=5;var J=K(L,9,0),U=K(L,9,1),D=K(F,5,0),Q=K(F,5,1),j=function(e){for(var n=e[0],a=1;an&&(n=e[a]);return n},H=function(e,n,i){var a=0|n/8;return(e[a]|e[a+1]<<8)>>(7&n)&i},M=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},P=function(e){return 0|(e+7)/8},z=function(i,a,t){(null==a||0>a)&&(a=0),(null==t||t>i.length)&&(t=i.length);var g=new(i instanceof h?h:i instanceof y?y:G)(t-a);return g.set(i.subarray(a,t)),g},_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],q=function(n,i,a){var t=new Error(i||_[n]);if(t.code=n,Error.captureStackTrace&&Error.captureStackTrace(t,q),!a)throw t;return t},$=function(a,g,o){var C=a.length;if(!C||o&&o.f&&!o.l)return g||new G(0);var I=!g||o,m=!o||o.i;o||(o={}),g||(g=new G(3*C));var A=function(e){var n=g.length;if(e>n){var i=new G(t(2*n,e));i.set(g),g=i}},u=o.f||0,Z=o.p||0,p=o.b||0,V=o.l,S=o.d,W=o.m,h=o.n,y=8*C;do{if(!V){u=H(a,Z,1);var X=H(a,Z+1,3);if(Z+=3,!X){var f=P(Z)+4,B=a[f-4]|a[f-3]<<8,l=f+B;if(l>C){m&&q(0);break}I&&A(p+B),g.set(a.subarray(f,l),p),o.b=p+=B,o.p=Z=8*l,o.f=u;continue}else if(1==X)V=U,S=Q,W=9,h=5;else if(2==X){var T=H(a,Z,31)+257,Y=H(a,Z+10,15)+4,v=T+H(a,Z+5,31)+1;Z+=14;for(var E=new G(v),O=new G(19),L=0;L>>4;if(16>f)E[L++]=f;else{var x=0,_=0;for(16==f?(_=3+H(a,Z,3),Z+=2,x=E[L-1]):17==f?(_=3+H(a,Z,7),Z+=3):18==f&&(_=11+H(a,Z,127),Z+=7);_--;)E[L++]=x}}var $=E.subarray(0,T),ee=E.subarray(T);W=j($),h=j(ee),V=K($,W,1),S=K(ee,h,1)}else q(1);if(Z>y){m&&q(0);break}}I&&A(p+131072);for(var ne=(1<>>4;if(Z+=15&x,Z>y){m&&q(0);break}if(x||q(2),256>te)g[p++]=te;else if(256==te){ae=Z,V=null;break}else{var ge=te-254;if(264>>4;le||q(3),Z+=15≤var ee=N[d];if(3y){m&&q(0);break}I&&A(p+131072);for(var de=p+ge;p>>8},ne=function(e,n,i){i<<=7&n;var a=0|n/8;e[a]|=i,e[a+1]|=i>>>8,e[a+2]|=i>>>16},ie=function(e,n){for(var a=[],t=0;tA&&(A=o[t].s);var u=new h(A+1),Z=ae(a[I-1],u,0);if(Z>n){var t=0,b=0,p=Z-n;for(o.sort(function(e,n){return u[n.s]-u[e.s]||e.f-n.f});tn)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var _,f=0;f>>5),C+=x[f]>>>12)}}else U=J,Q=L,j=D,H=F;for(var f=0;f>>18;ne(n,C,U[_+257]),C+=Q[_+257],7<_&&(ee(n,C,31&t[f]>>>23),C+=k[_]);var q=31&t[f];ne(n,C,j[q]),C+=H[q],3>>5),C+=w[q])}else ne(n,C,U[t[f]]),C+=Q[t[f]];return ne(n,C,U[256]),C+Q[256]},de=new y([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ce=new G(0),se=function(t,g,c,C,I,r){var m=t.length,s=new G(C+m+5*(1+a(m/7e3))+I),o=s.subarray(C,s.length-I),A=0;if(!g||8>m)for(var u,Z=0;Z<=m;Z+=65535)u=Z+65535,uD;++D)f[D]=0;for(var D=0;30>D;++D)T[D]=0}var Q=2,H=0,M=8191&b,x=32767&F-J;if(2>>13,U)-1,q=n(32767,Z),$=n(258,U);x<=q&&--M&&F!=J;){if(t[Z+Q]==t[Z+Q-x]){for(var ee=0;ee<$&&t[Z+ee]==t[Z+ee-x];++ee);if(ee>Q){if(Q=ee,H=x,ee>_)break;for(var ne=n(x,ee-2),ie=0,D=0;Die&&(ie=ge,J=ae)}}}F=J,J=V[F],x+=32767&F-J+32768}if(H){X[E++]=268435456|B[Q]<<18|v[H];var se=31&B[Q],Ce=31&v[H];N+=k[se]+w[Ce],++f[257+se],++T[Ce],O=Z+Q,++Y}else X[E++]=t[Z],++f[t[Z]]}}A=le(t,o,r,X,f,T,N,E,K,Z-K,A),!r&&7&A&&(A=oe(o,A+1,ce))}return z(s,0,C+P(A)+I)},Ce=function(){var t=1,g=0;return{p:function(a){for(var o,d=t,c=g,s=0|a.length,l=0;l!=s;){for(o=n(l+2655,s);l>16),c=(65535&c)+15*(c>>16)}t=d,g=c},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},Ie=function(e,i,g,o,l){return se(e,null==i.level?6:i.level,null==i.mem?a(1.5*t(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!l)},re=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},me=function(e,n){var i=n.level,a=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},Ae=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&q(6,"invalid zlib data"),32&e[1]&&q(6,"invalid zlib data: preset dictionaries not supported")},ue="undefined"!=typeof TextDecoder&&new TextDecoder,Ze=0;try{ue.decode(ce,{stream:!0}),Ze=1}catch(n){}class be extends Error{}class pe{constructor(e,n,i,a,t,g){this.role=n,this.channelId=i,this.metadata=a,this.signalingUrlCandidates=e,this.options=t,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},messaging:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.dataChannelsCompress={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const a={type:"disconnect",reason:e};this.ws.send(JSON.stringify(a)),this.writeWebSocketSignalingLog("send-disconnect",a),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const a=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),t=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(a),e(),n({code:4999,reason:""}));t.push((()=>new Promise(e=>{let n=0;const a=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(a),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(a))},100)}))())}}Promise.all(t).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(a)});const g={type:"disconnect",reason:"NO-ERROR"};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new W,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){return new Promise((n,i)=>{const a=new WebSocket(e);a.onclose=e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),i(n)},a.onopen=()=>{n(a)}})}if(Array.isArray(e)){let n=!1;const i=e=>new Promise((i,a)=>{const t=new WebSocket(e),g=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:t.url}),t&&!n&&(t.onclose=null,t.onerror=null,t.onopen=null,t.close(),a())},this.signalingCandidateTimeout);t.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:t.url,message:`WebSocket closed`,code:e.code,reason:e.reason}),t&&t.close(),clearInterval(g),a()},t.onerror=()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:t.url,message:`Failed to connect WebSocket`}),t&&(t.onclose=null,t.close()),clearInterval(g),a()},t.onopen=()=>{t&&(clearInterval(g),n?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!1}),t.onerror=null,t.onclose=null,t.onopen=null,t.close(),a()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!0}),t.onerror=null,t.onclose=null,t.onopen=null,n=!0,i(t)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(n){throw new be("Signaling failed. All signaling URL candidates failed to connect")}}throw new be("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,n=!1){const i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((a,t)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const n=JSON.parse(e.data);if("offer"==n.type)this.writeWebSocketSignalingLog("onmessage-offer",n),this.signalingOnMessageTypeOffer(n),a(n);else if("update"==n.type)this.writeWebSocketSignalingLog("onmessage-update",n),await this.signalingOnMessageTypeUpdate(n);else if("re-offer"==n.type)this.writeWebSocketSignalingLog("onmessage-re-offer",n),await this.signalingOnMessageTypeReOffer(n);else if("ping"==n.type)await this.signalingOnMessageTypePing(n);else if("push"==n.type)this.callbacks.push(n,"websocket");else if("notify"==n.type)"connection.created"===n.event_type?this.writeWebSocketTimelineLog("notify-connection.created",n):"connection.destroyed"===n.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",n),this.signalingOnMessageTypeNotify(n,"websocket");else if("switched"==n.type)this.writeWebSocketSignalingLog("onmessage-switched",n),this.signalingOnMessageTypeSwitched(n);else if("redirect"==n.type){this.writeWebSocketSignalingLog("onmessage-redirect",n);const e=await this.signalingOnMessageTypeRedirect(n);a(e)}},(async()=>{let a;try{a=r(i.sdp||"",this.role,this.channelId,this.metadata,this.options,n)}catch(e){return void t(e)}if(a.e2ee&&this.e2ee){const e=await this.e2ee.init();a.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",a),e&&(e.send(JSON.stringify(a)),this.writeWebSocketSignalingLog(`send-${a.type}`,a),this.ws=e)})()})}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendSignalingMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new be(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&Z(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(b(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(b(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=V(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const a=V(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(a)}writePeerConnectionTimelineLog(e,n){const i=V(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=V(e,n,"sora");this.callbacks.timeline(i)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(I()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.dataChannelsCompress[n.label]=n.compress;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=m(e),a=u(i);if(a&&this.e2ee&&n){const e=this.e2ee.startSession(n,a);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=A(e);i.forEach(e=>{const n=m(e),i=u(n),a=e.connection_id;a&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(a,i)})}else if("connection.destroyed"===e.event_type){const n=m(e),i=u(n),a=e.connection_id;if(i&&this.e2ee&&a){const e=this.e2ee.stopSession(a);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(a)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const n=await this.getSignalingWebSocket(e.location),i=await this.signaling(n,!0);return i}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,p(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.signaling){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${a.type}`,n,a),"re-offer"===a.type&&(await this.signalingOnMessageTypeReOffer(a))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.notify){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(!0===this.dataChannelsCompress.push){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let n=e.data;if(!0===this.dataChannelsCompress.stats){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const n=e.target;let i=e.data;if(!0===this.dataChannelsCompress[n.label]){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.callbacks.messaging(S(n.label,a))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(!0===this.dataChannelsCompress.signaling){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(!0===this.dataChannelsCompress.stats){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const a=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new a(e,n,i)}sendMessage(e,n){const i=this.dataChannels[e];if(null!==this.pc){if(void 0===i)throw new Error("Could not find DataChannel");if(!0===this.dataChannelsCompress[e]){const e=new TextEncoder().encode(JSON.stringify(n)),a=o(e,{});i.send(a)}else i.send(JSON.stringify(n))}}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}}class Ve extends pe{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class Se extends pe{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,a){n+=i.decode(a);const g=n.lastIndexOf("\n");return-1!=g&&(console.log(n.substr(0,g)),n=n.substr(g+1)),a.length},write(i,a,g,t,o,l){if(0!==g||t!==a.length||null!==o)return void l(e());const s=this.writeSync(i,a);l(null,s)},chmod(n,i,a){a(e())},chown(n,i,a,g){g(e())},close(n,i){i(e())},fchmod(n,i,a){a(e())},fchown(n,i,a,g){g(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,a){a(e())},lchown(n,i,a,g){g(e())},link(n,i,a){a(e())},lstat(n,i){i(e())},mkdir(n,i,a){a(e())},open(n,i,a,g){g(e())},read(n,i,a,g,t,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,a){a(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,a){a(e())},truncate(n,i,a){a(e())},unlink(n,i){i(e())},utimes(n,i,a,g){g(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},g=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},t=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let a=0;switch(typeof n){case"object":null!==n&&(a=1);break;case"string":a=2;break;case"symbol":a=3;break;case"function":a=4;}this.mem.setUint32(e+4,2146959360|a,!0),this.mem.setUint32(e,i,!0)},l=e=>{const n=g(e+0),i=g(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},s=e=>{const n=g(e+0),o=g(e+8),l=Array(o);for(let a=0;a{const n=g(e+0),a=g(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=g(e+8),a=g(e+16),t=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,t))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(c+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},g(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,d(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(t(e+8),d(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(t(e+8),d(e+16),t(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(t(e+8),d(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(t(e+8),g(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(t(e+8),g(e+16),t(e+24))},"syscall/js.valueCall":e=>{try{const n=t(e+8),i=Reflect.get(n,d(e+16)),a=s(e+32),g=Reflect.apply(i,n,a);e=this._inst.exports.getsp(),o(e+56,g),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=t(e+8),i=s(e+16),a=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=t(e+8),i=s(e+16),a=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(t(n+8).length))},"syscall/js.valuePrepareString":i=>{const a=n.encode(t(i+8)+"");o(i+16,a),e(i+24,a.length)},"syscall/js.valueLoadString":e=>{const n=t(e+8);l(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,t(e+8)instanceof t(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=l(n+8),a=t(n+32);if(!(a instanceof Uint8Array||a instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const g=a.subarray(0,i.length);i.set(g),e(n+40,g.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=t(n+8),a=l(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const g=a.subarray(0,i.length);i.set(g),e(n+40,g.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const a=e=>{const a=i,g=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,g.length).set(g),i+=g.length,0!=i%8&&(i+=8-i%8),a},g=this.argv.length,t=[];this.argv.forEach(e=>{t.push(a(e))}),t.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{t.push(a(`${e}=${this.env[e]}`))}),t.push(0);const l=i;t.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(g,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=Ce();i.p(e);var a=re(e,n,2,4);return me(a,n),Ie(a,a.length-4,i.d()),a}function l(e,n){return $((Ae(e),e.subarray(2,-4)),n)}function s(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function d(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function c(e){if("object"!=typeof e||null===e)throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'");const n=e,i={};return"string"==typeof n.label&&(i.label=n.label),"string"==typeof n.direction&&(i.direction=n.direction),"boolean"==typeof n.ordered&&(i.ordered=n.ordered),"boolean"==typeof n.compress&&(i.compress=n.compress),"number"==typeof n.maxPacketLifeTime&&(i.max_packet_life_time=n.maxPacketLifeTime),"number"==typeof n.maxRetransmits&&(i.max_retransmits=n.maxRetransmits),"string"==typeof n.protocol&&(i.protocol=n.protocol),i}function C(e){const n=[];for(const i of e)n.push(c(i));return n}function r(){return"safari"===s()}function I(e,n,i,a,g,t){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.2",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==a&&(o.metadata=a),t&&(o.redirect=!0),"signalingNotifyMetadata"in g&&(o.signaling_notify_metadata=g.signalingNotifyMetadata),"multistream"in g&&!0===g.multistream&&(o.multistream=!0,"spotlight"in g&&(o.spotlight=g.spotlight,"spotlightNumber"in g&&(o.spotlight_number=g.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==g.spotlightFocusRid&&0<=e.indexOf(g.spotlightFocusRid)&&(o.spotlight_focus_rid=g.spotlightFocusRid),void 0!==g.spotlightUnfocusRid&&0<=e.indexOf(g.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=g.spotlightUnfocusRid)}if("simulcast"in g||"simulcastRid"in g){"simulcast"in g&&!0===g.simulcast&&(o.simulcast=!0);void 0!==g.simulcastRid&&0<=["r0","r1","r2"].indexOf(g.simulcastRid)&&(o.simulcast_rid=g.simulcastRid)}"clientId"in g&&void 0!==g.clientId&&(o.client_id=g.clientId),"dataChannelSignaling"in g&&"boolean"==typeof g.dataChannelSignaling&&(o.data_channel_signaling=g.dataChannelSignaling),"ignoreDisconnectWebSocket"in g&&"boolean"==typeof g.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=g.ignoreDisconnectWebSocket);const l=["audioCodecType","audioBitRate"],s=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},g);Object.keys(r).forEach(e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=s.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]}),void 0!==r.audio&&(o.audio=r.audio);const I=Object.keys(r).some(e=>0<=l.indexOf(e));o.audio&&I&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const m=Object.keys(r).some(e=>0<=s.indexOf(e));o.audio&&m&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const A=Object.keys(r).some(e=>0<=c.indexOf(e));if(o.video&&A&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!d()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===g.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(g.messagingDataChannels)&&0{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),a(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let g="";window.performance&&(g="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(g=g+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(g+" "+n),a(i),console.groupEnd()):console.log(g+" "+n+"\n",i)}function b(e,n,i){const a=new Event(e);try{a.data=JSON.parse(JSON.stringify(n))}catch(e){a.data=n}return a.transportType=i,a}function p(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function V(e,n,i,a,g){const t=new Event(e);try{t.data=JSON.parse(JSON.stringify(n))}catch(e){t.data=n}return t.logType=i,t.dataChannelId=a,t.dataChannelLabel=g,t}function S(e,n){const i=new Event("messaging");return i.label=e,i.data=n,i}class W{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJl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AgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5UZXh0LmJ5dGVMZW5ndGgpOwogICAgICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgICAgICBuZXdVaW50OC5zZXQobmV3IFVpbnQ4QXJyYXkoZnJhbWVNZXRhZGF0YUJ1ZmZlciwgMCwgdW5lbmNyeXB0ZWRCeXRlc1tlbmNvZGVkRnJhbWUudHlwZV0pKTsKICAgICAgICAgICAgbmV3VWludDguc2V0KG5ldyBVaW50OEFycmF5KHB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AgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:a},[i,a])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:a},[i,a])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,a=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:a})}startSession(e,n){const[i,a]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(a)throw a;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(t(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.2.0-canary.2"}static wasmVersion(){return window.e2ee.version()}}var G=Uint8Array,h=Uint16Array,y=Uint32Array,k=new G([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),w=new G([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),R=new G([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(e,n){for(var a=new h(31),g=0;31>g;++g)a[g]=n+=1<g;++g)for(var o=a[g];oK;++K)T=(43690&K)>>>1|(21845&K)<<1,T=(52428&T)>>>2|(13107&T)<<2,T=(61680&T)>>>4|(3855&T)<<4,E[K]=((65280&T)>>>8|(255&T)<<8)>>>1;for(var v=function(e,n,a){for(var g=e.length,t=0,o=new h(n);t>>15-n]=d}else for(s=new h(g),t=0;t>>15-e[t]);return s},L=new G(288),K=0;144>K;++K)L[K]=8;for(var K=144;256>K;++K)L[K]=9;for(var K=256;280>K;++K)L[K]=7;for(var K=280;288>K;++K)L[K]=8;for(var F=new G(32),K=0;32>K;++K)F[K]=5;var J=v(L,9,0),U=v(L,9,1),D=v(F,5,0),Q=v(F,5,1),j=function(e){for(var n=e[0],a=1;an&&(n=e[a]);return n},M=function(e,n,i){var a=0|n/8;return(e[a]|e[a+1]<<8)>>(7&n)&i},H=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},P=function(e){return 0|(e+7)/8},z=function(i,a,g){(null==a||0>a)&&(a=0),(null==g||g>i.length)&&(g=i.length);var t=new(i instanceof h?h:i instanceof y?y:G)(g-a);return t.set(i.subarray(a,g)),t},_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],q=function(n,i,a){var g=new Error(i||_[n]);if(g.code=n,Error.captureStackTrace&&Error.captureStackTrace(g,q),!a)throw g;return g},$=function(a,o,C){var I=a.length;if(!I||C&&C.f&&!C.l)return o||new G(0);var m=!o||C,A=!C||C.i;C||(C={}),o||(o=new G(3*I));var u=function(e){var n=o.length;if(e>n){var i=new G(g(2*n,e));i.set(o),o=i}},Z=C.f||0,p=C.p||0,V=C.b||0,S=C.l,W=C.d,h=C.m,y=C.n,f=8*I;do{if(!S){Z=M(a,p,1);var X=M(a,p+1,3);if(p+=3,!X){var B=P(p)+4,T=a[B-4]|a[B-3]<<8,l=B+T;if(l>I){A&&q(0);break}m&&u(V+T),o.set(a.subarray(B,l),V),C.b=V+=T,C.p=p=8*l,C.f=Z;continue}else if(1==X)S=U,W=Q,h=9,y=5;else if(2==X){var t=M(a,p,31)+257,Y=M(a,p+10,15)+4,O=t+M(a,p+5,31)+1;p+=14;for(var E=new G(O),K=new G(19),L=0;L>>4;if(16>B)E[L++]=B;else{var x=0,_=0;for(16==B?(_=3+M(a,p,3),p+=2,x=E[L-1]):17==B?(_=3+M(a,p,7),p+=3):18==B&&(_=11+M(a,p,127),p+=7);_--;)E[L++]=x}}var $=E.subarray(0,t),ee=E.subarray(t);h=j($),y=j(ee),S=v($,h,1),W=v(ee,y,1)}else q(1);if(p>f){A&&q(0);break}}m&&u(V+131072);for(var ne=(1<>>4;if(p+=15&x,p>f){A&&q(0);break}if(x||q(2),256>ge)o[V++]=ge;else if(256==ge){ae=p,S=null;break}else{var te=ge-254;if(264>>4;le||q(3),p+=15≤var ee=N[d];if(3f){A&&q(0);break}m&&u(V+131072);for(var se=V+te;V>>8},ne=function(e,n,i){i<<=7&n;var a=0|n/8;e[a]|=i,e[a+1]|=i>>>8,e[a+2]|=i>>>16},ie=function(e,n){for(var a=[],g=0;gA&&(A=o[g].s);var u=new h(A+1),Z=ae(a[I-1],u,0);if(Z>n){var g=0,b=0,p=Z-n;for(o.sort(function(e,n){return u[n.s]-u[e.s]||e.f-n.f});gn)b+=(1<>>=p;0>>8,e[t+2]=255^e[t],e[t+3]=255^e[t+1];for(var o=0;oz;++z){x=P[z];for(var _,X=0;X>>5),C+=x[X]>>>12)}}else U=J,Q=L,j=D,M=F;for(var X=0;X>>18;ne(n,C,U[_+257]),C+=Q[_+257],7<_&&(ee(n,C,31&g[X]>>>23),C+=k[_]);var q=31&g[X];ne(n,C,j[q]),C+=M[q],3>>5),C+=w[q])}else ne(n,C,U[g[X]]),C+=Q[g[X]];return ne(n,C,U[256]),C+Q[256]},se=new y([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),de=new G(0),ce=function(g,t,c,C,r,I){var m=g.length,s=new G(C+m+5*(1+a(m/7e3))+r),o=s.subarray(C,s.length-r),A=0;if(!t||8>m)for(var u,Z=0;Z<=m;Z+=65535)u=Z+65535,uD;++D)X[D]=0;for(var D=0;30>D;++D)T[D]=0}var Q=2,M=0,H=8191&b,x=32767&F-J;if(2>>13,U)-1,q=n(32767,Z),$=n(258,U);x<=q&&--H&&F!=J;){if(g[Z+Q]==g[Z+Q-x]){for(var ee=0;ee<$&&g[Z+ee]==g[Z+ee-x];++ee);if(ee>Q){if(Q=ee,M=x,ee>_)break;for(var ne=n(x,ee-2),ie=0,D=0;Die&&(ie=te,J=ae)}}}F=J,J=V[F],x+=32767&F-J+32768}if(M){f[v++]=268435456|B[Q]<<18|O[M];var ce=31&B[Q],Ce=31&O[M];N+=k[ce]+w[Ce],++X[257+ce],++T[Ce],E=Z+Q,++Y}else f[v++]=g[Z],++X[g[Z]]}}A=le(g,o,I,f,X,T,N,v,K,Z-K,A),!I&&7&A&&(A=oe(o,A+1,de))}return z(s,0,C+P(A)+r)},Ce=function(){var g=1,t=0;return{p:function(a){for(var o,s=g,d=t,c=0|a.length,l=0;l!=c;){for(o=n(l+2655,c);l>16),d=(65535&d)+15*(d>>16)}g=s,t=d},d:function(){return g%=65521,t%=65521,(255&g)<<24|g>>>8<<16|(255&t)<<8|t>>>8}}},re=function(e,i,t,o,l){return ce(e,null==i.level?6:i.level,null==i.mem?a(1.5*g(8,n(13,Math.log(e.length)))):12+i.mem,t,o,!l)},Ie=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},me=function(e,n){var i=n.level,a=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},Ae=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&q(6,"invalid zlib data"),32&e[1]&&q(6,"invalid zlib data: preset dictionaries not supported")},ue="undefined"!=typeof TextDecoder&&new TextDecoder,Ze=0;try{ue.decode(de,{stream:!0}),Ze=1}catch(n){}class be extends Error{}class pe{constructor(e,n,i,a,g,t){this.role=n,this.channelId=i,this.metadata=a,this.signalingUrlCandidates=e,this.options=g,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=t,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},messaging:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const a={type:"disconnect",reason:e};this.ws.send(JSON.stringify(a)),this.writeWebSocketSignalingLog("send-disconnect",a),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const a=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),g=[];for(const t of Object.keys(this.dataChannels)){const i=this.dataChannels[t];if(i){i.onerror=()=>(clearTimeout(a),e(),n({code:4999,reason:""}));g.push((()=>new Promise(e=>{let n=0;const a=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(a),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(a))},100)}))())}}Promise.all(g).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(a)});const t={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=new TextEncoder().encode(JSON.stringify(t)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new W,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){return new Promise((n,i)=>{const a=new WebSocket(e);a.onclose=e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),i(n)},a.onopen=()=>{n(a)}})}if(Array.isArray(e)){let n=!1;const i=e=>new Promise((i,a)=>{const g=new WebSocket(e),t=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:g.url}),g&&!n&&(g.onclose=null,g.onerror=null,g.onopen=null,g.close(),a())},this.signalingCandidateTimeout);g.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:g.url,message:`WebSocket closed`,code:e.code,reason:e.reason}),g&&g.close(),clearInterval(t),a()},g.onerror=()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:g.url,message:`Failed to connect WebSocket`}),g&&(g.onclose=null,g.close()),clearInterval(t),a()},g.onopen=()=>{g&&(clearInterval(t),n?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:g.url,selected:!1}),g.onerror=null,g.onclose=null,g.onopen=null,g.close(),a()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:g.url,selected:!0}),g.onerror=null,g.onclose=null,g.onopen=null,n=!0,i(g)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(n){throw new be("Signaling failed. All signaling URL candidates failed to connect")}}throw new be("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,n=!1){const i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((a,g)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),g(n)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const n=JSON.parse(e.data);if("offer"==n.type)this.writeWebSocketSignalingLog("onmessage-offer",n),this.signalingOnMessageTypeOffer(n),a(n);else if("update"==n.type)this.writeWebSocketSignalingLog("onmessage-update",n),await this.signalingOnMessageTypeUpdate(n);else if("re-offer"==n.type)this.writeWebSocketSignalingLog("onmessage-re-offer",n),await this.signalingOnMessageTypeReOffer(n);else if("ping"==n.type)await this.signalingOnMessageTypePing(n);else if("push"==n.type)this.callbacks.push(n,"websocket");else if("notify"==n.type)"connection.created"===n.event_type?this.writeWebSocketTimelineLog("notify-connection.created",n):"connection.destroyed"===n.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",n),this.signalingOnMessageTypeNotify(n,"websocket");else if("switched"==n.type)this.writeWebSocketSignalingLog("onmessage-switched",n),this.signalingOnMessageTypeSwitched(n);else if("redirect"==n.type){this.writeWebSocketSignalingLog("onmessage-redirect",n);const e=await this.signalingOnMessageTypeRedirect(n);a(e)}},(async()=>{let a;try{a=I(i.sdp||"",this.role,this.channelId,this.metadata,this.options,n)}catch(e){return void g(e)}if(a.e2ee&&this.e2ee){const e=await this.e2ee.init();a.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",a),e&&(e.send(JSON.stringify(a)),this.writeWebSocketSignalingLog(`send-${a.type}`,a),this.ws=e)})()})}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendSignalingMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new be(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&Z(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(b(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(b(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=V(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const a=V(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(a)}writePeerConnectionTimelineLog(e,n){const i=V(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=V(e,n,"sora");this.callbacks.timeline(i)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(r()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.signalingOfferMessageDataChannels[n.label]=n;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=m(e),a=u(i);if(a&&this.e2ee&&n){const e=this.e2ee.startSession(n,a);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=A(e);i.forEach(e=>{const n=m(e),i=u(n),a=e.connection_id;a&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(a,i)})}else if("connection.destroyed"===e.event_type){const n=m(e),i=u(n),a=e.connection_id;if(i&&this.e2ee&&a){const e=this.e2ee.stopSession(a);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(a)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const n=await this.getSignalingWebSocket(e.location),i=await this.signaling(n,!0);return i}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,p(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${a.type}`,n,a),"re-offer"===a.type&&(await this.signalingOnMessageTypeReOffer(a))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let n=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const n=e.target;let i=e.data;const a=this.signalingOfferMessageDataChannels[n.label];if(a!==void 0&&!0===a.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const g=JSON.parse(i);this.callbacks.messaging(S(n.label,g))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const a=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new a(e,n,i)}sendMessage(e,n){const i=this.dataChannels[e];if(null!==this.pc){if(void 0===i)throw new Error("Could not find DataChannel");const a=this.signalingOfferMessageDataChannels[e];if(void 0!==a&&!0===a.compress){const e=new TextEncoder().encode(JSON.stringify(n)),a=o(e,{});i.send(a)}else i.send(JSON.stringify(n))}}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter(e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e)),n=[];for(const i of e){const e=this.dataChannels[i];if(!e)continue;const a=this.signalingOfferMessageDataChannels[i];if(!a)continue;const g={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:a.compress,direction:a.direction};"number"==typeof e.maxPacketLifeTime&&(g.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(g.maxRetransmits=e.maxRetransmits),n.push(g)}return n}}class Ve extends pe{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class Se extends pe{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.2.0-canary.1\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY29uc3QgcGFkZGluZ0xlbmd0aCA9IFVpbnQzMkFycmF5LkJZVEVTX1BFUl9FTEVNRU5UIC0gZGF0YVZpZXcuYnl0ZUxlbmd0aDsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGFkZGluZ0xlbmd0aDsgaSArPSAxKSB7CiAgICAgICAg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rpb25JZCwga2V5SWQsIGRlcml2ZUtleSB9OwogICAgICAgIHNlbGZEZXJpdmVLZXlNYXAuc2V0KCJsYXRlc3QiLCBuZXh0U2VsZkRlcml2ZUtleSk7CiAgICB9Cn0KZnVuY3Rpb24gc2lsZW5jZUZyYW1lKGVuY29kZWRGcmFtZSkgewogICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkLCByZWNlaXZlTWVzc2FnZSDlj5fkv6HliY3jga7loLTlkIgKICAgIGlmIChlbmNvZGVkRnJhbWUudHlwZSA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgLy8g6Z+z5aOw44Gv5pqX5Y+35YyW44Gv44GE44KL44Go6IGe44GR44Gf44KC44Gu44GY44KD44Gq44GE44Gu44Gn572u44GN5o+b44GI44KLCiAgICAgICAgY29uc3QgbmV3RGF0YSA9IG5ldyBBcnJheUJ1ZmZlcigzKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIE9wdXMg44K144Kk44Os44Oz44K544OV44Os44O844OgCiAgICAgICAgbmV3VWludDguc2V0KFsweGQ4LCAweGZmLCAweGZlXSk7CiAgICAgICAgZW5jb2RlZEZyYW1lLmRhdGEgPSBuZXdEYXRhOwogICAgfQogICAgZWxzZSB7CiAgICAgICAgLy8g5pig5YOP44GM5q2j5bi444GY44KD44Gq44GE44Gf44KBIFBMSSDjgrnjg4jjg7zjg6DjgYznmbrnlJ/jgZfjgabjgZfjgb7jgYYKICAgICAgICAvLyDjgZ3jga7jgZ/jgoEgMzIweDI0MCDjga7nnJ/jgaPpu5LjgarnlLvpnaLjgavnva7jgY3mj5vjgYjjgosKICAgICAgICBjb25zdCBuZXdEYXRhID0gbmV3IEFycmF5QnVmZmVyKDYwKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIHByZXR0aWVyLWlnbm9yZQogICAgICAg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vbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkp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ICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.2.0-canary.1\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAAX,CACNA,MAAM,CAACD,MAAP,CAAgBC,MADV,KAEA,IAAoB,WAAhB,QAAOC,CAAAA,IAAX,CACNA,IAAI,CAACF,MAAL,CAAcE,IADR,KAGN,MAAM,IAAIC,CAAAA,KAAJ,CAAU,+DAAV,CAAN,CAOD,GAJKH,MAAM,CAACI,OAAR,EAAsC,WAAnB,QAAOA,CAAAA,OAI9B,GAHCJ,MAAM,CAACI,OAAP,CAAiBA,OAGlB,EAAI,CAACJ,MAAM,CAACK,EAAR,EAAcL,MAAM,CAACI,OAAzB,CAAkC,CACjC,KAAMC,CAAAA,CAAE,CAAGD,OAAO,CAAC,IAAD,CAAlB,CACwB,CAApB,GAAAE,MAAM,CAACC,IAAP,CAAYF,CAAZ,CAF6B,GAGhCL,MAAM,C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AD,CAAD,EAAQ,CAAR,CAAYA,CAAC,CAAC,CAAD,CAAd,EAAqB,EAD/C,GAEfhN,CAAG,CAAC,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file +{"version":3,"file":"sora.min.js","sources":["../packages/sdk/node_modules/fflate/esm/browser.js","../packages/go-wasm/src/wasm_exec.js","../packages/e2ee/dist/sora_e2ee.mjs"],"sourcesContent":["// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([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, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([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, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.2.0-canary.2\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJ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UtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5UZXh0LmJ5dGVMZW5ndGgpOwogICAgICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgICAgICBuZXdVaW50OC5zZXQobmV3IFVpbnQ4QXJyYXkoZnJhbWVNZXRhZGF0YUJ1ZmZlciwgMCwgdW5lbmNyeXB0ZWRCeXRlc1tlbmNvZGVkRnJhbWUudHlwZV0pKTsKICAgICAgICAgICAgbmV3VWludDguc2V0KG5ldyBVaW50OEFycmF5KHBsYWluVGV4dCksIHVuZW5jcnlwdGVkQnl0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XciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.2.0-canary.2\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,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,CAAalC,CAAb,CAAgB,CACtB,GAAIkI,CAAAA,CAAE,CAAGlI,CAAC,CAACiI,KAAX,CAAkBvJ,CAAE,CAAS,CAAN,EAAAwJ,CAAE,CAAQ,CAAR,CAAiB,CAAL,CAAAA,CAAE,CAAO,CAAP,CAAiB,CAAN,EAAAA,CAAE,CAAQ,CAAR,CAAY,CAAhE,CACAhG,CAAC,CAAC,CAAD,CAAD,CAAO,GAAP,CAAYA,CAAC,CAAC,CAAD,CAAD,CAAQxD,CAAE,EAAI,CAAP,EAAaA,CAAE,CAAI,GAAK,EAAIA,CAAb,CAAmB,CAAlC,CACtB,EAEG5E,EAAG,CAAG,SAAUP,CAAV,CAAa,EACA,CAAf,GAAQ,EAAP,CAAAA,CAAC,CAAC,CAAD,CAAF,GAAmC,CAAf,CAACA,CAAC,CAAC,CAAD,CAAD,GAAS,CAA9B,EAAyC,CAACA,CAAC,CAAC,CAAD,CAAD,EAAQ,CAAR,CAAYA,CAAC,CAAC,CAAD,CAAd,EAAqB,EAD/C,GAEfhN,CAAG,CAAC,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file diff --git a/dist/sora.mjs b/dist/sora.mjs index 8d1142e1..0d193ff2 100644 --- a/dist/sora.mjs +++ b/dist/sora.mjs @@ -1,7 +1,7 @@ /** * @sora/sdk * undefined - * @version: 2021.2.0-canary.1 + * @version: 2021.2.0-canary.2 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -598,7 +598,7 @@ function WasmExec () { /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.2.0-canary.1 + * @version: 2021.2.0-canary.2 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -766,7 +766,7 @@ class SoraE2EE { } } static version() { - return "2021.2.0-canary.1"; + return "2021.2.0-canary.2"; } static wasmVersion() { return window.e2ee.version(); @@ -1629,7 +1629,7 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options, re } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.1", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.2", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1985,7 +1985,7 @@ class ConnectionBase { video: "", }; this.signalingSwitched = false; - this.dataChannelsCompress = {}; + this.signalingOfferMessageDataChannels = {}; } on(kind, callback) { // @deprecated message @@ -2199,7 +2199,8 @@ class ConnectionBase { // 終了処理を開始する if (this.dataChannels.signaling) { const message = { type: "disconnect", reason: title }; - if (this.dataChannelsCompress.signaling === true) { + if (this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); if (this.dataChannels.signaling.readyState === "open") { @@ -2268,6 +2269,7 @@ class ConnectionBase { video: "", }; this.signalingSwitched = false; + this.signalingOfferMessageDataChannels = {}; this.clearConnectionTimeout(); } disconnectWebSocket(title) { @@ -2385,7 +2387,8 @@ class ConnectionBase { clearTimeout(disconnectWaitTimeoutId); }); const message = { type: "disconnect", reason: "NO-ERROR" }; - if (this.dataChannelsCompress.signaling === true) { + if (this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); if (this.dataChannels.signaling.readyState === "open") { @@ -3038,8 +3041,8 @@ class ConnectionBase { this.mids.video = message.mid.video; } if (message.data_channels) { - for (const o of message.data_channels) { - this.dataChannelsCompress[o.label] = o.compress; + for (const dc of message.data_channels) { + this.signalingOfferMessageDataChannels[dc.label] = dc; } } this.trace("SIGNALING OFFER MESSAGE", message); @@ -3208,7 +3211,8 @@ class ConnectionBase { dataChannelEvent.channel.onmessage = async (event) => { const channel = event.currentTarget; let data = event.data; - if (this.dataChannelsCompress.signaling === true) { + if (this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3223,7 +3227,8 @@ class ConnectionBase { dataChannelEvent.channel.onmessage = (event) => { const channel = event.currentTarget; let data = event.data; - if (this.dataChannelsCompress.notify === true) { + if (this.signalingOfferMessageDataChannels.notify && + this.signalingOfferMessageDataChannels.notify.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3240,7 +3245,8 @@ class ConnectionBase { else if (dataChannelEvent.channel.label === "push") { dataChannelEvent.channel.onmessage = (event) => { let data = event.data; - if (this.dataChannelsCompress.push === true) { + if (this.signalingOfferMessageDataChannels.push && + this.signalingOfferMessageDataChannels.push.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3259,7 +3265,8 @@ class ConnectionBase { else if (dataChannelEvent.channel.label === "stats") { dataChannelEvent.channel.onmessage = async (event) => { let data = event.data; - if (this.dataChannelsCompress.stats === true) { + if (this.signalingOfferMessageDataChannels.stats && + this.signalingOfferMessageDataChannels.stats.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3277,7 +3284,8 @@ class ConnectionBase { } const dataChannel = event.target; let data = event.data; - if (this.dataChannelsCompress[dataChannel.label] === true) { + const settings = this.signalingOfferMessageDataChannels[dataChannel.label]; + if (settings !== undefined && settings.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } @@ -3288,7 +3296,8 @@ class ConnectionBase { } sendSignalingMessage(message) { if (this.dataChannels.signaling) { - if (this.dataChannelsCompress.signaling === true) { + if (this.signalingOfferMessageDataChannels.signaling && + this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); this.dataChannels.signaling.send(zlibMessage); @@ -3319,7 +3328,8 @@ class ConnectionBase { type: "stats", reports: reports, }; - if (this.dataChannelsCompress.stats === true) { + if (this.signalingOfferMessageDataChannels.stats && + this.signalingOfferMessageDataChannels.stats.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); this.dataChannels.stats.send(zlibMessage); @@ -3376,7 +3386,8 @@ class ConnectionBase { if (dataChannel === undefined) { throw new Error("Could not find DataChannel"); } - if (this.dataChannelsCompress[label] === true) { + const settings = this.signalingOfferMessageDataChannels[label]; + if (settings !== undefined && settings.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); dataChannel.send(zlibMessage); @@ -3412,6 +3423,37 @@ class ConnectionBase { } return this.ws.url; } + get messagingDataChannels() { + const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { + return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); + }); + const result = []; + for (const label of messagingDataChannellabels) { + const dataChannel = this.dataChannels[label]; + if (!dataChannel) { + continue; + } + const settings = this.signalingOfferMessageDataChannels[label]; + if (!settings) { + continue; + } + const messagingDataChannel = { + label: dataChannel.label, + ordered: dataChannel.ordered, + protocol: dataChannel.protocol, + compress: settings.compress, + direction: settings.direction, + }; + if (typeof dataChannel.maxPacketLifeTime === "number") { + messagingDataChannel.maxPacketLifeTime = dataChannel.maxPacketLifeTime; + } + if (typeof dataChannel.maxRetransmits === "number") { + messagingDataChannel.maxRetransmits = dataChannel.maxRetransmits; + } + result.push(messagingDataChannel); + } + return result; + } } class ConnectionPublisher extends ConnectionBase { @@ -3732,7 +3774,7 @@ var sora = { return new SoraConnection(signalingUrlCandidates, debug); }, version: function () { - return "2021.2.0-canary.1"; + return "2021.2.0-canary.2"; }, helpers: { applyMediaStreamConstraints, diff --git a/dist/types.d.ts b/dist/types.d.ts index 7bed8b16..8c00fabd 100644 --- a/dist/types.d.ts +++ b/dist/types.d.ts @@ -63,6 +63,11 @@ export declare type SignalingConnectMessage = { data_channel_messaging?: SignalingConnectMessagingDataChannel[]; }; export declare type SignalingMessage = SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage | SignalingPingMessage | SignalingPushMessage | SignalingNotifyMessage | SignalingReqStatsMessage | SignalingSwitchedMessage | SignalingRedirectMessage; +export declare type SignalingOfferMessageDataChannel = { + label: string; + direction: MessagingDataChannelDirection; + compress: boolean; +}; export declare type SignalingOfferMessage = { type: "offer"; sdp: string; @@ -73,10 +78,7 @@ export declare type SignalingOfferMessage = { encodings?: RTCRtpEncodingParameters[]; ignore_disconnect_websocket?: boolean; data_channel_signaling?: boolean; - data_channels?: Array<{ - label: string; - compress: boolean; - }>; + data_channels?: SignalingOfferMessageDataChannel[]; mid?: { audio?: string; video?: string; diff --git a/lerna.json b/lerna.json index de2d0ec0..e3c9d63a 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": [ "packages/*" ], - "version": "2021.2.0-canary.1" + "version": "2021.2.0-canary.2" } diff --git a/package.json b/package.json index 62cdb7cd..7490c5c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.1", + "version": "2021.2.0-canary.2", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", diff --git a/packages/e2ee/package.json b/packages/e2ee/package.json index f7157e60..2374bf53 100644 --- a/packages/e2ee/package.json +++ b/packages/e2ee/package.json @@ -1,6 +1,6 @@ { "name": "@sora/e2ee", - "version": "2021.2.0-canary.1", + "version": "2021.2.0-canary.2", "description": "WebRTC SFU Sora JavaScript E2EE Library", "author": "Shiguredo Inc.", "license": "Apache-2.0", @@ -28,6 +28,6 @@ "typescript": "^4.4.2" }, "dependencies": { - "@sora/go-wasm": "^2021.2.0-canary.1" + "@sora/go-wasm": "^2021.2.0-canary.2" } } diff --git a/packages/go-wasm/package.json b/packages/go-wasm/package.json index 9edca2fd..746430cc 100644 --- a/packages/go-wasm/package.json +++ b/packages/go-wasm/package.json @@ -1,6 +1,6 @@ { "name": "@sora/go-wasm", - "version": "2021.2.0-canary.1", + "version": "2021.2.0-canary.2", "main": "src/wasm_exec.js", "module": "src/wasm_exec.js", "types": "src/wasm_exec.d.ts", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 15e489a3..0985abd4 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@sora/sdk", - "version": "2021.2.0-canary.1", + "version": "2021.2.0-canary.2", "author": "Shiguredo Inc.", "license": "Apache-2.0", "main": "dist/sora.min.js", @@ -35,7 +35,7 @@ "typescript": "^4.4.2" }, "dependencies": { - "@sora/e2ee": "^2021.2.0-canary.1", + "@sora/e2ee": "^2021.2.0-canary.2", "fflate": "^0.7.1" } } From 7c93dfaf9b5165005bfc609b8f5dec81fccafab2 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 6 Oct 2021 11:20:50 +0900 Subject: [PATCH 28/87] =?UTF-8?q?=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- packages/e2ee/package.json | 10 +- packages/e2ee/yarn.lock | 183 +++---- packages/sdk/package.json | 19 +- packages/sdk/yarn.lock | 1049 ++++++++++++++++++------------------ yarn.lock | 348 ++++++------ 6 files changed, 809 insertions(+), 802 deletions(-) diff --git a/package.json b/package.json index 7490c5c6..f577bf95 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "devDependencies": { "lerna": "^4.0.0", "npm-check-updates": "^11.8.5", - "serve": "^12.0.0" + "serve": "^12.0.1" }, "resolutions": { "get-pkg-repo": "4.1.2" diff --git a/packages/e2ee/package.json b/packages/e2ee/package.json index 2374bf53..1b8861f8 100644 --- a/packages/e2ee/package.json +++ b/packages/e2ee/package.json @@ -17,15 +17,15 @@ }, "devDependencies": { "@rollup/plugin-replace": "^3.0.0", - "@typescript-eslint/eslint-plugin": "^4.30.0", - "@typescript-eslint/parser": "^4.30.0", + "@typescript-eslint/eslint-plugin": "^4.33.0", + "@typescript-eslint/parser": "^4.33.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", - "prettier": "^2.3.2", - "rollup": "^2.56.3", + "prettier": "^2.4.1", + "rollup": "^2.58.0", "rollup-plugin-typescript2": "^0.30.0", - "typescript": "^4.4.2" + "typescript": "^4.4.3" }, "dependencies": { "@sora/go-wasm": "^2021.2.0-canary.2" diff --git a/packages/e2ee/yarn.lock b/packages/e2ee/yarn.lock index a8b435cd..7a96d5b4 100644 --- a/packages/e2ee/yarn.lock +++ b/packages/e2ee/yarn.lock @@ -10,9 +10,9 @@ "@babel/highlight" "^7.10.4" "@babel/helper-validator-identifier@^7.14.5": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" - integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" + integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== "@babel/highlight@^7.10.4": version "7.14.5" @@ -108,73 +108,74 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== -"@typescript-eslint/eslint-plugin@^4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz#4a0c1ae96b953f4e67435e20248d812bfa55e4fb" - integrity sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g== +"@typescript-eslint/eslint-plugin@^4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" + integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== dependencies: - "@typescript-eslint/experimental-utils" "4.30.0" - "@typescript-eslint/scope-manager" "4.30.0" + "@typescript-eslint/experimental-utils" "4.33.0" + "@typescript-eslint/scope-manager" "4.33.0" debug "^4.3.1" functional-red-black-tree "^1.0.1" + ignore "^5.1.8" regexpp "^3.1.0" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz#9e49704fef568432ae16fc0d6685c13d67db0fd5" - integrity sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw== +"@typescript-eslint/experimental-utils@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" + integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== dependencies: "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.30.0" - "@typescript-eslint/types" "4.30.0" - "@typescript-eslint/typescript-estree" "4.30.0" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@^4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.30.0.tgz#6abd720f66bd790f3e0e80c3be77180c8fcb192d" - integrity sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg== +"@typescript-eslint/parser@^4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" + integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== dependencies: - "@typescript-eslint/scope-manager" "4.30.0" - "@typescript-eslint/types" "4.30.0" - "@typescript-eslint/typescript-estree" "4.30.0" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz#1a3ffbb385b1a06be85cd5165a22324f069a85ee" - integrity sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A== +"@typescript-eslint/scope-manager@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" + integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== dependencies: - "@typescript-eslint/types" "4.30.0" - "@typescript-eslint/visitor-keys" "4.30.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/types@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.30.0.tgz#fb9d9b0358426f18687fba82eb0b0f869780204f" - integrity sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw== +"@typescript-eslint/types@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" + integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/typescript-estree@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz#ae57833da72a753f4846cd3053758c771670c2ac" - integrity sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg== +"@typescript-eslint/typescript-estree@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" + integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== dependencies: - "@typescript-eslint/types" "4.30.0" - "@typescript-eslint/visitor-keys" "4.30.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" debug "^4.3.1" globby "^11.0.3" is-glob "^4.0.1" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz#a47c6272fc71b0c627d1691f68eaecf4ad71445e" - integrity sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw== +"@typescript-eslint/visitor-keys@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" + integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== dependencies: - "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" acorn-jsx@^5.3.1: @@ -198,9 +199,9 @@ ajv@^6.10.0, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.6.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.2.tgz#2fb45e0e5fcbc0813326c1c3da535d1881bb0571" - integrity sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w== + version "8.6.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" + integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -212,10 +213,10 @@ ansi-colors@^4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^3.2.1: version "3.2.1" @@ -556,9 +557,9 @@ fast-levenshtein@^2.0.6: integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastq@^1.6.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.12.0.tgz#ed7b6ab5d62393fb2cc591c853652a5c318bf794" - integrity sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg== + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== dependencies: reusify "^1.0.4" @@ -643,9 +644,9 @@ glob-parent@^5.1.2: is-glob "^4.0.1" glob@^7.1.3: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -700,7 +701,7 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.4: +ignore@^5.1.4, ignore@^5.1.8: version "5.1.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== @@ -732,9 +733,9 @@ inherits@2: integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-core-module@^2.2.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" - integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== + version "2.7.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" + integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== dependencies: has "^1.0.3" @@ -749,9 +750,9 @@ is-fullwidth-code-point@^3.0.0: integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" @@ -975,10 +976,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" - integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== +prettier@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" + integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== progress@^2.0.0: version "2.0.3" @@ -1041,10 +1042,10 @@ rollup-plugin-typescript2@^0.30.0: resolve "1.20.0" tslib "2.1.0" -rollup@^2.56.3: - version "2.56.3" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.56.3.tgz#b63edadd9851b0d618a6d0e6af8201955a77aeff" - integrity sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg== +rollup@^2.58.0: + version "2.58.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.58.0.tgz#a643983365e7bf7f5b7c62a8331b983b7c4c67fb" + integrity sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw== optionalDependencies: fsevents "~2.3.2" @@ -1103,21 +1104,21 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -string-width@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== +string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: - ansi-regex "^5.0.0" + ansi-regex "^5.0.1" strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" @@ -1139,16 +1140,16 @@ supports-color@^7.1.0: has-flag "^4.0.0" table@^6.0.9: - version "6.7.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" - integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== + version "6.7.2" + resolved "https://registry.yarnpkg.com/table/-/table-6.7.2.tgz#a8d39b9f5966693ca8b0feba270a78722cbaf3b0" + integrity sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g== dependencies: ajv "^8.0.1" lodash.clonedeep "^4.5.0" lodash.truncate "^4.4.2" slice-ansi "^4.0.0" - string-width "^4.2.0" - strip-ansi "^6.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" text-table@^0.2.0: version "0.2.0" @@ -1191,10 +1192,10 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -typescript@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86" - integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ== +typescript@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" + integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== universalify@^0.1.0: version "0.1.2" diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 0985abd4..9d71e212 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,5 +1,6 @@ { "name": "@sora/sdk", + "description": "WebRTC SFU Sora JavaScript SDK", "version": "2021.2.0-canary.2", "author": "Shiguredo Inc.", "license": "Apache-2.0", @@ -17,22 +18,22 @@ "test": "jest --detectOpenHandles --forceExit" }, "devDependencies": { - "@rollup/plugin-commonjs": "^20.0.0", - "@rollup/plugin-node-resolve": "^13.0.4", + "@rollup/plugin-commonjs": "^21.0.0", + "@rollup/plugin-node-resolve": "^13.0.5", "@rollup/plugin-replace": "^3.0.0", - "@types/jest": "^27.0.1", - "@typescript-eslint/eslint-plugin": "4.30.0", - "@typescript-eslint/parser": "4.30.0", + "@types/jest": "^27.0.2", + "@typescript-eslint/eslint-plugin": "4.33.0", + "@typescript-eslint/parser": "4.33.0", "eslint": "7.32.0", "eslint-config-prettier": "8.3.0", "eslint-plugin-prettier": "4.0.0", - "jest": "^27.1.0", - "prettier": "^2.3.2", - "rollup": "^2.56.3", + "jest": "^27.2.4", + "prettier": "^2.4.1", + "rollup": "^2.58.0", "rollup-plugin-babel-minify": "^10.0.0", "rollup-plugin-typescript2": "^0.30.0", "ts-jest": "^27.0.5", - "typescript": "^4.4.2" + "typescript": "^4.4.3" }, "dependencies": { "@sora/e2ee": "^2021.2.0-canary.2", diff --git a/packages/sdk/yarn.lock b/packages/sdk/yarn.lock index 89cd0725..52b1365a 100644 --- a/packages/sdk/yarn.lock +++ b/packages/sdk/yarn.lock @@ -99,18 +99,18 @@ "@babel/types" "^7.15.4" "@babel/helper-module-transforms@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.4.tgz#962cc629a7f7f9a082dd62d0307fa75fe8788d7c" - integrity sha512-9fHHSGE9zTC++KuXLZcB5FKgvlV83Ox+NLUmQTawovwlJ85+QMhk1CnVk406CQVj97LaWod6KVjl2Sfgw9Aktw== + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" + integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== dependencies: "@babel/helper-module-imports" "^7.15.4" "@babel/helper-replace-supers" "^7.15.4" "@babel/helper-simple-access" "^7.15.4" "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-validator-identifier" "^7.15.7" "@babel/template" "^7.15.4" "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/types" "^7.15.6" "@babel/helper-optimise-call-expression@^7.15.4": version "7.15.4" @@ -148,10 +148,10 @@ dependencies: "@babel/types" "^7.15.4" -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" - integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== +"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" + integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== "@babel/helper-validator-option@^7.14.5": version "7.14.5" @@ -177,9 +177,9 @@ js-tokens "^4.0.0" "@babel/parser@^7.1.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.2": - version "7.15.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.5.tgz#d33a58ca69facc05b26adfe4abebfed56c1c2dac" - integrity sha512-2hQstc6I7T6tQsWzlboMh3SgMRPaS4H6H7cPQsJkdzTzEGqQrpLDsE2BGASU5sBPoEQyHzeqU6C8uKbFeEk6sg== + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" + integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -303,10 +303,10 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.15.4", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.4.tgz#74eeb86dbd6748d2741396557b9860e57fce0a0d" - integrity sha512-0f1HJFuGmmbrKTCZtbm3cU+b/AqdEYk5toj5iQur58xkVMlS0JWaKxTBSmCXd47uiN7vbcozAupm6Mvs80GNhw== +"@babel/types@^7.0.0", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.15.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" + integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== dependencies: "@babel/helper-validator-identifier" "^7.14.9" to-fast-properties "^2.0.0" @@ -366,94 +366,93 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.1.0.tgz#de13b603cb1d389b50c0dc6296e86e112381e43c" - integrity sha512-+Vl+xmLwAXLNlqT61gmHEixeRbS4L8MUzAjtpBCOPWH+izNI/dR16IeXjkXJdRtIVWVSf9DO1gdp67B1XorZhQ== +"@jest/console@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.4.tgz#2f1a4bf82b9940065d4818fac271def99ec55e5e" + integrity sha512-94znCKynPZpDpYHQ6esRJSc11AmONrVkBOBZiD7S+bSubHhrUfbS95EY5HIOxhm4PQO7cnvZkL3oJcY0oMA+Wg== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.1.0" - jest-util "^27.1.0" + jest-message-util "^27.2.4" + jest-util "^27.2.4" slash "^3.0.0" -"@jest/core@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.1.0.tgz#622220f18032f5869e579cecbe744527238648bf" - integrity sha512-3l9qmoknrlCFKfGdrmiQiPne+pUR4ALhKwFTYyOeKw6egfDwJkO21RJ1xf41rN8ZNFLg5W+w6+P4fUqq4EMRWA== +"@jest/core@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.4.tgz#0b932da787d64848eab720dbb88e5b7a3f86e539" + integrity sha512-UNQLyy+rXoojNm2MGlapgzWhZD1CT1zcHZQYeiD0xE7MtJfC19Q6J5D/Lm2l7i4V97T30usKDoEtjI8vKwWcLg== dependencies: - "@jest/console" "^27.1.0" - "@jest/reporters" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/console" "^27.2.4" + "@jest/reporters" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.1.0" - jest-config "^27.1.0" - jest-haste-map "^27.1.0" - jest-message-util "^27.1.0" + jest-changed-files "^27.2.4" + jest-config "^27.2.4" + jest-haste-map "^27.2.4" + jest-message-util "^27.2.4" jest-regex-util "^27.0.6" - jest-resolve "^27.1.0" - jest-resolve-dependencies "^27.1.0" - jest-runner "^27.1.0" - jest-runtime "^27.1.0" - jest-snapshot "^27.1.0" - jest-util "^27.1.0" - jest-validate "^27.1.0" - jest-watcher "^27.1.0" + jest-resolve "^27.2.4" + jest-resolve-dependencies "^27.2.4" + jest-runner "^27.2.4" + jest-runtime "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" + jest-watcher "^27.2.4" micromatch "^4.0.4" - p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.1.0.tgz#c7224a67004759ec203d8fa44e8bc0db93f66c44" - integrity sha512-wRp50aAMY2w1U2jP1G32d6FUVBNYqmk8WaGkiIEisU48qyDV0WPtw3IBLnl7orBeggveommAkuijY+RzVnNDOQ== +"@jest/environment@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.4.tgz#db3e60f7dd30ab950f6ce2d6d7293ed9a6b7cbcd" + integrity sha512-wkuui5yr3SSQW0XD0Qm3TATUbL/WE3LDEM3ulC+RCQhMf2yxhci8x7svGkZ4ivJ6Pc94oOzpZ6cdHBAMSYd1ew== dependencies: - "@jest/fake-timers" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/fake-timers" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" - jest-mock "^27.1.0" + jest-mock "^27.2.4" -"@jest/fake-timers@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.1.0.tgz#c0b343d8a16af17eab2cb6862e319947c0ea2abe" - integrity sha512-22Zyn8il8DzpS+30jJNVbTlm7vAtnfy1aYvNeOEHloMlGy1PCYLHa4PWlSws0hvNsMM5bON6GISjkLoQUV3oMA== +"@jest/fake-timers@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.4.tgz#00df08bd60332bd59503cb5b6db21e4903785f86" + integrity sha512-cs/TzvwWUM7kAA6Qm/890SK6JJ2pD5RfDNM3SSEom6BmdyV6OiWP1qf/pqo6ts6xwpcM36oN0wSEzcZWc6/B6w== dependencies: - "@jest/types" "^27.1.0" - "@sinonjs/fake-timers" "^7.0.2" + "@jest/types" "^27.2.4" + "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.1.0" - jest-mock "^27.1.0" - jest-util "^27.1.0" + jest-message-util "^27.2.4" + jest-mock "^27.2.4" + jest-util "^27.2.4" -"@jest/globals@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.1.0.tgz#e093a49c718dd678a782c197757775534c88d3f2" - integrity sha512-73vLV4aNHAlAgjk0/QcSIzzCZSqVIPbmFROJJv9D3QUR7BI4f517gVdJpSrCHxuRH3VZFhe0yGG/tmttlMll9g== +"@jest/globals@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.4.tgz#0aeb22b011f8c8c4b8ff3b4dbd1ee0392fe0dd8a" + integrity sha512-DRsRs5dh0i+fA9mGHylTU19+8fhzNJoEzrgsu+zgJoZth3x8/0juCQ8nVVdW1er4Cqifb/ET7/hACYVPD0dBEA== dependencies: - "@jest/environment" "^27.1.0" - "@jest/types" "^27.1.0" - expect "^27.1.0" + "@jest/environment" "^27.2.4" + "@jest/types" "^27.2.4" + expect "^27.2.4" -"@jest/reporters@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.1.0.tgz#02ed1e6601552c2f6447378533f77aad002781d4" - integrity sha512-5T/zlPkN2HnK3Sboeg64L5eC8iiaZueLpttdktWTJsvALEtP2YMkC5BQxwjRWQACG9SwDmz+XjjkoxXUDMDgdw== +"@jest/reporters@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.4.tgz#1482ff007f2e919d85c54b1563abb8b2ea2d5198" + integrity sha512-LHeSdDnDZkDnJ8kvnjcqV8P1Yv/32yL4d4XfR5gBiy3xGO0onwll1QEbvtW96fIwhx2nejug0GTaEdNDoyr3fQ== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/console" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -464,15 +463,15 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.1.0" - jest-resolve "^27.1.0" - jest-util "^27.1.0" - jest-worker "^27.1.0" + jest-haste-map "^27.2.4" + jest-resolve "^27.2.4" + jest-util "^27.2.4" + jest-worker "^27.2.4" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^8.0.0" + v8-to-istanbul "^8.1.0" "@jest/source-map@^27.0.6": version "27.0.6" @@ -483,51 +482,51 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.1.0.tgz#9345ae5f97f6a5287af9ebd54716cd84331d42e8" - integrity sha512-Aoz00gpDL528ODLghat3QSy6UBTD5EmmpjrhZZMK/v1Q2/rRRqTGnFxHuEkrD4z/Py96ZdOHxIWkkCKRpmnE1A== +"@jest/test-result@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.4.tgz#d1ca8298d168f1b0be834bfb543b1ac0294c05d7" + integrity sha512-eU+PRo0+lIS01b0dTmMdVZ0TtcRSxEaYquZTRFMQz6CvsehGhx9bRzi9Zdw6VROviJyv7rstU+qAMX5pNBmnfQ== dependencies: - "@jest/console" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/console" "^27.2.4" + "@jest/types" "^27.2.4" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.1.0.tgz#04e8b3bd735570d3d48865e74977a14dc99bff2d" - integrity sha512-lnCWawDr6Z1DAAK9l25o3AjmKGgcutq1iIbp+hC10s/HxnB8ZkUsYq1FzjOoxxZ5hW+1+AthBtvS4x9yno3V1A== +"@jest/test-sequencer@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.4.tgz#df66422a3e9e7440ce8b7498e255fa6b52c0bc03" + integrity sha512-fpk5eknU3/DXE2QCCG1wv/a468+cfPo3Asu6d6yUtM9LOPh709ubZqrhuUOYfM8hXMrIpIdrv1CdCrWWabX0rQ== dependencies: - "@jest/test-result" "^27.1.0" + "@jest/test-result" "^27.2.4" graceful-fs "^4.2.4" - jest-haste-map "^27.1.0" - jest-runtime "^27.1.0" + jest-haste-map "^27.2.4" + jest-runtime "^27.2.4" -"@jest/transform@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.1.0.tgz#962e385517e3d1f62827fa39c305edcc3ca8544b" - integrity sha512-ZRGCA2ZEVJ00ubrhkTG87kyLbN6n55g1Ilq0X9nJb5bX3MhMp3O6M7KG+LvYu+nZRqG5cXsQnJEdZbdpTAV8pQ== +"@jest/transform@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.4.tgz#2fe5b6836895f7a1b8bdec442c51e83943c62733" + integrity sha512-n5FlX2TH0oQGwyVDKPxdJ5nI2sO7TJBFe3u3KaAtt7TOiV4yL+Y+rSFDl+Ic5MpbiA/eqXmLAQxjnBmWgS2rEA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.1.0" + jest-haste-map "^27.2.4" jest-regex-util "^27.0.6" - jest-util "^27.1.0" + jest-util "^27.2.4" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.0.tgz#674a40325eab23c857ebc0689e7e191a3c5b10cc" - integrity sha512-pRP5cLIzN7I7Vp6mHKRSaZD7YpBTK7hawx5si8trMKqk4+WOdK8NEKOTO2G8PKWD1HbKMVckVB6/XHh/olhf2g== +"@jest/types@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" + integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -556,10 +555,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@rollup/plugin-commonjs@^20.0.0": - version "20.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-20.0.0.tgz#3246872dcbcb18a54aaa6277a8c7d7f1b155b745" - integrity sha512-5K0g5W2Ol8hAcTHqcTBHiA7M58tfmYi1o9KxeJuuRNpGaTa5iLjcyemBitCBcKXaHamOBBEH2dGom6v6Unmqjg== +"@rollup/plugin-commonjs@^21.0.0": + version "21.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.0.tgz#b9e4342855ea20b5528f4587b9a90f642196a502" + integrity sha512-XDQimjHl0kNotAV5lLo34XoygaI0teqiKGJ100B3iCU8+15YscJPeqk2KqkqD3NIe1H8ZTUo5lYjUFZyEgASTw== dependencies: "@rollup/pluginutils" "^3.1.0" commondir "^1.0.1" @@ -569,10 +568,10 @@ magic-string "^0.25.7" resolve "^1.17.0" -"@rollup/plugin-node-resolve@^13.0.4": - version "13.0.4" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.4.tgz#b10222f4145a019740acb7738402130d848660c0" - integrity sha512-eYq4TFy40O8hjeDs+sIxEH/jc9lyuI2k9DM557WN6rO5OpnC2qXMBNj4IKH1oHrnAazL49C5p0tgP0/VpqJ+/w== +"@rollup/plugin-node-resolve@^13.0.5": + version "13.0.5" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.5.tgz#016abe58796a4ff544d6beac7818921e3d3777fc" + integrity sha512-mVaw6uxtvuGx/XCI4qBQXsDZJUfyx5vp39iE0J/7Hd6wDhEbjHr6aES7Nr9yWbuE0BY+oKp6N7Bq6jX5NCGNmQ== dependencies: "@rollup/pluginutils" "^3.1.0" "@types/resolve" "1.17.1" @@ -613,10 +612,10 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^7.0.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz#2524eae70c4910edccf99b2f4e6efc5894aff7b5" - integrity sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg== +"@sinonjs/fake-timers@^8.0.1": + version "8.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz#1c1c9a91419f804e59ae8df316a07dd1c3a76b94" + integrity sha512-AU7kwFxreVd6OAXcAFlKSmZquiRUU0FvYm44k1Y1QbK7Co4m0aqfGMhjykIeQp/H6rcl+nFmj0zfdUcGVs9Dew== dependencies: "@sinonjs/commons" "^1.7.0" @@ -626,9 +625,9 @@ integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": - version "7.1.15" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.15.tgz#2ccfb1ad55a02c83f8e0ad327cbc332f55eb1024" - integrity sha512-bxlMKPDbY8x5h6HBwVzEOk2C8fb6SLfYQ5Jw3uBYuYF1lfWk/kbLd81la82vrIkBb0l+JdmrZaDikPrNxpS/Ew== + version "7.1.16" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" + integrity sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -694,10 +693,10 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.1.tgz#fafcc997da0135865311bb1215ba16dba6bdf4ca" - integrity sha512-HTLpVXHrY69556ozYkcq47TtQJXpcWAWfkoqz+ZGz2JnmZhzlRjprCIyFnetSy8gpDWwTTGBcRVv1J1I1vBrHw== +"@types/jest@^27.0.2": + version "27.0.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.2.tgz#ac383c4d4aaddd29bbf2b916d8d105c304a5fcd7" + integrity sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA== dependencies: jest-diff "^27.0.0" pretty-format "^27.0.0" @@ -708,14 +707,14 @@ integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== "@types/node@*": - version "16.7.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.10.tgz#7aa732cc47341c12a16b7d562f519c2383b6d4fc" - integrity sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA== + version "16.10.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.3.tgz#7a8f2838603ea314d1d22bb3171d899e15c57bd5" + integrity sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ== "@types/prettier@^2.1.5": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" - integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== + version "2.4.1" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.1.tgz#e1303048d5389563e130f5bdd89d37a99acb75eb" + integrity sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw== "@types/resolve@1.17.1": version "1.17.1" @@ -741,73 +740,74 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz#4a0c1ae96b953f4e67435e20248d812bfa55e4fb" - integrity sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g== +"@typescript-eslint/eslint-plugin@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" + integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== dependencies: - "@typescript-eslint/experimental-utils" "4.30.0" - "@typescript-eslint/scope-manager" "4.30.0" + "@typescript-eslint/experimental-utils" "4.33.0" + "@typescript-eslint/scope-manager" "4.33.0" debug "^4.3.1" functional-red-black-tree "^1.0.1" + ignore "^5.1.8" regexpp "^3.1.0" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz#9e49704fef568432ae16fc0d6685c13d67db0fd5" - integrity sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw== +"@typescript-eslint/experimental-utils@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" + integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== dependencies: "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.30.0" - "@typescript-eslint/types" "4.30.0" - "@typescript-eslint/typescript-estree" "4.30.0" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.30.0.tgz#6abd720f66bd790f3e0e80c3be77180c8fcb192d" - integrity sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg== +"@typescript-eslint/parser@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" + integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== dependencies: - "@typescript-eslint/scope-manager" "4.30.0" - "@typescript-eslint/types" "4.30.0" - "@typescript-eslint/typescript-estree" "4.30.0" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz#1a3ffbb385b1a06be85cd5165a22324f069a85ee" - integrity sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A== +"@typescript-eslint/scope-manager@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" + integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== dependencies: - "@typescript-eslint/types" "4.30.0" - "@typescript-eslint/visitor-keys" "4.30.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/types@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.30.0.tgz#fb9d9b0358426f18687fba82eb0b0f869780204f" - integrity sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw== +"@typescript-eslint/types@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" + integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/typescript-estree@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz#ae57833da72a753f4846cd3053758c771670c2ac" - integrity sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg== +"@typescript-eslint/typescript-estree@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" + integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== dependencies: - "@typescript-eslint/types" "4.30.0" - "@typescript-eslint/visitor-keys" "4.30.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" debug "^4.3.1" globby "^11.0.3" is-glob "^4.0.1" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.30.0": - version "4.30.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz#a47c6272fc71b0c627d1691f68eaecf4ad71445e" - integrity sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw== +"@typescript-eslint/visitor-keys@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" + integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== dependencies: - "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" abab@^2.0.3, abab@^2.0.5: @@ -839,9 +839,9 @@ acorn@^7.1.1, acorn@^7.4.0: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.2.4: - version "8.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c" - integrity sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA== + version "8.5.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" + integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== agent-base@6: version "6.0.2" @@ -861,9 +861,9 @@ ajv@^6.10.0, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.6.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.2.tgz#2fb45e0e5fcbc0813326c1c3da535d1881bb0571" - integrity sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w== + version "8.6.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" + integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -882,10 +882,10 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.21.3" -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^3.2.1: version "3.2.1" @@ -971,16 +971,16 @@ babel-helper-to-multiple-sequence-expressions@^0.5.0: resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" integrity sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA== -babel-jest@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.1.0.tgz#e96ca04554fd32274439869e2b6d24de9d91bc4e" - integrity sha512-6NrdqzaYemALGCuR97QkC/FkFIEBWP5pw5TMJoUHZTVXyOgocujp6A0JE2V6gE0HtqAAv6VKU/nI+OCR1Z4gHA== +babel-jest@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.4.tgz#21ed6729d51bdd75470bbbf3c8b08d86209fb0dc" + integrity sha512-f24OmxyWymk5jfgLdlCMu4fTs4ldxFBIdn5sJdhvGC1m08rSkJ5hYbWkNmfBSvE/DjhCVNSHXepxsI6THGfGsg== dependencies: - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^27.0.6" + babel-preset-jest "^27.2.0" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -996,10 +996,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.6.tgz#f7c6b3d764af21cb4a2a1ab6870117dbde15b456" - integrity sha512-CewFeM9Vv2gM7Yr9n5eyyLVPRSiBnk6lKZRjgwYnGKSl9M14TMn2vkN02wTF04OGuSDLEzlWiMzvjXuW9mB6Gw== +babel-plugin-jest-hoist@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.2.0.tgz#79f37d43f7e5c4fdc4b2ca3e10cc6cf545626277" + integrity sha512-TOux9khNKdi64mW+0OIhcmbAn75tTlzKhxmiNXevQaPbrBYK7YKjP1jl6NHTJ6XR5UgUrJbCnWlKVnJn29dfjw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -1159,12 +1159,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.6.tgz#909ef08e9f24a4679768be2f60a3df0856843f9d" - integrity sha512-WObA0/Biw2LrVVwZkF/2GqbOdzhKD6Fkdwhoy9ASIrOWr/zodcSpQh72JOkEn6NWyjmnPDjNSqaGN4KnpKzhXw== +babel-preset-jest@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.2.0.tgz#556bbbf340608fed5670ab0ea0c8ef2449fba885" + integrity sha512-z7MgQ3peBwN5L5aCqBKnF6iqdlvZvFUQynEhu0J+X9nHLU72jO3iY331lcYrg+AssJ8q7xsv5/3AICzVmJ/wvg== dependencies: - babel-plugin-jest-hoist "^27.0.6" + babel-plugin-jest-hoist "^27.2.0" babel-preset-current-node-syntax "^1.0.0" babel-preset-minify@^0.5.1: @@ -1222,15 +1222,15 @@ browser-process-hrtime@^1.0.0: integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserslist@^4.16.6: - version "4.17.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.0.tgz#1fcd81ec75b41d6d4994fb0831b92ac18c01649c" - integrity sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g== + version "4.17.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.3.tgz#2844cd6eebe14d12384b0122d217550160d2d624" + integrity sha512-59IqHJV5VGdcJZ+GZ2hU5n4Kv3YiASzW6Xk5g9tf5a/MAzGeFwgGWU39fVzNIOVcgB3+Gp+kiQu0HEfTVU/3VQ== dependencies: - caniuse-lite "^1.0.30001254" - colorette "^1.3.0" - electron-to-chromium "^1.3.830" + caniuse-lite "^1.0.30001264" + electron-to-chromium "^1.3.857" escalade "^3.1.1" - node-releases "^1.1.75" + node-releases "^1.1.77" + picocolors "^0.2.1" bs-logger@0.x: version "0.2.6" @@ -1271,10 +1271,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001254: - version "1.0.30001255" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001255.tgz#f3b09b59ab52e39e751a569523618f47c4298ca0" - integrity sha512-F+A3N9jTZL882f/fg/WWVnKSu6IOo3ueLz4zwaOPbPYHNmM/ZaDUyzyJwS1mZhX7Ex5jqTyW599Gdelh5PDYLQ== +caniuse-lite@^1.0.30001264: + version "1.0.30001264" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001264.tgz#88f625a60efb6724c7c62ac698bc8dbd9757e55b" + integrity sha512-Ftfqqfcs/ePiUmyaySsQ4PUsdcYyXG2rfoBVsk3iY1ahHaJEw65vfb7Suzqm+cEkwwPIv/XWkg27iCpRavH4zA== chalk@^2.0.0: version "2.4.2" @@ -1351,11 +1351,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.3.0.tgz#ff45d2f0edb244069d3b772adeb04fed38d0a0af" - integrity sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w== - combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -1478,10 +1473,10 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -electron-to-chromium@^1.3.830: - version "1.3.830" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.830.tgz#40e3144204f8ca11b2cebec83cf14c20d3499236" - integrity sha512-gBN7wNAxV5vl1430dG+XRcQhD4pIeYeak6p6rjdCtlz5wWNwDad8jwvphe5oi1chL5MV6RNRikfffBBiFuj+rQ== +electron-to-chromium@^1.3.857: + version "1.3.860" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.860.tgz#d612e54ed75fa524c12af8da3ad8121ebfe2802b" + integrity sha512-gWwGZ+Wv4Mou2SJRH6JQzhTPjL5f95SX7n6VkLTQ/Q/INsZLZNQ1vH2GlZjozKyvT0kkFuCmWTwIoCj+/hUDPw== emittery@^0.8.1: version "0.8.1" @@ -1695,16 +1690,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.1.0.tgz#380de0abb3a8f2299c4c6c66bbe930483b5dba9b" - integrity sha512-9kJngV5hOJgkFil4F/uXm3hVBubUK2nERVfvqNNwxxuW8ZOUwSTTSysgfzckYtv/LBzj/LJXbiAF7okHCXgdug== +expect@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.4.tgz#4debf546050bcdad8914a8c95fec7662e02bf67c" + integrity sha512-gOtuonQ8TCnbNNCSw2fhVzRf8EFYDII4nB5NmG4IEV0rbUnW1I5zXvoTntU4iicB/Uh0oZr20NGlOLdJiwsOZA== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.1.0" - jest-message-util "^27.1.0" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1739,9 +1734,9 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastq@^1.6.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.12.0.tgz#ed7b6ab5d62393fb2cc591c853652a5c318bf794" - integrity sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg== + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== dependencies: reusify "^1.0.4" @@ -1867,9 +1862,9 @@ glob-parent@^5.1.2: is-glob "^4.0.1" glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -1970,7 +1965,7 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.4: +ignore@^5.1.4, ignore@^5.1.8: version "5.1.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== @@ -1984,9 +1979,9 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: resolve-from "^4.0.0" import-local@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" - integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== + version "3.0.3" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" + integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -2017,9 +2012,9 @@ is-ci@^3.0.0: ci-info "^3.1.1" is-core-module@^2.2.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" - integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== + version "2.7.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" + integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== dependencies: has "^1.0.3" @@ -2039,9 +2034,9 @@ is-generator-fn@^2.0.0: integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" @@ -2083,9 +2078,9 @@ isexe@^2.0.0: integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= istanbul-lib-coverage@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" - integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.1.tgz#e8900b3ed6069759229cf30f7067388d148aeb5e" + integrity sha512-GvCYYTxaCPqwMjobtVcVKvSHtAGe48MNhGjpK8LtVF8K0ISX7hCKl85LgtuaSneWVyQmaGcW3iXVV3GaZSLpmQ== istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: version "4.0.3" @@ -2123,94 +2118,94 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.1.0.tgz#42da6ea00f06274172745729d55f42b60a9dffe0" - integrity sha512-eRcb13TfQw0xiV2E98EmiEgs9a5uaBIqJChyl0G7jR9fCIvGjXovnDS6Zbku3joij4tXYcSK4SE1AXqOlUxjWg== +jest-changed-files@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.4.tgz#d7de46e90e5a599c47e260760f5ab53516e835e6" + integrity sha512-eeO1C1u4ex7pdTroYXezr+rbr957myyVoKGjcY4R1TJi3A+9v+4fu1Iv9J4eLq1bgFyT3O3iRWU9lZsEE7J72Q== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.1.0.tgz#24c280c90a625ea57da20ee231d25b1621979a57" - integrity sha512-6FWtHs3nZyZlMBhRf1wvAC5CirnflbGJAY1xssSAnERLiiXQRH+wY2ptBVtXjX4gz4AA2EwRV57b038LmifRbA== +jest-circus@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.4.tgz#3bd898a29dcaf6a506f3f1b780dff5f67ca83c23" + integrity sha512-TtheheTElrGjlsY9VxkzUU1qwIx05ItIusMVKnvNkMt4o/PeegLRcjq3Db2Jz0GGdBalJdbzLZBgeulZAJxJWA== dependencies: - "@jest/environment" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/environment" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.1.0" + expect "^27.2.4" is-generator-fn "^2.0.0" - jest-each "^27.1.0" - jest-matcher-utils "^27.1.0" - jest-message-util "^27.1.0" - jest-runtime "^27.1.0" - jest-snapshot "^27.1.0" - jest-util "^27.1.0" - pretty-format "^27.1.0" + jest-each "^27.2.4" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-runtime "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + pretty-format "^27.2.4" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.1.0.tgz#118438e4d11cf6fb66cb2b2eb5778817eab3daeb" - integrity sha512-h6zPUOUu+6oLDrXz0yOWY2YXvBLk8gQinx4HbZ7SF4V3HzasQf+ncoIbKENUMwXyf54/6dBkYXvXJos+gOHYZw== +jest-cli@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.4.tgz#acda7f367aa6e674723fc1a7334e0ae1799448d2" + integrity sha512-4kpQQkg74HYLaXo3nzwtg4PYxSLgL7puz1LXHj5Tu85KmlIpxQFjRkXlx4V47CYFFIDoyl3rHA/cXOxUWyMpNg== dependencies: - "@jest/core" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/core" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.1.0" - jest-util "^27.1.0" - jest-validate "^27.1.0" + jest-config "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" prompts "^2.0.1" - yargs "^16.0.3" + yargs "^16.2.0" -jest-config@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.1.0.tgz#e6826e2baaa34c07c3839af86466870e339d9ada" - integrity sha512-GMo7f76vMYUA3b3xOdlcKeKQhKcBIgurjERO2hojo0eLkKPGcw7fyIoanH+m6KOP2bLad+fGnF8aWOJYxzNPeg== +jest-config@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.4.tgz#0204969f5ae2e5190d47be2c14c04d631b7836e2" + integrity sha512-tWy0UxhdzqiKyp4l5Vq4HxLyD+gH5td+GCF3c22/DJ0bYAOsMo+qi2XtbJI6oYMH5JOJQs9nLW/r34nvFCehjA== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.1.0" - "@jest/types" "^27.1.0" - babel-jest "^27.1.0" + "@jest/test-sequencer" "^27.2.4" + "@jest/types" "^27.2.4" + babel-jest "^27.2.4" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.1.0" - jest-environment-jsdom "^27.1.0" - jest-environment-node "^27.1.0" + jest-circus "^27.2.4" + jest-environment-jsdom "^27.2.4" + jest-environment-node "^27.2.4" jest-get-type "^27.0.6" - jest-jasmine2 "^27.1.0" + jest-jasmine2 "^27.2.4" jest-regex-util "^27.0.6" - jest-resolve "^27.1.0" - jest-runner "^27.1.0" - jest-util "^27.1.0" - jest-validate "^27.1.0" + jest-resolve "^27.2.4" + jest-runner "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" micromatch "^4.0.4" - pretty-format "^27.1.0" + pretty-format "^27.2.4" -jest-diff@^27.0.0, jest-diff@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.1.0.tgz#c7033f25add95e2218f3c7f4c3d7b634ab6b3cd2" - integrity sha512-rjfopEYl58g/SZTsQFmspBODvMSytL16I+cirnScWTLkQVXYVZfxm78DFfdIIXc05RCYuGjxJqrdyG4PIFzcJg== +jest-diff@^27.0.0, jest-diff@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" + integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== dependencies: chalk "^4.0.0" diff-sequences "^27.0.6" jest-get-type "^27.0.6" - pretty-format "^27.1.0" + pretty-format "^27.2.4" jest-docblock@^27.0.6: version "27.0.6" @@ -2219,53 +2214,53 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.1.0.tgz#36ac75f7aeecb3b8da2a8e617ccb30a446df408c" - integrity sha512-K/cNvQlmDqQMRHF8CaQ0XPzCfjP5HMJc2bIJglrIqI9fjwpNqITle63IWE+wq4p+3v+iBgh7Wq0IdGpLx5xjDg== +jest-each@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.4.tgz#b4f280aafd63129ba82e345f0e74c5a10200aeef" + integrity sha512-w9XVc+0EDBUTJS4xBNJ7N2JCcWItFd006lFjz77OarAQcQ10eFDBMrfDv2GBJMKlXe9aq0HrIIF51AXcZrRJyg== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" chalk "^4.0.0" jest-get-type "^27.0.6" - jest-util "^27.1.0" - pretty-format "^27.1.0" + jest-util "^27.2.4" + pretty-format "^27.2.4" -jest-environment-jsdom@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.1.0.tgz#5fb3eb8a67e02e6cc623640388d5f90e33075f18" - integrity sha512-JbwOcOxh/HOtsj56ljeXQCUJr3ivnaIlM45F5NBezFLVYdT91N5UofB1ux2B1CATsQiudcHdgTaeuqGXJqjJYQ== +jest-environment-jsdom@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.4.tgz#39ae80bbb8675306bfaf0440be1e5f877554539a" + integrity sha512-X70pTXFSypD7AIzKT1mLnDi5hP9w9mdTRcOGOmoDoBrNyNEg4rYm6d4LQWFLc9ps1VnMuDOkFSG0wjSNYGjkng== dependencies: - "@jest/environment" "^27.1.0" - "@jest/fake-timers" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/environment" "^27.2.4" + "@jest/fake-timers" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" - jest-mock "^27.1.0" - jest-util "^27.1.0" + jest-mock "^27.2.4" + jest-util "^27.2.4" jsdom "^16.6.0" -jest-environment-node@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.1.0.tgz#feea6b765f1fd4582284d4f1007df2b0a8d15b7f" - integrity sha512-JIyJ8H3wVyM4YCXp7njbjs0dIT87yhGlrXCXhDKNIg1OjurXr6X38yocnnbXvvNyqVTqSI4M9l+YfPKueqL1lw== +jest-environment-node@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.4.tgz#b79f98cb36e0c9111aac859c9c99f04eb2f74ff6" + integrity sha512-ZbVbFSnbzTvhLOIkqh5lcLuGCCFvtG4xTXIRPK99rV2KzQT3kNg16KZwfTnLNlIiWCE8do960eToeDfcqmpSAw== dependencies: - "@jest/environment" "^27.1.0" - "@jest/fake-timers" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/environment" "^27.2.4" + "@jest/fake-timers" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" - jest-mock "^27.1.0" - jest-util "^27.1.0" + jest-mock "^27.2.4" + jest-util "^27.2.4" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.1.0.tgz#a39f456823bd6a74e3c86ad25f6fa870428326bf" - integrity sha512-7mz6LopSe+eA6cTFMf10OfLLqRoIPvmMyz5/OnSXnHO7hB0aDP1iIeLWCXzAcYU5eIJVpHr12Bk9yyq2fTW9vg== +jest-haste-map@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.4.tgz#f8974807bedf07348ca9fd24e5861ab7c8e61aba" + integrity sha512-bkJ4bT00T2K+1NZXbRcyKnbJ42I6QBvoDNMTAQQDBhaGNnZreiQKUNqax0e6hLTx7E75pKDeltVu3V1HAdu+YA== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -2273,76 +2268,76 @@ jest-haste-map@^27.1.0: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.1.0" - jest-worker "^27.1.0" + jest-util "^27.2.4" + jest-worker "^27.2.4" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.1.0.tgz#324a3de0b2ee20d238b2b5b844acc4571331a206" - integrity sha512-Z/NIt0wBDg3przOW2FCWtYjMn3Ip68t0SL60agD/e67jlhTyV3PIF8IzT9ecwqFbeuUSO2OT8WeJgHcalDGFzQ== +jest-jasmine2@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.4.tgz#4a1608133dbdb4d68b5929bfd785503ed9c9ba51" + integrity sha512-fcffjO/xLWLVnW2ct3No4EksxM5RyPwHDYu9QU+90cC+/eSMLkFAxS55vkqsxexOO5zSsZ3foVpMQcg/amSeIQ== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.1.0" + "@jest/environment" "^27.2.4" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.1.0" + expect "^27.2.4" is-generator-fn "^2.0.0" - jest-each "^27.1.0" - jest-matcher-utils "^27.1.0" - jest-message-util "^27.1.0" - jest-runtime "^27.1.0" - jest-snapshot "^27.1.0" - jest-util "^27.1.0" - pretty-format "^27.1.0" + jest-each "^27.2.4" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-runtime "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + pretty-format "^27.2.4" throat "^6.0.1" -jest-leak-detector@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.1.0.tgz#fe7eb633c851e06280ec4dd248067fe232c00a79" - integrity sha512-oHvSkz1E80VyeTKBvZNnw576qU+cVqRXUD3/wKXh1zpaki47Qty2xeHg2HKie9Hqcd2l4XwircgNOWb/NiGqdA== +jest-leak-detector@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.4.tgz#9bb7eab26a73bb280e9298be8d80f389288ec8f1" + integrity sha512-SrcHWbe0EHg/bw2uBjVoHacTo5xosl068x2Q0aWsjr2yYuW2XwqrSkZV4lurUop0jhv1709ymG4or+8E4sH27Q== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.1.0" + pretty-format "^27.2.4" -jest-matcher-utils@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.1.0.tgz#68afda0885db1f0b9472ce98dc4c535080785301" - integrity sha512-VmAudus2P6Yt/JVBRdTPFhUzlIN8DYJd+et5Rd9QDsO/Z82Z4iwGjo43U8Z+PTiz8CBvKvlb6Fh3oKy39hykkQ== +jest-matcher-utils@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.4.tgz#008fff018151415ad1b6cfc083fd70fe1e012525" + integrity sha512-nQeLfFAIPPkyhkDfifAPfP/U5wm1x0fLtAzqXZSSKckXDNuk2aaOfQiDYv1Mgf5GY6yOsxfUnvNm3dDjXM+BXw== dependencies: chalk "^4.0.0" - jest-diff "^27.1.0" + jest-diff "^27.2.4" jest-get-type "^27.0.6" - pretty-format "^27.1.0" + pretty-format "^27.2.4" -jest-message-util@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.1.0.tgz#e77692c84945d1d10ef00afdfd3d2c20bd8fb468" - integrity sha512-Eck8NFnJ5Sg36R9XguD65cf2D5+McC+NF5GIdEninoabcuoOfWrID5qJhufq5FB0DRKoiyxB61hS7MKoMD0trQ== +jest-message-util@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.4.tgz#667e8c0f2b973156d1bac7398a7f677705cafaca" + integrity sha512-wbKT/BNGnBVB9nzi+IoaLkXt6fbSvqUxx+IYY66YFh96J3goY33BAaNG3uPqaw/Sh/FR9YpXGVDfd5DJdbh4nA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.1.0" + pretty-format "^27.2.4" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.1.0.tgz#7ca6e4d09375c071661642d1c14c4711f3ab4b4f" - integrity sha512-iT3/Yhu7DwAg/0HvvLCqLvrTKTRMyJlrrfJYWzuLSf9RCAxBoIXN3HoymZxMnYsC3eD8ewGbUa9jUknwBenx2w== +jest-mock@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.4.tgz#c8f0ef33f73d8ff53e3f60b16d59f1128f4072ae" + integrity sha512-iVRU905rutaAoUcrt5Tm1JoHHWi24YabqEGXjPJI4tAyA6wZ7mzDi3GrZ+M7ebgWBqUkZE93GAx1STk7yCMIQA== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -2355,72 +2350,72 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.1.0.tgz#d32ea4a2c82f76410f6157d0ec6cde24fbff2317" - integrity sha512-Kq5XuDAELuBnrERrjFYEzu/A+i2W7l9HnPWqZEeKGEQ7m1R+6ndMbdXCVCx29Se1qwLZLgvoXwinB3SPIaitMQ== +jest-resolve-dependencies@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.4.tgz#20c41cc02b66aa45169b282356ec73b133013089" + integrity sha512-i5s7Uh9B3Q6uwxLpMhNKlgBf6pcemvWaORxsW1zNF/YCY3jd5EftvnGBI+fxVwJ1CBxkVfxqCvm1lpZkbaoGmg== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" jest-regex-util "^27.0.6" - jest-snapshot "^27.1.0" + jest-snapshot "^27.2.4" -jest-resolve@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.1.0.tgz#bb22303c9e240cccdda28562e3c6fbcc6a23ac86" - integrity sha512-TXvzrLyPg0vLOwcWX38ZGYeEztSEmW+cQQKqc4HKDUwun31wsBXwotRlUz4/AYU/Fq4GhbMd/ileIWZEtcdmIA== +jest-resolve@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.4.tgz#d3b999f073ff84a8ae109ce99ff7f3223048701a" + integrity sha512-IsAO/3+3BZnKjI2I4f3835TBK/90dxR7Otgufn3mnrDFTByOSXclDi3G2XJsawGV4/18IMLARJ+V7Wm7t+J89Q== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.1.0" + jest-haste-map "^27.2.4" jest-pnp-resolver "^1.2.2" - jest-util "^27.1.0" - jest-validate "^27.1.0" + jest-util "^27.2.4" + jest-validate "^27.2.4" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.1.0.tgz#1b28d114fb3b67407b8354c9385d47395e8ff83f" - integrity sha512-ZWPKr9M5w5gDplz1KsJ6iRmQaDT/yyAFLf18fKbb/+BLWsR1sCNC2wMT0H7pP3gDcBz0qZ6aJraSYUNAGSJGaw== +jest-runner@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.4.tgz#d816f4cb4af04f3cba703afcf5a35a335b77cad4" + integrity sha512-hIo5PPuNUyVDidZS8EetntuuJbQ+4IHWxmHgYZz9FIDbG2wcZjrP6b52uMDjAEQiHAn8yn8ynNe+TL8UuGFYKg== dependencies: - "@jest/console" "^27.1.0" - "@jest/environment" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/console" "^27.2.4" + "@jest/environment" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.1.0" - jest-environment-node "^27.1.0" - jest-haste-map "^27.1.0" - jest-leak-detector "^27.1.0" - jest-message-util "^27.1.0" - jest-resolve "^27.1.0" - jest-runtime "^27.1.0" - jest-util "^27.1.0" - jest-worker "^27.1.0" + jest-environment-jsdom "^27.2.4" + jest-environment-node "^27.2.4" + jest-haste-map "^27.2.4" + jest-leak-detector "^27.2.4" + jest-message-util "^27.2.4" + jest-resolve "^27.2.4" + jest-runtime "^27.2.4" + jest-util "^27.2.4" + jest-worker "^27.2.4" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.1.0.tgz#1a98d984ffebc16a0b4f9eaad8ab47c00a750cf5" - integrity sha512-okiR2cpGjY0RkWmUGGado6ETpFOi9oG3yV0CioYdoktkVxy5Hv0WRLWnJFuArSYS8cHMCNcceUUMGiIfgxCO9A== +jest-runtime@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.4.tgz#170044041e5d30625ab8d753516bbe503f213a5c" + integrity sha512-ICKzzYdjIi70P17MZsLLIgIQFCQmIjMFf+xYww3aUySiUA/QBPUTdUqo5B2eg4HOn9/KkUsV0z6GVgaqAPBJvg== dependencies: - "@jest/console" "^27.1.0" - "@jest/environment" "^27.1.0" - "@jest/fake-timers" "^27.1.0" - "@jest/globals" "^27.1.0" + "@jest/console" "^27.2.4" + "@jest/environment" "^27.2.4" + "@jest/fake-timers" "^27.2.4" + "@jest/globals" "^27.2.4" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.1.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -2429,17 +2424,17 @@ jest-runtime@^27.1.0: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.1.0" - jest-message-util "^27.1.0" - jest-mock "^27.1.0" + jest-haste-map "^27.2.4" + jest-message-util "^27.2.4" + jest-mock "^27.2.4" jest-regex-util "^27.0.6" - jest-resolve "^27.1.0" - jest-snapshot "^27.1.0" - jest-util "^27.1.0" - jest-validate "^27.1.0" + jest-resolve "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" slash "^3.0.0" strip-bom "^4.0.0" - yargs "^16.0.3" + yargs "^16.2.0" jest-serializer@^27.0.6: version "27.0.6" @@ -2449,10 +2444,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.1.0.tgz#2a063ab90064017a7e9302528be7eaea6da12d17" - integrity sha512-eaeUBoEjuuRwmiRI51oTldUsKOohB1F6fPqWKKILuDi/CStxzp2IWekVUXbuHHoz5ik33ioJhshiHpgPFbYgcA== +jest-snapshot@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.4.tgz#277b2269437e3ffcb91d95a73b24becf33c5a871" + integrity sha512-5DFxK31rYS8X8C6WXsFx8XxrxW3PGa6+9IrUcZdTLg1aEyXDGIeiBh4jbwvh655bg/9vTETbEj/njfZicHTZZw== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2460,79 +2455,79 @@ jest-snapshot@^27.1.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.1.0" + expect "^27.2.4" graceful-fs "^4.2.4" - jest-diff "^27.1.0" + jest-diff "^27.2.4" jest-get-type "^27.0.6" - jest-haste-map "^27.1.0" - jest-matcher-utils "^27.1.0" - jest-message-util "^27.1.0" - jest-resolve "^27.1.0" - jest-util "^27.1.0" + jest-haste-map "^27.2.4" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-resolve "^27.2.4" + jest-util "^27.2.4" natural-compare "^1.4.0" - pretty-format "^27.1.0" + pretty-format "^27.2.4" semver "^7.3.2" -jest-util@^27.0.0, jest-util@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.1.0.tgz#06a53777a8cb7e4940ca8e20bf9c67dd65d9bd68" - integrity sha512-edSLD2OneYDKC6gZM1yc+wY/877s/fuJNoM1k3sOEpzFyeptSmke3SLnk1dDHk9CgTA+58mnfx3ew3J11Kes/w== +jest-util@^27.0.0, jest-util@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.4.tgz#3d7ce081b2e7f4cfe0156452ac01f3cb456cc656" + integrity sha512-mW++4u+fSvAt3YBWm5IpbmRAceUqa2B++JlUZTiuEt2AmNYn0Yw5oay4cP17TGsMINRNPSGiJ2zNnX60g+VbFg== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.1.0.tgz#d9e82024c5e3f5cef52a600cfc456793a84c0998" - integrity sha512-QiJ+4XuSuMsfPi9zvdO//IrSRSlG6ybJhOpuqYSsuuaABaNT84h0IoD6vvQhThBOKT+DIKvl5sTM0l6is9+SRA== +jest-validate@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.4.tgz#b66d462b2fb93d7e16a47d1aa8763d5600bf2cfa" + integrity sha512-VMtbxbkd7LHnIH7PChdDtrluCFRJ4b1YV2YJzNwwsASMWftq/HgqiqjvptBOWyWOtevgO3f14wPxkPcLlVBRog== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.2.4" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.1.0" + pretty-format "^27.2.4" -jest-watcher@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.1.0.tgz#2511fcddb0e969a400f3d1daa74265f93f13ce93" - integrity sha512-ivaWTrA46aHWdgPDgPypSHiNQjyKnLBpUIHeBaGg11U+pDzZpkffGlcB1l1a014phmG0mHgkOHtOgiqJQM6yKQ== +jest-watcher@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.4.tgz#b1d5c39ab94f59f4f35f66cc96f7761a10e0cfc4" + integrity sha512-LXC/0+dKxhK7cfF7reflRYlzDIaQE+fL4ynhKhzg8IMILNMuI4xcjXXfUJady7OR4/TZeMg7X8eHx8uan9vqaQ== dependencies: - "@jest/test-result" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.1.0" + jest-util "^27.2.4" string-length "^4.0.1" -jest-worker@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.1.0.tgz#65f4a88e37148ed984ba8ca8492d6b376938c0aa" - integrity sha512-mO4PHb2QWLn9yRXGp7rkvXLAYuxwhq1ZYUo0LoDhg8wqvv4QizP1ZWEJOeolgbEgAWZLIEU0wsku8J+lGWfBhg== +jest-worker@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.4.tgz#881455df75e22e7726a53f43703ab74d6b36f82d" + integrity sha512-Zq9A2Pw59KkVjBBKD1i3iE2e22oSjXhUKKuAK1HGX8flGwkm6NMozyEYzKd41hXc64dbd/0eWFeEEuxqXyhM+g== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.1.0.tgz#eaab62dfdc02d8b7c814cd27b8d2d92bc46d3d69" - integrity sha512-pSQDVwRSwb109Ss13lcMtdfS9r8/w2Zz8+mTUA9VORD66GflCdl8nUFCqM96geOD2EBwWCNURrNAfQsLIDNBdg== +jest@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.4.tgz#70e27bef873138afc123aa4769f7124c50ad3efb" + integrity sha512-h4uqb1EQLfPulWyUFFWv9e9Nn8sCqsJ/j3wk/KCY0p4s4s0ICCfP3iMf6hRf5hEhsDyvyrCgKiZXma63gMz16A== dependencies: - "@jest/core" "^27.1.0" + "@jest/core" "^27.2.4" import-local "^3.0.2" - jest-cli "^27.1.0" + jest-cli "^27.2.4" js-tokens@^4.0.0: version "4.0.0" @@ -2718,17 +2713,17 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.49.0: - version "1.49.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" - integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== +mime-db@1.50.0: + version "1.50.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" + integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== mime-types@^2.1.12: - version "2.1.32" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" - integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== + version "2.1.33" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" + integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== dependencies: - mime-db "1.49.0" + mime-db "1.50.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2767,10 +2762,10 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-releases@^1.1.75: - version "1.1.75" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.75.tgz#6dd8c876b9897a1b8e5a02de26afa79bb54ebbfe" - integrity sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw== +node-releases@^1.1.77: + version "1.1.77" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.77.tgz#50b0cfede855dd374e7585bf228ff34e57c1c32e" + integrity sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ== normalize-path@^3.0.0: version "3.0.0" @@ -2827,11 +2822,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -p-each-series@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" - integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== - p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -2888,6 +2878,11 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +picocolors@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" + integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== + picomatch@^2.0.4, picomatch@^2.2.2, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" @@ -2924,18 +2919,18 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" - integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== +prettier@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" + integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== -pretty-format@^27.0.0, pretty-format@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.1.0.tgz#022f3fdb19121e0a2612f3cff8d724431461b9ca" - integrity sha512-4aGaud3w3rxAO6OXmK3fwBFQ0bctIOG3/if+jYEFGNGIs0EvuidQm3bZ9mlP2/t9epLNC/12czabfy7TZNSwVA== +pretty-format@^27.0.0, pretty-format@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" + integrity sha512-NUjw22WJHldzxyps2YjLZkUj6q1HvjqFezkB9Y2cklN8NtVZN/kZEXGZdFw4uny3oENzV5EEMESrkI0YDUH8vg== dependencies: - "@jest/types" "^27.1.0" - ansi-regex "^5.0.0" + "@jest/types" "^27.2.4" + ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^17.0.1" @@ -3046,10 +3041,10 @@ rollup-plugin-typescript2@^0.30.0: resolve "1.20.0" tslib "2.1.0" -rollup@^2.56.3: - version "2.56.3" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.56.3.tgz#b63edadd9851b0d618a6d0e6af8201955a77aeff" - integrity sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg== +rollup@^2.58.0: + version "2.58.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.58.0.tgz#a643983365e7bf7f5b7c62a8331b983b7c4c67fb" + integrity sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw== optionalDependencies: fsevents "~2.3.2" @@ -3102,9 +3097,9 @@ shebang-regex@^3.0.0: integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" + integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== sisteransi@^1.0.5: version "1.0.5" @@ -3126,9 +3121,9 @@ slice-ansi@^4.0.0: is-fullwidth-code-point "^3.0.0" source-map-support@^0.5.6: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + version "0.5.20" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" + integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -3159,9 +3154,9 @@ sprintf-js@~1.0.2: integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= stack-utils@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277" - integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw== + version "2.0.5" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" + integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== dependencies: escape-string-regexp "^2.0.0" @@ -3173,21 +3168,21 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: - ansi-regex "^5.0.0" + ansi-regex "^5.0.1" strip-bom@^4.0.0: version "4.0.0" @@ -3239,16 +3234,16 @@ symbol-tree@^3.2.4: integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== table@^6.0.9: - version "6.7.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" - integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== + version "6.7.2" + resolved "https://registry.yarnpkg.com/table/-/table-6.7.2.tgz#a8d39b9f5966693ca8b0feba270a78722cbaf3b0" + integrity sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g== dependencies: ajv "^8.0.1" lodash.clonedeep "^4.5.0" lodash.truncate "^4.4.2" slice-ansi "^4.0.0" - string-width "^4.2.0" - strip-ansi "^6.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" terminal-link@^2.0.0: version "2.1.1" @@ -3278,9 +3273,9 @@ throat@^6.0.1: integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== tmpl@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" - integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + version "1.0.5" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== to-fast-properties@^2.0.0: version "2.0.0" @@ -3377,10 +3372,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86" - integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ== +typescript@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" + integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== universalify@^0.1.0, universalify@^0.1.2: version "0.1.2" @@ -3399,10 +3394,10 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -v8-to-istanbul@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.0.0.tgz#4229f2a99e367f3f018fa1d5c2b8ec684667c69c" - integrity sha512-LkmXi8UUNxnCC+JlH7/fsfsKr5AU110l+SYGJimWNkWhxbN5EyeOtm1MJ0hhvqMMOhGwBj1Fp70Yv9i+hX0QAg== +v8-to-istanbul@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c" + integrity sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -3497,9 +3492,9 @@ write-file-atomic@^3.0.0: typedarray-to-buffer "^3.1.5" ws@^7.4.6: - version "7.5.4" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.4.tgz#56bfa20b167427e138a7795de68d134fe92e21f9" - integrity sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg== + version "7.5.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" + integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== xml-name-validator@^3.0.0: version "3.0.0" @@ -3526,7 +3521,7 @@ yargs-parser@20.x, yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs@^16.0.3: +yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== diff --git a/yarn.lock b/yarn.lock index 3ef36dc5..80da964f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,9 +10,9 @@ "@babel/highlight" "^7.14.5" "@babel/helper-validator-identifier@^7.14.5": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" - integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" + integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== "@babel/highlight@^7.14.5": version "7.14.5" @@ -769,9 +769,9 @@ rimraf "^3.0.2" "@npmcli/node-gyp@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@npmcli/node-gyp/-/node-gyp-1.0.2.tgz#3cdc1f30e9736dbc417373ed803b42b1a0a29ede" - integrity sha512-yrJUe6reVMpktcvagumoqD9r08fH1iRo01gn1u0zoCApa9lnZGEigVKUd2hzsCId4gdtkZZIVscLhNxMECKgRg== + version "1.0.3" + resolved "https://registry.yarnpkg.com/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz#a912e637418ffc5f2db375e93b85837691a43a33" + integrity sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA== "@npmcli/promise-spawn@^1.2.0", "@npmcli/promise-spawn@^1.3.2": version "1.3.2" @@ -791,9 +791,9 @@ read-package-json-fast "^2.0.1" "@octokit/auth-token@^2.4.4": - version "2.4.5" - resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.5.tgz#568ccfb8cb46f36441fac094ce34f7a875b197f3" - integrity sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA== + version "2.5.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" + integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== dependencies: "@octokit/types" "^6.0.3" @@ -828,34 +828,34 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^10.1.0": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.1.1.tgz#74607482d193e9c9cc7e23ecf04b1bde3eabb6d8" - integrity sha512-ygp/6r25Ezb1CJuVMnFfOsScEtPF0zosdTJDZ7mZ+I8IULl7DP1BS5ZvPRwglcarGPXOvS5sHdR0bjnVDDfQdQ== +"@octokit/openapi-types@^10.6.4": + version "10.6.4" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.6.4.tgz#c8b5b1f5c60ab7c62858abe2ef57bc709f426a30" + integrity sha512-JVmwWzYTIs6jACYOwD6zu5rdrqGIYsiAsLzTCxdrWIPNKNVjEF6vPTL20shmgJ4qZsq7WPBcLXLsaQD+NLChfg== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== -"@octokit/plugin-paginate-rest@^2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.0.tgz#09dbda2e5fbca022e3cdf76b63618f7b357c9f0c" - integrity sha512-8YYzALPMvEZ35kgy5pdYvQ22Roz+BIuEaedO575GwE2vb/ACDqQn0xQrTJR4tnZCJn7pi8+AWPVjrFDaERIyXQ== +"@octokit/plugin-paginate-rest@^2.16.4": + version "2.16.7" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.7.tgz#d25b6e650ba5a007002986f5fda66958d44e70a4" + integrity sha512-TMlyVhMPx6La1Ud4PSY4YxqAvb9YPEMs/7R1nBSbsw4wNqG73aBqls0r0dRRCWe5Pm0ZUGS9a94N46iAxlOR8A== dependencies: - "@octokit/types" "^6.26.0" + "@octokit/types" "^6.31.3" "@octokit/plugin-request-log@^1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== -"@octokit/plugin-rest-endpoint-methods@^5.9.0": - version "5.10.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.10.0.tgz#8058acf408d518defa2dc59a46777adbcd7ee8e8" - integrity sha512-HiUZliq5wNg15cevJlTo9zDnPXAD0BMRhLxbRNPnq9J3HELKesDTOiou56ax2jC/rECUkK/uJTugrizYKSo/jg== +"@octokit/plugin-rest-endpoint-methods@5.11.4": + version "5.11.4" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.11.4.tgz#221dedcbdc45d6bfa54228d469e8c34acb4e0e34" + integrity sha512-iS+GYTijrPUiEiLoDsGJhrbXIvOPfm2+schvr+FxNMs7PeE9Nl4bAMhE8ftfNX3Z1xLxSKwEZh0O7GbWurX5HQ== dependencies: - "@octokit/types" "^6.27.0" + "@octokit/types" "^6.31.2" deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": @@ -868,9 +868,9 @@ once "^1.4.0" "@octokit/request@^5.6.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.1.tgz#f97aff075c37ab1d427c49082fefeef0dba2d8ce" - integrity sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ== + version "5.6.2" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.2.tgz#1aa74d5da7b9e04ac60ef232edd9a7438dcf32d8" + integrity sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA== dependencies: "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.1.0" @@ -880,21 +880,21 @@ universal-user-agent "^6.0.0" "@octokit/rest@^18.1.0": - version "18.10.0" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.10.0.tgz#8a0add9611253e0e31d3ed5b4bc941a3795a7648" - integrity sha512-esHR5OKy38bccL/sajHqZudZCvmv4yjovMJzyXlphaUo7xykmtOdILGJ3aAm0mFHmMLmPFmDMJXf39cAjNJsrw== + version "18.11.4" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.11.4.tgz#9fb6d826244554fbf8c110b9064018d7198eec51" + integrity sha512-QplypCyYxqMK05JdMSm/bDWZO8VWWaBdzQ9tbF9rEV9rIEiICh+v6q+Vu/Y5hdze8JJaxfUC+PBC7vrnEkZvZg== dependencies: "@octokit/core" "^3.5.1" - "@octokit/plugin-paginate-rest" "^2.16.0" + "@octokit/plugin-paginate-rest" "^2.16.4" "@octokit/plugin-request-log" "^1.0.4" - "@octokit/plugin-rest-endpoint-methods" "^5.9.0" + "@octokit/plugin-rest-endpoint-methods" "5.11.4" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.26.0", "@octokit/types@^6.27.0": - version "6.27.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.27.0.tgz#2ffcd4d1cf344285f4151978c6fd36a2edcdf922" - integrity sha512-ha27f8DToxXBPEJdzHCCuqpw7AgKfjhWGdNf3yIlBAhAsaexBXTfWw36zNSsncALXGvJq4EjLy1p3Wz45Aqb4A== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.31.2", "@octokit/types@^6.31.3": + version "6.31.3" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.31.3.tgz#14c2961baea853b2bf148d892256357a936343f8" + integrity sha512-IUG3uMpsLHrtEL6sCVXbxCgnbKcgpkS4K7gVEytLDvYYalkK3XcuMCHK1YPD8xJglSJAOAbL4MgXp47rS9G49w== dependencies: - "@octokit/openapi-types" "^10.1.0" + "@octokit/openapi-types" "^10.6.4" "@sindresorhus/is@^0.14.0": version "0.14.0" @@ -1006,11 +1006,11 @@ ansi-align@^2.0.0: string-width "^2.0.0" ansi-align@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" - integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== dependencies: - string-width "^3.0.0" + string-width "^4.1.0" ansi-escapes@^4.2.1: version "4.3.2" @@ -1029,15 +1029,10 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^3.2.1: version "3.2.1" @@ -1179,15 +1174,15 @@ boxen@1.3.0: widest-line "^2.0.0" boxen@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.0.1.tgz#657528bdd3f59a772b8279b831f27ec2c744664b" - integrity sha512-49VBlw+PrWEF51aCmy7QIteYPIFZxSpvqBdP/2itCPPlJ49kj9zg/XPRFrdkne2W+CfwXUls8exMvu1RysZpKA== + version "5.1.2" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== dependencies: ansi-align "^3.0.0" camelcase "^6.2.0" chalk "^4.1.0" cli-boxes "^2.2.1" - string-width "^4.2.0" + string-width "^4.2.2" type-fest "^0.20.2" widest-line "^3.1.0" wrap-ansi "^7.0.0" @@ -1570,17 +1565,17 @@ content-disposition@0.5.2: integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= conventional-changelog-angular@^5.0.12: - version "5.0.12" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz#c979b8b921cbfe26402eb3da5bbfda02d865a2b9" - integrity sha512-5GLsbnkR/7A89RyHLvvoExbiGbd9xKdKqDTrArnPbOqBqG/2wIosu0fHwpeIRI8Tl94MhVNBXcLJZl92ZQ5USw== + version "5.0.13" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz#896885d63b914a70d4934b59d2fe7bde1832b28c" + integrity sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA== dependencies: compare-func "^2.0.0" q "^1.5.1" conventional-changelog-core@^4.2.2: - version "4.2.3" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.3.tgz#ce44d4bbba4032e3dc14c00fcd5b53fc00b66433" - integrity sha512-MwnZjIoMRL3jtPH5GywVNqetGILC7g6RQFvdb8LRU/fA/338JbeWAku3PZ8yQ+mtVRViiISqJlb0sOz0htBZig== + version "4.2.4" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz#e50d047e8ebacf63fac3dc67bf918177001e1e9f" + integrity sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg== dependencies: add-stream "^1.0.0" conventional-changelog-writer "^5.0.0" @@ -1626,9 +1621,9 @@ conventional-commits-filter@^2.0.7: modify-values "^1.0.0" conventional-commits-parser@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.1.tgz#ba44f0b3b6588da2ee9fd8da508ebff50d116ce2" - integrity sha512-OG9kQtmMZBJD/32NEw5IhN5+HnBqVjy03eC+I71I0oQRFA5rOgA4OtPOYG7mz1GkCfCNxn3gKIX8EiHJYuf1cA== + version "3.2.2" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.2.tgz#190fb9900c6e02be0c0bca9b03d57e24982639fd" + integrity sha512-Jr9KAKgqAkwXMRHjxDwO/zOCDKod1XdAESHAGuJX38iZ7ZzVti/tvVoysO0suMsdAObp9NQ2rHSsSbnAqZ5f5g== dependencies: JSONStream "^1.0.4" is-text-path "^1.0.1" @@ -1636,7 +1631,6 @@ conventional-commits-parser@^3.2.0: meow "^8.0.0" split2 "^3.0.0" through2 "^4.0.0" - trim-off-newlines "^1.0.0" conventional-recommended-bump@^6.1.0: version "6.1.0" @@ -1874,11 +1868,6 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -1920,22 +1909,25 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.18.0-next.2: - version "1.18.5" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.5.tgz#9b10de7d4c206a3581fd5b2124233e04db49ae19" - integrity sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA== +es-abstract@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" + integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" has "^1.0.3" has-symbols "^1.0.2" internal-slot "^1.0.3" - is-callable "^1.2.3" + is-callable "^1.2.4" is-negative-zero "^2.0.1" - is-regex "^1.1.3" - is-string "^1.0.6" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.1" + is-string "^1.0.7" + is-weakref "^1.0.1" object-inspect "^1.11.0" object-keys "^1.1.1" object.assign "^4.1.2" @@ -2071,9 +2063,9 @@ fast-url-parser@1.1.3: punycode "^1.3.2" fastq@^1.6.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.12.0.tgz#ed7b6ab5d62393fb2cc591c853652a5c318bf794" - integrity sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg== + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== dependencies: reusify "^1.0.4" @@ -2256,6 +2248,14 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -2299,9 +2299,9 @@ git-up@^4.0.0: parse-url "^6.0.0" git-url-parse@^11.4.4: - version "11.5.0" - resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.5.0.tgz#acaaf65239cb1536185b19165a24bbc754b3f764" - integrity sha512-TZYSMDeM37r71Lqg1mbnMlOqlHd7BSij9qN7XwTkRqSAYFMihGLGhfHwgqQob3GUhEneKnV4nskN9rbQw2KGxA== + version "11.6.0" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.6.0.tgz#c634b8de7faa66498a2b88932df31702c67df605" + integrity sha512-WWUxvJs5HsyHL6L08wOusa/IXYtMuCAhrMmnTjQPpBU0TTHyDhnOATNH3xNQz7YOQUsqIIPTGr4xiVti1Hsk5g== dependencies: git-up "^4.0.0" @@ -2320,9 +2320,9 @@ glob-parent@^5.1.1, glob-parent@^5.1.2: is-glob "^4.0.1" glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -2541,9 +2541,9 @@ import-lazy@^2.1.0: integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= import-local@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" - integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== + version "3.0.3" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" + integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -2587,15 +2587,14 @@ ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== init-package-json@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-2.0.4.tgz#9f9f66cd5934e6d5f645150e15013d384d0b90d2" - integrity sha512-gUACSdZYka+VvnF90TsQorC+1joAVWNI724vBNj3RD0LLMeDss2IuzaeiQs0T4YzKs76BPHtrp/z3sn2p+KDTw== + version "2.0.5" + resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-2.0.5.tgz#78b85f3c36014db42d8f32117252504f68022646" + integrity sha512-u1uGAtEFu3VA6HNl/yUWw57jmKEMx8SKOxHhxjGnOFUiIlFnohKDFg4ZrPpv9wWqk44nDxGJAtqjdQFm+9XXQA== dependencies: - glob "^7.1.1" - npm-package-arg "^8.1.2" + npm-package-arg "^8.1.5" promzard "^0.3.0" read "~1.0.1" - read-package-json "^4.0.0" + read-package-json "^4.1.1" semver "^7.3.5" validate-npm-package-license "^3.0.4" validate-npm-package-name "^3.0.0" @@ -2653,7 +2652,7 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-callable@^1.1.4, is-callable@^1.2.3: +is-callable@^1.1.4, is-callable@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== @@ -2666,9 +2665,9 @@ is-ci@^2.0.0: ci-info "^2.0.0" is-core-module@^2.2.0, is-core-module@^2.5.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" - integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== + version "2.7.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" + integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== dependencies: has "^1.0.3" @@ -2707,9 +2706,9 @@ is-fullwidth-code-point@^3.0.0: integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" @@ -2780,7 +2779,7 @@ is-plain-object@^5.0.0: resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== -is-regex@^1.1.3: +is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== @@ -2788,6 +2787,11 @@ is-regex@^1.1.3: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-shared-array-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" + integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== + is-ssh@^1.3.0: version "1.3.3" resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.3.tgz#7f133285ccd7f2c2c7fc897b771b53d95a2b2c7e" @@ -2805,7 +2809,7 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-string@^1.0.5, is-string@^1.0.6: +is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== @@ -2831,6 +2835,13 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= +is-weakref@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" + integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== + dependencies: + call-bind "^1.0.0" + is-wsl@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" @@ -3210,9 +3221,9 @@ map-obj@^1.0.0: integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= map-obj@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.2.1.tgz#e4ea399dbc979ae735c83c863dd31bdf364277b7" - integrity sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ== + version "4.3.0" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" + integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== meow@^7.0.0: version "7.1.1" @@ -3266,10 +3277,10 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.49.0, "mime-db@>= 1.43.0 < 2": - version "1.49.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" - integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== +mime-db@1.50.0, "mime-db@>= 1.43.0 < 2": + version "1.50.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" + integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== mime-db@~1.33.0: version "1.33.0" @@ -3284,11 +3295,11 @@ mime-types@2.1.18: mime-db "~1.33.0" mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.32" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" - integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== + version "2.1.33" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" + integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== dependencies: - mime-db "1.49.0" + mime-db "1.50.0" mimic-fn@^2.1.0: version "2.1.0" @@ -3382,9 +3393,9 @@ minipass@^2.6.0, minipass@^2.9.0: yallist "^3.0.0" minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd" - integrity sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg== + version "3.1.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.5.tgz#71f6251b0a33a49c01b3cf97ff77eda030dff732" + integrity sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw== dependencies: yallist "^4.0.0" @@ -3476,9 +3487,11 @@ nice-try@^1.0.4: integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + version "2.6.5" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd" + integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ== + dependencies: + whatwg-url "^5.0.0" node-gyp@^5.0.2: version "5.1.1" @@ -3624,7 +3637,7 @@ npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== -npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-package-arg@^8.1.2: +npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-package-arg@^8.1.2, npm-package-arg@^8.1.5: version "8.1.5" resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.5.tgz#3369b2d5fe8fdc674baa7f1786514ddc15466e44" integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q== @@ -3739,13 +3752,13 @@ object.assign@^4.1.2: object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3: - version "2.1.2" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" - integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== + version "2.1.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz#b223cf38e17fefb97a63c10c91df72ccb386df9e" + integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" + es-abstract "^1.19.1" on-headers@~1.0.1: version "1.0.2" @@ -4254,7 +4267,7 @@ read-package-json@^3.0.0: normalize-package-data "^3.0.0" npm-normalize-package-bin "^1.0.0" -read-package-json@^4.0.0: +read-package-json@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-4.1.1.tgz#153be72fce801578c1c86b8ef2b21188df1b9eea" integrity sha512-P82sbZJ3ldDrWCOSKxJT0r/CXMWR0OR3KRh55SgKo3p91GSIEEC32v3lSHAvO/UcH3/IoL7uqhOFBduAnwdldw== @@ -4567,10 +4580,10 @@ serve-handler@6.1.3: path-to-regexp "2.2.1" range-parser "1.2.0" -serve@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/serve/-/serve-12.0.0.tgz#122962f712b57660059de9d109c82599280e4949" - integrity sha512-BkTsETQYynAZ7rXX414kg4X6EvuZQS3UVs1NY0VQYdRHSTYWPYcH38nnDh48D0x6ONuislgjag8uKlU2gTBImA== +serve@^12.0.1: + version "12.0.1" + resolved "https://registry.yarnpkg.com/serve/-/serve-12.0.1.tgz#5b0e05849f5ed9b8aab0f30a298c3664bba052bb" + integrity sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw== dependencies: "@zeit/schemas" "2.6.0" ajv "6.12.6" @@ -4628,9 +4641,9 @@ side-channel@^1.0.4: object-inspect "^1.9.0" signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" + integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== sisteransi@^1.0.5: version "1.0.5" @@ -4662,9 +4675,9 @@ socks-proxy-agent@^5.0.0: socks "^2.3.3" socks-proxy-agent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.0.0.tgz#9f8749cdc05976505fa9f9a958b1818d0e60573b" - integrity sha512-FIgZbQWlnjVEQvMkylz64/rUggGtrKstPnx8OZyYFG0tAFR8CSBtpXxSwbFLHyeXFn/cunFL7MpuSOvDSOPo9g== + version "6.1.0" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz#869cf2d7bd10fea96c7ad3111e81726855e285c3" + integrity sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg== dependencies: agent-base "^6.0.2" debug "^4.3.1" @@ -4791,23 +4804,14 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" string.prototype.trimend@^1.0.4: version "1.0.4" @@ -4853,19 +4857,12 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: - ansi-regex "^5.0.0" + ansi-regex "^5.0.1" strip-bom@^3.0.0: version "3.0.0" @@ -5029,16 +5026,16 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + trim-newlines@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== -trim-off-newlines@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" - integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= - tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -5104,9 +5101,9 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= uglify-js@^3.1.4: - version "3.14.1" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.1.tgz#e2cb9fe34db9cb4cf7e35d1d26dfea28e09a7d06" - integrity sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g== + version "3.14.2" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.2.tgz#d7dd6a46ca57214f54a2d0a43cad0f35db82ac99" + integrity sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A== uid-number@0.0.6: version "0.0.6" @@ -5259,11 +5256,24 @@ wcwidth@^1.0.0: dependencies: defaults "^1.0.3" +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + webidl-conversions@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + whatwg-url@^8.4.0: version "8.7.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" From 87330d0ce29d7f8d521917bfc7a3c01e546d042b Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 18 Oct 2021 11:43:00 +0900 Subject: [PATCH 29/87] =?UTF-8?q?type=20connect=20=E6=99=82=E3=81=AE?= =?UTF-8?q?=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E3=83=BC=E5=90=8D?= =?UTF-8?q?=E3=82=92=20data=5Fchannel=5Fmessaging=20=E3=82=92=20data=5Fcha?= =?UTF-8?q?nnels=20=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/sora.ts | 2 ++ packages/sdk/src/types.ts | 12 ++++++------ packages/sdk/src/utils.ts | 12 ++++++------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/sdk/src/sora.ts b/packages/sdk/src/sora.ts index 9a9993c4..c9295734 100644 --- a/packages/sdk/src/sora.ts +++ b/packages/sdk/src/sora.ts @@ -10,6 +10,7 @@ import type { ConnectionOptions, JSONType, MessagingDataChannel, + DataChannelDirection, Role, SignalingEvent, SignalingNotifyConnectionCreated, @@ -95,6 +96,7 @@ export type { ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, + DataChannelDirection, MessagingDataChannel, Role, SignalingEvent, diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 49697fde..e4336078 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -37,9 +37,9 @@ export type SignalingVideo = export type Role = "sendrecv" | "sendonly" | "recvonly"; -export type SignalingConnectMessagingDataChannel = { +export type SignalingConnectDataChannel = { label?: string; - direction?: MessagingDataChannelDirection; + direction?: DataChannelDirection; compress?: boolean; max_packet_life_time?: number; max_retransmits?: number; @@ -70,7 +70,7 @@ export type SignalingConnectMessage = { data_channel_signaling?: boolean; ignore_disconnect_websocket?: boolean; redirect?: true; - data_channel_messaging?: SignalingConnectMessagingDataChannel[]; + data_channels?: SignalingConnectDataChannel[]; }; export type SignalingMessage = @@ -86,7 +86,7 @@ export type SignalingMessage = export type SignalingOfferMessageDataChannel = { label: string; - direction: MessagingDataChannelDirection; + direction: DataChannelDirection; compress: boolean; }; @@ -251,11 +251,11 @@ export type SignalingNotifyNetworkStatus = { unstable_level: 0 | 1 | 2 | 3; }; -export type MessagingDataChannelDirection = "sendonly" | "sendrecv" | "recvonly"; +export type DataChannelDirection = "sendonly" | "sendrecv" | "recvonly"; export type MessagingDataChannel = { label: string; - direction: MessagingDataChannelDirection; + direction: DataChannelDirection; compress?: boolean; maxPacketLifeTime?: number; maxRetransmits?: number; diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index 257fe5b2..bba1b3a4 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -6,7 +6,7 @@ import { MessagingEvent, PreKeyBundle, SignalingConnectMessage, - SignalingConnectMessagingDataChannel, + SignalingConnectDataChannel, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, @@ -54,12 +54,12 @@ function enabledSimulcast(): boolean { return hasAllRequiredHeaderExtensions; } -function parseMessagingDataChannel(params: unknown): SignalingConnectMessagingDataChannel { +function parseMessagingDataChannel(params: unknown): SignalingConnectDataChannel { if (typeof params !== "object" || params === null) { throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); } const messagingDataChannel = params as MessagingDataChannel; - const result: SignalingConnectMessagingDataChannel = {}; + const result: SignalingConnectDataChannel = {}; if (typeof messagingDataChannel.label === "string") { result.label = messagingDataChannel.label; } @@ -84,8 +84,8 @@ function parseMessagingDataChannel(params: unknown): SignalingConnectMessagingDa return result; } -function parseMessagingDataChannels(messagingDataChannels: unknown[]): SignalingConnectMessagingDataChannel[] { - const result: SignalingConnectMessagingDataChannel[] = []; +function parseMessagingDataChannels(messagingDataChannels: unknown[]): SignalingConnectDataChannel[] { + const result: SignalingConnectDataChannel[] = []; for (const messagingDataChannel of messagingDataChannels) { result.push(parseMessagingDataChannel(messagingDataChannel)); } @@ -305,7 +305,7 @@ export function createSignalingMessage( } if (Array.isArray(options.messagingDataChannels) && 0 < options.messagingDataChannels.length) { - message.data_channel_messaging = parseMessagingDataChannels(options.messagingDataChannels); + message.data_channels = parseMessagingDataChannels(options.messagingDataChannels); } return message; From c746a8d51511fb1e798ff41b903703a88207615c Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 18 Oct 2021 12:21:44 +0900 Subject: [PATCH 30/87] =?UTF-8?q?=E6=8E=A5=E7=B6=9A=20option=20=E3=81=AB?= =?UTF-8?q?=E6=B8=A1=E3=81=99=20DataChannel=20=E3=81=AE=E3=82=AA=E3=83=97?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E5=90=8D=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 8 +++---- packages/sdk/src/sora.ts | 4 ++-- packages/sdk/src/types.ts | 4 ++-- packages/sdk/src/utils.ts | 48 +++++++++++++++++++-------------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index a1ca650e..5da727a9 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -17,7 +17,7 @@ import { Callbacks, ConnectionOptions, JSONType, - MessagingDataChannel, + DataChannelConfiguration, SignalingConnectMessage, SignalingMessage, SignalingNotifyMessage, @@ -1664,11 +1664,11 @@ export default class ConnectionBase { return this.ws.url; } - get messagingDataChannels(): MessagingDataChannel[] { + get messagingDataChannels(): DataChannelConfiguration[] { const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); }); - const result: MessagingDataChannel[] = []; + const result: DataChannelConfiguration[] = []; for (const label of messagingDataChannellabels) { const dataChannel = this.dataChannels[label]; if (!dataChannel) { @@ -1678,7 +1678,7 @@ export default class ConnectionBase { if (!settings) { continue; } - const messagingDataChannel: MessagingDataChannel = { + const messagingDataChannel: DataChannelConfiguration = { label: dataChannel.label, ordered: dataChannel.ordered, protocol: dataChannel.protocol, diff --git a/packages/sdk/src/sora.ts b/packages/sdk/src/sora.ts index c9295734..714abfc0 100644 --- a/packages/sdk/src/sora.ts +++ b/packages/sdk/src/sora.ts @@ -9,7 +9,7 @@ import type { Callbacks, ConnectionOptions, JSONType, - MessagingDataChannel, + DataChannelConfiguration, DataChannelDirection, Role, SignalingEvent, @@ -96,8 +96,8 @@ export type { ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, + DataChannelConfiguration, DataChannelDirection, - MessagingDataChannel, Role, SignalingEvent, SignalingNotifyConnectionCreated, diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index e4336078..dcebb369 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -253,7 +253,7 @@ export type SignalingNotifyNetworkStatus = { export type DataChannelDirection = "sendonly" | "sendrecv" | "recvonly"; -export type MessagingDataChannel = { +export type DataChannelConfiguration = { label: string; direction: DataChannelDirection; compress?: boolean; @@ -295,7 +295,7 @@ export type ConnectionOptions = { ignoreDisconnectWebSocket?: boolean; disconnectWaitTimeout?: number; signalingCandidateTimeout?: number; - messagingDataChannels?: MessagingDataChannel[]; + dataChannels?: DataChannelConfiguration[]; }; export type Callbacks = { diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index bba1b3a4..40276656 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -2,7 +2,7 @@ import { ConnectionOptions, Browser, JSONType, - MessagingDataChannel, + DataChannelConfiguration, MessagingEvent, PreKeyBundle, SignalingConnectMessage, @@ -54,40 +54,40 @@ function enabledSimulcast(): boolean { return hasAllRequiredHeaderExtensions; } -function parseMessagingDataChannel(params: unknown): SignalingConnectDataChannel { - if (typeof params !== "object" || params === null) { - throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); +function parseDataChannelConfiguration(dataChannelConfiguration: unknown): SignalingConnectDataChannel { + if (typeof dataChannelConfiguration !== "object" || dataChannelConfiguration === null) { + throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'"); } - const messagingDataChannel = params as MessagingDataChannel; + const configuration = dataChannelConfiguration as DataChannelConfiguration; const result: SignalingConnectDataChannel = {}; - if (typeof messagingDataChannel.label === "string") { - result.label = messagingDataChannel.label; + if (typeof configuration.label === "string") { + result.label = configuration.label; } - if (typeof messagingDataChannel.direction === "string") { - result.direction = messagingDataChannel.direction; + if (typeof configuration.direction === "string") { + result.direction = configuration.direction; } - if (typeof messagingDataChannel.ordered === "boolean") { - result.ordered = messagingDataChannel.ordered; + if (typeof configuration.ordered === "boolean") { + result.ordered = configuration.ordered; } - if (typeof messagingDataChannel.compress === "boolean") { - result.compress = messagingDataChannel.compress; + if (typeof configuration.compress === "boolean") { + result.compress = configuration.compress; } - if (typeof messagingDataChannel.maxPacketLifeTime === "number") { - result.max_packet_life_time = messagingDataChannel.maxPacketLifeTime; + if (typeof configuration.maxPacketLifeTime === "number") { + result.max_packet_life_time = configuration.maxPacketLifeTime; } - if (typeof messagingDataChannel.maxRetransmits === "number") { - result.max_retransmits = messagingDataChannel.maxRetransmits; + if (typeof configuration.maxRetransmits === "number") { + result.max_retransmits = configuration.maxRetransmits; } - if (typeof messagingDataChannel.protocol === "string") { - result.protocol = messagingDataChannel.protocol; + if (typeof configuration.protocol === "string") { + result.protocol = configuration.protocol; } return result; } -function parseMessagingDataChannels(messagingDataChannels: unknown[]): SignalingConnectDataChannel[] { +function parseDataChannelConfigurations(dataChannelConfigurations: unknown[]): SignalingConnectDataChannel[] { const result: SignalingConnectDataChannel[] = []; - for (const messagingDataChannel of messagingDataChannels) { - result.push(parseMessagingDataChannel(messagingDataChannel)); + for (const dataChannelConfiguration of dataChannelConfigurations) { + result.push(parseDataChannelConfiguration(dataChannelConfiguration)); } return result; } @@ -304,8 +304,8 @@ export function createSignalingMessage( message.e2ee = true; } - if (Array.isArray(options.messagingDataChannels) && 0 < options.messagingDataChannels.length) { - message.data_channels = parseMessagingDataChannels(options.messagingDataChannels); + if (Array.isArray(options.dataChannels) && 0 < options.dataChannels.length) { + message.data_channels = parseDataChannelConfigurations(options.dataChannels); } return message; From d5b6f3a2c8be6c3b40bc3da316dbed18423aec8d Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 18 Oct 2021 12:21:52 +0900 Subject: [PATCH 31/87] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/tests/utils.test.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/sdk/tests/utils.test.ts b/packages/sdk/tests/utils.test.ts index eca4304f..466224e4 100644 --- a/packages/sdk/tests/utils.test.ts +++ b/packages/sdk/tests/utils.test.ts @@ -1,5 +1,5 @@ import { createSignalingMessage } from "../src/utils"; -import { AudioCodecType, MessagingDataChannelDirection, VideoCodecType } from "../src/types"; +import { AudioCodecType, DataChannelDirection, VideoCodecType } from "../src/types"; const channelId = "7N3fsMHob"; const role = "sendonly"; @@ -458,45 +458,45 @@ test("createSignalingMessage redirect", () => { ); }); -test("createSignalingMessage messagingDataChannels option", () => { +test("createSignalingMessage dataChannels option", () => { // array 以外の場合は無視 const options1 = { - messagingDataChannels: "test", + dataChannels: "test", }; // @ts-ignore option で指定されている型以外を引数に指定する expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual(baseExpectedMessage); // array が空の場合は追加されない const options2 = { - messagingDataChannels: [], + dataChannels: [], }; expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual(baseExpectedMessage); // messagingDataChannel に object 以外が含まれる場合は例外が発生する const options3 = { - messagingDataChannels: [{ label: "test", direction: "sendrecv" }, "test"], + dataChannels: [{ label: "test", direction: "sendrecv" }, "test"], }; expect(() => { // @ts-ignore option で指定されている型以外を引数に指定する createSignalingMessage(sdp, role, channelId, null, options3, false); - }).toThrow("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); + }).toThrow("Failed to parse options dataChannels. Options dataChannels element must be type 'object'"); // messagingDataChannel に null が含まれる場合は例外が発生する const options4 = { - messagingDataChannels: [{ label: "test", direction: "sendrecv" }, null], + dataChannels: [{ label: "test", direction: "sendrecv" }, null], }; expect(() => { // @ts-ignore option で指定されている型以外を引数に指定する createSignalingMessage(sdp, role, channelId, null, options4, false); - }).toThrow("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); + }).toThrow("Failed to parse options dataChannels. Options dataChannels element must be type 'object'"); // 正常系 const options5 = { - messagingDataChannels: [ - { label: "test", direction: "sendrecv" as MessagingDataChannelDirection }, + dataChannels: [ + { label: "test", direction: "sendrecv" as DataChannelDirection }, { label: "test2", - direction: "sendonly" as MessagingDataChannelDirection, + direction: "sendonly" as DataChannelDirection, ordered: true, maxPacketLifeTime: 100, maxRetransmits: 100, @@ -506,7 +506,7 @@ test("createSignalingMessage messagingDataChannels option", () => { ], }; const diff5 = { - data_channel_messaging: [ + data_channels: [ { label: "test", direction: "sendrecv" }, { label: "test2", From fdcf04975f14b7a66284612178aad209442579e7 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 18 Oct 2021 14:14:17 +0900 Subject: [PATCH 32/87] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/tests/utils.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sdk/tests/utils.test.ts b/packages/sdk/tests/utils.test.ts index 466224e4..78d20c31 100644 --- a/packages/sdk/tests/utils.test.ts +++ b/packages/sdk/tests/utils.test.ts @@ -472,7 +472,7 @@ test("createSignalingMessage dataChannels option", () => { }; expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual(baseExpectedMessage); - // messagingDataChannel に object 以外が含まれる場合は例外が発生する + // dataChannel に object 以外が含まれる場合は例外が発生する const options3 = { dataChannels: [{ label: "test", direction: "sendrecv" }, "test"], }; @@ -481,7 +481,7 @@ test("createSignalingMessage dataChannels option", () => { createSignalingMessage(sdp, role, channelId, null, options3, false); }).toThrow("Failed to parse options dataChannels. Options dataChannels element must be type 'object'"); - // messagingDataChannel に null が含まれる場合は例外が発生する + // dataChannel に null が含まれる場合は例外が発生する const options4 = { dataChannels: [{ label: "test", direction: "sendrecv" }, null], }; From f95662c6f94a4b68a0531ecd8b717bb419665522 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 18 Oct 2021 14:21:17 +0900 Subject: [PATCH 33/87] =?UTF-8?q?DataChannel=20Messaging=20=E3=81=AE=20cal?= =?UTF-8?q?lback=20=E3=82=92=20messaging=20=E3=81=8B=E3=82=89=20message=20?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 6 +++--- packages/sdk/src/types.ts | 4 ++-- packages/sdk/src/utils.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 5da727a9..38f2cfbd 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -3,7 +3,7 @@ import { unzlibSync, zlibSync } from "fflate"; import { ConnectError, createDataChannelData, - createMessagingEvent, + createDataChannelMessageEvent, createSignalingEvent, createSignalingMessage, createTimelineEvent, @@ -133,7 +133,7 @@ export default class ConnectionBase { timeout: (): void => {}, timeline: (): void => {}, signaling: (): void => {}, - messaging: (): void => {}, + message: (): void => {}, }; this.authMetadata = null; this.e2ee = null; @@ -1513,7 +1513,7 @@ export default class ConnectionBase { data = new TextDecoder().decode(unzlibMessage); } const message = JSON.parse(data) as JSONType; - this.callbacks.messaging(createMessagingEvent(dataChannel.label, message)); + this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, message)); }; } } diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index dcebb369..e4f1b60f 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -310,7 +310,7 @@ export type Callbacks = { timeout: () => void; timeline: (event: TimelineEvent) => void; signaling: (event: SignalingEvent) => void; - messaging: (event: MessagingEvent) => void; + message: (event: DataChannelMessageEvent) => void; }; export type PreKeyBundle = { @@ -331,7 +331,7 @@ export interface SignalingEvent extends Event { data?: any; } -export interface MessagingEvent extends Event { +export interface DataChannelMessageEvent extends Event { label: string; data: JSONType; } diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index 40276656..de63ef72 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -3,7 +3,7 @@ import { Browser, JSONType, DataChannelConfiguration, - MessagingEvent, + DataChannelMessageEvent, PreKeyBundle, SignalingConnectMessage, SignalingConnectDataChannel, @@ -432,8 +432,8 @@ export function createTimelineEvent( return event; } -export function createMessagingEvent(label: string, data: JSONType): MessagingEvent { - const event = new Event("messaging") as MessagingEvent; +export function createDataChannelMessageEvent(label: string, data: JSONType): DataChannelMessageEvent { + const event = new Event("message") as DataChannelMessageEvent; event.label = label; event.data = data; return event; From a234fe502ec9dcc3b02fda5ef2048738e02c8b46 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 18 Oct 2021 15:20:47 +0900 Subject: [PATCH 34/87] =?UTF-8?q?disconnect=20=E6=99=82=E3=81=AE=E3=83=AD?= =?UTF-8?q?=E3=82=B0=E5=87=BA=E5=8A=9B=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 38f2cfbd..6b9d2ce2 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -621,6 +621,12 @@ export default class ConnectionBase { const dataChannel = this.dataChannels[key]; if (dataChannel) { dataChannel.onmessage = null; + // onclose はログを吐く専用に残す + dataChannel.onclose = (event): void => { + const channel = event.currentTarget as RTCDataChannel; + this.writeDataChannelTimelineLog("onclose", channel); + this.trace("CLOSE DATA CHANNEL", channel.label); + }; } } let event = null; From aae45e7557a12fab9c4aa64159b1a210a19e1e7f Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 18 Oct 2021 15:23:33 +0900 Subject: [PATCH 35/87] 2021.2.0-canary.3 --- dist/base.d.ts | 4 +- dist/sora.d.ts | 4 +- dist/sora.js | 76 +++++++++++++++++++---------------- dist/sora.min.js | 6 +-- dist/sora.min.js.map | 2 +- dist/sora.mjs | 72 ++++++++++++++++++--------------- dist/types.d.ts | 20 ++++----- dist/utils.d.ts | 4 +- lerna.json | 2 +- package.json | 2 +- packages/e2ee/package.json | 4 +- packages/go-wasm/package.json | 2 +- packages/sdk/package.json | 4 +- 13 files changed, 107 insertions(+), 95 deletions(-) diff --git a/dist/base.d.ts b/dist/base.d.ts index 57c5d22a..466f3c4e 100644 --- a/dist/base.d.ts +++ b/dist/base.d.ts @@ -1,4 +1,4 @@ -import { Callbacks, ConnectionOptions, JSONType, MessagingDataChannel, SignalingOfferMessage, SignalingReOfferMessage, SignalingUpdateMessage } from "./types"; +import { Callbacks, ConnectionOptions, JSONType, DataChannelConfiguration, SignalingOfferMessage, SignalingReOfferMessage, SignalingUpdateMessage } from "./types"; import SoraE2EE from "@sora/e2ee"; declare global { interface Algorithm { @@ -110,5 +110,5 @@ export default class ConnectionBase { get video(): boolean; get signalingUrl(): string | string[]; get connectedSignalingUrl(): string; - get messagingDataChannels(): MessagingDataChannel[]; + get messagingDataChannels(): DataChannelConfiguration[]; } diff --git a/dist/sora.d.ts b/dist/sora.d.ts index 9ecb936f..be671bf6 100644 --- a/dist/sora.d.ts +++ b/dist/sora.d.ts @@ -2,7 +2,7 @@ import ConnectionBase from "./base"; import ConnectionPublisher from "./publisher"; import ConnectionSubscriber from "./subscriber"; import { applyMediaStreamConstraints } from "./helpers"; -import type { AudioCodecType, Callbacks, ConnectionOptions, JSONType, MessagingDataChannel, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; +import type { AudioCodecType, Callbacks, ConnectionOptions, JSONType, DataChannelConfiguration, DataChannelDirection, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; declare class SoraConnection { signalingUrlCandidates: string | string[]; debug: boolean; @@ -21,4 +21,4 @@ declare const _default: { }; }; export default _default; -export type { AudioCodecType, Callbacks, ConnectionBase, ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, MessagingDataChannel, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SoraConnection, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType, }; +export type { AudioCodecType, Callbacks, ConnectionBase, ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, DataChannelConfiguration, DataChannelDirection, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SoraConnection, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType, }; diff --git a/dist/sora.js b/dist/sora.js index 9fc0077f..2cb4c4bd 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * @sora/sdk - * undefined - * @version: 2021.2.0-canary.2 + * WebRTC SFU Sora JavaScript SDK + * @version: 2021.2.0-canary.3 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -10,7 +10,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Sora = factory()); -}(this, (function () { 'use strict'; +})(this, (function () { 'use strict'; // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -604,7 +604,7 @@ /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.2.0-canary.2 + * @version: 2021.2.0-canary.3 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -772,7 +772,7 @@ } } static version() { - return "2021.2.0-canary.2"; + return "2021.2.0-canary.3"; } static wasmVersion() { return window.e2ee.version(); @@ -1587,39 +1587,39 @@ const hasAllRequiredHeaderExtensions = REQUIRED_HEADER_EXTEMSIONS.every((h) => headerExtensions.includes(h)); return hasAllRequiredHeaderExtensions; } - function parseMessagingDataChannel(params) { - if (typeof params !== "object" || params === null) { - throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); + function parseDataChannelConfiguration(dataChannelConfiguration) { + if (typeof dataChannelConfiguration !== "object" || dataChannelConfiguration === null) { + throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'"); } - const messagingDataChannel = params; + const configuration = dataChannelConfiguration; const result = {}; - if (typeof messagingDataChannel.label === "string") { - result.label = messagingDataChannel.label; + if (typeof configuration.label === "string") { + result.label = configuration.label; } - if (typeof messagingDataChannel.direction === "string") { - result.direction = messagingDataChannel.direction; + if (typeof configuration.direction === "string") { + result.direction = configuration.direction; } - if (typeof messagingDataChannel.ordered === "boolean") { - result.ordered = messagingDataChannel.ordered; + if (typeof configuration.ordered === "boolean") { + result.ordered = configuration.ordered; } - if (typeof messagingDataChannel.compress === "boolean") { - result.compress = messagingDataChannel.compress; + if (typeof configuration.compress === "boolean") { + result.compress = configuration.compress; } - if (typeof messagingDataChannel.maxPacketLifeTime === "number") { - result.max_packet_life_time = messagingDataChannel.maxPacketLifeTime; + if (typeof configuration.maxPacketLifeTime === "number") { + result.max_packet_life_time = configuration.maxPacketLifeTime; } - if (typeof messagingDataChannel.maxRetransmits === "number") { - result.max_retransmits = messagingDataChannel.maxRetransmits; + if (typeof configuration.maxRetransmits === "number") { + result.max_retransmits = configuration.maxRetransmits; } - if (typeof messagingDataChannel.protocol === "string") { - result.protocol = messagingDataChannel.protocol; + if (typeof configuration.protocol === "string") { + result.protocol = configuration.protocol; } return result; } - function parseMessagingDataChannels(messagingDataChannels) { + function parseDataChannelConfigurations(dataChannelConfigurations) { const result = []; - for (const messagingDataChannel of messagingDataChannels) { - result.push(parseMessagingDataChannel(messagingDataChannel)); + for (const dataChannelConfiguration of dataChannelConfigurations) { + result.push(parseDataChannelConfiguration(dataChannelConfiguration)); } return result; } @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.2", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.3", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1809,8 +1809,8 @@ } message.e2ee = true; } - if (Array.isArray(options.messagingDataChannels) && 0 < options.messagingDataChannels.length) { - message.data_channel_messaging = parseMessagingDataChannels(options.messagingDataChannels); + if (Array.isArray(options.dataChannels) && 0 < options.dataChannels.length) { + message.data_channels = parseDataChannelConfigurations(options.dataChannels); } return message; } @@ -1924,8 +1924,8 @@ event.dataChannelLabel = dataChannelLabel; return event; } - function createMessagingEvent(label, data) { - const event = new Event("messaging"); + function createDataChannelMessageEvent(label, data) { + const event = new Event("message"); event.label = label; event.data = data; return event; @@ -1978,7 +1978,7 @@ timeout: () => { }, timeline: () => { }, signaling: () => { }, - messaging: () => { }, + message: () => { }, }; this.authMetadata = null; this.e2ee = null; @@ -2454,6 +2454,12 @@ const dataChannel = this.dataChannels[key]; if (dataChannel) { dataChannel.onmessage = null; + // onclose はログを吐く専用に残す + dataChannel.onclose = (event) => { + const channel = event.currentTarget; + this.writeDataChannelTimelineLog("onclose", channel); + this.trace("CLOSE DATA CHANNEL", channel.label); + }; } } let event = null; @@ -3296,7 +3302,7 @@ data = new TextDecoder().decode(unzlibMessage); } const message = JSON.parse(data); - this.callbacks.messaging(createMessagingEvent(dataChannel.label, message)); + this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, message)); }; } } @@ -3780,7 +3786,7 @@ return new SoraConnection(signalingUrlCandidates, debug); }, version: function () { - return "2021.2.0-canary.2"; + return "2021.2.0-canary.3"; }, helpers: { applyMediaStreamConstraints, @@ -3789,4 +3795,4 @@ return sora; -}))); +})); diff --git a/dist/sora.min.js b/dist/sora.min.js index db558d24..c2513d47 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,8 +1,8 @@ /** * @sora/sdk - * undefined - * @version: 2021.2.0-canary.2 + * WebRTC SFU Sora JavaScript SDK + * @version: 2021.2.0-canary.3 * @author: Shiguredo Inc. * @license: Apache-2.0 - **/(function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"==typeof globalThis?e||self:globalThis,e.Sora=n())})(this,function(){'use strict';var n=Math.min,a=Math.ceil,g=Math.max;function t(){(()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,a){n+=i.decode(a);const g=n.lastIndexOf("\n");return-1!=g&&(console.log(n.substr(0,g)),n=n.substr(g+1)),a.length},write(i,a,g,t,o,l){if(0!==g||t!==a.length||null!==o)return void l(e());const s=this.writeSync(i,a);l(null,s)},chmod(n,i,a){a(e())},chown(n,i,a,g){g(e())},close(n,i){i(e())},fchmod(n,i,a){a(e())},fchown(n,i,a,g){g(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,a){a(e())},lchown(n,i,a,g){g(e())},link(n,i,a){a(e())},lstat(n,i){i(e())},mkdir(n,i,a){a(e())},open(n,i,a,g){g(e())},read(n,i,a,g,t,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,a){a(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,a){a(e())},truncate(n,i,a){a(e())},unlink(n,i){i(e())},utimes(n,i,a,g){g(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},g=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},t=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let a=0;switch(typeof n){case"object":null!==n&&(a=1);break;case"string":a=2;break;case"symbol":a=3;break;case"function":a=4;}this.mem.setUint32(e+4,2146959360|a,!0),this.mem.setUint32(e,i,!0)},l=e=>{const n=g(e+0),i=g(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},s=e=>{const n=g(e+0),o=g(e+8),l=Array(o);for(let a=0;a{const n=g(e+0),a=g(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=g(e+8),a=g(e+16),t=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,t))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(c+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},g(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,d(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(t(e+8),d(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(t(e+8),d(e+16),t(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(t(e+8),d(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(t(e+8),g(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(t(e+8),g(e+16),t(e+24))},"syscall/js.valueCall":e=>{try{const n=t(e+8),i=Reflect.get(n,d(e+16)),a=s(e+32),g=Reflect.apply(i,n,a);e=this._inst.exports.getsp(),o(e+56,g),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=t(e+8),i=s(e+16),a=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=t(e+8),i=s(e+16),a=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(t(n+8).length))},"syscall/js.valuePrepareString":i=>{const a=n.encode(t(i+8)+"");o(i+16,a),e(i+24,a.length)},"syscall/js.valueLoadString":e=>{const n=t(e+8);l(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,t(e+8)instanceof t(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=l(n+8),a=t(n+32);if(!(a instanceof Uint8Array||a instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const g=a.subarray(0,i.length);i.set(g),e(n+40,g.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=t(n+8),a=l(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const g=a.subarray(0,i.length);i.set(g),e(n+40,g.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const a=e=>{const a=i,g=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,g.length).set(g),i+=g.length,0!=i%8&&(i+=8-i%8),a},g=this.argv.length,t=[];this.argv.forEach(e=>{t.push(a(e))}),t.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{t.push(a(`${e}=${this.env[e]}`))}),t.push(0);const l=i;t.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(g,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=Ce();i.p(e);var a=re(e,n,2,4);return me(a,n),Ie(a,a.length-4,i.d()),a}function l(e,n){return $((Ae(e),e.subarray(2,-4)),n)}function s(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function d(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function c(e){if("object"!=typeof e||null===e)throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'");const n=e,i={};return"string"==typeof n.label&&(i.label=n.label),"string"==typeof n.direction&&(i.direction=n.direction),"boolean"==typeof n.ordered&&(i.ordered=n.ordered),"boolean"==typeof n.compress&&(i.compress=n.compress),"number"==typeof n.maxPacketLifeTime&&(i.max_packet_life_time=n.maxPacketLifeTime),"number"==typeof n.maxRetransmits&&(i.max_retransmits=n.maxRetransmits),"string"==typeof n.protocol&&(i.protocol=n.protocol),i}function C(e){const n=[];for(const i of e)n.push(c(i));return n}function r(){return"safari"===s()}function I(e,n,i,a,g,t){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.2",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==a&&(o.metadata=a),t&&(o.redirect=!0),"signalingNotifyMetadata"in g&&(o.signaling_notify_metadata=g.signalingNotifyMetadata),"multistream"in g&&!0===g.multistream&&(o.multistream=!0,"spotlight"in g&&(o.spotlight=g.spotlight,"spotlightNumber"in g&&(o.spotlight_number=g.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==g.spotlightFocusRid&&0<=e.indexOf(g.spotlightFocusRid)&&(o.spotlight_focus_rid=g.spotlightFocusRid),void 0!==g.spotlightUnfocusRid&&0<=e.indexOf(g.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=g.spotlightUnfocusRid)}if("simulcast"in g||"simulcastRid"in g){"simulcast"in g&&!0===g.simulcast&&(o.simulcast=!0);void 0!==g.simulcastRid&&0<=["r0","r1","r2"].indexOf(g.simulcastRid)&&(o.simulcast_rid=g.simulcastRid)}"clientId"in g&&void 0!==g.clientId&&(o.client_id=g.clientId),"dataChannelSignaling"in g&&"boolean"==typeof g.dataChannelSignaling&&(o.data_channel_signaling=g.dataChannelSignaling),"ignoreDisconnectWebSocket"in g&&"boolean"==typeof g.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=g.ignoreDisconnectWebSocket);const l=["audioCodecType","audioBitRate"],s=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},g);Object.keys(r).forEach(e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=s.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]}),void 0!==r.audio&&(o.audio=r.audio);const I=Object.keys(r).some(e=>0<=l.indexOf(e));o.audio&&I&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const m=Object.keys(r).some(e=>0<=s.indexOf(e));o.audio&&m&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const A=Object.keys(r).some(e=>0<=c.indexOf(e));if(o.video&&A&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!d()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===g.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(g.messagingDataChannels)&&0{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),a(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let g="";window.performance&&(g="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(g=g+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(g+" "+n),a(i),console.groupEnd()):console.log(g+" "+n+"\n",i)}function b(e,n,i){const a=new Event(e);try{a.data=JSON.parse(JSON.stringify(n))}catch(e){a.data=n}return a.transportType=i,a}function p(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function V(e,n,i,a,g){const t=new Event(e);try{t.data=JSON.parse(JSON.stringify(n))}catch(e){t.data=n}return t.logType=i,t.dataChannelId=a,t.dataChannelLabel=g,t}function S(e,n){const i=new Event("messaging");return i.label=e,i.data=n,i}class W{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm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6HliY3jga7loLTlkIgKICAgIGlmIChlbmNvZGVkRnJhbWUudHlwZSA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgLy8g6Z+z5aOw44Gv5pqX5Y+35YyW44Gv44GE44KL44Go6IGe44GR44Gf44KC44Gu44GY44KD44Gq44GE44Gu44Gn572u44GN5o+b44GI44KLCiAgICAgICAgY29uc3QgbmV3RGF0YSA9IG5ldyBBcnJheUJ1ZmZlcigzKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIE9wdXMg44K144Kk44Os44Oz44K544OV44Os44O844OgCiAgICAgICAgbmV3VWludDguc2V0KFsweGQ4LCAweGZmLCAweGZlXSk7CiAgICAgICAgZW5jb2RlZEZyYW1lLmRhdGEgPSBuZXdEYXRhOwogICAgfQogICAgZWxzZSB7CiAgICAgICAgLy8g5pig5YOP44GM5q2j5bi444GY44KD44Gq44GE44Gf44KBIFBMSSDjgrnjg4jjg7zjg6DjgYznmbrnlJ/jgZfjgabjgZfjgb7jgYYKICAgICAgICAvLyDjgZ3jga7jgZ/jgoEgMzIweDI0MCDjga7nnJ/jgaPpu5LjgarnlLvpnaLjgavnva7jgY3mj5vjgYjjgosKICAgICAgICBjb25zdCBuZXdEYXRhID0gbmV3IEFycmF5QnVmZmVyKDYwKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIHByZXR0aWVyLWlnbm9yZQogICAgICAgIG5ld1VpbnQ4LnNldChbMHhiMCwgMHgwNSwgMHgwMCwgMHg5ZCwgMHgwMSwgMHgyYSwgMHhhMCwgMHgwMCwgMHg1YSwgMHgwMCwKICAgICAgICAgICAgMHgzOSwgMHgwMywgMHgwMCwgMHgwMCwgMHgxYywgMHgyMiwgMHgxNiwgMHgxNiwgMHgyMiwgMHg2NiwKICAgICAgICAgICAgMHgxMiwgMHgyMCwgMHgwNCwg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25uZWN0aW9uSWQgPSB0ZXh0RGVjb2Rlci5kZWNvZGUoY29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1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IGNvbnN0IHsgdHlwZSB9ID0gZXZlbnQuZGF0YTsKICAgIGlmICh0eXBlID09PSAic2VsZlNlY3JldEtleU1hdGVyaWFsIikgewogICAgICAgIGNvbnN0IHsgc2VsZlNlY3JldEtleU1hdGVyaWFsLCBzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdhaXRpbmdUaW1lIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RS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gICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:a},[i,a])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:a},[i,a])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,a=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:a})}startSession(e,n){const[i,a]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(a)throw a;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(t(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.2.0-canary.2"}static wasmVersion(){return window.e2ee.version()}}var G=Uint8Array,h=Uint16Array,y=Uint32Array,k=new G([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),w=new G([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),R=new G([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(e,n){for(var a=new h(31),g=0;31>g;++g)a[g]=n+=1<g;++g)for(var o=a[g];oK;++K)T=(43690&K)>>>1|(21845&K)<<1,T=(52428&T)>>>2|(13107&T)<<2,T=(61680&T)>>>4|(3855&T)<<4,E[K]=((65280&T)>>>8|(255&T)<<8)>>>1;for(var v=function(e,n,a){for(var g=e.length,t=0,o=new h(n);t>>15-n]=d}else for(s=new h(g),t=0;t>>15-e[t]);return s},L=new G(288),K=0;144>K;++K)L[K]=8;for(var K=144;256>K;++K)L[K]=9;for(var K=256;280>K;++K)L[K]=7;for(var K=280;288>K;++K)L[K]=8;for(var F=new G(32),K=0;32>K;++K)F[K]=5;var J=v(L,9,0),U=v(L,9,1),D=v(F,5,0),Q=v(F,5,1),j=function(e){for(var n=e[0],a=1;an&&(n=e[a]);return n},M=function(e,n,i){var a=0|n/8;return(e[a]|e[a+1]<<8)>>(7&n)&i},H=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},P=function(e){return 0|(e+7)/8},z=function(i,a,g){(null==a||0>a)&&(a=0),(null==g||g>i.length)&&(g=i.length);var t=new(i instanceof h?h:i instanceof y?y:G)(g-a);return t.set(i.subarray(a,g)),t},_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],q=function(n,i,a){var g=new Error(i||_[n]);if(g.code=n,Error.captureStackTrace&&Error.captureStackTrace(g,q),!a)throw g;return g},$=function(a,o,C){var I=a.length;if(!I||C&&C.f&&!C.l)return o||new G(0);var m=!o||C,A=!C||C.i;C||(C={}),o||(o=new G(3*I));var u=function(e){var n=o.length;if(e>n){var i=new G(g(2*n,e));i.set(o),o=i}},Z=C.f||0,p=C.p||0,V=C.b||0,S=C.l,W=C.d,h=C.m,y=C.n,f=8*I;do{if(!S){Z=M(a,p,1);var X=M(a,p+1,3);if(p+=3,!X){var B=P(p)+4,T=a[B-4]|a[B-3]<<8,l=B+T;if(l>I){A&&q(0);break}m&&u(V+T),o.set(a.subarray(B,l),V),C.b=V+=T,C.p=p=8*l,C.f=Z;continue}else if(1==X)S=U,W=Q,h=9,y=5;else if(2==X){var t=M(a,p,31)+257,Y=M(a,p+10,15)+4,O=t+M(a,p+5,31)+1;p+=14;for(var E=new G(O),K=new G(19),L=0;L>>4;if(16>B)E[L++]=B;else{var x=0,_=0;for(16==B?(_=3+M(a,p,3),p+=2,x=E[L-1]):17==B?(_=3+M(a,p,7),p+=3):18==B&&(_=11+M(a,p,127),p+=7);_--;)E[L++]=x}}var $=E.subarray(0,t),ee=E.subarray(t);h=j($),y=j(ee),S=v($,h,1),W=v(ee,y,1)}else q(1);if(p>f){A&&q(0);break}}m&&u(V+131072);for(var ne=(1<>>4;if(p+=15&x,p>f){A&&q(0);break}if(x||q(2),256>ge)o[V++]=ge;else if(256==ge){ae=p,S=null;break}else{var te=ge-254;if(264>>4;le||q(3),p+=15≤var ee=N[d];if(3f){A&&q(0);break}m&&u(V+131072);for(var se=V+te;V>>8},ne=function(e,n,i){i<<=7&n;var a=0|n/8;e[a]|=i,e[a+1]|=i>>>8,e[a+2]|=i>>>16},ie=function(e,n){for(var a=[],g=0;gA&&(A=o[g].s);var u=new h(A+1),Z=ae(a[I-1],u,0);if(Z>n){var g=0,b=0,p=Z-n;for(o.sort(function(e,n){return u[n.s]-u[e.s]||e.f-n.f});gn)b+=(1<>>=p;0>>8,e[t+2]=255^e[t],e[t+3]=255^e[t+1];for(var o=0;oz;++z){x=P[z];for(var _,X=0;X>>5),C+=x[X]>>>12)}}else U=J,Q=L,j=D,M=F;for(var X=0;X>>18;ne(n,C,U[_+257]),C+=Q[_+257],7<_&&(ee(n,C,31&g[X]>>>23),C+=k[_]);var q=31&g[X];ne(n,C,j[q]),C+=M[q],3>>5),C+=w[q])}else ne(n,C,U[g[X]]),C+=Q[g[X]];return ne(n,C,U[256]),C+Q[256]},se=new y([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),de=new G(0),ce=function(g,t,c,C,r,I){var m=g.length,s=new G(C+m+5*(1+a(m/7e3))+r),o=s.subarray(C,s.length-r),A=0;if(!t||8>m)for(var u,Z=0;Z<=m;Z+=65535)u=Z+65535,uD;++D)X[D]=0;for(var D=0;30>D;++D)T[D]=0}var Q=2,M=0,H=8191&b,x=32767&F-J;if(2>>13,U)-1,q=n(32767,Z),$=n(258,U);x<=q&&--H&&F!=J;){if(g[Z+Q]==g[Z+Q-x]){for(var ee=0;ee<$&&g[Z+ee]==g[Z+ee-x];++ee);if(ee>Q){if(Q=ee,M=x,ee>_)break;for(var ne=n(x,ee-2),ie=0,D=0;Die&&(ie=te,J=ae)}}}F=J,J=V[F],x+=32767&F-J+32768}if(M){f[v++]=268435456|B[Q]<<18|O[M];var ce=31&B[Q],Ce=31&O[M];N+=k[ce]+w[Ce],++X[257+ce],++T[Ce],E=Z+Q,++Y}else f[v++]=g[Z],++X[g[Z]]}}A=le(g,o,I,f,X,T,N,v,K,Z-K,A),!I&&7&A&&(A=oe(o,A+1,de))}return z(s,0,C+P(A)+r)},Ce=function(){var g=1,t=0;return{p:function(a){for(var o,s=g,d=t,c=0|a.length,l=0;l!=c;){for(o=n(l+2655,c);l>16),d=(65535&d)+15*(d>>16)}g=s,t=d},d:function(){return g%=65521,t%=65521,(255&g)<<24|g>>>8<<16|(255&t)<<8|t>>>8}}},re=function(e,i,t,o,l){return ce(e,null==i.level?6:i.level,null==i.mem?a(1.5*g(8,n(13,Math.log(e.length)))):12+i.mem,t,o,!l)},Ie=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},me=function(e,n){var i=n.level,a=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},Ae=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&q(6,"invalid zlib data"),32&e[1]&&q(6,"invalid zlib data: preset dictionaries not supported")},ue="undefined"!=typeof TextDecoder&&new TextDecoder,Ze=0;try{ue.decode(de,{stream:!0}),Ze=1}catch(n){}class be extends Error{}class pe{constructor(e,n,i,a,g,t){this.role=n,this.channelId=i,this.metadata=a,this.signalingUrlCandidates=e,this.options=g,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=t,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},messaging:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const a={type:"disconnect",reason:e};this.ws.send(JSON.stringify(a)),this.writeWebSocketSignalingLog("send-disconnect",a),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const a=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),g=[];for(const t of Object.keys(this.dataChannels)){const i=this.dataChannels[t];if(i){i.onerror=()=>(clearTimeout(a),e(),n({code:4999,reason:""}));g.push((()=>new Promise(e=>{let n=0;const a=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(a),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(a))},100)}))())}}Promise.all(g).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(a)});const t={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=new TextEncoder().encode(JSON.stringify(t)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new W,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){return new Promise((n,i)=>{const a=new WebSocket(e);a.onclose=e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),i(n)},a.onopen=()=>{n(a)}})}if(Array.isArray(e)){let n=!1;const i=e=>new Promise((i,a)=>{const g=new WebSocket(e),t=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:g.url}),g&&!n&&(g.onclose=null,g.onerror=null,g.onopen=null,g.close(),a())},this.signalingCandidateTimeout);g.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:g.url,message:`WebSocket closed`,code:e.code,reason:e.reason}),g&&g.close(),clearInterval(t),a()},g.onerror=()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:g.url,message:`Failed to connect WebSocket`}),g&&(g.onclose=null,g.close()),clearInterval(t),a()},g.onopen=()=>{g&&(clearInterval(t),n?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:g.url,selected:!1}),g.onerror=null,g.onclose=null,g.onopen=null,g.close(),a()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:g.url,selected:!0}),g.onerror=null,g.onclose=null,g.onopen=null,n=!0,i(g)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(n){throw new be("Signaling failed. All signaling URL candidates failed to connect")}}throw new be("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,n=!1){const i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((a,g)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),g(n)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const n=JSON.parse(e.data);if("offer"==n.type)this.writeWebSocketSignalingLog("onmessage-offer",n),this.signalingOnMessageTypeOffer(n),a(n);else if("update"==n.type)this.writeWebSocketSignalingLog("onmessage-update",n),await this.signalingOnMessageTypeUpdate(n);else if("re-offer"==n.type)this.writeWebSocketSignalingLog("onmessage-re-offer",n),await this.signalingOnMessageTypeReOffer(n);else if("ping"==n.type)await this.signalingOnMessageTypePing(n);else if("push"==n.type)this.callbacks.push(n,"websocket");else if("notify"==n.type)"connection.created"===n.event_type?this.writeWebSocketTimelineLog("notify-connection.created",n):"connection.destroyed"===n.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",n),this.signalingOnMessageTypeNotify(n,"websocket");else if("switched"==n.type)this.writeWebSocketSignalingLog("onmessage-switched",n),this.signalingOnMessageTypeSwitched(n);else if("redirect"==n.type){this.writeWebSocketSignalingLog("onmessage-redirect",n);const e=await this.signalingOnMessageTypeRedirect(n);a(e)}},(async()=>{let a;try{a=I(i.sdp||"",this.role,this.channelId,this.metadata,this.options,n)}catch(e){return void g(e)}if(a.e2ee&&this.e2ee){const e=await this.e2ee.init();a.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",a),e&&(e.send(JSON.stringify(a)),this.writeWebSocketSignalingLog(`send-${a.type}`,a),this.ws=e)})()})}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendSignalingMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new be(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&Z(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(b(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(b(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=V(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const a=V(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(a)}writePeerConnectionTimelineLog(e,n){const i=V(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=V(e,n,"sora");this.callbacks.timeline(i)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(r()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.signalingOfferMessageDataChannels[n.label]=n;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=m(e),a=u(i);if(a&&this.e2ee&&n){const e=this.e2ee.startSession(n,a);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=A(e);i.forEach(e=>{const n=m(e),i=u(n),a=e.connection_id;a&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(a,i)})}else if("connection.destroyed"===e.event_type){const n=m(e),i=u(n),a=e.connection_id;if(i&&this.e2ee&&a){const e=this.e2ee.stopSession(a);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(a)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const n=await this.getSignalingWebSocket(e.location),i=await this.signaling(n,!0);return i}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,p(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${a.type}`,n,a),"re-offer"===a.type&&(await this.signalingOnMessageTypeReOffer(a))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let n=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const n=e.target;let i=e.data;const a=this.signalingOfferMessageDataChannels[n.label];if(a!==void 0&&!0===a.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const g=JSON.parse(i);this.callbacks.messaging(S(n.label,g))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const a=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new a(e,n,i)}sendMessage(e,n){const i=this.dataChannels[e];if(null!==this.pc){if(void 0===i)throw new Error("Could not find DataChannel");const a=this.signalingOfferMessageDataChannels[e];if(void 0!==a&&!0===a.compress){const e=new TextEncoder().encode(JSON.stringify(n)),a=o(e,{});i.send(a)}else i.send(JSON.stringify(n))}}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter(e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e)),n=[];for(const i of e){const e=this.dataChannels[i];if(!e)continue;const a=this.signalingOfferMessageDataChannels[i];if(!a)continue;const g={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:a.compress,direction:a.direction};"number"==typeof e.maxPacketLifeTime&&(g.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(g.maxRetransmits=e.maxRetransmits),n.push(g)}return n}}class Ve extends pe{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class Se extends pe{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,a){n+=i.decode(a);const t=n.lastIndexOf("\n");return-1!=t&&(console.log(n.substr(0,t)),n=n.substr(t+1)),a.length},write(i,a,t,g,o,l){if(0!==t||g!==a.length||null!==o)return void l(e());const s=this.writeSync(i,a);l(null,s)},chmod(n,i,a){a(e())},chown(n,i,a,t){t(e())},close(n,i){i(e())},fchmod(n,i,a){a(e())},fchown(n,i,a,t){t(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,a){a(e())},lchown(n,i,a,t){t(e())},link(n,i,a){a(e())},lstat(n,i){i(e())},mkdir(n,i,a){a(e())},open(n,i,a,t){t(e())},read(n,i,a,t,g,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,a){a(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,a){a(e())},truncate(n,i,a){a(e())},unlink(n,i){i(e())},utimes(n,i,a,t){t(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},t=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},g=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let a=0;switch(typeof n){case"object":null!==n&&(a=1);break;case"string":a=2;break;case"symbol":a=3;break;case"function":a=4;}this.mem.setUint32(e+4,2146959360|a,!0),this.mem.setUint32(e,i,!0)},l=e=>{const n=t(e+0),i=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},s=e=>{const n=t(e+0),o=t(e+8),l=Array(o);for(let a=0;a{const n=t(e+0),a=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=t(e+8),a=t(e+16),g=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,g))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(c+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},t(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,d(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(g(e+8),d(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(g(e+8),d(e+16),g(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(g(e+8),d(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(g(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(g(e+8),t(e+16),g(e+24))},"syscall/js.valueCall":e=>{try{const n=g(e+8),i=Reflect.get(n,d(e+16)),a=s(e+32),t=Reflect.apply(i,n,a);e=this._inst.exports.getsp(),o(e+56,t),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=g(e+8),i=s(e+16),a=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=g(e+8),i=s(e+16),a=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(g(n+8).length))},"syscall/js.valuePrepareString":i=>{const a=n.encode(g(i+8)+"");o(i+16,a),e(i+24,a.length)},"syscall/js.valueLoadString":e=>{const n=g(e+8);l(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,g(e+8)instanceof g(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=l(n+8),a=g(n+32);if(!(a instanceof Uint8Array||a instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=g(n+8),a=l(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const a=e=>{const a=i,t=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,0!=i%8&&(i+=8-i%8),a},t=this.argv.length,g=[];this.argv.forEach(e=>{g.push(a(e))}),g.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{g.push(a(`${e}=${this.env[e]}`))}),g.push(0);const l=i;g.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(t,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=Ce();i.p(e);var a=re(e,n,2,4);return me(a,n),Ie(a,a.length-4,i.d()),a}function l(e,n){return $((Ae(e),e.subarray(2,-4)),n)}function s(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function d(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function c(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const n=e,i={};return"string"==typeof n.label&&(i.label=n.label),"string"==typeof n.direction&&(i.direction=n.direction),"boolean"==typeof n.ordered&&(i.ordered=n.ordered),"boolean"==typeof n.compress&&(i.compress=n.compress),"number"==typeof n.maxPacketLifeTime&&(i.max_packet_life_time=n.maxPacketLifeTime),"number"==typeof n.maxRetransmits&&(i.max_retransmits=n.maxRetransmits),"string"==typeof n.protocol&&(i.protocol=n.protocol),i}function C(e){const n=[];for(const i of e)n.push(c(i));return n}function r(){return"safari"===s()}function I(e,n,i,a,t,g){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.3",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==a&&(o.metadata=a),g&&(o.redirect=!0),"signalingNotifyMetadata"in t&&(o.signaling_notify_metadata=t.signalingNotifyMetadata),"multistream"in t&&!0===t.multistream&&(o.multistream=!0,"spotlight"in t&&(o.spotlight=t.spotlight,"spotlightNumber"in t&&(o.spotlight_number=t.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==t.spotlightFocusRid&&0<=e.indexOf(t.spotlightFocusRid)&&(o.spotlight_focus_rid=t.spotlightFocusRid),void 0!==t.spotlightUnfocusRid&&0<=e.indexOf(t.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=t.spotlightUnfocusRid)}if("simulcast"in t||"simulcastRid"in t){"simulcast"in t&&!0===t.simulcast&&(o.simulcast=!0);void 0!==t.simulcastRid&&0<=["r0","r1","r2"].indexOf(t.simulcastRid)&&(o.simulcast_rid=t.simulcastRid)}"clientId"in t&&void 0!==t.clientId&&(o.client_id=t.clientId),"dataChannelSignaling"in t&&"boolean"==typeof t.dataChannelSignaling&&(o.data_channel_signaling=t.dataChannelSignaling),"ignoreDisconnectWebSocket"in t&&"boolean"==typeof t.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=t.ignoreDisconnectWebSocket);const l=["audioCodecType","audioBitRate"],s=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},t);Object.keys(r).forEach(e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=s.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]}),void 0!==r.audio&&(o.audio=r.audio);const I=Object.keys(r).some(e=>0<=l.indexOf(e));o.audio&&I&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const m=Object.keys(r).some(e=>0<=s.indexOf(e));o.audio&&m&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const A=Object.keys(r).some(e=>0<=c.indexOf(e));if(o.video&&A&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!d()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===t.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(t.dataChannels)&&0{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),a(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let t="";window.performance&&(t="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(t=t+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(t+" "+n),a(i),console.groupEnd()):console.log(t+" "+n+"\n",i)}function b(e,n,i){const a=new Event(e);try{a.data=JSON.parse(JSON.stringify(n))}catch(e){a.data=n}return a.transportType=i,a}function p(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function V(e,n,i,a,t){const g=new Event(e);try{g.data=JSON.parse(JSON.stringify(n))}catch(e){g.data=n}return g.logType=i,g.dataChannelId=a,g.dataChannelLabel=t,g}function S(e,n){const i=new Event("message");return i.label=e,i.data=n,i}class W{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCd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bigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:a},[i,a])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:a},[i,a])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,a=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:a})}startSession(e,n){const[i,a]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(a)throw a;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(g(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.2.0-canary.3"}static wasmVersion(){return window.e2ee.version()}}var G=Uint8Array,h=Uint16Array,y=Uint32Array,k=new G([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),w=new G([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),R=new G([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(e,n){for(var a=new h(31),t=0;31>t;++t)a[t]=n+=1<t;++t)for(var o=a[t];ov;++v)B=(43690&v)>>>1|(21845&v)<<1,B=(52428&B)>>>2|(13107&B)<<2,B=(61680&B)>>>4|(3855&B)<<4,E[v]=((65280&B)>>>8|(255&B)<<8)>>>1;for(var K=function(e,n,a){for(var t=e.length,g=0,o=new h(n);g>>15-n]=d}else for(s=new h(t),g=0;g>>15-e[g]);return s},L=new G(288),v=0;144>v;++v)L[v]=8;for(var v=144;256>v;++v)L[v]=9;for(var v=256;280>v;++v)L[v]=7;for(var v=280;288>v;++v)L[v]=8;for(var F=new G(32),v=0;32>v;++v)F[v]=5;var J=K(L,9,0),U=K(L,9,1),D=K(F,5,0),Q=K(F,5,1),j=function(e){for(var n=e[0],a=1;an&&(n=e[a]);return n},M=function(e,n,i){var a=0|n/8;return(e[a]|e[a+1]<<8)>>(7&n)&i},H=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},P=function(e){return 0|(e+7)/8},z=function(i,a,t){(null==a||0>a)&&(a=0),(null==t||t>i.length)&&(t=i.length);var g=new(i instanceof h?h:i instanceof y?y:G)(t-a);return g.set(i.subarray(a,t)),g},_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],q=function(n,i,a){var t=new Error(i||_[n]);if(t.code=n,Error.captureStackTrace&&Error.captureStackTrace(t,q),!a)throw t;return t},$=function(a,g,o){var C=a.length;if(!C||o&&o.f&&!o.l)return g||new G(0);var I=!g||o,m=!o||o.i;o||(o={}),g||(g=new G(3*C));var A=function(e){var n=g.length;if(e>n){var i=new G(t(2*n,e));i.set(g),g=i}},u=o.f||0,Z=o.p||0,p=o.b||0,V=o.l,S=o.d,W=o.m,h=o.n,y=8*C;do{if(!V){u=M(a,Z,1);var f=M(a,Z+1,3);if(Z+=3,!f){var X=P(Z)+4,T=a[X-4]|a[X-3]<<8,l=X+T;if(l>C){m&&q(0);break}I&&A(p+T),g.set(a.subarray(X,l),p),o.b=p+=T,o.p=Z=8*l,o.f=u;continue}else if(1==f)V=U,S=Q,W=9,h=5;else if(2==f){var B=M(a,Z,31)+257,Y=M(a,Z+10,15)+4,O=B+M(a,Z+5,31)+1;Z+=14;for(var E=new G(O),v=new G(19),L=0;L>>4;if(16>X)E[L++]=X;else{var x=0,_=0;for(16==X?(_=3+M(a,Z,3),Z+=2,x=E[L-1]):17==X?(_=3+M(a,Z,7),Z+=3):18==X&&(_=11+M(a,Z,127),Z+=7);_--;)E[L++]=x}}var $=E.subarray(0,B),ee=E.subarray(B);W=j($),h=j(ee),V=K($,W,1),S=K(ee,h,1)}else q(1);if(Z>y){m&&q(0);break}}I&&A(p+131072);for(var ne=(1<>>4;if(Z+=15&x,Z>y){m&&q(0);break}if(x||q(2),256>te)g[p++]=te;else if(256==te){ae=Z,V=null;break}else{var ge=te-254;if(264>>4;le||q(3),Z+=15≤var ee=N[d];if(3y){m&&q(0);break}I&&A(p+131072);for(var se=p+ge;p>>8},ne=function(e,n,i){i<<=7&n;var a=0|n/8;e[a]|=i,e[a+1]|=i>>>8,e[a+2]|=i>>>16},ie=function(e,n){for(var a=[],t=0;tA&&(A=o[t].s);var u=new h(A+1),Z=ae(a[I-1],u,0);if(Z>n){var t=0,b=0,p=Z-n;for(o.sort(function(e,n){return u[n.s]-u[e.s]||e.f-n.f});tn)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var _,X=0;X>>5),C+=x[X]>>>12)}}else U=J,Q=L,j=D,M=F;for(var X=0;X>>18;ne(n,C,U[_+257]),C+=Q[_+257],7<_&&(ee(n,C,31&t[X]>>>23),C+=k[_]);var q=31&t[X];ne(n,C,j[q]),C+=M[q],3>>5),C+=w[q])}else ne(n,C,U[t[X]]),C+=Q[t[X]];return ne(n,C,U[256]),C+Q[256]},se=new y([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),de=new G(0),ce=function(t,g,c,C,r,I){var m=t.length,s=new G(C+m+5*(1+a(m/7e3))+r),o=s.subarray(C,s.length-r),A=0;if(!g||8>m)for(var u,Z=0;Z<=m;Z+=65535)u=Z+65535,uD;++D)X[D]=0;for(var D=0;30>D;++D)B[D]=0}var Q=2,M=0,H=8191&b,x=32767&F-J;if(2>>13,U)-1,q=n(32767,Z),$=n(258,U);x<=q&&--H&&F!=J;){if(t[Z+Q]==t[Z+Q-x]){for(var ee=0;ee<$&&t[Z+ee]==t[Z+ee-x];++ee);if(ee>Q){if(Q=ee,M=x,ee>_)break;for(var ne=n(x,ee-2),ie=0,D=0;Die&&(ie=ge,J=ae)}}}F=J,J=V[F],x+=32767&F-J+32768}if(M){f[E++]=268435456|T[Q]<<18|O[M];var ce=31&T[Q],Ce=31&O[M];N+=k[ce]+w[Ce],++X[257+ce],++B[Ce],v=Z+Q,++Y}else f[E++]=t[Z],++X[t[Z]]}}A=le(t,o,I,f,X,B,N,E,K,Z-K,A),!I&&7&A&&(A=oe(o,A+1,de))}return z(s,0,C+P(A)+r)},Ce=function(){var t=1,g=0;return{p:function(a){for(var o,s=t,d=g,c=0|a.length,l=0;l!=c;){for(o=n(l+2655,c);l>16),d=(65535&d)+15*(d>>16)}t=s,g=d},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},re=function(e,i,g,o,l){return ce(e,null==i.level?6:i.level,null==i.mem?a(1.5*t(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!l)},Ie=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},me=function(e,n){var i=n.level,a=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},Ae=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&q(6,"invalid zlib data"),32&e[1]&&q(6,"invalid zlib data: preset dictionaries not supported")},ue="undefined"!=typeof TextDecoder&&new TextDecoder,Ze=0;try{ue.decode(de,{stream:!0}),Ze=1}catch(n){}class be extends Error{}class pe{constructor(e,n,i,a,t,g){this.role=n,this.channelId=i,this.metadata=a,this.signalingUrlCandidates=e,this.options=t,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const a={type:"disconnect",reason:e};this.ws.send(JSON.stringify(a)),this.writeWebSocketSignalingLog("send-disconnect",a),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const a=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),t=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(a),e(),n({code:4999,reason:""}));t.push((()=>new Promise(e=>{let n=0;const a=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(a),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(a))},100)}))())}}Promise.all(t).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(a)});const g={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null,n.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)})}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new W,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){return new Promise((n,i)=>{const a=new WebSocket(e);a.onclose=e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),i(n)},a.onopen=()=>{n(a)}})}if(Array.isArray(e)){let n=!1;const i=e=>new Promise((i,a)=>{const t=new WebSocket(e),g=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:t.url}),t&&!n&&(t.onclose=null,t.onerror=null,t.onopen=null,t.close(),a())},this.signalingCandidateTimeout);t.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:t.url,message:`WebSocket closed`,code:e.code,reason:e.reason}),t&&t.close(),clearInterval(g),a()},t.onerror=()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:t.url,message:`Failed to connect WebSocket`}),t&&(t.onclose=null,t.close()),clearInterval(g),a()},t.onopen=()=>{t&&(clearInterval(g),n?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!1}),t.onerror=null,t.onclose=null,t.onopen=null,t.close(),a()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!0}),t.onerror=null,t.onclose=null,t.onopen=null,n=!0,i(t)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(n){throw new be("Signaling failed. All signaling URL candidates failed to connect")}}throw new be("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,n=!1){const i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((a,t)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const n=JSON.parse(e.data);if("offer"==n.type)this.writeWebSocketSignalingLog("onmessage-offer",n),this.signalingOnMessageTypeOffer(n),a(n);else if("update"==n.type)this.writeWebSocketSignalingLog("onmessage-update",n),await this.signalingOnMessageTypeUpdate(n);else if("re-offer"==n.type)this.writeWebSocketSignalingLog("onmessage-re-offer",n),await this.signalingOnMessageTypeReOffer(n);else if("ping"==n.type)await this.signalingOnMessageTypePing(n);else if("push"==n.type)this.callbacks.push(n,"websocket");else if("notify"==n.type)"connection.created"===n.event_type?this.writeWebSocketTimelineLog("notify-connection.created",n):"connection.destroyed"===n.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",n),this.signalingOnMessageTypeNotify(n,"websocket");else if("switched"==n.type)this.writeWebSocketSignalingLog("onmessage-switched",n),this.signalingOnMessageTypeSwitched(n);else if("redirect"==n.type){this.writeWebSocketSignalingLog("onmessage-redirect",n);const e=await this.signalingOnMessageTypeRedirect(n);a(e)}},(async()=>{let a;try{a=I(i.sdp||"",this.role,this.channelId,this.metadata,this.options,n)}catch(e){return void t(e)}if(a.e2ee&&this.e2ee){const e=await this.e2ee.init();a.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",a),e&&(e.send(JSON.stringify(a)),this.writeWebSocketSignalingLog(`send-${a.type}`,a),this.ws=e)})()})}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendSignalingMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new be(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&Z(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(b(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(b(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=V(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const a=V(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(a)}writePeerConnectionTimelineLog(e,n){const i=V(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=V(e,n,"sora");this.callbacks.timeline(i)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(r()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.signalingOfferMessageDataChannels[n.label]=n;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=m(e),a=u(i);if(a&&this.e2ee&&n){const e=this.e2ee.startSession(n,a);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=A(e);i.forEach(e=>{const n=m(e),i=u(n),a=e.connection_id;a&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(a,i)})}else if("connection.destroyed"===e.event_type){const n=m(e),i=u(n),a=e.connection_id;if(i&&this.e2ee&&a){const e=this.e2ee.stopSession(a);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(a)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const n=await this.getSignalingWebSocket(e.location),i=await this.signaling(n,!0);return i}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,p(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${a.type}`,n,a),"re-offer"===a.type&&(await this.signalingOnMessageTypeReOffer(a))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let n=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const n=e.target;let i=e.data;const a=this.signalingOfferMessageDataChannels[n.label];if(a!==void 0&&!0===a.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const t=JSON.parse(i);this.callbacks.message(S(n.label,t))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const a=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new a(e,n,i)}sendMessage(e,n){const i=this.dataChannels[e];if(null!==this.pc){if(void 0===i)throw new Error("Could not find DataChannel");const a=this.signalingOfferMessageDataChannels[e];if(void 0!==a&&!0===a.compress){const e=new TextEncoder().encode(JSON.stringify(n)),a=o(e,{});i.send(a)}else i.send(JSON.stringify(n))}}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter(e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e)),n=[];for(const i of e){const e=this.dataChannels[i];if(!e)continue;const a=this.signalingOfferMessageDataChannels[i];if(!a)continue;const t={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:a.compress,direction:a.direction};"number"==typeof e.maxPacketLifeTime&&(t.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(t.maxRetransmits=e.maxRetransmits),n.push(t)}return n}}class Ve extends pe{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class Se extends pe{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.2.0-canary.2\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY29uc3QgcGFkZGluZ0xlbmd0aCA9IFVpbnQzMkFycmF5LkJZVEVTX1BFUl9FTEVNRU5UIC0gZGF0YVZpZXcuYnl0ZUxlbmd0aDsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGFkZGluZ0xlbmd0aDsgaSArPSAxKSB7CiAgICAgICAgbmV3RGF0YVZpZXcuc2V0VWludDgoaSwgMCk7CiAgICB9CiAgICBmb3IgKGxldCBpID0gcGFkZGluZ0x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W5jcnlwdGVkQnl0ZXNbZW5jb2RlZEZyYW1lLnR5cGVdKSk7CiAgICAgICAgY29uc3Qgc2ZyYW1lSGVhZGVyID0gbmV3IFVpbnQ4QXJyYXkoc2ZyYW1lSGVhZGVyQnVmZmVyKTsKICAgICAgICBjb25zdCBjb25uZWN0aW9uSWQgPSB0ZXh0RGVjb2Rlci5kZWNvZGUoY29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4Q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bGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWw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TdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.2.0-canary.2\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAAX,CACNA,MAAM,CAACD,MAAP,CAAgBC,MADV,KAEA,IAAoB,WAAhB,QAAOC,CAAAA,IAAX,CACNA,IAAI,CAACF,MAAL,CAAcE,IADR,KAGN,MAAM,IAAIC,CAAAA,KAAJ,CAAU,+DAAV,CAAN,CAOD,GAJKH,MAAM,CAACI,OAAR,EAAsC,WAAnB,QAAOA,CAAAA,OAI9B,GAHCJ,MAAM,CAACI,OAAP,CAAiBA,OAGlB,EAAI,CAACJ,MAAM,CAACK,EAAR,EAAcL,MAAM,CAACI,OAAzB,CAAkC,CACjC,KAAMC,CAAAA,CAAE,CAAGD,OAAO,CAAC,IAAD,CAAlB,CACwB,CAApB,GAAAE,MAAM,CAACC,IAAP,CAAYF,CAAZ,CAF6B,GAGhCL,MAAM,CAACK,EAAP,CAAYA,CAHoB,CAKjC,CAED,KAAMG,CAAAA,CAAM,CAAG,IAAM,CACpB,KAAMC,CAAA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,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file +{"version":3,"file":"sora.min.js","sources":["../packages/sdk/node_modules/fflate/esm/browser.js","../packages/go-wasm/src/wasm_exec.js","../packages/e2ee/dist/sora_e2ee.mjs"],"sourcesContent":["// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([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, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([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, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.2.0-canary.3\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2j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ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.2.0-canary.3\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAA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,CAAE,CAAS,CAAN,EAAAwJ,CAAE,CAAQ,CAAR,CAAiB,CAAL,CAAAA,CAAE,CAAO,CAAP,CAAiB,CAAN,EAAAA,CAAE,CAAQ,CAAR,CAAY,CAAhE,CACAhG,CAAC,CAAC,CAAD,CAAD,CAAO,GAAP,CAAYA,CAAC,CAAC,CAAD,CAAD,CAAQxD,CAAE,EAAI,CAAP,EAAaA,CAAE,CAAI,GAAK,EAAIA,CAAb,CAAmB,CAAlC,CACtB,EAEG5E,EAAG,CAAG,SAAUP,CAAV,CAAa,EACA,CAAf,GAAQ,EAAP,CAAAA,CAAC,CAAC,CAAD,CAAF,GAAmC,CAAf,CAACA,CAAC,CAAC,CAAD,CAAD,GAAS,CAA9B,EAAyC,CAACA,CAAC,CAAC,CAAD,CAAD,EAAQ,CAAR,CAAYA,CAAC,CAAC,CAAD,CAAd,EAAqB,EAD/C,GAEfhN,CAAG,CAAC,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file diff --git a/dist/sora.mjs b/dist/sora.mjs index 0d193ff2..5c11899f 100644 --- a/dist/sora.mjs +++ b/dist/sora.mjs @@ -1,7 +1,7 @@ /** * @sora/sdk - * undefined - * @version: 2021.2.0-canary.2 + * WebRTC SFU Sora JavaScript SDK + * @version: 2021.2.0-canary.3 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -598,7 +598,7 @@ function WasmExec () { /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.2.0-canary.2 + * @version: 2021.2.0-canary.3 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -766,7 +766,7 @@ class SoraE2EE { } } static version() { - return "2021.2.0-canary.2"; + return "2021.2.0-canary.3"; } static wasmVersion() { return window.e2ee.version(); @@ -1581,39 +1581,39 @@ function enabledSimulcast() { const hasAllRequiredHeaderExtensions = REQUIRED_HEADER_EXTEMSIONS.every((h) => headerExtensions.includes(h)); return hasAllRequiredHeaderExtensions; } -function parseMessagingDataChannel(params) { - if (typeof params !== "object" || params === null) { - throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'"); +function parseDataChannelConfiguration(dataChannelConfiguration) { + if (typeof dataChannelConfiguration !== "object" || dataChannelConfiguration === null) { + throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'"); } - const messagingDataChannel = params; + const configuration = dataChannelConfiguration; const result = {}; - if (typeof messagingDataChannel.label === "string") { - result.label = messagingDataChannel.label; + if (typeof configuration.label === "string") { + result.label = configuration.label; } - if (typeof messagingDataChannel.direction === "string") { - result.direction = messagingDataChannel.direction; + if (typeof configuration.direction === "string") { + result.direction = configuration.direction; } - if (typeof messagingDataChannel.ordered === "boolean") { - result.ordered = messagingDataChannel.ordered; + if (typeof configuration.ordered === "boolean") { + result.ordered = configuration.ordered; } - if (typeof messagingDataChannel.compress === "boolean") { - result.compress = messagingDataChannel.compress; + if (typeof configuration.compress === "boolean") { + result.compress = configuration.compress; } - if (typeof messagingDataChannel.maxPacketLifeTime === "number") { - result.max_packet_life_time = messagingDataChannel.maxPacketLifeTime; + if (typeof configuration.maxPacketLifeTime === "number") { + result.max_packet_life_time = configuration.maxPacketLifeTime; } - if (typeof messagingDataChannel.maxRetransmits === "number") { - result.max_retransmits = messagingDataChannel.maxRetransmits; + if (typeof configuration.maxRetransmits === "number") { + result.max_retransmits = configuration.maxRetransmits; } - if (typeof messagingDataChannel.protocol === "string") { - result.protocol = messagingDataChannel.protocol; + if (typeof configuration.protocol === "string") { + result.protocol = configuration.protocol; } return result; } -function parseMessagingDataChannels(messagingDataChannels) { +function parseDataChannelConfigurations(dataChannelConfigurations) { const result = []; - for (const messagingDataChannel of messagingDataChannels) { - result.push(parseMessagingDataChannel(messagingDataChannel)); + for (const dataChannelConfiguration of dataChannelConfigurations) { + result.push(parseDataChannelConfiguration(dataChannelConfiguration)); } return result; } @@ -1629,7 +1629,7 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options, re } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.2", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.3", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1803,8 +1803,8 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options, re } message.e2ee = true; } - if (Array.isArray(options.messagingDataChannels) && 0 < options.messagingDataChannels.length) { - message.data_channel_messaging = parseMessagingDataChannels(options.messagingDataChannels); + if (Array.isArray(options.dataChannels) && 0 < options.dataChannels.length) { + message.data_channels = parseDataChannelConfigurations(options.dataChannels); } return message; } @@ -1918,8 +1918,8 @@ function createTimelineEvent(eventType, data, logType, dataChannelId, dataChanne event.dataChannelLabel = dataChannelLabel; return event; } -function createMessagingEvent(label, data) { - const event = new Event("messaging"); +function createDataChannelMessageEvent(label, data) { + const event = new Event("message"); event.label = label; event.data = data; return event; @@ -1972,7 +1972,7 @@ class ConnectionBase { timeout: () => { }, timeline: () => { }, signaling: () => { }, - messaging: () => { }, + message: () => { }, }; this.authMetadata = null; this.e2ee = null; @@ -2448,6 +2448,12 @@ class ConnectionBase { const dataChannel = this.dataChannels[key]; if (dataChannel) { dataChannel.onmessage = null; + // onclose はログを吐く専用に残す + dataChannel.onclose = (event) => { + const channel = event.currentTarget; + this.writeDataChannelTimelineLog("onclose", channel); + this.trace("CLOSE DATA CHANNEL", channel.label); + }; } } let event = null; @@ -3290,7 +3296,7 @@ class ConnectionBase { data = new TextDecoder().decode(unzlibMessage); } const message = JSON.parse(data); - this.callbacks.messaging(createMessagingEvent(dataChannel.label, message)); + this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, message)); }; } } @@ -3774,7 +3780,7 @@ var sora = { return new SoraConnection(signalingUrlCandidates, debug); }, version: function () { - return "2021.2.0-canary.2"; + return "2021.2.0-canary.3"; }, helpers: { applyMediaStreamConstraints, diff --git a/dist/types.d.ts b/dist/types.d.ts index 8c00fabd..23e93443 100644 --- a/dist/types.d.ts +++ b/dist/types.d.ts @@ -28,9 +28,9 @@ export declare type SignalingVideo = boolean | { bit_rate?: number; }; export declare type Role = "sendrecv" | "sendonly" | "recvonly"; -export declare type SignalingConnectMessagingDataChannel = { +export declare type SignalingConnectDataChannel = { label?: string; - direction?: MessagingDataChannelDirection; + direction?: DataChannelDirection; compress?: boolean; max_packet_life_time?: number; max_retransmits?: number; @@ -60,12 +60,12 @@ export declare type SignalingConnectMessage = { data_channel_signaling?: boolean; ignore_disconnect_websocket?: boolean; redirect?: true; - data_channel_messaging?: SignalingConnectMessagingDataChannel[]; + data_channels?: SignalingConnectDataChannel[]; }; export declare type SignalingMessage = SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage | SignalingPingMessage | SignalingPushMessage | SignalingNotifyMessage | SignalingReqStatsMessage | SignalingSwitchedMessage | SignalingRedirectMessage; export declare type SignalingOfferMessageDataChannel = { label: string; - direction: MessagingDataChannelDirection; + direction: DataChannelDirection; compress: boolean; }; export declare type SignalingOfferMessage = { @@ -205,10 +205,10 @@ export declare type SignalingNotifyNetworkStatus = { event_type: "network.status"; unstable_level: 0 | 1 | 2 | 3; }; -export declare type MessagingDataChannelDirection = "sendonly" | "sendrecv" | "recvonly"; -export declare type MessagingDataChannel = { +export declare type DataChannelDirection = "sendonly" | "sendrecv" | "recvonly"; +export declare type DataChannelConfiguration = { label: string; - direction: MessagingDataChannelDirection; + direction: DataChannelDirection; compress?: boolean; maxPacketLifeTime?: number; maxRetransmits?: number; @@ -247,7 +247,7 @@ export declare type ConnectionOptions = { ignoreDisconnectWebSocket?: boolean; disconnectWaitTimeout?: number; signalingCandidateTimeout?: number; - messagingDataChannels?: MessagingDataChannel[]; + dataChannels?: DataChannelConfiguration[]; }; export declare type Callbacks = { disconnect: (event: SoraCloseEvent) => void; @@ -261,7 +261,7 @@ export declare type Callbacks = { timeout: () => void; timeline: (event: TimelineEvent) => void; signaling: (event: SignalingEvent) => void; - messaging: (event: MessagingEvent) => void; + message: (event: DataChannelMessageEvent) => void; }; export declare type PreKeyBundle = { identityKey: string; @@ -275,7 +275,7 @@ export interface SignalingEvent extends Event { transportType: TransportType; data?: any; } -export interface MessagingEvent extends Event { +export interface DataChannelMessageEvent extends Event { label: string; data: JSONType; } diff --git a/dist/utils.d.ts b/dist/utils.d.ts index b0edc647..fc7f70c3 100644 --- a/dist/utils.d.ts +++ b/dist/utils.d.ts @@ -1,4 +1,4 @@ -import { ConnectionOptions, JSONType, MessagingEvent, PreKeyBundle, SignalingConnectMessage, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, TimelineEvent, TimelineEventLogType, TransportType } from "./types"; +import { ConnectionOptions, JSONType, DataChannelMessageEvent, PreKeyBundle, SignalingConnectMessage, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, TimelineEvent, TimelineEventLogType, TransportType } from "./types"; export declare function isSafari(): boolean; export declare function isChrome(): boolean; export declare function createSignalingMessage(offerSDP: string, role: string, channelId: string | null | undefined, metadata: JSONType | undefined, options: ConnectionOptions, redirect: boolean): SignalingConnectMessage; @@ -13,4 +13,4 @@ export declare class ConnectError extends Error { export declare function createSignalingEvent(eventType: string, data: unknown, transportType: TransportType): SignalingEvent; export declare function createDataChannelData(channel: RTCDataChannel): Record; export declare function createTimelineEvent(eventType: string, data: unknown, logType: TimelineEventLogType, dataChannelId?: number | null, dataChannelLabel?: string): TimelineEvent; -export declare function createMessagingEvent(label: string, data: JSONType): MessagingEvent; +export declare function createDataChannelMessageEvent(label: string, data: JSONType): DataChannelMessageEvent; diff --git a/lerna.json b/lerna.json index e3c9d63a..ea8068ee 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": [ "packages/*" ], - "version": "2021.2.0-canary.2" + "version": "2021.2.0-canary.3" } diff --git a/package.json b/package.json index f577bf95..8ec97ab9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.2", + "version": "2021.2.0-canary.3", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", diff --git a/packages/e2ee/package.json b/packages/e2ee/package.json index 1b8861f8..a0892749 100644 --- a/packages/e2ee/package.json +++ b/packages/e2ee/package.json @@ -1,6 +1,6 @@ { "name": "@sora/e2ee", - "version": "2021.2.0-canary.2", + "version": "2021.2.0-canary.3", "description": "WebRTC SFU Sora JavaScript E2EE Library", "author": "Shiguredo Inc.", "license": "Apache-2.0", @@ -28,6 +28,6 @@ "typescript": "^4.4.3" }, "dependencies": { - "@sora/go-wasm": "^2021.2.0-canary.2" + "@sora/go-wasm": "^2021.2.0-canary.3" } } diff --git a/packages/go-wasm/package.json b/packages/go-wasm/package.json index 746430cc..e47a7d3c 100644 --- a/packages/go-wasm/package.json +++ b/packages/go-wasm/package.json @@ -1,6 +1,6 @@ { "name": "@sora/go-wasm", - "version": "2021.2.0-canary.2", + "version": "2021.2.0-canary.3", "main": "src/wasm_exec.js", "module": "src/wasm_exec.js", "types": "src/wasm_exec.d.ts", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 9d71e212..a7a716c1 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,7 +1,7 @@ { "name": "@sora/sdk", "description": "WebRTC SFU Sora JavaScript SDK", - "version": "2021.2.0-canary.2", + "version": "2021.2.0-canary.3", "author": "Shiguredo Inc.", "license": "Apache-2.0", "main": "dist/sora.min.js", @@ -36,7 +36,7 @@ "typescript": "^4.4.3" }, "dependencies": { - "@sora/e2ee": "^2021.2.0-canary.2", + "@sora/e2ee": "^2021.2.0-canary.3", "fflate": "^0.7.1" } } From 19e73863c5fa005d6aa759ea96ca787d17d4dc8a Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 22 Oct 2021 16:05:18 +0900 Subject: [PATCH 36/87] =?UTF-8?q?TSDoc=20=E7=94=A8=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 437 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 432 insertions(+), 5 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 6b9d2ce2..6173b367 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -45,38 +45,119 @@ declare global { } export default class ConnectionBase { + /** + * ロール(sendonly | sendrecv | recvonly). + */ role: string; + /** + * チャネルID. + */ channelId: string; + /** + * メタデータ. + */ metadata: JSONType | undefined; + /** + * シグナリングに使用する URL. + */ signalingUrlCandidates: string | string[]; + /** + * 接続オプション. + */ options: ConnectionOptions; + /** + * PeerConnection に渡す configuration. + */ // eslint-disable-next-line @typescript-eslint/no-explicit-any constraints: any; + /** + * デバッグフラグ. + */ debug: boolean; + /** + * クライアントID. + */ clientId: string | null; + /** + * コネクションID. + */ connectionId: string | null; + /** + * リモートコネクションIDのリスト. + */ remoteConnectionIds: string[]; + /** + * メディアストリーム. + */ stream: MediaStream | null; + /** + * type offer に含まれる認証 metadata. + */ authMetadata: JSONType; + /** + * PeerConnection インスタンス. + */ pc: RTCPeerConnection | null; + /** + * サイマルキャストで使用する RTCRtpEncodingParameters のリスト. + */ encodings: RTCRtpEncodingParameters[]; + /** + * WebSocket インスタンス. + */ protected ws: WebSocket | null; + /** + * イベントコールバックのリスト. + */ protected callbacks: Callbacks; + /** + * E2EE インスタンス. + */ protected e2ee: SoraE2EE | null; + /** + * 初回シグナリング時接続タイムアウト用のタイマーID. + */ protected connectionTimeoutTimerId: number; + /** + * WebSocket 切断監視用のタイマーID. + */ protected monitorSignalingWebSocketEventTimerId: number; + /** + * PeerConnection state 切断監視用のタイマーID. + */ protected monitorIceConnectionStateChangeTimerId: number; + /** + * 接続中の DataChannel リスト. + */ protected dataChannels: { [key in string]?: RTCDataChannel; }; + /** + * 初回シグナリング接続時のタイムアウトに使用するタイムアウト時間(デフォルト 60000ms) + */ private connectionTimeout: number; + /** + * シグナリング候補のURLへの接続確認タイムアウトに使用するタイムアウト時間(デフォルト 3000ms) + */ private signalingCandidateTimeout: number; + /** + * 切断処理のタイムアウトに使用するタイムアウト時間(デフォルト 3000ms) + */ private disconnectWaitTimeout: number; + /** + * audio / video の msid + */ private mids: { audio: string; video: string; }; + /** + * シグナリングを DataChannel へ switch したかどうかのフラグ + */ private signalingSwitched: boolean; + /** + * シグナリング type offer に含まれる DataChannel レコード + */ private signalingOfferMessageDataChannels: { [key in string]?: SignalingOfferMessageDataChannel; }; @@ -149,6 +230,18 @@ export default class ConnectionBase { this.signalingOfferMessageDataChannels = {}; } + /** + * SendRecv Object で発火するイベントのコールバックを設定するメソッド. + * + * @remarks + * addstream イベントは非推奨です.track イベントを使用してください. + * removestream イベントは非推奨です.removetrack イベントを使用してください. + * + * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message) + * @param callback - コールバック関数 + * + * @public + */ on(kind: T, callback: U): void { // @deprecated message if (kind === "addstream") { @@ -161,6 +254,16 @@ export default class ConnectionBase { } } + /** + * audio track を停止するメソッド. + * + * @remarks + * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します. + * + * @param stream - audio track を削除する MediaStream + * + * @public + */ stopAudioTrack(stream: MediaStream): Promise { for (const track of stream.getAudioTracks()) { track.enabled = false; @@ -185,6 +288,16 @@ export default class ConnectionBase { }); } + /** + * video track を停止するメソッド. + * + * @remarks + * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します. + * + * @param stream - video track を削除する MediaStream + * + * @public + */ stopVideoTrack(stream: MediaStream): Promise { for (const track of stream.getVideoTracks()) { track.enabled = false; @@ -209,6 +322,17 @@ export default class ConnectionBase { }); } + /** + * audio track を入れ替えするメソッド. + * + * @remarks + * stream の audio track を停止後、新しい audio track をセットします. + * + * @param stream - audio track を削除する MediaStream + * @param audioTrack - 新しい audio track + * + * @public + */ async replaceAudioTrack(stream: MediaStream, audioTrack: MediaStreamTrack): Promise { await this.stopAudioTrack(stream); const transceiver = this.getAudioTransceiver(); @@ -219,6 +343,17 @@ export default class ConnectionBase { await transceiver.sender.replaceTrack(audioTrack); } + /** + * video track を入れ替えするメソッド. + * + * @remarks + * stream の video track を停止後、新しい video track をセットします. + * + * @param stream - video track を削除する MediaStream + * @param videoTrack - 新しい video track + * + * @public + */ async replaceVideoTrack(stream: MediaStream, videoTrack: MediaStreamTrack): Promise { await this.stopVideoTrack(stream); const transceiver = this.getVideoTransceiver(); @@ -229,6 +364,9 @@ export default class ConnectionBase { await transceiver.sender.replaceTrack(videoTrack); } + /** + * stream を停止するメソッド. + */ private stopStream(): Promise { return new Promise((resolve, _) => { if (this.debug) { @@ -248,7 +386,7 @@ export default class ConnectionBase { } /** - * connect 処理中に例外が発生した場合の切断処理 + * connect 処理中に例外が発生した場合の切断処理をするメソッド. */ private async signalingTerminate(): Promise { await this.stopStream(); @@ -273,7 +411,9 @@ export default class ConnectionBase { } /** - * PeerConnection の state に異常が発生した場合の切断処理 + * PeerConnection の state に異常が発生した場合の切断処理をするメソッド. + * + * @param title - disconnect callback に渡すイベントのタイトル */ private async abendPeerConnectionState(title: SoraAbendTitle): Promise { this.clearMonitorIceConnectionStateChange(); @@ -335,6 +475,9 @@ export default class ConnectionBase { /** * 何かしらの異常があった場合の切断処理 + * + * @param title - disconnect callback に渡すイベントのタイトル + * @param params - 切断時の状況を入れる Record */ private async abend(title: SoraAbendTitle, params?: Record): Promise { this.clearMonitorIceConnectionStateChange(); @@ -424,6 +567,9 @@ export default class ConnectionBase { this.callbacks.disconnect(this.soraCloseEvent("abend", title, params)); } + /** + * 接続状態の初期化をするメソッド. + */ private initializeConnection(): void { this.clientId = null; this.connectionId = null; @@ -444,6 +590,14 @@ export default class ConnectionBase { this.clearConnectionTimeout(); } + /** + * WebSocket を切断するメソッド. + * + * @remarks + * 正常/異常どちらの切断でも使用する. + * + * @param title - type disconnect 時の reason + */ private disconnectWebSocket(title: SoraAbendTitle | "NO-ERROR"): Promise<{ code: number; reason: string } | null> { let timerId = 0; if (this.signalingSwitched) { @@ -487,6 +641,12 @@ export default class ConnectionBase { }); } + /** + * DataChannel を切断するメソッド. + * + * @remarks + * 正常/異常どちらの切断でも使用する. + */ private disconnectDataChannel(): Promise<{ code: number; reason: string } | null> { // DataChannel の強制終了処理 const closeDataChannels = () => { @@ -590,6 +750,12 @@ export default class ConnectionBase { }); } + /** + * PeerConnection を切断するメソッド. + * + * @remarks + * 正常/異常どちらの切断でも使用する. + */ private disconnectPeerConnection(): Promise { return new Promise((resolve, _) => { if (this.pc && this.pc.connectionState !== "closed") { @@ -599,6 +765,11 @@ export default class ConnectionBase { }); } + /** + * 切断処理をするメソッド. + * + * @public + */ async disconnect(): Promise { this.clearMonitorIceConnectionStateChange(); await this.stopStream(); @@ -663,6 +834,9 @@ export default class ConnectionBase { } } + /** + * E2EE の初期設定をするメソッド. + */ protected setupE2EE(): void { if (this.options.e2ee === true) { this.e2ee = new SoraE2EE(); @@ -673,6 +847,9 @@ export default class ConnectionBase { } } + /** + * E2EE を開始するメソッド. + */ protected startE2EE(): void { if (this.options.e2ee === true && this.e2ee) { if (!this.connectionId) { @@ -686,6 +863,18 @@ export default class ConnectionBase { } } + /** + * シグナリングに使う WebSocket インスタンスを作成するメソッド. + * + * @remarks + * シグナリング候補の URL 一覧に順に接続します. + * 接続できた URL がない場合は例外が発生します. + * + * @param signalingUrlCandidates - シグナリング候補の URL. 後方互換のため string | string[] を受け取る + * + * @returns + * 接続できた WebScoket インスタンスを返します. + */ protected async getSignalingWebSocket(signalingUrlCandidates: string | string[]): Promise { if (typeof signalingUrlCandidates === "string") { // signaling url の候補が文字列の場合 @@ -792,6 +981,19 @@ export default class ConnectionBase { throw new ConnectError("Signaling failed. Invalid format signaling URL candidates"); } + /** + * シグナリング処理を行うメソッド. + * + * @remarks + * シグナリング候補の URL 一覧に順に接続します. + * 接続できた URL がない場合は例外が発生します. + * + * @param ws - WebSocket インスタンス + * @param redirect - クラスター接続時にリダイレクトされた場合のフラグ + * + * @returns + * Sora から受け取った type offer メッセージを返します. + */ protected async signaling(ws: WebSocket, redirect = false): Promise { const offer = await this.createOffer(); this.trace("CREATE OFFER", offer); @@ -878,6 +1080,11 @@ export default class ConnectionBase { }); } + /** + * PeerConnection 接続処理をするメソッド. + * + * @param message - シグナリング処理で受け取った type offer メッセージ + */ protected async connectPeerConnection(message: SignalingOfferMessage): Promise { let config = Object.assign({}, message.config); if (this.e2ee) { @@ -926,6 +1133,11 @@ export default class ConnectionBase { return; } + /** + * setRemoteDescription 処理を行うメソッド. + * + * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ + */ protected async setRemoteDescription( message: SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage ): Promise { @@ -938,6 +1150,14 @@ export default class ConnectionBase { return; } + /** + * createAnswer 処理を行うメソッド. + * + * @remarks + * サイマルキャスト用の setParameters 処理もここで行う. + * + * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ + */ protected async createAnswer( message: SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage ): Promise { @@ -982,6 +1202,9 @@ export default class ConnectionBase { return; } + /** + * シグナリングサーバーに type answer を投げるメソッド. + */ protected sendAnswer(): void { if (this.pc && this.ws && this.pc.localDescription) { this.trace("ANSWER SDP", this.pc.localDescription.sdp); @@ -992,6 +1215,9 @@ export default class ConnectionBase { return; } + /** + * iceCnadidate 処理をするメソッド. + */ protected onIceCandidate(): Promise { return new Promise((resolve, _) => { if (this.pc) { @@ -1027,6 +1253,12 @@ export default class ConnectionBase { }); } + /** + * connectionState が "connected" になるのを監視するメソッド. + * + * @remarks + * PeerConnection.connectionState が実装されていない場合は何もしない + */ protected waitChangeConnectionStateConnected(): Promise { return new Promise((resolve, reject) => { // connectionState が存在しない場合はそのまま抜ける @@ -1048,8 +1280,13 @@ export default class ConnectionBase { }); } + /** + * 初回シグナリング接続時の WebSocket の切断を監視するメソッド. + * + * @remarks + * 意図しない切断があった場合には異常終了処理を実行する + */ protected monitorSignalingWebSocketEvent(): Promise { - // シグナリング時に意図しない WebSocket の切断を監視する return new Promise((_, reject) => { this.monitorSignalingWebSocketEventTimerId = setInterval(() => { if (!this.ws) { @@ -1076,8 +1313,13 @@ export default class ConnectionBase { }); } + /** + * WebSocket の切断を監視するメソッド. + * + * @remarks + * 意図しない切断があった場合には異常終了処理を実行する + */ protected monitorWebSocketEvent(): void { - // 接続後の意図しない WebSocket の切断を監視する if (!this.ws) { return; } @@ -1091,8 +1333,13 @@ export default class ConnectionBase { }; } + /** + * 初回シグナリング後 PeerConnection の state を監視するメソッド. + * + * @remarks + * connectionState, iceConnectionState を監視して不正な場合に切断する. + */ protected monitorPeerConnectionState(): void { - // PeerConnection の ConnectionState, iceConnectionState を監視して不正な場合に切断する if (!this.pc) { return; } @@ -1134,6 +1381,9 @@ export default class ConnectionBase { }; } + /** + * 初回シグナリングの接続タイムアウト処理をするメソッド. + */ protected setConnectionTimeout(): Promise { return new Promise((_, reject) => { if (0 < this.connectionTimeout) { @@ -1157,18 +1407,33 @@ export default class ConnectionBase { }); } + /** + * setConnectionTimeout でセットしたタイマーを止めるメソッド. + */ protected clearConnectionTimeout(): void { clearTimeout(this.connectionTimeoutTimerId); } + /** + * monitorSignalingWebSocketEvent でセットしたタイマーを止めるメソッド. + */ protected clearMonitorSignalingWebSocketEvent(): void { clearInterval(this.monitorSignalingWebSocketEventTimerId); } + /** + * monitorPeerConnectionState でセットしたタイマーを止めるメソッド. + */ protected clearMonitorIceConnectionStateChange(): void { clearInterval(this.monitorIceConnectionStateChangeTimerId); } + /** + * trace log を出力するメソッド. + * + * @param title - ログのタイトル + * @param message - ログの本文 + */ protected trace(title: string, message: unknown): void { this.callbacks.log(title, message as JSONType); if (!this.debug) { @@ -1177,36 +1442,81 @@ export default class ConnectionBase { trace(this.clientId, title, message); } + /** + * WebSocket のシグナリングログ処理をするメソッド. + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeWebSocketSignalingLog(eventType: string, data?: unknown): void { this.callbacks.signaling(createSignalingEvent(eventType, data, "websocket")); this.writeWebSocketTimelineLog(eventType, data); } + /** + * DataChannel のシグナリングログ処理をするメソッド. + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeDataChannelSignalingLog(eventType: string, channel: RTCDataChannel, data?: unknown): void { this.callbacks.signaling(createSignalingEvent(eventType, data, "datachannel")); this.writeDataChannelTimelineLog(eventType, channel, data); } + /** + * WebSocket のタイムラインログ処理をするメソッド. + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeWebSocketTimelineLog(eventType: string, data?: unknown): void { const event = createTimelineEvent(eventType, data, "websocket"); this.callbacks.timeline(event); } + /** + * DataChannel のタイムラインログ処理をするメソッド. + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeDataChannelTimelineLog(eventType: string, channel: RTCDataChannel, data?: unknown): void { const event = createTimelineEvent(eventType, data, "datachannel", channel.id, channel.label); this.callbacks.timeline(event); } + /** + * PeerConnection のタイムラインログ処理をするメソッド. + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writePeerConnectionTimelineLog(eventType: string, data?: unknown): void { const event = createTimelineEvent(eventType, data, "peerconnection"); this.callbacks.timeline(event); } + /** + * Sora との接続のタイムラインログ処理をするメソッド. + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeSoraTimelineLog(eventType: string, data?: unknown): void { const event = createTimelineEvent(eventType, data, "sora"); this.callbacks.timeline(event); } + /** + * createOffer 処理をするメソッド. + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + * + * @returns + * 生成した RTCSessionDescription を返します. + */ private async createOffer(): Promise { const config = { iceServers: [] }; const pc = new window.RTCPeerConnection(config); @@ -1224,6 +1534,11 @@ export default class ConnectionBase { return offer; } + /** + * シグナリングサーバーから受け取った type e2ee メッセージを処理をするメソッド. + * + * @param data - E2EE 用バイナリメッセージ + */ private signalingOnMessageE2EE(data: ArrayBuffer): void { if (this.e2ee) { const message = new Uint8Array(data); @@ -1235,6 +1550,11 @@ export default class ConnectionBase { } } + /** + * シグナリングサーバーから受け取った type offer メッセージを処理をするメソッド. + * + * @param message - type offer メッセージ + */ private signalingOnMessageTypeOffer(message: SignalingOfferMessage): void { this.clientId = message.client_id; this.connectionId = message.connection_id; @@ -1259,6 +1579,9 @@ export default class ConnectionBase { this.trace("OFFER SDP", message.sdp); } + /** + * シグナリングサーバーに type update を投げるメソッド. + */ private sendUpdateAnswer(): void { if (this.pc && this.ws && this.pc.localDescription) { this.trace("ANSWER SDP", this.pc.localDescription.sdp); @@ -1266,6 +1589,9 @@ export default class ConnectionBase { } } + /** + * シグナリングサーバーに type re-answer を投げるメソッド. + */ private sendReAnswer(): void { if (this.pc && this.pc.localDescription) { this.trace("RE ANSWER SDP", this.pc.localDescription.sdp); @@ -1273,6 +1599,11 @@ export default class ConnectionBase { } } + /** + * シグナリングサーバーから受け取った type update メッセージを処理をするメソッド. + * + * @param message - type update メッセージ + */ private async signalingOnMessageTypeUpdate(message: SignalingUpdateMessage): Promise { this.trace("SIGNALING UPDATE MESSGE", message); this.trace("UPDATE SDP", message.sdp); @@ -1281,6 +1612,11 @@ export default class ConnectionBase { this.sendUpdateAnswer(); } + /** + * シグナリングサーバーから受け取った type re-offer メッセージを処理をするメソッド. + * + * @param message - type re-offer メッセージ + */ private async signalingOnMessageTypeReOffer(message: SignalingReOfferMessage): Promise { this.trace("SIGNALING RE OFFER MESSGE", message); this.trace("RE OFFER SDP", message.sdp); @@ -1289,6 +1625,11 @@ export default class ConnectionBase { this.sendReAnswer(); } + /** + * シグナリングサーバーから受け取った type ping メッセージを処理をするメソッド. + * + * @param message - type ping メッセージ + */ private async signalingOnMessageTypePing(message: SignalingPingMessage): Promise { const pongMessage: { type: "pong"; stats?: RTCStatsReport[] } = { type: "pong" }; if (message.stats) { @@ -1300,6 +1641,11 @@ export default class ConnectionBase { } } + /** + * シグナリングサーバーから受け取った type notify メッセージを処理をするメソッド. + * + * @param message - type notify メッセージ + */ private signalingOnMessageTypeNotify(message: SignalingNotifyMessage, transportType: TransportType): void { if (message.event_type === "connection.created") { const connectionId = message.connection_id; @@ -1346,6 +1692,11 @@ export default class ConnectionBase { this.callbacks.notify(message, transportType); } + /** + * シグナリングサーバーから受け取った type switched メッセージを処理をするメソッド. + * + * @param message - type switched メッセージ + */ private signalingOnMessageTypeSwitched(message: SignalingSwitchedMessage): void { this.signalingSwitched = true; if (!this.ws) { @@ -1361,6 +1712,11 @@ export default class ConnectionBase { } } + /** + * シグナリングサーバーから受け取った type redirect メッセージを処理をするメソッド. + * + * @param message - type redirect メッセージ + */ private async signalingOnMessageTypeRedirect(message: SignalingRedirectMessage): Promise { if (this.ws) { this.ws.onclose = null; @@ -1373,6 +1729,12 @@ export default class ConnectionBase { return signalingMessage; } + /** + * sender の parameters に encodings をセットするメソッド. + * + * @remarks + * サイマルキャスト用の処理. + */ private async setSenderParameters( transceiver: RTCRtpTransceiver, encodings: RTCRtpEncodingParameters[] @@ -1386,6 +1748,9 @@ export default class ConnectionBase { return; } + /** + * PeerConnection から RTCStatsReport を取得するためのメソッド. + */ private async getStats(): Promise { const stats: RTCStatsReport[] = []; if (!this.pc) { @@ -1398,6 +1763,11 @@ export default class ConnectionBase { return stats; } + /** + * PeerConnection の ondatachannel callback メソッド. + * + * @param dataChannelEvent - DataChannel イベント + */ private onDataChannel(dataChannelEvent: RTCDataChannelEvent): void { const dataChannel = dataChannelEvent.channel; this.writeDataChannelTimelineLog("ondatachannel", dataChannel, createDataChannelData(dataChannel)); @@ -1524,6 +1894,11 @@ export default class ConnectionBase { } } + /** + * シグナリングサーバーへメッセージを送信するメソッド. + * + * @param message - 送信するメッセージ + */ private sendSignalingMessage(message: { type: string; [key: string]: unknown }): void { if (this.dataChannels.signaling) { if ( @@ -1543,6 +1918,11 @@ export default class ConnectionBase { } } + /** + * シグナリングサーバーに E2E 用メッセージを投げるメソッド. + * + * @param message - 送信するバイナリメッセージ + */ private sendE2EEMessage(message: ArrayBuffer): void { if (this.dataChannels.e2ee) { this.dataChannels.e2ee.send(message); @@ -1553,6 +1933,11 @@ export default class ConnectionBase { } } + /** + * シグナリングサーバーに stats メッセージを投げるメソッド. + * + * @param reports - RTCStatsReport のリスト + */ private sendStatsMessage(reports: RTCStatsReport[]): void { if (this.dataChannels.stats) { const message = { @@ -1572,6 +1957,9 @@ export default class ConnectionBase { } } + /** + * audio transceiver を取得するメソッド. + */ private getAudioTransceiver(): RTCRtpTransceiver | null { if (this.pc && this.mids.audio) { const transceiver = this.pc.getTransceivers().find((transceiver) => { @@ -1582,6 +1970,9 @@ export default class ConnectionBase { return null; } + /** + * video transceiver を取得するメソッド. + */ private getVideoTransceiver(): RTCRtpTransceiver | null { if (this.pc && this.mids.video) { const transceiver = this.pc.getTransceivers().find((transceiver) => { @@ -1592,6 +1983,13 @@ export default class ConnectionBase { return null; } + /** + * disconnect callback に渡す Event オブジェクトを生成するためのメソッド. + * + * @param type - Event タイプ(normal | abend) + * @param title - Event タイトル + * @param initDict - Event に設定するオプションパラメーター + */ private soraCloseEvent(type: SoraCloseEventType, title: string, initDict?: SoraCloseEventInitDict): SoraCloseEvent { const soraCloseEvent = class SoraCloseEvent extends Event { title: string; @@ -1618,6 +2016,12 @@ export default class ConnectionBase { return new soraCloseEvent(type, title, initDict); } + /** + * DataChannel を使用してメッセージを送信するメソッド. + * + * @param label - メッセージを送信する DataChannel のラベル + * @param message - JSON + */ sendMessage(label: string, message: JSONType): void { const dataChannel = this.dataChannels[label]; // 接続していない場合は何もしない @@ -1637,6 +2041,9 @@ export default class ConnectionBase { } } + /** + * E2EE の自分のフィンガープリント. + */ get e2eeSelfFingerprint(): string | undefined { if (this.options.e2ee && this.e2ee) { return this.e2ee.selfFingerprint(); @@ -1644,6 +2051,9 @@ export default class ConnectionBase { return; } + /** + * E2EE のリモートのフィンガープリントリスト. + */ get e2eeRemoteFingerprints(): Record | undefined { if (this.options.e2ee && this.e2ee) { return this.e2ee.remoteFingerprints(); @@ -1651,18 +2061,32 @@ export default class ConnectionBase { return; } + /** + * audio が有効かどうか. + */ get audio(): boolean { return this.getAudioTransceiver() !== null; } + /** + * video が有効かどうか. + */ get video(): boolean { return this.getVideoTransceiver() !== null; } + /** + * シグナリングに使用する URL. + * + * @deprecated + */ get signalingUrl(): string | string[] { return this.signalingUrlCandidates; } + /** + * 接続中のシグナリング URL. + */ get connectedSignalingUrl(): string { if (!this.ws) { return ""; @@ -1670,6 +2094,9 @@ export default class ConnectionBase { return this.ws.url; } + /** + * DataChannel メッセージング用の DataChannel 情報のリスト. + */ get messagingDataChannels(): DataChannelConfiguration[] { const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); From 2e5d19be6f71a2da9194a5d720071238c42bfd50 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 25 Oct 2021 15:27:00 +0900 Subject: [PATCH 37/87] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 2 +- packages/sdk/src/helpers.ts | 10 ++++- packages/sdk/src/sora.ts | 78 +++++++++++++++++++++++++++++++--- packages/sdk/tsconfig.doc.json | 32 ++++++++++++++ 4 files changed, 115 insertions(+), 7 deletions(-) create mode 100644 packages/sdk/tsconfig.doc.json diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 6173b367..292563b8 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -58,7 +58,7 @@ export default class ConnectionBase { */ metadata: JSONType | undefined; /** - * シグナリングに使用する URL. + * シグナリングに使用する URL 候補. */ signalingUrlCandidates: string | string[]; /** diff --git a/packages/sdk/src/helpers.ts b/packages/sdk/src/helpers.ts index dcee8196..e419daaa 100644 --- a/packages/sdk/src/helpers.ts +++ b/packages/sdk/src/helpers.ts @@ -1,4 +1,12 @@ -// MediaStream の constraints を動的に変更 +/** + * MediaStream の constraints を動的に変更するメソッド. + * + * @param mediastream - メディアストリーム + * + * @param constraints - メディアストリーム制約 + * + * @public + */ async function applyMediaStreamConstraints( mediastream: MediaStream, constraints: MediaStreamConstraints diff --git a/packages/sdk/src/sora.ts b/packages/sdk/src/sora.ts index 714abfc0..d5133d25 100644 --- a/packages/sdk/src/sora.ts +++ b/packages/sdk/src/sora.ts @@ -36,14 +36,31 @@ import type { } from "./types"; class SoraConnection { + /** + * シグナリングに使用する URL の候補. + */ signalingUrlCandidates: string | string[]; + /** + * デバッグフラグ. + */ debug: boolean; constructor(signalingUrlCandidates: string | string[], debug = false) { this.signalingUrlCandidates = signalingUrlCandidates; this.debug = debug; } - + /** + * role sendrecv で接続するための Connecion インスタンスを生成するメソッド. + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role sendrecv な Connection オブジェクトを返します. + * + * @public + */ sendrecv( channelId: string, metadata: JSONType = null, @@ -51,7 +68,18 @@ class SoraConnection { ): ConnectionPublisher { return new ConnectionPublisher(this.signalingUrlCandidates, "sendrecv", channelId, metadata, options, this.debug); } - + /** + * role sendonly で接続するための Connecion インスタンスを生成するメソッド. + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role sendonly な Connection オブジェクトを返します. + * + * @public + */ sendonly( channelId: string, metadata: JSONType = null, @@ -59,7 +87,18 @@ class SoraConnection { ): ConnectionPublisher { return new ConnectionPublisher(this.signalingUrlCandidates, "sendonly", channelId, metadata, options, this.debug); } - + /** + * role recvonly で接続するための Connecion インスタンスを生成するメソッド. + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role recvonly な Connection オブジェクトを返します. + * + * @public + */ recvonly( channelId: string, metadata: JSONType = null, @@ -67,23 +106,52 @@ class SoraConnection { ): ConnectionSubscriber { return new ConnectionSubscriber(this.signalingUrlCandidates, "recvonly", channelId, metadata, options, this.debug); } - - // @deprecated 後方互換のため残す + /** + * シグナリングに使用する URL の候補. + * + * @public + * @deprecated + */ get signalingUrl(): string | string[] { return this.signalingUrlCandidates; } } export default { + /** + * E2EE で使用する WASM の読み込みを行うメソッド. + * + * @param wasmUrl - E2EE WASM の URL + * + * @public + */ initE2EE: async function (wasmUrl: string): Promise { await SoraE2EE.loadWasm(wasmUrl); }, + /** + * SoraConnection インスタンスを生成するメソッド. + * + * @param wasmUrl - シグナリングに使用する URL 候補. + * @param debug - デバッグフラグ. + * + * @public + */ connection: function (signalingUrlCandidates: string | string[], debug = false): SoraConnection { return new SoraConnection(signalingUrlCandidates, debug); }, + /** + * SDK のバージョンを返すメソッド. + * + * @public + */ version: function (): string { return "__SORA_JS_SDK_VERSION__"; }, + /** + * WebRTC のユーティリティ関数群. + * + * @public + */ helpers: { applyMediaStreamConstraints, }, diff --git a/packages/sdk/tsconfig.doc.json b/packages/sdk/tsconfig.doc.json new file mode 100644 index 00000000..27550f43 --- /dev/null +++ b/packages/sdk/tsconfig.doc.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "es2020", + "strict": true, + "declaration": true, + "strictNullChecks": true, + "importHelpers": true, + "moduleResolution": "node", + "experimentalDecorators": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true, + "newLine": "LF", + "types": [ + "jest" + ], + "lib": [ + "esnext", + "dom", + "dom.iterable", + "scripthost" + ] + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules", + "tests" + ] +} From 8c20c7b2fbbd76975c7c6b765446df12baf68824 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 25 Oct 2021 16:20:53 +0900 Subject: [PATCH 38/87] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 223 +++++++++++++++++++++------------------ packages/sdk/src/sora.ts | 39 ++++--- 2 files changed, 142 insertions(+), 120 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 292563b8..9ecc3e3b 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -44,90 +44,100 @@ declare global { } } +/** + * Sora との WebRTC 接続を扱う基底クラス + * + * @param signalingUrlCandidates - シグナリングに使用する URL の候補 + * @param role - ロール + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * @param debug - デバッグフラグ + */ export default class ConnectionBase { /** - * ロール(sendonly | sendrecv | recvonly). + * ロール(sendonly | sendrecv | recvonly) */ role: string; /** - * チャネルID. + * チャネルID */ channelId: string; /** - * メタデータ. + * メタデータ */ metadata: JSONType | undefined; /** - * シグナリングに使用する URL 候補. + * シグナリングに使用する URL 候補 */ signalingUrlCandidates: string | string[]; /** - * 接続オプション. + * 接続オプション */ options: ConnectionOptions; /** - * PeerConnection に渡す configuration. + * PeerConnection に渡す configuration */ // eslint-disable-next-line @typescript-eslint/no-explicit-any constraints: any; /** - * デバッグフラグ. + * デバッグフラグ */ debug: boolean; /** - * クライアントID. + * クライアントID */ clientId: string | null; /** - * コネクションID. + * コネクションID */ connectionId: string | null; /** - * リモートコネクションIDのリスト. + * リモートコネクションIDのリスト */ remoteConnectionIds: string[]; /** - * メディアストリーム. + * メディアストリーム */ stream: MediaStream | null; /** - * type offer に含まれる認証 metadata. + * type offer に含まれる認証 metadata */ authMetadata: JSONType; /** - * PeerConnection インスタンス. + * PeerConnection インスタンス */ pc: RTCPeerConnection | null; /** - * サイマルキャストで使用する RTCRtpEncodingParameters のリスト. + * サイマルキャストで使用する RTCRtpEncodingParameters のリスト */ encodings: RTCRtpEncodingParameters[]; /** - * WebSocket インスタンス. + * WebSocket インスタンス */ protected ws: WebSocket | null; /** - * イベントコールバックのリスト. + * イベントコールバックのリスト */ protected callbacks: Callbacks; /** - * E2EE インスタンス. + * E2EE インスタンス */ protected e2ee: SoraE2EE | null; /** - * 初回シグナリング時接続タイムアウト用のタイマーID. + * 初回シグナリング時接続タイムアウト用のタイマーID */ protected connectionTimeoutTimerId: number; /** - * WebSocket 切断監視用のタイマーID. + * WebSocket 切断監視用のタイマーID */ protected monitorSignalingWebSocketEventTimerId: number; /** - * PeerConnection state 切断監視用のタイマーID. + * PeerConnection state 切断監視用のタイマーID */ protected monitorIceConnectionStateChangeTimerId: number; /** - * 接続中の DataChannel リスト. + * 接続中の DataChannel リスト */ protected dataChannels: { [key in string]?: RTCDataChannel; @@ -231,11 +241,12 @@ export default class ConnectionBase { } /** - * SendRecv Object で発火するイベントのコールバックを設定するメソッド. + * SendRecv Object で発火するイベントのコールバックを設定するメソッド * * @remarks - * addstream イベントは非推奨です.track イベントを使用してください. - * removestream イベントは非推奨です.removetrack イベントを使用してください. + * addstream イベントは非推奨です.track イベントを使用してください + * + * removestream イベントは非推奨です.removetrack イベントを使用してください * * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message) * @param callback - コールバック関数 @@ -255,10 +266,10 @@ export default class ConnectionBase { } /** - * audio track を停止するメソッド. + * audio track を停止するメソッド * * @remarks - * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します. + * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します * * @param stream - audio track を削除する MediaStream * @@ -289,10 +300,10 @@ export default class ConnectionBase { } /** - * video track を停止するメソッド. + * video track を停止するメソッド * * @remarks - * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します. + * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します * * @param stream - video track を削除する MediaStream * @@ -323,10 +334,10 @@ export default class ConnectionBase { } /** - * audio track を入れ替えするメソッド. + * audio track を入れ替えするメソッド * * @remarks - * stream の audio track を停止後、新しい audio track をセットします. + * stream の audio track を停止後、新しい audio track をセットします * * @param stream - audio track を削除する MediaStream * @param audioTrack - 新しい audio track @@ -344,10 +355,10 @@ export default class ConnectionBase { } /** - * video track を入れ替えするメソッド. + * video track を入れ替えするメソッド * * @remarks - * stream の video track を停止後、新しい video track をセットします. + * stream の video track を停止後、新しい video track をセットします * * @param stream - video track を削除する MediaStream * @param videoTrack - 新しい video track @@ -365,7 +376,7 @@ export default class ConnectionBase { } /** - * stream を停止するメソッド. + * stream を停止するメソッド */ private stopStream(): Promise { return new Promise((resolve, _) => { @@ -386,7 +397,7 @@ export default class ConnectionBase { } /** - * connect 処理中に例外が発生した場合の切断処理をするメソッド. + * connect 処理中に例外が発生した場合の切断処理をするメソッド */ private async signalingTerminate(): Promise { await this.stopStream(); @@ -411,7 +422,7 @@ export default class ConnectionBase { } /** - * PeerConnection の state に異常が発生した場合の切断処理をするメソッド. + * PeerConnection の state に異常が発生した場合の切断処理をするメソッド * * @param title - disconnect callback に渡すイベントのタイトル */ @@ -568,7 +579,7 @@ export default class ConnectionBase { } /** - * 接続状態の初期化をするメソッド. + * 接続状態の初期化をするメソッド */ private initializeConnection(): void { this.clientId = null; @@ -591,10 +602,10 @@ export default class ConnectionBase { } /** - * WebSocket を切断するメソッド. + * WebSocket を切断するメソッド * * @remarks - * 正常/異常どちらの切断でも使用する. + * 正常/異常どちらの切断でも使用する * * @param title - type disconnect 時の reason */ @@ -642,10 +653,10 @@ export default class ConnectionBase { } /** - * DataChannel を切断するメソッド. + * DataChannel を切断するメソッド * * @remarks - * 正常/異常どちらの切断でも使用する. + * 正常/異常どちらの切断でも使用する */ private disconnectDataChannel(): Promise<{ code: number; reason: string } | null> { // DataChannel の強制終了処理 @@ -751,10 +762,10 @@ export default class ConnectionBase { } /** - * PeerConnection を切断するメソッド. + * PeerConnection を切断するメソッド * * @remarks - * 正常/異常どちらの切断でも使用する. + * 正常/異常どちらの切断でも使用する */ private disconnectPeerConnection(): Promise { return new Promise((resolve, _) => { @@ -766,7 +777,7 @@ export default class ConnectionBase { } /** - * 切断処理をするメソッド. + * 切断処理をするメソッド * * @public */ @@ -835,7 +846,7 @@ export default class ConnectionBase { } /** - * E2EE の初期設定をするメソッド. + * E2EE の初期設定をするメソッド */ protected setupE2EE(): void { if (this.options.e2ee === true) { @@ -848,7 +859,7 @@ export default class ConnectionBase { } /** - * E2EE を開始するメソッド. + * E2EE を開始するメソッド */ protected startE2EE(): void { if (this.options.e2ee === true && this.e2ee) { @@ -864,16 +875,17 @@ export default class ConnectionBase { } /** - * シグナリングに使う WebSocket インスタンスを作成するメソッド. + * シグナリングに使う WebSocket インスタンスを作成するメソッド * * @remarks - * シグナリング候補の URL 一覧に順に接続します. - * 接続できた URL がない場合は例外が発生します. + * シグナリング候補の URL 一覧に順に接続します + * + * 接続できた URL がない場合は例外が発生します * * @param signalingUrlCandidates - シグナリング候補の URL. 後方互換のため string | string[] を受け取る * * @returns - * 接続できた WebScoket インスタンスを返します. + * 接続できた WebScoket インスタンスを返します */ protected async getSignalingWebSocket(signalingUrlCandidates: string | string[]): Promise { if (typeof signalingUrlCandidates === "string") { @@ -982,17 +994,18 @@ export default class ConnectionBase { } /** - * シグナリング処理を行うメソッド. + * シグナリング処理を行うメソッド * * @remarks - * シグナリング候補の URL 一覧に順に接続します. - * 接続できた URL がない場合は例外が発生します. + * シグナリング候補の URL 一覧に順に接続します + * + * 接続できた URL がない場合は例外が発生します * * @param ws - WebSocket インスタンス * @param redirect - クラスター接続時にリダイレクトされた場合のフラグ * * @returns - * Sora から受け取った type offer メッセージを返します. + * Sora から受け取った type offer メッセージを返します */ protected async signaling(ws: WebSocket, redirect = false): Promise { const offer = await this.createOffer(); @@ -1081,7 +1094,7 @@ export default class ConnectionBase { } /** - * PeerConnection 接続処理をするメソッド. + * PeerConnection 接続処理をするメソッド * * @param message - シグナリング処理で受け取った type offer メッセージ */ @@ -1134,7 +1147,7 @@ export default class ConnectionBase { } /** - * setRemoteDescription 処理を行うメソッド. + * setRemoteDescription 処理を行うメソッド * * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ */ @@ -1151,10 +1164,10 @@ export default class ConnectionBase { } /** - * createAnswer 処理を行うメソッド. + * createAnswer 処理を行うメソッド * * @remarks - * サイマルキャスト用の setParameters 処理もここで行う. + * サイマルキャスト用の setParameters 処理もここで行う * * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ */ @@ -1203,7 +1216,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーに type answer を投げるメソッド. + * シグナリングサーバーに type answer を投げるメソッド */ protected sendAnswer(): void { if (this.pc && this.ws && this.pc.localDescription) { @@ -1216,7 +1229,7 @@ export default class ConnectionBase { } /** - * iceCnadidate 処理をするメソッド. + * iceCnadidate 処理をするメソッド */ protected onIceCandidate(): Promise { return new Promise((resolve, _) => { @@ -1254,7 +1267,7 @@ export default class ConnectionBase { } /** - * connectionState が "connected" になるのを監視するメソッド. + * connectionState が "connected" になるのを監視するメソッド * * @remarks * PeerConnection.connectionState が実装されていない場合は何もしない @@ -1281,7 +1294,7 @@ export default class ConnectionBase { } /** - * 初回シグナリング接続時の WebSocket の切断を監視するメソッド. + * 初回シグナリング接続時の WebSocket の切断を監視するメソッド * * @remarks * 意図しない切断があった場合には異常終了処理を実行する @@ -1314,7 +1327,7 @@ export default class ConnectionBase { } /** - * WebSocket の切断を監視するメソッド. + * WebSocket の切断を監視するメソッド * * @remarks * 意図しない切断があった場合には異常終了処理を実行する @@ -1334,10 +1347,10 @@ export default class ConnectionBase { } /** - * 初回シグナリング後 PeerConnection の state を監視するメソッド. + * 初回シグナリング後 PeerConnection の state を監視するメソッド * * @remarks - * connectionState, iceConnectionState を監視して不正な場合に切断する. + * connectionState, iceConnectionState を監視して不正な場合に切断する */ protected monitorPeerConnectionState(): void { if (!this.pc) { @@ -1382,7 +1395,7 @@ export default class ConnectionBase { } /** - * 初回シグナリングの接続タイムアウト処理をするメソッド. + * 初回シグナリングの接続タイムアウト処理をするメソッド */ protected setConnectionTimeout(): Promise { return new Promise((_, reject) => { @@ -1408,28 +1421,28 @@ export default class ConnectionBase { } /** - * setConnectionTimeout でセットしたタイマーを止めるメソッド. + * setConnectionTimeout でセットしたタイマーを止めるメソッド */ protected clearConnectionTimeout(): void { clearTimeout(this.connectionTimeoutTimerId); } /** - * monitorSignalingWebSocketEvent でセットしたタイマーを止めるメソッド. + * monitorSignalingWebSocketEvent でセットしたタイマーを止めるメソッド */ protected clearMonitorSignalingWebSocketEvent(): void { clearInterval(this.monitorSignalingWebSocketEventTimerId); } /** - * monitorPeerConnectionState でセットしたタイマーを止めるメソッド. + * monitorPeerConnectionState でセットしたタイマーを止めるメソッド */ protected clearMonitorIceConnectionStateChange(): void { clearInterval(this.monitorIceConnectionStateChangeTimerId); } /** - * trace log を出力するメソッド. + * trace log を出力するメソッド * * @param title - ログのタイトル * @param message - ログの本文 @@ -1443,7 +1456,7 @@ export default class ConnectionBase { } /** - * WebSocket のシグナリングログ処理をするメソッド. + * WebSocket のシグナリングログ処理をするメソッド * * @param eventType - イベントタイプ * @param data - イベントデータ @@ -1454,7 +1467,7 @@ export default class ConnectionBase { } /** - * DataChannel のシグナリングログ処理をするメソッド. + * DataChannel のシグナリングログ処理をするメソッド * * @param eventType - イベントタイプ * @param data - イベントデータ @@ -1465,7 +1478,7 @@ export default class ConnectionBase { } /** - * WebSocket のタイムラインログ処理をするメソッド. + * WebSocket のタイムラインログ処理をするメソッド * * @param eventType - イベントタイプ * @param data - イベントデータ @@ -1476,7 +1489,7 @@ export default class ConnectionBase { } /** - * DataChannel のタイムラインログ処理をするメソッド. + * DataChannel のタイムラインログ処理をするメソッド * * @param eventType - イベントタイプ * @param data - イベントデータ @@ -1487,7 +1500,7 @@ export default class ConnectionBase { } /** - * PeerConnection のタイムラインログ処理をするメソッド. + * PeerConnection のタイムラインログ処理をするメソッド * * @param eventType - イベントタイプ * @param data - イベントデータ @@ -1498,7 +1511,7 @@ export default class ConnectionBase { } /** - * Sora との接続のタイムラインログ処理をするメソッド. + * Sora との接続のタイムラインログ処理をするメソッド * * @param eventType - イベントタイプ * @param data - イベントデータ @@ -1509,13 +1522,13 @@ export default class ConnectionBase { } /** - * createOffer 処理をするメソッド. + * createOffer 処理をするメソッド * * @param eventType - イベントタイプ * @param data - イベントデータ * * @returns - * 生成した RTCSessionDescription を返します. + * 生成した RTCSessionDescription を返します */ private async createOffer(): Promise { const config = { iceServers: [] }; @@ -1535,7 +1548,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーから受け取った type e2ee メッセージを処理をするメソッド. + * シグナリングサーバーから受け取った type e2ee メッセージを処理をするメソッド * * @param data - E2EE 用バイナリメッセージ */ @@ -1551,7 +1564,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーから受け取った type offer メッセージを処理をするメソッド. + * シグナリングサーバーから受け取った type offer メッセージを処理をするメソッド * * @param message - type offer メッセージ */ @@ -1580,7 +1593,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーに type update を投げるメソッド. + * シグナリングサーバーに type update を投げるメソッド */ private sendUpdateAnswer(): void { if (this.pc && this.ws && this.pc.localDescription) { @@ -1590,7 +1603,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーに type re-answer を投げるメソッド. + * シグナリングサーバーに type re-answer を投げるメソッド */ private sendReAnswer(): void { if (this.pc && this.pc.localDescription) { @@ -1600,7 +1613,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーから受け取った type update メッセージを処理をするメソッド. + * シグナリングサーバーから受け取った type update メッセージを処理をするメソッド * * @param message - type update メッセージ */ @@ -1613,7 +1626,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーから受け取った type re-offer メッセージを処理をするメソッド. + * シグナリングサーバーから受け取った type re-offer メッセージを処理をするメソッド * * @param message - type re-offer メッセージ */ @@ -1626,7 +1639,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーから受け取った type ping メッセージを処理をするメソッド. + * シグナリングサーバーから受け取った type ping メッセージを処理をするメソッド * * @param message - type ping メッセージ */ @@ -1642,7 +1655,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーから受け取った type notify メッセージを処理をするメソッド. + * シグナリングサーバーから受け取った type notify メッセージを処理をするメソッド * * @param message - type notify メッセージ */ @@ -1693,7 +1706,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーから受け取った type switched メッセージを処理をするメソッド. + * シグナリングサーバーから受け取った type switched メッセージを処理をするメソッド * * @param message - type switched メッセージ */ @@ -1713,7 +1726,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーから受け取った type redirect メッセージを処理をするメソッド. + * シグナリングサーバーから受け取った type redirect メッセージを処理をするメソッド * * @param message - type redirect メッセージ */ @@ -1730,10 +1743,10 @@ export default class ConnectionBase { } /** - * sender の parameters に encodings をセットするメソッド. + * sender の parameters に encodings をセットするメソッド * * @remarks - * サイマルキャスト用の処理. + * サイマルキャスト用の処理 */ private async setSenderParameters( transceiver: RTCRtpTransceiver, @@ -1749,7 +1762,7 @@ export default class ConnectionBase { } /** - * PeerConnection から RTCStatsReport を取得するためのメソッド. + * PeerConnection から RTCStatsReport を取得するためのメソッド */ private async getStats(): Promise { const stats: RTCStatsReport[] = []; @@ -1764,7 +1777,7 @@ export default class ConnectionBase { } /** - * PeerConnection の ondatachannel callback メソッド. + * PeerConnection の ondatachannel callback メソッド * * @param dataChannelEvent - DataChannel イベント */ @@ -1895,7 +1908,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーへメッセージを送信するメソッド. + * シグナリングサーバーへメッセージを送信するメソッド * * @param message - 送信するメッセージ */ @@ -1919,7 +1932,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーに E2E 用メッセージを投げるメソッド. + * シグナリングサーバーに E2E 用メッセージを投げるメソッド * * @param message - 送信するバイナリメッセージ */ @@ -1934,7 +1947,7 @@ export default class ConnectionBase { } /** - * シグナリングサーバーに stats メッセージを投げるメソッド. + * シグナリングサーバーに stats メッセージを投げるメソッド * * @param reports - RTCStatsReport のリスト */ @@ -1958,7 +1971,7 @@ export default class ConnectionBase { } /** - * audio transceiver を取得するメソッド. + * audio transceiver を取得するメソッド */ private getAudioTransceiver(): RTCRtpTransceiver | null { if (this.pc && this.mids.audio) { @@ -1971,7 +1984,7 @@ export default class ConnectionBase { } /** - * video transceiver を取得するメソッド. + * video transceiver を取得するメソッド */ private getVideoTransceiver(): RTCRtpTransceiver | null { if (this.pc && this.mids.video) { @@ -1984,7 +1997,7 @@ export default class ConnectionBase { } /** - * disconnect callback に渡す Event オブジェクトを生成するためのメソッド. + * disconnect callback に渡す Event オブジェクトを生成するためのメソッド * * @param type - Event タイプ(normal | abend) * @param title - Event タイトル @@ -2017,7 +2030,7 @@ export default class ConnectionBase { } /** - * DataChannel を使用してメッセージを送信するメソッド. + * DataChannel を使用してメッセージを送信するメソッド * * @param label - メッセージを送信する DataChannel のラベル * @param message - JSON @@ -2042,7 +2055,7 @@ export default class ConnectionBase { } /** - * E2EE の自分のフィンガープリント. + * E2EE の自分のフィンガープリント */ get e2eeSelfFingerprint(): string | undefined { if (this.options.e2ee && this.e2ee) { @@ -2052,7 +2065,7 @@ export default class ConnectionBase { } /** - * E2EE のリモートのフィンガープリントリスト. + * E2EE のリモートのフィンガープリントリスト */ get e2eeRemoteFingerprints(): Record | undefined { if (this.options.e2ee && this.e2ee) { @@ -2062,21 +2075,21 @@ export default class ConnectionBase { } /** - * audio が有効かどうか. + * audio が有効かどうか */ get audio(): boolean { return this.getAudioTransceiver() !== null; } /** - * video が有効かどうか. + * video が有効かどうか */ get video(): boolean { return this.getVideoTransceiver() !== null; } /** - * シグナリングに使用する URL. + * シグナリングに使用する URL * * @deprecated */ @@ -2085,7 +2098,7 @@ export default class ConnectionBase { } /** - * 接続中のシグナリング URL. + * 接続中のシグナリング URL */ get connectedSignalingUrl(): string { if (!this.ws) { @@ -2095,7 +2108,7 @@ export default class ConnectionBase { } /** - * DataChannel メッセージング用の DataChannel 情報のリスト. + * DataChannel メッセージング用の DataChannel 情報のリスト */ get messagingDataChannels(): DataChannelConfiguration[] { const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { diff --git a/packages/sdk/src/sora.ts b/packages/sdk/src/sora.ts index d5133d25..0b04d602 100644 --- a/packages/sdk/src/sora.ts +++ b/packages/sdk/src/sora.ts @@ -35,13 +35,19 @@ import type { VideoCodecType, } from "./types"; +/** + * Role 毎の Connection インスタンスを生成するためのクラス + * + * @param signalingUrlCandidates - シグナリングに使用する URL の候補 + * @param debug - デバッグフラグ + */ class SoraConnection { /** - * シグナリングに使用する URL の候補. + * シグナリングに使用する URL の候補 */ signalingUrlCandidates: string | string[]; /** - * デバッグフラグ. + * デバッグフラグ */ debug: boolean; @@ -50,14 +56,14 @@ class SoraConnection { this.debug = debug; } /** - * role sendrecv で接続するための Connecion インスタンスを生成するメソッド. + * role sendrecv で接続するための Connecion インスタンスを生成するメソッド * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション * * @returns - * role sendrecv な Connection オブジェクトを返します. + * role sendrecv な Connection オブジェクトを返します * * @public */ @@ -69,14 +75,14 @@ class SoraConnection { return new ConnectionPublisher(this.signalingUrlCandidates, "sendrecv", channelId, metadata, options, this.debug); } /** - * role sendonly で接続するための Connecion インスタンスを生成するメソッド. + * role sendonly で接続するための Connecion インスタンスを生成するメソッド * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション * * @returns - * role sendonly な Connection オブジェクトを返します. + * role sendonly な Connection オブジェクトを返します * * @public */ @@ -88,14 +94,14 @@ class SoraConnection { return new ConnectionPublisher(this.signalingUrlCandidates, "sendonly", channelId, metadata, options, this.debug); } /** - * role recvonly で接続するための Connecion インスタンスを生成するメソッド. + * role recvonly で接続するための Connecion インスタンスを生成するメソッド * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション * * @returns - * role recvonly な Connection オブジェクトを返します. + * role recvonly な Connection オブジェクトを返します * * @public */ @@ -107,7 +113,7 @@ class SoraConnection { return new ConnectionSubscriber(this.signalingUrlCandidates, "recvonly", channelId, metadata, options, this.debug); } /** - * シグナリングに使用する URL の候補. + * シグナリングに使用する URL の候補 * * @public * @deprecated @@ -117,9 +123,12 @@ class SoraConnection { } } +/** + * Sora JS SDK package + */ export default { /** - * E2EE で使用する WASM の読み込みを行うメソッド. + * E2EE で使用する WASM の読み込みを行うメソッド * * @param wasmUrl - E2EE WASM の URL * @@ -129,10 +138,10 @@ export default { await SoraE2EE.loadWasm(wasmUrl); }, /** - * SoraConnection インスタンスを生成するメソッド. + * SoraConnection インスタンスを生成するメソッド * - * @param wasmUrl - シグナリングに使用する URL 候補. - * @param debug - デバッグフラグ. + * @param wasmUrl - シグナリングに使用する URL 候補 + * @param debug - デバッグフラグ * * @public */ @@ -140,7 +149,7 @@ export default { return new SoraConnection(signalingUrlCandidates, debug); }, /** - * SDK のバージョンを返すメソッド. + * SDK のバージョンを返すメソッド * * @public */ @@ -148,7 +157,7 @@ export default { return "__SORA_JS_SDK_VERSION__"; }, /** - * WebRTC のユーティリティ関数群. + * WebRTC のユーティリティ関数群 * * @public */ From eee63aa80bbfc611dc09584604cf81b4468adc62 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 28 Oct 2021 11:55:47 +0900 Subject: [PATCH 39/87] =?UTF-8?q?yarn=20=E3=81=A8=20lerna=20=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lerna.json | 6 - package.json | 13 +- packages/e2ee/yarn.lock | 1237 --------- packages/sdk/yarn.lock | 3535 ------------------------- yarn.lock | 5472 --------------------------------------- 5 files changed, 1 insertion(+), 10262 deletions(-) delete mode 100644 lerna.json delete mode 100644 packages/e2ee/yarn.lock delete mode 100644 packages/sdk/yarn.lock delete mode 100644 yarn.lock diff --git a/lerna.json b/lerna.json deleted file mode 100644 index ea8068ee..00000000 --- a/lerna.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "packages": [ - "packages/*" - ], - "version": "2021.2.0-canary.3" -} diff --git a/package.json b/package.json index 8ec97ab9..f58dd049 100644 --- a/package.json +++ b/package.json @@ -6,17 +6,7 @@ "module": "dist/sora.mjs", "types": "dist/sora.d.ts", "scripts": { - "bootstrap": "npx lerna bootstrap --npm-client yarn", - "build": "npx lerna run --npm-client yarn build", - "lint": "npx lerna run --npm-client yarn lint", - "fmt": "npx lerna run --npm-client yarn fmt", - "test": "npx lerna run --npm-client yarn test", - "start": "npx serve -S -l 8080 ./example", - "packages:upgrade": "npx lerna clean -y && npx lerna exec -- npx ncu -u && yarn bootstrap", - "release:major": "./scripts/versioning.sh major && npx lerna run build", - "release:minor": "./scripts/versioning.sh minor && npx lerna run build", - "release:patch": "./scripts/versioning.sh patch && npx lerna run build", - "release:canary": "./scripts/versioning.sh canary && npx lerna run build" + "start": "npx serve -S -l 8080 ./example" }, "repository": { "type": "git", @@ -32,7 +22,6 @@ "dist" ], "devDependencies": { - "lerna": "^4.0.0", "npm-check-updates": "^11.8.5", "serve": "^12.0.1" }, diff --git a/packages/e2ee/yarn.lock b/packages/e2ee/yarn.lock deleted file mode 100644 index 7a96d5b4..00000000 --- a/packages/e2ee/yarn.lock +++ /dev/null @@ -1,1237 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/helper-validator-identifier@^7.14.5": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== - -"@babel/highlight@^7.10.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== - dependencies: - ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^13.9.0" - ignore "^4.0.6" - import-fresh "^3.2.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - strip-json-comments "^3.1.1" - -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== - dependencies: - "@humanwhocodes/object-schema" "^1.2.0" - debug "^4.1.1" - minimatch "^3.0.4" - -"@humanwhocodes/object-schema@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" - integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@rollup/plugin-replace@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-3.0.0.tgz#3a4c9665d4e7a4ce2c360cf021232784892f3fac" - integrity sha512-3c7JCbMuYXM4PbPWT4+m/4Y6U60SgsnDT/cCyAyUKwFHg7pTSfsSQzIpETha3a3ig6OdOKzZz87D9ZXIK3qsDg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - magic-string "^0.25.7" - -"@rollup/pluginutils@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" - integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== - dependencies: - "@types/estree" "0.0.39" - estree-walker "^1.0.1" - picomatch "^2.2.2" - -"@rollup/pluginutils@^4.1.0": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" - integrity sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ== - dependencies: - estree-walker "^2.0.1" - picomatch "^2.2.2" - -"@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== - -"@types/json-schema@^7.0.7": - version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== - -"@typescript-eslint/eslint-plugin@^4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" - integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== - dependencies: - "@typescript-eslint/experimental-utils" "4.33.0" - "@typescript-eslint/scope-manager" "4.33.0" - debug "^4.3.1" - functional-red-black-tree "^1.0.1" - ignore "^5.1.8" - regexpp "^3.1.0" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/experimental-utils@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" - integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== - dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - -"@typescript-eslint/parser@^4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" - integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== - dependencies: - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - debug "^4.3.1" - -"@typescript-eslint/scope-manager@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" - integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - -"@typescript-eslint/types@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" - integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== - -"@typescript-eslint/typescript-estree@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" - integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/visitor-keys@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" - integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== - dependencies: - "@typescript-eslint/types" "4.33.0" - eslint-visitor-keys "^2.0.0" - -acorn-jsx@^5.3.1: - version "5.3.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -acorn@^7.4.0: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -ajv@^6.10.0, ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^8.0.1: - version "8.6.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" - integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -cross-spawn@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@^4.0.1, debug@^4.1.1, debug@^4.3.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== - dependencies: - ms "2.1.2" - -deep-is@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -eslint-config-prettier@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" - integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== - -eslint-plugin-prettier@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" - integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - -eslint@^7.32.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== - dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" - ajv "^6.10.0" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.0.1" - doctrine "^3.0.0" - enquirer "^2.3.5" - escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" - globals "^13.6.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.0.4" - natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^6.0.9" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== - dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== - -estree-walker@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" - integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== - -estree-walker@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - -fast-glob@^3.1.1: - version "3.2.7" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" - integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== - dependencies: - reusify "^1.0.4" - -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-cache-dir@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" - integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== - dependencies: - commondir "^1.0.1" - make-dir "^3.0.2" - pkg-dir "^4.1.0" - -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== - dependencies: - flatted "^3.1.0" - rimraf "^3.0.2" - -flatted@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" - integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== - -fs-extra@8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@^7.1.3: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^13.6.0, globals@^13.9.0: - version "13.11.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" - integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== - dependencies: - type-fest "^0.20.2" - -globby@^11.0.3: - version "11.0.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" - integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - -graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -ignore@^5.1.4, ignore@^5.1.8: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== - -import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -is-core-module@^2.2.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" - integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== - dependencies: - has "^1.0.3" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -magic-string@^0.25.7: - version "0.25.7" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== - dependencies: - sourcemap-codec "^1.4.4" - -make-dir@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - -merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== - dependencies: - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - word-wrap "^1.2.3" - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picomatch@^2.2.2, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== - -pkg-dir@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" - integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -regexpp@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve@1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -rollup-plugin-typescript2@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz#1cc99ac2309bf4b9d0a3ebdbc2002aecd56083d3" - integrity sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ== - dependencies: - "@rollup/pluginutils" "^4.1.0" - find-cache-dir "^3.3.1" - fs-extra "8.1.0" - resolve "1.20.0" - tslib "2.1.0" - -rollup@^2.58.0: - version "2.58.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.58.0.tgz#a643983365e7bf7f5b7c62a8331b983b7c4c67fb" - integrity sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw== - optionalDependencies: - fsevents "~2.3.2" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -semver@^6.0.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.2.1, semver@^7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - -sourcemap-codec@^1.4.4: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -table@^6.0.9: - version "6.7.2" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.2.tgz#a8d39b9f5966693ca8b0feba270a78722cbaf3b0" - integrity sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g== - dependencies: - ajv "^8.0.1" - lodash.clonedeep "^4.5.0" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -tslib@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" - integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== - -tslib@^1.8.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -typescript@^4.4.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" - integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -word-wrap@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/packages/sdk/yarn.lock b/packages/sdk/yarn.lock deleted file mode 100644 index 52b1365a..00000000 --- a/packages/sdk/yarn.lock +++ /dev/null @@ -1,3535 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== - dependencies: - "@babel/highlight" "^7.14.5" - -"@babel/compat-data@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" - integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== - -"@babel/core@^7.1.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.8.7": - version "7.15.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" - integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.5" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - source-map "^0.5.0" - -"@babel/generator@^7.15.4", "@babel/generator@^7.7.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" - integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== - dependencies: - "@babel/types" "^7.15.4" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/helper-compilation-targets@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" - integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== - dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" - semver "^6.3.0" - -"@babel/helper-function-name@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" - integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== - dependencies: - "@babel/helper-get-function-arity" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helper-get-function-arity@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" - integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-hoist-variables@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" - integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-member-expression-to-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" - integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-module-imports@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" - integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-module-transforms@^7.15.4": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" - integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== - dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" - -"@babel/helper-optimise-call-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" - integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" - integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== - -"@babel/helper-replace-supers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" - integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helper-simple-access@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" - integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-split-export-declaration@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" - integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== - -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== - -"@babel/helpers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" - integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== - dependencies: - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/parser@^7.1.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.2": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" - integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-bigint@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" - integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.8.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" - integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-import-meta@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" - integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-typescript@^7.7.2": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz#b82c6ce471b165b5ce420cf92914d6fb46225716" - integrity sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/template@^7.15.4", "@babel/template@^7.3.3": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" - integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.7.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" - integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/types@^7.0.0", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" - integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== - dependencies: - "@babel/helper-validator-identifier" "^7.14.9" - to-fast-properties "^2.0.0" - -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - -"@comandeer/babel-plugin-banner@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@comandeer/babel-plugin-banner/-/babel-plugin-banner-5.0.0.tgz#30969cb08e810b67810d41761d0cfac292231ea9" - integrity sha512-sR9Go0U6puXoXyW9UgIiIQhRcJ8jVOvGl4BptUiXAtheMs72WcakZ1udh6J0ZOivr3o8jAM+MTCHLP8FZMbVpQ== - -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== - dependencies: - ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^13.9.0" - ignore "^4.0.6" - import-fresh "^3.2.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - strip-json-comments "^3.1.1" - -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== - dependencies: - "@humanwhocodes/object-schema" "^1.2.0" - debug "^4.1.1" - minimatch "^3.0.4" - -"@humanwhocodes/object-schema@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" - integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== - -"@istanbuljs/load-nyc-config@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" - integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - get-package-type "^0.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - -"@istanbuljs/schema@^0.1.2": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - -"@jest/console@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.4.tgz#2f1a4bf82b9940065d4818fac271def99ec55e5e" - integrity sha512-94znCKynPZpDpYHQ6esRJSc11AmONrVkBOBZiD7S+bSubHhrUfbS95EY5HIOxhm4PQO7cnvZkL3oJcY0oMA+Wg== - dependencies: - "@jest/types" "^27.2.4" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^27.2.4" - jest-util "^27.2.4" - slash "^3.0.0" - -"@jest/core@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.4.tgz#0b932da787d64848eab720dbb88e5b7a3f86e539" - integrity sha512-UNQLyy+rXoojNm2MGlapgzWhZD1CT1zcHZQYeiD0xE7MtJfC19Q6J5D/Lm2l7i4V97T30usKDoEtjI8vKwWcLg== - dependencies: - "@jest/console" "^27.2.4" - "@jest/reporters" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - emittery "^0.8.1" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-changed-files "^27.2.4" - jest-config "^27.2.4" - jest-haste-map "^27.2.4" - jest-message-util "^27.2.4" - jest-regex-util "^27.0.6" - jest-resolve "^27.2.4" - jest-resolve-dependencies "^27.2.4" - jest-runner "^27.2.4" - jest-runtime "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" - jest-watcher "^27.2.4" - micromatch "^4.0.4" - rimraf "^3.0.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - -"@jest/environment@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.4.tgz#db3e60f7dd30ab950f6ce2d6d7293ed9a6b7cbcd" - integrity sha512-wkuui5yr3SSQW0XD0Qm3TATUbL/WE3LDEM3ulC+RCQhMf2yxhci8x7svGkZ4ivJ6Pc94oOzpZ6cdHBAMSYd1ew== - dependencies: - "@jest/fake-timers" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/node" "*" - jest-mock "^27.2.4" - -"@jest/fake-timers@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.4.tgz#00df08bd60332bd59503cb5b6db21e4903785f86" - integrity sha512-cs/TzvwWUM7kAA6Qm/890SK6JJ2pD5RfDNM3SSEom6BmdyV6OiWP1qf/pqo6ts6xwpcM36oN0wSEzcZWc6/B6w== - dependencies: - "@jest/types" "^27.2.4" - "@sinonjs/fake-timers" "^8.0.1" - "@types/node" "*" - jest-message-util "^27.2.4" - jest-mock "^27.2.4" - jest-util "^27.2.4" - -"@jest/globals@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.4.tgz#0aeb22b011f8c8c4b8ff3b4dbd1ee0392fe0dd8a" - integrity sha512-DRsRs5dh0i+fA9mGHylTU19+8fhzNJoEzrgsu+zgJoZth3x8/0juCQ8nVVdW1er4Cqifb/ET7/hACYVPD0dBEA== - dependencies: - "@jest/environment" "^27.2.4" - "@jest/types" "^27.2.4" - expect "^27.2.4" - -"@jest/reporters@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.4.tgz#1482ff007f2e919d85c54b1563abb8b2ea2d5198" - integrity sha512-LHeSdDnDZkDnJ8kvnjcqV8P1Yv/32yL4d4XfR5gBiy3xGO0onwll1QEbvtW96fIwhx2nejug0GTaEdNDoyr3fQ== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" - chalk "^4.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.2" - graceful-fs "^4.2.4" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.3" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.2" - jest-haste-map "^27.2.4" - jest-resolve "^27.2.4" - jest-util "^27.2.4" - jest-worker "^27.2.4" - slash "^3.0.0" - source-map "^0.6.0" - string-length "^4.0.1" - terminal-link "^2.0.0" - v8-to-istanbul "^8.1.0" - -"@jest/source-map@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.6.tgz#be9e9b93565d49b0548b86e232092491fb60551f" - integrity sha512-Fek4mi5KQrqmlY07T23JRi0e7Z9bXTOOD86V/uS0EIW4PClvPDqZOyFlLpNJheS6QI0FNX1CgmPjtJ4EA/2M+g== - dependencies: - callsites "^3.0.0" - graceful-fs "^4.2.4" - source-map "^0.6.0" - -"@jest/test-result@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.4.tgz#d1ca8298d168f1b0be834bfb543b1ac0294c05d7" - integrity sha512-eU+PRo0+lIS01b0dTmMdVZ0TtcRSxEaYquZTRFMQz6CvsehGhx9bRzi9Zdw6VROviJyv7rstU+qAMX5pNBmnfQ== - dependencies: - "@jest/console" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - -"@jest/test-sequencer@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.4.tgz#df66422a3e9e7440ce8b7498e255fa6b52c0bc03" - integrity sha512-fpk5eknU3/DXE2QCCG1wv/a468+cfPo3Asu6d6yUtM9LOPh709ubZqrhuUOYfM8hXMrIpIdrv1CdCrWWabX0rQ== - dependencies: - "@jest/test-result" "^27.2.4" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" - jest-runtime "^27.2.4" - -"@jest/transform@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.4.tgz#2fe5b6836895f7a1b8bdec442c51e83943c62733" - integrity sha512-n5FlX2TH0oQGwyVDKPxdJ5nI2sO7TJBFe3u3KaAtt7TOiV4yL+Y+rSFDl+Ic5MpbiA/eqXmLAQxjnBmWgS2rEA== - dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^27.2.4" - babel-plugin-istanbul "^6.0.0" - chalk "^4.0.0" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" - jest-regex-util "^27.0.6" - jest-util "^27.2.4" - micromatch "^4.0.4" - pirates "^4.0.1" - slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" - -"@jest/types@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" - integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@rollup/plugin-commonjs@^21.0.0": - version "21.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.0.tgz#b9e4342855ea20b5528f4587b9a90f642196a502" - integrity sha512-XDQimjHl0kNotAV5lLo34XoygaI0teqiKGJ100B3iCU8+15YscJPeqk2KqkqD3NIe1H8ZTUo5lYjUFZyEgASTw== - dependencies: - "@rollup/pluginutils" "^3.1.0" - commondir "^1.0.1" - estree-walker "^2.0.1" - glob "^7.1.6" - is-reference "^1.2.1" - magic-string "^0.25.7" - resolve "^1.17.0" - -"@rollup/plugin-node-resolve@^13.0.5": - version "13.0.5" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.5.tgz#016abe58796a4ff544d6beac7818921e3d3777fc" - integrity sha512-mVaw6uxtvuGx/XCI4qBQXsDZJUfyx5vp39iE0J/7Hd6wDhEbjHr6aES7Nr9yWbuE0BY+oKp6N7Bq6jX5NCGNmQ== - dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" - builtin-modules "^3.1.0" - deepmerge "^4.2.2" - is-module "^1.0.0" - resolve "^1.19.0" - -"@rollup/plugin-replace@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-3.0.0.tgz#3a4c9665d4e7a4ce2c360cf021232784892f3fac" - integrity sha512-3c7JCbMuYXM4PbPWT4+m/4Y6U60SgsnDT/cCyAyUKwFHg7pTSfsSQzIpETha3a3ig6OdOKzZz87D9ZXIK3qsDg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - magic-string "^0.25.7" - -"@rollup/pluginutils@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" - integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== - dependencies: - "@types/estree" "0.0.39" - estree-walker "^1.0.1" - picomatch "^2.2.2" - -"@rollup/pluginutils@^4.1.0": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" - integrity sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ== - dependencies: - estree-walker "^2.0.1" - picomatch "^2.2.2" - -"@sinonjs/commons@^1.7.0": - version "1.8.3" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^8.0.1": - version "8.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz#1c1c9a91419f804e59ae8df316a07dd1c3a76b94" - integrity sha512-AU7kwFxreVd6OAXcAFlKSmZquiRUU0FvYm44k1Y1QbK7Co4m0aqfGMhjykIeQp/H6rcl+nFmj0zfdUcGVs9Dew== - dependencies: - "@sinonjs/commons" "^1.7.0" - -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== - -"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": - version "7.1.16" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" - integrity sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.3.tgz#f456b4b2ce79137f768aa130d2423d2f0ccfaba5" - integrity sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*": - version "7.4.1" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" - integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43" - integrity sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA== - dependencies: - "@babel/types" "^7.3.0" - -"@types/estree@*": - version "0.0.50" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" - integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== - -"@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== - -"@types/graceful-fs@^4.1.2": - version "4.1.5" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" - integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== - dependencies: - "@types/node" "*" - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" - integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== - -"@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== - dependencies: - "@types/istanbul-lib-report" "*" - -"@types/jest@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.2.tgz#ac383c4d4aaddd29bbf2b916d8d105c304a5fcd7" - integrity sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA== - dependencies: - jest-diff "^27.0.0" - pretty-format "^27.0.0" - -"@types/json-schema@^7.0.7": - version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== - -"@types/node@*": - version "16.10.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.3.tgz#7a8f2838603ea314d1d22bb3171d899e15c57bd5" - integrity sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ== - -"@types/prettier@^2.1.5": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.1.tgz#e1303048d5389563e130f5bdd89d37a99acb75eb" - integrity sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw== - -"@types/resolve@1.17.1": - version "1.17.1" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" - integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== - dependencies: - "@types/node" "*" - -"@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== - -"@types/yargs-parser@*": - version "20.2.1" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" - integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== - -"@types/yargs@^16.0.0": - version "16.0.4" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" - integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== - dependencies: - "@types/yargs-parser" "*" - -"@typescript-eslint/eslint-plugin@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" - integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== - dependencies: - "@typescript-eslint/experimental-utils" "4.33.0" - "@typescript-eslint/scope-manager" "4.33.0" - debug "^4.3.1" - functional-red-black-tree "^1.0.1" - ignore "^5.1.8" - regexpp "^3.1.0" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/experimental-utils@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" - integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== - dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - -"@typescript-eslint/parser@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" - integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== - dependencies: - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - debug "^4.3.1" - -"@typescript-eslint/scope-manager@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" - integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - -"@typescript-eslint/types@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" - integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== - -"@typescript-eslint/typescript-estree@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" - integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/visitor-keys@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" - integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== - dependencies: - "@typescript-eslint/types" "4.33.0" - eslint-visitor-keys "^2.0.0" - -abab@^2.0.3, abab@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" - integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== - -acorn-globals@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" - integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== - dependencies: - acorn "^7.1.1" - acorn-walk "^7.1.1" - -acorn-jsx@^5.3.1: - version "5.3.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -acorn-walk@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" - integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== - -acorn@^7.1.1, acorn@^7.4.0: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -acorn@^8.2.4: - version "8.5.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" - integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -ajv@^6.10.0, ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^8.0.1: - version "8.6.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" - integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - -anymatch@^3.0.3: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -babel-helper-evaluate-path@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c" - integrity sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA== - -babel-helper-flip-expressions@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz#3696736a128ac18bc25254b5f40a22ceb3c1d3fd" - integrity sha1-NpZzahKKwYvCUlS19AoizrPB0/0= - -babel-helper-is-nodes-equiv@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" - integrity sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ= - -babel-helper-is-void-0@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz#7d9c01b4561e7b95dbda0f6eee48f5b60e67313e" - integrity sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4= - -babel-helper-mark-eval-scopes@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" - integrity sha1-0kSjvvmESHJgP/tG4izorN9VFWI= - -babel-helper-remove-or-void@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" - integrity sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA= - -babel-helper-to-multiple-sequence-expressions@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" - integrity sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA== - -babel-jest@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.4.tgz#21ed6729d51bdd75470bbbf3c8b08d86209fb0dc" - integrity sha512-f24OmxyWymk5jfgLdlCMu4fTs4ldxFBIdn5sJdhvGC1m08rSkJ5hYbWkNmfBSvE/DjhCVNSHXepxsI6THGfGsg== - dependencies: - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/babel__core" "^7.1.14" - babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^27.2.0" - chalk "^4.0.0" - graceful-fs "^4.2.4" - slash "^3.0.0" - -babel-plugin-istanbul@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" - integrity sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^4.0.0" - test-exclude "^6.0.0" - -babel-plugin-jest-hoist@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.2.0.tgz#79f37d43f7e5c4fdc4b2ca3e10cc6cf545626277" - integrity sha512-TOux9khNKdi64mW+0OIhcmbAn75tTlzKhxmiNXevQaPbrBYK7YKjP1jl6NHTJ6XR5UgUrJbCnWlKVnJn29dfjw== - dependencies: - "@babel/template" "^7.3.3" - "@babel/types" "^7.3.3" - "@types/babel__core" "^7.0.0" - "@types/babel__traverse" "^7.0.6" - -babel-plugin-minify-builtins@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz#31eb82ed1a0d0efdc31312f93b6e4741ce82c36b" - integrity sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag== - -babel-plugin-minify-constant-folding@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz#f84bc8dbf6a561e5e350ff95ae216b0ad5515b6e" - integrity sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ== - dependencies: - babel-helper-evaluate-path "^0.5.0" - -babel-plugin-minify-dead-code-elimination@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz#1a0c68e44be30de4976ca69ffc535e08be13683f" - integrity sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg== - dependencies: - babel-helper-evaluate-path "^0.5.0" - babel-helper-mark-eval-scopes "^0.4.3" - babel-helper-remove-or-void "^0.4.3" - lodash "^4.17.11" - -babel-plugin-minify-flip-comparisons@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz#00ca870cb8f13b45c038b3c1ebc0f227293c965a" - integrity sha1-AMqHDLjxO0XAOLPB68DyJyk8llo= - dependencies: - babel-helper-is-void-0 "^0.4.3" - -babel-plugin-minify-guarded-expressions@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz#818960f64cc08aee9d6c75bec6da974c4d621135" - integrity sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA== - dependencies: - babel-helper-evaluate-path "^0.5.0" - babel-helper-flip-expressions "^0.4.3" - -babel-plugin-minify-infinity@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz#dfb876a1b08a06576384ef3f92e653ba607b39ca" - integrity sha1-37h2obCKBldjhO8/kuZTumB7Oco= - -babel-plugin-minify-mangle-names@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz#bcddb507c91d2c99e138bd6b17a19c3c271e3fd3" - integrity sha512-3jdNv6hCAw6fsX1p2wBGPfWuK69sfOjfd3zjUXkbq8McbohWy23tpXfy5RnToYWggvqzuMOwlId1PhyHOfgnGw== - dependencies: - babel-helper-mark-eval-scopes "^0.4.3" - -babel-plugin-minify-numeric-literals@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz#8e4fd561c79f7801286ff60e8c5fd9deee93c0bc" - integrity sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw= - -babel-plugin-minify-replace@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz#d3e2c9946c9096c070efc96761ce288ec5c3f71c" - integrity sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q== - -babel-plugin-minify-simplify@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz#f21613c8b95af3450a2ca71502fdbd91793c8d6a" - integrity sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A== - dependencies: - babel-helper-evaluate-path "^0.5.0" - babel-helper-flip-expressions "^0.4.3" - babel-helper-is-nodes-equiv "^0.0.1" - babel-helper-to-multiple-sequence-expressions "^0.5.0" - -babel-plugin-minify-type-constructors@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz#1bc6f15b87f7ab1085d42b330b717657a2156500" - integrity sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA= - dependencies: - babel-helper-is-void-0 "^0.4.3" - -babel-plugin-transform-inline-consecutive-adds@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz#323d47a3ea63a83a7ac3c811ae8e6941faf2b0d1" - integrity sha1-Mj1Ho+pjqDp6w8gRro5pQfrysNE= - -babel-plugin-transform-member-expression-literals@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz#37039c9a0c3313a39495faac2ff3a6b5b9d038bf" - integrity sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8= - -babel-plugin-transform-merge-sibling-variables@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz#85b422fc3377b449c9d1cde44087203532401dae" - integrity sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4= - -babel-plugin-transform-minify-booleans@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198" - integrity sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg= - -babel-plugin-transform-property-literals@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39" - integrity sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk= - dependencies: - esutils "^2.0.2" - -babel-plugin-transform-regexp-constructors@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz#58b7775b63afcf33328fae9a5f88fbd4fb0b4965" - integrity sha1-WLd3W2OvzzMyj66aX4j71PsLSWU= - -babel-plugin-transform-remove-console@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780" - integrity sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A= - -babel-plugin-transform-remove-debugger@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz#42b727631c97978e1eb2d199a7aec84a18339ef2" - integrity sha1-QrcnYxyXl44estGZp67IShgznvI= - -babel-plugin-transform-remove-undefined@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz#80208b31225766c630c97fa2d288952056ea22dd" - integrity sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ== - dependencies: - babel-helper-evaluate-path "^0.5.0" - -babel-plugin-transform-simplify-comparison-operators@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9" - integrity sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk= - -babel-plugin-transform-undefined-to-void@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280" - integrity sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA= - -babel-preset-current-node-syntax@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" - integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== - dependencies: - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.8.3" - -babel-preset-jest@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.2.0.tgz#556bbbf340608fed5670ab0ea0c8ef2449fba885" - integrity sha512-z7MgQ3peBwN5L5aCqBKnF6iqdlvZvFUQynEhu0J+X9nHLU72jO3iY331lcYrg+AssJ8q7xsv5/3AICzVmJ/wvg== - dependencies: - babel-plugin-jest-hoist "^27.2.0" - babel-preset-current-node-syntax "^1.0.0" - -babel-preset-minify@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/babel-preset-minify/-/babel-preset-minify-0.5.1.tgz#25f5d0bce36ec818be80338d0e594106e21eaa9f" - integrity sha512-1IajDumYOAPYImkHbrKeiN5AKKP9iOmRoO2IPbIuVp0j2iuCcj0n7P260z38siKMZZ+85d3mJZdtW8IgOv+Tzg== - dependencies: - babel-plugin-minify-builtins "^0.5.0" - babel-plugin-minify-constant-folding "^0.5.0" - babel-plugin-minify-dead-code-elimination "^0.5.1" - babel-plugin-minify-flip-comparisons "^0.4.3" - babel-plugin-minify-guarded-expressions "^0.4.4" - babel-plugin-minify-infinity "^0.4.3" - babel-plugin-minify-mangle-names "^0.5.0" - babel-plugin-minify-numeric-literals "^0.4.3" - babel-plugin-minify-replace "^0.5.0" - babel-plugin-minify-simplify "^0.5.1" - babel-plugin-minify-type-constructors "^0.4.3" - babel-plugin-transform-inline-consecutive-adds "^0.4.3" - babel-plugin-transform-member-expression-literals "^6.9.4" - babel-plugin-transform-merge-sibling-variables "^6.9.4" - babel-plugin-transform-minify-booleans "^6.9.4" - babel-plugin-transform-property-literals "^6.9.4" - babel-plugin-transform-regexp-constructors "^0.4.3" - babel-plugin-transform-remove-console "^6.9.4" - babel-plugin-transform-remove-debugger "^6.9.4" - babel-plugin-transform-remove-undefined "^0.5.0" - babel-plugin-transform-simplify-comparison-operators "^6.9.4" - babel-plugin-transform-undefined-to-void "^6.9.4" - lodash "^4.17.11" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - -browserslist@^4.16.6: - version "4.17.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.3.tgz#2844cd6eebe14d12384b0122d217550160d2d624" - integrity sha512-59IqHJV5VGdcJZ+GZ2hU5n4Kv3YiASzW6Xk5g9tf5a/MAzGeFwgGWU39fVzNIOVcgB3+Gp+kiQu0HEfTVU/3VQ== - dependencies: - caniuse-lite "^1.0.30001264" - electron-to-chromium "^1.3.857" - escalade "^3.1.1" - node-releases "^1.1.77" - picocolors "^0.2.1" - -bs-logger@0.x: - version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - -bser@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -builtin-modules@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" - integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== - -caniuse-lite@^1.0.30001264: - version "1.0.30001264" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001264.tgz#88f625a60efb6724c7c62ac698bc8dbd9757e55b" - integrity sha512-Ftfqqfcs/ePiUmyaySsQ4PUsdcYyXG2rfoBVsk3iY1ahHaJEw65vfb7Suzqm+cEkwwPIv/XWkg27iCpRavH4zA== - -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -char-regex@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" - integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== - -ci-info@^3.1.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" - integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== - -cjs-module-lexer@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" - integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -collect-v8-coverage@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" - integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" - -cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -cssom@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" - integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== - -cssom@~0.3.6: - version "0.3.8" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" - integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== - -cssstyle@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" - integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== - dependencies: - cssom "~0.3.6" - -data-urls@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" - integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== - dependencies: - abab "^2.0.3" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" - -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== - dependencies: - ms "2.1.2" - -decimal.js@^10.2.1: - version "10.3.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" - integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== - -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= - -deep-is@^0.1.3, deep-is@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -deepmerge@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" - integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -detect-newline@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - -diff-sequences@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" - integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -domexception@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" - integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== - dependencies: - webidl-conversions "^5.0.0" - -electron-to-chromium@^1.3.857: - version "1.3.860" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.860.tgz#d612e54ed75fa524c12af8da3ad8121ebfe2802b" - integrity sha512-gWwGZ+Wv4Mou2SJRH6JQzhTPjL5f95SX7n6VkLTQ/Q/INsZLZNQ1vH2GlZjozKyvT0kkFuCmWTwIoCj+/hUDPw== - -emittery@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" - integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -escodegen@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" - integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== - dependencies: - esprima "^4.0.1" - estraverse "^5.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -eslint-config-prettier@8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" - integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== - -eslint-plugin-prettier@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" - integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - -eslint@7.32.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== - dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" - ajv "^6.10.0" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.0.1" - doctrine "^3.0.0" - enquirer "^2.3.5" - escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" - globals "^13.6.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.0.4" - natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^6.0.9" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== - dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" - -esprima@^4.0.0, esprima@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== - -estree-walker@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" - integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== - -estree-walker@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -expect@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.4.tgz#4debf546050bcdad8914a8c95fec7662e02bf67c" - integrity sha512-gOtuonQ8TCnbNNCSw2fhVzRf8EFYDII4nB5NmG4IEV0rbUnW1I5zXvoTntU4iicB/Uh0oZr20NGlOLdJiwsOZA== - dependencies: - "@jest/types" "^27.2.4" - ansi-styles "^5.0.0" - jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-regex-util "^27.0.6" - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - -fast-glob@^3.1.1: - version "3.2.7" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" - integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== - dependencies: - reusify "^1.0.4" - -fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== - dependencies: - bser "2.1.1" - -fflate@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.7.1.tgz#56e87e87c3f2fe01b025fbb1c4ea835990c02fa2" - integrity sha512-VYM2Xy1gSA5MerKzCnmmuV2XljkpKwgJBKezW+495TTnTCh1x5HcYa1aH8wRU/MfTGhW4ziXqgwprgQUVl3Ohw== - -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-cache-dir@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" - integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== - dependencies: - commondir "^1.0.1" - make-dir "^3.0.2" - pkg-dir "^4.1.0" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== - dependencies: - flatted "^3.1.0" - rimraf "^3.0.2" - -flatted@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" - integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== - -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -fs-extra@8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^2.3.2, fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-package-type@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" - integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== - -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -globals@^13.6.0, globals@^13.9.0: - version "13.11.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" - integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== - dependencies: - type-fest "^0.20.2" - -globby@^11.0.3: - version "11.0.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" - integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - -graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -html-encoding-sniffer@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" - integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== - dependencies: - whatwg-encoding "^1.0.5" - -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -ignore@^5.1.4, ignore@^5.1.8: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== - -import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-local@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" - integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -is-ci@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.0.tgz#c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994" - integrity sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ== - dependencies: - ci-info "^3.1.1" - -is-core-module@^2.2.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" - integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== - dependencies: - has "^1.0.3" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" - integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-potential-custom-element-name@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" - integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== - -is-reference@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" - integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== - dependencies: - "@types/estree" "*" - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -is-typedarray@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -istanbul-lib-coverage@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.1.tgz#e8900b3ed6069759229cf30f7067388d148aeb5e" - integrity sha512-GvCYYTxaCPqwMjobtVcVKvSHtAGe48MNhGjpK8LtVF8K0ISX7hCKl85LgtuaSneWVyQmaGcW3iXVV3GaZSLpmQ== - -istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" - integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== - dependencies: - "@babel/core" "^7.7.5" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" - semver "^6.3.0" - -istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" - integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" - integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - -jest-changed-files@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.4.tgz#d7de46e90e5a599c47e260760f5ab53516e835e6" - integrity sha512-eeO1C1u4ex7pdTroYXezr+rbr957myyVoKGjcY4R1TJi3A+9v+4fu1Iv9J4eLq1bgFyT3O3iRWU9lZsEE7J72Q== - dependencies: - "@jest/types" "^27.2.4" - execa "^5.0.0" - throat "^6.0.1" - -jest-circus@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.4.tgz#3bd898a29dcaf6a506f3f1b780dff5f67ca83c23" - integrity sha512-TtheheTElrGjlsY9VxkzUU1qwIx05ItIusMVKnvNkMt4o/PeegLRcjq3Db2Jz0GGdBalJdbzLZBgeulZAJxJWA== - dependencies: - "@jest/environment" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - dedent "^0.7.0" - expect "^27.2.4" - is-generator-fn "^2.0.0" - jest-each "^27.2.4" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-runtime "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - pretty-format "^27.2.4" - slash "^3.0.0" - stack-utils "^2.0.3" - throat "^6.0.1" - -jest-cli@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.4.tgz#acda7f367aa6e674723fc1a7334e0ae1799448d2" - integrity sha512-4kpQQkg74HYLaXo3nzwtg4PYxSLgL7puz1LXHj5Tu85KmlIpxQFjRkXlx4V47CYFFIDoyl3rHA/cXOxUWyMpNg== - dependencies: - "@jest/core" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.4" - import-local "^3.0.2" - jest-config "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" - prompts "^2.0.1" - yargs "^16.2.0" - -jest-config@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.4.tgz#0204969f5ae2e5190d47be2c14c04d631b7836e2" - integrity sha512-tWy0UxhdzqiKyp4l5Vq4HxLyD+gH5td+GCF3c22/DJ0bYAOsMo+qi2XtbJI6oYMH5JOJQs9nLW/r34nvFCehjA== - dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.2.4" - "@jest/types" "^27.2.4" - babel-jest "^27.2.4" - chalk "^4.0.0" - deepmerge "^4.2.2" - glob "^7.1.1" - graceful-fs "^4.2.4" - is-ci "^3.0.0" - jest-circus "^27.2.4" - jest-environment-jsdom "^27.2.4" - jest-environment-node "^27.2.4" - jest-get-type "^27.0.6" - jest-jasmine2 "^27.2.4" - jest-regex-util "^27.0.6" - jest-resolve "^27.2.4" - jest-runner "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" - micromatch "^4.0.4" - pretty-format "^27.2.4" - -jest-diff@^27.0.0, jest-diff@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" - integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== - dependencies: - chalk "^4.0.0" - diff-sequences "^27.0.6" - jest-get-type "^27.0.6" - pretty-format "^27.2.4" - -jest-docblock@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" - integrity sha512-Fid6dPcjwepTFraz0YxIMCi7dejjJ/KL9FBjPYhBp4Sv1Y9PdhImlKZqYU555BlN4TQKaTc+F2Av1z+anVyGkA== - dependencies: - detect-newline "^3.0.0" - -jest-each@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.4.tgz#b4f280aafd63129ba82e345f0e74c5a10200aeef" - integrity sha512-w9XVc+0EDBUTJS4xBNJ7N2JCcWItFd006lFjz77OarAQcQ10eFDBMrfDv2GBJMKlXe9aq0HrIIF51AXcZrRJyg== - dependencies: - "@jest/types" "^27.2.4" - chalk "^4.0.0" - jest-get-type "^27.0.6" - jest-util "^27.2.4" - pretty-format "^27.2.4" - -jest-environment-jsdom@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.4.tgz#39ae80bbb8675306bfaf0440be1e5f877554539a" - integrity sha512-X70pTXFSypD7AIzKT1mLnDi5hP9w9mdTRcOGOmoDoBrNyNEg4rYm6d4LQWFLc9ps1VnMuDOkFSG0wjSNYGjkng== - dependencies: - "@jest/environment" "^27.2.4" - "@jest/fake-timers" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/node" "*" - jest-mock "^27.2.4" - jest-util "^27.2.4" - jsdom "^16.6.0" - -jest-environment-node@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.4.tgz#b79f98cb36e0c9111aac859c9c99f04eb2f74ff6" - integrity sha512-ZbVbFSnbzTvhLOIkqh5lcLuGCCFvtG4xTXIRPK99rV2KzQT3kNg16KZwfTnLNlIiWCE8do960eToeDfcqmpSAw== - dependencies: - "@jest/environment" "^27.2.4" - "@jest/fake-timers" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/node" "*" - jest-mock "^27.2.4" - jest-util "^27.2.4" - -jest-get-type@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" - integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== - -jest-haste-map@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.4.tgz#f8974807bedf07348ca9fd24e5861ab7c8e61aba" - integrity sha512-bkJ4bT00T2K+1NZXbRcyKnbJ42I6QBvoDNMTAQQDBhaGNnZreiQKUNqax0e6hLTx7E75pKDeltVu3V1HAdu+YA== - dependencies: - "@jest/types" "^27.2.4" - "@types/graceful-fs" "^4.1.2" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.4" - jest-regex-util "^27.0.6" - jest-serializer "^27.0.6" - jest-util "^27.2.4" - jest-worker "^27.2.4" - micromatch "^4.0.4" - walker "^1.0.7" - optionalDependencies: - fsevents "^2.3.2" - -jest-jasmine2@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.4.tgz#4a1608133dbdb4d68b5929bfd785503ed9c9ba51" - integrity sha512-fcffjO/xLWLVnW2ct3No4EksxM5RyPwHDYu9QU+90cC+/eSMLkFAxS55vkqsxexOO5zSsZ3foVpMQcg/amSeIQ== - dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.2.4" - "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - expect "^27.2.4" - is-generator-fn "^2.0.0" - jest-each "^27.2.4" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-runtime "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - pretty-format "^27.2.4" - throat "^6.0.1" - -jest-leak-detector@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.4.tgz#9bb7eab26a73bb280e9298be8d80f389288ec8f1" - integrity sha512-SrcHWbe0EHg/bw2uBjVoHacTo5xosl068x2Q0aWsjr2yYuW2XwqrSkZV4lurUop0jhv1709ymG4or+8E4sH27Q== - dependencies: - jest-get-type "^27.0.6" - pretty-format "^27.2.4" - -jest-matcher-utils@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.4.tgz#008fff018151415ad1b6cfc083fd70fe1e012525" - integrity sha512-nQeLfFAIPPkyhkDfifAPfP/U5wm1x0fLtAzqXZSSKckXDNuk2aaOfQiDYv1Mgf5GY6yOsxfUnvNm3dDjXM+BXw== - dependencies: - chalk "^4.0.0" - jest-diff "^27.2.4" - jest-get-type "^27.0.6" - pretty-format "^27.2.4" - -jest-message-util@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.4.tgz#667e8c0f2b973156d1bac7398a7f677705cafaca" - integrity sha512-wbKT/BNGnBVB9nzi+IoaLkXt6fbSvqUxx+IYY66YFh96J3goY33BAaNG3uPqaw/Sh/FR9YpXGVDfd5DJdbh4nA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.2.4" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.4" - micromatch "^4.0.4" - pretty-format "^27.2.4" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-mock@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.4.tgz#c8f0ef33f73d8ff53e3f60b16d59f1128f4072ae" - integrity sha512-iVRU905rutaAoUcrt5Tm1JoHHWi24YabqEGXjPJI4tAyA6wZ7mzDi3GrZ+M7ebgWBqUkZE93GAx1STk7yCMIQA== - dependencies: - "@jest/types" "^27.2.4" - "@types/node" "*" - -jest-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== - -jest-regex-util@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" - integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== - -jest-resolve-dependencies@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.4.tgz#20c41cc02b66aa45169b282356ec73b133013089" - integrity sha512-i5s7Uh9B3Q6uwxLpMhNKlgBf6pcemvWaORxsW1zNF/YCY3jd5EftvnGBI+fxVwJ1CBxkVfxqCvm1lpZkbaoGmg== - dependencies: - "@jest/types" "^27.2.4" - jest-regex-util "^27.0.6" - jest-snapshot "^27.2.4" - -jest-resolve@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.4.tgz#d3b999f073ff84a8ae109ce99ff7f3223048701a" - integrity sha512-IsAO/3+3BZnKjI2I4f3835TBK/90dxR7Otgufn3mnrDFTByOSXclDi3G2XJsawGV4/18IMLARJ+V7Wm7t+J89Q== - dependencies: - "@jest/types" "^27.2.4" - chalk "^4.0.0" - escalade "^3.1.1" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" - jest-pnp-resolver "^1.2.2" - jest-util "^27.2.4" - jest-validate "^27.2.4" - resolve "^1.20.0" - slash "^3.0.0" - -jest-runner@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.4.tgz#d816f4cb4af04f3cba703afcf5a35a335b77cad4" - integrity sha512-hIo5PPuNUyVDidZS8EetntuuJbQ+4IHWxmHgYZz9FIDbG2wcZjrP6b52uMDjAEQiHAn8yn8ynNe+TL8UuGFYKg== - dependencies: - "@jest/console" "^27.2.4" - "@jest/environment" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/node" "*" - chalk "^4.0.0" - emittery "^0.8.1" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-docblock "^27.0.6" - jest-environment-jsdom "^27.2.4" - jest-environment-node "^27.2.4" - jest-haste-map "^27.2.4" - jest-leak-detector "^27.2.4" - jest-message-util "^27.2.4" - jest-resolve "^27.2.4" - jest-runtime "^27.2.4" - jest-util "^27.2.4" - jest-worker "^27.2.4" - source-map-support "^0.5.6" - throat "^6.0.1" - -jest-runtime@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.4.tgz#170044041e5d30625ab8d753516bbe503f213a5c" - integrity sha512-ICKzzYdjIi70P17MZsLLIgIQFCQmIjMFf+xYww3aUySiUA/QBPUTdUqo5B2eg4HOn9/KkUsV0z6GVgaqAPBJvg== - dependencies: - "@jest/console" "^27.2.4" - "@jest/environment" "^27.2.4" - "@jest/fake-timers" "^27.2.4" - "@jest/globals" "^27.2.4" - "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - cjs-module-lexer "^1.0.0" - collect-v8-coverage "^1.0.0" - execa "^5.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" - jest-message-util "^27.2.4" - jest-mock "^27.2.4" - jest-regex-util "^27.0.6" - jest-resolve "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" - slash "^3.0.0" - strip-bom "^4.0.0" - yargs "^16.2.0" - -jest-serializer@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.6.tgz#93a6c74e0132b81a2d54623251c46c498bb5bec1" - integrity sha512-PtGdVK9EGC7dsaziskfqaAPib6wTViY3G8E5wz9tLVPhHyiDNTZn/xjZ4khAw+09QkoOVpn7vF5nPSN6dtBexA== - dependencies: - "@types/node" "*" - graceful-fs "^4.2.4" - -jest-snapshot@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.4.tgz#277b2269437e3ffcb91d95a73b24becf33c5a871" - integrity sha512-5DFxK31rYS8X8C6WXsFx8XxrxW3PGa6+9IrUcZdTLg1aEyXDGIeiBh4jbwvh655bg/9vTETbEj/njfZicHTZZw== - dependencies: - "@babel/core" "^7.7.2" - "@babel/generator" "^7.7.2" - "@babel/parser" "^7.7.2" - "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/traverse" "^7.7.2" - "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/babel__traverse" "^7.0.4" - "@types/prettier" "^2.1.5" - babel-preset-current-node-syntax "^1.0.0" - chalk "^4.0.0" - expect "^27.2.4" - graceful-fs "^4.2.4" - jest-diff "^27.2.4" - jest-get-type "^27.0.6" - jest-haste-map "^27.2.4" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-resolve "^27.2.4" - jest-util "^27.2.4" - natural-compare "^1.4.0" - pretty-format "^27.2.4" - semver "^7.3.2" - -jest-util@^27.0.0, jest-util@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.4.tgz#3d7ce081b2e7f4cfe0156452ac01f3cb456cc656" - integrity sha512-mW++4u+fSvAt3YBWm5IpbmRAceUqa2B++JlUZTiuEt2AmNYn0Yw5oay4cP17TGsMINRNPSGiJ2zNnX60g+VbFg== - dependencies: - "@jest/types" "^27.2.4" - "@types/node" "*" - chalk "^4.0.0" - graceful-fs "^4.2.4" - is-ci "^3.0.0" - picomatch "^2.2.3" - -jest-validate@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.4.tgz#b66d462b2fb93d7e16a47d1aa8763d5600bf2cfa" - integrity sha512-VMtbxbkd7LHnIH7PChdDtrluCFRJ4b1YV2YJzNwwsASMWftq/HgqiqjvptBOWyWOtevgO3f14wPxkPcLlVBRog== - dependencies: - "@jest/types" "^27.2.4" - camelcase "^6.2.0" - chalk "^4.0.0" - jest-get-type "^27.0.6" - leven "^3.1.0" - pretty-format "^27.2.4" - -jest-watcher@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.4.tgz#b1d5c39ab94f59f4f35f66cc96f7761a10e0cfc4" - integrity sha512-LXC/0+dKxhK7cfF7reflRYlzDIaQE+fL4ynhKhzg8IMILNMuI4xcjXXfUJady7OR4/TZeMg7X8eHx8uan9vqaQ== - dependencies: - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - jest-util "^27.2.4" - string-length "^4.0.1" - -jest-worker@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.4.tgz#881455df75e22e7726a53f43703ab74d6b36f82d" - integrity sha512-Zq9A2Pw59KkVjBBKD1i3iE2e22oSjXhUKKuAK1HGX8flGwkm6NMozyEYzKd41hXc64dbd/0eWFeEEuxqXyhM+g== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^8.0.0" - -jest@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.4.tgz#70e27bef873138afc123aa4769f7124c50ad3efb" - integrity sha512-h4uqb1EQLfPulWyUFFWv9e9Nn8sCqsJ/j3wk/KCY0p4s4s0ICCfP3iMf6hRf5hEhsDyvyrCgKiZXma63gMz16A== - dependencies: - "@jest/core" "^27.2.4" - import-local "^3.0.2" - jest-cli "^27.2.4" - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsdom@^16.6.0: - version "16.7.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" - integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== - dependencies: - abab "^2.0.5" - acorn "^8.2.4" - acorn-globals "^6.0.0" - cssom "^0.4.4" - cssstyle "^2.3.0" - data-urls "^2.0.0" - decimal.js "^10.2.1" - domexception "^2.0.1" - escodegen "^2.0.0" - form-data "^3.0.0" - html-encoding-sniffer "^2.0.1" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-potential-custom-element-name "^1.0.1" - nwsapi "^2.2.0" - parse5 "6.0.1" - saxes "^5.0.1" - symbol-tree "^3.2.4" - tough-cookie "^4.0.0" - w3c-hr-time "^1.0.2" - w3c-xmlserializer "^2.0.0" - webidl-conversions "^6.1.0" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.5.0" - ws "^7.4.6" - xml-name-validator "^3.0.0" - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -json5@2.x, json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= - -lodash@4.x, lodash@^4.17.11, lodash@^4.7.0: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -magic-string@^0.25.7: - version "0.25.7" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== - dependencies: - sourcemap-codec "^1.4.4" - -make-dir@^3.0.0, make-dir@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - -make-error@1.x: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= - dependencies: - tmpl "1.0.x" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - -mime-db@1.50.0: - version "1.50.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" - integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== - -mime-types@^2.1.12: - version "2.1.33" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" - integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== - dependencies: - mime-db "1.50.0" - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= - -node-modules-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" - integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= - -node-releases@^1.1.77: - version "1.1.77" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.77.tgz#50b0cfede855dd374e7585bf228ff34e57c1c32e" - integrity sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ== - -normalize-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -nwsapi@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" - integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== - dependencies: - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - word-wrap "^1.2.3" - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse5@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picocolors@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" - integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== - -picomatch@^2.0.4, picomatch@^2.2.2, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== - -pirates@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" - integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== - dependencies: - node-modules-regexp "^1.0.0" - -pkg-dir@^4.1.0, pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" - integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== - -pretty-format@^27.0.0, pretty-format@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" - integrity sha512-NUjw22WJHldzxyps2YjLZkUj6q1HvjqFezkB9Y2cklN8NtVZN/kZEXGZdFw4uny3oENzV5EEMESrkI0YDUH8vg== - dependencies: - "@jest/types" "^27.2.4" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -prompts@^2.0.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61" - integrity sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.5" - -psl@^1.1.33: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -react-is@^17.0.1: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" - integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== - -regexpp@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve@1.20.0, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^3.0.0, rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -rollup-plugin-babel-minify@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-babel-minify/-/rollup-plugin-babel-minify-10.0.0.tgz#7cb6df10b6a0d7acc4704305227e0f189bd5e88e" - integrity sha512-tYZOhGtffvGp8VzTrB5u/kPYyIjEEshTPEauOLkshPNx/MvCJVd6PCc2HX4CO0TDH0cBnnGKQ+yQpTERJikK4Q== - dependencies: - "@babel/core" "^7.8.7" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@comandeer/babel-plugin-banner" "^5.0.0" - babel-preset-minify "^0.5.1" - sourcemap-codec "^1.4.8" - -rollup-plugin-typescript2@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz#1cc99ac2309bf4b9d0a3ebdbc2002aecd56083d3" - integrity sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ== - dependencies: - "@rollup/pluginutils" "^4.1.0" - find-cache-dir "^3.3.1" - fs-extra "8.1.0" - resolve "1.20.0" - tslib "2.1.0" - -rollup@^2.58.0: - version "2.58.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.58.0.tgz#a643983365e7bf7f5b7c62a8331b983b7c4c67fb" - integrity sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw== - optionalDependencies: - fsevents "~2.3.2" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -saxes@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" - integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== - dependencies: - xmlchars "^2.2.0" - -semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.5" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" - integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== - -sisteransi@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" - integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - -source-map-support@^0.5.6: - version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -sourcemap-codec@^1.4.4, sourcemap-codec@^1.4.8: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== - dependencies: - escape-string-regexp "^2.0.0" - -string-length@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" - integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== - dependencies: - char-regex "^1.0.2" - strip-ansi "^6.0.0" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.0.0, supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-hyperlinks@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" - integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== - dependencies: - has-flag "^4.0.0" - supports-color "^7.0.0" - -symbol-tree@^3.2.4: - version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - -table@^6.0.9: - version "6.7.2" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.2.tgz#a8d39b9f5966693ca8b0feba270a78722cbaf3b0" - integrity sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g== - dependencies: - ajv "^8.0.1" - lodash.clonedeep "^4.5.0" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - -terminal-link@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" - integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== - dependencies: - ansi-escapes "^4.2.1" - supports-hyperlinks "^2.0.0" - -test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -throat@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" - integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== - -tmpl@1.0.x: - version "1.0.5" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" - integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -tough-cookie@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" - integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg== - dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.1.2" - -tr46@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" - integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== - dependencies: - punycode "^2.1.1" - -ts-jest@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.5.tgz#0b0604e2271167ec43c12a69770f0bb65ad1b750" - integrity sha512-lIJApzfTaSSbtlksfFNHkWOzLJuuSm4faFAfo5kvzOiRAuoN4/eKxVJ2zEAho8aecE04qX6K1pAzfH5QHL1/8w== - dependencies: - bs-logger "0.x" - fast-json-stable-stringify "2.x" - jest-util "^27.0.0" - json5 "2.x" - lodash "4.x" - make-error "1.x" - semver "7.x" - yargs-parser "20.x" - -tslib@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" - integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== - -tslib@^1.8.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -typescript@^4.4.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" - integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== - -universalify@^0.1.0, universalify@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - -v8-to-istanbul@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c" - integrity sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - source-map "^0.7.3" - -w3c-hr-time@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - -w3c-xmlserializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" - integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== - dependencies: - xml-name-validator "^3.0.0" - -walker@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= - dependencies: - makeerror "1.0.x" - -webidl-conversions@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" - integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== - -webidl-conversions@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" - integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== - -whatwg-encoding@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - -whatwg-mimetype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - -whatwg-url@^8.0.0, whatwg-url@^8.5.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" - integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== - dependencies: - lodash "^4.7.0" - tr46 "^2.1.0" - webidl-conversions "^6.1.0" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -word-wrap@^1.2.3, word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write-file-atomic@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== - dependencies: - imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" - -ws@^7.4.6: - version "7.5.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" - integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== - -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - -xmlchars@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" - integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yargs-parser@20.x, yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 80da964f..00000000 --- a/yarn.lock +++ /dev/null @@ -1,5472 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== - dependencies: - "@babel/highlight" "^7.14.5" - -"@babel/helper-validator-identifier@^7.14.5": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== - -"@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@gar/promisify@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210" - integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw== - -"@hutson/parse-repository-url@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" - integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== - -"@lerna/add@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/add/-/add-4.0.0.tgz#c36f57d132502a57b9e7058d1548b7a565ef183f" - integrity sha512-cpmAH1iS3k8JBxNvnMqrGTTjbY/ZAiKa1ChJzFevMYY3eeqbvhsBKnBcxjRXtdrJ6bd3dCQM+ZtK+0i682Fhng== - dependencies: - "@lerna/bootstrap" "4.0.0" - "@lerna/command" "4.0.0" - "@lerna/filter-options" "4.0.0" - "@lerna/npm-conf" "4.0.0" - "@lerna/validation-error" "4.0.0" - dedent "^0.7.0" - npm-package-arg "^8.1.0" - p-map "^4.0.0" - pacote "^11.2.6" - semver "^7.3.4" - -"@lerna/bootstrap@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-4.0.0.tgz#5f5c5e2c6cfc8fcec50cb2fbe569a8c607101891" - integrity sha512-RkS7UbeM2vu+kJnHzxNRCLvoOP9yGNgkzRdy4UV2hNalD7EP41bLvRVOwRYQ7fhc2QcbhnKNdOBihYRL0LcKtw== - dependencies: - "@lerna/command" "4.0.0" - "@lerna/filter-options" "4.0.0" - "@lerna/has-npm-version" "4.0.0" - "@lerna/npm-install" "4.0.0" - "@lerna/package-graph" "4.0.0" - "@lerna/pulse-till-done" "4.0.0" - "@lerna/rimraf-dir" "4.0.0" - "@lerna/run-lifecycle" "4.0.0" - "@lerna/run-topologically" "4.0.0" - "@lerna/symlink-binary" "4.0.0" - "@lerna/symlink-dependencies" "4.0.0" - "@lerna/validation-error" "4.0.0" - dedent "^0.7.0" - get-port "^5.1.1" - multimatch "^5.0.0" - npm-package-arg "^8.1.0" - npmlog "^4.1.2" - p-map "^4.0.0" - p-map-series "^2.1.0" - p-waterfall "^2.1.1" - read-package-tree "^5.3.1" - semver "^7.3.4" - -"@lerna/changed@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-4.0.0.tgz#b9fc76cea39b9292a6cd263f03eb57af85c9270b" - integrity sha512-cD+KuPRp6qiPOD+BO6S6SN5cARspIaWSOqGBpGnYzLb4uWT8Vk4JzKyYtc8ym1DIwyoFXHosXt8+GDAgR8QrgQ== - dependencies: - "@lerna/collect-updates" "4.0.0" - "@lerna/command" "4.0.0" - "@lerna/listable" "4.0.0" - "@lerna/output" "4.0.0" - -"@lerna/check-working-tree@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-4.0.0.tgz#257e36a602c00142e76082a19358e3e1ae8dbd58" - integrity sha512-/++bxM43jYJCshBiKP5cRlCTwSJdRSxVmcDAXM+1oUewlZJVSVlnks5eO0uLxokVFvLhHlC5kHMc7gbVFPHv6Q== - dependencies: - "@lerna/collect-uncommitted" "4.0.0" - "@lerna/describe-ref" "4.0.0" - "@lerna/validation-error" "4.0.0" - -"@lerna/child-process@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-4.0.0.tgz#341b96a57dffbd9705646d316e231df6fa4df6e1" - integrity sha512-XtCnmCT9eyVsUUHx6y/CTBYdV9g2Cr/VxyseTWBgfIur92/YKClfEtJTbOh94jRT62hlKLqSvux/UhxXVh613Q== - dependencies: - chalk "^4.1.0" - execa "^5.0.0" - strong-log-transformer "^2.1.0" - -"@lerna/clean@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-4.0.0.tgz#8f778b6f2617aa2a936a6b5e085ae62498e57dc5" - integrity sha512-uugG2iN9k45ITx2jtd8nEOoAtca8hNlDCUM0N3lFgU/b1mEQYAPRkqr1qs4FLRl/Y50ZJ41wUz1eazS+d/0osA== - dependencies: - "@lerna/command" "4.0.0" - "@lerna/filter-options" "4.0.0" - "@lerna/prompt" "4.0.0" - "@lerna/pulse-till-done" "4.0.0" - "@lerna/rimraf-dir" "4.0.0" - p-map "^4.0.0" - p-map-series "^2.1.0" - p-waterfall "^2.1.1" - -"@lerna/cli@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-4.0.0.tgz#8eabd334558836c1664df23f19acb95e98b5bbf3" - integrity sha512-Neaw3GzFrwZiRZv2g7g6NwFjs3er1vhraIniEs0jjVLPMNC4eata0na3GfE5yibkM/9d3gZdmihhZdZ3EBdvYA== - dependencies: - "@lerna/global-options" "4.0.0" - dedent "^0.7.0" - npmlog "^4.1.2" - yargs "^16.2.0" - -"@lerna/collect-uncommitted@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-4.0.0.tgz#855cd64612969371cfc2453b90593053ff1ba779" - integrity sha512-ufSTfHZzbx69YNj7KXQ3o66V4RC76ffOjwLX0q/ab//61bObJ41n03SiQEhSlmpP+gmFbTJ3/7pTe04AHX9m/g== - dependencies: - "@lerna/child-process" "4.0.0" - chalk "^4.1.0" - npmlog "^4.1.2" - -"@lerna/collect-updates@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-4.0.0.tgz#8e208b1bafd98a372ff1177f7a5e288f6bea8041" - integrity sha512-bnNGpaj4zuxsEkyaCZLka9s7nMs58uZoxrRIPJ+nrmrZYp1V5rrd+7/NYTuunOhY2ug1sTBvTAxj3NZQ+JKnOw== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/describe-ref" "4.0.0" - minimatch "^3.0.4" - npmlog "^4.1.2" - slash "^3.0.0" - -"@lerna/command@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/command/-/command-4.0.0.tgz#991c7971df8f5bf6ae6e42c808869a55361c1b98" - integrity sha512-LM9g3rt5FsPNFqIHUeRwWXLNHJ5NKzOwmVKZ8anSp4e1SPrv2HNc1V02/9QyDDZK/w+5POXH5lxZUI1CHaOK/A== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/package-graph" "4.0.0" - "@lerna/project" "4.0.0" - "@lerna/validation-error" "4.0.0" - "@lerna/write-log-file" "4.0.0" - clone-deep "^4.0.1" - dedent "^0.7.0" - execa "^5.0.0" - is-ci "^2.0.0" - npmlog "^4.1.2" - -"@lerna/conventional-commits@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-4.0.0.tgz#660fb2c7b718cb942ead70110df61f18c6f99750" - integrity sha512-CSUQRjJHFrH8eBn7+wegZLV3OrNc0Y1FehYfYGhjLE2SIfpCL4bmfu/ViYuHh9YjwHaA+4SX6d3hR+xkeseKmw== - dependencies: - "@lerna/validation-error" "4.0.0" - conventional-changelog-angular "^5.0.12" - conventional-changelog-core "^4.2.2" - conventional-recommended-bump "^6.1.0" - fs-extra "^9.1.0" - get-stream "^6.0.0" - lodash.template "^4.5.0" - npm-package-arg "^8.1.0" - npmlog "^4.1.2" - pify "^5.0.0" - semver "^7.3.4" - -"@lerna/create-symlink@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-4.0.0.tgz#8c5317ce5ae89f67825443bd7651bf4121786228" - integrity sha512-I0phtKJJdafUiDwm7BBlEUOtogmu8+taxq6PtIrxZbllV9hWg59qkpuIsiFp+no7nfRVuaasNYHwNUhDAVQBig== - dependencies: - cmd-shim "^4.1.0" - fs-extra "^9.1.0" - npmlog "^4.1.2" - -"@lerna/create@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-4.0.0.tgz#b6947e9b5dfb6530321952998948c3e63d64d730" - integrity sha512-mVOB1niKByEUfxlbKTM1UNECWAjwUdiioIbRQZEeEabtjCL69r9rscIsjlGyhGWCfsdAG5wfq4t47nlDXdLLag== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/command" "4.0.0" - "@lerna/npm-conf" "4.0.0" - "@lerna/validation-error" "4.0.0" - dedent "^0.7.0" - fs-extra "^9.1.0" - globby "^11.0.2" - init-package-json "^2.0.2" - npm-package-arg "^8.1.0" - p-reduce "^2.1.0" - pacote "^11.2.6" - pify "^5.0.0" - semver "^7.3.4" - slash "^3.0.0" - validate-npm-package-license "^3.0.4" - validate-npm-package-name "^3.0.0" - whatwg-url "^8.4.0" - yargs-parser "20.2.4" - -"@lerna/describe-ref@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-4.0.0.tgz#53c53b4ea65fdceffa072a62bfebe6772c45d9ec" - integrity sha512-eTU5+xC4C5Gcgz+Ey4Qiw9nV2B4JJbMulsYJMW8QjGcGh8zudib7Sduj6urgZXUYNyhYpRs+teci9M2J8u+UvQ== - dependencies: - "@lerna/child-process" "4.0.0" - npmlog "^4.1.2" - -"@lerna/diff@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-4.0.0.tgz#6d3071817aaa4205a07bf77cfc6e932796d48b92" - integrity sha512-jYPKprQVg41+MUMxx6cwtqsNm0Yxx9GDEwdiPLwcUTFx+/qKCEwifKNJ1oGIPBxyEHX2PFCOjkK39lHoj2qiag== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/command" "4.0.0" - "@lerna/validation-error" "4.0.0" - npmlog "^4.1.2" - -"@lerna/exec@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-4.0.0.tgz#eb6cb95cb92d42590e9e2d628fcaf4719d4a8be6" - integrity sha512-VGXtL/b/JfY84NB98VWZpIExfhLOzy0ozm/0XaS4a2SmkAJc5CeUfrhvHxxkxiTBLkU+iVQUyYEoAT0ulQ8PCw== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/command" "4.0.0" - "@lerna/filter-options" "4.0.0" - "@lerna/profiler" "4.0.0" - "@lerna/run-topologically" "4.0.0" - "@lerna/validation-error" "4.0.0" - p-map "^4.0.0" - -"@lerna/filter-options@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-4.0.0.tgz#ac94cc515d7fa3b47e2f7d74deddeabb1de5e9e6" - integrity sha512-vV2ANOeZhOqM0rzXnYcFFCJ/kBWy/3OA58irXih9AMTAlQLymWAK0akWybl++sUJ4HB9Hx12TOqaXbYS2NM5uw== - dependencies: - "@lerna/collect-updates" "4.0.0" - "@lerna/filter-packages" "4.0.0" - dedent "^0.7.0" - npmlog "^4.1.2" - -"@lerna/filter-packages@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-4.0.0.tgz#b1f70d70e1de9cdd36a4e50caa0ac501f8d012f2" - integrity sha512-+4AJIkK7iIiOaqCiVTYJxh/I9qikk4XjNQLhE3kixaqgMuHl1NQ99qXRR0OZqAWB9mh8Z1HA9bM5K1HZLBTOqA== - dependencies: - "@lerna/validation-error" "4.0.0" - multimatch "^5.0.0" - npmlog "^4.1.2" - -"@lerna/get-npm-exec-opts@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-4.0.0.tgz#dc955be94a4ae75c374ef9bce91320887d34608f" - integrity sha512-yvmkerU31CTWS2c7DvmAWmZVeclPBqI7gPVr5VATUKNWJ/zmVcU4PqbYoLu92I9Qc4gY1TuUplMNdNuZTSL7IQ== - dependencies: - npmlog "^4.1.2" - -"@lerna/get-packed@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/get-packed/-/get-packed-4.0.0.tgz#0989d61624ac1f97e393bdad2137c49cd7a37823" - integrity sha512-rfWONRsEIGyPJTxFzC8ECb3ZbsDXJbfqWYyeeQQDrJRPnEJErlltRLPLgC2QWbxFgFPsoDLeQmFHJnf0iDfd8w== - dependencies: - fs-extra "^9.1.0" - ssri "^8.0.1" - tar "^6.1.0" - -"@lerna/github-client@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-4.0.0.tgz#2ced67721363ef70f8e12ffafce4410918f4a8a4" - integrity sha512-2jhsldZtTKXYUBnOm23Lb0Fx8G4qfSXF9y7UpyUgWUj+YZYd+cFxSuorwQIgk5P4XXrtVhsUesIsli+BYSThiw== - dependencies: - "@lerna/child-process" "4.0.0" - "@octokit/plugin-enterprise-rest" "^6.0.1" - "@octokit/rest" "^18.1.0" - git-url-parse "^11.4.4" - npmlog "^4.1.2" - -"@lerna/gitlab-client@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/gitlab-client/-/gitlab-client-4.0.0.tgz#00dad73379c7b38951d4b4ded043504c14e2b67d" - integrity sha512-OMUpGSkeDWFf7BxGHlkbb35T7YHqVFCwBPSIR6wRsszY8PAzCYahtH3IaJzEJyUg6vmZsNl0FSr3pdA2skhxqA== - dependencies: - node-fetch "^2.6.1" - npmlog "^4.1.2" - whatwg-url "^8.4.0" - -"@lerna/global-options@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-4.0.0.tgz#c7d8b0de6a01d8a845e2621ea89e7f60f18c6a5f" - integrity sha512-TRMR8afAHxuYBHK7F++Ogop2a82xQjoGna1dvPOY6ltj/pEx59pdgcJfYcynYqMkFIk8bhLJJN9/ndIfX29FTQ== - -"@lerna/has-npm-version@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-4.0.0.tgz#d3fc3292c545eb28bd493b36e6237cf0279f631c" - integrity sha512-LQ3U6XFH8ZmLCsvsgq1zNDqka0Xzjq5ibVN+igAI5ccRWNaUsE/OcmsyMr50xAtNQMYMzmpw5GVLAivT2/YzCg== - dependencies: - "@lerna/child-process" "4.0.0" - semver "^7.3.4" - -"@lerna/import@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/import/-/import-4.0.0.tgz#bde656c4a451fa87ae41733ff8a8da60547c5465" - integrity sha512-FaIhd+4aiBousKNqC7TX1Uhe97eNKf5/SC7c5WZANVWtC7aBWdmswwDt3usrzCNpj6/Wwr9EtEbYROzxKH8ffg== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/command" "4.0.0" - "@lerna/prompt" "4.0.0" - "@lerna/pulse-till-done" "4.0.0" - "@lerna/validation-error" "4.0.0" - dedent "^0.7.0" - fs-extra "^9.1.0" - p-map-series "^2.1.0" - -"@lerna/info@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/info/-/info-4.0.0.tgz#b9fb0e479d60efe1623603958a831a88b1d7f1fc" - integrity sha512-8Uboa12kaCSZEn4XRfPz5KU9XXoexSPS4oeYGj76s2UQb1O1GdnEyfjyNWoUl1KlJ2i/8nxUskpXIftoFYH0/Q== - dependencies: - "@lerna/command" "4.0.0" - "@lerna/output" "4.0.0" - envinfo "^7.7.4" - -"@lerna/init@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/init/-/init-4.0.0.tgz#dadff67e6dfb981e8ccbe0e6a310e837962f6c7a" - integrity sha512-wY6kygop0BCXupzWj5eLvTUqdR7vIAm0OgyV9WHpMYQGfs1V22jhztt8mtjCloD/O0nEe4tJhdG62XU5aYmPNQ== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/command" "4.0.0" - fs-extra "^9.1.0" - p-map "^4.0.0" - write-json-file "^4.3.0" - -"@lerna/link@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/link/-/link-4.0.0.tgz#c3a38aabd44279d714e90f2451e31b63f0fb65ba" - integrity sha512-KlvPi7XTAcVOByfaLlOeYOfkkDcd+bejpHMCd1KcArcFTwijOwXOVi24DYomIeHvy6HsX/IUquJ4PPUJIeB4+w== - dependencies: - "@lerna/command" "4.0.0" - "@lerna/package-graph" "4.0.0" - "@lerna/symlink-dependencies" "4.0.0" - p-map "^4.0.0" - slash "^3.0.0" - -"@lerna/list@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/list/-/list-4.0.0.tgz#24b4e6995bd73f81c556793fe502b847efd9d1d7" - integrity sha512-L2B5m3P+U4Bif5PultR4TI+KtW+SArwq1i75QZ78mRYxPc0U/piau1DbLOmwrdqr99wzM49t0Dlvl6twd7GHFg== - dependencies: - "@lerna/command" "4.0.0" - "@lerna/filter-options" "4.0.0" - "@lerna/listable" "4.0.0" - "@lerna/output" "4.0.0" - -"@lerna/listable@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-4.0.0.tgz#d00d6cb4809b403f2b0374fc521a78e318b01214" - integrity sha512-/rPOSDKsOHs5/PBLINZOkRIX1joOXUXEtyUs5DHLM8q6/RP668x/1lFhw6Dx7/U+L0+tbkpGtZ1Yt0LewCLgeQ== - dependencies: - "@lerna/query-graph" "4.0.0" - chalk "^4.1.0" - columnify "^1.5.4" - -"@lerna/log-packed@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-4.0.0.tgz#95168fe2e26ac6a71e42f4be857519b77e57a09f" - integrity sha512-+dpCiWbdzgMAtpajLToy9PO713IHoE6GV/aizXycAyA07QlqnkpaBNZ8DW84gHdM1j79TWockGJo9PybVhrrZQ== - dependencies: - byte-size "^7.0.0" - columnify "^1.5.4" - has-unicode "^2.0.1" - npmlog "^4.1.2" - -"@lerna/npm-conf@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-4.0.0.tgz#b259fd1e1cee2bf5402b236e770140ff9ade7fd2" - integrity sha512-uS7H02yQNq3oejgjxAxqq/jhwGEE0W0ntr8vM3EfpCW1F/wZruwQw+7bleJQ9vUBjmdXST//tk8mXzr5+JXCfw== - dependencies: - config-chain "^1.1.12" - pify "^5.0.0" - -"@lerna/npm-dist-tag@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-4.0.0.tgz#d1e99b4eccd3414142f0548ad331bf2d53f3257a" - integrity sha512-F20sg28FMYTgXqEQihgoqSfwmq+Id3zT23CnOwD+XQMPSy9IzyLf1fFVH319vXIw6NF6Pgs4JZN2Qty6/CQXGw== - dependencies: - "@lerna/otplease" "4.0.0" - npm-package-arg "^8.1.0" - npm-registry-fetch "^9.0.0" - npmlog "^4.1.2" - -"@lerna/npm-install@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-4.0.0.tgz#31180be3ab3b7d1818a1a0c206aec156b7094c78" - integrity sha512-aKNxq2j3bCH3eXl3Fmu4D54s/YLL9WSwV8W7X2O25r98wzrO38AUN6AB9EtmAx+LV/SP15et7Yueg9vSaanRWg== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/get-npm-exec-opts" "4.0.0" - fs-extra "^9.1.0" - npm-package-arg "^8.1.0" - npmlog "^4.1.2" - signal-exit "^3.0.3" - write-pkg "^4.0.0" - -"@lerna/npm-publish@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-4.0.0.tgz#84eb62e876fe949ae1fd62c60804423dbc2c4472" - integrity sha512-vQb7yAPRo5G5r77DRjHITc9piR9gvEKWrmfCH7wkfBnGWEqu7n8/4bFQ7lhnkujvc8RXOsYpvbMQkNfkYibD/w== - dependencies: - "@lerna/otplease" "4.0.0" - "@lerna/run-lifecycle" "4.0.0" - fs-extra "^9.1.0" - libnpmpublish "^4.0.0" - npm-package-arg "^8.1.0" - npmlog "^4.1.2" - pify "^5.0.0" - read-package-json "^3.0.0" - -"@lerna/npm-run-script@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-4.0.0.tgz#dfebf4f4601442e7c0b5214f9fb0d96c9350743b" - integrity sha512-Jmyh9/IwXJjOXqKfIgtxi0bxi1pUeKe5bD3S81tkcy+kyng/GNj9WSqD5ZggoNP2NP//s4CLDAtUYLdP7CU9rA== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/get-npm-exec-opts" "4.0.0" - npmlog "^4.1.2" - -"@lerna/otplease@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-4.0.0.tgz#84972eb43448f8a1077435ba1c5e59233b725850" - integrity sha512-Sgzbqdk1GH4psNiT6hk+BhjOfIr/5KhGBk86CEfHNJTk9BK4aZYyJD4lpDbDdMjIV4g03G7pYoqHzH765T4fxw== - dependencies: - "@lerna/prompt" "4.0.0" - -"@lerna/output@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/output/-/output-4.0.0.tgz#b1d72215c0e35483e4f3e9994debc82c621851f2" - integrity sha512-Un1sHtO1AD7buDQrpnaYTi2EG6sLF+KOPEAMxeUYG5qG3khTs2Zgzq5WE3dt2N/bKh7naESt20JjIW6tBELP0w== - dependencies: - npmlog "^4.1.2" - -"@lerna/pack-directory@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-4.0.0.tgz#8b617db95d20792f043aaaa13a9ccc0e04cb4c74" - integrity sha512-NJrmZNmBHS+5aM+T8N6FVbaKFScVqKlQFJNY2k7nsJ/uklNKsLLl6VhTQBPwMTbf6Tf7l6bcKzpy7aePuq9UiQ== - dependencies: - "@lerna/get-packed" "4.0.0" - "@lerna/package" "4.0.0" - "@lerna/run-lifecycle" "4.0.0" - npm-packlist "^2.1.4" - npmlog "^4.1.2" - tar "^6.1.0" - temp-write "^4.0.0" - -"@lerna/package-graph@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-4.0.0.tgz#16a00253a8ac810f72041481cb46bcee8d8123dd" - integrity sha512-QED2ZCTkfXMKFoTGoccwUzjHtZMSf3UKX14A4/kYyBms9xfFsesCZ6SLI5YeySEgcul8iuIWfQFZqRw+Qrjraw== - dependencies: - "@lerna/prerelease-id-from-version" "4.0.0" - "@lerna/validation-error" "4.0.0" - npm-package-arg "^8.1.0" - npmlog "^4.1.2" - semver "^7.3.4" - -"@lerna/package@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/package/-/package-4.0.0.tgz#1b4c259c4bcff45c876ee1d591a043aacbc0d6b7" - integrity sha512-l0M/izok6FlyyitxiQKr+gZLVFnvxRQdNhzmQ6nRnN9dvBJWn+IxxpM+cLqGACatTnyo9LDzNTOj2Db3+s0s8Q== - dependencies: - load-json-file "^6.2.0" - npm-package-arg "^8.1.0" - write-pkg "^4.0.0" - -"@lerna/prerelease-id-from-version@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-4.0.0.tgz#c7e0676fcee1950d85630e108eddecdd5b48c916" - integrity sha512-GQqguzETdsYRxOSmdFZ6zDBXDErIETWOqomLERRY54f4p+tk4aJjoVdd9xKwehC9TBfIFvlRbL1V9uQGHh1opg== - dependencies: - semver "^7.3.4" - -"@lerna/profiler@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/profiler/-/profiler-4.0.0.tgz#8a53ab874522eae15d178402bff90a14071908e9" - integrity sha512-/BaEbqnVh1LgW/+qz8wCuI+obzi5/vRE8nlhjPzdEzdmWmZXuCKyWSEzAyHOJWw1ntwMiww5dZHhFQABuoFz9Q== - dependencies: - fs-extra "^9.1.0" - npmlog "^4.1.2" - upath "^2.0.1" - -"@lerna/project@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/project/-/project-4.0.0.tgz#ff84893935833533a74deff30c0e64ddb7f0ba6b" - integrity sha512-o0MlVbDkD5qRPkFKlBZsXZjoNTWPyuL58564nSfZJ6JYNmgAptnWPB2dQlAc7HWRZkmnC2fCkEdoU+jioPavbg== - dependencies: - "@lerna/package" "4.0.0" - "@lerna/validation-error" "4.0.0" - cosmiconfig "^7.0.0" - dedent "^0.7.0" - dot-prop "^6.0.1" - glob-parent "^5.1.1" - globby "^11.0.2" - load-json-file "^6.2.0" - npmlog "^4.1.2" - p-map "^4.0.0" - resolve-from "^5.0.0" - write-json-file "^4.3.0" - -"@lerna/prompt@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-4.0.0.tgz#5ec69a803f3f0db0ad9f221dad64664d3daca41b" - integrity sha512-4Ig46oCH1TH5M7YyTt53fT6TuaKMgqUUaqdgxvp6HP6jtdak6+amcsqB8YGz2eQnw/sdxunx84DfI9XpoLj4bQ== - dependencies: - inquirer "^7.3.3" - npmlog "^4.1.2" - -"@lerna/publish@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-4.0.0.tgz#f67011305adeba120066a3b6d984a5bb5fceef65" - integrity sha512-K8jpqjHrChH22qtkytA5GRKIVFEtqBF6JWj1I8dWZtHs4Jywn8yB1jQ3BAMLhqmDJjWJtRck0KXhQQKzDK2UPg== - dependencies: - "@lerna/check-working-tree" "4.0.0" - "@lerna/child-process" "4.0.0" - "@lerna/collect-updates" "4.0.0" - "@lerna/command" "4.0.0" - "@lerna/describe-ref" "4.0.0" - "@lerna/log-packed" "4.0.0" - "@lerna/npm-conf" "4.0.0" - "@lerna/npm-dist-tag" "4.0.0" - "@lerna/npm-publish" "4.0.0" - "@lerna/otplease" "4.0.0" - "@lerna/output" "4.0.0" - "@lerna/pack-directory" "4.0.0" - "@lerna/prerelease-id-from-version" "4.0.0" - "@lerna/prompt" "4.0.0" - "@lerna/pulse-till-done" "4.0.0" - "@lerna/run-lifecycle" "4.0.0" - "@lerna/run-topologically" "4.0.0" - "@lerna/validation-error" "4.0.0" - "@lerna/version" "4.0.0" - fs-extra "^9.1.0" - libnpmaccess "^4.0.1" - npm-package-arg "^8.1.0" - npm-registry-fetch "^9.0.0" - npmlog "^4.1.2" - p-map "^4.0.0" - p-pipe "^3.1.0" - pacote "^11.2.6" - semver "^7.3.4" - -"@lerna/pulse-till-done@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/pulse-till-done/-/pulse-till-done-4.0.0.tgz#04bace7d483a8205c187b806bcd8be23d7bb80a3" - integrity sha512-Frb4F7QGckaybRhbF7aosLsJ5e9WuH7h0KUkjlzSByVycxY91UZgaEIVjS2oN9wQLrheLMHl6SiFY0/Pvo0Cxg== - dependencies: - npmlog "^4.1.2" - -"@lerna/query-graph@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-4.0.0.tgz#09dd1c819ac5ee3f38db23931143701f8a6eef63" - integrity sha512-YlP6yI3tM4WbBmL9GCmNDoeQyzcyg1e4W96y/PKMZa5GbyUvkS2+Jc2kwPD+5KcXou3wQZxSPzR3Te5OenaDdg== - dependencies: - "@lerna/package-graph" "4.0.0" - -"@lerna/resolve-symlink@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-4.0.0.tgz#6d006628a210c9b821964657a9e20a8c9a115e14" - integrity sha512-RtX8VEUzqT+uLSCohx8zgmjc6zjyRlh6i/helxtZTMmc4+6O4FS9q5LJas2uGO2wKvBlhcD6siibGt7dIC3xZA== - dependencies: - fs-extra "^9.1.0" - npmlog "^4.1.2" - read-cmd-shim "^2.0.0" - -"@lerna/rimraf-dir@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-4.0.0.tgz#2edf3b62d4eb0ef4e44e430f5844667d551ec25a" - integrity sha512-QNH9ABWk9mcMJh2/muD9iYWBk1oQd40y6oH+f3wwmVGKYU5YJD//+zMiBI13jxZRtwBx0vmBZzkBkK1dR11cBg== - dependencies: - "@lerna/child-process" "4.0.0" - npmlog "^4.1.2" - path-exists "^4.0.0" - rimraf "^3.0.2" - -"@lerna/run-lifecycle@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-4.0.0.tgz#e648a46f9210a9bcd7c391df6844498cb5079334" - integrity sha512-IwxxsajjCQQEJAeAaxF8QdEixfI7eLKNm4GHhXHrgBu185JcwScFZrj9Bs+PFKxwb+gNLR4iI5rpUdY8Y0UdGQ== - dependencies: - "@lerna/npm-conf" "4.0.0" - npm-lifecycle "^3.1.5" - npmlog "^4.1.2" - -"@lerna/run-topologically@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-4.0.0.tgz#af846eeee1a09b0c2be0d1bfb5ef0f7b04bb1827" - integrity sha512-EVZw9hGwo+5yp+VL94+NXRYisqgAlj0jWKWtAIynDCpghRxCE5GMO3xrQLmQgqkpUl9ZxQFpICgYv5DW4DksQA== - dependencies: - "@lerna/query-graph" "4.0.0" - p-queue "^6.6.2" - -"@lerna/run@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/run/-/run-4.0.0.tgz#4bc7fda055a729487897c23579694f6183c91262" - integrity sha512-9giulCOzlMPzcZS/6Eov6pxE9gNTyaXk0Man+iCIdGJNMrCnW7Dme0Z229WWP/UoxDKg71F2tMsVVGDiRd8fFQ== - dependencies: - "@lerna/command" "4.0.0" - "@lerna/filter-options" "4.0.0" - "@lerna/npm-run-script" "4.0.0" - "@lerna/output" "4.0.0" - "@lerna/profiler" "4.0.0" - "@lerna/run-topologically" "4.0.0" - "@lerna/timer" "4.0.0" - "@lerna/validation-error" "4.0.0" - p-map "^4.0.0" - -"@lerna/symlink-binary@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-4.0.0.tgz#21009f62d53a425f136cb4c1a32c6b2a0cc02d47" - integrity sha512-zualodWC4q1QQc1pkz969hcFeWXOsVYZC5AWVtAPTDfLl+TwM7eG/O6oP+Rr3fFowspxo6b1TQ6sYfDV6HXNWA== - dependencies: - "@lerna/create-symlink" "4.0.0" - "@lerna/package" "4.0.0" - fs-extra "^9.1.0" - p-map "^4.0.0" - -"@lerna/symlink-dependencies@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-4.0.0.tgz#8910eca084ae062642d0490d8972cf2d98e9ebbd" - integrity sha512-BABo0MjeUHNAe2FNGty1eantWp8u83BHSeIMPDxNq0MuW2K3CiQRaeWT3EGPAzXpGt0+hVzBrA6+OT0GPn7Yuw== - dependencies: - "@lerna/create-symlink" "4.0.0" - "@lerna/resolve-symlink" "4.0.0" - "@lerna/symlink-binary" "4.0.0" - fs-extra "^9.1.0" - p-map "^4.0.0" - p-map-series "^2.1.0" - -"@lerna/timer@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/timer/-/timer-4.0.0.tgz#a52e51bfcd39bfd768988049ace7b15c1fd7a6da" - integrity sha512-WFsnlaE7SdOvjuyd05oKt8Leg3ENHICnvX3uYKKdByA+S3g+TCz38JsNs7OUZVt+ba63nC2nbXDlUnuT2Xbsfg== - -"@lerna/validation-error@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-4.0.0.tgz#af9d62fe8304eaa2eb9a6ba1394f9aa807026d35" - integrity sha512-1rBOM5/koiVWlRi3V6dB863E1YzJS8v41UtsHgMr6gB2ncJ2LsQtMKlJpi3voqcgh41H8UsPXR58RrrpPpufyw== - dependencies: - npmlog "^4.1.2" - -"@lerna/version@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/version/-/version-4.0.0.tgz#532659ec6154d8a8789c5ab53878663e244e3228" - integrity sha512-otUgiqs5W9zGWJZSCCMRV/2Zm2A9q9JwSDS7s/tlKq4mWCYriWo7+wsHEA/nPTMDyYyBO5oyZDj+3X50KDUzeA== - dependencies: - "@lerna/check-working-tree" "4.0.0" - "@lerna/child-process" "4.0.0" - "@lerna/collect-updates" "4.0.0" - "@lerna/command" "4.0.0" - "@lerna/conventional-commits" "4.0.0" - "@lerna/github-client" "4.0.0" - "@lerna/gitlab-client" "4.0.0" - "@lerna/output" "4.0.0" - "@lerna/prerelease-id-from-version" "4.0.0" - "@lerna/prompt" "4.0.0" - "@lerna/run-lifecycle" "4.0.0" - "@lerna/run-topologically" "4.0.0" - "@lerna/validation-error" "4.0.0" - chalk "^4.1.0" - dedent "^0.7.0" - load-json-file "^6.2.0" - minimatch "^3.0.4" - npmlog "^4.1.2" - p-map "^4.0.0" - p-pipe "^3.1.0" - p-reduce "^2.1.0" - p-waterfall "^2.1.1" - semver "^7.3.4" - slash "^3.0.0" - temp-write "^4.0.0" - write-json-file "^4.3.0" - -"@lerna/write-log-file@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/write-log-file/-/write-log-file-4.0.0.tgz#18221a38a6a307d6b0a5844dd592ad53fa27091e" - integrity sha512-XRG5BloiArpXRakcnPHmEHJp+4AtnhRtpDIHSghmXD5EichI1uD73J7FgPp30mm2pDRq3FdqB0NbwSEsJ9xFQg== - dependencies: - npmlog "^4.1.2" - write-file-atomic "^3.0.3" - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@npmcli/ci-detect@^1.0.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@npmcli/ci-detect/-/ci-detect-1.3.0.tgz#6c1d2c625fb6ef1b9dea85ad0a5afcbef85ef22a" - integrity sha512-oN3y7FAROHhrAt7Rr7PnTSwrHrZVRTS2ZbyxeQwSSYD0ifwM3YNgQqbaRmjcWoPyq77MjchusjJDspbzMmip1Q== - -"@npmcli/fs@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.0.0.tgz#589612cfad3a6ea0feafcb901d29c63fd52db09f" - integrity sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ== - dependencies: - "@gar/promisify" "^1.0.1" - semver "^7.3.5" - -"@npmcli/git@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-2.1.0.tgz#2fbd77e147530247d37f325930d457b3ebe894f6" - integrity sha512-/hBFX/QG1b+N7PZBFs0bi+evgRZcK9nWBxQKZkGoXUT5hJSwl5c4d7y8/hm+NQZRPhQ67RzFaj5UM9YeyKoryw== - dependencies: - "@npmcli/promise-spawn" "^1.3.2" - lru-cache "^6.0.0" - mkdirp "^1.0.4" - npm-pick-manifest "^6.1.1" - promise-inflight "^1.0.1" - promise-retry "^2.0.1" - semver "^7.3.5" - which "^2.0.2" - -"@npmcli/installed-package-contents@^1.0.6": - version "1.0.7" - resolved "https://registry.yarnpkg.com/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz#ab7408c6147911b970a8abe261ce512232a3f4fa" - integrity sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw== - dependencies: - npm-bundled "^1.1.1" - npm-normalize-package-bin "^1.0.1" - -"@npmcli/move-file@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@npmcli/move-file/-/move-file-1.1.2.tgz#1a82c3e372f7cae9253eb66d72543d6b8685c674" - integrity sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg== - dependencies: - mkdirp "^1.0.4" - rimraf "^3.0.2" - -"@npmcli/node-gyp@^1.0.2": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz#a912e637418ffc5f2db375e93b85837691a43a33" - integrity sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA== - -"@npmcli/promise-spawn@^1.2.0", "@npmcli/promise-spawn@^1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz#42d4e56a8e9274fba180dabc0aea6e38f29274f5" - integrity sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg== - dependencies: - infer-owner "^1.0.4" - -"@npmcli/run-script@^1.8.2": - version "1.8.6" - resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-1.8.6.tgz#18314802a6660b0d4baa4c3afe7f1ad39d8c28b7" - integrity sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g== - dependencies: - "@npmcli/node-gyp" "^1.0.2" - "@npmcli/promise-spawn" "^1.3.2" - node-gyp "^7.1.0" - read-package-json-fast "^2.0.1" - -"@octokit/auth-token@^2.4.4": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" - integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== - dependencies: - "@octokit/types" "^6.0.3" - -"@octokit/core@^3.5.1": - version "3.5.1" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" - integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== - dependencies: - "@octokit/auth-token" "^2.4.4" - "@octokit/graphql" "^4.5.8" - "@octokit/request" "^5.6.0" - "@octokit/request-error" "^2.0.5" - "@octokit/types" "^6.0.3" - before-after-hook "^2.2.0" - universal-user-agent "^6.0.0" - -"@octokit/endpoint@^6.0.1": - version "6.0.12" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" - integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== - dependencies: - "@octokit/types" "^6.0.3" - is-plain-object "^5.0.0" - universal-user-agent "^6.0.0" - -"@octokit/graphql@^4.5.8": - version "4.8.0" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" - integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== - dependencies: - "@octokit/request" "^5.6.0" - "@octokit/types" "^6.0.3" - universal-user-agent "^6.0.0" - -"@octokit/openapi-types@^10.6.4": - version "10.6.4" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.6.4.tgz#c8b5b1f5c60ab7c62858abe2ef57bc709f426a30" - integrity sha512-JVmwWzYTIs6jACYOwD6zu5rdrqGIYsiAsLzTCxdrWIPNKNVjEF6vPTL20shmgJ4qZsq7WPBcLXLsaQD+NLChfg== - -"@octokit/plugin-enterprise-rest@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" - integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== - -"@octokit/plugin-paginate-rest@^2.16.4": - version "2.16.7" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.7.tgz#d25b6e650ba5a007002986f5fda66958d44e70a4" - integrity sha512-TMlyVhMPx6La1Ud4PSY4YxqAvb9YPEMs/7R1nBSbsw4wNqG73aBqls0r0dRRCWe5Pm0ZUGS9a94N46iAxlOR8A== - dependencies: - "@octokit/types" "^6.31.3" - -"@octokit/plugin-request-log@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" - integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== - -"@octokit/plugin-rest-endpoint-methods@5.11.4": - version "5.11.4" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.11.4.tgz#221dedcbdc45d6bfa54228d469e8c34acb4e0e34" - integrity sha512-iS+GYTijrPUiEiLoDsGJhrbXIvOPfm2+schvr+FxNMs7PeE9Nl4bAMhE8ftfNX3Z1xLxSKwEZh0O7GbWurX5HQ== - dependencies: - "@octokit/types" "^6.31.2" - deprecation "^2.3.1" - -"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" - integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== - dependencies: - "@octokit/types" "^6.0.3" - deprecation "^2.0.0" - once "^1.4.0" - -"@octokit/request@^5.6.0": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.2.tgz#1aa74d5da7b9e04ac60ef232edd9a7438dcf32d8" - integrity sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA== - dependencies: - "@octokit/endpoint" "^6.0.1" - "@octokit/request-error" "^2.1.0" - "@octokit/types" "^6.16.1" - is-plain-object "^5.0.0" - node-fetch "^2.6.1" - universal-user-agent "^6.0.0" - -"@octokit/rest@^18.1.0": - version "18.11.4" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.11.4.tgz#9fb6d826244554fbf8c110b9064018d7198eec51" - integrity sha512-QplypCyYxqMK05JdMSm/bDWZO8VWWaBdzQ9tbF9rEV9rIEiICh+v6q+Vu/Y5hdze8JJaxfUC+PBC7vrnEkZvZg== - dependencies: - "@octokit/core" "^3.5.1" - "@octokit/plugin-paginate-rest" "^2.16.4" - "@octokit/plugin-request-log" "^1.0.4" - "@octokit/plugin-rest-endpoint-methods" "5.11.4" - -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.31.2", "@octokit/types@^6.31.3": - version "6.31.3" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.31.3.tgz#14c2961baea853b2bf148d892256357a936343f8" - integrity sha512-IUG3uMpsLHrtEL6sCVXbxCgnbKcgpkS4K7gVEytLDvYYalkK3XcuMCHK1YPD8xJglSJAOAbL4MgXp47rS9G49w== - dependencies: - "@octokit/openapi-types" "^10.6.4" - -"@sindresorhus/is@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" - integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== - -"@szmarczak/http-timer@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" - integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== - dependencies: - defer-to-connect "^1.0.1" - -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== - -"@types/minimatch@^3.0.3": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" - integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== - -"@types/minimist@^1.2.0": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" - integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== - -"@types/normalize-package-data@^2.4.0": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" - integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== - -"@types/parse-json@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" - integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== - -"@zeit/schemas@2.6.0": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@zeit/schemas/-/schemas-2.6.0.tgz#004e8e553b4cd53d538bd38eac7bcbf58a867fe3" - integrity sha512-uUrgZ8AxS+Lio0fZKAipJjAh415JyrOZowliZAzmnJSsf7piVL5w+G0+gFJ0KSu3QRhvui/7zuvpLz03YjXAhg== - -JSONStream@^1.0.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" - integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -accepts@~1.3.5: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -add-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" - integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= - -agent-base@6, agent-base@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -agentkeepalive@^4.1.3: - version "4.1.4" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.1.4.tgz#d928028a4862cb11718e55227872e842a44c945b" - integrity sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ== - dependencies: - debug "^4.1.0" - depd "^1.1.2" - humanize-ms "^1.2.1" - -aggregate-error@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" - integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== - dependencies: - clean-stack "^2.0.0" - indent-string "^4.0.0" - -ajv@6.12.6, ajv@^6.12.3: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-align@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" - integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= - dependencies: - string-width "^2.0.0" - -ansi-align@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" - integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== - dependencies: - string-width "^4.1.0" - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -aproba@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" - integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== - -arch@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" - integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== - -are-we-there-yet@~1.1.2: - version "1.1.7" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146" - integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -arg@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arg/-/arg-2.0.0.tgz#c06e7ff69ab05b3a4a03ebe0407fac4cba657545" - integrity sha512-XxNTUzKnz1ctK3ZIcI2XUPlD96wbHP2nGqkPKpvk/HNRlPveYrXIVSTk9m3LcqOgDPg3B1nMvdV/K8wZd7PG4w== - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -array-differ@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" - integrity sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg== - -array-ify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" - integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -arrify@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" - integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== - -asap@^2.0.0: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - -before-after-hook@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" - integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== - -boxen@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" - integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== - dependencies: - ansi-align "^2.0.0" - camelcase "^4.0.0" - chalk "^2.0.1" - cli-boxes "^1.0.0" - string-width "^2.0.0" - term-size "^1.2.0" - widest-line "^2.0.0" - -boxen@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" - integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== - dependencies: - ansi-align "^3.0.0" - camelcase "^6.2.0" - chalk "^4.1.0" - cli-boxes "^2.2.1" - string-width "^4.2.2" - type-fest "^0.20.2" - widest-line "^3.1.0" - wrap-ansi "^7.0.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -builtins@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" - integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= - -byline@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" - integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= - -byte-size@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-7.0.1.tgz#b1daf3386de7ab9d706b941a748dbfc71130dee3" - integrity sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A== - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -cacache@^15.0.5, cacache@^15.2.0: - version "15.3.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" - integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== - dependencies: - "@npmcli/fs" "^1.0.0" - "@npmcli/move-file" "^1.0.1" - chownr "^2.0.0" - fs-minipass "^2.0.0" - glob "^7.1.4" - infer-owner "^1.0.4" - lru-cache "^6.0.0" - minipass "^3.1.1" - minipass-collect "^1.0.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.2" - mkdirp "^1.0.3" - p-map "^4.0.0" - promise-inflight "^1.0.1" - rimraf "^3.0.2" - ssri "^8.0.1" - tar "^6.0.2" - unique-filename "^1.1.1" - -cacheable-request@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" - integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^3.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^1.0.2" - -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase-keys@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" - integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== - dependencies: - camelcase "^5.3.1" - map-obj "^4.0.0" - quick-lru "^4.0.1" - -camelcase@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - -camelcase@^5.0.0, camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -chalk@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^2.0.0, chalk@^2.0.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.1.0, chalk@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -chownr@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -chownr@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" - integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cint@^8.2.1: - version "8.2.1" - resolved "https://registry.yarnpkg.com/cint/-/cint-8.2.1.tgz#70386b1b48e2773d0d63166a55aff94ef4456a12" - integrity sha1-cDhrG0jidz0NYxZqVa/5TvRFahI= - -clean-stack@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" - integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== - -cli-boxes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" - integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= - -cli-boxes@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" - integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== - -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-table@^0.3.6: - version "0.3.6" - resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.6.tgz#e9d6aa859c7fe636981fd3787378c2a20bce92fc" - integrity sha512-ZkNZbnZjKERTY5NwC2SeMeLeifSPq/pubeRoTpdr3WchLlnZg6hEgvHkK5zL7KNFdd9PmHN8lxrENUwI3cE8vQ== - dependencies: - colors "1.0.3" - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - -clipboardy@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-2.3.0.tgz#3c2903650c68e46a91b388985bc2774287dba290" - integrity sha512-mKhiIL2DrQIsuXMgBgnfEHOZOryC7kY7YO//TN6c63wlEm3NG5tz+YgY5rVi29KCmq/QQjKYvM7a19+MDOTHOQ== - dependencies: - arch "^2.1.1" - execa "^1.0.0" - is-wsl "^2.1.1" - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -clone-deep@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" - integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== - dependencies: - is-plain-object "^2.0.4" - kind-of "^6.0.2" - shallow-clone "^3.0.0" - -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= - -cmd-shim@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-4.1.0.tgz#b3a904a6743e9fede4148c6f3800bf2a08135bdd" - integrity sha512-lb9L7EM4I/ZRVuljLPEtUJOP+xiQVknZ4ZMpMgEp4JzNldPb27HU03hi6K1/6CoIuit/Zm/LQXySErFeXxDprw== - dependencies: - mkdirp-infer-owner "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -colors@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" - integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= - -columnify@^1.5.4: - version "1.5.4" - resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" - integrity sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs= - dependencies: - strip-ansi "^3.0.0" - wcwidth "^1.0.0" - -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@^6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== - -compare-func@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" - integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== - dependencies: - array-ify "^1.0.0" - dot-prop "^5.1.0" - -compressible@~2.0.14: - version "2.0.18" - resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" - integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== - dependencies: - mime-db ">= 1.43.0 < 2" - -compression@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.3.tgz#27e0e176aaf260f7f2c2813c3e440adb9f1993db" - integrity sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg== - dependencies: - accepts "~1.3.5" - bytes "3.0.0" - compressible "~2.0.14" - debug "2.6.9" - on-headers "~1.0.1" - safe-buffer "5.1.2" - vary "~1.1.2" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -concat-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1" - integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.0.2" - typedarray "^0.0.6" - -config-chain@^1.1.12: - version "1.1.13" - resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4" - integrity sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ== - dependencies: - ini "^1.3.4" - proto-list "~1.2.1" - -configstore@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" - integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== - dependencies: - dot-prop "^5.2.0" - graceful-fs "^4.1.2" - make-dir "^3.0.0" - unique-string "^2.0.0" - write-file-atomic "^3.0.0" - xdg-basedir "^4.0.0" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - -content-disposition@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" - integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= - -conventional-changelog-angular@^5.0.12: - version "5.0.13" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz#896885d63b914a70d4934b59d2fe7bde1832b28c" - integrity sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA== - dependencies: - compare-func "^2.0.0" - q "^1.5.1" - -conventional-changelog-core@^4.2.2: - version "4.2.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz#e50d047e8ebacf63fac3dc67bf918177001e1e9f" - integrity sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg== - dependencies: - add-stream "^1.0.0" - conventional-changelog-writer "^5.0.0" - conventional-commits-parser "^3.2.0" - dateformat "^3.0.0" - get-pkg-repo "^4.0.0" - git-raw-commits "^2.0.8" - git-remote-origin-url "^2.0.0" - git-semver-tags "^4.1.1" - lodash "^4.17.15" - normalize-package-data "^3.0.0" - q "^1.5.1" - read-pkg "^3.0.0" - read-pkg-up "^3.0.0" - through2 "^4.0.0" - -conventional-changelog-preset-loader@^2.3.4: - version "2.3.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz#14a855abbffd59027fd602581f1f34d9862ea44c" - integrity sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g== - -conventional-changelog-writer@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.0.tgz#c4042f3f1542f2f41d7d2e0d6cad23aba8df8eec" - integrity sha512-HnDh9QHLNWfL6E1uHz6krZEQOgm8hN7z/m7tT16xwd802fwgMN0Wqd7AQYVkhpsjDUx/99oo+nGgvKF657XP5g== - dependencies: - conventional-commits-filter "^2.0.7" - dateformat "^3.0.0" - handlebars "^4.7.6" - json-stringify-safe "^5.0.1" - lodash "^4.17.15" - meow "^8.0.0" - semver "^6.0.0" - split "^1.0.0" - through2 "^4.0.0" - -conventional-commits-filter@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz#f8d9b4f182fce00c9af7139da49365b136c8a0b3" - integrity sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA== - dependencies: - lodash.ismatch "^4.4.0" - modify-values "^1.0.0" - -conventional-commits-parser@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.2.tgz#190fb9900c6e02be0c0bca9b03d57e24982639fd" - integrity sha512-Jr9KAKgqAkwXMRHjxDwO/zOCDKod1XdAESHAGuJX38iZ7ZzVti/tvVoysO0suMsdAObp9NQ2rHSsSbnAqZ5f5g== - dependencies: - JSONStream "^1.0.4" - is-text-path "^1.0.1" - lodash "^4.17.15" - meow "^8.0.0" - split2 "^3.0.0" - through2 "^4.0.0" - -conventional-recommended-bump@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz#cfa623285d1de554012f2ffde70d9c8a22231f55" - integrity sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw== - dependencies: - concat-stream "^2.0.0" - conventional-changelog-preset-loader "^2.3.4" - conventional-commits-filter "^2.0.7" - conventional-commits-parser "^3.2.0" - git-raw-commits "^2.0.8" - git-semver-tags "^4.1.1" - meow "^8.0.0" - q "^1.5.1" - -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cosmiconfig@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" - integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.2.1" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.10.0" - -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -crypto-random-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" - integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== - -dargs@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" - integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -dateformat@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" - integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== - -debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== - dependencies: - ms "2.1.2" - -debuglog@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" - integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= - -decamelize-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" - integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= - dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" - -decamelize@^1.1.0, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -decompress-response@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= - dependencies: - mimic-response "^1.0.0" - -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= - dependencies: - clone "^1.0.2" - -defer-to-connect@^1.0.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" - integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== - -define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -depd@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -deprecation@^2.0.0, deprecation@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" - integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== - -detect-indent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" - integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= - -detect-indent@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" - integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== - -dezalgo@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" - integrity sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY= - dependencies: - asap "^2.0.0" - wrappy "1" - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -dot-prop@^5.1.0, dot-prop@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" - integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== - dependencies: - is-obj "^2.0.0" - -dot-prop@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" - integrity sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA== - dependencies: - is-obj "^2.0.0" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -duplexer@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" - integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -encoding@^0.1.12: - version "0.1.13" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" - integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== - dependencies: - iconv-lite "^0.6.2" - -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -env-paths@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - -envinfo@^7.7.4: - version "7.8.1" - resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" - integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== - -err-code@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" - integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" - integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-symbols "^1.0.2" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.1" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.1" - is-string "^1.0.7" - is-weakref "^1.0.1" - object-inspect "^1.11.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.1" - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-goat@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" - integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -eventemitter3@^4.0.4: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-glob@^3.1.1: - version "3.2.7" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" - integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-memoize@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/fast-memoize/-/fast-memoize-2.5.2.tgz#79e3bb6a4ec867ea40ba0e7146816f6cdce9b57e" - integrity sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw== - -fast-url-parser@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d" - integrity sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0= - dependencies: - punycode "^1.3.2" - -fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== - dependencies: - reusify "^1.0.4" - -figgy-pudding@^3.5.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" - integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== - -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -filter-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" - integrity sha1-mzERErxsYSehbgFsbF1/GeCAXFs= - -find-up@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-up@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -fp-and-or@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/fp-and-or/-/fp-and-or-0.1.3.tgz#e6fba83872a5853a56b3ebdf8d3167f5dfca1882" - integrity sha512-wJaE62fLaB3jCYvY2ZHjZvmKK2iiLiiehX38rz5QZxtdN8fVPJDeZUiVvJrHStdTc+23LHlyZuSEKgFc0pxi2g== - -fs-extra@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs-minipass@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - -fs-minipass@^2.0.0, fs-minipass@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" - integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== - dependencies: - minipass "^3.0.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-pkg-repo@4.1.2, get-pkg-repo@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-4.1.2.tgz#c4ffd60015cf091be666a0212753fc158f01a4c0" - integrity sha512-/FjamZL9cBYllEbReZkxF2IMh80d8TJoC4e3bmLNif8ibHw95aj0N/tzqK0kZz9eU/3w3dL6lF4fnnX/sDdW3A== - dependencies: - "@hutson/parse-repository-url" "^3.0.0" - hosted-git-info "^4.0.0" - meow "^7.0.0" - through2 "^2.0.0" - -get-port@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193" - integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== - -get-stdin@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" - integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -get-stream@^4.0.0, get-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -get-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -git-raw-commits@^2.0.8: - version "2.0.10" - resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.10.tgz#e2255ed9563b1c9c3ea6bd05806410290297bbc1" - integrity sha512-sHhX5lsbG9SOO6yXdlwgEMQ/ljIn7qMpAbJZCGfXX2fq5T8M5SrDnpYk9/4HswTildcIqatsWa91vty6VhWSaQ== - dependencies: - dargs "^7.0.0" - lodash "^4.17.15" - meow "^8.0.0" - split2 "^3.0.0" - through2 "^4.0.0" - -git-remote-origin-url@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" - integrity sha1-UoJlna4hBxRaERJhEq0yFuxfpl8= - dependencies: - gitconfiglocal "^1.0.0" - pify "^2.3.0" - -git-semver-tags@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-4.1.1.tgz#63191bcd809b0ec3e151ba4751c16c444e5b5780" - integrity sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA== - dependencies: - meow "^8.0.0" - semver "^6.0.0" - -git-up@^4.0.0: - version "4.0.5" - resolved "https://registry.yarnpkg.com/git-up/-/git-up-4.0.5.tgz#e7bb70981a37ea2fb8fe049669800a1f9a01d759" - integrity sha512-YUvVDg/vX3d0syBsk/CKUTib0srcQME0JyHkL5BaYdwLsiCslPWmDSi8PUMo9pXYjrryMcmsCoCgsTpSCJEQaA== - dependencies: - is-ssh "^1.3.0" - parse-url "^6.0.0" - -git-url-parse@^11.4.4: - version "11.6.0" - resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.6.0.tgz#c634b8de7faa66498a2b88932df31702c67df605" - integrity sha512-WWUxvJs5HsyHL6L08wOusa/IXYtMuCAhrMmnTjQPpBU0TTHyDhnOATNH3xNQz7YOQUsqIIPTGr4xiVti1Hsk5g== - dependencies: - git-up "^4.0.0" - -gitconfiglocal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" - integrity sha1-QdBF84UaXqiPA/JMocYXgRRGS5s= - dependencies: - ini "^1.3.2" - -glob-parent@^5.1.1, glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global-dirs@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.0.tgz#70a76fe84ea315ab37b1f5576cbde7d48ef72686" - integrity sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA== - dependencies: - ini "2.0.0" - -globby@^11.0.2, globby@^11.0.4: - version "11.0.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" - integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - -got@^9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" - integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== - dependencies: - "@sindresorhus/is" "^0.14.0" - "@szmarczak/http-timer" "^1.1.2" - cacheable-request "^6.0.0" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^4.1.0" - lowercase-keys "^1.0.1" - mimic-response "^1.0.1" - p-cancelable "^1.0.0" - to-readable-stream "^1.0.0" - url-parse-lax "^3.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - -handlebars@^4.7.6: - version "4.7.7" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" - integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.0" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - -hard-rejection@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" - integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== - -has-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - -has-unicode@^2.0.0, has-unicode@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - -has-yarn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" - integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -hosted-git-info@^4.0.0, hosted-git-info@^4.0.1, hosted-git-info@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.0.2.tgz#5e425507eede4fea846b7262f0838456c4209961" - integrity sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg== - dependencies: - lru-cache "^6.0.0" - -http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -humanize-ms@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" - integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0= - dependencies: - ms "^2.0.0" - -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -ignore-walk@^3.0.3: - version "3.0.4" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.4.tgz#c9a09f69b7c7b479a5d74ac1a3c0d4236d2a6335" - integrity sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ== - dependencies: - minimatch "^3.0.4" - -ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== - -import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-lazy@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" - integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= - -import-local@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" - integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -infer-owner@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" - integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ini@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" - integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== - -ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -init-package-json@^2.0.2: - version "2.0.5" - resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-2.0.5.tgz#78b85f3c36014db42d8f32117252504f68022646" - integrity sha512-u1uGAtEFu3VA6HNl/yUWw57jmKEMx8SKOxHhxjGnOFUiIlFnohKDFg4ZrPpv9wWqk44nDxGJAtqjdQFm+9XXQA== - dependencies: - npm-package-arg "^8.1.5" - promzard "^0.3.0" - read "~1.0.1" - read-package-json "^4.1.1" - semver "^7.3.5" - validate-npm-package-license "^3.0.4" - validate-npm-package-name "^3.0.0" - -inquirer@^7.3.3: - version "7.3.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" - integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.19" - mute-stream "0.0.8" - run-async "^2.4.0" - rxjs "^6.6.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== - dependencies: - get-intrinsic "^1.1.0" - has "^1.0.3" - side-channel "^1.0.4" - -ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" - -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== - -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - -is-core-module@^2.2.0, is-core-module@^2.5.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" - integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== - dependencies: - has "^1.0.3" - -is-date-object@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - -is-docker@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-installed-globally@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" - integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== - dependencies: - global-dirs "^3.0.0" - is-path-inside "^3.0.2" - -is-lambda@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" - integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= - -is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== - -is-npm@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8" - integrity sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA== - -is-number-object@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" - integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== - dependencies: - has-tostringtag "^1.0.0" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-obj@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" - integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== - -is-path-inside@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - -is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - -is-plain-obj@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - -is-regex@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-shared-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" - integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== - -is-ssh@^1.3.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.3.tgz#7f133285ccd7f2c2c7fc897b771b53d95a2b2c7e" - integrity sha512-NKzJmQzJfEEma3w5cJNcUMxoXfDjz0Zj0eyCalHn2E6VOwlzjZo0yuO2fcBSf8zhFuVCL/82/r5gRcoi6aEPVQ== - dependencies: - protocols "^1.1.0" - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" - -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - -is-text-path@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" - integrity sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= - dependencies: - text-extensions "^1.0.0" - -is-typedarray@^1.0.0, is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -is-weakref@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" - integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== - dependencies: - call-bind "^1.0.0" - -is-wsl@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -is-yarn-global@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" - integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -jju@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a" - integrity sha1-o6vicYryQaKykE+EpiWXDzia4yo= - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= - -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-parse-helpfulerror@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz#13f14ce02eed4e981297b64eb9e3b932e2dd13dc" - integrity sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w= - dependencies: - jju "^1.1.0" - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -jsonlines@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsonlines/-/jsonlines-0.1.1.tgz#4fcd246dc5d0e38691907c44ab002f782d1d94cc" - integrity sha1-T80kbcXQ44aRkHxEqwAveC0dlMw= - -jsonparse@^1.2.0, jsonparse@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -keyv@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" - integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== - dependencies: - json-buffer "3.0.0" - -kind-of@^6.0.2, kind-of@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -latest-version@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" - integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== - dependencies: - package-json "^6.3.0" - -lerna@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-4.0.0.tgz#b139d685d50ea0ca1be87713a7c2f44a5b678e9e" - integrity sha512-DD/i1znurfOmNJb0OBw66NmNqiM8kF6uIrzrJ0wGE3VNdzeOhz9ziWLYiRaZDGGwgbcjOo6eIfcx9O5Qynz+kg== - dependencies: - "@lerna/add" "4.0.0" - "@lerna/bootstrap" "4.0.0" - "@lerna/changed" "4.0.0" - "@lerna/clean" "4.0.0" - "@lerna/cli" "4.0.0" - "@lerna/create" "4.0.0" - "@lerna/diff" "4.0.0" - "@lerna/exec" "4.0.0" - "@lerna/import" "4.0.0" - "@lerna/info" "4.0.0" - "@lerna/init" "4.0.0" - "@lerna/link" "4.0.0" - "@lerna/list" "4.0.0" - "@lerna/publish" "4.0.0" - "@lerna/run" "4.0.0" - "@lerna/version" "4.0.0" - import-local "^3.0.2" - npmlog "^4.1.2" - -libnpmaccess@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-4.0.3.tgz#dfb0e5b0a53c315a2610d300e46b4ddeb66e7eec" - integrity sha512-sPeTSNImksm8O2b6/pf3ikv4N567ERYEpeKRPSmqlNt1dTZbvgpJIzg5vAhXHpw2ISBsELFRelk0jEahj1c6nQ== - dependencies: - aproba "^2.0.0" - minipass "^3.1.1" - npm-package-arg "^8.1.2" - npm-registry-fetch "^11.0.0" - -libnpmconfig@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/libnpmconfig/-/libnpmconfig-1.2.1.tgz#c0c2f793a74e67d4825e5039e7a02a0044dfcbc0" - integrity sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA== - dependencies: - figgy-pudding "^3.5.1" - find-up "^3.0.0" - ini "^1.3.5" - -libnpmpublish@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-4.0.2.tgz#be77e8bf5956131bcb45e3caa6b96a842dec0794" - integrity sha512-+AD7A2zbVeGRCFI2aO//oUmapCwy7GHqPXFJh3qpToSRNU+tXKJ2YFUgjt04LPPAf2dlEH95s6EhIHM1J7bmOw== - dependencies: - normalize-package-data "^3.0.2" - npm-package-arg "^8.1.2" - npm-registry-fetch "^11.0.0" - semver "^7.1.3" - ssri "^8.0.1" - -lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -load-json-file@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-6.2.0.tgz#5c7770b42cafa97074ca2848707c61662f4251a1" - integrity sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ== - dependencies: - graceful-fs "^4.1.15" - parse-json "^5.0.0" - strip-bom "^4.0.0" - type-fest "^0.6.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= - -lodash.ismatch@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" - integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= - -lodash.template@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" - integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.templatesettings "^4.0.0" - -lodash.templatesettings@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" - integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== - dependencies: - lodash._reinterpolate "^3.0.0" - -lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.7.0: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -make-dir@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" - integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== - dependencies: - pify "^4.0.1" - semver "^5.6.0" - -make-dir@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - -make-fetch-happen@^8.0.9: - version "8.0.14" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz#aaba73ae0ab5586ad8eaa68bd83332669393e222" - integrity sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ== - dependencies: - agentkeepalive "^4.1.3" - cacache "^15.0.5" - http-cache-semantics "^4.1.0" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-lambda "^1.0.1" - lru-cache "^6.0.0" - minipass "^3.1.3" - minipass-collect "^1.0.2" - minipass-fetch "^1.3.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.4" - promise-retry "^2.0.1" - socks-proxy-agent "^5.0.0" - ssri "^8.0.0" - -make-fetch-happen@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" - integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== - dependencies: - agentkeepalive "^4.1.3" - cacache "^15.2.0" - http-cache-semantics "^4.1.0" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-lambda "^1.0.1" - lru-cache "^6.0.0" - minipass "^3.1.3" - minipass-collect "^1.0.2" - minipass-fetch "^1.3.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.4" - negotiator "^0.6.2" - promise-retry "^2.0.1" - socks-proxy-agent "^6.0.0" - ssri "^8.0.0" - -map-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= - -map-obj@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" - integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== - -meow@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/meow/-/meow-7.1.1.tgz#7c01595e3d337fcb0ec4e8eed1666ea95903d306" - integrity sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^2.5.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.13.1" - yargs-parser "^18.1.3" - -meow@^8.0.0: - version "8.1.2" - resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" - integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - -mime-db@1.50.0, "mime-db@>= 1.43.0 < 2": - version "1.50.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" - integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== - -mime-db@~1.33.0: - version "1.33.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" - integrity sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ== - -mime-types@2.1.18: - version "2.1.18" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" - integrity sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ== - dependencies: - mime-db "~1.33.0" - -mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.33" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" - integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== - dependencies: - mime-db "1.50.0" - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -mimic-response@^1.0.0, mimic-response@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist-options@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" - integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - kind-of "^6.0.3" - -minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -minipass-collect@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" - integrity sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA== - dependencies: - minipass "^3.0.0" - -minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.4.1.tgz#d75e0091daac1b0ffd7e9d41629faff7d0c1f1b6" - integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw== - dependencies: - minipass "^3.1.0" - minipass-sized "^1.0.3" - minizlib "^2.0.0" - optionalDependencies: - encoding "^0.1.12" - -minipass-flush@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" - integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== - dependencies: - minipass "^3.0.0" - -minipass-json-stream@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz#7edbb92588fbfc2ff1db2fc10397acb7b6b44aa7" - integrity sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg== - dependencies: - jsonparse "^1.3.1" - minipass "^3.0.0" - -minipass-pipeline@^1.2.2, minipass-pipeline@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" - integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== - dependencies: - minipass "^3.0.0" - -minipass-sized@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/minipass-sized/-/minipass-sized-1.0.3.tgz#70ee5a7c5052070afacfbc22977ea79def353b70" - integrity sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g== - dependencies: - minipass "^3.0.0" - -minipass@^2.6.0, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.5.tgz#71f6251b0a33a49c01b3cf97ff77eda030dff732" - integrity sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw== - dependencies: - yallist "^4.0.0" - -minizlib@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - -minizlib@^2.0.0, minizlib@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" - integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== - dependencies: - minipass "^3.0.0" - yallist "^4.0.0" - -mkdirp-infer-owner@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz#55d3b368e7d89065c38f32fd38e638f0ab61d316" - integrity sha512-sdqtiFt3lkOaYvTXSRIUjkIdPTcxgv5+fgqYE/5qgwdw12cOrAuzzgzvVExIkH/ul1oeHN3bCLOWSG3XOqbKKw== - dependencies: - chownr "^2.0.0" - infer-owner "^1.0.4" - mkdirp "^1.0.3" - -mkdirp@^0.5.1, mkdirp@^0.5.5: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mkdirp@^1.0.3, mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -modify-values@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" - integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@^2.0.0: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -multimatch@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-5.0.0.tgz#932b800963cea7a31a033328fa1e0c3a1874dbe6" - integrity sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA== - dependencies: - "@types/minimatch" "^3.0.3" - array-differ "^3.0.0" - array-union "^2.1.0" - arrify "^2.0.1" - minimatch "^3.0.4" - -mute-stream@0.0.8, mute-stream@~0.0.4: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - -negotiator@0.6.2, negotiator@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -neo-async@^2.6.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -node-fetch@^2.6.1: - version "2.6.5" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd" - integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ== - dependencies: - whatwg-url "^5.0.0" - -node-gyp@^5.0.2: - version "5.1.1" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.1.1.tgz#eb915f7b631c937d282e33aed44cb7a025f62a3e" - integrity sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw== - dependencies: - env-paths "^2.2.0" - glob "^7.1.4" - graceful-fs "^4.2.2" - mkdirp "^0.5.1" - nopt "^4.0.1" - npmlog "^4.1.2" - request "^2.88.0" - rimraf "^2.6.3" - semver "^5.7.1" - tar "^4.4.12" - which "^1.3.1" - -node-gyp@^7.1.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-7.1.2.tgz#21a810aebb187120251c3bcec979af1587b188ae" - integrity sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ== - dependencies: - env-paths "^2.2.0" - glob "^7.1.4" - graceful-fs "^4.2.3" - nopt "^5.0.0" - npmlog "^4.1.2" - request "^2.88.2" - rimraf "^3.0.2" - semver "^7.3.2" - tar "^6.0.2" - which "^2.0.2" - -nopt@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48" - integrity sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg== - dependencies: - abbrev "1" - osenv "^0.1.4" - -nopt@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" - integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ== - dependencies: - abbrev "1" - -normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-package-data@^3.0.0, normalize-package-data@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" - integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== - dependencies: - hosted-git-info "^4.0.1" - is-core-module "^2.5.0" - semver "^7.3.4" - validate-npm-package-license "^3.0.1" - -normalize-url@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" - integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== - -normalize-url@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" - integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== - -npm-bundled@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.2.tgz#944c78789bd739035b70baa2ca5cc32b8d860bc1" - integrity sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ== - dependencies: - npm-normalize-package-bin "^1.0.1" - -npm-check-updates@^11.8.5: - version "11.8.5" - resolved "https://registry.yarnpkg.com/npm-check-updates/-/npm-check-updates-11.8.5.tgz#8dec7fd255a437264742c15f9c0bb29f4eceaf55" - integrity sha512-IYSHjlWe8UEugDy7X0qjBeJwcni4DlcWdBK4QQEbwgkNlEDlXyd4yQJYWFumKaJzrp/n5/EcvaboXsBD1Er/pw== - dependencies: - chalk "^4.1.2" - cint "^8.2.1" - cli-table "^0.3.6" - commander "^6.2.1" - fast-memoize "^2.5.2" - find-up "5.0.0" - fp-and-or "^0.1.3" - get-stdin "^8.0.0" - globby "^11.0.4" - hosted-git-info "^4.0.2" - json-parse-helpfulerror "^1.0.3" - jsonlines "^0.1.1" - libnpmconfig "^1.2.1" - lodash "^4.17.21" - minimatch "^3.0.4" - p-map "^4.0.0" - pacote "^11.3.5" - parse-github-url "^1.0.2" - progress "^2.0.3" - prompts "^2.4.1" - rc-config-loader "^4.0.0" - remote-git-tags "^3.0.0" - rimraf "^3.0.2" - semver "^7.3.5" - semver-utils "^1.1.4" - spawn-please "^1.0.0" - update-notifier "^5.1.0" - -npm-install-checks@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-4.0.0.tgz#a37facc763a2fde0497ef2c6d0ac7c3fbe00d7b4" - integrity sha512-09OmyDkNLYwqKPOnbI8exiOZU2GVVmQp7tgez2BPi5OZC8M82elDAps7sxC4l//uSUtotWqoEIDwjRvWH4qz8w== - dependencies: - semver "^7.1.1" - -npm-lifecycle@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz#9882d3642b8c82c815782a12e6a1bfeed0026309" - integrity sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g== - dependencies: - byline "^5.0.0" - graceful-fs "^4.1.15" - node-gyp "^5.0.2" - resolve-from "^4.0.0" - slide "^1.1.6" - uid-number "0.0.6" - umask "^1.1.0" - which "^1.3.1" - -npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" - integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== - -npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-package-arg@^8.1.2, npm-package-arg@^8.1.5: - version "8.1.5" - resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.5.tgz#3369b2d5fe8fdc674baa7f1786514ddc15466e44" - integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q== - dependencies: - hosted-git-info "^4.0.1" - semver "^7.3.4" - validate-npm-package-name "^3.0.0" - -npm-packlist@^2.1.4: - version "2.2.2" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-2.2.2.tgz#076b97293fa620f632833186a7a8f65aaa6148c8" - integrity sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg== - dependencies: - glob "^7.1.6" - ignore-walk "^3.0.3" - npm-bundled "^1.1.1" - npm-normalize-package-bin "^1.0.1" - -npm-pick-manifest@^6.0.0, npm-pick-manifest@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz#7b5484ca2c908565f43b7f27644f36bb816f5148" - integrity sha512-dBsdBtORT84S8V8UTad1WlUyKIY9iMsAmqxHbLdeEeBNMLQDlDWWra3wYUx9EBEIiG/YwAy0XyNHDd2goAsfuA== - dependencies: - npm-install-checks "^4.0.0" - npm-normalize-package-bin "^1.0.1" - npm-package-arg "^8.1.2" - semver "^7.3.4" - -npm-registry-fetch@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz#68c1bb810c46542760d62a6a965f85a702d43a76" - integrity sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA== - dependencies: - make-fetch-happen "^9.0.1" - minipass "^3.1.3" - minipass-fetch "^1.3.0" - minipass-json-stream "^1.0.1" - minizlib "^2.0.0" - npm-package-arg "^8.0.0" - -npm-registry-fetch@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-9.0.0.tgz#86f3feb4ce00313bc0b8f1f8f69daae6face1661" - integrity sha512-PuFYYtnQ8IyVl6ib9d3PepeehcUeHN9IO5N/iCRhyg9tStQcqGQBRVHmfmMWPDERU3KwZoHFvbJ4FPXPspvzbA== - dependencies: - "@npmcli/ci-detect" "^1.0.0" - lru-cache "^6.0.0" - make-fetch-happen "^8.0.9" - minipass "^3.1.3" - minipass-fetch "^1.3.0" - minipass-json-stream "^1.0.1" - minizlib "^2.0.0" - npm-package-arg "^8.0.0" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -npmlog@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-inspect@^1.11.0, object-inspect@^1.9.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== - -object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" - object-keys "^1.1.1" - -object.getownpropertydescriptors@^2.0.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz#b223cf38e17fefb97a63c10c91df72ccb386df9e" - integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - -on-headers@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" - integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^5.1.0, onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -p-cancelable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" - integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-limit@^2.0.0, p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-map-series@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-map-series/-/p-map-series-2.1.0.tgz#7560d4c452d9da0c07e692fdbfe6e2c81a2a91f2" - integrity sha512-RpYIIK1zXSNEOdwxcfe7FdvGcs7+y5n8rifMhMNWvaxRNMPINJHF5GDeuVxWqnfrcHPSCnp7Oo5yNXHId9Av2Q== - -p-map@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" - integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== - dependencies: - aggregate-error "^3.0.0" - -p-pipe@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-3.1.0.tgz#48b57c922aa2e1af6a6404cb7c6bf0eb9cc8e60e" - integrity sha512-08pj8ATpzMR0Y80x50yJHn37NF6vjrqHutASaX5LiH5npS9XPvrUmscd9MF5R4fuYRHOxQR1FfMIlF7AzwoPqw== - -p-queue@^6.6.2: - version "6.6.2" - resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" - integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== - dependencies: - eventemitter3 "^4.0.4" - p-timeout "^3.2.0" - -p-reduce@^2.0.0, p-reduce@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-2.1.0.tgz#09408da49507c6c274faa31f28df334bc712b64a" - integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== - -p-timeout@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" - integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== - dependencies: - p-finally "^1.0.0" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -p-waterfall@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/p-waterfall/-/p-waterfall-2.1.1.tgz#63153a774f472ccdc4eb281cdb2967fcf158b2ee" - integrity sha512-RRTnDb2TBG/epPRI2yYXsimO0v3BXC8Yd3ogr1545IaqKK17VGhbWVeGGN+XfCm/08OK8635nH31c8bATkHuSw== - dependencies: - p-reduce "^2.0.0" - -package-json@^6.3.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" - integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== - dependencies: - got "^9.6.0" - registry-auth-token "^4.0.0" - registry-url "^5.0.0" - semver "^6.2.0" - -pacote@^11.2.6, pacote@^11.3.5: - version "11.3.5" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.5.tgz#73cf1fc3772b533f575e39efa96c50be8c3dc9d2" - integrity sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg== - dependencies: - "@npmcli/git" "^2.1.0" - "@npmcli/installed-package-contents" "^1.0.6" - "@npmcli/promise-spawn" "^1.2.0" - "@npmcli/run-script" "^1.8.2" - cacache "^15.0.5" - chownr "^2.0.0" - fs-minipass "^2.1.0" - infer-owner "^1.0.4" - minipass "^3.1.3" - mkdirp "^1.0.3" - npm-package-arg "^8.0.1" - npm-packlist "^2.1.4" - npm-pick-manifest "^6.0.0" - npm-registry-fetch "^11.0.0" - promise-retry "^2.0.1" - read-package-json-fast "^2.0.1" - rimraf "^3.0.2" - ssri "^8.0.1" - tar "^6.1.0" - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-github-url@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395" - integrity sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw== - -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -parse-path@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.3.tgz#82d81ec3e071dcc4ab49aa9f2c9c0b8966bb22bf" - integrity sha512-9Cepbp2asKnWTJ9x2kpw6Fe8y9JDbqwahGCTvklzd/cEq5C5JC59x2Xb0Kx+x0QZ8bvNquGO8/BWP0cwBHzSAA== - dependencies: - is-ssh "^1.3.0" - protocols "^1.4.0" - qs "^6.9.4" - query-string "^6.13.8" - -parse-url@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-6.0.0.tgz#f5dd262a7de9ec00914939220410b66cff09107d" - integrity sha512-cYyojeX7yIIwuJzledIHeLUBVJ6COVLeT4eF+2P6aKVzwvgKQPndCBv3+yQ7pcWjqToYwaligxzSYNNmGoMAvw== - dependencies: - is-ssh "^1.3.0" - normalize-url "^6.1.0" - parse-path "^4.0.0" - protocols "^1.4.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-is-inside@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-to-regexp@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.2.1.tgz#90b617025a16381a879bc82a38d4e8bdeb2bcf45" - integrity sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ== - -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - -picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== - -pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pify@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" - integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== - -pify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" - integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -prepend-http@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -progress@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -promise-inflight@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" - integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= - -promise-retry@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" - integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== - dependencies: - err-code "^2.0.2" - retry "^0.12.0" - -prompts@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61" - integrity sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.5" - -promzard@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" - integrity sha1-JqXW7ox97kyxIggwWs+5O6OCqe4= - dependencies: - read "1" - -proto-list@~1.2.1: - version "1.2.4" - resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" - integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= - -protocols@^1.1.0, protocols@^1.4.0: - version "1.4.8" - resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.8.tgz#48eea2d8f58d9644a4a32caae5d5db290a075ce8" - integrity sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg== - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -punycode@^1.3.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= - -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -pupa@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" - integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== - dependencies: - escape-goat "^2.0.0" - -q@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= - -qs@^6.9.4: - version "6.10.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a" - integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== - dependencies: - side-channel "^1.0.4" - -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -query-string@^6.13.8: - version "6.14.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" - integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== - dependencies: - decode-uri-component "^0.2.0" - filter-obj "^1.1.0" - split-on-first "^1.0.0" - strict-uri-encode "^2.0.0" - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -quick-lru@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" - integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== - -range-parser@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= - -rc-config-loader@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/rc-config-loader/-/rc-config-loader-4.0.0.tgz#144cf31961c9f8ebcf252bd9c263fd40d62bd387" - integrity sha512-//LRTblJEcqbmmro1GCmZ39qZXD+JqzuD8Y5/IZU3Dhp3A1Yr0Xn68ks8MQ6qKfKvYCWDveUmRDKDA40c+sCXw== - dependencies: - debug "^4.1.1" - js-yaml "^4.0.0" - json5 "^2.1.2" - require-from-string "^2.0.2" - -rc@^1.0.1, rc@^1.1.6, rc@^1.2.8: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -read-cmd-shim@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz#4a50a71d6f0965364938e9038476f7eede3928d9" - integrity sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw== - -read-package-json-fast@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz#323ca529630da82cb34b36cc0b996693c98c2b83" - integrity sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ== - dependencies: - json-parse-even-better-errors "^2.3.0" - npm-normalize-package-bin "^1.0.1" - -read-package-json@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.1.2.tgz#6992b2b66c7177259feb8eaac73c3acd28b9222a" - integrity sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA== - dependencies: - glob "^7.1.1" - json-parse-even-better-errors "^2.3.0" - normalize-package-data "^2.0.0" - npm-normalize-package-bin "^1.0.0" - -read-package-json@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-3.0.1.tgz#c7108f0b9390257b08c21e3004d2404c806744b9" - integrity sha512-aLcPqxovhJTVJcsnROuuzQvv6oziQx4zd3JvG0vGCL5MjTONUc4uJ90zCBC6R7W7oUKBNoR/F8pkyfVwlbxqng== - dependencies: - glob "^7.1.1" - json-parse-even-better-errors "^2.3.0" - normalize-package-data "^3.0.0" - npm-normalize-package-bin "^1.0.0" - -read-package-json@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-4.1.1.tgz#153be72fce801578c1c86b8ef2b21188df1b9eea" - integrity sha512-P82sbZJ3ldDrWCOSKxJT0r/CXMWR0OR3KRh55SgKo3p91GSIEEC32v3lSHAvO/UcH3/IoL7uqhOFBduAnwdldw== - dependencies: - glob "^7.1.1" - json-parse-even-better-errors "^2.3.0" - normalize-package-data "^3.0.0" - npm-normalize-package-bin "^1.0.0" - -read-package-tree@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.3.1.tgz#a32cb64c7f31eb8a6f31ef06f9cedf74068fe636" - integrity sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw== - dependencies: - read-package-json "^2.0.0" - readdir-scoped-modules "^1.0.0" - util-promisify "^2.1.0" - -read-pkg-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" - integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= - dependencies: - find-up "^2.0.0" - read-pkg "^3.0.0" - -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - -read@1, read@~1.0.1: - version "1.0.7" - resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" - integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= - dependencies: - mute-stream "~0.0.4" - -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@^2.0.6, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdir-scoped-modules@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" - integrity sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw== - dependencies: - debuglog "^1.0.1" - dezalgo "^1.0.0" - graceful-fs "^4.1.2" - once "^1.3.0" - -redent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" - integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== - dependencies: - indent-string "^4.0.0" - strip-indent "^3.0.0" - -registry-auth-token@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" - integrity sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ== - dependencies: - rc "^1.1.6" - safe-buffer "^5.0.1" - -registry-auth-token@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250" - integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw== - dependencies: - rc "^1.2.8" - -registry-url@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" - integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= - dependencies: - rc "^1.0.1" - -registry-url@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" - integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== - dependencies: - rc "^1.2.8" - -remote-git-tags@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/remote-git-tags/-/remote-git-tags-3.0.0.tgz#424f8ec2cdea00bb5af1784a49190f25e16983c3" - integrity sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w== - -request@^2.88.0, request@^2.88.2: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve@^1.10.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" - -responselike@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= - dependencies: - lowercase-keys "^1.0.0" - -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - -retry@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" - integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^2.6.3: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -rxjs@^6.6.0: - version "6.6.7" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" - integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== - dependencies: - tslib "^1.9.0" - -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver-diff@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" - integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg== - dependencies: - semver "^6.3.0" - -semver-utils@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/semver-utils/-/semver-utils-1.1.4.tgz#cf0405e669a57488913909fc1c3f29bf2a4871e2" - integrity sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA== - -"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -serve-handler@6.1.3: - version "6.1.3" - resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-6.1.3.tgz#1bf8c5ae138712af55c758477533b9117f6435e8" - integrity sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w== - dependencies: - bytes "3.0.0" - content-disposition "0.5.2" - fast-url-parser "1.1.3" - mime-types "2.1.18" - minimatch "3.0.4" - path-is-inside "1.0.2" - path-to-regexp "2.2.1" - range-parser "1.2.0" - -serve@^12.0.1: - version "12.0.1" - resolved "https://registry.yarnpkg.com/serve/-/serve-12.0.1.tgz#5b0e05849f5ed9b8aab0f30a298c3664bba052bb" - integrity sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw== - dependencies: - "@zeit/schemas" "2.6.0" - ajv "6.12.6" - arg "2.0.0" - boxen "1.3.0" - chalk "2.4.1" - clipboardy "2.3.0" - compression "1.7.3" - serve-handler "6.1.3" - update-check "1.5.2" - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -shallow-clone@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" - integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== - dependencies: - kind-of "^6.0.2" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.5" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" - integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== - -sisteransi@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" - integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -slide@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" - integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= - -smart-buffer@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" - integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== - -socks-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz#032fb583048a29ebffec2e6a73fca0761f48177e" - integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== - dependencies: - agent-base "^6.0.2" - debug "4" - socks "^2.3.3" - -socks-proxy-agent@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz#869cf2d7bd10fea96c7ad3111e81726855e285c3" - integrity sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg== - dependencies: - agent-base "^6.0.2" - debug "^4.3.1" - socks "^2.6.1" - -socks@^2.3.3, socks@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.1.tgz#989e6534a07cf337deb1b1c94aaa44296520d30e" - integrity sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA== - dependencies: - ip "^1.1.5" - smart-buffer "^4.1.0" - -sort-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" - integrity sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= - dependencies: - is-plain-obj "^1.0.0" - -sort-keys@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-4.2.0.tgz#6b7638cee42c506fff8c1cecde7376d21315be18" - integrity sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg== - dependencies: - is-plain-obj "^2.0.0" - -source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -spawn-please@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/spawn-please/-/spawn-please-1.0.0.tgz#51cf5831ba2bf418aa3ec2102d40b75cfd48b6f2" - integrity sha512-Kz33ip6NRNKuyTRo3aDWyWxeGeM0ORDO552Fs6E1nj4pLWPkl37SrRtTnq+MEopVaqgmaO6bAvVS+v64BJ5M/A== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.10" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" - integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== - -split-on-first@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" - integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== - -split2@^3.0.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" - -split@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" - integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== - dependencies: - through "2" - -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -ssri@^8.0.0, ssri@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" - integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ== - dependencies: - minipass "^3.1.1" - -strict-uri-encode@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" - integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string.prototype.trimend@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" - integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string.prototype.trimstart@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" - integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -strong-log-transformer@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz#0f5ed78d325e0421ac6f90f7f10e691d6ae3ae10" - integrity sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA== - dependencies: - duplexer "^0.1.1" - minimist "^1.2.0" - through "^2.3.4" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -tar@^4.4.12: - version "4.4.19" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" - integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== - dependencies: - chownr "^1.1.4" - fs-minipass "^1.2.7" - minipass "^2.9.0" - minizlib "^1.3.3" - mkdirp "^0.5.5" - safe-buffer "^5.2.1" - yallist "^3.1.1" - -tar@^6.0.2, tar@^6.1.0: - version "6.1.11" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== - dependencies: - chownr "^2.0.0" - fs-minipass "^2.0.0" - minipass "^3.0.0" - minizlib "^2.1.1" - mkdirp "^1.0.3" - yallist "^4.0.0" - -temp-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" - integrity sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= - -temp-write@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/temp-write/-/temp-write-4.0.0.tgz#cd2e0825fc826ae72d201dc26eef3bf7e6fc9320" - integrity sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw== - dependencies: - graceful-fs "^4.1.15" - is-stream "^2.0.0" - make-dir "^3.0.0" - temp-dir "^1.0.0" - uuid "^3.3.2" - -term-size@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" - integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= - dependencies: - execa "^0.7.0" - -text-extensions@^1.0.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" - integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== - -through2@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -through2@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" - integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== - dependencies: - readable-stream "3" - -through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -to-readable-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" - integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tr46@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" - integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== - dependencies: - punycode "^2.1.1" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -trim-newlines@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" - integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== - -tslib@^1.9.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -type-fest@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" - integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== - -type-fest@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" - integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8" - integrity sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw== - -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= - -uglify-js@^3.1.4: - version "3.14.2" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.2.tgz#d7dd6a46ca57214f54a2d0a43cad0f35db82ac99" - integrity sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A== - -uid-number@0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" - integrity sha1-DqEOgDXo61uOREnwbaHHMGY7qoE= - -umask@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" - integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= - -unbox-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" - integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== - dependencies: - function-bind "^1.1.1" - has-bigints "^1.0.1" - has-symbols "^1.0.2" - which-boxed-primitive "^1.0.2" - -unique-filename@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" - integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== - dependencies: - unique-slug "^2.0.0" - -unique-slug@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" - integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== - dependencies: - imurmurhash "^0.1.4" - -unique-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" - integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== - dependencies: - crypto-random-string "^2.0.0" - -universal-user-agent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" - integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== - -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - -upath@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" - integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w== - -update-check@1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/update-check/-/update-check-1.5.2.tgz#2fe09f725c543440b3d7dabe8971f2d5caaedc28" - integrity sha512-1TrmYLuLj/5ZovwUS7fFd1jMH3NnFDN1y1A8dboedIDt7zs/zJMo6TwwlhYKkSeEwzleeiSBV5/3c9ufAQWDaQ== - dependencies: - registry-auth-token "3.3.2" - registry-url "3.1.0" - -update-notifier@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-5.1.0.tgz#4ab0d7c7f36a231dd7316cf7729313f0214d9ad9" - integrity sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw== - dependencies: - boxen "^5.0.0" - chalk "^4.1.0" - configstore "^5.0.1" - has-yarn "^2.1.0" - import-lazy "^2.1.0" - is-ci "^2.0.0" - is-installed-globally "^0.4.0" - is-npm "^5.0.0" - is-yarn-global "^0.3.0" - latest-version "^5.1.0" - pupa "^2.1.1" - semver "^7.3.4" - semver-diff "^3.1.1" - xdg-basedir "^4.0.0" - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -url-parse-lax@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= - dependencies: - prepend-http "^2.0.0" - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -util-promisify@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/util-promisify/-/util-promisify-2.1.0.tgz#3c2236476c4d32c5ff3c47002add7c13b9a82a53" - integrity sha1-PCI2R2xNMsX/PEcAKt18E7moKlM= - dependencies: - object.getownpropertydescriptors "^2.0.3" - -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -validate-npm-package-name@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" - integrity sha1-X6kS2B630MdK/BQN5zF/DKffQ34= - dependencies: - builtins "^1.0.3" - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -wcwidth@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= - dependencies: - defaults "^1.0.3" - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -webidl-conversions@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" - integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -whatwg-url@^8.4.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" - integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== - dependencies: - lodash "^4.7.0" - tr46 "^2.1.0" - webidl-conversions "^6.1.0" - -which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -which@^1.2.9, which@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -which@^2.0.1, which@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -widest-line@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" - integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== - dependencies: - string-width "^2.1.1" - -widest-line@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" - integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== - dependencies: - string-width "^4.0.0" - -wordwrap@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write-file-atomic@^2.4.2: - version "2.4.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" - integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - -write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== - dependencies: - imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" - -write-json-file@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-3.2.0.tgz#65bbdc9ecd8a1458e15952770ccbadfcff5fe62a" - integrity sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ== - dependencies: - detect-indent "^5.0.0" - graceful-fs "^4.1.15" - make-dir "^2.1.0" - pify "^4.0.1" - sort-keys "^2.0.0" - write-file-atomic "^2.4.2" - -write-json-file@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-4.3.0.tgz#908493d6fd23225344af324016e4ca8f702dd12d" - integrity sha512-PxiShnxf0IlnQuMYOPPhPkhExoCQuTUNPOa/2JWCYTmBquU9njyyDuwRKN26IZBlp4yn1nt+Agh2HOOBl+55HQ== - dependencies: - detect-indent "^6.0.0" - graceful-fs "^4.1.15" - is-plain-obj "^2.0.0" - make-dir "^3.0.0" - sort-keys "^4.0.0" - write-file-atomic "^3.0.0" - -write-pkg@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-4.0.0.tgz#675cc04ef6c11faacbbc7771b24c0abbf2a20039" - integrity sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA== - dependencies: - sort-keys "^2.0.0" - type-fest "^0.4.1" - write-json-file "^3.2.0" - -xdg-basedir@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" - integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== - -xtend@~4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yallist@^3.0.0, yallist@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yaml@^1.10.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - -yargs-parser@20.2.4: - version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - -yargs-parser@^18.1.3: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^20.2.2, yargs-parser@^20.2.3: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 60b5a76e4a68367868bf598c20005a38dde71d5a Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 28 Oct 2021 12:04:32 +0900 Subject: [PATCH 40/87] =?UTF-8?q?workspace=20=E3=82=92=E4=BD=BF=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=83=93=E3=83=AB=E3=83=89=E3=81=A7=E3=81=8D=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 16863 +++++++++++++++++++++++++++++++ package.json | 7 +- packages/e2ee/package.json | 2 +- packages/sdk/tsconfig.doc.json | 32 - 4 files changed, 16870 insertions(+), 34 deletions(-) create mode 100644 package-lock.json delete mode 100644 packages/sdk/tsconfig.doc.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..931da620 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,16863 @@ +{ + "name": "sora-js-sdk", + "version": "2021.2.0-canary.3", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "sora-js-sdk", + "version": "2021.2.0-canary.3", + "license": "Apache-2.0", + "workspaces": [ + "packages/sdk", + "packages/e2ee", + "packages/go-wasm" + ], + "devDependencies": { + "npm-check-updates": "^11.8.5", + "serve": "^12.0.1" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz", + "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.8.tgz", + "integrity": "sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.15.8", + "@babel/generator": "^7.15.8", + "@babel/helper-compilation-targets": "^7.15.4", + "@babel/helper-module-transforms": "^7.15.8", + "@babel/helpers": "^7.15.4", + "@babel/parser": "^7.15.8", + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.6", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/@babel/code-frame": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", + "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/core/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.8.tgz", + "integrity": "sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.15.6", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz", + "integrity": "sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.15.0", + "@babel/helper-validator-option": "^7.14.5", + "browserslist": "^4.16.6", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", + "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.15.4", + "@babel/template": "^7.15.4", + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-get-function-arity": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", + "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", + "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz", + "integrity": "sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz", + "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz", + "integrity": "sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.15.4", + "@babel/helper-replace-supers": "^7.15.4", + "@babel/helper-simple-access": "^7.15.4", + "@babel/helper-split-export-declaration": "^7.15.4", + "@babel/helper-validator-identifier": "^7.15.7", + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz", + "integrity": "sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz", + "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz", + "integrity": "sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.15.4", + "@babel/helper-optimise-call-expression": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz", + "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", + "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", + "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz", + "integrity": "sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ==", + "dev": true, + "dependencies": { + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.8.tgz", + "integrity": "sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz", + "integrity": "sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", + "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.15.4", + "@babel/types": "^7.15.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/code-frame": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", + "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", + "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.15.4", + "@babel/helper-function-name": "^7.15.4", + "@babel/helper-hoist-variables": "^7.15.4", + "@babel/helper-split-export-declaration": "^7.15.4", + "@babel/parser": "^7.15.4", + "@babel/types": "^7.15.4", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/code-frame": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", + "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", + "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.9", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@comandeer/babel-plugin-banner": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@comandeer/babel-plugin-banner/-/babel-plugin-banner-5.0.0.tgz", + "integrity": "sha512-sR9Go0U6puXoXyW9UgIiIQhRcJ8jVOvGl4BptUiXAtheMs72WcakZ1udh6J0ZOivr3o8jAM+MTCHLP8FZMbVpQ==", + "dev": true, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@gar/promisify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz", + "integrity": "sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw==", + "dev": true + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.3.1.tgz", + "integrity": "sha512-RkFNWmv0iui+qsOr/29q9dyfKTTT5DCuP31kUwg7rmOKPT/ozLeGLKJKVIiOfbiKyleUZKIrHwhmiZWVe8IMdw==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.3.1", + "jest-util": "^27.3.1", + "slash": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/core": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-27.3.1.tgz", + "integrity": "sha512-DMNE90RR5QKx0EA+wqe3/TNEwiRpOkhshKNxtLxd4rt3IZpCt+RSL+FoJsGeblRZmqdK4upHA/mKKGPPRAifhg==", + "dev": true, + "dependencies": { + "@jest/console": "^27.3.1", + "@jest/reporters": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-changed-files": "^27.3.0", + "jest-config": "^27.3.1", + "jest-haste-map": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-regex-util": "^27.0.6", + "jest-resolve": "^27.3.1", + "jest-resolve-dependencies": "^27.3.1", + "jest-runner": "^27.3.1", + "jest-runtime": "^27.3.1", + "jest-snapshot": "^27.3.1", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "jest-watcher": "^27.3.1", + "micromatch": "^4.0.4", + "rimraf": "^3.0.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/core/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/environment": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-27.3.1.tgz", + "integrity": "sha512-BCKCj4mOVLme6Tanoyc9k0ultp3pnmuyHw73UHRPeeZxirsU/7E3HC4le/VDb/SMzE1JcPnto+XBKFOcoiJzVw==", + "dev": true, + "dependencies": { + "@jest/fake-timers": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "jest-mock": "^27.3.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-27.3.1.tgz", + "integrity": "sha512-M3ZFgwwlqJtWZ+QkBG5NmC23A9w+A6ZxNsO5nJxJsKYt4yguBd3i8TpjQz5NfCX91nEve1KqD9RA2Q+Q1uWqoA==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "@sinonjs/fake-timers": "^8.0.1", + "@types/node": "*", + "jest-message-util": "^27.3.1", + "jest-mock": "^27.3.0", + "jest-util": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-27.3.1.tgz", + "integrity": "sha512-Q651FWiWQAIFiN+zS51xqhdZ8g9b88nGCobC87argAxA7nMfNQq0Q0i9zTfQYgLa6qFXk2cGANEqfK051CZ8Pg==", + "dev": true, + "dependencies": { + "@jest/environment": "^27.3.1", + "@jest/types": "^27.2.5", + "expect": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-27.3.1.tgz", + "integrity": "sha512-m2YxPmL9Qn1emFVgZGEiMwDntDxRRQ2D58tiDQlwYTg5GvbFOKseYCcHtn0WsI8CG4vzPglo3nqbOiT8ySBT/w==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.2.4", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.3", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "jest-haste-map": "^27.3.1", + "jest-resolve": "^27.3.1", + "jest-util": "^27.3.1", + "jest-worker": "^27.3.1", + "slash": "^3.0.0", + "source-map": "^0.6.0", + "string-length": "^4.0.1", + "terminal-link": "^2.0.0", + "v8-to-istanbul": "^8.1.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/source-map": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-27.0.6.tgz", + "integrity": "sha512-Fek4mi5KQrqmlY07T23JRi0e7Z9bXTOOD86V/uS0EIW4PClvPDqZOyFlLpNJheS6QI0FNX1CgmPjtJ4EA/2M+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0", + "graceful-fs": "^4.2.4", + "source-map": "^0.6.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.3.1.tgz", + "integrity": "sha512-mLn6Thm+w2yl0opM8J/QnPTqrfS4FoXsXF2WIWJb2O/GBSyResL71BRuMYbYRsGt7ELwS5JGcEcGb52BNrumgg==", + "dev": true, + "dependencies": { + "@jest/console": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-27.3.1.tgz", + "integrity": "sha512-siySLo07IMEdSjA4fqEnxfIX8lB/lWYsBPwNFtkOvsFQvmBrL3yj3k3uFNZv/JDyApTakRpxbKLJ3CT8UGVCrA==", + "dev": true, + "dependencies": { + "@jest/test-result": "^27.3.1", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.3.1", + "jest-runtime": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-27.3.1.tgz", + "integrity": "sha512-3fSvQ02kuvjOI1C1ssqMVBKJpZf6nwoCiSu00zAKh5nrp3SptNtZy/8s5deayHnqxhjD9CWDJ+yqQwuQ0ZafXQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.1.0", + "@jest/types": "^27.2.5", + "babel-plugin-istanbul": "^6.0.0", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.3.1", + "jest-regex-util": "^27.0.6", + "jest-util": "^27.3.1", + "micromatch": "^4.0.4", + "pirates": "^4.0.1", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/types": { + "version": "27.2.5", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.2.5.tgz", + "integrity": "sha512-nmuM4VuDtCZcY+eTpw+0nvstwReMsjPoj7ZR80/BbixulhLaiX+fbv8oeLW8WZlJMcsGQsTmMKT/iTZu1Uy/lQ==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/fs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.0.0.tgz", + "integrity": "sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ==", + "dev": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/git": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.1.0.tgz", + "integrity": "sha512-/hBFX/QG1b+N7PZBFs0bi+evgRZcK9nWBxQKZkGoXUT5hJSwl5c4d7y8/hm+NQZRPhQ67RzFaj5UM9YeyKoryw==", + "dev": true, + "dependencies": { + "@npmcli/promise-spawn": "^1.3.2", + "lru-cache": "^6.0.0", + "mkdirp": "^1.0.4", + "npm-pick-manifest": "^6.1.1", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^2.0.2" + } + }, + "node_modules/@npmcli/installed-package-contents": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", + "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==", + "dev": true, + "dependencies": { + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" + }, + "bin": { + "installed-package-contents": "index.js" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "dev": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/node-gyp": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz", + "integrity": "sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA==", + "dev": true + }, + "node_modules/@npmcli/promise-spawn": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz", + "integrity": "sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg==", + "dev": true, + "dependencies": { + "infer-owner": "^1.0.4" + } + }, + "node_modules/@npmcli/run-script": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz", + "integrity": "sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g==", + "dev": true, + "dependencies": { + "@npmcli/node-gyp": "^1.0.2", + "@npmcli/promise-spawn": "^1.3.2", + "node-gyp": "^7.1.0", + "read-package-json-fast": "^2.0.1" + } + }, + "node_modules/@rollup/plugin-commonjs": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz", + "integrity": "sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "commondir": "^1.0.1", + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^2.38.3" + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.6.tgz", + "integrity": "sha512-sFsPDMPd4gMqnh2gS0uIxELnoRUp5kBl5knxD2EO0778G1oOJv4G1vyT2cpWz75OU2jDVcXhjVUuTAczGyFNKA==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "rollup": "^2.42.0" + } + }, + "node_modules/@rollup/plugin-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-3.0.0.tgz", + "integrity": "sha512-3c7JCbMuYXM4PbPWT4+m/4Y6U60SgsnDT/cCyAyUKwFHg7pTSfsSQzIpETha3a3ig6OdOKzZz87D9ZXIK3qsDg==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "magic-string": "^0.25.7" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, + "node_modules/@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, + "dependencies": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" + } + }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + }, + "node_modules/@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz", + "integrity": "sha512-AU7kwFxreVd6OAXcAFlKSmZquiRUU0FvYm44k1Y1QbK7Co4m0aqfGMhjykIeQp/H6rcl+nFmj0zfdUcGVs9Dew==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.7.0" + } + }, + "node_modules/@sora/e2ee": { + "resolved": "packages/e2ee", + "link": true + }, + "node_modules/@sora/go-wasm": { + "resolved": "packages/go-wasm", + "link": true + }, + "node_modules/@sora/sdk": { + "resolved": "packages/sdk", + "link": true + }, + "node_modules/@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "dependencies": { + "defer-to-connect": "^1.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/babel__core": { + "version": "7.1.16", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz", + "integrity": "sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.3.tgz", + "integrity": "sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", + "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.3.0" + } + }, + "node_modules/@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", + "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "27.0.2", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.0.2.tgz", + "integrity": "sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA==", + "dev": true, + "dependencies": { + "jest-diff": "^27.0.0", + "pretty-format": "^27.0.0" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "16.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", + "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", + "dev": true + }, + "node_modules/@types/prettier": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw==", + "dev": true + }, + "node_modules/@types/resolve": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "20.2.1", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", + "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", + "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", + "dev": true, + "dependencies": { + "@typescript-eslint/experimental-utils": "4.33.0", + "@typescript-eslint/scope-manager": "4.33.0", + "debug": "^4.3.1", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^4.0.0", + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", + "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", + "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "debug": "^4.3.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", + "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", + "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", + "dev": true, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", + "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0", + "debug": "^4.3.1", + "globby": "^11.0.3", + "is-glob": "^4.0.1", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", + "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.33.0", + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@zeit/schemas": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@zeit/schemas/-/schemas-2.6.0.tgz", + "integrity": "sha512-uUrgZ8AxS+Lio0fZKAipJjAh415JyrOZowliZAzmnJSsf7piVL5w+G0+gFJ0KSu3QRhvui/7zuvpLz03YjXAhg==", + "dev": true + }, + "node_modules/abab": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", + "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "dev": true + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "dev": true, + "dependencies": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agentkeepalive": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz", + "integrity": "sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "dev": true, + "dependencies": { + "string-width": "^2.0.0" + } + }, + "node_modules/ansi-align/node_modules/ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-align/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-align/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-align/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "node_modules/arch": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/are-we-there-yet": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/arg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arg/-/arg-2.0.0.tgz", + "integrity": "sha512-XxNTUzKnz1ctK3ZIcI2XUPlD96wbHP2nGqkPKpvk/HNRlPveYrXIVSTk9m3LcqOgDPg3B1nMvdV/K8wZd7PG4w==", + "dev": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "node_modules/babel-helper-evaluate-path": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", + "integrity": "sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==", + "dev": true + }, + "node_modules/babel-helper-flip-expressions": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz", + "integrity": "sha1-NpZzahKKwYvCUlS19AoizrPB0/0=", + "dev": true + }, + "node_modules/babel-helper-is-nodes-equiv": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz", + "integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=", + "dev": true + }, + "node_modules/babel-helper-is-void-0": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz", + "integrity": "sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4=", + "dev": true + }, + "node_modules/babel-helper-mark-eval-scopes": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz", + "integrity": "sha1-0kSjvvmESHJgP/tG4izorN9VFWI=", + "dev": true + }, + "node_modules/babel-helper-remove-or-void": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz", + "integrity": "sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=", + "dev": true + }, + "node_modules/babel-helper-to-multiple-sequence-expressions": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz", + "integrity": "sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA==", + "dev": true + }, + "node_modules/babel-jest": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.3.1.tgz", + "integrity": "sha512-SjIF8hh/ir0peae2D6S6ZKRhUy7q/DnpH7k/V6fT4Bgs/LXXUztOpX4G2tCgq8mLo5HA9mN6NmlFMeYtKmIsTQ==", + "dev": true, + "dependencies": { + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.0.0", + "babel-preset-jest": "^27.2.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "slash": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz", + "integrity": "sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "27.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.2.0.tgz", + "integrity": "sha512-TOux9khNKdi64mW+0OIhcmbAn75tTlzKhxmiNXevQaPbrBYK7YKjP1jl6NHTJ6XR5UgUrJbCnWlKVnJn29dfjw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.0.0", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/babel-plugin-minify-builtins": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz", + "integrity": "sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag==", + "dev": true + }, + "node_modules/babel-plugin-minify-constant-folding": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz", + "integrity": "sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0" + } + }, + "node_modules/babel-plugin-minify-dead-code-elimination": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz", + "integrity": "sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-mark-eval-scopes": "^0.4.3", + "babel-helper-remove-or-void": "^0.4.3", + "lodash": "^4.17.11" + } + }, + "node_modules/babel-plugin-minify-flip-comparisons": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz", + "integrity": "sha1-AMqHDLjxO0XAOLPB68DyJyk8llo=", + "dev": true, + "dependencies": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "node_modules/babel-plugin-minify-guarded-expressions": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz", + "integrity": "sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3" + } + }, + "node_modules/babel-plugin-minify-infinity": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz", + "integrity": "sha1-37h2obCKBldjhO8/kuZTumB7Oco=", + "dev": true + }, + "node_modules/babel-plugin-minify-mangle-names": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz", + "integrity": "sha512-3jdNv6hCAw6fsX1p2wBGPfWuK69sfOjfd3zjUXkbq8McbohWy23tpXfy5RnToYWggvqzuMOwlId1PhyHOfgnGw==", + "dev": true, + "dependencies": { + "babel-helper-mark-eval-scopes": "^0.4.3" + } + }, + "node_modules/babel-plugin-minify-numeric-literals": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz", + "integrity": "sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw=", + "dev": true + }, + "node_modules/babel-plugin-minify-replace": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz", + "integrity": "sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q==", + "dev": true + }, + "node_modules/babel-plugin-minify-simplify": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz", + "integrity": "sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3", + "babel-helper-is-nodes-equiv": "^0.0.1", + "babel-helper-to-multiple-sequence-expressions": "^0.5.0" + } + }, + "node_modules/babel-plugin-minify-type-constructors": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz", + "integrity": "sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA=", + "dev": true, + "dependencies": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "node_modules/babel-plugin-transform-inline-consecutive-adds": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz", + "integrity": "sha1-Mj1Ho+pjqDp6w8gRro5pQfrysNE=", + "dev": true + }, + "node_modules/babel-plugin-transform-member-expression-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz", + "integrity": "sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8=", + "dev": true + }, + "node_modules/babel-plugin-transform-merge-sibling-variables": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz", + "integrity": "sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4=", + "dev": true + }, + "node_modules/babel-plugin-transform-minify-booleans": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz", + "integrity": "sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg=", + "dev": true + }, + "node_modules/babel-plugin-transform-property-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz", + "integrity": "sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk=", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + } + }, + "node_modules/babel-plugin-transform-regexp-constructors": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz", + "integrity": "sha1-WLd3W2OvzzMyj66aX4j71PsLSWU=", + "dev": true + }, + "node_modules/babel-plugin-transform-remove-console": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz", + "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=", + "dev": true + }, + "node_modules/babel-plugin-transform-remove-debugger": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz", + "integrity": "sha1-QrcnYxyXl44estGZp67IShgznvI=", + "dev": true + }, + "node_modules/babel-plugin-transform-remove-undefined": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz", + "integrity": "sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0" + } + }, + "node_modules/babel-plugin-transform-simplify-comparison-operators": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz", + "integrity": "sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk=", + "dev": true + }, + "node_modules/babel-plugin-transform-undefined-to-void": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz", + "integrity": "sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=", + "dev": true + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "27.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-27.2.0.tgz", + "integrity": "sha512-z7MgQ3peBwN5L5aCqBKnF6iqdlvZvFUQynEhu0J+X9nHLU72jO3iY331lcYrg+AssJ8q7xsv5/3AICzVmJ/wvg==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^27.2.0", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-minify": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.5.1.tgz", + "integrity": "sha512-1IajDumYOAPYImkHbrKeiN5AKKP9iOmRoO2IPbIuVp0j2iuCcj0n7P260z38siKMZZ+85d3mJZdtW8IgOv+Tzg==", + "dev": true, + "dependencies": { + "babel-plugin-minify-builtins": "^0.5.0", + "babel-plugin-minify-constant-folding": "^0.5.0", + "babel-plugin-minify-dead-code-elimination": "^0.5.1", + "babel-plugin-minify-flip-comparisons": "^0.4.3", + "babel-plugin-minify-guarded-expressions": "^0.4.4", + "babel-plugin-minify-infinity": "^0.4.3", + "babel-plugin-minify-mangle-names": "^0.5.0", + "babel-plugin-minify-numeric-literals": "^0.4.3", + "babel-plugin-minify-replace": "^0.5.0", + "babel-plugin-minify-simplify": "^0.5.1", + "babel-plugin-minify-type-constructors": "^0.4.3", + "babel-plugin-transform-inline-consecutive-adds": "^0.4.3", + "babel-plugin-transform-member-expression-literals": "^6.9.4", + "babel-plugin-transform-merge-sibling-variables": "^6.9.4", + "babel-plugin-transform-minify-booleans": "^6.9.4", + "babel-plugin-transform-property-literals": "^6.9.4", + "babel-plugin-transform-regexp-constructors": "^0.4.3", + "babel-plugin-transform-remove-console": "^6.9.4", + "babel-plugin-transform-remove-debugger": "^6.9.4", + "babel-plugin-transform-remove-undefined": "^0.5.0", + "babel-plugin-transform-simplify-comparison-operators": "^6.9.4", + "babel-plugin-transform-undefined-to-void": "^6.9.4", + "lodash": "^4.17.11" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "dev": true, + "dependencies": { + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/boxen/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/boxen/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", + "dev": true + }, + "node_modules/browserslist": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.5.tgz", + "integrity": "sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA==", + "dev": true, + "dependencies": { + "caniuse-lite": "^1.0.30001271", + "electron-to-chromium": "^1.3.878", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/builtin-modules": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", + "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", + "dev": true + }, + "node_modules/bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "dev": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacheable-request/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cacheable-request/node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001271", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz", + "integrity": "sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "node_modules/cint": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/cint/-/cint-8.2.1.tgz", + "integrity": "sha1-cDhrG0jidz0NYxZqVa/5TvRFahI=", + "dev": true + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", + "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "dev": true + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cli-table": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.6.tgz", + "integrity": "sha512-ZkNZbnZjKERTY5NwC2SeMeLeifSPq/pubeRoTpdr3WchLlnZg6hEgvHkK5zL7KNFdd9PmHN8lxrENUwI3cE8vQ==", + "dev": true, + "dependencies": { + "colors": "1.0.3" + }, + "engines": { + "node": ">= 0.2.0" + } + }, + "node_modules/clipboardy": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-2.3.0.tgz", + "integrity": "sha512-mKhiIL2DrQIsuXMgBgnfEHOZOryC7kY7YO//TN6c63wlEm3NG5tz+YgY5rVi29KCmq/QQjKYvM7a19+MDOTHOQ==", + "dev": true, + "dependencies": { + "arch": "^2.1.1", + "execa": "^1.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", + "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "dev": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", + "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", + "dev": true, + "dependencies": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.14", + "debug": "2.6.9", + "on-headers": "~1.0.1", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/compression/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/compression/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "dependencies": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/cross-spawn/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssom": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "dev": true + }, + "node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", + "dev": true + }, + "node_modules/decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.0.6.tgz", + "integrity": "sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ==", + "dev": true, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "dev": true, + "dependencies": { + "webidl-conversions": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/domexception/node_modules/webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.3.882", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.882.tgz", + "integrity": "sha512-Kllt2R9+7yEIBbASR0MReJSK9TjPmHoomLbCLRP7r4SVtSy+Y0hYIhQ7LGjnMhlAyWUtGXTiznoGsaKxEH0ttw==", + "dev": true + }, + "node_modules/emittery": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", + "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/escodegen/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", + "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", + "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=6.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/eslint/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "dependencies": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "dependencies": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-27.3.1.tgz", + "integrity": "sha512-MrNXV2sL9iDRebWPGOGFdPQRl2eDQNu/uhxIMShjjx74T6kC6jFIkmQ6OqXDtevjGUkyB2IT56RzDBqXf/QPCg==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "ansi-styles": "^5.0.0", + "jest-get-type": "^27.3.1", + "jest-matcher-utils": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-regex-util": "^27.0.6" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/expect/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true, + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fast-memoize": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", + "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==", + "dev": true + }, + "node_modules/fast-url-parser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz", + "integrity": "sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=", + "dev": true, + "dependencies": { + "punycode": "^1.3.2" + } + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", + "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fflate": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.7.1.tgz", + "integrity": "sha512-VYM2Xy1gSA5MerKzCnmmuV2XljkpKwgJBKezW+495TTnTCh1x5HcYa1aH8wRU/MfTGhW4ziXqgwprgQUVl3Ohw==" + }, + "node_modules/figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", + "dev": true + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/fp-and-or": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-0.1.3.tgz", + "integrity": "sha512-wJaE62fLaB3jCYvY2ZHjZvmKK2iiLiiehX38rz5QZxtdN8fVPJDeZUiVvJrHStdTc+23LHlyZuSEKgFc0pxi2g==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "node_modules/gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-dirs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "dev": true, + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/global-dirs/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", + "dev": true + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "dev": true, + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "node_modules/has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hosted-git-info": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", + "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^1.0.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/ignore-walk": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz", + "integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==", + "dev": true, + "dependencies": { + "minimatch": "^3.0.4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/import-local": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", + "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "node_modules/is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "dependencies": { + "ci-info": "^2.0.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, + "node_modules/is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "dev": true, + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=", + "dev": true + }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, + "node_modules/is-npm": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", + "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.5.tgz", + "integrity": "sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest/-/jest-27.3.1.tgz", + "integrity": "sha512-U2AX0AgQGd5EzMsiZpYt8HyZ+nSVIh5ujQ9CPp9EQZJMjXIiSZpJNweZl0swatKRoqHWgGKM3zaSwm4Zaz87ng==", + "dev": true, + "dependencies": { + "@jest/core": "^27.3.1", + "import-local": "^3.0.2", + "jest-cli": "^27.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "27.3.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-27.3.0.tgz", + "integrity": "sha512-9DJs9garMHv4RhylUMZgbdCJ3+jHSkpL9aaVKp13xtXAD80qLTLrqcDZL1PHA9dYA0bCI86Nv2BhkLpLhrBcPg==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "execa": "^5.0.0", + "throat": "^6.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-changed-files/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/jest-changed-files/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/jest-changed-files/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-changed-files/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-changed-files/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-circus": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-27.3.1.tgz", + "integrity": "sha512-v1dsM9II6gvXokgqq6Yh2jHCpfg7ZqV4jWY66u7npz24JnhP3NHxI0sKT7+ZMQ7IrOWHYAaeEllOySbDbWsiXw==", + "dev": true, + "dependencies": { + "@jest/environment": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^0.7.0", + "expect": "^27.3.1", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.3.1", + "jest-matcher-utils": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-runtime": "^27.3.1", + "jest-snapshot": "^27.3.1", + "jest-util": "^27.3.1", + "pretty-format": "^27.3.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3", + "throat": "^6.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-cli": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-27.3.1.tgz", + "integrity": "sha512-WHnCqpfK+6EvT62me6WVs8NhtbjAS4/6vZJnk7/2+oOr50cwAzG4Wxt6RXX0hu6m1169ZGMlhYYUNeKBXCph/Q==", + "dev": true, + "dependencies": { + "@jest/core": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/types": "^27.2.5", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "import-local": "^3.0.2", + "jest-config": "^27.3.1", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "prompts": "^2.0.1", + "yargs": "^16.2.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-27.3.1.tgz", + "integrity": "sha512-KY8xOIbIACZ/vdYCKSopL44I0xboxC751IX+DXL2+Wx6DKNycyEfV3rryC3BPm5Uq/BBqDoMrKuqLEUNJmMKKg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^27.3.1", + "@jest/types": "^27.2.5", + "babel-jest": "^27.3.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.4", + "jest-circus": "^27.3.1", + "jest-environment-jsdom": "^27.3.1", + "jest-environment-node": "^27.3.1", + "jest-get-type": "^27.3.1", + "jest-jasmine2": "^27.3.1", + "jest-regex-util": "^27.0.6", + "jest-resolve": "^27.3.1", + "jest-runner": "^27.3.1", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "micromatch": "^4.0.4", + "pretty-format": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/ci-info": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz", + "integrity": "sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A==", + "dev": true + }, + "node_modules/jest-diff": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.3.1.tgz", + "integrity": "sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^27.0.6", + "jest-get-type": "^27.3.1", + "pretty-format": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.0.6.tgz", + "integrity": "sha512-Fid6dPcjwepTFraz0YxIMCi7dejjJ/KL9FBjPYhBp4Sv1Y9PdhImlKZqYU555BlN4TQKaTc+F2Av1z+anVyGkA==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-each": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-27.3.1.tgz", + "integrity": "sha512-E4SwfzKJWYcvOYCjOxhZcxwL+AY0uFMvdCOwvzgutJiaiodFjkxQQDxHm8FQBeTqDnSmKsQWn7ldMRzTn2zJaQ==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "chalk": "^4.0.0", + "jest-get-type": "^27.3.1", + "jest-util": "^27.3.1", + "pretty-format": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-environment-jsdom": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-27.3.1.tgz", + "integrity": "sha512-3MOy8qMzIkQlfb3W1TfrD7uZHj+xx8Olix5vMENkj5djPmRqndMaXtpnaZkxmxM+Qc3lo+yVzJjzuXbCcZjAlg==", + "dev": true, + "dependencies": { + "@jest/environment": "^27.3.1", + "@jest/fake-timers": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "jest-mock": "^27.3.0", + "jest-util": "^27.3.1", + "jsdom": "^16.6.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-27.3.1.tgz", + "integrity": "sha512-T89F/FgkE8waqrTSA7/ydMkcc52uYPgZZ6q8OaZgyiZkJb5QNNCF6oPZjH9IfPFfcc9uBWh1574N0kY0pSvTXw==", + "dev": true, + "dependencies": { + "@jest/environment": "^27.3.1", + "@jest/fake-timers": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "jest-mock": "^27.3.0", + "jest-util": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.3.1.tgz", + "integrity": "sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg==", + "dev": true, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.3.1.tgz", + "integrity": "sha512-lYfNZIzwPccDJZIyk9Iz5iQMM/MH56NIIcGj7AFU1YyA4ewWFBl8z+YPJuSCRML/ee2cCt2y3W4K3VXPT6Nhzg==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "@types/graceful-fs": "^4.1.2", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-regex-util": "^27.0.6", + "jest-serializer": "^27.0.6", + "jest-util": "^27.3.1", + "jest-worker": "^27.3.1", + "micromatch": "^4.0.4", + "walker": "^1.0.7" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-jasmine2": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-27.3.1.tgz", + "integrity": "sha512-WK11ZUetDQaC09w4/j7o4FZDUIp+4iYWH/Lik34Pv7ukL+DuXFGdnmmi7dT58J2ZYKFB5r13GyE0z3NPeyJmsg==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^27.3.1", + "@jest/source-map": "^27.0.6", + "@jest/test-result": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "expect": "^27.3.1", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.3.1", + "jest-matcher-utils": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-runtime": "^27.3.1", + "jest-snapshot": "^27.3.1", + "jest-util": "^27.3.1", + "pretty-format": "^27.3.1", + "throat": "^6.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-leak-detector": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-27.3.1.tgz", + "integrity": "sha512-78QstU9tXbaHzwlRlKmTpjP9k4Pvre5l0r8Spo4SbFFVy/4Abg9I6ZjHwjg2QyKEAMg020XcjP+UgLZIY50yEg==", + "dev": true, + "dependencies": { + "jest-get-type": "^27.3.1", + "pretty-format": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.3.1.tgz", + "integrity": "sha512-hX8N7zXS4k+8bC1Aj0OWpGb7D3gIXxYvPNK1inP5xvE4ztbz3rc4AkI6jGVaerepBnfWB17FL5lWFJT3s7qo8w==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^27.3.1", + "jest-get-type": "^27.3.1", + "pretty-format": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.3.1.tgz", + "integrity": "sha512-bh3JEmxsTZ/9rTm0jQrPElbY2+y48Rw2t47uMfByNyUVR+OfPh4anuyKsGqsNkXk/TI4JbLRZx+7p7Hdt6q1yg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.2.5", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.4", + "pretty-format": "^27.3.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-message-util/node_modules/@babel/code-frame": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", + "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/jest-mock": { + "version": "27.3.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.3.0.tgz", + "integrity": "sha512-ziZiLk0elZOQjD08bLkegBzv5hCABu/c8Ytx45nJKkysQwGaonvmTxwjLqEA4qGdasq9o2I8/HtdGMNnVsMTGw==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "@types/node": "*" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "dev": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.0.6.tgz", + "integrity": "sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ==", + "dev": true, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-27.3.1.tgz", + "integrity": "sha512-Dfzt25CFSPo3Y3GCbxynRBZzxq9AdyNN+x/v2IqYx6KVT5Z6me2Z/PsSGFSv3cOSUZqJ9pHxilao/I/m9FouLw==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.3.1", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "resolve": "^1.20.0", + "resolve.exports": "^1.1.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.1.tgz", + "integrity": "sha512-X7iLzY8pCiYOnvYo2YrK3P9oSE8/3N2f4pUZMJ8IUcZnT81vlSonya1KTO9ZfKGuC+svE6FHK/XOb8SsoRUV1A==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "jest-regex-util": "^27.0.6", + "jest-snapshot": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-runner": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-27.3.1.tgz", + "integrity": "sha512-r4W6kBn6sPr3TBwQNmqE94mPlYVn7fLBseeJfo4E2uCTmAyDFm2O5DYAQAFP7Q3YfiA/bMwg8TVsciP7k0xOww==", + "dev": true, + "dependencies": { + "@jest/console": "^27.3.1", + "@jest/environment": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-docblock": "^27.0.6", + "jest-environment-jsdom": "^27.3.1", + "jest-environment-node": "^27.3.1", + "jest-haste-map": "^27.3.1", + "jest-leak-detector": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-resolve": "^27.3.1", + "jest-runtime": "^27.3.1", + "jest-util": "^27.3.1", + "jest-worker": "^27.3.1", + "source-map-support": "^0.5.6", + "throat": "^6.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-27.3.1.tgz", + "integrity": "sha512-qtO6VxPbS8umqhEDpjA4pqTkKQ1Hy4ZSi9mDVeE9Za7LKBo2LdW2jmT+Iod3XFaJqINikZQsn2wEi0j9wPRbLg==", + "dev": true, + "dependencies": { + "@jest/console": "^27.3.1", + "@jest/environment": "^27.3.1", + "@jest/globals": "^27.3.1", + "@jest/source-map": "^27.0.6", + "@jest/test-result": "^27.3.1", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "execa": "^5.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-mock": "^27.3.0", + "jest-regex-util": "^27.0.6", + "jest-resolve": "^27.3.1", + "jest-snapshot": "^27.3.1", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "slash": "^3.0.0", + "strip-bom": "^4.0.0", + "yargs": "^16.2.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-runtime/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/jest-runtime/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-runtime/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-runtime/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runtime/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runtime/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runtime/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-serializer": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-27.0.6.tgz", + "integrity": "sha512-PtGdVK9EGC7dsaziskfqaAPib6wTViY3G8E5wz9tLVPhHyiDNTZn/xjZ4khAw+09QkoOVpn7vF5nPSN6dtBexA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "graceful-fs": "^4.2.4" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-27.3.1.tgz", + "integrity": "sha512-APZyBvSgQgOT0XumwfFu7X3G5elj6TGhCBLbBdn3R1IzYustPGPE38F51dBWMQ8hRXa9je0vAdeVDtqHLvB6lg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.7.2", + "@babel/generator": "^7.7.2", + "@babel/parser": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.0.0", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/babel__traverse": "^7.0.4", + "@types/prettier": "^2.1.5", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^27.3.1", + "graceful-fs": "^4.2.4", + "jest-diff": "^27.3.1", + "jest-get-type": "^27.3.1", + "jest-haste-map": "^27.3.1", + "jest-matcher-utils": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-resolve": "^27.3.1", + "jest-util": "^27.3.1", + "natural-compare": "^1.4.0", + "pretty-format": "^27.3.1", + "semver": "^7.3.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-util": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.3.1.tgz", + "integrity": "sha512-8fg+ifEH3GDryLQf/eKZck1DEs2YuVPBCMOaHQxVVLmQwl/CDhWzrvChTX4efLZxGrw+AA0mSXv78cyytBt/uw==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.4", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-util/node_modules/ci-info": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz", + "integrity": "sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A==", + "dev": true + }, + "node_modules/jest-validate": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.3.1.tgz", + "integrity": "sha512-3H0XCHDFLA9uDII67Bwi1Vy7AqwA5HqEEjyy934lgVhtJ3eisw6ShOF1MDmRPspyikef5MyExvIm0/TuLzZ86Q==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^27.3.1", + "leven": "^3.1.0", + "pretty-format": "^27.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-27.3.1.tgz", + "integrity": "sha512-9/xbV6chABsGHWh9yPaAGYVVKurWoP3ZMCv6h+O1v9/+pkOroigs6WzZ0e9gLP/njokUwM7yQhr01LKJVMkaZA==", + "dev": true, + "dependencies": { + "@jest/test-result": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "jest-util": "^27.3.1", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-worker": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.3.1.tgz", + "integrity": "sha512-ks3WCzsiZaOPJl/oMsDjaf0TRiSv7ctNgs0FqRr2nARsovz6AWWy4oLElwcquGSz692DzgZQrCLScPNs5YlC4g==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "node_modules/jsdom": { + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "dev": true, + "dependencies": { + "abab": "^2.0.5", + "acorn": "^8.2.4", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.3.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.1", + "domexception": "^2.0.1", + "escodegen": "^2.0.0", + "form-data": "^3.0.0", + "html-encoding-sniffer": "^2.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.5.0", + "ws": "^7.4.6", + "xml-name-validator": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/acorn": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/jsdom/node_modules/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/jsdom/node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsdom/node_modules/tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-parse-helpfulerror": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", + "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", + "dev": true, + "dependencies": { + "jju": "^1.1.0" + } + }, + "node_modules/json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonlines": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsonlines/-/jsonlines-0.1.1.tgz", + "integrity": "sha1-T80kbcXQ44aRkHxEqwAveC0dlMw=", + "dev": true + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true, + "engines": [ + "node >= 0.2.0" + ] + }, + "node_modules/jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "node_modules/keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "dependencies": { + "package-json": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/libnpmconfig": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", + "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", + "dev": true, + "dependencies": { + "figgy-pudding": "^3.5.1", + "find-up": "^3.0.0", + "ini": "^1.3.5" + } + }, + "node_modules/libnpmconfig/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/libnpmconfig/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/libnpmconfig/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/libnpmconfig/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/libnpmconfig/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, + "node_modules/lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dev": true, + "dependencies": { + "sourcemap-codec": "^1.4.4" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "dev": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", + "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.33", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", + "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", + "dev": true, + "dependencies": { + "mime-db": "1.50.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/minipass": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "dev": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-json-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", + "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", + "dev": true, + "dependencies": { + "jsonparse": "^1.3.1", + "minipass": "^3.0.0" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/node-gyp": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", + "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", + "dev": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.3", + "nopt": "^5.0.0", + "npmlog": "^4.1.2", + "request": "^2.88.2", + "rimraf": "^3.0.2", + "semver": "^7.3.2", + "tar": "^6.0.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node_modules/node-modules-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", + "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "dev": true + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm-bundled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", + "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", + "dev": true, + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "node_modules/npm-check-updates": { + "version": "11.8.5", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-11.8.5.tgz", + "integrity": "sha512-IYSHjlWe8UEugDy7X0qjBeJwcni4DlcWdBK4QQEbwgkNlEDlXyd4yQJYWFumKaJzrp/n5/EcvaboXsBD1Er/pw==", + "dev": true, + "dependencies": { + "chalk": "^4.1.2", + "cint": "^8.2.1", + "cli-table": "^0.3.6", + "commander": "^6.2.1", + "fast-memoize": "^2.5.2", + "find-up": "5.0.0", + "fp-and-or": "^0.1.3", + "get-stdin": "^8.0.0", + "globby": "^11.0.4", + "hosted-git-info": "^4.0.2", + "json-parse-helpfulerror": "^1.0.3", + "jsonlines": "^0.1.1", + "libnpmconfig": "^1.2.1", + "lodash": "^4.17.21", + "minimatch": "^3.0.4", + "p-map": "^4.0.0", + "pacote": "^11.3.5", + "parse-github-url": "^1.0.2", + "progress": "^2.0.3", + "prompts": "^2.4.1", + "rc-config-loader": "^4.0.0", + "remote-git-tags": "^3.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "semver-utils": "^1.1.4", + "spawn-please": "^1.0.0", + "update-notifier": "^5.1.0" + }, + "bin": { + "ncu": "bin/cli.js", + "npm-check-updates": "bin/cli.js" + }, + "engines": { + "node": ">=10.17" + } + }, + "node_modules/npm-install-checks": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz", + "integrity": "sha512-09OmyDkNLYwqKPOnbI8exiOZU2GVVmQp7tgez2BPi5OZC8M82elDAps7sxC4l//uSUtotWqoEIDwjRvWH4qz8w==", + "dev": true, + "dependencies": { + "semver": "^7.1.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "node_modules/npm-package-arg": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz", + "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "semver": "^7.3.4", + "validate-npm-package-name": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-packlist": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz", + "integrity": "sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg==", + "dev": true, + "dependencies": { + "glob": "^7.1.6", + "ignore-walk": "^3.0.3", + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" + }, + "bin": { + "npm-packlist": "bin/index.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-pick-manifest": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz", + "integrity": "sha512-dBsdBtORT84S8V8UTad1WlUyKIY9iMsAmqxHbLdeEeBNMLQDlDWWra3wYUx9EBEIiG/YwAy0XyNHDd2goAsfuA==", + "dev": true, + "dependencies": { + "npm-install-checks": "^4.0.0", + "npm-normalize-package-bin": "^1.0.1", + "npm-package-arg": "^8.1.2", + "semver": "^7.3.4" + } + }, + "node_modules/npm-registry-fetch": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz", + "integrity": "sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA==", + "dev": true, + "dependencies": { + "make-fetch-happen": "^9.0.1", + "minipass": "^3.1.3", + "minipass-fetch": "^1.3.0", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.0.0", + "npm-package-arg": "^8.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "dependencies": { + "path-key": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "dev": true + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "dependencies": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json/node_modules/registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "dev": true, + "dependencies": { + "rc": "^1.2.8" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/package-json/node_modules/registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "dependencies": { + "rc": "^1.2.8" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/pacote": { + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz", + "integrity": "sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg==", + "dev": true, + "dependencies": { + "@npmcli/git": "^2.1.0", + "@npmcli/installed-package-contents": "^1.0.6", + "@npmcli/promise-spawn": "^1.2.0", + "@npmcli/run-script": "^1.8.2", + "cacache": "^15.0.5", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "infer-owner": "^1.0.4", + "minipass": "^3.1.3", + "mkdirp": "^1.0.3", + "npm-package-arg": "^8.0.1", + "npm-packlist": "^2.1.4", + "npm-pick-manifest": "^6.0.0", + "npm-registry-fetch": "^11.0.0", + "promise-retry": "^2.0.1", + "read-package-json-fast": "^2.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.1.0" + }, + "bin": { + "pacote": "lib/bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-github-url": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "dev": true, + "bin": { + "parse-github-url": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-to-regexp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", + "integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", + "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "dev": true, + "dependencies": { + "node-modules-regexp": "^1.0.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/prettier": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/pretty-format": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.3.1.tgz", + "integrity": "sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA==", + "dev": true, + "dependencies": { + "@jest/types": "^27.2.5", + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "node_modules/pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "dev": true, + "dependencies": { + "escape-goat": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc-config-loader": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.0.0.tgz", + "integrity": "sha512-//LRTblJEcqbmmro1GCmZ39qZXD+JqzuD8Y5/IZU3Dhp3A1Yr0Xn68ks8MQ6qKfKvYCWDveUmRDKDA40c+sCXw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "js-yaml": "^4.0.0", + "json5": "^2.1.2", + "require-from-string": "^2.0.2" + } + }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, + "node_modules/read-package-json-fast": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", + "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", + "dev": true, + "dependencies": { + "json-parse-even-better-errors": "^2.3.0", + "npm-normalize-package-bin": "^1.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/registry-auth-token": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", + "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "dev": true, + "dependencies": { + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "dev": true, + "dependencies": { + "rc": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remote-git-tags": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remote-git-tags/-/remote-git-tags-3.0.0.tgz", + "integrity": "sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve.exports": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz", + "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "dependencies": { + "lowercase-keys": "^1.0.0" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "2.58.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.58.3.tgz", + "integrity": "sha512-ei27MSw1KhRur4p87Q0/Va2NAYqMXOX++FNEumMBcdreIRLURKy+cE2wcDJKBn0nfmhP2ZGrJkP1XPO+G8FJQw==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-babel-minify": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-babel-minify/-/rollup-plugin-babel-minify-10.0.0.tgz", + "integrity": "sha512-tYZOhGtffvGp8VzTrB5u/kPYyIjEEshTPEauOLkshPNx/MvCJVd6PCc2HX4CO0TDH0cBnnGKQ+yQpTERJikK4Q==", + "deprecated": "Please use rollup-plugin-terser instead.", + "dev": true, + "dependencies": { + "@babel/core": "^7.8.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@comandeer/babel-plugin-banner": "^5.0.0", + "babel-preset-minify": "^0.5.1", + "sourcemap-codec": "^1.4.8" + }, + "engines": { + "node": ">=10.13.0" + }, + "peerDependencies": { + "rollup": ">=1.6.0" + } + }, + "node_modules/rollup-plugin-typescript2": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz", + "integrity": "sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^4.1.0", + "find-cache-dir": "^3.3.1", + "fs-extra": "8.1.0", + "resolve": "1.20.0", + "tslib": "2.1.0" + }, + "peerDependencies": { + "rollup": ">=1.26.3", + "typescript": ">=2.4.0" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.1.tgz", + "integrity": "sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==", + "dev": true, + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "dependencies": { + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/semver-diff/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/semver-utils": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/semver-utils/-/semver-utils-1.1.4.tgz", + "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", + "dev": true + }, + "node_modules/serve": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.1.tgz", + "integrity": "sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw==", + "dev": true, + "dependencies": { + "@zeit/schemas": "2.6.0", + "ajv": "6.12.6", + "arg": "2.0.0", + "boxen": "1.3.0", + "chalk": "2.4.1", + "clipboardy": "2.3.0", + "compression": "1.7.3", + "serve-handler": "6.1.3", + "update-check": "1.5.2" + }, + "bin": { + "serve": "bin/serve.js" + } + }, + "node_modules/serve-handler": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.3.tgz", + "integrity": "sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w==", + "dev": true, + "dependencies": { + "bytes": "3.0.0", + "content-disposition": "0.5.2", + "fast-url-parser": "1.1.3", + "mime-types": "2.1.18", + "minimatch": "3.0.4", + "path-is-inside": "1.0.2", + "path-to-regexp": "2.2.1", + "range-parser": "1.2.0" + } + }, + "node_modules/serve-handler/node_modules/mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-handler/node_modules/mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "dependencies": { + "mime-db": "~1.33.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/serve/node_modules/chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/serve/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/serve/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/serve/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/serve/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/signal-exit": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", + "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", + "dev": true + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", + "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==", + "dev": true, + "dependencies": { + "ip": "^1.1.5", + "smart-buffer": "^4.1.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz", + "integrity": "sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg==", + "dev": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.1", + "socks": "^2.6.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", + "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "node_modules/spawn-please": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-1.0.0.tgz", + "integrity": "sha512-Kz33ip6NRNKuyTRo3aDWyWxeGeM0ORDO552Fs6E1nj4pLWPkl37SrRtTnq+MEopVaqgmaO6bAvVS+v64BJ5M/A==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "dev": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-length/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-length/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", + "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "node_modules/table": { + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.2.tgz", + "integrity": "sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==", + "dev": true, + "dependencies": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/table/node_modules/ajv": { + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/table/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/table/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/table/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/table/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/table/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "dev": true, + "dependencies": { + "execa": "^0.7.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/term-size/node_modules/cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "node_modules/term-size/node_modules/execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "dependencies": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/term-size/node_modules/get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/term-size/node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/term-size/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/term-size/node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "node_modules/terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/throat": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.1.tgz", + "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", + "dev": true + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tough-cookie/node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/tr46": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tr46/node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ts-jest": { + "version": "27.0.7", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.0.7.tgz", + "integrity": "sha512-O41shibMqzdafpuP+CkrOL7ykbmLh+FqQrXEmV9CydQ5JBk0Sj0uAEF5TNNe94fZWKm3yYvWa/IbyV4Yg1zK2Q==", + "dev": true, + "dependencies": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^27.0.0", + "json5": "2.x", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "7.x", + "yargs-parser": "20.x" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@types/jest": "^27.0.0", + "babel-jest": ">=27.0.0 <28", + "jest": "^27.0.0", + "typescript": ">=3.8 <5.0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@types/jest": { + "optional": true + }, + "babel-jest": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", + "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==", + "dev": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/typescript": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/update-check": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/update-check/-/update-check-1.5.2.tgz", + "integrity": "sha512-1TrmYLuLj/5ZovwUS7fFd1jMH3NnFDN1y1A8dboedIDt7zs/zJMo6TwwlhYKkSeEwzleeiSBV5/3c9ufAQWDaQ==", + "dev": true, + "dependencies": { + "registry-auth-token": "3.3.2", + "registry-url": "3.1.0" + } + }, + "node_modules/update-notifier": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", + "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", + "dev": true, + "dependencies": { + "boxen": "^5.0.0", + "chalk": "^4.1.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.4.0", + "is-npm": "^5.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.1.0", + "pupa": "^2.1.1", + "semver": "^7.3.4", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/yeoman/update-notifier?sponsor=1" + } + }, + "node_modules/update-notifier/node_modules/ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "dev": true, + "dependencies": { + "string-width": "^4.1.0" + } + }, + "node_modules/update-notifier/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/update-notifier/node_modules/boxen": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", + "dev": true, + "dependencies": { + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/update-notifier/node_modules/camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/update-notifier/node_modules/cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/update-notifier/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/update-notifier/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/update-notifier/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/update-notifier/node_modules/widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/uri-js/node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "dependencies": { + "prepend-http": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/v8-to-istanbul": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz", + "integrity": "sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", + "dev": true, + "dependencies": { + "builtins": "^1.0.3" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/verror/node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", + "dev": true, + "dependencies": { + "browser-process-hrtime": "^1.0.0" + } + }, + "node_modules/w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "dev": true, + "dependencies": { + "xml-name-validator": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true, + "engines": { + "node": ">=10.4" + } + }, + "node_modules/whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "dependencies": { + "iconv-lite": "0.4.24" + } + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", + "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "dev": true, + "dependencies": { + "lodash": "^4.7.0", + "tr46": "^2.1.0", + "webidl-conversions": "^6.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/widest-line": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "dev": true, + "dependencies": { + "string-width": "^2.1.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line/node_modules/ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/ws": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", + "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/e2ee": { + "name": "@sora/e2ee", + "version": "2021.2.0-canary.3", + "license": "Apache-2.0", + "dependencies": { + "@sora/go-wasm": "^2021.2.0-canary.3" + }, + "devDependencies": { + "@rollup/plugin-replace": "^3.0.0", + "@typescript-eslint/eslint-plugin": "^4.33.0", + "@typescript-eslint/parser": "^4.33.0", + "eslint": "^7.32.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "prettier": "^2.4.1", + "rollup": "^2.58.0", + "rollup-plugin-typescript2": "^0.30.0", + "typescript": "^4.4.3" + } + }, + "packages/go-wasm": { + "name": "@sora/go-wasm", + "version": "2021.2.0-canary.3", + "license": "ISC", + "devDependencies": {} + }, + "packages/sdk": { + "name": "@sora/sdk", + "version": "2021.2.0-canary.3", + "license": "Apache-2.0", + "dependencies": { + "@sora/e2ee": "^2021.2.0-canary.3", + "fflate": "^0.7.1" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^21.0.0", + "@rollup/plugin-node-resolve": "^13.0.5", + "@rollup/plugin-replace": "^3.0.0", + "@types/jest": "^27.0.2", + "@typescript-eslint/eslint-plugin": "4.33.0", + "@typescript-eslint/parser": "4.33.0", + "eslint": "7.32.0", + "eslint-config-prettier": "8.3.0", + "eslint-plugin-prettier": "4.0.0", + "jest": "^27.2.4", + "prettier": "^2.4.1", + "rollup": "^2.58.0", + "rollup-plugin-babel-minify": "^10.0.0", + "rollup-plugin-typescript2": "^0.30.0", + "ts-jest": "^27.0.5", + "typescript": "^4.4.3" + } + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/compat-data": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz", + "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==", + "dev": true + }, + "@babel/core": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.8.tgz", + "integrity": "sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.15.8", + "@babel/generator": "^7.15.8", + "@babel/helper-compilation-targets": "^7.15.4", + "@babel/helper-module-transforms": "^7.15.8", + "@babel/helpers": "^7.15.4", + "@babel/parser": "^7.15.8", + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.6", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", + "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.8.tgz", + "integrity": "sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g==", + "dev": true, + "requires": { + "@babel/types": "^7.15.6", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-compilation-targets": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz", + "integrity": "sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.15.0", + "@babel/helper-validator-option": "^7.14.5", + "browserslist": "^4.16.6", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", + "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.15.4", + "@babel/template": "^7.15.4", + "@babel/types": "^7.15.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", + "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", + "dev": true, + "requires": { + "@babel/types": "^7.15.4" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", + "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", + "dev": true, + "requires": { + "@babel/types": "^7.15.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz", + "integrity": "sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA==", + "dev": true, + "requires": { + "@babel/types": "^7.15.4" + } + }, + "@babel/helper-module-imports": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz", + "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==", + "dev": true, + "requires": { + "@babel/types": "^7.15.4" + } + }, + "@babel/helper-module-transforms": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz", + "integrity": "sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.15.4", + "@babel/helper-replace-supers": "^7.15.4", + "@babel/helper-simple-access": "^7.15.4", + "@babel/helper-split-export-declaration": "^7.15.4", + "@babel/helper-validator-identifier": "^7.15.7", + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.6" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz", + "integrity": "sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw==", + "dev": true, + "requires": { + "@babel/types": "^7.15.4" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz", + "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz", + "integrity": "sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.15.4", + "@babel/helper-optimise-call-expression": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.4" + } + }, + "@babel/helper-simple-access": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz", + "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==", + "dev": true, + "requires": { + "@babel/types": "^7.15.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", + "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", + "dev": true, + "requires": { + "@babel/types": "^7.15.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", + "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "dev": true + }, + "@babel/helpers": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz", + "integrity": "sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ==", + "dev": true, + "requires": { + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.4" + } + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/parser": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.8.tgz", + "integrity": "sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA==", + "dev": true + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-typescript": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz", + "integrity": "sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/template": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", + "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.15.4", + "@babel/types": "^7.15.4" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", + "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + } + } + }, + "@babel/traverse": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", + "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.15.4", + "@babel/helper-function-name": "^7.15.4", + "@babel/helper-hoist-variables": "^7.15.4", + "@babel/helper-split-export-declaration": "^7.15.4", + "@babel/parser": "^7.15.4", + "@babel/types": "^7.15.4", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", + "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", + "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.9", + "to-fast-properties": "^2.0.0" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@comandeer/babel-plugin-banner": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@comandeer/babel-plugin-banner/-/babel-plugin-banner-5.0.0.tgz", + "integrity": "sha512-sR9Go0U6puXoXyW9UgIiIQhRcJ8jVOvGl4BptUiXAtheMs72WcakZ1udh6J0ZOivr3o8jAM+MTCHLP8FZMbVpQ==", + "dev": true, + "requires": {} + }, + "@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, + "@gar/promisify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz", + "integrity": "sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw==", + "dev": true + }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@jest/console": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.3.1.tgz", + "integrity": "sha512-RkFNWmv0iui+qsOr/29q9dyfKTTT5DCuP31kUwg7rmOKPT/ozLeGLKJKVIiOfbiKyleUZKIrHwhmiZWVe8IMdw==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.3.1", + "jest-util": "^27.3.1", + "slash": "^3.0.0" + } + }, + "@jest/core": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-27.3.1.tgz", + "integrity": "sha512-DMNE90RR5QKx0EA+wqe3/TNEwiRpOkhshKNxtLxd4rt3IZpCt+RSL+FoJsGeblRZmqdK4upHA/mKKGPPRAifhg==", + "dev": true, + "requires": { + "@jest/console": "^27.3.1", + "@jest/reporters": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-changed-files": "^27.3.0", + "jest-config": "^27.3.1", + "jest-haste-map": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-regex-util": "^27.0.6", + "jest-resolve": "^27.3.1", + "jest-resolve-dependencies": "^27.3.1", + "jest-runner": "^27.3.1", + "jest-runtime": "^27.3.1", + "jest-snapshot": "^27.3.1", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "jest-watcher": "^27.3.1", + "micromatch": "^4.0.4", + "rimraf": "^3.0.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "@jest/environment": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-27.3.1.tgz", + "integrity": "sha512-BCKCj4mOVLme6Tanoyc9k0ultp3pnmuyHw73UHRPeeZxirsU/7E3HC4le/VDb/SMzE1JcPnto+XBKFOcoiJzVw==", + "dev": true, + "requires": { + "@jest/fake-timers": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "jest-mock": "^27.3.0" + } + }, + "@jest/fake-timers": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-27.3.1.tgz", + "integrity": "sha512-M3ZFgwwlqJtWZ+QkBG5NmC23A9w+A6ZxNsO5nJxJsKYt4yguBd3i8TpjQz5NfCX91nEve1KqD9RA2Q+Q1uWqoA==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "@sinonjs/fake-timers": "^8.0.1", + "@types/node": "*", + "jest-message-util": "^27.3.1", + "jest-mock": "^27.3.0", + "jest-util": "^27.3.1" + } + }, + "@jest/globals": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-27.3.1.tgz", + "integrity": "sha512-Q651FWiWQAIFiN+zS51xqhdZ8g9b88nGCobC87argAxA7nMfNQq0Q0i9zTfQYgLa6qFXk2cGANEqfK051CZ8Pg==", + "dev": true, + "requires": { + "@jest/environment": "^27.3.1", + "@jest/types": "^27.2.5", + "expect": "^27.3.1" + } + }, + "@jest/reporters": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-27.3.1.tgz", + "integrity": "sha512-m2YxPmL9Qn1emFVgZGEiMwDntDxRRQ2D58tiDQlwYTg5GvbFOKseYCcHtn0WsI8CG4vzPglo3nqbOiT8ySBT/w==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.2.4", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.3", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "jest-haste-map": "^27.3.1", + "jest-resolve": "^27.3.1", + "jest-util": "^27.3.1", + "jest-worker": "^27.3.1", + "slash": "^3.0.0", + "source-map": "^0.6.0", + "string-length": "^4.0.1", + "terminal-link": "^2.0.0", + "v8-to-istanbul": "^8.1.0" + } + }, + "@jest/source-map": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-27.0.6.tgz", + "integrity": "sha512-Fek4mi5KQrqmlY07T23JRi0e7Z9bXTOOD86V/uS0EIW4PClvPDqZOyFlLpNJheS6QI0FNX1CgmPjtJ4EA/2M+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.2.4", + "source-map": "^0.6.0" + } + }, + "@jest/test-result": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.3.1.tgz", + "integrity": "sha512-mLn6Thm+w2yl0opM8J/QnPTqrfS4FoXsXF2WIWJb2O/GBSyResL71BRuMYbYRsGt7ELwS5JGcEcGb52BNrumgg==", + "dev": true, + "requires": { + "@jest/console": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/test-sequencer": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-27.3.1.tgz", + "integrity": "sha512-siySLo07IMEdSjA4fqEnxfIX8lB/lWYsBPwNFtkOvsFQvmBrL3yj3k3uFNZv/JDyApTakRpxbKLJ3CT8UGVCrA==", + "dev": true, + "requires": { + "@jest/test-result": "^27.3.1", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.3.1", + "jest-runtime": "^27.3.1" + } + }, + "@jest/transform": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-27.3.1.tgz", + "integrity": "sha512-3fSvQ02kuvjOI1C1ssqMVBKJpZf6nwoCiSu00zAKh5nrp3SptNtZy/8s5deayHnqxhjD9CWDJ+yqQwuQ0ZafXQ==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^27.2.5", + "babel-plugin-istanbul": "^6.0.0", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.3.1", + "jest-regex-util": "^27.0.6", + "jest-util": "^27.3.1", + "micromatch": "^4.0.4", + "pirates": "^4.0.1", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + } + }, + "@jest/types": { + "version": "27.2.5", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.2.5.tgz", + "integrity": "sha512-nmuM4VuDtCZcY+eTpw+0nvstwReMsjPoj7ZR80/BbixulhLaiX+fbv8oeLW8WZlJMcsGQsTmMKT/iTZu1Uy/lQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@npmcli/fs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.0.0.tgz", + "integrity": "sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ==", + "dev": true, + "requires": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "@npmcli/git": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.1.0.tgz", + "integrity": "sha512-/hBFX/QG1b+N7PZBFs0bi+evgRZcK9nWBxQKZkGoXUT5hJSwl5c4d7y8/hm+NQZRPhQ67RzFaj5UM9YeyKoryw==", + "dev": true, + "requires": { + "@npmcli/promise-spawn": "^1.3.2", + "lru-cache": "^6.0.0", + "mkdirp": "^1.0.4", + "npm-pick-manifest": "^6.1.1", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^2.0.2" + } + }, + "@npmcli/installed-package-contents": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", + "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==", + "dev": true, + "requires": { + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "dev": true, + "requires": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + } + }, + "@npmcli/node-gyp": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz", + "integrity": "sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA==", + "dev": true + }, + "@npmcli/promise-spawn": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz", + "integrity": "sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg==", + "dev": true, + "requires": { + "infer-owner": "^1.0.4" + } + }, + "@npmcli/run-script": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz", + "integrity": "sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g==", + "dev": true, + "requires": { + "@npmcli/node-gyp": "^1.0.2", + "@npmcli/promise-spawn": "^1.3.2", + "node-gyp": "^7.1.0", + "read-package-json-fast": "^2.0.1" + } + }, + "@rollup/plugin-commonjs": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz", + "integrity": "sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "commondir": "^1.0.1", + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" + } + }, + "@rollup/plugin-node-resolve": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.6.tgz", + "integrity": "sha512-sFsPDMPd4gMqnh2gS0uIxELnoRUp5kBl5knxD2EO0778G1oOJv4G1vyT2cpWz75OU2jDVcXhjVUuTAczGyFNKA==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + } + }, + "@rollup/plugin-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-3.0.0.tgz", + "integrity": "sha512-3c7JCbMuYXM4PbPWT4+m/4Y6U60SgsnDT/cCyAyUKwFHg7pTSfsSQzIpETha3a3ig6OdOKzZz87D9ZXIK3qsDg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "magic-string": "^0.25.7" + } + }, + "@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "dependencies": { + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + } + } + }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz", + "integrity": "sha512-AU7kwFxreVd6OAXcAFlKSmZquiRUU0FvYm44k1Y1QbK7Co4m0aqfGMhjykIeQp/H6rcl+nFmj0zfdUcGVs9Dew==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@sora/e2ee": { + "version": "file:packages/e2ee", + "requires": { + "@rollup/plugin-replace": "^3.0.0", + "@sora/go-wasm": "^2021.2.0-canary.3", + "@typescript-eslint/eslint-plugin": "^4.33.0", + "@typescript-eslint/parser": "^4.33.0", + "eslint": "^7.32.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "prettier": "^2.4.1", + "rollup": "^2.58.0", + "rollup-plugin-typescript2": "^0.30.0", + "typescript": "^4.4.3" + } + }, + "@sora/go-wasm": { + "version": "file:packages/go-wasm" + }, + "@sora/sdk": { + "version": "file:packages/sdk", + "requires": { + "@rollup/plugin-commonjs": "^21.0.0", + "@rollup/plugin-node-resolve": "^13.0.5", + "@rollup/plugin-replace": "^3.0.0", + "@sora/e2ee": "^2021.2.0-canary.3", + "@types/jest": "^27.0.2", + "@typescript-eslint/eslint-plugin": "4.33.0", + "@typescript-eslint/parser": "4.33.0", + "eslint": "7.32.0", + "eslint-config-prettier": "8.3.0", + "eslint-plugin-prettier": "4.0.0", + "fflate": "^0.7.1", + "jest": "^27.2.4", + "prettier": "^2.4.1", + "rollup": "^2.58.0", + "rollup-plugin-babel-minify": "^10.0.0", + "rollup-plugin-typescript2": "^0.30.0", + "ts-jest": "^27.0.5", + "typescript": "^4.4.3" + } + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true + }, + "@types/babel__core": { + "version": "7.1.16", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz", + "integrity": "sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.3.tgz", + "integrity": "sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", + "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "dev": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "@types/graceful-fs": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", + "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/jest": { + "version": "27.0.2", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.0.2.tgz", + "integrity": "sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA==", + "dev": true, + "requires": { + "jest-diff": "^27.0.0", + "pretty-format": "^27.0.0" + } + }, + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, + "@types/node": { + "version": "16.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", + "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", + "dev": true + }, + "@types/prettier": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw==", + "dev": true + }, + "@types/resolve": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "20.2.1", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", + "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", + "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.33.0", + "@typescript-eslint/scope-manager": "4.33.0", + "debug": "^4.3.1", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", + "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", + "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "debug": "^4.3.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", + "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0" + } + }, + "@typescript-eslint/types": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", + "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", + "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0", + "debug": "^4.3.1", + "globby": "^11.0.3", + "is-glob": "^4.0.1", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", + "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.33.0", + "eslint-visitor-keys": "^2.0.0" + } + }, + "@zeit/schemas": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@zeit/schemas/-/schemas-2.6.0.tgz", + "integrity": "sha512-uUrgZ8AxS+Lio0fZKAipJjAh415JyrOZowliZAzmnJSsf7piVL5w+G0+gFJ0KSu3QRhvui/7zuvpLz03YjXAhg==", + "dev": true + }, + "abab": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", + "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "dev": true + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + } + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + } + }, + "agentkeepalive": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz", + "integrity": "sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + } + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "dev": true, + "requires": { + "string-width": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "arch": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "arg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arg/-/arg-2.0.0.tgz", + "integrity": "sha512-XxNTUzKnz1ctK3ZIcI2XUPlD96wbHP2nGqkPKpvk/HNRlPveYrXIVSTk9m3LcqOgDPg3B1nMvdV/K8wZd7PG4w==", + "dev": true + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "babel-helper-evaluate-path": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", + "integrity": "sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==", + "dev": true + }, + "babel-helper-flip-expressions": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz", + "integrity": "sha1-NpZzahKKwYvCUlS19AoizrPB0/0=", + "dev": true + }, + "babel-helper-is-nodes-equiv": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz", + "integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=", + "dev": true + }, + "babel-helper-is-void-0": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz", + "integrity": "sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4=", + "dev": true + }, + "babel-helper-mark-eval-scopes": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz", + "integrity": "sha1-0kSjvvmESHJgP/tG4izorN9VFWI=", + "dev": true + }, + "babel-helper-remove-or-void": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz", + "integrity": "sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=", + "dev": true + }, + "babel-helper-to-multiple-sequence-expressions": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz", + "integrity": "sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA==", + "dev": true + }, + "babel-jest": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.3.1.tgz", + "integrity": "sha512-SjIF8hh/ir0peae2D6S6ZKRhUy7q/DnpH7k/V6fT4Bgs/LXXUztOpX4G2tCgq8mLo5HA9mN6NmlFMeYtKmIsTQ==", + "dev": true, + "requires": { + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.0.0", + "babel-preset-jest": "^27.2.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "slash": "^3.0.0" + } + }, + "babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "dependencies": { + "istanbul-lib-instrument": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz", + "integrity": "sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "babel-plugin-jest-hoist": { + "version": "27.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.2.0.tgz", + "integrity": "sha512-TOux9khNKdi64mW+0OIhcmbAn75tTlzKhxmiNXevQaPbrBYK7YKjP1jl6NHTJ6XR5UgUrJbCnWlKVnJn29dfjw==", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.0.0", + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-plugin-minify-builtins": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz", + "integrity": "sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag==", + "dev": true + }, + "babel-plugin-minify-constant-folding": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz", + "integrity": "sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0" + } + }, + "babel-plugin-minify-dead-code-elimination": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz", + "integrity": "sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-mark-eval-scopes": "^0.4.3", + "babel-helper-remove-or-void": "^0.4.3", + "lodash": "^4.17.11" + } + }, + "babel-plugin-minify-flip-comparisons": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz", + "integrity": "sha1-AMqHDLjxO0XAOLPB68DyJyk8llo=", + "dev": true, + "requires": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "babel-plugin-minify-guarded-expressions": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz", + "integrity": "sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3" + } + }, + "babel-plugin-minify-infinity": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz", + "integrity": "sha1-37h2obCKBldjhO8/kuZTumB7Oco=", + "dev": true + }, + "babel-plugin-minify-mangle-names": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz", + "integrity": "sha512-3jdNv6hCAw6fsX1p2wBGPfWuK69sfOjfd3zjUXkbq8McbohWy23tpXfy5RnToYWggvqzuMOwlId1PhyHOfgnGw==", + "dev": true, + "requires": { + "babel-helper-mark-eval-scopes": "^0.4.3" + } + }, + "babel-plugin-minify-numeric-literals": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz", + "integrity": "sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw=", + "dev": true + }, + "babel-plugin-minify-replace": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz", + "integrity": "sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q==", + "dev": true + }, + "babel-plugin-minify-simplify": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz", + "integrity": "sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3", + "babel-helper-is-nodes-equiv": "^0.0.1", + "babel-helper-to-multiple-sequence-expressions": "^0.5.0" + } + }, + "babel-plugin-minify-type-constructors": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz", + "integrity": "sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA=", + "dev": true, + "requires": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "babel-plugin-transform-inline-consecutive-adds": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz", + "integrity": "sha1-Mj1Ho+pjqDp6w8gRro5pQfrysNE=", + "dev": true + }, + "babel-plugin-transform-member-expression-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz", + "integrity": "sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8=", + "dev": true + }, + "babel-plugin-transform-merge-sibling-variables": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz", + "integrity": "sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4=", + "dev": true + }, + "babel-plugin-transform-minify-booleans": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz", + "integrity": "sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg=", + "dev": true + }, + "babel-plugin-transform-property-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz", + "integrity": "sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk=", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "babel-plugin-transform-regexp-constructors": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz", + "integrity": "sha1-WLd3W2OvzzMyj66aX4j71PsLSWU=", + "dev": true + }, + "babel-plugin-transform-remove-console": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz", + "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=", + "dev": true + }, + "babel-plugin-transform-remove-debugger": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz", + "integrity": "sha1-QrcnYxyXl44estGZp67IShgznvI=", + "dev": true + }, + "babel-plugin-transform-remove-undefined": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz", + "integrity": "sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0" + } + }, + "babel-plugin-transform-simplify-comparison-operators": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz", + "integrity": "sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk=", + "dev": true + }, + "babel-plugin-transform-undefined-to-void": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz", + "integrity": "sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=", + "dev": true + }, + "babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "requires": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + } + }, + "babel-preset-jest": { + "version": "27.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-27.2.0.tgz", + "integrity": "sha512-z7MgQ3peBwN5L5aCqBKnF6iqdlvZvFUQynEhu0J+X9nHLU72jO3iY331lcYrg+AssJ8q7xsv5/3AICzVmJ/wvg==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^27.2.0", + "babel-preset-current-node-syntax": "^1.0.0" + } + }, + "babel-preset-minify": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.5.1.tgz", + "integrity": "sha512-1IajDumYOAPYImkHbrKeiN5AKKP9iOmRoO2IPbIuVp0j2iuCcj0n7P260z38siKMZZ+85d3mJZdtW8IgOv+Tzg==", + "dev": true, + "requires": { + "babel-plugin-minify-builtins": "^0.5.0", + "babel-plugin-minify-constant-folding": "^0.5.0", + "babel-plugin-minify-dead-code-elimination": "^0.5.1", + "babel-plugin-minify-flip-comparisons": "^0.4.3", + "babel-plugin-minify-guarded-expressions": "^0.4.4", + "babel-plugin-minify-infinity": "^0.4.3", + "babel-plugin-minify-mangle-names": "^0.5.0", + "babel-plugin-minify-numeric-literals": "^0.4.3", + "babel-plugin-minify-replace": "^0.5.0", + "babel-plugin-minify-simplify": "^0.5.1", + "babel-plugin-minify-type-constructors": "^0.4.3", + "babel-plugin-transform-inline-consecutive-adds": "^0.4.3", + "babel-plugin-transform-member-expression-literals": "^6.9.4", + "babel-plugin-transform-merge-sibling-variables": "^6.9.4", + "babel-plugin-transform-minify-booleans": "^6.9.4", + "babel-plugin-transform-property-literals": "^6.9.4", + "babel-plugin-transform-regexp-constructors": "^0.4.3", + "babel-plugin-transform-remove-console": "^6.9.4", + "babel-plugin-transform-remove-debugger": "^6.9.4", + "babel-plugin-transform-remove-undefined": "^0.5.0", + "babel-plugin-transform-simplify-comparison-operators": "^6.9.4", + "babel-plugin-transform-undefined-to-void": "^6.9.4", + "lodash": "^4.17.11" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "dev": true, + "requires": { + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", + "dev": true + }, + "browserslist": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.5.tgz", + "integrity": "sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001271", + "electron-to-chromium": "^1.3.878", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + } + }, + "bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "requires": { + "fast-json-stable-stringify": "2.x" + } + }, + "bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "builtin-modules": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", + "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", + "dev": true + }, + "builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", + "dev": true + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "dev": true + }, + "cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "dev": true, + "requires": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + } + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001271", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz", + "integrity": "sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cint": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/cint/-/cint-8.2.1.tgz", + "integrity": "sha1-cDhrG0jidz0NYxZqVa/5TvRFahI=", + "dev": true + }, + "cjs-module-lexer": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", + "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "dev": true + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "dev": true + }, + "cli-table": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.6.tgz", + "integrity": "sha512-ZkNZbnZjKERTY5NwC2SeMeLeifSPq/pubeRoTpdr3WchLlnZg6hEgvHkK5zL7KNFdd9PmHN8lxrENUwI3cE8vQ==", + "dev": true, + "requires": { + "colors": "1.0.3" + } + }, + "clipboardy": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-2.3.0.tgz", + "integrity": "sha512-mKhiIL2DrQIsuXMgBgnfEHOZOryC7kY7YO//TN6c63wlEm3NG5tz+YgY5rVi29KCmq/QQjKYvM7a19+MDOTHOQ==", + "dev": true, + "requires": { + "arch": "^2.1.1", + "execa": "^1.0.0", + "is-wsl": "^2.1.1" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collect-v8-coverage": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", + "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "requires": { + "mime-db": ">= 1.43.0 < 2" + } + }, + "compression": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", + "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", + "dev": true, + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.14", + "debug": "2.6.9", + "on-headers": "~1.0.1", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + } + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", + "dev": true + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, + "cssom": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "dev": true + }, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "requires": { + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + } + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "dev": true, + "requires": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "decimal.js": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", + "dev": true + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true + }, + "diff-sequences": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.0.6.tgz", + "integrity": "sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "dev": true, + "requires": { + "webidl-conversions": "^5.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true + } + } + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "electron-to-chromium": { + "version": "1.3.882", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.882.tgz", + "integrity": "sha512-Kllt2R9+7yEIBbASR0MReJSK9TjPmHoomLbCLRP7r4SVtSy+Y0hYIhQ7LGjnMhlAyWUtGXTiznoGsaKxEH0ttw==", + "dev": true + }, + "emittery": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", + "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "optional": true, + "requires": { + "iconv-lite": "^0.6.2" + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true + }, + "err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + } + } + }, + "eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, + "eslint-config-prettier": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", + "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", + "dev": true, + "requires": {} + }, + "eslint-plugin-prettier": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", + "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expect": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-27.3.1.tgz", + "integrity": "sha512-MrNXV2sL9iDRebWPGOGFdPQRl2eDQNu/uhxIMShjjx74T6kC6jFIkmQ6OqXDtevjGUkyB2IT56RzDBqXf/QPCg==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "ansi-styles": "^5.0.0", + "jest-get-type": "^27.3.1", + "jest-matcher-utils": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-regex-util": "^27.0.6" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fast-memoize": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", + "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==", + "dev": true + }, + "fast-url-parser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz", + "integrity": "sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=", + "dev": true, + "requires": { + "punycode": "^1.3.2" + } + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", + "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "dev": true, + "requires": { + "bser": "2.1.1" + } + }, + "fflate": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.7.1.tgz", + "integrity": "sha512-VYM2Xy1gSA5MerKzCnmmuV2XljkpKwgJBKezW+495TTnTCh1x5HcYa1aH8wRU/MfTGhW4ziXqgwprgQUVl3Ohw==" + }, + "figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fp-and-or": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-0.1.3.tgz", + "integrity": "sha512-wJaE62fLaB3jCYvY2ZHjZvmKK2iiLiiehX38rz5QZxtdN8fVPJDeZUiVvJrHStdTc+23LHlyZuSEKgFc0pxi2g==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global-dirs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "dev": true, + "requires": { + "ini": "2.0.0" + }, + "dependencies": { + "ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true + } + } + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "dev": true + }, + "hosted-git-info": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", + "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.5" + } + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "requires": { + "ms": "^2.0.0" + } + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "ignore-walk": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz", + "integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "import-local": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", + "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "dev": true, + "requires": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + } + }, + "is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=", + "dev": true + }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, + "is-npm": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", + "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, + "is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + } + }, + "istanbul-reports": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.5.tgz", + "integrity": "sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jest": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest/-/jest-27.3.1.tgz", + "integrity": "sha512-U2AX0AgQGd5EzMsiZpYt8HyZ+nSVIh5ujQ9CPp9EQZJMjXIiSZpJNweZl0swatKRoqHWgGKM3zaSwm4Zaz87ng==", + "dev": true, + "requires": { + "@jest/core": "^27.3.1", + "import-local": "^3.0.2", + "jest-cli": "^27.3.1" + } + }, + "jest-changed-files": { + "version": "27.3.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-27.3.0.tgz", + "integrity": "sha512-9DJs9garMHv4RhylUMZgbdCJ3+jHSkpL9aaVKp13xtXAD80qLTLrqcDZL1PHA9dYA0bCI86Nv2BhkLpLhrBcPg==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "execa": "^5.0.0", + "throat": "^6.0.1" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + } + } + }, + "jest-circus": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-27.3.1.tgz", + "integrity": "sha512-v1dsM9II6gvXokgqq6Yh2jHCpfg7ZqV4jWY66u7npz24JnhP3NHxI0sKT7+ZMQ7IrOWHYAaeEllOySbDbWsiXw==", + "dev": true, + "requires": { + "@jest/environment": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^0.7.0", + "expect": "^27.3.1", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.3.1", + "jest-matcher-utils": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-runtime": "^27.3.1", + "jest-snapshot": "^27.3.1", + "jest-util": "^27.3.1", + "pretty-format": "^27.3.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3", + "throat": "^6.0.1" + } + }, + "jest-cli": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-27.3.1.tgz", + "integrity": "sha512-WHnCqpfK+6EvT62me6WVs8NhtbjAS4/6vZJnk7/2+oOr50cwAzG4Wxt6RXX0hu6m1169ZGMlhYYUNeKBXCph/Q==", + "dev": true, + "requires": { + "@jest/core": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/types": "^27.2.5", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "import-local": "^3.0.2", + "jest-config": "^27.3.1", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "prompts": "^2.0.1", + "yargs": "^16.2.0" + } + }, + "jest-config": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-27.3.1.tgz", + "integrity": "sha512-KY8xOIbIACZ/vdYCKSopL44I0xboxC751IX+DXL2+Wx6DKNycyEfV3rryC3BPm5Uq/BBqDoMrKuqLEUNJmMKKg==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^27.3.1", + "@jest/types": "^27.2.5", + "babel-jest": "^27.3.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.4", + "jest-circus": "^27.3.1", + "jest-environment-jsdom": "^27.3.1", + "jest-environment-node": "^27.3.1", + "jest-get-type": "^27.3.1", + "jest-jasmine2": "^27.3.1", + "jest-regex-util": "^27.0.6", + "jest-resolve": "^27.3.1", + "jest-runner": "^27.3.1", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "micromatch": "^4.0.4", + "pretty-format": "^27.3.1" + }, + "dependencies": { + "ci-info": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz", + "integrity": "sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A==", + "dev": true + } + } + }, + "jest-diff": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.3.1.tgz", + "integrity": "sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^27.0.6", + "jest-get-type": "^27.3.1", + "pretty-format": "^27.3.1" + } + }, + "jest-docblock": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.0.6.tgz", + "integrity": "sha512-Fid6dPcjwepTFraz0YxIMCi7dejjJ/KL9FBjPYhBp4Sv1Y9PdhImlKZqYU555BlN4TQKaTc+F2Av1z+anVyGkA==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-27.3.1.tgz", + "integrity": "sha512-E4SwfzKJWYcvOYCjOxhZcxwL+AY0uFMvdCOwvzgutJiaiodFjkxQQDxHm8FQBeTqDnSmKsQWn7ldMRzTn2zJaQ==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "chalk": "^4.0.0", + "jest-get-type": "^27.3.1", + "jest-util": "^27.3.1", + "pretty-format": "^27.3.1" + } + }, + "jest-environment-jsdom": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-27.3.1.tgz", + "integrity": "sha512-3MOy8qMzIkQlfb3W1TfrD7uZHj+xx8Olix5vMENkj5djPmRqndMaXtpnaZkxmxM+Qc3lo+yVzJjzuXbCcZjAlg==", + "dev": true, + "requires": { + "@jest/environment": "^27.3.1", + "@jest/fake-timers": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "jest-mock": "^27.3.0", + "jest-util": "^27.3.1", + "jsdom": "^16.6.0" + } + }, + "jest-environment-node": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-27.3.1.tgz", + "integrity": "sha512-T89F/FgkE8waqrTSA7/ydMkcc52uYPgZZ6q8OaZgyiZkJb5QNNCF6oPZjH9IfPFfcc9uBWh1574N0kY0pSvTXw==", + "dev": true, + "requires": { + "@jest/environment": "^27.3.1", + "@jest/fake-timers": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "jest-mock": "^27.3.0", + "jest-util": "^27.3.1" + } + }, + "jest-get-type": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.3.1.tgz", + "integrity": "sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg==", + "dev": true + }, + "jest-haste-map": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.3.1.tgz", + "integrity": "sha512-lYfNZIzwPccDJZIyk9Iz5iQMM/MH56NIIcGj7AFU1YyA4ewWFBl8z+YPJuSCRML/ee2cCt2y3W4K3VXPT6Nhzg==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "@types/graceful-fs": "^4.1.2", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.3.2", + "graceful-fs": "^4.2.4", + "jest-regex-util": "^27.0.6", + "jest-serializer": "^27.0.6", + "jest-util": "^27.3.1", + "jest-worker": "^27.3.1", + "micromatch": "^4.0.4", + "walker": "^1.0.7" + } + }, + "jest-jasmine2": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-27.3.1.tgz", + "integrity": "sha512-WK11ZUetDQaC09w4/j7o4FZDUIp+4iYWH/Lik34Pv7ukL+DuXFGdnmmi7dT58J2ZYKFB5r13GyE0z3NPeyJmsg==", + "dev": true, + "requires": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^27.3.1", + "@jest/source-map": "^27.0.6", + "@jest/test-result": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "expect": "^27.3.1", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.3.1", + "jest-matcher-utils": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-runtime": "^27.3.1", + "jest-snapshot": "^27.3.1", + "jest-util": "^27.3.1", + "pretty-format": "^27.3.1", + "throat": "^6.0.1" + } + }, + "jest-leak-detector": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-27.3.1.tgz", + "integrity": "sha512-78QstU9tXbaHzwlRlKmTpjP9k4Pvre5l0r8Spo4SbFFVy/4Abg9I6ZjHwjg2QyKEAMg020XcjP+UgLZIY50yEg==", + "dev": true, + "requires": { + "jest-get-type": "^27.3.1", + "pretty-format": "^27.3.1" + } + }, + "jest-matcher-utils": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.3.1.tgz", + "integrity": "sha512-hX8N7zXS4k+8bC1Aj0OWpGb7D3gIXxYvPNK1inP5xvE4ztbz3rc4AkI6jGVaerepBnfWB17FL5lWFJT3s7qo8w==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "jest-diff": "^27.3.1", + "jest-get-type": "^27.3.1", + "pretty-format": "^27.3.1" + } + }, + "jest-message-util": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.3.1.tgz", + "integrity": "sha512-bh3JEmxsTZ/9rTm0jQrPElbY2+y48Rw2t47uMfByNyUVR+OfPh4anuyKsGqsNkXk/TI4JbLRZx+7p7Hdt6q1yg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.2.5", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.4", + "pretty-format": "^27.3.1", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.15.8", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", + "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + } + } + }, + "jest-mock": { + "version": "27.3.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.3.0.tgz", + "integrity": "sha512-ziZiLk0elZOQjD08bLkegBzv5hCABu/c8Ytx45nJKkysQwGaonvmTxwjLqEA4qGdasq9o2I8/HtdGMNnVsMTGw==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "@types/node": "*" + } + }, + "jest-pnp-resolver": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "dev": true, + "requires": {} + }, + "jest-regex-util": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.0.6.tgz", + "integrity": "sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ==", + "dev": true + }, + "jest-resolve": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-27.3.1.tgz", + "integrity": "sha512-Dfzt25CFSPo3Y3GCbxynRBZzxq9AdyNN+x/v2IqYx6KVT5Z6me2Z/PsSGFSv3cOSUZqJ9pHxilao/I/m9FouLw==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.3.1", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "resolve": "^1.20.0", + "resolve.exports": "^1.1.0", + "slash": "^3.0.0" + } + }, + "jest-resolve-dependencies": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.1.tgz", + "integrity": "sha512-X7iLzY8pCiYOnvYo2YrK3P9oSE8/3N2f4pUZMJ8IUcZnT81vlSonya1KTO9ZfKGuC+svE6FHK/XOb8SsoRUV1A==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "jest-regex-util": "^27.0.6", + "jest-snapshot": "^27.3.1" + } + }, + "jest-runner": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-27.3.1.tgz", + "integrity": "sha512-r4W6kBn6sPr3TBwQNmqE94mPlYVn7fLBseeJfo4E2uCTmAyDFm2O5DYAQAFP7Q3YfiA/bMwg8TVsciP7k0xOww==", + "dev": true, + "requires": { + "@jest/console": "^27.3.1", + "@jest/environment": "^27.3.1", + "@jest/test-result": "^27.3.1", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-docblock": "^27.0.6", + "jest-environment-jsdom": "^27.3.1", + "jest-environment-node": "^27.3.1", + "jest-haste-map": "^27.3.1", + "jest-leak-detector": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-resolve": "^27.3.1", + "jest-runtime": "^27.3.1", + "jest-util": "^27.3.1", + "jest-worker": "^27.3.1", + "source-map-support": "^0.5.6", + "throat": "^6.0.1" + } + }, + "jest-runtime": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-27.3.1.tgz", + "integrity": "sha512-qtO6VxPbS8umqhEDpjA4pqTkKQ1Hy4ZSi9mDVeE9Za7LKBo2LdW2jmT+Iod3XFaJqINikZQsn2wEi0j9wPRbLg==", + "dev": true, + "requires": { + "@jest/console": "^27.3.1", + "@jest/environment": "^27.3.1", + "@jest/globals": "^27.3.1", + "@jest/source-map": "^27.0.6", + "@jest/test-result": "^27.3.1", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "execa": "^5.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-mock": "^27.3.0", + "jest-regex-util": "^27.0.6", + "jest-resolve": "^27.3.1", + "jest-snapshot": "^27.3.1", + "jest-util": "^27.3.1", + "jest-validate": "^27.3.1", + "slash": "^3.0.0", + "strip-bom": "^4.0.0", + "yargs": "^16.2.0" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + } + } + }, + "jest-serializer": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-27.0.6.tgz", + "integrity": "sha512-PtGdVK9EGC7dsaziskfqaAPib6wTViY3G8E5wz9tLVPhHyiDNTZn/xjZ4khAw+09QkoOVpn7vF5nPSN6dtBexA==", + "dev": true, + "requires": { + "@types/node": "*", + "graceful-fs": "^4.2.4" + } + }, + "jest-snapshot": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-27.3.1.tgz", + "integrity": "sha512-APZyBvSgQgOT0XumwfFu7X3G5elj6TGhCBLbBdn3R1IzYustPGPE38F51dBWMQ8hRXa9je0vAdeVDtqHLvB6lg==", + "dev": true, + "requires": { + "@babel/core": "^7.7.2", + "@babel/generator": "^7.7.2", + "@babel/parser": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.0.0", + "@jest/transform": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/babel__traverse": "^7.0.4", + "@types/prettier": "^2.1.5", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^27.3.1", + "graceful-fs": "^4.2.4", + "jest-diff": "^27.3.1", + "jest-get-type": "^27.3.1", + "jest-haste-map": "^27.3.1", + "jest-matcher-utils": "^27.3.1", + "jest-message-util": "^27.3.1", + "jest-resolve": "^27.3.1", + "jest-util": "^27.3.1", + "natural-compare": "^1.4.0", + "pretty-format": "^27.3.1", + "semver": "^7.3.2" + } + }, + "jest-util": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.3.1.tgz", + "integrity": "sha512-8fg+ifEH3GDryLQf/eKZck1DEs2YuVPBCMOaHQxVVLmQwl/CDhWzrvChTX4efLZxGrw+AA0mSXv78cyytBt/uw==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.4", + "picomatch": "^2.2.3" + }, + "dependencies": { + "ci-info": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz", + "integrity": "sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A==", + "dev": true + } + } + }, + "jest-validate": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.3.1.tgz", + "integrity": "sha512-3H0XCHDFLA9uDII67Bwi1Vy7AqwA5HqEEjyy934lgVhtJ3eisw6ShOF1MDmRPspyikef5MyExvIm0/TuLzZ86Q==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^27.3.1", + "leven": "^3.1.0", + "pretty-format": "^27.3.1" + }, + "dependencies": { + "camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true + } + } + }, + "jest-watcher": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-27.3.1.tgz", + "integrity": "sha512-9/xbV6chABsGHWh9yPaAGYVVKurWoP3ZMCv6h+O1v9/+pkOroigs6WzZ0e9gLP/njokUwM7yQhr01LKJVMkaZA==", + "dev": true, + "requires": { + "@jest/test-result": "^27.3.1", + "@jest/types": "^27.2.5", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "jest-util": "^27.3.1", + "string-length": "^4.0.1" + } + }, + "jest-worker": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.3.1.tgz", + "integrity": "sha512-ks3WCzsiZaOPJl/oMsDjaf0TRiSv7ctNgs0FqRr2nARsovz6AWWy4oLElwcquGSz692DzgZQrCLScPNs5YlC4g==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "dependencies": { + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsdom": { + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "dev": true, + "requires": { + "abab": "^2.0.5", + "acorn": "^8.2.4", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.3.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.1", + "domexception": "^2.0.1", + "escodegen": "^2.0.0", + "form-data": "^3.0.0", + "html-encoding-sniffer": "^2.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.5.0", + "ws": "^7.4.6", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "dev": true + }, + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "dev": true, + "requires": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" + } + } + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-parse-helpfulerror": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", + "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", + "dev": true, + "requires": { + "jju": "^1.1.0" + } + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonlines": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsonlines/-/jsonlines-0.1.1.tgz", + "integrity": "sha1-T80kbcXQ44aRkHxEqwAveC0dlMw=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "requires": { + "package-json": "^6.3.0" + } + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "libnpmconfig": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", + "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1", + "find-up": "^3.0.0", + "ini": "^1.3.5" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "dev": true, + "requires": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + } + }, + "makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "requires": { + "tmpl": "1.0.5" + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "mime-db": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", + "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==", + "dev": true + }, + "mime-types": { + "version": "2.1.33", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", + "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", + "dev": true, + "requires": { + "mime-db": "1.50.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minipass": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "dev": true, + "requires": { + "encoding": "^0.1.12", + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-json-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", + "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", + "dev": true, + "requires": { + "jsonparse": "^1.3.1", + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-gyp": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", + "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", + "dev": true, + "requires": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.3", + "nopt": "^5.0.0", + "npmlog": "^4.1.2", + "request": "^2.88.2", + "rimraf": "^3.0.2", + "semver": "^7.3.2", + "tar": "^6.0.2", + "which": "^2.0.2" + } + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-modules-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", + "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", + "dev": true + }, + "node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "dev": true + }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "dev": true + }, + "npm-bundled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", + "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", + "dev": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-check-updates": { + "version": "11.8.5", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-11.8.5.tgz", + "integrity": "sha512-IYSHjlWe8UEugDy7X0qjBeJwcni4DlcWdBK4QQEbwgkNlEDlXyd4yQJYWFumKaJzrp/n5/EcvaboXsBD1Er/pw==", + "dev": true, + "requires": { + "chalk": "^4.1.2", + "cint": "^8.2.1", + "cli-table": "^0.3.6", + "commander": "^6.2.1", + "fast-memoize": "^2.5.2", + "find-up": "5.0.0", + "fp-and-or": "^0.1.3", + "get-stdin": "^8.0.0", + "globby": "^11.0.4", + "hosted-git-info": "^4.0.2", + "json-parse-helpfulerror": "^1.0.3", + "jsonlines": "^0.1.1", + "libnpmconfig": "^1.2.1", + "lodash": "^4.17.21", + "minimatch": "^3.0.4", + "p-map": "^4.0.0", + "pacote": "^11.3.5", + "parse-github-url": "^1.0.2", + "progress": "^2.0.3", + "prompts": "^2.4.1", + "rc-config-loader": "^4.0.0", + "remote-git-tags": "^3.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "semver-utils": "^1.1.4", + "spawn-please": "^1.0.0", + "update-notifier": "^5.1.0" + } + }, + "npm-install-checks": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz", + "integrity": "sha512-09OmyDkNLYwqKPOnbI8exiOZU2GVVmQp7tgez2BPi5OZC8M82elDAps7sxC4l//uSUtotWqoEIDwjRvWH4qz8w==", + "dev": true, + "requires": { + "semver": "^7.1.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "npm-package-arg": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz", + "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==", + "dev": true, + "requires": { + "hosted-git-info": "^4.0.1", + "semver": "^7.3.4", + "validate-npm-package-name": "^3.0.0" + } + }, + "npm-packlist": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz", + "integrity": "sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg==", + "dev": true, + "requires": { + "glob": "^7.1.6", + "ignore-walk": "^3.0.3", + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-pick-manifest": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz", + "integrity": "sha512-dBsdBtORT84S8V8UTad1WlUyKIY9iMsAmqxHbLdeEeBNMLQDlDWWra3wYUx9EBEIiG/YwAy0XyNHDd2goAsfuA==", + "dev": true, + "requires": { + "npm-install-checks": "^4.0.0", + "npm-normalize-package-bin": "^1.0.1", + "npm-package-arg": "^8.1.2", + "semver": "^7.3.4" + } + }, + "npm-registry-fetch": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz", + "integrity": "sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA==", + "dev": true, + "requires": { + "make-fetch-happen": "^9.0.1", + "minipass": "^3.1.3", + "minipass-fetch": "^1.3.0", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.0.0", + "npm-package-arg": "^8.0.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "pacote": { + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz", + "integrity": "sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg==", + "dev": true, + "requires": { + "@npmcli/git": "^2.1.0", + "@npmcli/installed-package-contents": "^1.0.6", + "@npmcli/promise-spawn": "^1.2.0", + "@npmcli/run-script": "^1.8.2", + "cacache": "^15.0.5", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "infer-owner": "^1.0.4", + "minipass": "^3.1.3", + "mkdirp": "^1.0.3", + "npm-package-arg": "^8.0.1", + "npm-packlist": "^2.1.4", + "npm-pick-manifest": "^6.0.0", + "npm-registry-fetch": "^11.0.0", + "promise-retry": "^2.0.1", + "read-package-json-fast": "^2.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.1.0" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-github-url": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "dev": true + }, + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-to-regexp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", + "integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "pirates": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", + "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "dev": true, + "requires": { + "node-modules-regexp": "^1.0.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + } + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "prettier": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, + "pretty-format": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.3.1.tgz", + "integrity": "sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA==", + "dev": true, + "requires": { + "@jest/types": "^27.2.5", + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + } + } + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "requires": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + } + }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "dev": true, + "requires": { + "escape-goat": "^2.0.0" + } + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "rc-config-loader": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.0.0.tgz", + "integrity": "sha512-//LRTblJEcqbmmro1GCmZ39qZXD+JqzuD8Y5/IZU3Dhp3A1Yr0Xn68ks8MQ6qKfKvYCWDveUmRDKDA40c+sCXw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "js-yaml": "^4.0.0", + "json5": "^2.1.2", + "require-from-string": "^2.0.2" + } + }, + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, + "read-package-json-fast": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", + "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", + "dev": true, + "requires": { + "json-parse-even-better-errors": "^2.3.0", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "registry-auth-token": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", + "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "dev": true, + "requires": { + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" + } + }, + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "dev": true, + "requires": { + "rc": "^1.0.1" + } + }, + "remote-git-tags": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remote-git-tags/-/remote-git-tags-3.0.0.tgz", + "integrity": "sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w==", + "dev": true + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "resolve.exports": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz", + "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", + "dev": true + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "2.58.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.58.3.tgz", + "integrity": "sha512-ei27MSw1KhRur4p87Q0/Va2NAYqMXOX++FNEumMBcdreIRLURKy+cE2wcDJKBn0nfmhP2ZGrJkP1XPO+G8FJQw==", + "dev": true, + "requires": { + "fsevents": "~2.3.2" + } + }, + "rollup-plugin-babel-minify": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-babel-minify/-/rollup-plugin-babel-minify-10.0.0.tgz", + "integrity": "sha512-tYZOhGtffvGp8VzTrB5u/kPYyIjEEshTPEauOLkshPNx/MvCJVd6PCc2HX4CO0TDH0cBnnGKQ+yQpTERJikK4Q==", + "dev": true, + "requires": { + "@babel/core": "^7.8.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@comandeer/babel-plugin-banner": "^5.0.0", + "babel-preset-minify": "^0.5.1", + "sourcemap-codec": "^1.4.8" + } + }, + "rollup-plugin-typescript2": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz", + "integrity": "sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^4.1.0", + "find-cache-dir": "^3.3.1", + "fs-extra": "8.1.0", + "resolve": "1.20.0", + "tslib": "2.1.0" + }, + "dependencies": { + "@rollup/pluginutils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.1.tgz", + "integrity": "sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==", + "dev": true, + "requires": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + } + } + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dev": true, + "requires": { + "xmlchars": "^2.2.0" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "semver-utils": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/semver-utils/-/semver-utils-1.1.4.tgz", + "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", + "dev": true + }, + "serve": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.1.tgz", + "integrity": "sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw==", + "dev": true, + "requires": { + "@zeit/schemas": "2.6.0", + "ajv": "6.12.6", + "arg": "2.0.0", + "boxen": "1.3.0", + "chalk": "2.4.1", + "clipboardy": "2.3.0", + "compression": "1.7.3", + "serve-handler": "6.1.3", + "update-check": "1.5.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "serve-handler": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.3.tgz", + "integrity": "sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w==", + "dev": true, + "requires": { + "bytes": "3.0.0", + "content-disposition": "0.5.2", + "fast-url-parser": "1.1.3", + "mime-types": "2.1.18", + "minimatch": "3.0.4", + "path-is-inside": "1.0.2", + "path-to-regexp": "2.2.1", + "range-parser": "1.2.0" + }, + "dependencies": { + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "~1.33.0" + } + } + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", + "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", + "dev": true + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + } + } + }, + "smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true + }, + "socks": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", + "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==", + "dev": true, + "requires": { + "ip": "^1.1.5", + "smart-buffer": "^4.1.0" + } + }, + "socks-proxy-agent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz", + "integrity": "sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg==", + "dev": true, + "requires": { + "agent-base": "^6.0.2", + "debug": "^4.3.1", + "socks": "^2.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", + "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "spawn-please": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-1.0.0.tgz", + "integrity": "sha512-Kz33ip6NRNKuyTRo3aDWyWxeGeM0ORDO552Fs6E1nj4pLWPkl37SrRtTnq+MEopVaqgmaO6bAvVS+v64BJ5M/A==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "dev": true, + "requires": { + "minipass": "^3.1.1" + } + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "requires": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-hyperlinks": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", + "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", + "dev": true, + "requires": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + } + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "table": { + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.2.tgz", + "integrity": "sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ajv": { + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "tar": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + } + }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "dev": true, + "requires": { + "execa": "^0.7.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + } + } + }, + "terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throat": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.1.tgz", + "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", + "dev": true + }, + "tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "tr46": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, + "requires": { + "punycode": "^2.1.1" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "ts-jest": { + "version": "27.0.7", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.0.7.tgz", + "integrity": "sha512-O41shibMqzdafpuP+CkrOL7ykbmLh+FqQrXEmV9CydQ5JBk0Sj0uAEF5TNNe94fZWKm3yYvWa/IbyV4Yg1zK2Q==", + "dev": true, + "requires": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^27.0.0", + "json5": "2.x", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "7.x", + "yargs-parser": "20.x" + } + }, + "tslib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", + "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "dev": true + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "update-check": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/update-check/-/update-check-1.5.2.tgz", + "integrity": "sha512-1TrmYLuLj/5ZovwUS7fFd1jMH3NnFDN1y1A8dboedIDt7zs/zJMo6TwwlhYKkSeEwzleeiSBV5/3c9ufAQWDaQ==", + "dev": true, + "requires": { + "registry-auth-token": "3.3.2", + "registry-url": "3.1.0" + } + }, + "update-notifier": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", + "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", + "dev": true, + "requires": { + "boxen": "^5.0.0", + "chalk": "^4.1.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.4.0", + "is-npm": "^5.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.1.0", + "pupa": "^2.1.1", + "semver": "^7.3.4", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "dev": true, + "requires": { + "string-width": "^4.1.0" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "boxen": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", + "dev": true, + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" + } + }, + "camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true + }, + "cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "requires": { + "string-width": "^4.0.0" + } + } + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "v8-to-istanbul": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz", + "integrity": "sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + }, + "validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", + "dev": true, + "requires": { + "builtins": "^1.0.3" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + }, + "dependencies": { + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + } + } + }, + "w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", + "dev": true, + "requires": { + "browser-process-hrtime": "^1.0.0" + } + }, + "w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "dev": true, + "requires": { + "xml-name-validator": "^3.0.0" + } + }, + "walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "requires": { + "makeerror": "1.0.12" + } + }, + "webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } + } + }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "whatwg-url": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", + "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "dev": true, + "requires": { + "lodash": "^4.7.0", + "tr46": "^2.1.0", + "webidl-conversions": "^6.1.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "widest-line": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "dev": true, + "requires": { + "string-width": "^2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "ws": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", + "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "dev": true, + "requires": {} + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json index f58dd049..846e60bc 100644 --- a/package.json +++ b/package.json @@ -27,5 +27,10 @@ }, "resolutions": { "get-pkg-repo": "4.1.2" - } + }, + "workspaces": [ + "packages/sdk", + "packages/e2ee", + "packages/go-wasm" + ] } diff --git a/packages/e2ee/package.json b/packages/e2ee/package.json index a0892749..33316ae8 100644 --- a/packages/e2ee/package.json +++ b/packages/e2ee/package.json @@ -8,7 +8,7 @@ "module": "dist/sora_e2ee.mjs", "types": "dist/sora_e2ee.d.ts", "scripts": { - "build": "yarn build:worker && yarn build:development", + "build": "npm run build:worker && npm run build:development", "build:development": "NODE_ENV=development rollup -c rollup.config.js", "build:worker": "npx tsc --project tsconfig.worker.json", "fmt": "prettier --write src", diff --git a/packages/sdk/tsconfig.doc.json b/packages/sdk/tsconfig.doc.json deleted file mode 100644 index 27550f43..00000000 --- a/packages/sdk/tsconfig.doc.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "compilerOptions": { - "target": "es2020", - "module": "es2020", - "strict": true, - "declaration": true, - "strictNullChecks": true, - "importHelpers": true, - "moduleResolution": "node", - "experimentalDecorators": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "resolveJsonModule": true, - "newLine": "LF", - "types": [ - "jest" - ], - "lib": [ - "esnext", - "dom", - "dom.iterable", - "scripthost" - ] - }, - "include": [ - "src/**/*.ts" - ], - "exclude": [ - "node_modules", - "tests" - ] -} From a719bc025e3a6e9c5f2313d13598415a9fee7e23 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 28 Oct 2021 15:04:24 +0900 Subject: [PATCH 41/87] =?UTF-8?q?=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E6=95=B4=E7=90=86=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 778 +++++++--------------------------- packages/e2ee/package.json | 4 +- packages/go-wasm/package.json | 2 +- packages/sdk/package.json | 12 +- 4 files changed, 161 insertions(+), 635 deletions(-) diff --git a/package-lock.json b/package-lock.json index 931da620..66193d7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,6 @@ "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, "dependencies": { "@babel/highlight": "^7.10.4" } @@ -291,7 +290,6 @@ "version": "7.15.7", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -323,7 +321,6 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", @@ -337,7 +334,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -349,7 +345,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -363,7 +358,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -371,14 +365,12 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, "engines": { "node": ">=4" } @@ -387,7 +379,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -443,18 +434,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-import-meta": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", @@ -667,18 +646,6 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "node_modules/@comandeer/babel-plugin-banner": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@comandeer/babel-plugin-banner/-/babel-plugin-banner-5.0.0.tgz", - "integrity": "sha512-sR9Go0U6puXoXyW9UgIiIQhRcJ8jVOvGl4BptUiXAtheMs72WcakZ1udh6J0ZOivr3o8jAM+MTCHLP8FZMbVpQ==", - "dev": true, - "engines": { - "node": ">=8.0.0" - }, - "peerDependencies": { - "@babel/core": ">=7.0.0" - } - }, "node_modules/@eslint/eslintrc": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", @@ -1499,8 +1466,7 @@ "node_modules/@types/node": { "version": "16.11.6", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", - "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", - "dev": true + "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==" }, "node_modules/@types/prettier": { "version": "2.4.1", @@ -2051,48 +2017,6 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, - "node_modules/babel-helper-evaluate-path": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", - "integrity": "sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==", - "dev": true - }, - "node_modules/babel-helper-flip-expressions": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz", - "integrity": "sha1-NpZzahKKwYvCUlS19AoizrPB0/0=", - "dev": true - }, - "node_modules/babel-helper-is-nodes-equiv": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz", - "integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=", - "dev": true - }, - "node_modules/babel-helper-is-void-0": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz", - "integrity": "sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4=", - "dev": true - }, - "node_modules/babel-helper-mark-eval-scopes": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz", - "integrity": "sha1-0kSjvvmESHJgP/tG4izorN9VFWI=", - "dev": true - }, - "node_modules/babel-helper-remove-or-void": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz", - "integrity": "sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=", - "dev": true - }, - "node_modules/babel-helper-to-multiple-sequence-expressions": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz", - "integrity": "sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA==", - "dev": true - }, "node_modules/babel-jest": { "version": "27.3.1", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.3.1.tgz", @@ -2171,172 +2095,6 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "node_modules/babel-plugin-minify-builtins": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz", - "integrity": "sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag==", - "dev": true - }, - "node_modules/babel-plugin-minify-constant-folding": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz", - "integrity": "sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ==", - "dev": true, - "dependencies": { - "babel-helper-evaluate-path": "^0.5.0" - } - }, - "node_modules/babel-plugin-minify-dead-code-elimination": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz", - "integrity": "sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg==", - "dev": true, - "dependencies": { - "babel-helper-evaluate-path": "^0.5.0", - "babel-helper-mark-eval-scopes": "^0.4.3", - "babel-helper-remove-or-void": "^0.4.3", - "lodash": "^4.17.11" - } - }, - "node_modules/babel-plugin-minify-flip-comparisons": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz", - "integrity": "sha1-AMqHDLjxO0XAOLPB68DyJyk8llo=", - "dev": true, - "dependencies": { - "babel-helper-is-void-0": "^0.4.3" - } - }, - "node_modules/babel-plugin-minify-guarded-expressions": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz", - "integrity": "sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA==", - "dev": true, - "dependencies": { - "babel-helper-evaluate-path": "^0.5.0", - "babel-helper-flip-expressions": "^0.4.3" - } - }, - "node_modules/babel-plugin-minify-infinity": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz", - "integrity": "sha1-37h2obCKBldjhO8/kuZTumB7Oco=", - "dev": true - }, - "node_modules/babel-plugin-minify-mangle-names": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz", - "integrity": "sha512-3jdNv6hCAw6fsX1p2wBGPfWuK69sfOjfd3zjUXkbq8McbohWy23tpXfy5RnToYWggvqzuMOwlId1PhyHOfgnGw==", - "dev": true, - "dependencies": { - "babel-helper-mark-eval-scopes": "^0.4.3" - } - }, - "node_modules/babel-plugin-minify-numeric-literals": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz", - "integrity": "sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw=", - "dev": true - }, - "node_modules/babel-plugin-minify-replace": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz", - "integrity": "sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q==", - "dev": true - }, - "node_modules/babel-plugin-minify-simplify": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz", - "integrity": "sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A==", - "dev": true, - "dependencies": { - "babel-helper-evaluate-path": "^0.5.0", - "babel-helper-flip-expressions": "^0.4.3", - "babel-helper-is-nodes-equiv": "^0.0.1", - "babel-helper-to-multiple-sequence-expressions": "^0.5.0" - } - }, - "node_modules/babel-plugin-minify-type-constructors": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz", - "integrity": "sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA=", - "dev": true, - "dependencies": { - "babel-helper-is-void-0": "^0.4.3" - } - }, - "node_modules/babel-plugin-transform-inline-consecutive-adds": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz", - "integrity": "sha1-Mj1Ho+pjqDp6w8gRro5pQfrysNE=", - "dev": true - }, - "node_modules/babel-plugin-transform-member-expression-literals": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz", - "integrity": "sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8=", - "dev": true - }, - "node_modules/babel-plugin-transform-merge-sibling-variables": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz", - "integrity": "sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4=", - "dev": true - }, - "node_modules/babel-plugin-transform-minify-booleans": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz", - "integrity": "sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg=", - "dev": true - }, - "node_modules/babel-plugin-transform-property-literals": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz", - "integrity": "sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk=", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - } - }, - "node_modules/babel-plugin-transform-regexp-constructors": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz", - "integrity": "sha1-WLd3W2OvzzMyj66aX4j71PsLSWU=", - "dev": true - }, - "node_modules/babel-plugin-transform-remove-console": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz", - "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=", - "dev": true - }, - "node_modules/babel-plugin-transform-remove-debugger": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz", - "integrity": "sha1-QrcnYxyXl44estGZp67IShgznvI=", - "dev": true - }, - "node_modules/babel-plugin-transform-remove-undefined": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz", - "integrity": "sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ==", - "dev": true, - "dependencies": { - "babel-helper-evaluate-path": "^0.5.0" - } - }, - "node_modules/babel-plugin-transform-simplify-comparison-operators": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz", - "integrity": "sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk=", - "dev": true - }, - "node_modules/babel-plugin-transform-undefined-to-void": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz", - "integrity": "sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=", - "dev": true - }, "node_modules/babel-preset-current-node-syntax": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", @@ -2376,37 +2134,6 @@ "@babel/core": "^7.0.0" } }, - "node_modules/babel-preset-minify": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.5.1.tgz", - "integrity": "sha512-1IajDumYOAPYImkHbrKeiN5AKKP9iOmRoO2IPbIuVp0j2iuCcj0n7P260z38siKMZZ+85d3mJZdtW8IgOv+Tzg==", - "dev": true, - "dependencies": { - "babel-plugin-minify-builtins": "^0.5.0", - "babel-plugin-minify-constant-folding": "^0.5.0", - "babel-plugin-minify-dead-code-elimination": "^0.5.1", - "babel-plugin-minify-flip-comparisons": "^0.4.3", - "babel-plugin-minify-guarded-expressions": "^0.4.4", - "babel-plugin-minify-infinity": "^0.4.3", - "babel-plugin-minify-mangle-names": "^0.5.0", - "babel-plugin-minify-numeric-literals": "^0.4.3", - "babel-plugin-minify-replace": "^0.5.0", - "babel-plugin-minify-simplify": "^0.5.1", - "babel-plugin-minify-type-constructors": "^0.4.3", - "babel-plugin-transform-inline-consecutive-adds": "^0.4.3", - "babel-plugin-transform-member-expression-literals": "^6.9.4", - "babel-plugin-transform-merge-sibling-variables": "^6.9.4", - "babel-plugin-transform-minify-booleans": "^6.9.4", - "babel-plugin-transform-property-literals": "^6.9.4", - "babel-plugin-transform-regexp-constructors": "^0.4.3", - "babel-plugin-transform-remove-console": "^6.9.4", - "babel-plugin-transform-remove-debugger": "^6.9.4", - "babel-plugin-transform-remove-undefined": "^0.5.0", - "babel-plugin-transform-simplify-comparison-operators": "^6.9.4", - "babel-plugin-transform-undefined-to-void": "^6.9.4", - "lodash": "^4.17.11" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2620,8 +2347,7 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "node_modules/builtin-modules": { "version": "3.2.0", @@ -2740,9 +2466,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001271", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz", - "integrity": "sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA==", + "version": "1.0.30001272", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001272.tgz", + "integrity": "sha512-DV1j9Oot5dydyH1v28g25KoVm7l8MTxazwuiH3utWiAS6iL/9Nh//TGwqFEeqqN8nnWYQ8HHhUq+o4QPt9kvYw==", "dev": true, "funding": { "type": "opencollective", @@ -3466,7 +3192,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -4228,7 +3953,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -4484,7 +4208,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } @@ -5869,8 +5592,7 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "4.1.0", @@ -6364,8 +6086,7 @@ "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "node_modules/merge2": { "version": "1.4.1", @@ -7431,6 +7152,14 @@ } ] }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, "node_modules/range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", @@ -7693,7 +7422,6 @@ "version": "2.58.3", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.58.3.tgz", "integrity": "sha512-ei27MSw1KhRur4p87Q0/Va2NAYqMXOX++FNEumMBcdreIRLURKy+cE2wcDJKBn0nfmhP2ZGrJkP1XPO+G8FJQw==", - "dev": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -7704,24 +7432,31 @@ "fsevents": "~2.3.2" } }, - "node_modules/rollup-plugin-babel-minify": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-babel-minify/-/rollup-plugin-babel-minify-10.0.0.tgz", - "integrity": "sha512-tYZOhGtffvGp8VzTrB5u/kPYyIjEEshTPEauOLkshPNx/MvCJVd6PCc2HX4CO0TDH0cBnnGKQ+yQpTERJikK4Q==", - "deprecated": "Please use rollup-plugin-terser instead.", - "dev": true, + "node_modules/rollup-plugin-terser": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", + "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", "dependencies": { - "@babel/core": "^7.8.7", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@comandeer/babel-plugin-banner": "^5.0.0", - "babel-preset-minify": "^0.5.1", - "sourcemap-codec": "^1.4.8" - }, - "engines": { - "node": ">=10.13.0" + "@babel/code-frame": "^7.10.4", + "jest-worker": "^26.2.1", + "serialize-javascript": "^4.0.0", + "terser": "^5.0.0" }, "peerDependencies": { - "rollup": ">=1.6.0" + "rollup": "^2.0.0" + } + }, + "node_modules/rollup-plugin-terser/node_modules/jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">= 10.13.0" } }, "node_modules/rollup-plugin-typescript2": { @@ -7780,8 +7515,7 @@ "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/safer-buffer": { "version": "2.1.2", @@ -7843,6 +7577,14 @@ "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", "dev": true }, + "node_modules/serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/serve": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.1.tgz", @@ -8078,7 +7820,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -8087,7 +7828,6 @@ "version": "0.5.20", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", - "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -8281,7 +8021,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -8502,6 +8241,35 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/terser": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", + "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", + "dependencies": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/terser/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "engines": { + "node": ">= 8" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -9437,10 +9205,10 @@ }, "packages/e2ee": { "name": "@sora/e2ee", - "version": "2021.2.0-canary.3", + "version": "2021.1.0", "license": "Apache-2.0", "dependencies": { - "@sora/go-wasm": "^2021.2.0-canary.3" + "@sora/go-wasm": "^2021.1.0" }, "devDependencies": { "@rollup/plugin-replace": "^3.0.0", @@ -9457,17 +9225,14 @@ }, "packages/go-wasm": { "name": "@sora/go-wasm", - "version": "2021.2.0-canary.3", - "license": "ISC", - "devDependencies": {} + "version": "2021.1.0" }, "packages/sdk": { "name": "@sora/sdk", - "version": "2021.2.0-canary.3", - "license": "Apache-2.0", "dependencies": { - "@sora/e2ee": "^2021.2.0-canary.3", - "fflate": "^0.7.1" + "@sora/e2ee": "^2021.1.0", + "fflate": "^0.7.1", + "rollup-plugin-terser": "^7.0.2" }, "devDependencies": { "@rollup/plugin-commonjs": "^21.0.0", @@ -9482,7 +9247,6 @@ "jest": "^27.2.4", "prettier": "^2.4.1", "rollup": "^2.58.0", - "rollup-plugin-babel-minify": "^10.0.0", "rollup-plugin-typescript2": "^0.30.0", "ts-jest": "^27.0.5", "typescript": "^4.4.3" @@ -9494,7 +9258,6 @@ "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, "requires": { "@babel/highlight": "^7.10.4" } @@ -9701,8 +9464,7 @@ "@babel/helper-validator-identifier": { "version": "7.15.7", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==" }, "@babel/helper-validator-option": { "version": "7.14.5", @@ -9725,7 +9487,6 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", @@ -9736,7 +9497,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -9745,7 +9505,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -9756,7 +9515,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -9764,20 +9522,17 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } @@ -9817,15 +9572,6 @@ "@babel/helper-plugin-utils": "^7.12.13" } }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, "@babel/plugin-syntax-import-meta": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", @@ -9988,13 +9734,6 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "@comandeer/babel-plugin-banner": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@comandeer/babel-plugin-banner/-/babel-plugin-banner-5.0.0.tgz", - "integrity": "sha512-sR9Go0U6puXoXyW9UgIiIQhRcJ8jVOvGl4BptUiXAtheMs72WcakZ1udh6J0ZOivr3o8jAM+MTCHLP8FZMbVpQ==", - "dev": true, - "requires": {} - }, "@eslint/eslintrc": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", @@ -10550,7 +10289,7 @@ "version": "file:packages/e2ee", "requires": { "@rollup/plugin-replace": "^3.0.0", - "@sora/go-wasm": "^2021.2.0-canary.3", + "@sora/go-wasm": "^2021.1.0", "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", "eslint": "^7.32.0", @@ -10571,7 +10310,7 @@ "@rollup/plugin-commonjs": "^21.0.0", "@rollup/plugin-node-resolve": "^13.0.5", "@rollup/plugin-replace": "^3.0.0", - "@sora/e2ee": "^2021.2.0-canary.3", + "@sora/e2ee": "^2021.1.0", "@types/jest": "^27.0.2", "@typescript-eslint/eslint-plugin": "4.33.0", "@typescript-eslint/parser": "4.33.0", @@ -10582,7 +10321,7 @@ "jest": "^27.2.4", "prettier": "^2.4.1", "rollup": "^2.58.0", - "rollup-plugin-babel-minify": "^10.0.0", + "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript2": "^0.30.0", "ts-jest": "^27.0.5", "typescript": "^4.4.3" @@ -10702,8 +10441,7 @@ "@types/node": { "version": "16.11.6", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", - "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", - "dev": true + "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==" }, "@types/prettier": { "version": "2.4.1", @@ -11092,48 +10830,6 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, - "babel-helper-evaluate-path": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", - "integrity": "sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==", - "dev": true - }, - "babel-helper-flip-expressions": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz", - "integrity": "sha1-NpZzahKKwYvCUlS19AoizrPB0/0=", - "dev": true - }, - "babel-helper-is-nodes-equiv": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz", - "integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=", - "dev": true - }, - "babel-helper-is-void-0": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz", - "integrity": "sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4=", - "dev": true - }, - "babel-helper-mark-eval-scopes": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz", - "integrity": "sha1-0kSjvvmESHJgP/tG4izorN9VFWI=", - "dev": true - }, - "babel-helper-remove-or-void": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz", - "integrity": "sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=", - "dev": true - }, - "babel-helper-to-multiple-sequence-expressions": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz", - "integrity": "sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA==", - "dev": true - }, "babel-jest": { "version": "27.3.1", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.3.1.tgz", @@ -11196,172 +10892,6 @@ "@types/babel__traverse": "^7.0.6" } }, - "babel-plugin-minify-builtins": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz", - "integrity": "sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag==", - "dev": true - }, - "babel-plugin-minify-constant-folding": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz", - "integrity": "sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ==", - "dev": true, - "requires": { - "babel-helper-evaluate-path": "^0.5.0" - } - }, - "babel-plugin-minify-dead-code-elimination": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz", - "integrity": "sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg==", - "dev": true, - "requires": { - "babel-helper-evaluate-path": "^0.5.0", - "babel-helper-mark-eval-scopes": "^0.4.3", - "babel-helper-remove-or-void": "^0.4.3", - "lodash": "^4.17.11" - } - }, - "babel-plugin-minify-flip-comparisons": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz", - "integrity": "sha1-AMqHDLjxO0XAOLPB68DyJyk8llo=", - "dev": true, - "requires": { - "babel-helper-is-void-0": "^0.4.3" - } - }, - "babel-plugin-minify-guarded-expressions": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz", - "integrity": "sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA==", - "dev": true, - "requires": { - "babel-helper-evaluate-path": "^0.5.0", - "babel-helper-flip-expressions": "^0.4.3" - } - }, - "babel-plugin-minify-infinity": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz", - "integrity": "sha1-37h2obCKBldjhO8/kuZTumB7Oco=", - "dev": true - }, - "babel-plugin-minify-mangle-names": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz", - "integrity": "sha512-3jdNv6hCAw6fsX1p2wBGPfWuK69sfOjfd3zjUXkbq8McbohWy23tpXfy5RnToYWggvqzuMOwlId1PhyHOfgnGw==", - "dev": true, - "requires": { - "babel-helper-mark-eval-scopes": "^0.4.3" - } - }, - "babel-plugin-minify-numeric-literals": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz", - "integrity": "sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw=", - "dev": true - }, - "babel-plugin-minify-replace": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz", - "integrity": "sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q==", - "dev": true - }, - "babel-plugin-minify-simplify": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz", - "integrity": "sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A==", - "dev": true, - "requires": { - "babel-helper-evaluate-path": "^0.5.0", - "babel-helper-flip-expressions": "^0.4.3", - "babel-helper-is-nodes-equiv": "^0.0.1", - "babel-helper-to-multiple-sequence-expressions": "^0.5.0" - } - }, - "babel-plugin-minify-type-constructors": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz", - "integrity": "sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA=", - "dev": true, - "requires": { - "babel-helper-is-void-0": "^0.4.3" - } - }, - "babel-plugin-transform-inline-consecutive-adds": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz", - "integrity": "sha1-Mj1Ho+pjqDp6w8gRro5pQfrysNE=", - "dev": true - }, - "babel-plugin-transform-member-expression-literals": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz", - "integrity": "sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8=", - "dev": true - }, - "babel-plugin-transform-merge-sibling-variables": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz", - "integrity": "sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4=", - "dev": true - }, - "babel-plugin-transform-minify-booleans": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz", - "integrity": "sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg=", - "dev": true - }, - "babel-plugin-transform-property-literals": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz", - "integrity": "sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk=", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "babel-plugin-transform-regexp-constructors": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz", - "integrity": "sha1-WLd3W2OvzzMyj66aX4j71PsLSWU=", - "dev": true - }, - "babel-plugin-transform-remove-console": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz", - "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=", - "dev": true - }, - "babel-plugin-transform-remove-debugger": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz", - "integrity": "sha1-QrcnYxyXl44estGZp67IShgznvI=", - "dev": true - }, - "babel-plugin-transform-remove-undefined": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz", - "integrity": "sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ==", - "dev": true, - "requires": { - "babel-helper-evaluate-path": "^0.5.0" - } - }, - "babel-plugin-transform-simplify-comparison-operators": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz", - "integrity": "sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk=", - "dev": true - }, - "babel-plugin-transform-undefined-to-void": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz", - "integrity": "sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=", - "dev": true - }, "babel-preset-current-node-syntax": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", @@ -11392,37 +10922,6 @@ "babel-preset-current-node-syntax": "^1.0.0" } }, - "babel-preset-minify": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.5.1.tgz", - "integrity": "sha512-1IajDumYOAPYImkHbrKeiN5AKKP9iOmRoO2IPbIuVp0j2iuCcj0n7P260z38siKMZZ+85d3mJZdtW8IgOv+Tzg==", - "dev": true, - "requires": { - "babel-plugin-minify-builtins": "^0.5.0", - "babel-plugin-minify-constant-folding": "^0.5.0", - "babel-plugin-minify-dead-code-elimination": "^0.5.1", - "babel-plugin-minify-flip-comparisons": "^0.4.3", - "babel-plugin-minify-guarded-expressions": "^0.4.4", - "babel-plugin-minify-infinity": "^0.4.3", - "babel-plugin-minify-mangle-names": "^0.5.0", - "babel-plugin-minify-numeric-literals": "^0.4.3", - "babel-plugin-minify-replace": "^0.5.0", - "babel-plugin-minify-simplify": "^0.5.1", - "babel-plugin-minify-type-constructors": "^0.4.3", - "babel-plugin-transform-inline-consecutive-adds": "^0.4.3", - "babel-plugin-transform-member-expression-literals": "^6.9.4", - "babel-plugin-transform-merge-sibling-variables": "^6.9.4", - "babel-plugin-transform-minify-booleans": "^6.9.4", - "babel-plugin-transform-property-literals": "^6.9.4", - "babel-plugin-transform-regexp-constructors": "^0.4.3", - "babel-plugin-transform-remove-console": "^6.9.4", - "babel-plugin-transform-remove-debugger": "^6.9.4", - "babel-plugin-transform-remove-undefined": "^0.5.0", - "babel-plugin-transform-simplify-comparison-operators": "^6.9.4", - "babel-plugin-transform-undefined-to-void": "^6.9.4", - "lodash": "^4.17.11" - } - }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -11595,8 +11094,7 @@ "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "builtin-modules": { "version": "3.2.0", @@ -11687,9 +11185,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001271", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz", - "integrity": "sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA==", + "version": "1.0.30001272", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001272.tgz", + "integrity": "sha512-DV1j9Oot5dydyH1v28g25KoVm7l8MTxazwuiH3utWiAS6iL/9Nh//TGwqFEeqqN8nnWYQ8HHhUq+o4QPt9kvYw==", "dev": true }, "caseless": { @@ -12268,8 +11766,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { "version": "2.0.0", @@ -12844,7 +12341,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "optional": true }, "function-bind": { @@ -13033,8 +12529,7 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "has-unicode": { "version": "2.0.1", @@ -14104,8 +13599,7 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { "version": "4.1.0", @@ -14504,8 +13998,7 @@ "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "merge2": { "version": "1.4.1", @@ -15308,6 +14801,14 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, "range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", @@ -15513,22 +15014,31 @@ "version": "2.58.3", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.58.3.tgz", "integrity": "sha512-ei27MSw1KhRur4p87Q0/Va2NAYqMXOX++FNEumMBcdreIRLURKy+cE2wcDJKBn0nfmhP2ZGrJkP1XPO+G8FJQw==", - "dev": true, "requires": { "fsevents": "~2.3.2" } }, - "rollup-plugin-babel-minify": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-babel-minify/-/rollup-plugin-babel-minify-10.0.0.tgz", - "integrity": "sha512-tYZOhGtffvGp8VzTrB5u/kPYyIjEEshTPEauOLkshPNx/MvCJVd6PCc2HX4CO0TDH0cBnnGKQ+yQpTERJikK4Q==", - "dev": true, + "rollup-plugin-terser": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", + "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", "requires": { - "@babel/core": "^7.8.7", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@comandeer/babel-plugin-banner": "^5.0.0", - "babel-preset-minify": "^0.5.1", - "sourcemap-codec": "^1.4.8" + "@babel/code-frame": "^7.10.4", + "jest-worker": "^26.2.1", + "serialize-javascript": "^4.0.0", + "terser": "^5.0.0" + }, + "dependencies": { + "jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + } + } } }, "rollup-plugin-typescript2": { @@ -15568,8 +15078,7 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safer-buffer": { "version": "2.1.2", @@ -15618,6 +15127,14 @@ "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", "dev": true }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "requires": { + "randombytes": "^2.1.0" + } + }, "serve": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.1.tgz", @@ -15808,14 +15325,12 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-support": { "version": "0.5.20", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", - "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -15966,7 +15481,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -16145,6 +15659,28 @@ "supports-hyperlinks": "^2.0.0" } }, + "terser": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", + "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", + "requires": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.20" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" + } + } + }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", diff --git a/packages/e2ee/package.json b/packages/e2ee/package.json index 33316ae8..3ed517a9 100644 --- a/packages/e2ee/package.json +++ b/packages/e2ee/package.json @@ -1,6 +1,6 @@ { "name": "@sora/e2ee", - "version": "2021.2.0-canary.3", + "version": "2021.1.0", "description": "WebRTC SFU Sora JavaScript E2EE Library", "author": "Shiguredo Inc.", "license": "Apache-2.0", @@ -28,6 +28,6 @@ "typescript": "^4.4.3" }, "dependencies": { - "@sora/go-wasm": "^2021.2.0-canary.3" + "@sora/go-wasm": "^2021.1.0" } } diff --git a/packages/go-wasm/package.json b/packages/go-wasm/package.json index e47a7d3c..b13bfde5 100644 --- a/packages/go-wasm/package.json +++ b/packages/go-wasm/package.json @@ -1,6 +1,6 @@ { "name": "@sora/go-wasm", - "version": "2021.2.0-canary.3", + "version": "2021.1.0", "main": "src/wasm_exec.js", "module": "src/wasm_exec.js", "types": "src/wasm_exec.d.ts", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index a7a716c1..64f7097b 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,15 +1,5 @@ { "name": "@sora/sdk", - "description": "WebRTC SFU Sora JavaScript SDK", - "version": "2021.2.0-canary.3", - "author": "Shiguredo Inc.", - "license": "Apache-2.0", - "main": "dist/sora.min.js", - "module": "dist/sora.mjs", - "types": "dist/sora.d.ts", - "files": [ - "dist" - ], "scripts": { "build": "rollup -c", "watch": "rollup -c -w", @@ -36,7 +26,7 @@ "typescript": "^4.4.3" }, "dependencies": { - "@sora/e2ee": "^2021.2.0-canary.3", "fflate": "^0.7.1" + "@sora/e2ee": "^2021.1.0", } } From e06a2576eb3bd765a7015fe5440cd83b69093521 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 28 Oct 2021 15:07:59 +0900 Subject: [PATCH 42/87] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=81=AE?= =?UTF-8?q?=E4=BB=95=E7=B5=84=E3=81=BF=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + packages/sdk/package.json | 4 ++-- packages/sdk/rollup.config.js | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 846e60bc..65c947af 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "module": "dist/sora.mjs", "types": "dist/sora.d.ts", "scripts": { + "build": "npm run build -w packages/e2ee && npm run build -w packages/sdk", "start": "npx serve -S -l 8080 ./example" }, "repository": { diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 64f7097b..6b9449a1 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -20,13 +20,13 @@ "jest": "^27.2.4", "prettier": "^2.4.1", "rollup": "^2.58.0", - "rollup-plugin-babel-minify": "^10.0.0", "rollup-plugin-typescript2": "^0.30.0", "ts-jest": "^27.0.5", "typescript": "^4.4.3" }, "dependencies": { - "fflate": "^0.7.1" "@sora/e2ee": "^2021.1.0", + "fflate": "^0.7.1", + "rollup-plugin-terser": "^7.0.2" } } diff --git a/packages/sdk/rollup.config.js b/packages/sdk/rollup.config.js index a34b07b7..2513a4d2 100644 --- a/packages/sdk/rollup.config.js +++ b/packages/sdk/rollup.config.js @@ -1,9 +1,9 @@ import commonjs from '@rollup/plugin-commonjs'; import resolve from '@rollup/plugin-node-resolve'; -import minify from 'rollup-plugin-babel-minify'; +import { terser } from 'rollup-plugin-terser'; import typescript from 'rollup-plugin-typescript2'; import replace from '@rollup/plugin-replace'; -import pkg from './package.json'; +import pkg from '../../package.json'; const banner = `/** * ${pkg.name} @@ -48,8 +48,10 @@ export default [ tsconfig: './tsconfig.json' }), commonjs(), - minify({ - comments: false + terser({ + output: { + comments: false, + }, }) ], output: { From d00063cadd9b019aa17d7dd0984aac95500ed8ae Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 28 Oct 2021 15:38:48 +0900 Subject: [PATCH 43/87] =?UTF-8?q?version=20=E6=9B=B4=E6=96=B0=E3=82=B3?= =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=83=89=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++++- scripts/versioning.sh | 26 +++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 65c947af..56efe8f5 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,11 @@ "types": "dist/sora.d.ts", "scripts": { "build": "npm run build -w packages/e2ee && npm run build -w packages/sdk", - "start": "npx serve -S -l 8080 ./example" + "start": "npx serve -S -l 8080 ./example", + "release:major": "./scripts/versioning.sh major", + "release:minor": "./scripts/versioning.sh minor", + "release:patch": "./scripts/versioning.sh patch", + "release:canary": "./scripts/versioning.sh canary" }, "repository": { "type": "git", diff --git a/scripts/versioning.sh b/scripts/versioning.sh index 99cfd794..5dcf817c 100755 --- a/scripts/versioning.sh +++ b/scripts/versioning.sh @@ -4,17 +4,29 @@ version=`cat ./package.json | jq -r -c ".version"` if [ $1 = "canary" ]; then if [[ ${version} =~ ^.*canary.*$ ]]; then - npx lerna version prerelease --preid canary --no-git-tag-version --tag-version-prefix ''; + npm version prerelease --preid canary --no-git-tag-version; else - npx lerna version preminor --preid canary --no-git-tag-version --tag-version-prefix ''; + npm version preminor --preid canary --no-git-tag-version; fi elif [ $1 = "major" ]; then - npx lerna version major --no-git-tag-version --tag-version-prefix ''; + npm version major --no-git-tag-version --tag-version-prefix ''; elif [ $1 = "minor" ]; then - npx lerna version minor --no-git-tag-version --tag-version-prefix ''; + npm version minor --no-git-tag-version --tag-version-prefix ''; elif [ $1 = "patch" ]; then - npx lerna version patch --no-git-tag-version --tag-version-prefix ''; + npm version patch --no-git-tag-version --tag-version-prefix ''; fi -next_version=`cat ./lerna.json | jq -r -c ".version"` -npm version ${next_version} --git-tag-version false; +next_version=`cat ./package.json | jq -r -c ".version"` + +echo "Next version is '${next_version}'" +read -p "Do you wish to git commit and tag this version? (y/n)" answer +echo $answer +case $answer in + "" | "Y" | "y" | "yes" | "Yes" | "YES" ) + npm run build + git add . + git commit -m "${next_version}" + git tag ${next_version} + ;; + * ) exit 0;; +esac From 1d644944326943f86e15c4f4c7ec2ddcd347731e Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 28 Oct 2021 16:28:51 +0900 Subject: [PATCH 44/87] =?UTF-8?q?=E5=90=84=E7=A8=AE=E3=82=B3=E3=83=9E?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 9 ++++++--- packages/sdk/jest.config.js | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 56efe8f5..48e9a406 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,10 @@ "module": "dist/sora.mjs", "types": "dist/sora.d.ts", "scripts": { - "build": "npm run build -w packages/e2ee && npm run build -w packages/sdk", + "build": "npm run build --workspaces", + "lint": "npm run lint --workspaces", + "fmt": "npm run fmt --workspaces", + "test": "npm run test --workspaces", "start": "npx serve -S -l 8080 ./example", "release:major": "./scripts/versioning.sh major", "release:minor": "./scripts/versioning.sh minor", @@ -34,8 +37,8 @@ "get-pkg-repo": "4.1.2" }, "workspaces": [ - "packages/sdk", + "packages/go-wasm", "packages/e2ee", - "packages/go-wasm" + "packages/sdk" ] } diff --git a/packages/sdk/jest.config.js b/packages/sdk/jest.config.js index 0cc5fc3b..c3d7216c 100644 --- a/packages/sdk/jest.config.js +++ b/packages/sdk/jest.config.js @@ -1,5 +1,6 @@ // For a detailed explanation regarding each configuration property, visit: // https://jestjs.io/docs/en/configuration.html +const path = require('path'); module.exports = { // All imported modules in your tests should be mocked automatically @@ -58,8 +59,11 @@ module.exports = { // globalTeardown: undefined, // A set of global variables that need to be available in all test environments - // globals: { - // }, + globals: { + "ts-jest": { + "tsconfig": path.join(__dirname, "tsconfig.json") + } + }, // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. // maxWorkers: "50%", @@ -113,7 +117,7 @@ module.exports = { // restoreMocks: false, // The root directory that Jest should scan for tests and modules within - // rootDir: undefined, + rootDir: path.join(__dirname, "../../"), // A list of paths to directories that Jest should use to search for files in // roots: [ From c37f6671db19eae328185f265398b63c41f03226 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 29 Oct 2021 15:31:55 +0900 Subject: [PATCH 45/87] =?UTF-8?q?GitHub=20Actions=20=E3=81=AE=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yaml | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f78d185d..c8fba8b5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,33 +12,25 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: ['12', '14', '15', '16'] + node: ['16'] steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install - - run: yarn bootstrap - - run: yarn build - - run: yarn lint - - run: yarn test + cache: npm + - run: npm --version + - run: npm install + - run: npm run build -w packages/e2ee + - run: npm run build -w packages/sdk + - run: npm run lint -w packages/e2ee + - run: npm run lint -w packages/sdk + - run: npm run test -w packages/sdk - name: Slack Notification if: failure() uses: rtCamp/action-slack-notify@v2.1.0 env: - SLACK_CHANNEL: sora-demo + SLACK_CHANNEL: sora-devtools SLACK_COLOR: danger SLACK_TITLE: Failure test SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} From 79099ae78c28f8a2895adf3c5da640d64ab9c61c Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 29 Oct 2021 16:04:36 +0900 Subject: [PATCH 46/87] =?UTF-8?q?CHANGES=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 2780b975..41e599eb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,9 +10,12 @@ - バグ修正 ## develop +- [CHANGE] 複数パッケージの管理を lerna から npm workspace に変更する + - @yuitowest - [ADD] DataChannel メッセージング機能を追加する - sendrecv オブジェクトに sendMessage API を追加する - on callback に "message" を追加する + - @yuitowest - [CHANGE] 複数 Signaling URL への接続に対応する - Connection オブジェクト第一引数の type を `string` から `string | string[]` に変更する - Connection オブジェクト signalingUrl プロパティの戻り値の type を `string` から `string | string[]` に変更する From 595cb4add7dd5eab79e4cd075d565a19122f4f8d Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 29 Oct 2021 16:33:34 +0900 Subject: [PATCH 47/87] =?UTF-8?q?=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEVELOPMENT.md | 35 ++++++++++++++++++++--------------- RELEASE.md | 27 +++++++++++++-------------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 1f5d6985..28cb3221 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -4,31 +4,36 @@ ## 開発環境 +- Node.js + - v16.13.0 以上 - npm - - v6.9.0 以上 -- yarn - - v1.16.0 以上 -- yarn install + - v8.1.0 以上 +- npm install - これで事前に利用するライブラリをインストールする ## 開発準備 -- `yarn install` を実行 -- `yarn bootstrap` を実行して packages 以下の各パッケージで依存関係をインストール -- `yarn start` でローカルサーバを起動する +**lerna でパッケージ管理していた時代に yarn install した状態の場合はトップディレクトリと packages 以下のすべての node_modules を削除すること** + +- `npm install` を実行 +- `npm run start` でローカルサーバを起動する ## 開発 sora-js-sdk のトップディレクトリでコマンドを実行することによりビルドやフォーマットを行う -- `yarn build` packages 以下をビルドする -- `yarn lint` packages 以下のコードに lint を実行する -- `yarn fmt` packages 以下のコードに formatter を実行する -- `yarn test` packages 以下のテストを実行する + +- `npm run build` packages 以下をビルドする +- `npm run lint` packages 以下のコードに lint を実行する +- `npm run fmt` packages 以下のコードに formatter を実行する +- `npm run test` packages 以下のテストを実行する ## パッケージ更新 sora-js-sdk の package 更新 -- `yarn upgrade` を実行する +- `npx ncu -u` を実行する +- `npm update` を実行する sora-js-sdk/packages の package 更新 -- `yarn packages:upgrade` を実行する -- `yarn test` を実行する -- `yarn build` を実行する +- `npx --workspaces ncu -u` を実行する +- `npm update` を実行する +- `npm run build` を実行する +- `npm run lint` を実行する +- `npm run test` を実行する diff --git a/RELEASE.md b/RELEASE.md index 12f1d4fc..8ff0d407 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,32 +4,31 @@ ## リリース環境 +- Node.js + - v16.13.0 以上 - npm - - v6.9.0 以上 -- yarn - - v1.16.0 以上 -- yarn install + - v8.1.0 以上 +- npm install - これで事前に利用するライブラリをインストールする - ## リリース手順 - git flow release start で開始する - CHANGES.md にタグを打つバージョンで書き込む -- yarn lint を実行する -- yarn test を実行する -- yarn release:minor を実行する - - minor バージョンが更新されていることを確認する - - 差分をコミットする +- npm run lint を実行する +- npm run test を実行する +- npm run release:minor を実行する + - Next version を確認する + - コミットメッセージをにして差分をコミットする(例. git commit -m "2020.2.0") - git flow release finish で終了する - git push -u origin develop master --tags ## canary リリース手順 -- yarn lint を実行する -- yarn test を実行する -- yarn release:canary を実行する - - canary バージョンが更新されていることを確認する +- npm run lint を実行する +- npm run test を実行する +- npm run release:canary を実行する + - Next version を確認する - コミットメッセージをバージョンにして差分をコミットする(例. git commit -m "2020.1.0-canary.0") - git push -u origin develop --tags From 2d9a454db2eadd15d3000c8fbfad61f1e2323747 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 1 Nov 2021 10:13:16 +0900 Subject: [PATCH 48/87] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E6=9B=B4=E6=96=B0=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/versioning.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/scripts/versioning.sh b/scripts/versioning.sh index 5dcf817c..aa1bd251 100755 --- a/scripts/versioning.sh +++ b/scripts/versioning.sh @@ -2,30 +2,43 @@ version=`cat ./package.json | jq -r -c ".version"` + if [ $1 = "canary" ]; then if [[ ${version} =~ ^.*canary.*$ ]]; then - npm version prerelease --preid canary --no-git-tag-version; + npm version prerelease --preid canary --no-git-tag-version > /dev/null; else - npm version preminor --preid canary --no-git-tag-version; + npm version preminor --preid canary --no-git-tag-version > /dev/null; fi elif [ $1 = "major" ]; then - npm version major --no-git-tag-version --tag-version-prefix ''; + npm version major --no-git-tag-version > /dev/null; elif [ $1 = "minor" ]; then - npm version minor --no-git-tag-version --tag-version-prefix ''; + npm version minor --no-git-tag-version > /dev/null; elif [ $1 = "patch" ]; then - npm version patch --no-git-tag-version --tag-version-prefix ''; + npm version patch --no-git-tag-version > /dev/null; +else + exit 1; fi +echo "==== sora-js-sdk@${version} $1 update ====" + next_version=`cat ./package.json | jq -r -c ".version"` echo "Next version is '${next_version}'" -read -p "Do you wish to git commit and tag this version? (y/n)" answer -echo $answer -case $answer in +echo "" +read -p "Do you wish to run 'git commit -m \"${next_version}\"'? (y/n) " commit +case $commit in "" | "Y" | "y" | "yes" | "Yes" | "YES" ) npm run build git add . git commit -m "${next_version}" + ;; + * ) exit 0;; +esac + +echo "" +read -p "Do you wish to run 'git tag ${next_version}'? (y/n) " tag +case $tag in + "" | "Y" | "y" | "yes" | "Yes" | "YES" ) git tag ${next_version} ;; * ) exit 0;; From 52354e5f374f6ba5fc72d39d26b45cc52061142f Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 1 Nov 2021 10:28:47 +0900 Subject: [PATCH 49/87] 2021.2.0-canary.4 --- dist/base.d.ts | 447 ++++++++++++++++++++++++++++++++++++++++- dist/helpers.d.ts | 9 + dist/sora.d.ts | 82 ++++++++ dist/sora.js | 468 +++++++++++++++++++++++++++++++++++++++++-- dist/sora.min.js | 8 +- dist/sora.min.js.map | 2 +- dist/sora.mjs | 468 +++++++++++++++++++++++++++++++++++++++++-- package-lock.json | 4 +- package.json | 2 +- 9 files changed, 1451 insertions(+), 39 deletions(-) diff --git a/dist/base.d.ts b/dist/base.d.ts index 466f3c4e..ceca45fa 100644 --- a/dist/base.d.ts +++ b/dist/base.d.ts @@ -5,110 +5,553 @@ declare global { namedCurve: string; } } +/** + * Sora との WebRTC 接続を扱う基底クラス + * + * @param signalingUrlCandidates - シグナリングに使用する URL の候補 + * @param role - ロール + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * @param debug - デバッグフラグ + */ export default class ConnectionBase { + /** + * ロール(sendonly | sendrecv | recvonly) + */ role: string; + /** + * チャネルID + */ channelId: string; + /** + * メタデータ + */ metadata: JSONType | undefined; + /** + * シグナリングに使用する URL 候補 + */ signalingUrlCandidates: string | string[]; + /** + * 接続オプション + */ options: ConnectionOptions; + /** + * PeerConnection に渡す configuration + */ constraints: any; + /** + * デバッグフラグ + */ debug: boolean; + /** + * クライアントID + */ clientId: string | null; + /** + * コネクションID + */ connectionId: string | null; + /** + * リモートコネクションIDのリスト + */ remoteConnectionIds: string[]; + /** + * メディアストリーム + */ stream: MediaStream | null; + /** + * type offer に含まれる認証 metadata + */ authMetadata: JSONType; + /** + * PeerConnection インスタンス + */ pc: RTCPeerConnection | null; + /** + * サイマルキャストで使用する RTCRtpEncodingParameters のリスト + */ encodings: RTCRtpEncodingParameters[]; + /** + * WebSocket インスタンス + */ protected ws: WebSocket | null; + /** + * イベントコールバックのリスト + */ protected callbacks: Callbacks; + /** + * E2EE インスタンス + */ protected e2ee: SoraE2EE | null; + /** + * 初回シグナリング時接続タイムアウト用のタイマーID + */ protected connectionTimeoutTimerId: number; + /** + * WebSocket 切断監視用のタイマーID + */ protected monitorSignalingWebSocketEventTimerId: number; + /** + * PeerConnection state 切断監視用のタイマーID + */ protected monitorIceConnectionStateChangeTimerId: number; + /** + * 接続中の DataChannel リスト + */ protected dataChannels: { [key in string]?: RTCDataChannel; }; + /** + * 初回シグナリング接続時のタイムアウトに使用するタイムアウト時間(デフォルト 60000ms) + */ private connectionTimeout; + /** + * シグナリング候補のURLへの接続確認タイムアウトに使用するタイムアウト時間(デフォルト 3000ms) + */ private signalingCandidateTimeout; + /** + * 切断処理のタイムアウトに使用するタイムアウト時間(デフォルト 3000ms) + */ private disconnectWaitTimeout; + /** + * audio / video の msid + */ private mids; + /** + * シグナリングを DataChannel へ switch したかどうかのフラグ + */ private signalingSwitched; + /** + * シグナリング type offer に含まれる DataChannel レコード + */ private signalingOfferMessageDataChannels; constructor(signalingUrlCandidates: string | string[], role: string, channelId: string, metadata: JSONType, options: ConnectionOptions, debug: boolean); + /** + * SendRecv Object で発火するイベントのコールバックを設定するメソッド + * + * @remarks + * addstream イベントは非推奨です.track イベントを使用してください + * + * removestream イベントは非推奨です.removetrack イベントを使用してください + * + * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message) + * @param callback - コールバック関数 + * + * @public + */ on(kind: T, callback: U): void; + /** + * audio track を停止するメソッド + * + * @remarks + * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します + * + * @param stream - audio track を削除する MediaStream + * + * @public + */ stopAudioTrack(stream: MediaStream): Promise; + /** + * video track を停止するメソッド + * + * @remarks + * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します + * + * @param stream - video track を削除する MediaStream + * + * @public + */ stopVideoTrack(stream: MediaStream): Promise; + /** + * audio track を入れ替えするメソッド + * + * @remarks + * stream の audio track を停止後、新しい audio track をセットします + * + * @param stream - audio track を削除する MediaStream + * @param audioTrack - 新しい audio track + * + * @public + */ replaceAudioTrack(stream: MediaStream, audioTrack: MediaStreamTrack): Promise; + /** + * video track を入れ替えするメソッド + * + * @remarks + * stream の video track を停止後、新しい video track をセットします + * + * @param stream - video track を削除する MediaStream + * @param videoTrack - 新しい video track + * + * @public + */ replaceVideoTrack(stream: MediaStream, videoTrack: MediaStreamTrack): Promise; + /** + * stream を停止するメソッド + */ private stopStream; /** - * connect 処理中に例外が発生した場合の切断処理 + * connect 処理中に例外が発生した場合の切断処理をするメソッド */ private signalingTerminate; /** - * PeerConnection の state に異常が発生した場合の切断処理 + * PeerConnection の state に異常が発生した場合の切断処理をするメソッド + * + * @param title - disconnect callback に渡すイベントのタイトル */ private abendPeerConnectionState; /** * 何かしらの異常があった場合の切断処理 + * + * @param title - disconnect callback に渡すイベントのタイトル + * @param params - 切断時の状況を入れる Record */ private abend; + /** + * 接続状態の初期化をするメソッド + */ private initializeConnection; + /** + * WebSocket を切断するメソッド + * + * @remarks + * 正常/異常どちらの切断でも使用する + * + * @param title - type disconnect 時の reason + */ private disconnectWebSocket; + /** + * DataChannel を切断するメソッド + * + * @remarks + * 正常/異常どちらの切断でも使用する + */ private disconnectDataChannel; + /** + * PeerConnection を切断するメソッド + * + * @remarks + * 正常/異常どちらの切断でも使用する + */ private disconnectPeerConnection; + /** + * 切断処理をするメソッド + * + * @public + */ disconnect(): Promise; + /** + * E2EE の初期設定をするメソッド + */ protected setupE2EE(): void; + /** + * E2EE を開始するメソッド + */ protected startE2EE(): void; + /** + * シグナリングに使う WebSocket インスタンスを作成するメソッド + * + * @remarks + * シグナリング候補の URL 一覧に順に接続します + * + * 接続できた URL がない場合は例外が発生します + * + * @param signalingUrlCandidates - シグナリング候補の URL. 後方互換のため string | string[] を受け取る + * + * @returns + * 接続できた WebScoket インスタンスを返します + */ protected getSignalingWebSocket(signalingUrlCandidates: string | string[]): Promise; + /** + * シグナリング処理を行うメソッド + * + * @remarks + * シグナリング候補の URL 一覧に順に接続します + * + * 接続できた URL がない場合は例外が発生します + * + * @param ws - WebSocket インスタンス + * @param redirect - クラスター接続時にリダイレクトされた場合のフラグ + * + * @returns + * Sora から受け取った type offer メッセージを返します + */ protected signaling(ws: WebSocket, redirect?: boolean): Promise; + /** + * PeerConnection 接続処理をするメソッド + * + * @param message - シグナリング処理で受け取った type offer メッセージ + */ protected connectPeerConnection(message: SignalingOfferMessage): Promise; + /** + * setRemoteDescription 処理を行うメソッド + * + * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ + */ protected setRemoteDescription(message: SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage): Promise; + /** + * createAnswer 処理を行うメソッド + * + * @remarks + * サイマルキャスト用の setParameters 処理もここで行う + * + * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ + */ protected createAnswer(message: SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage): Promise; + /** + * シグナリングサーバーに type answer を投げるメソッド + */ protected sendAnswer(): void; + /** + * iceCnadidate 処理をするメソッド + */ protected onIceCandidate(): Promise; + /** + * connectionState が "connected" になるのを監視するメソッド + * + * @remarks + * PeerConnection.connectionState が実装されていない場合は何もしない + */ protected waitChangeConnectionStateConnected(): Promise; + /** + * 初回シグナリング接続時の WebSocket の切断を監視するメソッド + * + * @remarks + * 意図しない切断があった場合には異常終了処理を実行する + */ protected monitorSignalingWebSocketEvent(): Promise; + /** + * WebSocket の切断を監視するメソッド + * + * @remarks + * 意図しない切断があった場合には異常終了処理を実行する + */ protected monitorWebSocketEvent(): void; + /** + * 初回シグナリング後 PeerConnection の state を監視するメソッド + * + * @remarks + * connectionState, iceConnectionState を監視して不正な場合に切断する + */ protected monitorPeerConnectionState(): void; + /** + * 初回シグナリングの接続タイムアウト処理をするメソッド + */ protected setConnectionTimeout(): Promise; + /** + * setConnectionTimeout でセットしたタイマーを止めるメソッド + */ protected clearConnectionTimeout(): void; + /** + * monitorSignalingWebSocketEvent でセットしたタイマーを止めるメソッド + */ protected clearMonitorSignalingWebSocketEvent(): void; + /** + * monitorPeerConnectionState でセットしたタイマーを止めるメソッド + */ protected clearMonitorIceConnectionStateChange(): void; + /** + * trace log を出力するメソッド + * + * @param title - ログのタイトル + * @param message - ログの本文 + */ protected trace(title: string, message: unknown): void; + /** + * WebSocket のシグナリングログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeWebSocketSignalingLog(eventType: string, data?: unknown): void; + /** + * DataChannel のシグナリングログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeDataChannelSignalingLog(eventType: string, channel: RTCDataChannel, data?: unknown): void; + /** + * WebSocket のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeWebSocketTimelineLog(eventType: string, data?: unknown): void; + /** + * DataChannel のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeDataChannelTimelineLog(eventType: string, channel: RTCDataChannel, data?: unknown): void; + /** + * PeerConnection のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writePeerConnectionTimelineLog(eventType: string, data?: unknown): void; + /** + * Sora との接続のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ protected writeSoraTimelineLog(eventType: string, data?: unknown): void; + /** + * createOffer 処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + * + * @returns + * 生成した RTCSessionDescription を返します + */ private createOffer; + /** + * シグナリングサーバーから受け取った type e2ee メッセージを処理をするメソッド + * + * @param data - E2EE 用バイナリメッセージ + */ private signalingOnMessageE2EE; + /** + * シグナリングサーバーから受け取った type offer メッセージを処理をするメソッド + * + * @param message - type offer メッセージ + */ private signalingOnMessageTypeOffer; + /** + * シグナリングサーバーに type update を投げるメソッド + */ private sendUpdateAnswer; + /** + * シグナリングサーバーに type re-answer を投げるメソッド + */ private sendReAnswer; + /** + * シグナリングサーバーから受け取った type update メッセージを処理をするメソッド + * + * @param message - type update メッセージ + */ private signalingOnMessageTypeUpdate; + /** + * シグナリングサーバーから受け取った type re-offer メッセージを処理をするメソッド + * + * @param message - type re-offer メッセージ + */ private signalingOnMessageTypeReOffer; + /** + * シグナリングサーバーから受け取った type ping メッセージを処理をするメソッド + * + * @param message - type ping メッセージ + */ private signalingOnMessageTypePing; + /** + * シグナリングサーバーから受け取った type notify メッセージを処理をするメソッド + * + * @param message - type notify メッセージ + */ private signalingOnMessageTypeNotify; + /** + * シグナリングサーバーから受け取った type switched メッセージを処理をするメソッド + * + * @param message - type switched メッセージ + */ private signalingOnMessageTypeSwitched; + /** + * シグナリングサーバーから受け取った type redirect メッセージを処理をするメソッド + * + * @param message - type redirect メッセージ + */ private signalingOnMessageTypeRedirect; + /** + * sender の parameters に encodings をセットするメソッド + * + * @remarks + * サイマルキャスト用の処理 + */ private setSenderParameters; + /** + * PeerConnection から RTCStatsReport を取得するためのメソッド + */ private getStats; + /** + * PeerConnection の ondatachannel callback メソッド + * + * @param dataChannelEvent - DataChannel イベント + */ private onDataChannel; + /** + * シグナリングサーバーへメッセージを送信するメソッド + * + * @param message - 送信するメッセージ + */ private sendSignalingMessage; + /** + * シグナリングサーバーに E2E 用メッセージを投げるメソッド + * + * @param message - 送信するバイナリメッセージ + */ private sendE2EEMessage; + /** + * シグナリングサーバーに stats メッセージを投げるメソッド + * + * @param reports - RTCStatsReport のリスト + */ private sendStatsMessage; + /** + * audio transceiver を取得するメソッド + */ private getAudioTransceiver; + /** + * video transceiver を取得するメソッド + */ private getVideoTransceiver; + /** + * disconnect callback に渡す Event オブジェクトを生成するためのメソッド + * + * @param type - Event タイプ(normal | abend) + * @param title - Event タイトル + * @param initDict - Event に設定するオプションパラメーター + */ private soraCloseEvent; + /** + * DataChannel を使用してメッセージを送信するメソッド + * + * @param label - メッセージを送信する DataChannel のラベル + * @param message - JSON + */ sendMessage(label: string, message: JSONType): void; + /** + * E2EE の自分のフィンガープリント + */ get e2eeSelfFingerprint(): string | undefined; + /** + * E2EE のリモートのフィンガープリントリスト + */ get e2eeRemoteFingerprints(): Record | undefined; + /** + * audio が有効かどうか + */ get audio(): boolean; + /** + * video が有効かどうか + */ get video(): boolean; + /** + * シグナリングに使用する URL + * + * @deprecated + */ get signalingUrl(): string | string[]; + /** + * 接続中のシグナリング URL + */ get connectedSignalingUrl(): string; + /** + * DataChannel メッセージング用の DataChannel 情報のリスト + */ get messagingDataChannels(): DataChannelConfiguration[]; } diff --git a/dist/helpers.d.ts b/dist/helpers.d.ts index 0e549f14..a74eb59c 100644 --- a/dist/helpers.d.ts +++ b/dist/helpers.d.ts @@ -1,2 +1,11 @@ +/** + * MediaStream の constraints を動的に変更するメソッド. + * + * @param mediastream - メディアストリーム + * + * @param constraints - メディアストリーム制約 + * + * @public + */ declare function applyMediaStreamConstraints(mediastream: MediaStream, constraints: MediaStreamConstraints): Promise; export { applyMediaStreamConstraints }; diff --git a/dist/sora.d.ts b/dist/sora.d.ts index be671bf6..fcc8dfd5 100644 --- a/dist/sora.d.ts +++ b/dist/sora.d.ts @@ -3,22 +3,104 @@ import ConnectionPublisher from "./publisher"; import ConnectionSubscriber from "./subscriber"; import { applyMediaStreamConstraints } from "./helpers"; import type { AudioCodecType, Callbacks, ConnectionOptions, JSONType, DataChannelConfiguration, DataChannelDirection, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; +/** + * Role 毎の Connection インスタンスを生成するためのクラス + * + * @param signalingUrlCandidates - シグナリングに使用する URL の候補 + * @param debug - デバッグフラグ + */ declare class SoraConnection { + /** + * シグナリングに使用する URL の候補 + */ signalingUrlCandidates: string | string[]; + /** + * デバッグフラグ + */ debug: boolean; constructor(signalingUrlCandidates: string | string[], debug?: boolean); + /** + * role sendrecv で接続するための Connecion インスタンスを生成するメソッド + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role sendrecv な Connection オブジェクトを返します + * + * @public + */ sendrecv(channelId: string, metadata?: JSONType, options?: ConnectionOptions): ConnectionPublisher; + /** + * role sendonly で接続するための Connecion インスタンスを生成するメソッド + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role sendonly な Connection オブジェクトを返します + * + * @public + */ sendonly(channelId: string, metadata?: JSONType, options?: ConnectionOptions): ConnectionPublisher; + /** + * role recvonly で接続するための Connecion インスタンスを生成するメソッド + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role recvonly な Connection オブジェクトを返します + * + * @public + */ recvonly(channelId: string, metadata?: JSONType, options?: ConnectionOptions): ConnectionSubscriber; + /** + * シグナリングに使用する URL の候補 + * + * @public + * @deprecated + */ get signalingUrl(): string | string[]; } declare const _default: { + /** + * E2EE で使用する WASM の読み込みを行うメソッド + * + * @param wasmUrl - E2EE WASM の URL + * + * @public + */ initE2EE: (wasmUrl: string) => Promise; + /** + * SoraConnection インスタンスを生成するメソッド + * + * @param wasmUrl - シグナリングに使用する URL 候補 + * @param debug - デバッグフラグ + * + * @public + */ connection: (signalingUrlCandidates: string | string[], debug?: boolean) => SoraConnection; + /** + * SDK のバージョンを返すメソッド + * + * @public + */ version: () => string; + /** + * WebRTC のユーティリティ関数群 + * + * @public + */ helpers: { applyMediaStreamConstraints: typeof applyMediaStreamConstraints; }; }; +/** + * Sora JS SDK package + */ export default _default; export type { AudioCodecType, Callbacks, ConnectionBase, ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, DataChannelConfiguration, DataChannelDirection, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SoraConnection, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType, }; diff --git a/dist/sora.js b/dist/sora.js index 2cb4c4bd..9b8a27f6 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** - * @sora/sdk + * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.3 + * @version: 2021.2.0-canary.4 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -604,7 +604,7 @@ /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.2.0-canary.3 + * @version: 2021.1.0 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -772,7 +772,7 @@ } } static version() { - return "2021.2.0-canary.3"; + return "2021.1.0"; } static wasmVersion() { return window.e2ee.version(); @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.3", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.4", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1931,6 +1931,16 @@ return event; } + /** + * Sora との WebRTC 接続を扱う基底クラス + * + * @param signalingUrlCandidates - シグナリングに使用する URL の候補 + * @param role - ロール + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * @param debug - デバッグフラグ + */ class ConnectionBase { constructor(signalingUrlCandidates, role, channelId, metadata, options, debug) { this.role = role; @@ -1993,6 +2003,19 @@ this.signalingSwitched = false; this.signalingOfferMessageDataChannels = {}; } + /** + * SendRecv Object で発火するイベントのコールバックを設定するメソッド + * + * @remarks + * addstream イベントは非推奨です.track イベントを使用してください + * + * removestream イベントは非推奨です.removetrack イベントを使用してください + * + * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message) + * @param callback - コールバック関数 + * + * @public + */ on(kind, callback) { // @deprecated message if (kind === "addstream") { @@ -2005,6 +2028,16 @@ this.callbacks[kind] = callback; } } + /** + * audio track を停止するメソッド + * + * @remarks + * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します + * + * @param stream - audio track を削除する MediaStream + * + * @public + */ stopAudioTrack(stream) { for (const track of stream.getAudioTracks()) { track.enabled = false; @@ -2028,6 +2061,16 @@ }, 100); }); } + /** + * video track を停止するメソッド + * + * @remarks + * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します + * + * @param stream - video track を削除する MediaStream + * + * @public + */ stopVideoTrack(stream) { for (const track of stream.getVideoTracks()) { track.enabled = false; @@ -2051,6 +2094,17 @@ }, 100); }); } + /** + * audio track を入れ替えするメソッド + * + * @remarks + * stream の audio track を停止後、新しい audio track をセットします + * + * @param stream - audio track を削除する MediaStream + * @param audioTrack - 新しい audio track + * + * @public + */ async replaceAudioTrack(stream, audioTrack) { await this.stopAudioTrack(stream); const transceiver = this.getAudioTransceiver(); @@ -2060,6 +2114,17 @@ stream.addTrack(audioTrack); await transceiver.sender.replaceTrack(audioTrack); } + /** + * video track を入れ替えするメソッド + * + * @remarks + * stream の video track を停止後、新しい video track をセットします + * + * @param stream - video track を削除する MediaStream + * @param videoTrack - 新しい video track + * + * @public + */ async replaceVideoTrack(stream, videoTrack) { await this.stopVideoTrack(stream); const transceiver = this.getVideoTransceiver(); @@ -2069,6 +2134,9 @@ stream.addTrack(videoTrack); await transceiver.sender.replaceTrack(videoTrack); } + /** + * stream を停止するメソッド + */ stopStream() { return new Promise((resolve, _) => { if (this.debug) { @@ -2085,7 +2153,7 @@ }); } /** - * connect 処理中に例外が発生した場合の切断処理 + * connect 処理中に例外が発生した場合の切断処理をするメソッド */ async signalingTerminate() { await this.stopStream(); @@ -2109,7 +2177,9 @@ this.initializeConnection(); } /** - * PeerConnection の state に異常が発生した場合の切断処理 + * PeerConnection の state に異常が発生した場合の切断処理をするメソッド + * + * @param title - disconnect callback に渡すイベントのタイトル */ async abendPeerConnectionState(title) { this.clearMonitorIceConnectionStateChange(); @@ -2170,6 +2240,9 @@ } /** * 何かしらの異常があった場合の切断処理 + * + * @param title - disconnect callback に渡すイベントのタイトル + * @param params - 切断時の状況を入れる Record */ async abend(title, params) { this.clearMonitorIceConnectionStateChange(); @@ -2259,6 +2332,9 @@ this.writeSoraTimelineLog("disconnect-abend", event); this.callbacks.disconnect(this.soraCloseEvent("abend", title, params)); } + /** + * 接続状態の初期化をするメソッド + */ initializeConnection() { this.clientId = null; this.connectionId = null; @@ -2278,6 +2354,14 @@ this.signalingOfferMessageDataChannels = {}; this.clearConnectionTimeout(); } + /** + * WebSocket を切断するメソッド + * + * @remarks + * 正常/異常どちらの切断でも使用する + * + * @param title - type disconnect 時の reason + */ disconnectWebSocket(title) { let timerId = 0; if (this.signalingSwitched) { @@ -2321,6 +2405,12 @@ } }); } + /** + * DataChannel を切断するメソッド + * + * @remarks + * 正常/異常どちらの切断でも使用する + */ disconnectDataChannel() { // DataChannel の強制終了処理 const closeDataChannels = () => { @@ -2424,6 +2514,12 @@ } }); } + /** + * PeerConnection を切断するメソッド + * + * @remarks + * 正常/異常どちらの切断でも使用する + */ disconnectPeerConnection() { return new Promise((resolve, _) => { if (this.pc && this.pc.connectionState !== "closed") { @@ -2432,6 +2528,11 @@ return resolve(); }); } + /** + * 切断処理をするメソッド + * + * @public + */ async disconnect() { this.clearMonitorIceConnectionStateChange(); await this.stopStream(); @@ -2498,6 +2599,9 @@ this.callbacks.disconnect(event); } } + /** + * E2EE の初期設定をするメソッド + */ setupE2EE() { if (this.options.e2ee === true) { this.e2ee = new SoraE2EE(); @@ -2507,6 +2611,9 @@ this.e2ee.startWorker(); } } + /** + * E2EE を開始するメソッド + */ startE2EE() { if (this.options.e2ee === true && this.e2ee) { if (!this.connectionId) { @@ -2519,6 +2626,19 @@ this.e2ee.postSelfSecretKeyMaterial(this.connectionId, result.selfKeyId, result.selfSecretKeyMaterial); } } + /** + * シグナリングに使う WebSocket インスタンスを作成するメソッド + * + * @remarks + * シグナリング候補の URL 一覧に順に接続します + * + * 接続できた URL がない場合は例外が発生します + * + * @param signalingUrlCandidates - シグナリング候補の URL. 後方互換のため string | string[] を受け取る + * + * @returns + * 接続できた WebScoket インスタンスを返します + */ async getSignalingWebSocket(signalingUrlCandidates) { if (typeof signalingUrlCandidates === "string") { // signaling url の候補が文字列の場合 @@ -2625,6 +2745,20 @@ } throw new ConnectError("Signaling failed. Invalid format signaling URL candidates"); } + /** + * シグナリング処理を行うメソッド + * + * @remarks + * シグナリング候補の URL 一覧に順に接続します + * + * 接続できた URL がない場合は例外が発生します + * + * @param ws - WebSocket インスタンス + * @param redirect - クラスター接続時にリダイレクトされた場合のフラグ + * + * @returns + * Sora から受け取った type offer メッセージを返します + */ async signaling(ws, redirect = false) { const offer = await this.createOffer(); this.trace("CREATE OFFER", offer); @@ -2710,6 +2844,11 @@ })(); }); } + /** + * PeerConnection 接続処理をするメソッド + * + * @param message - シグナリング処理で受け取った type offer メッセージ + */ async connectPeerConnection(message) { let config = Object.assign({}, message.config); if (this.e2ee) { @@ -2757,6 +2896,11 @@ }; return; } + /** + * setRemoteDescription 処理を行うメソッド + * + * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ + */ async setRemoteDescription(message) { if (!this.pc) { return; @@ -2766,6 +2910,14 @@ this.writePeerConnectionTimelineLog("set-remote-description", sessionDescription); return; } + /** + * createAnswer 処理を行うメソッド + * + * @remarks + * サイマルキャスト用の setParameters 処理もここで行う + * + * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ + */ async createAnswer(message) { if (!this.pc) { return; @@ -2805,6 +2957,9 @@ this.writePeerConnectionTimelineLog("set-local-description", sessionDescription); return; } + /** + * シグナリングサーバーに type answer を投げるメソッド + */ sendAnswer() { if (this.pc && this.ws && this.pc.localDescription) { this.trace("ANSWER SDP", this.pc.localDescription.sdp); @@ -2814,6 +2969,9 @@ } return; } + /** + * iceCnadidate 処理をするメソッド + */ onIceCandidate() { return new Promise((resolve, _) => { if (this.pc) { @@ -2849,6 +3007,12 @@ } }); } + /** + * connectionState が "connected" になるのを監視するメソッド + * + * @remarks + * PeerConnection.connectionState が実装されていない場合は何もしない + */ waitChangeConnectionStateConnected() { return new Promise((resolve, reject) => { // connectionState が存在しない場合はそのまま抜ける @@ -2870,8 +3034,13 @@ }, 10); }); } + /** + * 初回シグナリング接続時の WebSocket の切断を監視するメソッド + * + * @remarks + * 意図しない切断があった場合には異常終了処理を実行する + */ monitorSignalingWebSocketEvent() { - // シグナリング時に意図しない WebSocket の切断を監視する return new Promise((_, reject) => { this.monitorSignalingWebSocketEventTimerId = setInterval(() => { if (!this.ws) { @@ -2895,8 +3064,13 @@ }, 100); }); } + /** + * WebSocket の切断を監視するメソッド + * + * @remarks + * 意図しない切断があった場合には異常終了処理を実行する + */ monitorWebSocketEvent() { - // 接続後の意図しない WebSocket の切断を監視する if (!this.ws) { return; } @@ -2909,8 +3083,13 @@ await this.abend("WEBSOCKET-ONERROR"); }; } + /** + * 初回シグナリング後 PeerConnection の state を監視するメソッド + * + * @remarks + * connectionState, iceConnectionState を監視して不正な場合に切断する + */ monitorPeerConnectionState() { - // PeerConnection の ConnectionState, iceConnectionState を監視して不正な場合に切断する if (!this.pc) { return; } @@ -2951,6 +3130,9 @@ } }; } + /** + * 初回シグナリングの接続タイムアウト処理をするメソッド + */ setConnectionTimeout() { return new Promise((_, reject) => { if (0 < this.connectionTimeout) { @@ -2971,15 +3153,30 @@ } }); } + /** + * setConnectionTimeout でセットしたタイマーを止めるメソッド + */ clearConnectionTimeout() { clearTimeout(this.connectionTimeoutTimerId); } + /** + * monitorSignalingWebSocketEvent でセットしたタイマーを止めるメソッド + */ clearMonitorSignalingWebSocketEvent() { clearInterval(this.monitorSignalingWebSocketEventTimerId); } + /** + * monitorPeerConnectionState でセットしたタイマーを止めるメソッド + */ clearMonitorIceConnectionStateChange() { clearInterval(this.monitorIceConnectionStateChangeTimerId); } + /** + * trace log を出力するメソッド + * + * @param title - ログのタイトル + * @param message - ログの本文 + */ trace(title, message) { this.callbacks.log(title, message); if (!this.debug) { @@ -2987,30 +3184,75 @@ } trace(this.clientId, title, message); } + /** + * WebSocket のシグナリングログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeWebSocketSignalingLog(eventType, data) { this.callbacks.signaling(createSignalingEvent(eventType, data, "websocket")); this.writeWebSocketTimelineLog(eventType, data); } + /** + * DataChannel のシグナリングログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeDataChannelSignalingLog(eventType, channel, data) { this.callbacks.signaling(createSignalingEvent(eventType, data, "datachannel")); this.writeDataChannelTimelineLog(eventType, channel, data); } + /** + * WebSocket のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeWebSocketTimelineLog(eventType, data) { const event = createTimelineEvent(eventType, data, "websocket"); this.callbacks.timeline(event); } + /** + * DataChannel のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeDataChannelTimelineLog(eventType, channel, data) { const event = createTimelineEvent(eventType, data, "datachannel", channel.id, channel.label); this.callbacks.timeline(event); } + /** + * PeerConnection のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writePeerConnectionTimelineLog(eventType, data) { const event = createTimelineEvent(eventType, data, "peerconnection"); this.callbacks.timeline(event); } + /** + * Sora との接続のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeSoraTimelineLog(eventType, data) { const event = createTimelineEvent(eventType, data, "sora"); this.callbacks.timeline(event); } + /** + * createOffer 処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + * + * @returns + * 生成した RTCSessionDescription を返します + */ async createOffer() { const config = { iceServers: [] }; const pc = new window.RTCPeerConnection(config); @@ -3027,6 +3269,11 @@ this.writePeerConnectionTimelineLog("create-offer", offer); return offer; } + /** + * シグナリングサーバーから受け取った type e2ee メッセージを処理をするメソッド + * + * @param data - E2EE 用バイナリメッセージ + */ signalingOnMessageE2EE(data) { if (this.e2ee) { const message = new Uint8Array(data); @@ -3037,6 +3284,11 @@ }); } } + /** + * シグナリングサーバーから受け取った type offer メッセージを処理をするメソッド + * + * @param message - type offer メッセージ + */ signalingOnMessageTypeOffer(message) { this.clientId = message.client_id; this.connectionId = message.connection_id; @@ -3060,18 +3312,29 @@ this.trace("SIGNALING OFFER MESSAGE", message); this.trace("OFFER SDP", message.sdp); } + /** + * シグナリングサーバーに type update を投げるメソッド + */ sendUpdateAnswer() { if (this.pc && this.ws && this.pc.localDescription) { this.trace("ANSWER SDP", this.pc.localDescription.sdp); this.sendSignalingMessage({ type: "update", sdp: this.pc.localDescription.sdp }); } } + /** + * シグナリングサーバーに type re-answer を投げるメソッド + */ sendReAnswer() { if (this.pc && this.pc.localDescription) { this.trace("RE ANSWER SDP", this.pc.localDescription.sdp); this.sendSignalingMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp }); } } + /** + * シグナリングサーバーから受け取った type update メッセージを処理をするメソッド + * + * @param message - type update メッセージ + */ async signalingOnMessageTypeUpdate(message) { this.trace("SIGNALING UPDATE MESSGE", message); this.trace("UPDATE SDP", message.sdp); @@ -3079,6 +3342,11 @@ await this.createAnswer(message); this.sendUpdateAnswer(); } + /** + * シグナリングサーバーから受け取った type re-offer メッセージを処理をするメソッド + * + * @param message - type re-offer メッセージ + */ async signalingOnMessageTypeReOffer(message) { this.trace("SIGNALING RE OFFER MESSGE", message); this.trace("RE OFFER SDP", message.sdp); @@ -3086,6 +3354,11 @@ await this.createAnswer(message); this.sendReAnswer(); } + /** + * シグナリングサーバーから受け取った type ping メッセージを処理をするメソッド + * + * @param message - type ping メッセージ + */ async signalingOnMessageTypePing(message) { const pongMessage = { type: "pong" }; if (message.stats) { @@ -3096,6 +3369,11 @@ this.ws.send(JSON.stringify(pongMessage)); } } + /** + * シグナリングサーバーから受け取った type notify メッセージを処理をするメソッド + * + * @param message - type notify メッセージ + */ signalingOnMessageTypeNotify(message, transportType) { if (message.event_type === "connection.created") { const connectionId = message.connection_id; @@ -3137,6 +3415,11 @@ } this.callbacks.notify(message, transportType); } + /** + * シグナリングサーバーから受け取った type switched メッセージを処理をするメソッド + * + * @param message - type switched メッセージ + */ signalingOnMessageTypeSwitched(message) { this.signalingSwitched = true; if (!this.ws) { @@ -3151,6 +3434,11 @@ this.writeWebSocketSignalingLog("close"); } } + /** + * シグナリングサーバーから受け取った type redirect メッセージを処理をするメソッド + * + * @param message - type redirect メッセージ + */ async signalingOnMessageTypeRedirect(message) { if (this.ws) { this.ws.onclose = null; @@ -3162,6 +3450,12 @@ const signalingMessage = await this.signaling(ws, true); return signalingMessage; } + /** + * sender の parameters に encodings をセットするメソッド + * + * @remarks + * サイマルキャスト用の処理 + */ async setSenderParameters(transceiver, encodings) { const originalParameters = transceiver.sender.getParameters(); // @ts-ignore @@ -3171,6 +3465,9 @@ this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters", originalParameters); return; } + /** + * PeerConnection から RTCStatsReport を取得するためのメソッド + */ async getStats() { const stats = []; if (!this.pc) { @@ -3182,6 +3479,11 @@ }); return stats; } + /** + * PeerConnection の ondatachannel callback メソッド + * + * @param dataChannelEvent - DataChannel イベント + */ onDataChannel(dataChannelEvent) { const dataChannel = dataChannelEvent.channel; this.writeDataChannelTimelineLog("ondatachannel", dataChannel, createDataChannelData(dataChannel)); @@ -3306,6 +3608,11 @@ }; } } + /** + * シグナリングサーバーへメッセージを送信するメソッド + * + * @param message - 送信するメッセージ + */ sendSignalingMessage(message) { if (this.dataChannels.signaling) { if (this.signalingOfferMessageDataChannels.signaling && @@ -3324,6 +3631,11 @@ this.writeWebSocketSignalingLog(`send-${message.type}`, message); } } + /** + * シグナリングサーバーに E2E 用メッセージを投げるメソッド + * + * @param message - 送信するバイナリメッセージ + */ sendE2EEMessage(message) { if (this.dataChannels.e2ee) { this.dataChannels.e2ee.send(message); @@ -3334,6 +3646,11 @@ this.writeWebSocketSignalingLog("send-e2ee", message); } } + /** + * シグナリングサーバーに stats メッセージを投げるメソッド + * + * @param reports - RTCStatsReport のリスト + */ sendStatsMessage(reports) { if (this.dataChannels.stats) { const message = { @@ -3351,6 +3668,9 @@ } } } + /** + * audio transceiver を取得するメソッド + */ getAudioTransceiver() { if (this.pc && this.mids.audio) { const transceiver = this.pc.getTransceivers().find((transceiver) => { @@ -3360,6 +3680,9 @@ } return null; } + /** + * video transceiver を取得するメソッド + */ getVideoTransceiver() { if (this.pc && this.mids.video) { const transceiver = this.pc.getTransceivers().find((transceiver) => { @@ -3369,6 +3692,13 @@ } return null; } + /** + * disconnect callback に渡す Event オブジェクトを生成するためのメソッド + * + * @param type - Event タイプ(normal | abend) + * @param title - Event タイトル + * @param initDict - Event に設定するオプションパラメーター + */ soraCloseEvent(type, title, initDict) { const soraCloseEvent = class SoraCloseEvent extends Event { constructor(type, title, initDict) { @@ -3389,6 +3719,12 @@ }; return new soraCloseEvent(type, title, initDict); } + /** + * DataChannel を使用してメッセージを送信するメソッド + * + * @param label - メッセージを送信する DataChannel のラベル + * @param message - JSON + */ sendMessage(label, message) { const dataChannel = this.dataChannels[label]; // 接続していない場合は何もしない @@ -3408,33 +3744,56 @@ dataChannel.send(JSON.stringify(message)); } } + /** + * E2EE の自分のフィンガープリント + */ get e2eeSelfFingerprint() { if (this.options.e2ee && this.e2ee) { return this.e2ee.selfFingerprint(); } return; } + /** + * E2EE のリモートのフィンガープリントリスト + */ get e2eeRemoteFingerprints() { if (this.options.e2ee && this.e2ee) { return this.e2ee.remoteFingerprints(); } return; } + /** + * audio が有効かどうか + */ get audio() { return this.getAudioTransceiver() !== null; } + /** + * video が有効かどうか + */ get video() { return this.getVideoTransceiver() !== null; } + /** + * シグナリングに使用する URL + * + * @deprecated + */ get signalingUrl() { return this.signalingUrlCandidates; } + /** + * 接続中のシグナリング URL + */ get connectedSignalingUrl() { if (!this.ws) { return ""; } return this.ws.url; } + /** + * DataChannel メッセージング用の DataChannel 情報のリスト + */ get messagingDataChannels() { const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); @@ -3745,7 +4104,15 @@ } } - // MediaStream の constraints を動的に変更 + /** + * MediaStream の constraints を動的に変更するメソッド. + * + * @param mediastream - メディアストリーム + * + * @param constraints - メディアストリーム制約 + * + * @public + */ async function applyMediaStreamConstraints(mediastream, constraints) { if (constraints.audio && typeof constraints.audio !== "boolean") { for (const track of mediastream.getAudioTracks()) { @@ -3759,35 +4126,110 @@ } } + /** + * Role 毎の Connection インスタンスを生成するためのクラス + * + * @param signalingUrlCandidates - シグナリングに使用する URL の候補 + * @param debug - デバッグフラグ + */ class SoraConnection { constructor(signalingUrlCandidates, debug = false) { this.signalingUrlCandidates = signalingUrlCandidates; this.debug = debug; } + /** + * role sendrecv で接続するための Connecion インスタンスを生成するメソッド + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role sendrecv な Connection オブジェクトを返します + * + * @public + */ sendrecv(channelId, metadata = null, options = { audio: true, video: true }) { return new ConnectionPublisher(this.signalingUrlCandidates, "sendrecv", channelId, metadata, options, this.debug); } + /** + * role sendonly で接続するための Connecion インスタンスを生成するメソッド + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role sendonly な Connection オブジェクトを返します + * + * @public + */ sendonly(channelId, metadata = null, options = { audio: true, video: true }) { return new ConnectionPublisher(this.signalingUrlCandidates, "sendonly", channelId, metadata, options, this.debug); } + /** + * role recvonly で接続するための Connecion インスタンスを生成するメソッド + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role recvonly な Connection オブジェクトを返します + * + * @public + */ recvonly(channelId, metadata = null, options = { audio: true, video: true }) { return new ConnectionSubscriber(this.signalingUrlCandidates, "recvonly", channelId, metadata, options, this.debug); } - // @deprecated 後方互換のため残す + /** + * シグナリングに使用する URL の候補 + * + * @public + * @deprecated + */ get signalingUrl() { return this.signalingUrlCandidates; } } + /** + * Sora JS SDK package + */ var sora = { + /** + * E2EE で使用する WASM の読み込みを行うメソッド + * + * @param wasmUrl - E2EE WASM の URL + * + * @public + */ initE2EE: async function (wasmUrl) { await SoraE2EE.loadWasm(wasmUrl); }, + /** + * SoraConnection インスタンスを生成するメソッド + * + * @param wasmUrl - シグナリングに使用する URL 候補 + * @param debug - デバッグフラグ + * + * @public + */ connection: function (signalingUrlCandidates, debug = false) { return new SoraConnection(signalingUrlCandidates, debug); }, + /** + * SDK のバージョンを返すメソッド + * + * @public + */ version: function () { - return "2021.2.0-canary.3"; + return "2021.2.0-canary.4"; }, + /** + * WebRTC のユーティリティ関数群 + * + * @public + */ helpers: { applyMediaStreamConstraints, }, diff --git a/dist/sora.min.js b/dist/sora.min.js index c2513d47..08ab503f 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,8 +1,2 @@ -/** - * @sora/sdk - * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.3 - * @author: Shiguredo Inc. - * @license: Apache-2.0 - **/(function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"==typeof globalThis?e||self:globalThis,e.Sora=n())})(this,function(){'use strict';var n=Math.min,a=Math.ceil,t=Math.max;function g(){(()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else if("undefined"!=typeof self)self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let n="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,a){n+=i.decode(a);const t=n.lastIndexOf("\n");return-1!=t&&(console.log(n.substr(0,t)),n=n.substr(t+1)),a.length},write(i,a,t,g,o,l){if(0!==t||g!==a.length||null!==o)return void l(e());const s=this.writeSync(i,a);l(null,s)},chmod(n,i,a){a(e())},chown(n,i,a,t){t(e())},close(n,i){i(e())},fchmod(n,i,a){a(e())},fchown(n,i,a,t){t(e())},fstat(n,i){i(e())},fsync(e,n){n(null)},ftruncate(n,i,a){a(e())},lchown(n,i,a,t){t(e())},link(n,i,a){a(e())},lstat(n,i){i(e())},mkdir(n,i,a){a(e())},open(n,i,a,t){t(e())},read(n,i,a,t,g,o){o(e())},readdir(n,i){i(e())},readlink(n,i){i(e())},rename(n,i,a){a(e())},rmdir(n,i){i(e())},stat(n,i){i(e())},symlink(n,i,a){a(e())},truncate(n,i,a){a(e())},unlink(n,i){i(e())},utimes(n,i,a,t){t(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(n){e.randomFillSync(n)}}}global.performance||(global.performance={now(){const[e,n]=process.hrtime();return 1e3*e+n/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const n=new TextEncoder("utf-8"),i=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{var i=Math.floor;this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,i(n/4294967296),!0)},t=e=>{const n=this.mem.getUint32(e+0,!0),i=this.mem.getInt32(e+4,!0);return n+4294967296*i},g=e=>{const n=this.mem.getFloat64(e,!0);if(0!==n){if(!isNaN(n))return n;const i=this.mem.getUint32(e,!0);return this._values[i]}},o=(e,n)=>{if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,2146959360,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(n);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=n,this._goRefCounts[i]=0,this._ids.set(n,i)),this._goRefCounts[i]++;let a=0;switch(typeof n){case"object":null!==n&&(a=1);break;case"string":a=2;break;case"symbol":a=3;break;case"function":a=4;}this.mem.setUint32(e+4,2146959360|a,!0),this.mem.setUint32(e,i,!0)},l=e=>{const n=t(e+0),i=t(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,i)},s=e=>{const n=t(e+0),o=t(e+8),l=Array(o);for(let a=0;a{const n=t(e+0),a=t(e+8);return i.decode(new DataView(this._inst.exports.mem.buffer,n,a))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const i=t(e+8),a=t(e+16),g=this.mem.getInt32(e+24,!0);fs.writeSync(i,new Uint8Array(this._inst.exports.mem.buffer,a,g))},"runtime.resetMemoryDataView":()=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e(n+8,1e6*(c+performance.now()))},"runtime.walltime1":n=>{const i=new Date().getTime();e(n+8,i/1e3),this.mem.setInt32(n+16,1e6*(i%1e3),!0)},"runtime.scheduleTimeoutEvent":e=>{const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},t(e+8)+1)),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o(e+24,d(e+8))},"syscall/js.valueGet":e=>{const n=Reflect.get(g(e+8),d(e+16));e=this._inst.exports.getsp(),o(e+32,n)},"syscall/js.valueSet":e=>{Reflect.set(g(e+8),d(e+16),g(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(g(e+8),d(e+16))},"syscall/js.valueIndex":e=>{o(e+24,Reflect.get(g(e+8),t(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(g(e+8),t(e+16),g(e+24))},"syscall/js.valueCall":e=>{try{const n=g(e+8),i=Reflect.get(n,d(e+16)),a=s(e+32),t=Reflect.apply(i,n,a);e=this._inst.exports.getsp(),o(e+56,t),this.mem.setUint8(e+64,1)}catch(n){o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const n=g(e+8),i=s(e+16),a=Reflect.apply(n,void 0,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const n=g(e+8),i=s(e+16),a=Reflect.construct(n,i);e=this._inst.exports.getsp(),o(e+40,a),this.mem.setUint8(e+48,1)}catch(n){o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e(n+16,parseInt(g(n+8).length))},"syscall/js.valuePrepareString":i=>{const a=n.encode(g(i+8)+"");o(i+16,a),e(i+24,a.length)},"syscall/js.valueLoadString":e=>{const n=g(e+8);l(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,g(e+8)instanceof g(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const i=l(n+8),a=g(n+32);if(!(a instanceof Uint8Array||a instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const i=g(n+8),a=l(n+16);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const t=a.subarray(0,i.length);i.set(t),e(n+40,t.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let i=4096;const a=e=>{const a=i,t=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,0!=i%8&&(i+=8-i%8),a},t=this.argv.length,g=[];this.argv.forEach(e=>{g.push(a(e))}),g.push(0);const o=Object.keys(this.env).sort();o.forEach(e=>{g.push(a(`${e}=${this.env[e]}`))}),g.push(0);const l=i;g.forEach(e=>{this.mem.setUint32(i,e,!0),this.mem.setUint32(i+4,0,!0),i+=8}),this._inst.exports.run(t,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const i={id:e,this:this,args:arguments};return n._pendingEvent=i,n._resume(),i.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){3>process.argv.length&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then(n=>(process.on("exit",n=>{0!==n||e.exited||(e._pendingEvent={id:0},e._resume())}),e.run(n.instance))).catch(e=>{console.error(e),process.exit(1)})}})()}function o(e,n){n||(n={});var i=Ce();i.p(e);var a=re(e,n,2,4);return me(a,n),Ie(a,a.length-4,i.d()),a}function l(e,n){return $((Ae(e),e.subarray(2,-4)),n)}function s(){const e=window.navigator.userAgent.toLocaleLowerCase();if(-1!==e.indexOf("edge"))return"edge";return-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1===e.indexOf("opera")?-1===e.indexOf("firefox")?null:"firefox":"opera"}function d(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const n=e.headerExtensions.map(e=>e.uri),i=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every(e=>n.includes(e));return i}function c(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const n=e,i={};return"string"==typeof n.label&&(i.label=n.label),"string"==typeof n.direction&&(i.direction=n.direction),"boolean"==typeof n.ordered&&(i.ordered=n.ordered),"boolean"==typeof n.compress&&(i.compress=n.compress),"number"==typeof n.maxPacketLifeTime&&(i.max_packet_life_time=n.maxPacketLifeTime),"number"==typeof n.maxRetransmits&&(i.max_retransmits=n.maxRetransmits),"string"==typeof n.protocol&&(i.protocol=n.protocol),i}function C(e){const n=[];for(const i of e)n.push(c(i));return n}function r(){return"safari"===s()}function I(e,n,i,a,t,g){if("sendrecv"!==n&&"sendonly"!==n&&"recvonly"!==n)throw new Error("Unknown role type");if(null===i||void 0===i)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.3",environment:window.navigator.userAgent,role:n,channel_id:i,sdp:e,audio:!0,video:!0};if(void 0!==a&&(o.metadata=a),g&&(o.redirect=!0),"signalingNotifyMetadata"in t&&(o.signaling_notify_metadata=t.signalingNotifyMetadata),"multistream"in t&&!0===t.multistream&&(o.multistream=!0,"spotlight"in t&&(o.spotlight=t.spotlight,"spotlightNumber"in t&&(o.spotlight_number=t.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==t.spotlightFocusRid&&0<=e.indexOf(t.spotlightFocusRid)&&(o.spotlight_focus_rid=t.spotlightFocusRid),void 0!==t.spotlightUnfocusRid&&0<=e.indexOf(t.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=t.spotlightUnfocusRid)}if("simulcast"in t||"simulcastRid"in t){"simulcast"in t&&!0===t.simulcast&&(o.simulcast=!0);void 0!==t.simulcastRid&&0<=["r0","r1","r2"].indexOf(t.simulcastRid)&&(o.simulcast_rid=t.simulcastRid)}"clientId"in t&&void 0!==t.clientId&&(o.client_id=t.clientId),"dataChannelSignaling"in t&&"boolean"==typeof t.dataChannelSignaling&&(o.data_channel_signaling=t.dataChannelSignaling),"ignoreDisconnectWebSocket"in t&&"boolean"==typeof t.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=t.ignoreDisconnectWebSocket);const l=["audioCodecType","audioBitRate"],s=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},t);Object.keys(r).forEach(e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=s.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]}),void 0!==r.audio&&(o.audio=r.audio);const I=Object.keys(r).some(e=>0<=l.indexOf(e));o.audio&&I&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const m=Object.keys(r).some(e=>0<=s.indexOf(e));o.audio&&m&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const A=Object.keys(r).some(e=>0<=c.indexOf(e));if(o.video&&A&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!d()&&"recvonly"!==n)throw new Error("Simulcast can not be used with this browser");if(!0===t.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(t.dataChannels)&&0{if(e&&"object"==typeof e){let n=null;try{n=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}n&&Array.isArray(n)?n.forEach(n=>{console.group(n),a(e[n]),console.groupEnd()}):console.info(e)}else console.info(e)};let t="";window.performance&&(t="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(t=t+"["+e+"]"),console.info!==void 0&&console.group!==void 0?(console.group(t+" "+n),a(i),console.groupEnd()):console.log(t+" "+n+"\n",i)}function b(e,n,i){const a=new Event(e);try{a.data=JSON.parse(JSON.stringify(n))}catch(e){a.data=n}return a.transportType=i,a}function p(e){return{binaryType:e.binaryType,bufferedAmount:e.bufferedAmount,bufferedAmountLowThreshold:e.bufferedAmountLowThreshold,id:e.id,label:e.label,maxPacketLifeTime:e.maxPacketLifeTime,maxRetransmits:e.maxRetransmits,negotiated:e.negotiated,ordered:e.ordered,protocol:e.protocol,readyState:e.readyState,reliable:e.reliable}}function V(e,n,i,a,t){const g=new Event(e);try{g.data=JSON.parse(JSON.stringify(n))}catch(e){g.data=n}return g.logType=i,g.dataChannelId=a,g.dataChannelLabel=t,g}function S(e,n){const i=new Event("message");return i.label=e,i.data=n,i}class W{constructor(){const e=!!RTCRtpSender.prototype.createEncodedStreams;if(!e)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZ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aXZlTWVzc2FnZSDlj5fkv6HliY3jga7loLTlkIgKICAgIGlmIChlbmNvZGVkRnJhbWUudHlwZSA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgLy8g6Z+z5aOw44Gv5pqX5Y+35YyW44Gv44GE44KL44Go6IGe44GR44Gf44KC44Gu44GY44KD44Gq44GE44Gu44Gn572u44GN5o+b44GI44KLCiAgICAgICAgY29uc3QgbmV3RGF0YSA9IG5ldyBBcnJheUJ1ZmZlcigzKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIE9wdXMg44K144Kk44Os44Oz44K544OV44Os44O844OgCiAgICAgICAgbmV3VWludDguc2V0KFsweGQ4LCAweGZmLCAweGZlXSk7CiAgICAgICAgZW5jb2RlZEZyYW1lLmRhdGEgPSBuZXdEYXRhOwogICAgfQogICAgZWxzZSB7CiAgICAgICAgLy8g5pig5YOP44GM5q2j5bi444GY44KD44Gq44GE44Gf44KBIFBMSSDjgrnjg4jjg7zjg6DjgYznmbrnlJ/jgZfjgabjgZfjgb7jgYYKICAgICAgICAvLyDjgZ3jga7jgZ/jgoEgMzIweDI0MCDjga7nnJ/jgaPpu5LjgarnlLvpnaLjgavnva7jgY3mj5vjgYjjgosKICAgICAgICBjb25zdCBuZXdEYXRhID0gbmV3IEFycmF5QnVmZmVyKDYwKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIHByZXR0aWVyLWlnbm9yZQogICAgICAgIG5ld1VpbnQ4LnNldChbMHhiMCwgMHgwNSwgMHgwMCwgMHg5ZCwgMHgwMSwgMHgyYSwgMHhhMCwgMHgwMCwgMHg1YSwgMHgwMCwKICAgICAgICAgICAgMHgzOSwgMHgwMywgMHgwMCwgMHgwMCwgMHgxYywgMHgyMiwgMHgxNiwgMHgxNiwgMHgyMiwgMHg2NiwKICAgICAgICAgICAgMHg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KTsKICAgICAgICBjb25zdCBjb25uZWN0aW9uSWQgPSB0ZXh0RGVjb2Rlci5kZWNvZGUoY29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIo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SAoZXZlbnQpID0+IHsKICAgIGNvbnN0IHsgdHlwZSB9ID0gZXZlbnQuZGF0YTsKICAgIGlmICh0eXBlID09PSAic2VsZlNlY3JldEtleU1hdGVyaWFsIikgewogICAgICAgIGNvbnN0IHsgc2VsZlNlY3JldEtleU1hdGVyaWFsLCBzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdhaXRpbmdUaW1lIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAg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WFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:n}=e.data;"disconnect"===n&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"encrypt",readableStream:i,writableStream:a},[i,a])}setupReceiverTransform(e){const n=e.createEncodedStreams(),i=n.readableStream||n.readable,a=n.writableStream||n.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"decrypt",readableStream:i,writableStream:a},[i,a])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,n,i,a=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:n,selfSecretKeyMaterial:i,waitingTime:a})}startSession(e,n){const[i,a]=window.e2ee.startSession(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(a)throw a;return i}stopSession(e){const[n,i]=window.e2ee.stopSession(e);if(i)throw i;return n}receiveMessage(e){const[n,i]=window.e2ee.receiveMessage(e);if(i)throw i;return n}start(e){const[n,i]=window.e2ee.start(e);if(i)throw i;return n}addPreKeyBundle(e,n){const i=window.e2ee.addPreKeyBundle(e,n.identityKey,n.signedPreKey,n.preKeySignature);if(i)throw i}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if(g(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const n=new Go,{instance:i}=await WebAssembly.instantiateStreaming(fetch(e),n.importObject);if(n.run(i),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.2.0-canary.3"}static wasmVersion(){return window.e2ee.version()}}var G=Uint8Array,h=Uint16Array,y=Uint32Array,k=new G([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),w=new G([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),R=new G([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(e,n){for(var a=new h(31),t=0;31>t;++t)a[t]=n+=1<t;++t)for(var o=a[t];ov;++v)B=(43690&v)>>>1|(21845&v)<<1,B=(52428&B)>>>2|(13107&B)<<2,B=(61680&B)>>>4|(3855&B)<<4,E[v]=((65280&B)>>>8|(255&B)<<8)>>>1;for(var K=function(e,n,a){for(var t=e.length,g=0,o=new h(n);g>>15-n]=d}else for(s=new h(t),g=0;g>>15-e[g]);return s},L=new G(288),v=0;144>v;++v)L[v]=8;for(var v=144;256>v;++v)L[v]=9;for(var v=256;280>v;++v)L[v]=7;for(var v=280;288>v;++v)L[v]=8;for(var F=new G(32),v=0;32>v;++v)F[v]=5;var J=K(L,9,0),U=K(L,9,1),D=K(F,5,0),Q=K(F,5,1),j=function(e){for(var n=e[0],a=1;an&&(n=e[a]);return n},M=function(e,n,i){var a=0|n/8;return(e[a]|e[a+1]<<8)>>(7&n)&i},H=function(e,n){var i=0|n/8;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&n)},P=function(e){return 0|(e+7)/8},z=function(i,a,t){(null==a||0>a)&&(a=0),(null==t||t>i.length)&&(t=i.length);var g=new(i instanceof h?h:i instanceof y?y:G)(t-a);return g.set(i.subarray(a,t)),g},_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],q=function(n,i,a){var t=new Error(i||_[n]);if(t.code=n,Error.captureStackTrace&&Error.captureStackTrace(t,q),!a)throw t;return t},$=function(a,g,o){var C=a.length;if(!C||o&&o.f&&!o.l)return g||new G(0);var I=!g||o,m=!o||o.i;o||(o={}),g||(g=new G(3*C));var A=function(e){var n=g.length;if(e>n){var i=new G(t(2*n,e));i.set(g),g=i}},u=o.f||0,Z=o.p||0,p=o.b||0,V=o.l,S=o.d,W=o.m,h=o.n,y=8*C;do{if(!V){u=M(a,Z,1);var f=M(a,Z+1,3);if(Z+=3,!f){var X=P(Z)+4,T=a[X-4]|a[X-3]<<8,l=X+T;if(l>C){m&&q(0);break}I&&A(p+T),g.set(a.subarray(X,l),p),o.b=p+=T,o.p=Z=8*l,o.f=u;continue}else if(1==f)V=U,S=Q,W=9,h=5;else if(2==f){var B=M(a,Z,31)+257,Y=M(a,Z+10,15)+4,O=B+M(a,Z+5,31)+1;Z+=14;for(var E=new G(O),v=new G(19),L=0;L>>4;if(16>X)E[L++]=X;else{var x=0,_=0;for(16==X?(_=3+M(a,Z,3),Z+=2,x=E[L-1]):17==X?(_=3+M(a,Z,7),Z+=3):18==X&&(_=11+M(a,Z,127),Z+=7);_--;)E[L++]=x}}var $=E.subarray(0,B),ee=E.subarray(B);W=j($),h=j(ee),V=K($,W,1),S=K(ee,h,1)}else q(1);if(Z>y){m&&q(0);break}}I&&A(p+131072);for(var ne=(1<>>4;if(Z+=15&x,Z>y){m&&q(0);break}if(x||q(2),256>te)g[p++]=te;else if(256==te){ae=Z,V=null;break}else{var ge=te-254;if(264>>4;le||q(3),Z+=15≤var ee=N[d];if(3y){m&&q(0);break}I&&A(p+131072);for(var se=p+ge;p>>8},ne=function(e,n,i){i<<=7&n;var a=0|n/8;e[a]|=i,e[a+1]|=i>>>8,e[a+2]|=i>>>16},ie=function(e,n){for(var a=[],t=0;tA&&(A=o[t].s);var u=new h(A+1),Z=ae(a[I-1],u,0);if(Z>n){var t=0,b=0,p=Z-n;for(o.sort(function(e,n){return u[n.s]-u[e.s]||e.f-n.f});tn)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var _,X=0;X>>5),C+=x[X]>>>12)}}else U=J,Q=L,j=D,M=F;for(var X=0;X>>18;ne(n,C,U[_+257]),C+=Q[_+257],7<_&&(ee(n,C,31&t[X]>>>23),C+=k[_]);var q=31&t[X];ne(n,C,j[q]),C+=M[q],3>>5),C+=w[q])}else ne(n,C,U[t[X]]),C+=Q[t[X]];return ne(n,C,U[256]),C+Q[256]},se=new y([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),de=new G(0),ce=function(t,g,c,C,r,I){var m=t.length,s=new G(C+m+5*(1+a(m/7e3))+r),o=s.subarray(C,s.length-r),A=0;if(!g||8>m)for(var u,Z=0;Z<=m;Z+=65535)u=Z+65535,uD;++D)X[D]=0;for(var D=0;30>D;++D)B[D]=0}var Q=2,M=0,H=8191&b,x=32767&F-J;if(2>>13,U)-1,q=n(32767,Z),$=n(258,U);x<=q&&--H&&F!=J;){if(t[Z+Q]==t[Z+Q-x]){for(var ee=0;ee<$&&t[Z+ee]==t[Z+ee-x];++ee);if(ee>Q){if(Q=ee,M=x,ee>_)break;for(var ne=n(x,ee-2),ie=0,D=0;Die&&(ie=ge,J=ae)}}}F=J,J=V[F],x+=32767&F-J+32768}if(M){f[E++]=268435456|T[Q]<<18|O[M];var ce=31&T[Q],Ce=31&O[M];N+=k[ce]+w[Ce],++X[257+ce],++B[Ce],v=Z+Q,++Y}else f[E++]=t[Z],++X[t[Z]]}}A=le(t,o,I,f,X,B,N,E,K,Z-K,A),!I&&7&A&&(A=oe(o,A+1,de))}return z(s,0,C+P(A)+r)},Ce=function(){var t=1,g=0;return{p:function(a){for(var o,s=t,d=g,c=0|a.length,l=0;l!=c;){for(o=n(l+2655,c);l>16),d=(65535&d)+15*(d>>16)}t=s,g=d},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},re=function(e,i,g,o,l){return ce(e,null==i.level?6:i.level,null==i.mem?a(1.5*t(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!l)},Ie=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},me=function(e,n){var i=n.level,a=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},Ae=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&q(6,"invalid zlib data"),32&e[1]&&q(6,"invalid zlib data: preset dictionaries not supported")},ue="undefined"!=typeof TextDecoder&&new TextDecoder,Ze=0;try{ue.decode(de,{stream:!0}),Ze=1}catch(n){}class be extends Error{}class pe{constructor(e,n,i,a,t,g){this.role=n,this.channelId=i,this.metadata=a,this.signalingUrlCandidates=e,this.options=t,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const a={type:"disconnect",reason:e};this.ws.send(JSON.stringify(a)),this.writeWebSocketSignalingLog("send-disconnect",a),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const a=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),t=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(a),e(),n({code:4999,reason:""}));t.push((()=>new Promise(e=>{let n=0;const a=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(a),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(a))},100)}))())}}Promise.all(t).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(a)});const g={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null,n.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)})}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new W,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){return new Promise((n,i)=>{const a=new WebSocket(e);a.onclose=e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),i(n)},a.onopen=()=>{n(a)}})}if(Array.isArray(e)){let n=!1;const i=e=>new Promise((i,a)=>{const t=new WebSocket(e),g=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:t.url}),t&&!n&&(t.onclose=null,t.onerror=null,t.onopen=null,t.close(),a())},this.signalingCandidateTimeout);t.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:t.url,message:`WebSocket closed`,code:e.code,reason:e.reason}),t&&t.close(),clearInterval(g),a()},t.onerror=()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:t.url,message:`Failed to connect WebSocket`}),t&&(t.onclose=null,t.close()),clearInterval(g),a()},t.onopen=()=>{t&&(clearInterval(g),n?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!1}),t.onerror=null,t.onclose=null,t.onopen=null,t.close(),a()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!0}),t.onerror=null,t.onclose=null,t.onopen=null,n=!0,i(t)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(n){throw new be("Signaling failed. All signaling URL candidates failed to connect")}}throw new be("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,n=!1){const i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((a,t)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const n=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const n=JSON.parse(e.data);if("offer"==n.type)this.writeWebSocketSignalingLog("onmessage-offer",n),this.signalingOnMessageTypeOffer(n),a(n);else if("update"==n.type)this.writeWebSocketSignalingLog("onmessage-update",n),await this.signalingOnMessageTypeUpdate(n);else if("re-offer"==n.type)this.writeWebSocketSignalingLog("onmessage-re-offer",n),await this.signalingOnMessageTypeReOffer(n);else if("ping"==n.type)await this.signalingOnMessageTypePing(n);else if("push"==n.type)this.callbacks.push(n,"websocket");else if("notify"==n.type)"connection.created"===n.event_type?this.writeWebSocketTimelineLog("notify-connection.created",n):"connection.destroyed"===n.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",n),this.signalingOnMessageTypeNotify(n,"websocket");else if("switched"==n.type)this.writeWebSocketSignalingLog("onmessage-switched",n),this.signalingOnMessageTypeSwitched(n);else if("redirect"==n.type){this.writeWebSocketSignalingLog("onmessage-redirect",n);const e=await this.signalingOnMessageTypeRedirect(n);a(e)}},(async()=>{let a;try{a=I(i.sdp||"",this.role,this.channelId,this.metadata,this.options,n)}catch(e){return void t(e)}if(a.e2ee&&this.e2ee){const e=await this.e2ee.init();a.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",a),e&&(e.send(JSON.stringify(a)),this.writeWebSocketSignalingLog(`send-${a.type}`,a),this.ws=e)})()})}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendSignalingMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new be(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new be(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&Z(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(b(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(b(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=V(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const a=V(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(a)}writePeerConnectionTimelineLog(e,n){const i=V(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=V(e,n,"sora");this.callbacks.timeline(i)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(r()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.signalingOfferMessageDataChannels[n.label]=n;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=m(e),a=u(i);if(a&&this.e2ee&&n){const e=this.e2ee.startSession(n,a);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=A(e);i.forEach(e=>{const n=m(e),i=u(n),a=e.connection_id;a&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(a,i)})}else if("connection.destroyed"===e.event_type){const n=m(e),i=u(n),a=e.connection_id;if(i&&this.e2ee&&a){const e=this.e2ee.stopSession(a);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(a)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const n=await this.getSignalingWebSocket(e.location),i=await this.signaling(n,!0);return i}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,p(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${a.type}`,n,a),"re-offer"===a.type&&(await this.signalingOnMessageTypeReOffer(a))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let n=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const i=l(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const n=e.target;let i=e.data;const a=this.signalingOfferMessageDataChannels[n.label];if(a!==void 0&&!0===a.compress){const n=l(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const t=JSON.parse(i);this.callbacks.message(S(n.label,t))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const a=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new a(e,n,i)}sendMessage(e,n){const i=this.dataChannels[e];if(null!==this.pc){if(void 0===i)throw new Error("Could not find DataChannel");const a=this.signalingOfferMessageDataChannels[e];if(void 0!==a&&!0===a.compress){const e=new TextEncoder().encode(JSON.stringify(n)),a=o(e,{});i.send(a)}else i.send(JSON.stringify(n))}}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter(e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e)),n=[];for(const i of e){const e=this.dataChannels[i];if(!e)continue;const a=this.signalingOfferMessageDataChannels[i];if(!a)continue;const t={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:a.compress,direction:a.direction};"number"==typeof e.maxPacketLifeTime&&(t.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(t.maxRetransmits=e.maxRetransmits),n.push(t)}return n}}class Ve extends pe{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class Se extends pe{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[C-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!F[o[D-1]];--D);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*D+B(K,F)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(C,C+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),F=function(e,o,g,l,c){return function(e,o,g,l,c,d){var C=e.length,I=new t(l+C+5*(1+Math.ceil(C/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||C<8)for(var A=0;A<=C;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,F,A-F,u),N=O=E=0,F=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=D-M&32767;if(j>2&&U==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&D!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(D=M)-(M=V[D])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,d,v,T,X,E,N,F,A-F,u),!d&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function U(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=F(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function D(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var d=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(U=G(I)+4)-4]|e[U-3]<<8,X=U+T;if(X>g){r&&v(0);break}l&&d(m+T),n.set(e.subarray(U,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=U;else{var M=0,j=0;for(16==U?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==U?(j=3+y(e,I,7),I+=3):18==U&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&d(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=C[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&d(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.4",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.dataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}};return new Promise(((t,n)=>{if(!this.dataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.dataChannels)){const a=this.dataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.dataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0,this.ws&&e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.dataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];if(void 0!==i&&!0===i.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const s=JSON.parse(n);this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,s))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U((new TextEncoder).encode(JSON.stringify(e)),{});this.dataChannels.signaling.send(t)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});this.dataChannels.stats.send(e)}else this.dataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.dataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});n.send(e)}else n.send(JSON.stringify(t))}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.dataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class ee extends ${async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class te extends ${async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.2.0-canary.3\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY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Rlci5kZWNvZGUoY29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxha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nQuZGF0YTsKICAgIGlmICh0eXBlID09PSAic2VsZlNlY3JldEtleU1hdGVyaWFsIikgewogICAgICAgIGNvbnN0IHsgc2VsZlNlY3JldEtleU1hdGVyaWFsLCBzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdhaXRpbmdUaW1lIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQ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ogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.2.0-canary.3\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAAX,CACNA,MAAM,CAACD,MAAP,CAAgBC,MADV,KAEA,IAAoB,WAAhB,QAAOC,CAAAA,IAAX,CACNA,IAAI,CAACF,MAAL,CAAcE,IADR,KAGN,MAAM,IAAIC,CAAAA,KAAJ,CAAU,+DAAV,CAAN,CAOD,GAJKH,MAAM,CAACI,OAAR,EAAsC,WAAnB,QAAOA,CAAAA,OAI9B,GAHCJ,MAAM,CAACI,OAAP,CAAiBA,OAGlB,EAAI,CAACJ,MAAM,CAACK,EAAR,EAAcL,MAAM,CAACI,OAAzB,CAAkC,CACjC,KAAMC,CAAAA,CAAE,CAAGD,OAAO,CAAC,IAAD,CAAlB,CACwB,CAApB,GAAAE,MAAM,CAACC,IAAP,CAAYF,CAAZ,CAF6B,GAGhCL,MAAM,CAACK,EAAP,CAAYA,CAHoB,CAKjC,CAED,KAAMG,CAAAA,CAAM,CAAG,IAAM,CACpB,KAAMC,CAAAA,CAAG,CAAG,GAAIN,CAAAA,KAAJ,CAAU,iBAAV,CAAZ,CAEA,MADAM,CAAAA,CAAG,CAACC,IAAJ,CAAW,QACX,CAAOD,CACP,CAJD,CAMA,GAAI,CAACT,MAAM,CAACK,EAAZ,CAAgB,CACf,GAAIM,CAAAA,CAAS,CAAG,EAAhB,CACAX,MAAM,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,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"} \ No newline at end of file +{"version":3,"file":"sora.min.js","sources":["../packages/e2ee/dist/sora_e2ee.mjs","../packages/go-wasm/src/wasm_exec.js","../node_modules/fflate/esm/browser.js"],"sourcesContent":["/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.1.0\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyY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uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.1.0\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([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, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([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, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n"],"names":["SoraE2EE","constructor","RTCRtpSender","prototype","createEncodedStreams","Error","this","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","event","operation","data","clearWorker","postMessage","terminateWorker","terminate","async","preKeyBundle","window","e2ee","init","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","message","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","result","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","err","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","static","wasmUrl","undefined","console","warn","global","self","require","fs","Object","keys","enosys","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","log","substr","length","write","offset","position","callback","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","argv","env","exit","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","mem","setUint32","Math","floor","getInt64","getUint32","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","nanHead","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","n","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","String","dst","src","Uint8ClampedArray","toCopy","subarray","debug","value","instance","NaN","fill","Infinity","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","run","resume","_makeFuncWrapper","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","instantiateStreaming","fetch","version","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","_b","revfd","rev","x","hMap","cd","mb","s","l","co","le","rvb","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","max","bits","d","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","wbits","wbits16","hTree","t","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","dt","lft","cst","i2_1","i2_2","i2_3","lc","c","cl","cli","cln","cls","w","clen","cf","wfblk","out","pos","dat","wblk","final","syms","lf","df","li","bs","bl","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","lm","ll","dm","dl","flen","ftlen","dtlen","llm","lcts","it","clct","deo","dopt","opt","pre","post","st","lvl","plvl","lst","ceil","msk_1","prev","head","bs1_1","bs2_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","min","maxd","ml","mmd","md","ti","lin","din","dflt","level","zlibSync","opts","adler","lv","zlh","wbytes","unzlibSync","sl","noBuf","noSt","cbuf","nbuf","bt","lbt","dbt","tbts","hLit","hcLen","tl","ldt","clt","clb","clbmsk","clm","lt","lms","dms","lpos","sym","add","dsym","end","inflt","td","stream"],"mappings":"qOAWA,MAAMA,EACFC,cAII,MADoCC,aAAaC,UAAUC,qBAEvD,MAAM,IAAIC,MAAM,0CAEpBC,KAAKC,OAAS,KACdD,KAAKE,mBAAqB,KAG9BC,cAEI,MAAMC,EAAeC,KAfP,wjwBAgBdL,KAAKC,OAAS,IAAIK,OAAOC,IAAIC,gBAAgB,IAAIC,KAAK,CAACL,GAAe,CAAEM,KAAM,6BAC9EV,KAAKC,OAAOU,UAAaC,IACrB,MAAMC,UAAEA,GAAcD,EAAME,KACV,eAAdD,GAAiE,mBAA5Bb,KAAKE,oBAC1CF,KAAKE,sBAKjBa,cACQf,KAAKC,QACLD,KAAKC,OAAOe,YAAY,CACpBN,KAAM,UAKlBO,kBACQ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AM,EAAIA,EAAE,IAAM,KAC9DtQ,EAAI,EAAG,qBACA,GAAPsQ,EAAE,IACFtQ,EAAI,EAAG,wDAoccjC,EAAK4N,SAAS,GAAI,IAAKmH,GAxc1C,IAAUxC,EA6jBpB,IAAIiJ,EAA2B,oBAAflT,aAA4C,IAAIA,YAGhE,IACIkT,EAAGpX,OAAOmP,EAAI,CAAEkI,QAAQ,IAClB,EAEV,MAAO7I"} \ No newline at end of file diff --git a/dist/sora.mjs b/dist/sora.mjs index 5c11899f..17492a93 100644 --- a/dist/sora.mjs +++ b/dist/sora.mjs @@ -1,7 +1,7 @@ /** - * @sora/sdk + * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.3 + * @version: 2021.2.0-canary.4 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -598,7 +598,7 @@ function WasmExec () { /** * @sora/e2ee * WebRTC SFU Sora JavaScript E2EE Library - * @version: 2021.2.0-canary.3 + * @version: 2021.1.0 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -766,7 +766,7 @@ class SoraE2EE { } } static version() { - return "2021.2.0-canary.3"; + return "2021.1.0"; } static wasmVersion() { return window.e2ee.version(); @@ -1629,7 +1629,7 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options, re } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.3", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.4", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1925,6 +1925,16 @@ function createDataChannelMessageEvent(label, data) { return event; } +/** + * Sora との WebRTC 接続を扱う基底クラス + * + * @param signalingUrlCandidates - シグナリングに使用する URL の候補 + * @param role - ロール + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * @param debug - デバッグフラグ + */ class ConnectionBase { constructor(signalingUrlCandidates, role, channelId, metadata, options, debug) { this.role = role; @@ -1987,6 +1997,19 @@ class ConnectionBase { this.signalingSwitched = false; this.signalingOfferMessageDataChannels = {}; } + /** + * SendRecv Object で発火するイベントのコールバックを設定するメソッド + * + * @remarks + * addstream イベントは非推奨です.track イベントを使用してください + * + * removestream イベントは非推奨です.removetrack イベントを使用してください + * + * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message) + * @param callback - コールバック関数 + * + * @public + */ on(kind, callback) { // @deprecated message if (kind === "addstream") { @@ -1999,6 +2022,16 @@ class ConnectionBase { this.callbacks[kind] = callback; } } + /** + * audio track を停止するメソッド + * + * @remarks + * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します + * + * @param stream - audio track を削除する MediaStream + * + * @public + */ stopAudioTrack(stream) { for (const track of stream.getAudioTracks()) { track.enabled = false; @@ -2022,6 +2055,16 @@ class ConnectionBase { }, 100); }); } + /** + * video track を停止するメソッド + * + * @remarks + * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します + * + * @param stream - video track を削除する MediaStream + * + * @public + */ stopVideoTrack(stream) { for (const track of stream.getVideoTracks()) { track.enabled = false; @@ -2045,6 +2088,17 @@ class ConnectionBase { }, 100); }); } + /** + * audio track を入れ替えするメソッド + * + * @remarks + * stream の audio track を停止後、新しい audio track をセットします + * + * @param stream - audio track を削除する MediaStream + * @param audioTrack - 新しい audio track + * + * @public + */ async replaceAudioTrack(stream, audioTrack) { await this.stopAudioTrack(stream); const transceiver = this.getAudioTransceiver(); @@ -2054,6 +2108,17 @@ class ConnectionBase { stream.addTrack(audioTrack); await transceiver.sender.replaceTrack(audioTrack); } + /** + * video track を入れ替えするメソッド + * + * @remarks + * stream の video track を停止後、新しい video track をセットします + * + * @param stream - video track を削除する MediaStream + * @param videoTrack - 新しい video track + * + * @public + */ async replaceVideoTrack(stream, videoTrack) { await this.stopVideoTrack(stream); const transceiver = this.getVideoTransceiver(); @@ -2063,6 +2128,9 @@ class ConnectionBase { stream.addTrack(videoTrack); await transceiver.sender.replaceTrack(videoTrack); } + /** + * stream を停止するメソッド + */ stopStream() { return new Promise((resolve, _) => { if (this.debug) { @@ -2079,7 +2147,7 @@ class ConnectionBase { }); } /** - * connect 処理中に例外が発生した場合の切断処理 + * connect 処理中に例外が発生した場合の切断処理をするメソッド */ async signalingTerminate() { await this.stopStream(); @@ -2103,7 +2171,9 @@ class ConnectionBase { this.initializeConnection(); } /** - * PeerConnection の state に異常が発生した場合の切断処理 + * PeerConnection の state に異常が発生した場合の切断処理をするメソッド + * + * @param title - disconnect callback に渡すイベントのタイトル */ async abendPeerConnectionState(title) { this.clearMonitorIceConnectionStateChange(); @@ -2164,6 +2234,9 @@ class ConnectionBase { } /** * 何かしらの異常があった場合の切断処理 + * + * @param title - disconnect callback に渡すイベントのタイトル + * @param params - 切断時の状況を入れる Record */ async abend(title, params) { this.clearMonitorIceConnectionStateChange(); @@ -2253,6 +2326,9 @@ class ConnectionBase { this.writeSoraTimelineLog("disconnect-abend", event); this.callbacks.disconnect(this.soraCloseEvent("abend", title, params)); } + /** + * 接続状態の初期化をするメソッド + */ initializeConnection() { this.clientId = null; this.connectionId = null; @@ -2272,6 +2348,14 @@ class ConnectionBase { this.signalingOfferMessageDataChannels = {}; this.clearConnectionTimeout(); } + /** + * WebSocket を切断するメソッド + * + * @remarks + * 正常/異常どちらの切断でも使用する + * + * @param title - type disconnect 時の reason + */ disconnectWebSocket(title) { let timerId = 0; if (this.signalingSwitched) { @@ -2315,6 +2399,12 @@ class ConnectionBase { } }); } + /** + * DataChannel を切断するメソッド + * + * @remarks + * 正常/異常どちらの切断でも使用する + */ disconnectDataChannel() { // DataChannel の強制終了処理 const closeDataChannels = () => { @@ -2418,6 +2508,12 @@ class ConnectionBase { } }); } + /** + * PeerConnection を切断するメソッド + * + * @remarks + * 正常/異常どちらの切断でも使用する + */ disconnectPeerConnection() { return new Promise((resolve, _) => { if (this.pc && this.pc.connectionState !== "closed") { @@ -2426,6 +2522,11 @@ class ConnectionBase { return resolve(); }); } + /** + * 切断処理をするメソッド + * + * @public + */ async disconnect() { this.clearMonitorIceConnectionStateChange(); await this.stopStream(); @@ -2492,6 +2593,9 @@ class ConnectionBase { this.callbacks.disconnect(event); } } + /** + * E2EE の初期設定をするメソッド + */ setupE2EE() { if (this.options.e2ee === true) { this.e2ee = new SoraE2EE(); @@ -2501,6 +2605,9 @@ class ConnectionBase { this.e2ee.startWorker(); } } + /** + * E2EE を開始するメソッド + */ startE2EE() { if (this.options.e2ee === true && this.e2ee) { if (!this.connectionId) { @@ -2513,6 +2620,19 @@ class ConnectionBase { this.e2ee.postSelfSecretKeyMaterial(this.connectionId, result.selfKeyId, result.selfSecretKeyMaterial); } } + /** + * シグナリングに使う WebSocket インスタンスを作成するメソッド + * + * @remarks + * シグナリング候補の URL 一覧に順に接続します + * + * 接続できた URL がない場合は例外が発生します + * + * @param signalingUrlCandidates - シグナリング候補の URL. 後方互換のため string | string[] を受け取る + * + * @returns + * 接続できた WebScoket インスタンスを返します + */ async getSignalingWebSocket(signalingUrlCandidates) { if (typeof signalingUrlCandidates === "string") { // signaling url の候補が文字列の場合 @@ -2619,6 +2739,20 @@ class ConnectionBase { } throw new ConnectError("Signaling failed. Invalid format signaling URL candidates"); } + /** + * シグナリング処理を行うメソッド + * + * @remarks + * シグナリング候補の URL 一覧に順に接続します + * + * 接続できた URL がない場合は例外が発生します + * + * @param ws - WebSocket インスタンス + * @param redirect - クラスター接続時にリダイレクトされた場合のフラグ + * + * @returns + * Sora から受け取った type offer メッセージを返します + */ async signaling(ws, redirect = false) { const offer = await this.createOffer(); this.trace("CREATE OFFER", offer); @@ -2704,6 +2838,11 @@ class ConnectionBase { })(); }); } + /** + * PeerConnection 接続処理をするメソッド + * + * @param message - シグナリング処理で受け取った type offer メッセージ + */ async connectPeerConnection(message) { let config = Object.assign({}, message.config); if (this.e2ee) { @@ -2751,6 +2890,11 @@ class ConnectionBase { }; return; } + /** + * setRemoteDescription 処理を行うメソッド + * + * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ + */ async setRemoteDescription(message) { if (!this.pc) { return; @@ -2760,6 +2904,14 @@ class ConnectionBase { this.writePeerConnectionTimelineLog("set-remote-description", sessionDescription); return; } + /** + * createAnswer 処理を行うメソッド + * + * @remarks + * サイマルキャスト用の setParameters 処理もここで行う + * + * @param message - シグナリング処理で受け取った type offer | type update | type re-offer メッセージ + */ async createAnswer(message) { if (!this.pc) { return; @@ -2799,6 +2951,9 @@ class ConnectionBase { this.writePeerConnectionTimelineLog("set-local-description", sessionDescription); return; } + /** + * シグナリングサーバーに type answer を投げるメソッド + */ sendAnswer() { if (this.pc && this.ws && this.pc.localDescription) { this.trace("ANSWER SDP", this.pc.localDescription.sdp); @@ -2808,6 +2963,9 @@ class ConnectionBase { } return; } + /** + * iceCnadidate 処理をするメソッド + */ onIceCandidate() { return new Promise((resolve, _) => { if (this.pc) { @@ -2843,6 +3001,12 @@ class ConnectionBase { } }); } + /** + * connectionState が "connected" になるのを監視するメソッド + * + * @remarks + * PeerConnection.connectionState が実装されていない場合は何もしない + */ waitChangeConnectionStateConnected() { return new Promise((resolve, reject) => { // connectionState が存在しない場合はそのまま抜ける @@ -2864,8 +3028,13 @@ class ConnectionBase { }, 10); }); } + /** + * 初回シグナリング接続時の WebSocket の切断を監視するメソッド + * + * @remarks + * 意図しない切断があった場合には異常終了処理を実行する + */ monitorSignalingWebSocketEvent() { - // シグナリング時に意図しない WebSocket の切断を監視する return new Promise((_, reject) => { this.monitorSignalingWebSocketEventTimerId = setInterval(() => { if (!this.ws) { @@ -2889,8 +3058,13 @@ class ConnectionBase { }, 100); }); } + /** + * WebSocket の切断を監視するメソッド + * + * @remarks + * 意図しない切断があった場合には異常終了処理を実行する + */ monitorWebSocketEvent() { - // 接続後の意図しない WebSocket の切断を監視する if (!this.ws) { return; } @@ -2903,8 +3077,13 @@ class ConnectionBase { await this.abend("WEBSOCKET-ONERROR"); }; } + /** + * 初回シグナリング後 PeerConnection の state を監視するメソッド + * + * @remarks + * connectionState, iceConnectionState を監視して不正な場合に切断する + */ monitorPeerConnectionState() { - // PeerConnection の ConnectionState, iceConnectionState を監視して不正な場合に切断する if (!this.pc) { return; } @@ -2945,6 +3124,9 @@ class ConnectionBase { } }; } + /** + * 初回シグナリングの接続タイムアウト処理をするメソッド + */ setConnectionTimeout() { return new Promise((_, reject) => { if (0 < this.connectionTimeout) { @@ -2965,15 +3147,30 @@ class ConnectionBase { } }); } + /** + * setConnectionTimeout でセットしたタイマーを止めるメソッド + */ clearConnectionTimeout() { clearTimeout(this.connectionTimeoutTimerId); } + /** + * monitorSignalingWebSocketEvent でセットしたタイマーを止めるメソッド + */ clearMonitorSignalingWebSocketEvent() { clearInterval(this.monitorSignalingWebSocketEventTimerId); } + /** + * monitorPeerConnectionState でセットしたタイマーを止めるメソッド + */ clearMonitorIceConnectionStateChange() { clearInterval(this.monitorIceConnectionStateChangeTimerId); } + /** + * trace log を出力するメソッド + * + * @param title - ログのタイトル + * @param message - ログの本文 + */ trace(title, message) { this.callbacks.log(title, message); if (!this.debug) { @@ -2981,30 +3178,75 @@ class ConnectionBase { } trace(this.clientId, title, message); } + /** + * WebSocket のシグナリングログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeWebSocketSignalingLog(eventType, data) { this.callbacks.signaling(createSignalingEvent(eventType, data, "websocket")); this.writeWebSocketTimelineLog(eventType, data); } + /** + * DataChannel のシグナリングログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeDataChannelSignalingLog(eventType, channel, data) { this.callbacks.signaling(createSignalingEvent(eventType, data, "datachannel")); this.writeDataChannelTimelineLog(eventType, channel, data); } + /** + * WebSocket のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeWebSocketTimelineLog(eventType, data) { const event = createTimelineEvent(eventType, data, "websocket"); this.callbacks.timeline(event); } + /** + * DataChannel のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeDataChannelTimelineLog(eventType, channel, data) { const event = createTimelineEvent(eventType, data, "datachannel", channel.id, channel.label); this.callbacks.timeline(event); } + /** + * PeerConnection のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writePeerConnectionTimelineLog(eventType, data) { const event = createTimelineEvent(eventType, data, "peerconnection"); this.callbacks.timeline(event); } + /** + * Sora との接続のタイムラインログ処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + */ writeSoraTimelineLog(eventType, data) { const event = createTimelineEvent(eventType, data, "sora"); this.callbacks.timeline(event); } + /** + * createOffer 処理をするメソッド + * + * @param eventType - イベントタイプ + * @param data - イベントデータ + * + * @returns + * 生成した RTCSessionDescription を返します + */ async createOffer() { const config = { iceServers: [] }; const pc = new window.RTCPeerConnection(config); @@ -3021,6 +3263,11 @@ class ConnectionBase { this.writePeerConnectionTimelineLog("create-offer", offer); return offer; } + /** + * シグナリングサーバーから受け取った type e2ee メッセージを処理をするメソッド + * + * @param data - E2EE 用バイナリメッセージ + */ signalingOnMessageE2EE(data) { if (this.e2ee) { const message = new Uint8Array(data); @@ -3031,6 +3278,11 @@ class ConnectionBase { }); } } + /** + * シグナリングサーバーから受け取った type offer メッセージを処理をするメソッド + * + * @param message - type offer メッセージ + */ signalingOnMessageTypeOffer(message) { this.clientId = message.client_id; this.connectionId = message.connection_id; @@ -3054,18 +3306,29 @@ class ConnectionBase { this.trace("SIGNALING OFFER MESSAGE", message); this.trace("OFFER SDP", message.sdp); } + /** + * シグナリングサーバーに type update を投げるメソッド + */ sendUpdateAnswer() { if (this.pc && this.ws && this.pc.localDescription) { this.trace("ANSWER SDP", this.pc.localDescription.sdp); this.sendSignalingMessage({ type: "update", sdp: this.pc.localDescription.sdp }); } } + /** + * シグナリングサーバーに type re-answer を投げるメソッド + */ sendReAnswer() { if (this.pc && this.pc.localDescription) { this.trace("RE ANSWER SDP", this.pc.localDescription.sdp); this.sendSignalingMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp }); } } + /** + * シグナリングサーバーから受け取った type update メッセージを処理をするメソッド + * + * @param message - type update メッセージ + */ async signalingOnMessageTypeUpdate(message) { this.trace("SIGNALING UPDATE MESSGE", message); this.trace("UPDATE SDP", message.sdp); @@ -3073,6 +3336,11 @@ class ConnectionBase { await this.createAnswer(message); this.sendUpdateAnswer(); } + /** + * シグナリングサーバーから受け取った type re-offer メッセージを処理をするメソッド + * + * @param message - type re-offer メッセージ + */ async signalingOnMessageTypeReOffer(message) { this.trace("SIGNALING RE OFFER MESSGE", message); this.trace("RE OFFER SDP", message.sdp); @@ -3080,6 +3348,11 @@ class ConnectionBase { await this.createAnswer(message); this.sendReAnswer(); } + /** + * シグナリングサーバーから受け取った type ping メッセージを処理をするメソッド + * + * @param message - type ping メッセージ + */ async signalingOnMessageTypePing(message) { const pongMessage = { type: "pong" }; if (message.stats) { @@ -3090,6 +3363,11 @@ class ConnectionBase { this.ws.send(JSON.stringify(pongMessage)); } } + /** + * シグナリングサーバーから受け取った type notify メッセージを処理をするメソッド + * + * @param message - type notify メッセージ + */ signalingOnMessageTypeNotify(message, transportType) { if (message.event_type === "connection.created") { const connectionId = message.connection_id; @@ -3131,6 +3409,11 @@ class ConnectionBase { } this.callbacks.notify(message, transportType); } + /** + * シグナリングサーバーから受け取った type switched メッセージを処理をするメソッド + * + * @param message - type switched メッセージ + */ signalingOnMessageTypeSwitched(message) { this.signalingSwitched = true; if (!this.ws) { @@ -3145,6 +3428,11 @@ class ConnectionBase { this.writeWebSocketSignalingLog("close"); } } + /** + * シグナリングサーバーから受け取った type redirect メッセージを処理をするメソッド + * + * @param message - type redirect メッセージ + */ async signalingOnMessageTypeRedirect(message) { if (this.ws) { this.ws.onclose = null; @@ -3156,6 +3444,12 @@ class ConnectionBase { const signalingMessage = await this.signaling(ws, true); return signalingMessage; } + /** + * sender の parameters に encodings をセットするメソッド + * + * @remarks + * サイマルキャスト用の処理 + */ async setSenderParameters(transceiver, encodings) { const originalParameters = transceiver.sender.getParameters(); // @ts-ignore @@ -3165,6 +3459,9 @@ class ConnectionBase { this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters", originalParameters); return; } + /** + * PeerConnection から RTCStatsReport を取得するためのメソッド + */ async getStats() { const stats = []; if (!this.pc) { @@ -3176,6 +3473,11 @@ class ConnectionBase { }); return stats; } + /** + * PeerConnection の ondatachannel callback メソッド + * + * @param dataChannelEvent - DataChannel イベント + */ onDataChannel(dataChannelEvent) { const dataChannel = dataChannelEvent.channel; this.writeDataChannelTimelineLog("ondatachannel", dataChannel, createDataChannelData(dataChannel)); @@ -3300,6 +3602,11 @@ class ConnectionBase { }; } } + /** + * シグナリングサーバーへメッセージを送信するメソッド + * + * @param message - 送信するメッセージ + */ sendSignalingMessage(message) { if (this.dataChannels.signaling) { if (this.signalingOfferMessageDataChannels.signaling && @@ -3318,6 +3625,11 @@ class ConnectionBase { this.writeWebSocketSignalingLog(`send-${message.type}`, message); } } + /** + * シグナリングサーバーに E2E 用メッセージを投げるメソッド + * + * @param message - 送信するバイナリメッセージ + */ sendE2EEMessage(message) { if (this.dataChannels.e2ee) { this.dataChannels.e2ee.send(message); @@ -3328,6 +3640,11 @@ class ConnectionBase { this.writeWebSocketSignalingLog("send-e2ee", message); } } + /** + * シグナリングサーバーに stats メッセージを投げるメソッド + * + * @param reports - RTCStatsReport のリスト + */ sendStatsMessage(reports) { if (this.dataChannels.stats) { const message = { @@ -3345,6 +3662,9 @@ class ConnectionBase { } } } + /** + * audio transceiver を取得するメソッド + */ getAudioTransceiver() { if (this.pc && this.mids.audio) { const transceiver = this.pc.getTransceivers().find((transceiver) => { @@ -3354,6 +3674,9 @@ class ConnectionBase { } return null; } + /** + * video transceiver を取得するメソッド + */ getVideoTransceiver() { if (this.pc && this.mids.video) { const transceiver = this.pc.getTransceivers().find((transceiver) => { @@ -3363,6 +3686,13 @@ class ConnectionBase { } return null; } + /** + * disconnect callback に渡す Event オブジェクトを生成するためのメソッド + * + * @param type - Event タイプ(normal | abend) + * @param title - Event タイトル + * @param initDict - Event に設定するオプションパラメーター + */ soraCloseEvent(type, title, initDict) { const soraCloseEvent = class SoraCloseEvent extends Event { constructor(type, title, initDict) { @@ -3383,6 +3713,12 @@ class ConnectionBase { }; return new soraCloseEvent(type, title, initDict); } + /** + * DataChannel を使用してメッセージを送信するメソッド + * + * @param label - メッセージを送信する DataChannel のラベル + * @param message - JSON + */ sendMessage(label, message) { const dataChannel = this.dataChannels[label]; // 接続していない場合は何もしない @@ -3402,33 +3738,56 @@ class ConnectionBase { dataChannel.send(JSON.stringify(message)); } } + /** + * E2EE の自分のフィンガープリント + */ get e2eeSelfFingerprint() { if (this.options.e2ee && this.e2ee) { return this.e2ee.selfFingerprint(); } return; } + /** + * E2EE のリモートのフィンガープリントリスト + */ get e2eeRemoteFingerprints() { if (this.options.e2ee && this.e2ee) { return this.e2ee.remoteFingerprints(); } return; } + /** + * audio が有効かどうか + */ get audio() { return this.getAudioTransceiver() !== null; } + /** + * video が有効かどうか + */ get video() { return this.getVideoTransceiver() !== null; } + /** + * シグナリングに使用する URL + * + * @deprecated + */ get signalingUrl() { return this.signalingUrlCandidates; } + /** + * 接続中のシグナリング URL + */ get connectedSignalingUrl() { if (!this.ws) { return ""; } return this.ws.url; } + /** + * DataChannel メッセージング用の DataChannel 情報のリスト + */ get messagingDataChannels() { const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); @@ -3739,7 +4098,15 @@ class ConnectionSubscriber extends ConnectionBase { } } -// MediaStream の constraints を動的に変更 +/** + * MediaStream の constraints を動的に変更するメソッド. + * + * @param mediastream - メディアストリーム + * + * @param constraints - メディアストリーム制約 + * + * @public + */ async function applyMediaStreamConstraints(mediastream, constraints) { if (constraints.audio && typeof constraints.audio !== "boolean") { for (const track of mediastream.getAudioTracks()) { @@ -3753,35 +4120,110 @@ async function applyMediaStreamConstraints(mediastream, constraints) { } } +/** + * Role 毎の Connection インスタンスを生成するためのクラス + * + * @param signalingUrlCandidates - シグナリングに使用する URL の候補 + * @param debug - デバッグフラグ + */ class SoraConnection { constructor(signalingUrlCandidates, debug = false) { this.signalingUrlCandidates = signalingUrlCandidates; this.debug = debug; } + /** + * role sendrecv で接続するための Connecion インスタンスを生成するメソッド + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role sendrecv な Connection オブジェクトを返します + * + * @public + */ sendrecv(channelId, metadata = null, options = { audio: true, video: true }) { return new ConnectionPublisher(this.signalingUrlCandidates, "sendrecv", channelId, metadata, options, this.debug); } + /** + * role sendonly で接続するための Connecion インスタンスを生成するメソッド + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role sendonly な Connection オブジェクトを返します + * + * @public + */ sendonly(channelId, metadata = null, options = { audio: true, video: true }) { return new ConnectionPublisher(this.signalingUrlCandidates, "sendonly", channelId, metadata, options, this.debug); } + /** + * role recvonly で接続するための Connecion インスタンスを生成するメソッド + * + * @param channelId - チャネルID + * @param metadata - メタデータ + * @param options - コネクションオプション + * + * @returns + * role recvonly な Connection オブジェクトを返します + * + * @public + */ recvonly(channelId, metadata = null, options = { audio: true, video: true }) { return new ConnectionSubscriber(this.signalingUrlCandidates, "recvonly", channelId, metadata, options, this.debug); } - // @deprecated 後方互換のため残す + /** + * シグナリングに使用する URL の候補 + * + * @public + * @deprecated + */ get signalingUrl() { return this.signalingUrlCandidates; } } +/** + * Sora JS SDK package + */ var sora = { + /** + * E2EE で使用する WASM の読み込みを行うメソッド + * + * @param wasmUrl - E2EE WASM の URL + * + * @public + */ initE2EE: async function (wasmUrl) { await SoraE2EE.loadWasm(wasmUrl); }, + /** + * SoraConnection インスタンスを生成するメソッド + * + * @param wasmUrl - シグナリングに使用する URL 候補 + * @param debug - デバッグフラグ + * + * @public + */ connection: function (signalingUrlCandidates, debug = false) { return new SoraConnection(signalingUrlCandidates, debug); }, + /** + * SDK のバージョンを返すメソッド + * + * @public + */ version: function () { - return "2021.2.0-canary.3"; + return "2021.2.0-canary.4"; }, + /** + * WebRTC のユーティリティ関数群 + * + * @public + */ helpers: { applyMediaStreamConstraints, }, diff --git a/package-lock.json b/package-lock.json index 66193d7a..169e12e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.3", + "version": "2021.2.0-canary.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sora-js-sdk", - "version": "2021.2.0-canary.3", + "version": "2021.2.0-canary.4", "license": "Apache-2.0", "workspaces": [ "packages/sdk", diff --git a/package.json b/package.json index 48e9a406..10872e32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.3", + "version": "2021.2.0-canary.4", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", From c4f8163fbbb587cb25d0d377f3293c5cb1cf3b62 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 1 Nov 2021 10:35:08 +0900 Subject: [PATCH 50/87] =?UTF-8?q?=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RELEASE.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 8ff0d407..6430cd09 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -22,7 +22,9 @@ - Next version を確認する - コミットメッセージをにして差分をコミットする(例. git commit -m "2020.2.0") - git flow release finish で終了する -- git push -u origin develop master --tags +- git push -u origin develop master +- git push origin +- npm publish を実行する ## canary リリース手順 @@ -31,4 +33,6 @@ - npm run release:canary を実行する - Next version を確認する - コミットメッセージをバージョンにして差分をコミットする(例. git commit -m "2020.1.0-canary.0") -- git push -u origin develop --tags +- git push -u origin develop master +- git push origin +- npm publish を実行する From fe9571f54e1c590c410d38edef96027c6b27f935 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 1 Nov 2021 10:36:35 +0900 Subject: [PATCH 51/87] =?UTF-8?q?=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RELEASE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index 6430cd09..b809733f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -35,4 +35,4 @@ - コミットメッセージをバージョンにして差分をコミットする(例. git commit -m "2020.1.0-canary.0") - git push -u origin develop master - git push origin -- npm publish を実行する +- npm publish --tag canary を実行する From 53fb39ad59085a3539c04c81fec2247d5a84a409 Mon Sep 17 00:00:00 2001 From: NAKAI Ryosuke Date: Thu, 4 Nov 2021 09:56:39 +0900 Subject: [PATCH 52/87] =?UTF-8?q?slack=20=E9=80=9A=E7=9F=A5=E3=82=A2?= =?UTF-8?q?=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E3=83=A1=E3=82=B8?= =?UTF-8?q?=E3=83=A3=E3=83=BC=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=AE=E3=81=BF=E3=81=AE=E6=8C=87=E5=AE=9A=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c8fba8b5..be00cb4a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,7 +28,7 @@ jobs: - run: npm run test -w packages/sdk - name: Slack Notification if: failure() - uses: rtCamp/action-slack-notify@v2.1.0 + uses: rtCamp/action-slack-notify@v2 env: SLACK_CHANNEL: sora-devtools SLACK_COLOR: danger From 7b321d076b9003b73c1796a2f7abc2cac9c58563 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 4 Nov 2021 11:02:43 +0900 Subject: [PATCH 53/87] =?UTF-8?q?sendMessage=20=E3=81=AE=E5=BC=95=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E5=9E=8B=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 20 +++++++++++++------- packages/sdk/src/types.ts | 2 +- packages/sdk/src/utils.ts | 5 ++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 9ecc3e3b..cc067ce1 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -1895,14 +1895,13 @@ export default class ConnectionBase { return; } const dataChannel = event.target as RTCDataChannel; - let data = event.data as string; + let data = event.data as string | ArrayBuffer | ArrayBufferView | Blob; const settings = this.signalingOfferMessageDataChannels[dataChannel.label]; if (settings !== undefined && settings.compress === true) { const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } - const message = JSON.parse(data) as JSONType; - this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, message)); + this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, data)); }; } } @@ -2032,10 +2031,13 @@ export default class ConnectionBase { /** * DataChannel を使用してメッセージを送信するメソッド * + * @remarks + * DataChannel の compress option が true の場合、第2引数の message は string のみ + * * @param label - メッセージを送信する DataChannel のラベル - * @param message - JSON + * @param message - string | Blob | ArrayBuffer | ArrayBufferView */ - sendMessage(label: string, message: JSONType): void { + sendMessage(label: string, message: string | Blob | ArrayBuffer | ArrayBufferView): void { const dataChannel = this.dataChannels[label]; // 接続していない場合は何もしない if (this.pc === null) { @@ -2046,11 +2048,15 @@ export default class ConnectionBase { } const settings = this.signalingOfferMessageDataChannels[label]; if (settings !== undefined && settings.compress === true) { - const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); + if (typeof message !== "string") { + throw new Error("'message' must be string if the DataChannel compress option is true"); + } + const binaryMessage = new TextEncoder().encode(message); const zlibMessage = zlibSync(binaryMessage, {}); dataChannel.send(zlibMessage); } else { - dataChannel.send(JSON.stringify(message)); + // @ts-ignore 引数のメッセージをそのまま投げる + dataChannel.send(message); } } diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index e4f1b60f..f5857c07 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -333,7 +333,7 @@ export interface SignalingEvent extends Event { export interface DataChannelMessageEvent extends Event { label: string; - data: JSONType; + data: string | ArrayBuffer | ArrayBufferView | Blob; } export interface TimelineEvent extends Event { diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index de63ef72..999deff3 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -432,7 +432,10 @@ export function createTimelineEvent( return event; } -export function createDataChannelMessageEvent(label: string, data: JSONType): DataChannelMessageEvent { +export function createDataChannelMessageEvent( + label: string, + data: string | ArrayBuffer | ArrayBufferView | Blob +): DataChannelMessageEvent { const event = new Event("message") as DataChannelMessageEvent; event.label = label; event.data = data; From b2f701ac75ef832c47b5e97a5e440c470dc6b9b0 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 4 Nov 2021 11:05:57 +0900 Subject: [PATCH 54/87] =?UTF-8?q?example=20=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...data_channel.html => data_channel_messaging.html} | 12 ++++++------ example/index.html | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) rename example/{messaging_data_channel.html => data_channel_messaging.html} (92%) diff --git a/example/messaging_data_channel.html b/example/data_channel_messaging.html similarity index 92% rename from example/messaging_data_channel.html rename to example/data_channel_messaging.html index 76de24ee..0be68002 100644 --- a/example/messaging_data_channel.html +++ b/example/data_channel_messaging.html @@ -1,11 +1,11 @@ - Messaging DataChannel + DataChannel messaging
    -

    Messaging DataChannel test

    +

    DataChannel messaging test

    複数のブラウザで開いて sendMessage することで動作確認できます

    @@ -33,9 +33,9 @@

    messages

    const sora = Sora.connection('ws://127.0.0.1:5000/signaling', debug); const options = { multistream: true, - messagingDataChannels: [ + dataChannels: [ { - label: "#messaging-data-channel-example", + label: "#example", direction: "sendrecv", compress: true, }, @@ -79,7 +79,7 @@

    messages

    document.querySelector('#sendrecv-remote-videos').removeChild(remoteVideo); } }); - sendrecv.on('messaging', (event) => { + sendrecv.on('message', (event) => { const message = document.createElement('li'); message.textContent = event.data; document.querySelector('#received-messages').appendChild(message); @@ -98,7 +98,7 @@

    messages

    document.querySelector('#send-message').addEventListener('click', function() { const value = document.querySelector('input[name=message]').value; if (value !== "") { - sendrecv.sendMessage('#messaging-data-channel-example', value); + sendrecv.sendMessage('#example', value); } }); diff --git a/example/index.html b/example/index.html index 623dbaff..36818304 100644 --- a/example/index.html +++ b/example/index.html @@ -14,7 +14,7 @@
  • スポットライト配信視聴サンプル
  • スポットライト視聴サンプル
  • サイマルキャスト配信/視聴サンプル
  • -
  • メッセージングデータチャネルサンプル
  • +
  • データチャネルメッセージングサンプル
  • From 827a1e9d95714b780492c6b364a16e8c7c010f2f Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 4 Nov 2021 11:07:18 +0900 Subject: [PATCH 55/87] 2021.2.0-canary.5 --- dist/base.d.ts | 7 +++++-- dist/sora.js | 22 ++++++++++++++-------- dist/sora.min.js | 2 +- dist/sora.mjs | 22 ++++++++++++++-------- dist/types.d.ts | 2 +- dist/utils.d.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 8 files changed, 39 insertions(+), 24 deletions(-) diff --git a/dist/base.d.ts b/dist/base.d.ts index ceca45fa..ad3bc964 100644 --- a/dist/base.d.ts +++ b/dist/base.d.ts @@ -520,10 +520,13 @@ export default class ConnectionBase { /** * DataChannel を使用してメッセージを送信するメソッド * + * @remarks + * DataChannel の compress option が true の場合、第2引数の message は string のみ + * * @param label - メッセージを送信する DataChannel のラベル - * @param message - JSON + * @param message - string | Blob | ArrayBuffer | ArrayBufferView */ - sendMessage(label: string, message: JSONType): void; + sendMessage(label: string, message: string | Blob | ArrayBuffer | ArrayBufferView): void; /** * E2EE の自分のフィンガープリント */ diff --git a/dist/sora.js b/dist/sora.js index 9b8a27f6..f3be9e09 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.4 + * @version: 2021.2.0-canary.5 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.4", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.5", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -3603,8 +3603,7 @@ const unzlibMessage = unzlibSync(new Uint8Array(event.data)); data = new TextDecoder().decode(unzlibMessage); } - const message = JSON.parse(data); - this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, message)); + this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, data)); }; } } @@ -3722,8 +3721,11 @@ /** * DataChannel を使用してメッセージを送信するメソッド * + * @remarks + * DataChannel の compress option が true の場合、第2引数の message は string のみ + * * @param label - メッセージを送信する DataChannel のラベル - * @param message - JSON + * @param message - string | Blob | ArrayBuffer | ArrayBufferView */ sendMessage(label, message) { const dataChannel = this.dataChannels[label]; @@ -3736,12 +3738,16 @@ } const settings = this.signalingOfferMessageDataChannels[label]; if (settings !== undefined && settings.compress === true) { - const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); + if (typeof message !== "string") { + throw new Error("'message' must be string if the DataChannel compress option is true"); + } + const binaryMessage = new TextEncoder().encode(message); const zlibMessage = zlibSync(binaryMessage, {}); dataChannel.send(zlibMessage); } else { - dataChannel.send(JSON.stringify(message)); + // @ts-ignore 引数のメッセージをそのまま投げる + dataChannel.send(message); } } /** @@ -4223,7 +4229,7 @@ * @public */ version: function () { - return "2021.2.0-canary.4"; + return "2021.2.0-canary.5"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/sora.min.js b/dist/sora.min.js index 08ab503f..b045b170 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sora=t()}(this,(function(){"use strict";class e{constructor(){if(!!!RTCRtpSender.prototype.createEncodedStreams)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQ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wuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[C-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!F[o[D-1]];--D);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*D+B(K,F)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(C,C+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),F=function(e,o,g,l,c){return function(e,o,g,l,c,d){var C=e.length,I=new t(l+C+5*(1+Math.ceil(C/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||C<8)for(var A=0;A<=C;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,F,A-F,u),N=O=E=0,F=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=D-M&32767;if(j>2&&U==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&D!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(D=M)-(M=V[D])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,d,v,T,X,E,N,F,A-F,u),!d&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function U(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=F(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function D(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var d=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(U=G(I)+4)-4]|e[U-3]<<8,X=U+T;if(X>g){r&&v(0);break}l&&d(m+T),n.set(e.subarray(U,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=U;else{var M=0,j=0;for(16==U?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==U?(j=3+y(e,I,7),I+=3):18==U&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&d(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=C[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&d(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.4",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.dataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}};return new Promise(((t,n)=>{if(!this.dataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.dataChannels)){const a=this.dataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.dataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0,this.ws&&e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.dataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];if(void 0!==i&&!0===i.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const s=JSON.parse(n);this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,s))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U((new TextEncoder).encode(JSON.stringify(e)),{});this.dataChannels.signaling.send(t)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});this.dataChannels.stats.send(e)}else this.dataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.dataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});n.send(e)}else n.send(JSON.stringify(t))}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.dataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class ee extends ${async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class te extends ${async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[C-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!F[o[D-1]];--D);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*D+B(K,F)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(C,C+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),F=function(e,o,g,l,c){return function(e,o,g,l,c,d){var C=e.length,I=new t(l+C+5*(1+Math.ceil(C/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||C<8)for(var A=0;A<=C;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,F,A-F,u),N=O=E=0,F=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=D-M&32767;if(j>2&&U==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&D!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(D=M)-(M=V[D])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,d,v,T,X,E,N,F,A-F,u),!d&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function U(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=F(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function D(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var d=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(U=G(I)+4)-4]|e[U-3]<<8,X=U+T;if(X>g){r&&v(0);break}l&&d(m+T),n.set(e.subarray(U,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=U;else{var M=0,j=0;for(16==U?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==U?(j=3+y(e,I,7),I+=3):18==U&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&d(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=C[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&d(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.5",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.dataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}};return new Promise(((t,n)=>{if(!this.dataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.dataChannels)){const a=this.dataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.dataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0,this.ws&&e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.dataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];if(void 0!==i&&!0===i.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U((new TextEncoder).encode(JSON.stringify(e)),{});this.dataChannels.signaling.send(t)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});this.dataChannels.stats.send(e)}else this.dataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.dataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){if("string"!=typeof t)throw new Error("'message' must be string if the DataChannel compress option is true");const e=U((new TextEncoder).encode(t),{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.dataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class ee extends ${async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class te extends ${async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1; export declare function createTimelineEvent(eventType: string, data: unknown, logType: TimelineEventLogType, dataChannelId?: number | null, dataChannelLabel?: string): TimelineEvent; -export declare function createDataChannelMessageEvent(label: string, data: JSONType): DataChannelMessageEvent; +export declare function createDataChannelMessageEvent(label: string, data: string | ArrayBuffer | ArrayBufferView | Blob): DataChannelMessageEvent; diff --git a/package-lock.json b/package-lock.json index 169e12e4..315123d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.4", + "version": "2021.2.0-canary.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sora-js-sdk", - "version": "2021.2.0-canary.4", + "version": "2021.2.0-canary.5", "license": "Apache-2.0", "workspaces": [ "packages/sdk", diff --git a/package.json b/package.json index 10872e32..7c5c43fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.4", + "version": "2021.2.0-canary.5", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", From 7681682510f99cf9392534d7ad38032c7c105686 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 4 Nov 2021 15:27:29 +0900 Subject: [PATCH 56/87] =?UTF-8?q?sendMessage=20=E3=81=AB=E6=B8=A1=E3=81=9B?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=AF=20uint8array=20=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 19 +++++-------------- packages/sdk/src/types.ts | 2 +- packages/sdk/src/utils.ts | 5 +---- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index cc067ce1..eab409a2 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -1895,11 +1895,10 @@ export default class ConnectionBase { return; } const dataChannel = event.target as RTCDataChannel; - let data = event.data as string | ArrayBuffer | ArrayBufferView | Blob; + let data = event.data as ArrayBuffer; const settings = this.signalingOfferMessageDataChannels[dataChannel.label]; if (settings !== undefined && settings.compress === true) { - const unzlibMessage = unzlibSync(new Uint8Array(event.data)); - data = new TextDecoder().decode(unzlibMessage); + data = unzlibSync(new Uint8Array(event.data)); } this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, data)); }; @@ -2031,13 +2030,10 @@ export default class ConnectionBase { /** * DataChannel を使用してメッセージを送信するメソッド * - * @remarks - * DataChannel の compress option が true の場合、第2引数の message は string のみ - * * @param label - メッセージを送信する DataChannel のラベル - * @param message - string | Blob | ArrayBuffer | ArrayBufferView + * @param message - Uint8Array */ - sendMessage(label: string, message: string | Blob | ArrayBuffer | ArrayBufferView): void { + sendMessage(label: string, message: Uint8Array): void { const dataChannel = this.dataChannels[label]; // 接続していない場合は何もしない if (this.pc === null) { @@ -2048,14 +2044,9 @@ export default class ConnectionBase { } const settings = this.signalingOfferMessageDataChannels[label]; if (settings !== undefined && settings.compress === true) { - if (typeof message !== "string") { - throw new Error("'message' must be string if the DataChannel compress option is true"); - } - const binaryMessage = new TextEncoder().encode(message); - const zlibMessage = zlibSync(binaryMessage, {}); + const zlibMessage = zlibSync(message, {}); dataChannel.send(zlibMessage); } else { - // @ts-ignore 引数のメッセージをそのまま投げる dataChannel.send(message); } } diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index f5857c07..15a2f9da 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -333,7 +333,7 @@ export interface SignalingEvent extends Event { export interface DataChannelMessageEvent extends Event { label: string; - data: string | ArrayBuffer | ArrayBufferView | Blob; + data: ArrayBuffer; } export interface TimelineEvent extends Event { diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index 999deff3..47f8d586 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -432,10 +432,7 @@ export function createTimelineEvent( return event; } -export function createDataChannelMessageEvent( - label: string, - data: string | ArrayBuffer | ArrayBufferView | Blob -): DataChannelMessageEvent { +export function createDataChannelMessageEvent(label: string, data: ArrayBuffer): DataChannelMessageEvent { const event = new Event("message") as DataChannelMessageEvent; event.label = label; event.data = data; From e62513f15142b4e8b73838731226123821bc54b6 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 4 Nov 2021 16:03:37 +0900 Subject: [PATCH 57/87] =?UTF-8?q?example=20=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/data_channel_messaging.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/data_channel_messaging.html b/example/data_channel_messaging.html index 0be68002..2b88677a 100644 --- a/example/data_channel_messaging.html +++ b/example/data_channel_messaging.html @@ -81,7 +81,7 @@

    messages

    }); sendrecv.on('message', (event) => { const message = document.createElement('li'); - message.textContent = event.data; + message.textContent = new TextDecoder().decode(event.data); document.querySelector('#received-messages').appendChild(message); }); sendrecv.on('disconnect', (event) => { @@ -95,10 +95,10 @@

    messages

    document.querySelector('#sendrecv-remote-videos').innerHTML = null; }); }); -document.querySelector('#send-message').addEventListener('click', function() { +document.querySelector('#send-message').addEventListener('click', async function() { const value = document.querySelector('input[name=message]').value; if (value !== "") { - sendrecv.sendMessage('#example', value); + sendrecv.sendMessage('#example', new TextEncoder().encode(value)); } }); From 7ae1c990b14115de07ae8b57611fc91d368202d5 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 4 Nov 2021 16:07:43 +0900 Subject: [PATCH 58/87] 2021.2.0-canary.6 --- dist/base.d.ts | 7 ++----- dist/sora.js | 21 ++++++--------------- dist/sora.min.js | 2 +- dist/sora.mjs | 21 ++++++--------------- dist/types.d.ts | 2 +- dist/utils.d.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 8 files changed, 20 insertions(+), 41 deletions(-) diff --git a/dist/base.d.ts b/dist/base.d.ts index ad3bc964..447b3dfe 100644 --- a/dist/base.d.ts +++ b/dist/base.d.ts @@ -520,13 +520,10 @@ export default class ConnectionBase { /** * DataChannel を使用してメッセージを送信するメソッド * - * @remarks - * DataChannel の compress option が true の場合、第2引数の message は string のみ - * * @param label - メッセージを送信する DataChannel のラベル - * @param message - string | Blob | ArrayBuffer | ArrayBufferView + * @param message - Uint8Array */ - sendMessage(label: string, message: string | Blob | ArrayBuffer | ArrayBufferView): void; + sendMessage(label: string, message: Uint8Array): void; /** * E2EE の自分のフィンガープリント */ diff --git a/dist/sora.js b/dist/sora.js index f3be9e09..7d1d2df9 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.5 + * @version: 2021.2.0-canary.6 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.5", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.6", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -3600,8 +3600,7 @@ let data = event.data; const settings = this.signalingOfferMessageDataChannels[dataChannel.label]; if (settings !== undefined && settings.compress === true) { - const unzlibMessage = unzlibSync(new Uint8Array(event.data)); - data = new TextDecoder().decode(unzlibMessage); + data = unzlibSync(new Uint8Array(event.data)); } this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, data)); }; @@ -3721,11 +3720,8 @@ /** * DataChannel を使用してメッセージを送信するメソッド * - * @remarks - * DataChannel の compress option が true の場合、第2引数の message は string のみ - * * @param label - メッセージを送信する DataChannel のラベル - * @param message - string | Blob | ArrayBuffer | ArrayBufferView + * @param message - Uint8Array */ sendMessage(label, message) { const dataChannel = this.dataChannels[label]; @@ -3738,15 +3734,10 @@ } const settings = this.signalingOfferMessageDataChannels[label]; if (settings !== undefined && settings.compress === true) { - if (typeof message !== "string") { - throw new Error("'message' must be string if the DataChannel compress option is true"); - } - const binaryMessage = new TextEncoder().encode(message); - const zlibMessage = zlibSync(binaryMessage, {}); + const zlibMessage = zlibSync(message, {}); dataChannel.send(zlibMessage); } else { - // @ts-ignore 引数のメッセージをそのまま投げる dataChannel.send(message); } } @@ -4229,7 +4220,7 @@ * @public */ version: function () { - return "2021.2.0-canary.5"; + return "2021.2.0-canary.6"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/sora.min.js b/dist/sora.min.js index b045b170..b8e1d475 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sora=t()}(this,(function(){"use strict";class e{constructor(){if(!!!RTCRtpSender.prototype.createEncodedStreams)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY29uc3QgcGFkZGluZ0xlbmd0aCA9IFVpbnQzMkFycmF5LkJZVEVTX1BFUl9FTEVNRU5UIC0gZGF0YVZpZXcuYnl0ZUxlbmd0aDsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGFkZGluZ0xlbmd0aDsgaSArPSAxKSB7CiAgICAgICAgbmV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25JZCwga2V5SWQsIGRlcml2ZUtleSB9OwogICAgICAgIHNlbGZEZXJpdmVLZXlNYXAuc2V0KCJsYXRlc3QiLCBuZXh0U2VsZkRlcml2ZUtleSk7CiAgICB9Cn0KZnVuY3Rpb24gc2lsZW5jZUZyYW1lKGVuY29kZWRGcmFtZSkgewogICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkLCByZWNlaXZlTWVzc2FnZSDlj5fkv6HliY3jga7loLTlkIgKICAgIGlmIChlbmNvZGVkRnJhbWUudHlwZSA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgLy8g6Z+z5aOw44Gv5pqX5Y+35YyW44Gv44GE44KL44Go6IGe44GR44Gf44KC44Gu44GY44KD44Gq44GE44Gu44Gn572u44GN5o+b44GI44KLCiAgICAgICAgY29uc3QgbmV3RGF0YSA9IG5ldyBBcnJheUJ1ZmZlcigzKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIE9wdXMg44K144Kk44Os44Oz44K544OV44Os44O844OgCiAgICAgICAgbmV3VWludDguc2V0KFsweGQ4LCAweGZmLCAweGZlXSk7CiAgICAgICAgZW5jb2RlZEZyYW1lLmRhdGEgPSBuZXdEYXRhOwogICAgfQogICAgZWxzZSB7CiAgICAgICAgLy8g5pig5YOP44GM5q2j5bi444GY44KD44Gq44GE44Gf44KBIFBMSSDjgrnjg4jjg7zjg6DjgYznmbrnlJ/jgZfjgabjgZfjgb7jgYYKICAgICAgICAvLyDjgZ3jga7jgZ/jgoEgMzIweDI0MCDjga7nnJ/jgaPpu5LjgarnlLvpnaLjgavnva7jgY3mj5vjgYjjgosKICAgICAgICBjb25zdCBuZXdEYXRhID0gbmV3IEFycmF5QnVmZmVyKDYwKTsKICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgIC8vIHByZXR0aWVyLWlnbm9yZQogICAgICAgIG5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kLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwog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dHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[C-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!F[o[D-1]];--D);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*D+B(K,F)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(C,C+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),F=function(e,o,g,l,c){return function(e,o,g,l,c,d){var C=e.length,I=new t(l+C+5*(1+Math.ceil(C/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||C<8)for(var A=0;A<=C;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,F,A-F,u),N=O=E=0,F=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=D-M&32767;if(j>2&&U==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&D!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(D=M)-(M=V[D])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,d,v,T,X,E,N,F,A-F,u),!d&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function U(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=F(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function D(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var d=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(U=G(I)+4)-4]|e[U-3]<<8,X=U+T;if(X>g){r&&v(0);break}l&&d(m+T),n.set(e.subarray(U,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=U;else{var M=0,j=0;for(16==U?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==U?(j=3+y(e,I,7),I+=3):18==U&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&d(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=C[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&d(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.5",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.dataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}};return new Promise(((t,n)=>{if(!this.dataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.dataChannels)){const a=this.dataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.dataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0,this.ws&&e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.dataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];if(void 0!==i&&!0===i.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U((new TextEncoder).encode(JSON.stringify(e)),{});this.dataChannels.signaling.send(t)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});this.dataChannels.stats.send(e)}else this.dataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.dataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){if("string"!=typeof t)throw new Error("'message' must be string if the DataChannel compress option is true");const e=U((new TextEncoder).encode(t),{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.dataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class ee extends ${async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class te extends ${async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[C-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!F[o[D-1]];--D);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*D+B(K,F)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(C,C+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),F=function(e,o,g,l,c){return function(e,o,g,l,c,d){var C=e.length,I=new t(l+C+5*(1+Math.ceil(C/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||C<8)for(var A=0;A<=C;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,F,A-F,u),N=O=E=0,F=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=D-M&32767;if(j>2&&U==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&D!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(D=M)-(M=V[D])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,d,v,T,X,E,N,F,A-F,u),!d&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function U(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=F(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function D(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var d=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(U=G(I)+4)-4]|e[U-3]<<8,X=U+T;if(X>g){r&&v(0);break}l&&d(m+T),n.set(e.subarray(U,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=U;else{var M=0,j=0;for(16==U?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==U?(j=3+y(e,I,7),I+=3):18==U&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&d(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=C[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&d(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.6",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.dataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}};return new Promise(((t,n)=>{if(!this.dataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.dataChannels)){const a=this.dataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.dataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0,this.ws&&e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.dataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=D(new Uint8Array(e.data))),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U((new TextEncoder).encode(JSON.stringify(e)),{});this.dataChannels.signaling.send(t)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});this.dataChannels.stats.send(e)}else this.dataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.dataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=U(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.dataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class ee extends ${async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class te extends ${async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1; export declare function createTimelineEvent(eventType: string, data: unknown, logType: TimelineEventLogType, dataChannelId?: number | null, dataChannelLabel?: string): TimelineEvent; -export declare function createDataChannelMessageEvent(label: string, data: string | ArrayBuffer | ArrayBufferView | Blob): DataChannelMessageEvent; +export declare function createDataChannelMessageEvent(label: string, data: ArrayBuffer): DataChannelMessageEvent; diff --git a/package-lock.json b/package-lock.json index 315123d4..0b66e7e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.5", + "version": "2021.2.0-canary.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sora-js-sdk", - "version": "2021.2.0-canary.5", + "version": "2021.2.0-canary.6", "license": "Apache-2.0", "workspaces": [ "packages/sdk", diff --git a/package.json b/package.json index 7c5c43fc..caf76bc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.5", + "version": "2021.2.0-canary.6", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", From 2c6ee13a9edbc6d1b23aa4ba18cd5c4c416d7779 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 10 Nov 2021 14:36:24 +0900 Subject: [PATCH 59/87] =?UTF-8?q?DataChannelMessaging=20=E3=81=A7=20compre?= =?UTF-8?q?ss=20=E6=99=82=E3=81=AB=E3=81=AF=20ArrayBuffer=20=E3=82=92?= =?UTF-8?q?=E8=BF=94=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index eab409a2..9652f75e 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -1898,7 +1898,7 @@ export default class ConnectionBase { let data = event.data as ArrayBuffer; const settings = this.signalingOfferMessageDataChannels[dataChannel.label]; if (settings !== undefined && settings.compress === true) { - data = unzlibSync(new Uint8Array(event.data)); + data = unzlibSync(new Uint8Array(event.data)).buffer; } this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, data)); }; From 103aaf9cdff7d9e432bcd3545526d6b6e2934ce6 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 10 Nov 2021 14:43:09 +0900 Subject: [PATCH 60/87] 2021.2.0-canary.7 --- dist/sora.js | 8 ++++---- dist/sora.min.js | 2 +- dist/sora.mjs | 8 ++++---- package-lock.json | 8 ++++---- package.json | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/sora.js b/dist/sora.js index 7d1d2df9..f01c7bcb 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.6 + * @version: 2021.2.0-canary.7 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.6", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.7", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -3600,7 +3600,7 @@ let data = event.data; const settings = this.signalingOfferMessageDataChannels[dataChannel.label]; if (settings !== undefined && settings.compress === true) { - data = unzlibSync(new Uint8Array(event.data)); + data = unzlibSync(new Uint8Array(event.data)).buffer; } this.callbacks.message(createDataChannelMessageEvent(dataChannel.label, data)); }; @@ -4220,7 +4220,7 @@ * @public */ version: function () { - return "2021.2.0-canary.6"; + return "2021.2.0-canary.7"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/sora.min.js b/dist/sora.min.js index b8e1d475..632f4745 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sora=t()}(this,(function(){"use strict";class e{constructor(){if(!!!RTCRtpSender.prototype.createEncodedStreams)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY29uc3QgcGFkZGluZ0xlbmd0aCA9IFVpbnQzMkFycmF5LkJZVEVT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gICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[C-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!F[o[D-1]];--D);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*D+B(K,F)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(C,C+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),F=function(e,o,g,l,c){return function(e,o,g,l,c,d){var C=e.length,I=new t(l+C+5*(1+Math.ceil(C/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||C<8)for(var A=0;A<=C;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,F,A-F,u),N=O=E=0,F=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=D-M&32767;if(j>2&&U==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&D!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(D=M)-(M=V[D])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,d,v,T,X,E,N,F,A-F,u),!d&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function U(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=F(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function D(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var d=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(U=G(I)+4)-4]|e[U-3]<<8,X=U+T;if(X>g){r&&v(0);break}l&&d(m+T),n.set(e.subarray(U,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=U;else{var M=0,j=0;for(16==U?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==U?(j=3+y(e,I,7),I+=3):18==U&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&d(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=C[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&d(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.6",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.dataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}};return new Promise(((t,n)=>{if(!this.dataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.dataChannels)){const a=this.dataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.dataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0,this.ws&&e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.dataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=D(new Uint8Array(e.data))),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U((new TextEncoder).encode(JSON.stringify(e)),{});this.dataChannels.signaling.send(t)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});this.dataChannels.stats.send(e)}else this.dataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.dataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=U(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.dataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class ee extends ${async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class te extends ${async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[C-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!F[o[D-1]];--D);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*D+B(K,F)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(C,C+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),F=function(e,o,g,l,c){return function(e,o,g,l,c,d){var C=e.length,I=new t(l+C+5*(1+Math.ceil(C/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||C<8)for(var A=0;A<=C;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,F,A-F,u),N=O=E=0,F=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=D-M&32767;if(j>2&&U==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&D!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(D=M)-(M=V[D])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,d,v,T,X,E,N,F,A-F,u),!d&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function U(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=F(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function D(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var d=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(U=G(I)+4)-4]|e[U-3]<<8,X=U+T;if(X>g){r&&v(0);break}l&&d(m+T),n.set(e.subarray(U,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=U;else{var M=0,j=0;for(16==U?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==U?(j=3+y(e,I,7),I+=3):18==U&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&d(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=C[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&d(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.7",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.dataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}};return new Promise(((t,n)=>{if(!this.dataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.dataChannels)){const a=this.dataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.dataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0,this.ws&&e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.dataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=D(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U((new TextEncoder).encode(JSON.stringify(e)),{});this.dataChannels.signaling.send(t)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});this.dataChannels.stats.send(e)}else this.dataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.dataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=U(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.dataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class ee extends ${async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class te extends ${async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1 Date: Thu, 11 Nov 2021 11:30:44 +0900 Subject: [PATCH 61/87] =?UTF-8?q?messagingDataChannel=20=E3=81=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=8F=AF=E8=83=BD=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AE=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=A8=E3=82=B3=E3=83=BC=E3=83=AB=E3=83=90=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 10 +++++++++- packages/sdk/src/types.ts | 5 +++++ packages/sdk/src/utils.ts | 7 +++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 9652f75e..47ffe7bf 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -3,6 +3,7 @@ import { unzlibSync, zlibSync } from "fflate"; import { ConnectError, createDataChannelData, + createDataChannelEvent, createDataChannelMessageEvent, createSignalingEvent, createSignalingMessage, @@ -225,6 +226,7 @@ export default class ConnectionBase { timeline: (): void => {}, signaling: (): void => {}, message: (): void => {}, + datachannel: (): void => {}, }; this.authMetadata = null; this.e2ee = null; @@ -248,7 +250,7 @@ export default class ConnectionBase { * * removestream イベントは非推奨です.removetrack イベントを使用してください * - * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message) + * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message, datachannel) * @param callback - コールバック関数 * * @public @@ -1723,6 +1725,9 @@ export default class ConnectionBase { } this.writeWebSocketSignalingLog("close"); } + for (const channel of this.messagingDataChannels) { + this.callbacks.datachannel(createDataChannelEvent(channel)); + } } /** @@ -2108,6 +2113,9 @@ export default class ConnectionBase { * DataChannel メッセージング用の DataChannel 情報のリスト */ get messagingDataChannels(): DataChannelConfiguration[] { + if (!this.signalingSwitched) { + return []; + } const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); }); diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 15a2f9da..bd00bd96 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -311,6 +311,7 @@ export type Callbacks = { timeline: (event: TimelineEvent) => void; signaling: (event: SignalingEvent) => void; message: (event: DataChannelMessageEvent) => void; + datachannel: (event: DataChannelEvent) => void; }; export type PreKeyBundle = { @@ -336,6 +337,10 @@ export interface DataChannelMessageEvent extends Event { data: ArrayBuffer; } +export interface DataChannelEvent extends Event { + datachannel: DataChannelConfiguration; +} + export interface TimelineEvent extends Event { logType: TimelineEventLogType; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index 47f8d586..7989c98b 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -3,6 +3,7 @@ import { Browser, JSONType, DataChannelConfiguration, + DataChannelEvent, DataChannelMessageEvent, PreKeyBundle, SignalingConnectMessage, @@ -438,3 +439,9 @@ export function createDataChannelMessageEvent(label: string, data: ArrayBuffer): event.data = data; return event; } + +export function createDataChannelEvent(channel: DataChannelConfiguration): DataChannelEvent { + const event = new Event("datachannel") as DataChannelEvent; + event.datachannel = channel; + return event; +} From 033dddf538b8711f8da8eb53d3bfcd59dd579f16 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 11 Nov 2021 11:42:19 +0900 Subject: [PATCH 62/87] =?UTF-8?q?dataChannels=20=E3=82=92=20soraDataChanne?= =?UTF-8?q?ls=20=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 130 ++++++++++++++++++++++----------------- 1 file changed, 73 insertions(+), 57 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 47ffe7bf..a8a17948 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -140,7 +140,7 @@ export default class ConnectionBase { /** * 接続中の DataChannel リスト */ - protected dataChannels: { + private soraDataChannels: { [key in string]?: RTCDataChannel; }; /** @@ -233,7 +233,7 @@ export default class ConnectionBase { this.connectionTimeoutTimerId = 0; this.monitorSignalingWebSocketEventTimerId = 0; this.monitorIceConnectionStateChangeTimerId = 0; - this.dataChannels = {}; + this.soraDataChannels = {}; this.mids = { audio: "", video: "", @@ -403,12 +403,12 @@ export default class ConnectionBase { */ private async signalingTerminate(): Promise { await this.stopStream(); - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } if (this.ws) { this.ws.close(); @@ -446,8 +446,8 @@ export default class ConnectionBase { this.ws.onmessage = null; this.ws.onerror = null; } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { // onclose はログを吐く専用に残す dataChannel.onclose = (event) => { @@ -460,12 +460,12 @@ export default class ConnectionBase { } } // DataChannel を終了する - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } // WebSocket を終了する if (this.ws) { @@ -510,8 +510,8 @@ export default class ConnectionBase { this.ws.onmessage = null; this.ws.onerror = null; } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { // onclose はログを吐く専用に残す dataChannel.onclose = (event) => { @@ -524,7 +524,7 @@ export default class ConnectionBase { } } // 終了処理を開始する - if (this.dataChannels.signaling) { + if (this.soraDataChannels.signaling) { const message = { type: "disconnect", reason: title }; if ( this.signalingOfferMessageDataChannels.signaling && @@ -532,36 +532,44 @@ export default class ConnectionBase { ) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(zlibMessage); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(zlibMessage); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = (e as Error).message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog( + "failed-to-send-disconnect", + this.soraDataChannels.signaling, + errorMessage + ); } } } else { - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(JSON.stringify(message)); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(JSON.stringify(message)); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = (e as Error).message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog( + "failed-to-send-disconnect", + this.soraDataChannels.signaling, + errorMessage + ); } } } } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.onerror = null; dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } await this.disconnectWebSocket(title); await this.disconnectPeerConnection(); @@ -593,7 +601,7 @@ export default class ConnectionBase { this.encodings = []; this.authMetadata = null; this.e2ee = null; - this.dataChannels = {}; + this.soraDataChannels = {}; this.mids = { audio: "", video: "", @@ -663,18 +671,18 @@ export default class ConnectionBase { private disconnectDataChannel(): Promise<{ code: number; reason: string } | null> { // DataChannel の強制終了処理 const closeDataChannels = () => { - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.onerror = null; dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } }; return new Promise((resolve, reject) => { // DataChannel label signaling が存在しない場合は強制終了処理をする - if (!this.dataChannels.signaling) { + if (!this.soraDataChannels.signaling) { closeDataChannels(); return resolve({ code: 4999, reason: "" }); } @@ -685,8 +693,8 @@ export default class ConnectionBase { }, this.disconnectWaitTimeout); const onClosePromises: Promise[] = []; - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { // onerror が発火した場合は強制終了処理をする dataChannel.onerror = () => { @@ -721,7 +729,7 @@ export default class ConnectionBase { Promise.all(onClosePromises) .then(() => { // dataChannels が空の場合は切断処理が終わっているとみなす - if (0 === Object.keys(this.dataChannels).length) { + if (0 === Object.keys(this.soraDataChannels).length) { resolve(null); } else { resolve({ code: 4999, reason: "" }); @@ -738,25 +746,33 @@ export default class ConnectionBase { ) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(zlibMessage); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(zlibMessage); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = (e as Error).message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog( + "failed-to-send-disconnect", + this.soraDataChannels.signaling, + errorMessage + ); } } } else { - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(JSON.stringify(message)); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(JSON.stringify(message)); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = (e as Error).message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog( + "failed-to-send-disconnect", + this.soraDataChannels.signaling, + errorMessage + ); } } } @@ -801,8 +817,8 @@ export default class ConnectionBase { this.ws.onmessage = null; this.ws.onerror = null; } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.onmessage = null; // onclose はログを吐く専用に残す @@ -1725,7 +1741,7 @@ export default class ConnectionBase { } this.writeWebSocketSignalingLog("close"); } - for (const channel of this.messagingDataChannels) { + for (const channel of this.datachannels) { this.callbacks.datachannel(createDataChannelEvent(channel)); } } @@ -1799,7 +1815,7 @@ export default class ConnectionBase { const channel = event.currentTarget as RTCDataChannel; channel.bufferedAmountLowThreshold = 65536; channel.binaryType = "arraybuffer"; - this.dataChannels[channel.label] = channel; + this.soraDataChannels[channel.label] = channel; this.trace("OPEN DATA CHANNEL", channel.label); if (channel.label === "signaling" && this.ws) { this.writeDataChannelSignalingLog("onopen", channel); @@ -1916,18 +1932,18 @@ export default class ConnectionBase { * @param message - 送信するメッセージ */ private sendSignalingMessage(message: { type: string; [key: string]: unknown }): void { - if (this.dataChannels.signaling) { + if (this.soraDataChannels.signaling) { if ( this.signalingOfferMessageDataChannels.signaling && this.signalingOfferMessageDataChannels.signaling.compress === true ) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - this.dataChannels.signaling.send(zlibMessage); + this.soraDataChannels.signaling.send(zlibMessage); } else { - this.dataChannels.signaling.send(JSON.stringify(message)); + this.soraDataChannels.signaling.send(JSON.stringify(message)); } - this.writeDataChannelSignalingLog(`send-${message.type}`, this.dataChannels.signaling, message); + this.writeDataChannelSignalingLog(`send-${message.type}`, this.soraDataChannels.signaling, message); } else if (this.ws !== null) { this.ws.send(JSON.stringify(message)); this.writeWebSocketSignalingLog(`send-${message.type}`, message); @@ -1940,9 +1956,9 @@ export default class ConnectionBase { * @param message - 送信するバイナリメッセージ */ private sendE2EEMessage(message: ArrayBuffer): void { - if (this.dataChannels.e2ee) { - this.dataChannels.e2ee.send(message); - this.writeDataChannelSignalingLog("send-e2ee", this.dataChannels.e2ee, message); + if (this.soraDataChannels.e2ee) { + this.soraDataChannels.e2ee.send(message); + this.writeDataChannelSignalingLog("send-e2ee", this.soraDataChannels.e2ee, message); } else if (this.ws !== null) { this.ws.send(message); this.writeWebSocketSignalingLog("send-e2ee", message); @@ -1955,7 +1971,7 @@ export default class ConnectionBase { * @param reports - RTCStatsReport のリスト */ private sendStatsMessage(reports: RTCStatsReport[]): void { - if (this.dataChannels.stats) { + if (this.soraDataChannels.stats) { const message = { type: "stats", reports: reports, @@ -1966,9 +1982,9 @@ export default class ConnectionBase { ) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - this.dataChannels.stats.send(zlibMessage); + this.soraDataChannels.stats.send(zlibMessage); } else { - this.dataChannels.stats.send(JSON.stringify(message)); + this.soraDataChannels.stats.send(JSON.stringify(message)); } } } @@ -2039,7 +2055,7 @@ export default class ConnectionBase { * @param message - Uint8Array */ sendMessage(label: string, message: Uint8Array): void { - const dataChannel = this.dataChannels[label]; + const dataChannel = this.soraDataChannels[label]; // 接続していない場合は何もしない if (this.pc === null) { return; @@ -2112,7 +2128,7 @@ export default class ConnectionBase { /** * DataChannel メッセージング用の DataChannel 情報のリスト */ - get messagingDataChannels(): DataChannelConfiguration[] { + get datachannels(): DataChannelConfiguration[] { if (!this.signalingSwitched) { return []; } @@ -2121,7 +2137,7 @@ export default class ConnectionBase { }); const result: DataChannelConfiguration[] = []; for (const label of messagingDataChannellabels) { - const dataChannel = this.dataChannels[label]; + const dataChannel = this.soraDataChannels[label]; if (!dataChannel) { continue; } From 3f4e30a6446d457671377e66dbb26c4b9b81ce21 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 11 Nov 2021 11:58:35 +0900 Subject: [PATCH 63/87] =?UTF-8?q?DataChannelEvent=20=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E3=81=AE=E5=9E=8B=E3=82=92=20export=20=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/sora.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/sdk/src/sora.ts b/packages/sdk/src/sora.ts index 0b04d602..28646a97 100644 --- a/packages/sdk/src/sora.ts +++ b/packages/sdk/src/sora.ts @@ -8,9 +8,11 @@ import type { AudioCodecType, Callbacks, ConnectionOptions, - JSONType, DataChannelConfiguration, DataChannelDirection, + DataChannelEvent, + DataChannelMessageEvent, + JSONType, Role, SignalingEvent, SignalingNotifyConnectionCreated, @@ -175,6 +177,8 @@ export type { ConnectionSubscriber, DataChannelConfiguration, DataChannelDirection, + DataChannelEvent, + DataChannelMessageEvent, Role, SignalingEvent, SignalingNotifyConnectionCreated, From f1a8a4df58c3e37b87d47fab9cc3b26fe24a5a93 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 11 Nov 2021 12:33:46 +0900 Subject: [PATCH 64/87] =?UTF-8?q?CHANGES=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 41e599eb..c5465f2a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,7 +14,9 @@ - @yuitowest - [ADD] DataChannel メッセージング機能を追加する - sendrecv オブジェクトに sendMessage API を追加する + - sendrecv オブジェクトに datachannel プロパティを追加する - on callback に "message" を追加する + - on callback に "datachannel" を追加する - @yuitowest - [CHANGE] 複数 Signaling URL への接続に対応する - Connection オブジェクト第一引数の type を `string` から `string | string[]` に変更する From d64a3c7d2f6e3bc2c07b4b0a8541bfb0f5bfefe8 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 11 Nov 2021 12:34:09 +0900 Subject: [PATCH 65/87] 2021.2.0-canary.8 --- dist/base.d.ts | 8 ++- dist/sora.d.ts | 4 +- dist/sora.js | 130 +++++++++++++++++++++++++--------------------- dist/sora.min.js | 2 +- dist/sora.mjs | 130 +++++++++++++++++++++++++--------------------- dist/types.d.ts | 4 ++ dist/utils.d.ts | 3 +- package-lock.json | 4 +- package.json | 2 +- 9 files changed, 157 insertions(+), 130 deletions(-) diff --git a/dist/base.d.ts b/dist/base.d.ts index 447b3dfe..39f5f626 100644 --- a/dist/base.d.ts +++ b/dist/base.d.ts @@ -99,9 +99,7 @@ export default class ConnectionBase { /** * 接続中の DataChannel リスト */ - protected dataChannels: { - [key in string]?: RTCDataChannel; - }; + private soraDataChannels; /** * 初回シグナリング接続時のタイムアウトに使用するタイムアウト時間(デフォルト 60000ms) */ @@ -135,7 +133,7 @@ export default class ConnectionBase { * * removestream イベントは非推奨です.removetrack イベントを使用してください * - * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message) + * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message, datachannel) * @param callback - コールバック関数 * * @public @@ -553,5 +551,5 @@ export default class ConnectionBase { /** * DataChannel メッセージング用の DataChannel 情報のリスト */ - get messagingDataChannels(): DataChannelConfiguration[]; + get datachannels(): DataChannelConfiguration[]; } diff --git a/dist/sora.d.ts b/dist/sora.d.ts index fcc8dfd5..f7599f55 100644 --- a/dist/sora.d.ts +++ b/dist/sora.d.ts @@ -2,7 +2,7 @@ import ConnectionBase from "./base"; import ConnectionPublisher from "./publisher"; import ConnectionSubscriber from "./subscriber"; import { applyMediaStreamConstraints } from "./helpers"; -import type { AudioCodecType, Callbacks, ConnectionOptions, JSONType, DataChannelConfiguration, DataChannelDirection, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; +import type { AudioCodecType, Callbacks, ConnectionOptions, DataChannelConfiguration, DataChannelDirection, DataChannelEvent, DataChannelMessageEvent, JSONType, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; /** * Role 毎の Connection インスタンスを生成するためのクラス * @@ -103,4 +103,4 @@ declare const _default: { * Sora JS SDK package */ export default _default; -export type { AudioCodecType, Callbacks, ConnectionBase, ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, DataChannelConfiguration, DataChannelDirection, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SoraConnection, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType, }; +export type { AudioCodecType, Callbacks, ConnectionBase, ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, DataChannelConfiguration, DataChannelDirection, DataChannelEvent, DataChannelMessageEvent, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SoraConnection, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType, }; diff --git a/dist/sora.js b/dist/sora.js index f01c7bcb..9cd4e7e0 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.7 + * @version: 2021.2.0-canary.8 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.7", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.8", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -1930,6 +1930,11 @@ event.data = data; return event; } + function createDataChannelEvent(channel) { + const event = new Event("datachannel"); + event.datachannel = channel; + return event; + } /** * Sora との WebRTC 接続を扱う基底クラス @@ -1989,13 +1994,14 @@ timeline: () => { }, signaling: () => { }, message: () => { }, + datachannel: () => { }, }; this.authMetadata = null; this.e2ee = null; this.connectionTimeoutTimerId = 0; this.monitorSignalingWebSocketEventTimerId = 0; this.monitorIceConnectionStateChangeTimerId = 0; - this.dataChannels = {}; + this.soraDataChannels = {}; this.mids = { audio: "", video: "", @@ -2011,7 +2017,7 @@ * * removestream イベントは非推奨です.removetrack イベントを使用してください * - * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message) + * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message, datachannel) * @param callback - コールバック関数 * * @public @@ -2157,12 +2163,12 @@ */ async signalingTerminate() { await this.stopStream(); - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } if (this.ws) { this.ws.close(); @@ -2199,8 +2205,8 @@ this.ws.onmessage = null; this.ws.onerror = null; } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { // onclose はログを吐く専用に残す dataChannel.onclose = (event) => { @@ -2213,12 +2219,12 @@ } } // DataChannel を終了する - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } // WebSocket を終了する if (this.ws) { @@ -2262,8 +2268,8 @@ this.ws.onmessage = null; this.ws.onerror = null; } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { // onclose はログを吐く専用に残す dataChannel.onclose = (event) => { @@ -2276,45 +2282,45 @@ } } // 終了処理を開始する - if (this.dataChannels.signaling) { + if (this.soraDataChannels.signaling) { const message = { type: "disconnect", reason: title }; if (this.signalingOfferMessageDataChannels.signaling && this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(zlibMessage); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(zlibMessage); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = e.message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.soraDataChannels.signaling, errorMessage); } } } else { - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(JSON.stringify(message)); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(JSON.stringify(message)); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = e.message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.soraDataChannels.signaling, errorMessage); } } } } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.onerror = null; dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } await this.disconnectWebSocket(title); await this.disconnectPeerConnection(); @@ -2345,7 +2351,7 @@ this.encodings = []; this.authMetadata = null; this.e2ee = null; - this.dataChannels = {}; + this.soraDataChannels = {}; this.mids = { audio: "", video: "", @@ -2414,18 +2420,18 @@ disconnectDataChannel() { // DataChannel の強制終了処理 const closeDataChannels = () => { - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.onerror = null; dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } }; return new Promise((resolve, reject) => { // DataChannel label signaling が存在しない場合は強制終了処理をする - if (!this.dataChannels.signaling) { + if (!this.soraDataChannels.signaling) { closeDataChannels(); return resolve({ code: 4999, reason: "" }); } @@ -2435,8 +2441,8 @@ return reject(); }, this.disconnectWaitTimeout); const onClosePromises = []; - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { // onerror が発火した場合は強制終了処理をする dataChannel.onerror = () => { @@ -2471,7 +2477,7 @@ Promise.all(onClosePromises) .then(() => { // dataChannels が空の場合は切断処理が終わっているとみなす - if (0 === Object.keys(this.dataChannels).length) { + if (0 === Object.keys(this.soraDataChannels).length) { resolve(null); } else { @@ -2487,28 +2493,28 @@ this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(zlibMessage); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(zlibMessage); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = e.message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.soraDataChannels.signaling, errorMessage); } } } else { - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(JSON.stringify(message)); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(JSON.stringify(message)); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = e.message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.soraDataChannels.signaling, errorMessage); } } } @@ -2551,8 +2557,8 @@ this.ws.onmessage = null; this.ws.onerror = null; } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.onmessage = null; // onclose はログを吐く専用に残す @@ -3433,6 +3439,9 @@ } this.writeWebSocketSignalingLog("close"); } + for (const channel of this.datachannels) { + this.callbacks.datachannel(createDataChannelEvent(channel)); + } } /** * シグナリングサーバーから受け取った type redirect メッセージを処理をするメソッド @@ -3497,7 +3506,7 @@ const channel = event.currentTarget; channel.bufferedAmountLowThreshold = 65536; channel.binaryType = "arraybuffer"; - this.dataChannels[channel.label] = channel; + this.soraDataChannels[channel.label] = channel; this.trace("OPEN DATA CHANNEL", channel.label); if (channel.label === "signaling" && this.ws) { this.writeDataChannelSignalingLog("onopen", channel); @@ -3612,17 +3621,17 @@ * @param message - 送信するメッセージ */ sendSignalingMessage(message) { - if (this.dataChannels.signaling) { + if (this.soraDataChannels.signaling) { if (this.signalingOfferMessageDataChannels.signaling && this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - this.dataChannels.signaling.send(zlibMessage); + this.soraDataChannels.signaling.send(zlibMessage); } else { - this.dataChannels.signaling.send(JSON.stringify(message)); + this.soraDataChannels.signaling.send(JSON.stringify(message)); } - this.writeDataChannelSignalingLog(`send-${message.type}`, this.dataChannels.signaling, message); + this.writeDataChannelSignalingLog(`send-${message.type}`, this.soraDataChannels.signaling, message); } else if (this.ws !== null) { this.ws.send(JSON.stringify(message)); @@ -3635,9 +3644,9 @@ * @param message - 送信するバイナリメッセージ */ sendE2EEMessage(message) { - if (this.dataChannels.e2ee) { - this.dataChannels.e2ee.send(message); - this.writeDataChannelSignalingLog("send-e2ee", this.dataChannels.e2ee, message); + if (this.soraDataChannels.e2ee) { + this.soraDataChannels.e2ee.send(message); + this.writeDataChannelSignalingLog("send-e2ee", this.soraDataChannels.e2ee, message); } else if (this.ws !== null) { this.ws.send(message); @@ -3650,7 +3659,7 @@ * @param reports - RTCStatsReport のリスト */ sendStatsMessage(reports) { - if (this.dataChannels.stats) { + if (this.soraDataChannels.stats) { const message = { type: "stats", reports: reports, @@ -3659,10 +3668,10 @@ this.signalingOfferMessageDataChannels.stats.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - this.dataChannels.stats.send(zlibMessage); + this.soraDataChannels.stats.send(zlibMessage); } else { - this.dataChannels.stats.send(JSON.stringify(message)); + this.soraDataChannels.stats.send(JSON.stringify(message)); } } } @@ -3724,7 +3733,7 @@ * @param message - Uint8Array */ sendMessage(label, message) { - const dataChannel = this.dataChannels[label]; + const dataChannel = this.soraDataChannels[label]; // 接続していない場合は何もしない if (this.pc === null) { return; @@ -3791,13 +3800,16 @@ /** * DataChannel メッセージング用の DataChannel 情報のリスト */ - get messagingDataChannels() { + get datachannels() { + if (!this.signalingSwitched) { + return []; + } const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); }); const result = []; for (const label of messagingDataChannellabels) { - const dataChannel = this.dataChannels[label]; + const dataChannel = this.soraDataChannels[label]; if (!dataChannel) { continue; } @@ -4220,7 +4232,7 @@ * @public */ version: function () { - return "2021.2.0-canary.7"; + return "2021.2.0-canary.8"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/sora.min.js b/dist/sora.min.js index 632f4745..a0740245 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sora=t()}(this,(function(){"use strict";class e{constructor(){if(!!!RTCRtpSender.prototype.createEncodedStreams)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLX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WQgPSB0ZXh0RGVjb2Rlci5kZWNvZGUoY29ubmVjdGlvbklkQnVmZmVyKTsKICAgICAgICBjb25zdCBbcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXR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gdHlwZSB9ID0gZXZlbnQuZGF0YTsKICAgIGlmICh0eXBlID09PSAic2VsZlNlY3JldEtleU1hdGVyaWFsIikgewogICAgICAgIGNvbnN0IHsgc2VsZlNlY3JldEtleU1hdGVyaWFsLCBzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdhaXRpbmdUaW1lIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXl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JVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[C-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!F[o[D-1]];--D);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*D+B(K,F)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(C,C+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),F=function(e,o,g,l,c){return function(e,o,g,l,c,d){var C=e.length,I=new t(l+C+5*(1+Math.ceil(C/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||C<8)for(var A=0;A<=C;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,F,A-F,u),N=O=E=0,F=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=D-M&32767;if(j>2&&U==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&D!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(D=M)-(M=V[D])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,d,v,T,X,E,N,F,A-F,u),!d&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function U(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=F(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function D(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var d=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(U=G(I)+4)-4]|e[U-3]<<8,X=U+T;if(X>g){r&&v(0);break}l&&d(m+T),n.set(e.subarray(U,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=U;else{var M=0,j=0;for(16==U?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==U?(j=3+y(e,I,7),I+=3):18==U&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&d(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=C[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&d(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.7",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&t.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.dataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onerror=null,t.close()),delete this.dataChannels[e]}};return new Promise(((t,n)=>{if(!this.dataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.dataChannels)){const a=this.dataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.dataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=U((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const t=this.dataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0,this.ws&&e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.dataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=D(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=D(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=D(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.dataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U((new TextEncoder).encode(JSON.stringify(e)),{});this.dataChannels.signaling.send(t)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=U((new TextEncoder).encode(JSON.stringify(t)),{});this.dataChannels.stats.send(e)}else this.dataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.dataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=U(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get messagingDataChannels(){const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.dataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class ee extends ${async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class te extends ${async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[d-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!D[o[U-1]];--U);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*U+B(K,D)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(d,d+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),D=function(e,o,g,l,c){return function(e,o,g,l,c,C){var d=e.length,I=new t(l+d+5*(1+Math.ceil(d/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||d<8)for(var A=0;A<=d;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,D,A-D,u),N=O=E=0,D=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=U-M&32767;if(j>2&&F==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&U!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(U=M)-(M=V[U])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,C,v,T,X,E,N,D,A-D,u),!C&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function F(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=D(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function U(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var C=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(F=G(I)+4)-4]|e[F-3]<<8,X=F+T;if(X>g){r&&v(0);break}l&&C(m+T),n.set(e.subarray(F,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=F;else{var M=0,j=0;for(16==F?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==F?(j=3+y(e,I,7),I+=3):18==F&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&C(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=d[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&C(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.8",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const C=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&C&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const d=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&d&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise(((t,n)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.soraDataChannels)){const a=this.soraDataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws){e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"));for(const e of this.datachannels)this.callbacks.datachannel($(e))}}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=U(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=F((new TextEncoder).encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=F(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get datachannels(){if(!this.signalingSwitched)return[];const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.soraDataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class te extends ee{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ne extends ee{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1 { }, signaling: () => { }, message: () => { }, + datachannel: () => { }, }; this.authMetadata = null; this.e2ee = null; this.connectionTimeoutTimerId = 0; this.monitorSignalingWebSocketEventTimerId = 0; this.monitorIceConnectionStateChangeTimerId = 0; - this.dataChannels = {}; + this.soraDataChannels = {}; this.mids = { audio: "", video: "", @@ -2005,7 +2011,7 @@ class ConnectionBase { * * removestream イベントは非推奨です.removetrack イベントを使用してください * - * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message) + * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message, datachannel) * @param callback - コールバック関数 * * @public @@ -2151,12 +2157,12 @@ class ConnectionBase { */ async signalingTerminate() { await this.stopStream(); - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } if (this.ws) { this.ws.close(); @@ -2193,8 +2199,8 @@ class ConnectionBase { this.ws.onmessage = null; this.ws.onerror = null; } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { // onclose はログを吐く専用に残す dataChannel.onclose = (event) => { @@ -2207,12 +2213,12 @@ class ConnectionBase { } } // DataChannel を終了する - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } // WebSocket を終了する if (this.ws) { @@ -2256,8 +2262,8 @@ class ConnectionBase { this.ws.onmessage = null; this.ws.onerror = null; } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { // onclose はログを吐く専用に残す dataChannel.onclose = (event) => { @@ -2270,45 +2276,45 @@ class ConnectionBase { } } // 終了処理を開始する - if (this.dataChannels.signaling) { + if (this.soraDataChannels.signaling) { const message = { type: "disconnect", reason: title }; if (this.signalingOfferMessageDataChannels.signaling && this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(zlibMessage); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(zlibMessage); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = e.message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.soraDataChannels.signaling, errorMessage); } } } else { - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(JSON.stringify(message)); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(JSON.stringify(message)); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = e.message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.soraDataChannels.signaling, errorMessage); } } } } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.onerror = null; dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } await this.disconnectWebSocket(title); await this.disconnectPeerConnection(); @@ -2339,7 +2345,7 @@ class ConnectionBase { this.encodings = []; this.authMetadata = null; this.e2ee = null; - this.dataChannels = {}; + this.soraDataChannels = {}; this.mids = { audio: "", video: "", @@ -2408,18 +2414,18 @@ class ConnectionBase { disconnectDataChannel() { // DataChannel の強制終了処理 const closeDataChannels = () => { - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.onerror = null; dataChannel.close(); } - delete this.dataChannels[key]; + delete this.soraDataChannels[key]; } }; return new Promise((resolve, reject) => { // DataChannel label signaling が存在しない場合は強制終了処理をする - if (!this.dataChannels.signaling) { + if (!this.soraDataChannels.signaling) { closeDataChannels(); return resolve({ code: 4999, reason: "" }); } @@ -2429,8 +2435,8 @@ class ConnectionBase { return reject(); }, this.disconnectWaitTimeout); const onClosePromises = []; - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { // onerror が発火した場合は強制終了処理をする dataChannel.onerror = () => { @@ -2465,7 +2471,7 @@ class ConnectionBase { Promise.all(onClosePromises) .then(() => { // dataChannels が空の場合は切断処理が終わっているとみなす - if (0 === Object.keys(this.dataChannels).length) { + if (0 === Object.keys(this.soraDataChannels).length) { resolve(null); } else { @@ -2481,28 +2487,28 @@ class ConnectionBase { this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(zlibMessage); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(zlibMessage); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = e.message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.soraDataChannels.signaling, errorMessage); } } } else { - if (this.dataChannels.signaling.readyState === "open") { + if (this.soraDataChannels.signaling.readyState === "open") { // Firefox で readyState が open でも DataChannel send で例外がでる場合があるため処理する try { - this.dataChannels.signaling.send(JSON.stringify(message)); - this.writeDataChannelSignalingLog("send-disconnect", this.dataChannels.signaling, message); + this.soraDataChannels.signaling.send(JSON.stringify(message)); + this.writeDataChannelSignalingLog("send-disconnect", this.soraDataChannels.signaling, message); } catch (e) { const errorMessage = e.message; - this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.dataChannels.signaling, errorMessage); + this.writeDataChannelSignalingLog("failed-to-send-disconnect", this.soraDataChannels.signaling, errorMessage); } } } @@ -2545,8 +2551,8 @@ class ConnectionBase { this.ws.onmessage = null; this.ws.onerror = null; } - for (const key of Object.keys(this.dataChannels)) { - const dataChannel = this.dataChannels[key]; + for (const key of Object.keys(this.soraDataChannels)) { + const dataChannel = this.soraDataChannels[key]; if (dataChannel) { dataChannel.onmessage = null; // onclose はログを吐く専用に残す @@ -3427,6 +3433,9 @@ class ConnectionBase { } this.writeWebSocketSignalingLog("close"); } + for (const channel of this.datachannels) { + this.callbacks.datachannel(createDataChannelEvent(channel)); + } } /** * シグナリングサーバーから受け取った type redirect メッセージを処理をするメソッド @@ -3491,7 +3500,7 @@ class ConnectionBase { const channel = event.currentTarget; channel.bufferedAmountLowThreshold = 65536; channel.binaryType = "arraybuffer"; - this.dataChannels[channel.label] = channel; + this.soraDataChannels[channel.label] = channel; this.trace("OPEN DATA CHANNEL", channel.label); if (channel.label === "signaling" && this.ws) { this.writeDataChannelSignalingLog("onopen", channel); @@ -3606,17 +3615,17 @@ class ConnectionBase { * @param message - 送信するメッセージ */ sendSignalingMessage(message) { - if (this.dataChannels.signaling) { + if (this.soraDataChannels.signaling) { if (this.signalingOfferMessageDataChannels.signaling && this.signalingOfferMessageDataChannels.signaling.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - this.dataChannels.signaling.send(zlibMessage); + this.soraDataChannels.signaling.send(zlibMessage); } else { - this.dataChannels.signaling.send(JSON.stringify(message)); + this.soraDataChannels.signaling.send(JSON.stringify(message)); } - this.writeDataChannelSignalingLog(`send-${message.type}`, this.dataChannels.signaling, message); + this.writeDataChannelSignalingLog(`send-${message.type}`, this.soraDataChannels.signaling, message); } else if (this.ws !== null) { this.ws.send(JSON.stringify(message)); @@ -3629,9 +3638,9 @@ class ConnectionBase { * @param message - 送信するバイナリメッセージ */ sendE2EEMessage(message) { - if (this.dataChannels.e2ee) { - this.dataChannels.e2ee.send(message); - this.writeDataChannelSignalingLog("send-e2ee", this.dataChannels.e2ee, message); + if (this.soraDataChannels.e2ee) { + this.soraDataChannels.e2ee.send(message); + this.writeDataChannelSignalingLog("send-e2ee", this.soraDataChannels.e2ee, message); } else if (this.ws !== null) { this.ws.send(message); @@ -3644,7 +3653,7 @@ class ConnectionBase { * @param reports - RTCStatsReport のリスト */ sendStatsMessage(reports) { - if (this.dataChannels.stats) { + if (this.soraDataChannels.stats) { const message = { type: "stats", reports: reports, @@ -3653,10 +3662,10 @@ class ConnectionBase { this.signalingOfferMessageDataChannels.stats.compress === true) { const binaryMessage = new TextEncoder().encode(JSON.stringify(message)); const zlibMessage = zlibSync(binaryMessage, {}); - this.dataChannels.stats.send(zlibMessage); + this.soraDataChannels.stats.send(zlibMessage); } else { - this.dataChannels.stats.send(JSON.stringify(message)); + this.soraDataChannels.stats.send(JSON.stringify(message)); } } } @@ -3718,7 +3727,7 @@ class ConnectionBase { * @param message - Uint8Array */ sendMessage(label, message) { - const dataChannel = this.dataChannels[label]; + const dataChannel = this.soraDataChannels[label]; // 接続していない場合は何もしない if (this.pc === null) { return; @@ -3785,13 +3794,16 @@ class ConnectionBase { /** * DataChannel メッセージング用の DataChannel 情報のリスト */ - get messagingDataChannels() { + get datachannels() { + if (!this.signalingSwitched) { + return []; + } const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); }); const result = []; for (const label of messagingDataChannellabels) { - const dataChannel = this.dataChannels[label]; + const dataChannel = this.soraDataChannels[label]; if (!dataChannel) { continue; } @@ -4214,7 +4226,7 @@ var sora = { * @public */ version: function () { - return "2021.2.0-canary.7"; + return "2021.2.0-canary.8"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/types.d.ts b/dist/types.d.ts index f358c7cf..bc48588c 100644 --- a/dist/types.d.ts +++ b/dist/types.d.ts @@ -262,6 +262,7 @@ export declare type Callbacks = { timeline: (event: TimelineEvent) => void; signaling: (event: SignalingEvent) => void; message: (event: DataChannelMessageEvent) => void; + datachannel: (event: DataChannelEvent) => void; }; export declare type PreKeyBundle = { identityKey: string; @@ -279,6 +280,9 @@ export interface DataChannelMessageEvent extends Event { label: string; data: ArrayBuffer; } +export interface DataChannelEvent extends Event { + datachannel: DataChannelConfiguration; +} export interface TimelineEvent extends Event { logType: TimelineEventLogType; data?: any; diff --git a/dist/utils.d.ts b/dist/utils.d.ts index 07a8b55d..e2d99ad0 100644 --- a/dist/utils.d.ts +++ b/dist/utils.d.ts @@ -1,4 +1,4 @@ -import { ConnectionOptions, JSONType, DataChannelMessageEvent, PreKeyBundle, SignalingConnectMessage, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, TimelineEvent, TimelineEventLogType, TransportType } from "./types"; +import { ConnectionOptions, JSONType, DataChannelConfiguration, DataChannelEvent, DataChannelMessageEvent, PreKeyBundle, SignalingConnectMessage, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, TimelineEvent, TimelineEventLogType, TransportType } from "./types"; export declare function isSafari(): boolean; export declare function isChrome(): boolean; export declare function createSignalingMessage(offerSDP: string, role: string, channelId: string | null | undefined, metadata: JSONType | undefined, options: ConnectionOptions, redirect: boolean): SignalingConnectMessage; @@ -14,3 +14,4 @@ export declare function createSignalingEvent(eventType: string, data: unknown, t export declare function createDataChannelData(channel: RTCDataChannel): Record; export declare function createTimelineEvent(eventType: string, data: unknown, logType: TimelineEventLogType, dataChannelId?: number | null, dataChannelLabel?: string): TimelineEvent; export declare function createDataChannelMessageEvent(label: string, data: ArrayBuffer): DataChannelMessageEvent; +export declare function createDataChannelEvent(channel: DataChannelConfiguration): DataChannelEvent; diff --git a/package-lock.json b/package-lock.json index 2a778be6..4736c62e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.7", + "version": "2021.2.0-canary.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sora-js-sdk", - "version": "2021.2.0-canary.7", + "version": "2021.2.0-canary.8", "license": "Apache-2.0", "workspaces": [ "packages/go-wasm", diff --git a/package.json b/package.json index c9feaa68..b1377e9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.7", + "version": "2021.2.0-canary.8", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", From edbc7f10ee3089f3d4621f414801f1567b86cce0 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 17 Nov 2021 11:41:22 +0900 Subject: [PATCH 66/87] =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=B3=E3=82=B0=E3=81=AB=E4=BD=BF=E7=94=A8=E3=81=99?= =?UTF-8?q?=E3=82=8BDataChannel=E3=81=AE=E5=88=A4=E5=AE=9A=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index a8a17948..6401c887 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -1910,7 +1910,7 @@ export default class ConnectionBase { this.sendStatsMessage(stats); } }; - } else if (/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(dataChannelEvent.channel.label)) { + } else if (/^#.*/.exec(dataChannelEvent.channel.label)) { dataChannelEvent.channel.onmessage = (event): void => { if (event.target === null) { return; @@ -2133,7 +2133,7 @@ export default class ConnectionBase { return []; } const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { - return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); + return /^#.*/.exec(label); }); const result: DataChannelConfiguration[] = []; for (const label of messagingDataChannellabels) { From eb1560511e4a0ed8966176b233c4816e090d1e82 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 17 Nov 2021 11:46:42 +0900 Subject: [PATCH 67/87] 2021.2.0-canary.9 --- dist/sora.js | 10 +++++----- dist/sora.min.js | 2 +- dist/sora.mjs | 10 +++++----- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/sora.js b/dist/sora.js index 9cd4e7e0..eadc0f14 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.8 + * @version: 2021.2.0-canary.9 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.8", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.9", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -3600,7 +3600,7 @@ } }; } - else if (/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(dataChannelEvent.channel.label)) { + else if (/^#.*/.exec(dataChannelEvent.channel.label)) { dataChannelEvent.channel.onmessage = (event) => { if (event.target === null) { return; @@ -3805,7 +3805,7 @@ return []; } const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { - return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); + return /^#.*/.exec(label); }); const result = []; for (const label of messagingDataChannellabels) { @@ -4232,7 +4232,7 @@ * @public */ version: function () { - return "2021.2.0-canary.8"; + return "2021.2.0-canary.9"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/sora.min.js b/dist/sora.min.js index a0740245..c53b7b30 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sora=t()}(this,(function(){"use strict";class e{constructor(){if(!!!RTCRtpSender.prototype.createEncodedStreams)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJ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ICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5UZXh0LmJ5dGVMZW5ndGgpOwogICAgICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgICAgICBuZXdVaW50OC5zZXQobmV3IFVpbnQ4QXJyYXkoZnJhbWVNZXRhZGF0YUJ1ZmZlciwgMCwgdW5lbmNyeXB0ZWRCeXRlc1tlbmNvZGVkRnJhbWUudHlwZV0pKTsKICAgICAgICAgICAgbmV3VWludDguc2V0KG5ldyBVaW50OEFycmF5KH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ICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var Z=new t(32);for(m=0;m<32;++m)Z[m]=5;var p=A(b,9,0),w=A(b,9,1),S=A(Z,5,0),V=A(Z,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[d-1],m,0);if(u>i){a=0;var A=0,b=u-i,Z=1<i))break;A+=Z-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!D[o[U-1]];--U);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,Z)+r,z=B(l,u)+B(c,f)+r+14+3*U+B(K,D)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(d,d+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=p,j=b,Q=S,H=Z;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),D=function(e,o,g,l,c){return function(e,o,g,l,c,C){var d=e.length,I=new t(l+d+5*(1+Math.ceil(d/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||d<8)for(var A=0;A<=d;A+=65535){var b=A+65535;b>>13,w=8191&Z,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,D,A-D,u),N=O=E=0,D=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=U-M&32767;if(j>2&&F==R(A-z))for(var _=Math.min(p,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&U!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(U=M)-(M=V[U])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,C,v,T,X,E,N,D,A-D,u),!C&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function F(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=D(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function U(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var C=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,Z=i.m,p=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(F=G(I)+4)-4]|e[F-3]<<8,X=F+T;if(X>g){r&&v(0);break}l&&C(m+T),n.set(e.subarray(F,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,Z=9,p=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=F;else{var M=0,j=0;for(16==F?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==F?(j=3+y(e,I,7),I+=3):18==F&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);Z=f(Q),p=f(H),u=A(Q,Z,1),b=A(H,p,1)}else v(1);if(I>S){r&&v(0);break}}l&&C(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=d[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&C(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.8",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const C=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&C&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const d=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&d&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise(((t,n)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.soraDataChannels)){const a=this.soraDataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws){e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"));for(const e of this.datachannels)this.callbacks.datachannel($(e))}}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=U(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=F((new TextEncoder).encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=F(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get datachannels(){if(!this.signalingSwitched)return[];const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(e))),t=[];for(const n of e){const e=this.soraDataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class te extends ee{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ne extends ee{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var p=new t(32);for(m=0;m<32;++m)p[m]=5;var Z=A(b,9,0),w=A(b,9,1),S=A(p,5,0),V=A(p,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[d-1],m,0);if(u>i){a=0;var A=0,b=u-i,p=1<i))break;A+=p-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!D[o[U-1]];--U);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,p)+r,z=B(l,u)+B(c,f)+r+14+3*U+B(K,D)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(d,d+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=Z,j=b,Q=S,H=p;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),D=function(e,o,g,l,c){return function(e,o,g,l,c,C){var d=e.length,I=new t(l+d+5*(1+Math.ceil(d/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||d<8)for(var A=0;A<=d;A+=65535){var b=A+65535;b>>13,w=8191&p,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,D,A-D,u),N=O=E=0,D=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=U-M&32767;if(j>2&&F==R(A-z))for(var _=Math.min(Z,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&U!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(U=M)-(M=V[U])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,C,v,T,X,E,N,D,A-D,u),!C&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function F(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=D(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function U(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var C=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,p=i.m,Z=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(F=G(I)+4)-4]|e[F-3]<<8,X=F+T;if(X>g){r&&v(0);break}l&&C(m+T),n.set(e.subarray(F,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,p=9,Z=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=F;else{var M=0,j=0;for(16==F?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==F?(j=3+y(e,I,7),I+=3):18==F&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);p=f(Q),Z=f(H),u=A(Q,p,1),b=A(H,Z,1)}else v(1);if(I>S){r&&v(0);break}}l&&C(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=d[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&C(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.9",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const C=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&C&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const d=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&d&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise(((t,n)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.soraDataChannels)){const a=this.soraDataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws){e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"));for(const e of this.datachannels)this.callbacks.datachannel($(e))}}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#.*/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=U(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=F((new TextEncoder).encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=F(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get datachannels(){if(!this.signalingSwitched)return[];const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#.*/.exec(e))),t=[];for(const n of e){const e=this.soraDataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class te extends ee{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ne extends ee{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1 { if (event.target === null) { return; @@ -3799,7 +3799,7 @@ class ConnectionBase { return []; } const messagingDataChannellabels = Object.keys(this.signalingOfferMessageDataChannels).filter((label) => { - return /^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(label); + return /^#.*/.exec(label); }); const result = []; for (const label of messagingDataChannellabels) { @@ -4226,7 +4226,7 @@ var sora = { * @public */ version: function () { - return "2021.2.0-canary.8"; + return "2021.2.0-canary.9"; }, /** * WebRTC のユーティリティ関数群 diff --git a/package-lock.json b/package-lock.json index 4736c62e..788332b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.8", + "version": "2021.2.0-canary.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sora-js-sdk", - "version": "2021.2.0-canary.8", + "version": "2021.2.0-canary.9", "license": "Apache-2.0", "workspaces": [ "packages/go-wasm", diff --git a/package.json b/package.json index b1377e9c..f3072d49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.8", + "version": "2021.2.0-canary.9", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", From 783b476a0c81f760908f1b6970ba445c8926fa73 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 17 Nov 2021 16:11:40 +0900 Subject: [PATCH 68/87] =?UTF-8?q?simulcast=20=E6=99=82=E3=81=AE=20video=20?= =?UTF-8?q?transceiver=20=E5=88=A4=E5=AE=9A=E3=81=AB=20offer.mid=20?= =?UTF-8?q?=E3=82=82=E4=BD=BF=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 6401c887..85776600 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -1205,12 +1205,19 @@ export default class ConnectionBase { // simulcast の場合 if (this.options.simulcast && (this.role === "sendrecv" || this.role === "sendonly")) { const transceiver = this.pc.getTransceivers().find((t) => { - if ( - t.mid && - 0 <= t.mid.indexOf("video") && - t.sender.track !== null && - (t.currentDirection === null || t.currentDirection === "sendonly") - ) { + if (t.mid === null) { + return; + } + if (t.sender.track === null) { + return; + } + if (t.currentDirection !== null && t.currentDirection !== "sendonly") { + return; + } + if (this.mids.video !== "" && this.mids.video === t.mid) { + return t; + } + if (0 <= t.mid.indexOf("video")) { return t; } }); From 8e42e23a3dca102e4a307e1651112b034841fba6 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 18 Nov 2021 09:53:41 +0900 Subject: [PATCH 69/87] =?UTF-8?q?CHANGES=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c5465f2a..bedc4852 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,8 @@ - バグ修正 ## develop +- [CHANGE] simulcast 時の transceiver 判定条件に offer.mids.video での分岐を追加する + - @yuitowest - [CHANGE] 複数パッケージの管理を lerna から npm workspace に変更する - @yuitowest - [ADD] DataChannel メッセージング機能を追加する From 2385a4085c750814f5fe6444c776a519923323d0 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 18 Nov 2021 10:12:56 +0900 Subject: [PATCH 70/87] 2021.2.0-canary.10 --- dist/sora.js | 23 ++++++++++++++++------- dist/sora.min.js | 2 +- dist/sora.mjs | 23 ++++++++++++++++------- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/dist/sora.js b/dist/sora.js index eadc0f14..27d16c06 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.9 + * @version: 2021.2.0-canary.10 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.9", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.10", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -2938,10 +2938,19 @@ // simulcast の場合 if (this.options.simulcast && (this.role === "sendrecv" || this.role === "sendonly")) { const transceiver = this.pc.getTransceivers().find((t) => { - if (t.mid && - 0 <= t.mid.indexOf("video") && - t.sender.track !== null && - (t.currentDirection === null || t.currentDirection === "sendonly")) { + if (t.mid === null) { + return; + } + if (t.sender.track === null) { + return; + } + if (t.currentDirection !== null && t.currentDirection !== "sendonly") { + return; + } + if (this.mids.video !== "" && this.mids.video === t.mid) { + return t; + } + if (0 <= t.mid.indexOf("video")) { return t; } }); @@ -4232,7 +4241,7 @@ * @public */ version: function () { - return "2021.2.0-canary.9"; + return "2021.2.0-canary.10"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/sora.min.js b/dist/sora.min.js index c53b7b30..b6d1c97b 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sora=t()}(this,(function(){"use strict";class e{constructor(){if(!!!RTCRtpSender.prototype.createEncodedStreams)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0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8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5UZXh0LmJ5dGVMZW5ndGgpOwogICAgICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgICAgICBuZXdVaW50OC5zZXQobmV3IFVpbnQ4QXJyYXkoZnJhbWVNZXRhZGF0YUJ1ZmZlciwgM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ldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var p=new t(32);for(m=0;m<32;++m)p[m]=5;var Z=A(b,9,0),w=A(b,9,1),S=A(p,5,0),V=A(p,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[d-1],m,0);if(u>i){a=0;var A=0,b=u-i,p=1<i))break;A+=p-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!D[o[U-1]];--U);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,p)+r,z=B(l,u)+B(c,f)+r+14+3*U+B(K,D)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(d,d+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=Z,j=b,Q=S,H=p;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),D=function(e,o,g,l,c){return function(e,o,g,l,c,C){var d=e.length,I=new t(l+d+5*(1+Math.ceil(d/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||d<8)for(var A=0;A<=d;A+=65535){var b=A+65535;b>>13,w=8191&p,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,D,A-D,u),N=O=E=0,D=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=U-M&32767;if(j>2&&F==R(A-z))for(var _=Math.min(Z,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&U!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(U=M)-(M=V[U])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,C,v,T,X,E,N,D,A-D,u),!C&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function F(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=D(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function U(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var C=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,p=i.m,Z=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(F=G(I)+4)-4]|e[F-3]<<8,X=F+T;if(X>g){r&&v(0);break}l&&C(m+T),n.set(e.subarray(F,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,p=9,Z=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=F;else{var M=0,j=0;for(16==F?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==F?(j=3+y(e,I,7),I+=3):18==F&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);p=f(Q),Z=f(H),u=A(Q,p,1),b=A(H,Z,1)}else v(1);if(I>S){r&&v(0);break}}l&&C(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=d[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&C(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.9",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const C=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&C&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const d=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&d&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise(((t,n)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.soraDataChannels)){const a=this.soraDataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws){e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"));for(const e of this.datachannels)this.callbacks.datachannel($(e))}}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#.*/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=U(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=F((new TextEncoder).encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=F(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get datachannels(){if(!this.signalingSwitched)return[];const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#.*/.exec(e))),t=[];for(const n of e){const e=this.soraDataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class te extends ee{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ne extends ee{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},l=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,g(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),g(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),g(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),g(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,g(e+16)),i=l(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=l(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=l(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(l=new n(s),a=0;a>>15-e[a]);return l},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var p=new t(32);for(m=0;m<32;++m)p[m]=5;var Z=A(b,9,0),w=A(b,9,1),S=A(p,5,0),V=A(p,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=l[a].s);var m=new n(I+1),u=E(s[d-1],m,0);if(u>i){a=0;var A=0,b=u-i,p=1<i))break;A+=p-(1<>>=b;A>0;){var w=l[a].s;m[w]=0&&A;--a){var S=l[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,l=function(e){i[s++]=e},g=1;g<=t;++g)if(e[g]==a&&g!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(a),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(a);o=1,a=e[g]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!D[o[U-1]];--U);var M,j,Q,H,x=h+5<<3,P=B(g,b)+B(c,p)+r,z=B(g,u)+B(c,f)+r+14+3*U+B(K,D)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(d,d+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=Z,j=b,Q=S,H=p;for(L=0;L255){te=l[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,l[L]>>>23&31),I+=s[te]);var ne=31&l[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,l[L]>>>5&8191),I+=a[ne])}else X(t,I,M[l[L]]),I+=j[l[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),D=function(e,o,l,g,c){return function(e,o,l,g,c,C){var d=e.length,I=new t(g+d+5*(1+Math.ceil(d/7e3))+c),m=I.subarray(g,I.length-c),u=0;if(!o||d<8)for(var A=0;A<=d;A+=65535){var b=A+65535;b>>13,w=8191&p,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,D,A-D,u),N=O=E=0,D=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=U-M&32767;if(j>2&&F==R(A-z))for(var _=Math.min(Z,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&U!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(U=M)-(M=V[U])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,C,v,T,X,E,N,D,A-D,u),!C&&7&u&&(u=Y(m,u+1,J))}return k(I,0,g+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,l,g,!c)};function F(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var l=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=D(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function U(e,n){return function(e,n,i){var l=e.length;if(!l||i&&i.f&&!i.l)return n||new t(0);var g=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*l));var C=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,p=i.m,Z=i.n,S=8*l;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(F=G(I)+4)-4]|e[F-3]<<8,X=F+T;if(X>l){r&&v(0);break}g&&C(m+T),n.set(e.subarray(F,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,p=9,Z=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=F;else{var M=0,j=0;for(16==F?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==F?(j=3+y(e,I,7),I+=3):18==F&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);p=f(Q),Z=f(H),u=A(Q,p,1),b=A(H,Z,1)}else v(1);if(I>S){r&&v(0);break}}g&&C(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=d[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}g&&C(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.10",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const l=["audioCodecType","audioBitRate"],g=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise(((t,n)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.soraDataChannels)){const a=this.soraDataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(null!==e.mid&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return""!==this.mids.video&&this.mids.video===e.mid||0<=e.mid.indexOf("video")?e:void 0}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws){e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"));for(const e of this.datachannels)this.callbacks.datachannel($(e))}}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#.*/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=U(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=F((new TextEncoder).encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=F(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get datachannels(){if(!this.signalingSwitched)return[];const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#.*/.exec(e))),t=[];for(const n of e){const e=this.soraDataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class te extends ee{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ne extends ee{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1 { - if (t.mid && - 0 <= t.mid.indexOf("video") && - t.sender.track !== null && - (t.currentDirection === null || t.currentDirection === "sendonly")) { + if (t.mid === null) { + return; + } + if (t.sender.track === null) { + return; + } + if (t.currentDirection !== null && t.currentDirection !== "sendonly") { + return; + } + if (this.mids.video !== "" && this.mids.video === t.mid) { + return t; + } + if (0 <= t.mid.indexOf("video")) { return t; } }); @@ -4226,7 +4235,7 @@ var sora = { * @public */ version: function () { - return "2021.2.0-canary.9"; + return "2021.2.0-canary.10"; }, /** * WebRTC のユーティリティ関数群 diff --git a/package-lock.json b/package-lock.json index 788332b3..c834f867 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.9", + "version": "2021.2.0-canary.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sora-js-sdk", - "version": "2021.2.0-canary.9", + "version": "2021.2.0-canary.10", "license": "Apache-2.0", "workspaces": [ "packages/go-wasm", diff --git a/package.json b/package.json index f3072d49..58b7a59f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.9", + "version": "2021.2.0-canary.10", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", From 0ed3679d04a9695c0c4ad1fb488f8f22451dea36 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 25 Nov 2021 10:45:35 +0900 Subject: [PATCH 71/87] =?UTF-8?q?ConnectionBase=20=E3=81=AE=E3=83=97?= =?UTF-8?q?=E3=83=AD=E3=83=91=E3=83=86=E3=82=A3=E6=A8=A9=E9=99=90=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index 85776600..c0e3808a 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -116,27 +116,19 @@ export default class ConnectionBase { /** * WebSocket インスタンス */ - protected ws: WebSocket | null; - /** - * イベントコールバックのリスト - */ - protected callbacks: Callbacks; - /** - * E2EE インスタンス - */ - protected e2ee: SoraE2EE | null; + private ws: WebSocket | null; /** * 初回シグナリング時接続タイムアウト用のタイマーID */ - protected connectionTimeoutTimerId: number; + private connectionTimeoutTimerId: number; /** * WebSocket 切断監視用のタイマーID */ - protected monitorSignalingWebSocketEventTimerId: number; + private monitorSignalingWebSocketEventTimerId: number; /** * PeerConnection state 切断監視用のタイマーID */ - protected monitorIceConnectionStateChangeTimerId: number; + private monitorIceConnectionStateChangeTimerId: number; /** * 接続中の DataChannel リスト */ @@ -172,6 +164,15 @@ export default class ConnectionBase { private signalingOfferMessageDataChannels: { [key in string]?: SignalingOfferMessageDataChannel; }; + /** + * イベントコールバックのリスト + */ + protected callbacks: Callbacks; + /** + * E2EE インスタンス + */ + protected e2ee: SoraE2EE | null; + constructor( signalingUrlCandidates: string | string[], role: string, From 2cbb0237ceb52775416220dcc5a581f4c9c21bb2 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 25 Nov 2021 14:57:14 +0900 Subject: [PATCH 72/87] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/publisher.ts | 20 ++++++++++++++++++++ packages/sdk/src/subscriber.ts | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/packages/sdk/src/publisher.ts b/packages/sdk/src/publisher.ts index 0c585955..a3504690 100644 --- a/packages/sdk/src/publisher.ts +++ b/packages/sdk/src/publisher.ts @@ -1,6 +1,16 @@ import ConnectionBase from "./base"; +/** + * Role が "sendonly" または "sendrecv" の場合に Sora との WebRTC 接続を扱うクラス + */ export default class ConnectionPublisher extends ConnectionBase { + /** + * Sora へ接続するメソッド + * + * @param stream - メディアストリーム + * + * @public + */ async connect(stream: MediaStream): Promise { if (this.options.multistream) { await Promise.race([ @@ -26,6 +36,11 @@ export default class ConnectionPublisher extends ConnectionBase { return stream; } + /** + * シングルストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ private async singleStream(stream: MediaStream): Promise { await this.disconnect(); this.setupE2EE(); @@ -54,6 +69,11 @@ export default class ConnectionPublisher extends ConnectionBase { return stream; } + /** + * マルチストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ private async multiStream(stream: MediaStream): Promise { await this.disconnect(); this.setupE2EE(); diff --git a/packages/sdk/src/subscriber.ts b/packages/sdk/src/subscriber.ts index 934c174c..1d8e3d4a 100644 --- a/packages/sdk/src/subscriber.ts +++ b/packages/sdk/src/subscriber.ts @@ -1,6 +1,16 @@ import ConnectionBase from "./base"; +/** + * Role が "recvonly" の場合に Sora との WebRTC 接続を扱うクラス + */ export default class ConnectionSubscriber extends ConnectionBase { + /** + * Sora へ接続するメソッド + * + * @param stream - メディアストリーム + * + * @public + */ async connect(): Promise { if (this.options.multistream) { await Promise.race([ @@ -29,6 +39,11 @@ export default class ConnectionSubscriber extends ConnectionBase { } } + /** + * シングルストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ private async singleStream(): Promise { await this.disconnect(); this.setupE2EE(); @@ -87,6 +102,11 @@ export default class ConnectionSubscriber extends ConnectionBase { return this.stream || new MediaStream(); } + /** + * マルチストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ private async multiStream(): Promise { await this.disconnect(); this.setupE2EE(); From 9c83e386de52814890c848c81124a5729a2cd17c Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Tue, 30 Nov 2021 10:03:38 +0900 Subject: [PATCH 73/87] =?UTF-8?q?CHANGES=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index bedc4852..0bcf40cb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,9 +10,9 @@ - バグ修正 ## develop -- [CHANGE] simulcast 時の transceiver 判定条件に offer.mids.video での分岐を追加する +- [UPDATE] simulcast 時の transceiver 判定条件に offer.mids.video での分岐を追加する - @yuitowest -- [CHANGE] 複数パッケージの管理を lerna から npm workspace に変更する +- [UPDATE] 複数パッケージの管理を lerna から npm workspace に変更する - @yuitowest - [ADD] DataChannel メッセージング機能を追加する - sendrecv オブジェクトに sendMessage API を追加する From 39d9d722361bfd66e28eee11fe94ba681941cca0 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Tue, 30 Nov 2021 10:15:48 +0900 Subject: [PATCH 74/87] =?UTF-8?q?CHANGES=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 0bcf40cb..3e745920 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,7 +16,7 @@ - @yuitowest - [ADD] DataChannel メッセージング機能を追加する - sendrecv オブジェクトに sendMessage API を追加する - - sendrecv オブジェクトに datachannel プロパティを追加する + - sendrecv オブジェクトに datachannels プロパティを追加する - on callback に "message" を追加する - on callback に "datachannel" を追加する - @yuitowest From 90f2410641315b85949305968adb5f83f709f871 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 1 Dec 2021 15:58:00 +0900 Subject: [PATCH 75/87] =?UTF-8?q?typedoc=20=E3=82=92=E5=B0=8E=E5=85=A5?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + TYPEDOC.md | 34 ++++++++++ package-lock.json | 166 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 3 +- typedoc.json | 10 +++ 5 files changed, 212 insertions(+), 2 deletions(-) create mode 100644 TYPEDOC.md create mode 100644 typedoc.json diff --git a/.gitignore b/.gitignore index 0b9e7176..103265d9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ npm-debug.log wasm.wasm packages/e2ee/dist packages/e2ee/_worker +apidoc/ diff --git a/TYPEDOC.md b/TYPEDOC.md new file mode 100644 index 00000000..83cdb63d --- /dev/null +++ b/TYPEDOC.md @@ -0,0 +1,34 @@ +# Sora JavaScript SDK API Document + +Sora JavaScript SDK は[株式会社時雨堂](https://shiguredo.jp/)が開発、販売している [WebRTC SFU Sora](https://sora.shiguredo.jp) をブラウザから扱うための SDK です。 + +## About Shiguredo's open source software + +We will not respond to PRs or issues that have not been discussed on Discord. Also, Discord is only available in Japanese. + +Please read https://github.com/shiguredo/oss before use. + +## 時雨堂のオープンソースソフトウェアについて + +利用前に https://github.com/shiguredo/oss をお読みください。 + +## ライセンス + +Apache License 2.0 + +``` +Copyright 2017-2021, Yuki Ito (Original Author) +Copyright 2017-2021, Shiguredo Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` diff --git a/package-lock.json b/package-lock.json index c834f867..a6954b0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,8 @@ ], "devDependencies": { "npm-check-updates": "^11.8.5", - "serve": "^12.0.1" + "serve": "^12.0.1", + "typedoc": "^0.22.10" } }, "node_modules/@babel/code-frame": { @@ -5779,6 +5780,12 @@ "node": ">=6" } }, + "node_modules/jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true + }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -6008,6 +6015,12 @@ "node": ">=10" } }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, "node_modules/magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -6604,6 +6617,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/onigasm": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz", + "integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==", + "dev": true, + "dependencies": { + "lru-cache": "^5.1.1" + } + }, + "node_modules/onigasm/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/onigasm/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -7731,6 +7768,17 @@ "node": ">=0.10.0" } }, + "node_modules/shiki": { + "version": "0.9.12", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.12.tgz", + "integrity": "sha512-VXcROdldv0/Qu0w2XvzU4IrvTeBNs/Kj/FCmtcEXGz7Tic/veQzliJj6tEiAgoKianhQstpYmbPDStHU5Opqcw==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.0.0", + "onigasm": "^2.2.5", + "vscode-textmate": "5.2.0" + } + }, "node_modules/signal-exit": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", @@ -8502,6 +8550,40 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/typedoc": { + "version": "0.22.10", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz", + "integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==", + "dev": true, + "dependencies": { + "glob": "^7.2.0", + "lunr": "^2.3.9", + "marked": "^3.0.8", + "minimatch": "^3.0.4", + "shiki": "^0.9.12" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 12.10.0" + }, + "peerDependencies": { + "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x" + } + }, + "node_modules/typedoc/node_modules/marked": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", + "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==", + "dev": true, + "bin": { + "marked": "bin/marked" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/typescript": { "version": "4.4.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", @@ -8816,6 +8898,12 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "node_modules/vscode-textmate": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", + "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", + "dev": true + }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -13747,6 +13835,12 @@ "minimist": "^1.2.5" } }, + "jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -13930,6 +14024,12 @@ "yallist": "^4.0.0" } }, + "lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -14399,6 +14499,32 @@ "mimic-fn": "^2.1.0" } }, + "onigasm": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz", + "integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==", + "dev": true, + "requires": { + "lru-cache": "^5.1.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -15258,6 +15384,17 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shiki": { + "version": "0.9.12", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.12.tgz", + "integrity": "sha512-VXcROdldv0/Qu0w2XvzU4IrvTeBNs/Kj/FCmtcEXGz7Tic/veQzliJj6tEiAgoKianhQstpYmbPDStHU5Opqcw==", + "dev": true, + "requires": { + "jsonc-parser": "^3.0.0", + "onigasm": "^2.2.5", + "vscode-textmate": "5.2.0" + } + }, "signal-exit": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", @@ -15850,6 +15987,27 @@ "is-typedarray": "^1.0.0" } }, + "typedoc": { + "version": "0.22.10", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz", + "integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==", + "dev": true, + "requires": { + "glob": "^7.2.0", + "lunr": "^2.3.9", + "marked": "^3.0.8", + "minimatch": "^3.0.4", + "shiki": "^0.9.12" + }, + "dependencies": { + "marked": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", + "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==", + "dev": true + } + } + }, "typescript": { "version": "4.4.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", @@ -16098,6 +16256,12 @@ } } }, + "vscode-textmate": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", + "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", + "dev": true + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/package.json b/package.json index 58b7a59f..e581a37c 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ ], "devDependencies": { "npm-check-updates": "^11.8.5", - "serve": "^12.0.1" + "serve": "^12.0.1", + "typedoc": "^0.22.10" }, "resolutions": { "get-pkg-repo": "4.1.2" diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 00000000..fcb63565 --- /dev/null +++ b/typedoc.json @@ -0,0 +1,10 @@ +{ + "entryPoints": [ + "./packages/sdk/src/sora.ts", + "./packages/sdk/src/types.ts" + ], + "tsconfig": "./packages/sdk/tsconfig.json", + "disableSources": true, + "readme": "./TYPEDOC.md", + "out": "apidoc" +} From dbfe60841fb235f219dabc2d9f8e7d97867ab2c1 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 3 Dec 2021 12:03:24 +0900 Subject: [PATCH 76/87] =?UTF-8?q?private/protected=20=E3=82=92=20typedoc?= =?UTF-8?q?=20=E3=81=AB=E5=87=BA=E5=8A=9B=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typedoc.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/typedoc.json b/typedoc.json index fcb63565..d2a6af53 100644 --- a/typedoc.json +++ b/typedoc.json @@ -5,6 +5,8 @@ ], "tsconfig": "./packages/sdk/tsconfig.json", "disableSources": true, + "excludePrivate": true, + "excludeProtected": true, "readme": "./TYPEDOC.md", "out": "apidoc" } From eb2063c1f0b2c103a68be30755be9d117e14ca3e Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 3 Dec 2021 12:14:12 +0900 Subject: [PATCH 77/87] =?UTF-8?q?doc=20script=20=E3=82=92=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index e581a37c..a3f54cc2 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "fmt": "npm run fmt --workspaces", "test": "npm run test --workspaces", "start": "npx serve -S -l 8080 ./example", + "doc": "npx typedoc", "release:major": "./scripts/versioning.sh major", "release:minor": "./scripts/versioning.sh minor", "release:patch": "./scripts/versioning.sh patch", From 958cb69e95050771a18d950ec2f1b072a01aa114 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 3 Dec 2021 12:14:36 +0900 Subject: [PATCH 78/87] =?UTF-8?q?types.ts=20=E3=82=92=20entryPoint=20?= =?UTF-8?q?=E3=81=8B=E3=82=89=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typedoc.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/typedoc.json b/typedoc.json index d2a6af53..0dcfc307 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,7 +1,6 @@ { "entryPoints": [ - "./packages/sdk/src/sora.ts", - "./packages/sdk/src/types.ts" + "./packages/sdk/src/sora.ts" ], "tsconfig": "./packages/sdk/tsconfig.json", "disableSources": true, From 81c76ccf8b250338ed629a386443b906f59d5298 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 3 Dec 2021 12:14:44 +0900 Subject: [PATCH 79/87] =?UTF-8?q?typedoc=20=E3=82=B3=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 55 ++++++++++++++++++++++++++++++++-- packages/sdk/src/publisher.ts | 7 +++++ packages/sdk/src/sora.ts | 33 +++++++++++++++++++- packages/sdk/src/subscriber.ts | 6 ++++ 4 files changed, 98 insertions(+), 3 deletions(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index c0e3808a..c72c8c57 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -246,10 +246,18 @@ export default class ConnectionBase { /** * SendRecv Object で発火するイベントのコールバックを設定するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * sendrecv.on("track", (event) => { + * // callback 処理 + * }); + * ``` + * * @remarks - * addstream イベントは非推奨です.track イベントを使用してください + * addstream イベントは非推奨です. track イベントを使用してください * - * removestream イベントは非推奨です.removetrack イベントを使用してください + * removestream イベントは非推奨です. removetrack イベントを使用してください * * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message, datachannel) * @param callback - コールバック関数 @@ -271,6 +279,15 @@ export default class ConnectionBase { /** * audio track を停止するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * sendrecv.stopAudioTrack(mediaStream); + * ``` + * * @remarks * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します * @@ -305,6 +322,15 @@ export default class ConnectionBase { /** * video track を停止するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * sendrecv.stopVideoTrack(mediaStream); + * ``` + * * @remarks * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します * @@ -339,6 +365,16 @@ export default class ConnectionBase { /** * audio track を入れ替えするメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * const replacedMediaStream = await navigator.mediaDevices.getUserMedia({audio: true}); + * await sendrecv.replaceAudioTrack(mediaStream, replacedMediaStream.getAudioTracks()[0]); + * ``` + * * @remarks * stream の audio track を停止後、新しい audio track をセットします * @@ -360,6 +396,16 @@ export default class ConnectionBase { /** * video track を入れ替えするメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * const replacedMediaStream = await navigator.mediaDevices.getUserMedia({video: true}); + * await sendrecv.replaceVideoTrack(mediaStream, replacedMediaStream.getVideoTracks()[0]); + * ``` + * * @remarks * stream の video track を停止後、新しい video track をセットします * @@ -798,6 +844,11 @@ export default class ConnectionBase { /** * 切断処理をするメソッド * + * @example + * ``` + * await sendrecv.disconnect(); + * ``` + * * @public */ async disconnect(): Promise { diff --git a/packages/sdk/src/publisher.ts b/packages/sdk/src/publisher.ts index a3504690..9e8ba5e3 100644 --- a/packages/sdk/src/publisher.ts +++ b/packages/sdk/src/publisher.ts @@ -7,6 +7,13 @@ export default class ConnectionPublisher extends ConnectionBase { /** * Sora へ接続するメソッド * + * @example + * ```typescript + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * ``` + * * @param stream - メディアストリーム * * @public diff --git a/packages/sdk/src/sora.ts b/packages/sdk/src/sora.ts index 28646a97..50bf9364 100644 --- a/packages/sdk/src/sora.ts +++ b/packages/sdk/src/sora.ts @@ -24,6 +24,7 @@ import type { SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, + SignalingPushMessage, Simulcast, SimulcastRid, SoraAbendTitle, @@ -60,6 +61,12 @@ class SoraConnection { /** * role sendrecv で接続するための Connecion インスタンスを生成するメソッド * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const sendrecv = connection.sendrecv("sora"); + * ``` + * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション @@ -83,6 +90,12 @@ class SoraConnection { * @param metadata - メタデータ * @param options - コネクションオプション * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const sendonly = connection.sendonly("sora"); + * ``` + * * @returns * role sendonly な Connection オブジェクトを返します * @@ -98,6 +111,12 @@ class SoraConnection { /** * role recvonly で接続するための Connecion インスタンスを生成するメソッド * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const recvonly = connection.recvonly("sora"); + * ``` + * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション @@ -132,6 +151,10 @@ export default { /** * E2EE で使用する WASM の読み込みを行うメソッド * + * @example + * ```typescript + * Sora.initE2EE("http://192.0.2.100/wasm.wasm"); + * ``` * @param wasmUrl - E2EE WASM の URL * * @public @@ -142,10 +165,16 @@ export default { /** * SoraConnection インスタンスを生成するメソッド * - * @param wasmUrl - シグナリングに使用する URL 候補 + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * ``` + * + * @param signalingUrlCandidates - シグナリングに使用する URL 候補 * @param debug - デバッグフラグ * * @public + * */ connection: function (signalingUrlCandidates: string | string[], debug = false): SoraConnection { return new SoraConnection(signalingUrlCandidates, debug); @@ -179,6 +208,7 @@ export type { DataChannelDirection, DataChannelEvent, DataChannelMessageEvent, + JSONType, Role, SignalingEvent, SignalingNotifyConnectionCreated, @@ -190,6 +220,7 @@ export type { SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, + SignalingPushMessage, Simulcast, SimulcastRid, SoraAbendTitle, diff --git a/packages/sdk/src/subscriber.ts b/packages/sdk/src/subscriber.ts index 1d8e3d4a..a9d938ef 100644 --- a/packages/sdk/src/subscriber.ts +++ b/packages/sdk/src/subscriber.ts @@ -7,6 +7,12 @@ export default class ConnectionSubscriber extends ConnectionBase { /** * Sora へ接続するメソッド * + * @example + * ```typescript + * const recvonly = connection.sendrecv("sora"); + * await recvonly.connect(); + * ``` + * * @param stream - メディアストリーム * * @public From 60acc3e027ba4ff323b23086aaba4856e6d4e35f Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 3 Dec 2021 12:16:20 +0900 Subject: [PATCH 80/87] =?UTF-8?q?=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEVELOPMENT.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 28cb3221..c42e3d80 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -37,3 +37,6 @@ sora-js-sdk/packages の package 更新 - `npm run build` を実行する - `npm run lint` を実行する - `npm run test` を実行する + +## ドキュメント作成 +- `npm run doc` を実行する From c2e593d4eed1f7fb71a7a969c56143227bd32cfd Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Mon, 6 Dec 2021 15:37:46 +0900 Subject: [PATCH 81/87] =?UTF-8?q?CHANGES=20=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 3e745920..b49b6b1b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ - [UPDATE] 複数パッケージの管理を lerna から npm workspace に変更する - @yuitowest - [ADD] DataChannel メッセージング機能を追加する + - sendrecv オブジェクトのオプションに datachannels を追加する - sendrecv オブジェクトに sendMessage API を追加する - sendrecv オブジェクトに datachannels プロパティを追加する - on callback に "message" を追加する From 009019b00d657a6cc5852befb428b44e1a7fbd2f Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 8 Dec 2021 12:09:08 +0900 Subject: [PATCH 82/87] =?UTF-8?q?WebSocket=20=E5=88=87=E6=96=AD=E3=81=AE?= =?UTF-8?q?=20timeout=20=E6=99=82=E3=81=AB=20event=20=E3=82=92=E8=BF=94?= =?UTF-8?q?=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sdk/src/base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index c72c8c57..1af9a142 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -698,7 +698,7 @@ export default class ConnectionBase { this.ws.close(); this.ws = null; } - resolve(null); + resolve({ code: 1006, reason: "" }); }, this.disconnectWaitTimeout); } else { // ws の state が open ではない場合は後処理をして終わる From adc9ed22af2cf8f249158505f72f563c26a87bc4 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Wed, 8 Dec 2021 12:16:27 +0900 Subject: [PATCH 83/87] 2021.2.0-canary.11 --- dist/base.d.ts | 79 ++++++++++++++++++----- dist/publisher.d.ts | 27 ++++++++ dist/sora.d.ts | 34 +++++++++- dist/sora.js | 146 ++++++++++++++++++++++++++++++++++++++++--- dist/sora.min.js | 2 +- dist/sora.mjs | 146 ++++++++++++++++++++++++++++++++++++++++--- dist/subscriber.d.ts | 26 ++++++++ package-lock.json | 4 +- package.json | 2 +- 9 files changed, 431 insertions(+), 35 deletions(-) diff --git a/dist/base.d.ts b/dist/base.d.ts index 39f5f626..c6e423ae 100644 --- a/dist/base.d.ts +++ b/dist/base.d.ts @@ -75,27 +75,19 @@ export default class ConnectionBase { /** * WebSocket インスタンス */ - protected ws: WebSocket | null; - /** - * イベントコールバックのリスト - */ - protected callbacks: Callbacks; - /** - * E2EE インスタンス - */ - protected e2ee: SoraE2EE | null; + private ws; /** * 初回シグナリング時接続タイムアウト用のタイマーID */ - protected connectionTimeoutTimerId: number; + private connectionTimeoutTimerId; /** * WebSocket 切断監視用のタイマーID */ - protected monitorSignalingWebSocketEventTimerId: number; + private monitorSignalingWebSocketEventTimerId; /** * PeerConnection state 切断監視用のタイマーID */ - protected monitorIceConnectionStateChangeTimerId: number; + private monitorIceConnectionStateChangeTimerId; /** * 接続中の DataChannel リスト */ @@ -124,14 +116,30 @@ export default class ConnectionBase { * シグナリング type offer に含まれる DataChannel レコード */ private signalingOfferMessageDataChannels; + /** + * イベントコールバックのリスト + */ + protected callbacks: Callbacks; + /** + * E2EE インスタンス + */ + protected e2ee: SoraE2EE | null; constructor(signalingUrlCandidates: string | string[], role: string, channelId: string, metadata: JSONType, options: ConnectionOptions, debug: boolean); /** * SendRecv Object で発火するイベントのコールバックを設定するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * sendrecv.on("track", (event) => { + * // callback 処理 + * }); + * ``` + * * @remarks - * addstream イベントは非推奨です.track イベントを使用してください + * addstream イベントは非推奨です. track イベントを使用してください * - * removestream イベントは非推奨です.removetrack イベントを使用してください + * removestream イベントは非推奨です. removetrack イベントを使用してください * * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message, datachannel) * @param callback - コールバック関数 @@ -142,6 +150,15 @@ export default class ConnectionBase { /** * audio track を停止するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * sendrecv.stopAudioTrack(mediaStream); + * ``` + * * @remarks * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します * @@ -153,6 +170,15 @@ export default class ConnectionBase { /** * video track を停止するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * sendrecv.stopVideoTrack(mediaStream); + * ``` + * * @remarks * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します * @@ -164,6 +190,16 @@ export default class ConnectionBase { /** * audio track を入れ替えするメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * const replacedMediaStream = await navigator.mediaDevices.getUserMedia({audio: true}); + * await sendrecv.replaceAudioTrack(mediaStream, replacedMediaStream.getAudioTracks()[0]); + * ``` + * * @remarks * stream の audio track を停止後、新しい audio track をセットします * @@ -176,6 +212,16 @@ export default class ConnectionBase { /** * video track を入れ替えするメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * const replacedMediaStream = await navigator.mediaDevices.getUserMedia({video: true}); + * await sendrecv.replaceVideoTrack(mediaStream, replacedMediaStream.getVideoTracks()[0]); + * ``` + * * @remarks * stream の video track を停止後、新しい video track をセットします * @@ -236,6 +282,11 @@ export default class ConnectionBase { /** * 切断処理をするメソッド * + * @example + * ``` + * await sendrecv.disconnect(); + * ``` + * * @public */ disconnect(): Promise; diff --git a/dist/publisher.d.ts b/dist/publisher.d.ts index 46fc5b91..1688b010 100644 --- a/dist/publisher.d.ts +++ b/dist/publisher.d.ts @@ -1,6 +1,33 @@ import ConnectionBase from "./base"; +/** + * Role が "sendonly" または "sendrecv" の場合に Sora との WebRTC 接続を扱うクラス + */ export default class ConnectionPublisher extends ConnectionBase { + /** + * Sora へ接続するメソッド + * + * @example + * ```typescript + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * ``` + * + * @param stream - メディアストリーム + * + * @public + */ connect(stream: MediaStream): Promise; + /** + * シングルストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ private singleStream; + /** + * マルチストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ private multiStream; } diff --git a/dist/sora.d.ts b/dist/sora.d.ts index f7599f55..38ec6aae 100644 --- a/dist/sora.d.ts +++ b/dist/sora.d.ts @@ -2,7 +2,7 @@ import ConnectionBase from "./base"; import ConnectionPublisher from "./publisher"; import ConnectionSubscriber from "./subscriber"; import { applyMediaStreamConstraints } from "./helpers"; -import type { AudioCodecType, Callbacks, ConnectionOptions, DataChannelConfiguration, DataChannelDirection, DataChannelEvent, DataChannelMessageEvent, JSONType, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; +import type { AudioCodecType, Callbacks, ConnectionOptions, DataChannelConfiguration, DataChannelDirection, DataChannelEvent, DataChannelMessageEvent, JSONType, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, SignalingPushMessage, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType } from "./types"; /** * Role 毎の Connection インスタンスを生成するためのクラス * @@ -22,6 +22,12 @@ declare class SoraConnection { /** * role sendrecv で接続するための Connecion インスタンスを生成するメソッド * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const sendrecv = connection.sendrecv("sora"); + * ``` + * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション @@ -39,6 +45,12 @@ declare class SoraConnection { * @param metadata - メタデータ * @param options - コネクションオプション * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const sendonly = connection.sendonly("sora"); + * ``` + * * @returns * role sendonly な Connection オブジェクトを返します * @@ -48,6 +60,12 @@ declare class SoraConnection { /** * role recvonly で接続するための Connecion インスタンスを生成するメソッド * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const recvonly = connection.recvonly("sora"); + * ``` + * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション @@ -70,6 +88,10 @@ declare const _default: { /** * E2EE で使用する WASM の読み込みを行うメソッド * + * @example + * ```typescript + * Sora.initE2EE("http://192.0.2.100/wasm.wasm"); + * ``` * @param wasmUrl - E2EE WASM の URL * * @public @@ -78,10 +100,16 @@ declare const _default: { /** * SoraConnection インスタンスを生成するメソッド * - * @param wasmUrl - シグナリングに使用する URL 候補 + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * ``` + * + * @param signalingUrlCandidates - シグナリングに使用する URL 候補 * @param debug - デバッグフラグ * * @public + * */ connection: (signalingUrlCandidates: string | string[], debug?: boolean) => SoraConnection; /** @@ -103,4 +131,4 @@ declare const _default: { * Sora JS SDK package */ export default _default; -export type { AudioCodecType, Callbacks, ConnectionBase, ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, DataChannelConfiguration, DataChannelDirection, DataChannelEvent, DataChannelMessageEvent, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SoraConnection, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType, }; +export type { AudioCodecType, Callbacks, ConnectionBase, ConnectionOptions, ConnectionPublisher, ConnectionSubscriber, DataChannelConfiguration, DataChannelDirection, DataChannelEvent, DataChannelMessageEvent, JSONType, Role, SignalingEvent, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, SignalingNotifyConnectionUpdated, SignalingNotifyMessage, SignalingNotifyMetadata, SignalingNotifyNetworkStatus, SignalingNotifySpotlightChanged, SignalingNotifySpotlightFocused, SignalingNotifySpotlightUnfocused, SignalingPushMessage, Simulcast, SimulcastRid, SoraAbendTitle, SoraCloseEvent, SoraCloseEventInitDict, SoraCloseEventType, SoraConnection, SpotlightFocusRid, TimelineEvent, TimelineEventLogType, TransportType, VideoCodecType, }; diff --git a/dist/sora.js b/dist/sora.js index 27d16c06..122512dd 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.10 + * @version: 2021.2.0-canary.11 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.10", + sora_client: "Sora JavaScript SDK 2021.2.0-canary.11", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -2012,10 +2012,18 @@ /** * SendRecv Object で発火するイベントのコールバックを設定するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * sendrecv.on("track", (event) => { + * // callback 処理 + * }); + * ``` + * * @remarks - * addstream イベントは非推奨です.track イベントを使用してください + * addstream イベントは非推奨です. track イベントを使用してください * - * removestream イベントは非推奨です.removetrack イベントを使用してください + * removestream イベントは非推奨です. removetrack イベントを使用してください * * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message, datachannel) * @param callback - コールバック関数 @@ -2037,6 +2045,15 @@ /** * audio track を停止するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * sendrecv.stopAudioTrack(mediaStream); + * ``` + * * @remarks * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します * @@ -2070,6 +2087,15 @@ /** * video track を停止するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * sendrecv.stopVideoTrack(mediaStream); + * ``` + * * @remarks * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します * @@ -2103,6 +2129,16 @@ /** * audio track を入れ替えするメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * const replacedMediaStream = await navigator.mediaDevices.getUserMedia({audio: true}); + * await sendrecv.replaceAudioTrack(mediaStream, replacedMediaStream.getAudioTracks()[0]); + * ``` + * * @remarks * stream の audio track を停止後、新しい audio track をセットします * @@ -2123,6 +2159,16 @@ /** * video track を入れ替えするメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * const replacedMediaStream = await navigator.mediaDevices.getUserMedia({video: true}); + * await sendrecv.replaceVideoTrack(mediaStream, replacedMediaStream.getVideoTracks()[0]); + * ``` + * * @remarks * stream の video track を停止後、新しい video track をセットします * @@ -2400,7 +2446,7 @@ this.ws.close(); this.ws = null; } - resolve(null); + resolve({ code: 1006, reason: "" }); }, this.disconnectWaitTimeout); } else { @@ -2537,6 +2583,11 @@ /** * 切断処理をするメソッド * + * @example + * ``` + * await sendrecv.disconnect(); + * ``` + * * @public */ async disconnect() { @@ -3845,7 +3896,24 @@ } } + /** + * Role が "sendonly" または "sendrecv" の場合に Sora との WebRTC 接続を扱うクラス + */ class ConnectionPublisher extends ConnectionBase { + /** + * Sora へ接続するメソッド + * + * @example + * ```typescript + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * ``` + * + * @param stream - メディアストリーム + * + * @public + */ async connect(stream) { if (this.options.multistream) { await Promise.race([ @@ -3871,6 +3939,11 @@ this.monitorPeerConnectionState(); return stream; } + /** + * シングルストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ async singleStream(stream) { await this.disconnect(); this.setupE2EE(); @@ -3898,6 +3971,11 @@ await this.waitChangeConnectionStateConnected(); return stream; } + /** + * マルチストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ async multiStream(stream) { await this.disconnect(); this.setupE2EE(); @@ -3975,7 +4053,23 @@ } } + /** + * Role が "recvonly" の場合に Sora との WebRTC 接続を扱うクラス + */ class ConnectionSubscriber extends ConnectionBase { + /** + * Sora へ接続するメソッド + * + * @example + * ```typescript + * const recvonly = connection.sendrecv("sora"); + * await recvonly.connect(); + * ``` + * + * @param stream - メディアストリーム + * + * @public + */ async connect() { if (this.options.multistream) { await Promise.race([ @@ -4004,6 +4098,11 @@ return stream; } } + /** + * シングルストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ async singleStream() { await this.disconnect(); this.setupE2EE(); @@ -4061,6 +4160,11 @@ await this.waitChangeConnectionStateConnected(); return this.stream || new MediaStream(); } + /** + * マルチストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ async multiStream() { await this.disconnect(); this.setupE2EE(); @@ -4158,6 +4262,12 @@ /** * role sendrecv で接続するための Connecion インスタンスを生成するメソッド * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const sendrecv = connection.sendrecv("sora"); + * ``` + * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション @@ -4177,6 +4287,12 @@ * @param metadata - メタデータ * @param options - コネクションオプション * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const sendonly = connection.sendonly("sora"); + * ``` + * * @returns * role sendonly な Connection オブジェクトを返します * @@ -4188,6 +4304,12 @@ /** * role recvonly で接続するための Connecion インスタンスを生成するメソッド * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const recvonly = connection.recvonly("sora"); + * ``` + * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション @@ -4217,6 +4339,10 @@ /** * E2EE で使用する WASM の読み込みを行うメソッド * + * @example + * ```typescript + * Sora.initE2EE("http://192.0.2.100/wasm.wasm"); + * ``` * @param wasmUrl - E2EE WASM の URL * * @public @@ -4227,10 +4353,16 @@ /** * SoraConnection インスタンスを生成するメソッド * - * @param wasmUrl - シグナリングに使用する URL 候補 + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * ``` + * + * @param signalingUrlCandidates - シグナリングに使用する URL 候補 * @param debug - デバッグフラグ * * @public + * */ connection: function (signalingUrlCandidates, debug = false) { return new SoraConnection(signalingUrlCandidates, debug); @@ -4241,7 +4373,7 @@ * @public */ version: function () { - return "2021.2.0-canary.10"; + return "2021.2.0-canary.11"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/sora.min.js b/dist/sora.min.js index b6d1c97b..7cc511db 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sora=t()}(this,(function(){"use strict";class e{constructor(){if(!!!RTCRtpSender.prototype.createEncodedStreams)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G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WxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},l=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,g(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),g(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),g(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),g(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,g(e+16)),i=l(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=l(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=l(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(l=new n(s),a=0;a>>15-e[a]);return l},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var p=new t(32);for(m=0;m<32;++m)p[m]=5;var Z=A(b,9,0),w=A(b,9,1),S=A(p,5,0),V=A(p,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=l[a].s);var m=new n(I+1),u=E(s[d-1],m,0);if(u>i){a=0;var A=0,b=u-i,p=1<i))break;A+=p-(1<>>=b;A>0;){var w=l[a].s;m[w]=0&&A;--a){var S=l[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,l=function(e){i[s++]=e},g=1;g<=t;++g)if(e[g]==a&&g!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(a),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(a);o=1,a=e[g]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!D[o[U-1]];--U);var M,j,Q,H,x=h+5<<3,P=B(g,b)+B(c,p)+r,z=B(g,u)+B(c,f)+r+14+3*U+B(K,D)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(d,d+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=Z,j=b,Q=S,H=p;for(L=0;L255){te=l[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,l[L]>>>23&31),I+=s[te]);var ne=31&l[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,l[L]>>>5&8191),I+=a[ne])}else X(t,I,M[l[L]]),I+=j[l[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),D=function(e,o,l,g,c){return function(e,o,l,g,c,C){var d=e.length,I=new t(g+d+5*(1+Math.ceil(d/7e3))+c),m=I.subarray(g,I.length-c),u=0;if(!o||d<8)for(var A=0;A<=d;A+=65535){var b=A+65535;b>>13,w=8191&p,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,D,A-D,u),N=O=E=0,D=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=U-M&32767;if(j>2&&F==R(A-z))for(var _=Math.min(Z,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&U!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(U=M)-(M=V[U])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,C,v,T,X,E,N,D,A-D,u),!C&&7&u&&(u=Y(m,u+1,J))}return k(I,0,g+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,l,g,!c)};function F(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var l=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=D(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function U(e,n){return function(e,n,i){var l=e.length;if(!l||i&&i.f&&!i.l)return n||new t(0);var g=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*l));var C=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,p=i.m,Z=i.n,S=8*l;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(F=G(I)+4)-4]|e[F-3]<<8,X=F+T;if(X>l){r&&v(0);break}g&&C(m+T),n.set(e.subarray(F,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,p=9,Z=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=F;else{var M=0,j=0;for(16==F?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==F?(j=3+y(e,I,7),I+=3):18==F&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);p=f(Q),Z=f(H),u=A(Q,p,1),b=A(H,Z,1)}else v(1);if(I>S){r&&v(0);break}}g&&C(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=d[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}g&&C(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.10",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const l=["audioCodecType","audioBitRate"],g=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const C=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&C&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const d=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&d&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n(null)}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise(((t,n)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.soraDataChannels)){const a=this.soraDataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(null!==e.mid&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return""!==this.mids.video&&this.mids.video===e.mid||0<=e.mid.indexOf("video")?e:void 0}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws){e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"));for(const e of this.datachannels)this.callbacks.datachannel($(e))}}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#.*/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=U(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=F((new TextEncoder).encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=F(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get datachannels(){if(!this.signalingSwitched)return[];const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#.*/.exec(e))),t=[];for(const n of e){const e=this.soraDataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class te extends ee{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ne extends ee{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var p=new t(32);for(m=0;m<32;++m)p[m]=5;var Z=A(b,9,0),w=A(b,9,1),S=A(p,5,0),V=A(p,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[d-1],m,0);if(u>i){a=0;var A=0,b=u-i,p=1<i))break;A+=p-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!D[o[U-1]];--U);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,p)+r,z=B(l,u)+B(c,f)+r+14+3*U+B(K,D)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(d,d+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=Z,j=b,Q=S,H=p;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),D=function(e,o,g,l,c){return function(e,o,g,l,c,C){var d=e.length,I=new t(l+d+5*(1+Math.ceil(d/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||d<8)for(var A=0;A<=d;A+=65535){var b=A+65535;b>>13,w=8191&p,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,D,A-D,u),N=O=E=0,D=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=U-M&32767;if(j>2&&F==R(A-z))for(var _=Math.min(Z,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&U!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(U=M)-(M=V[U])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,C,v,T,X,E,N,D,A-D,u),!C&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function F(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=D(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function U(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var C=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,p=i.m,Z=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(F=G(I)+4)-4]|e[F-3]<<8,X=F+T;if(X>g){r&&v(0);break}l&&C(m+T),n.set(e.subarray(F,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,p=9,Z=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=F;else{var M=0,j=0;for(16==F?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==F?(j=3+y(e,I,7),I+=3):18==F&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);p=f(Q),Z=f(H),u=A(Q,p,1),b=A(H,Z,1)}else v(1);if(I>S){r&&v(0);break}}l&&C(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=d[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&C(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.11",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const C=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&C&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const d=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&d&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n({code:1006,reason:""})}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise(((t,n)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.soraDataChannels)){const a=this.soraDataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(null!==e.mid&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return""!==this.mids.video&&this.mids.video===e.mid||0<=e.mid.indexOf("video")?e:void 0}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws){e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"));for(const e of this.datachannels)this.callbacks.datachannel($(e))}}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#.*/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=U(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=F((new TextEncoder).encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=F(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get datachannels(){if(!this.signalingSwitched)return[];const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#.*/.exec(e))),t=[];for(const n of e){const e=this.soraDataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class te extends ee{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ne extends ee{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1 { + * // callback 処理 + * }); + * ``` + * * @remarks - * addstream イベントは非推奨です.track イベントを使用してください + * addstream イベントは非推奨です. track イベントを使用してください * - * removestream イベントは非推奨です.removetrack イベントを使用してください + * removestream イベントは非推奨です. removetrack イベントを使用してください * * @param kind - イベントの種類(disconnect, push, track, removetrack, notify, log, timeout, timeline, signaling, message, datachannel) * @param callback - コールバック関数 @@ -2031,6 +2039,15 @@ class ConnectionBase { /** * audio track を停止するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * sendrecv.stopAudioTrack(mediaStream); + * ``` + * * @remarks * stream の audio track を停止後、PeerConnection の senders から対象の sender を削除します * @@ -2064,6 +2081,15 @@ class ConnectionBase { /** * video track を停止するメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * sendrecv.stopVideoTrack(mediaStream); + * ``` + * * @remarks * stream の video track を停止後、PeerConnection の senders から対象の sender を削除します * @@ -2097,6 +2123,16 @@ class ConnectionBase { /** * audio track を入れ替えするメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * const replacedMediaStream = await navigator.mediaDevices.getUserMedia({audio: true}); + * await sendrecv.replaceAudioTrack(mediaStream, replacedMediaStream.getAudioTracks()[0]); + * ``` + * * @remarks * stream の audio track を停止後、新しい audio track をセットします * @@ -2117,6 +2153,16 @@ class ConnectionBase { /** * video track を入れ替えするメソッド * + * @example + * ``` + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * + * const replacedMediaStream = await navigator.mediaDevices.getUserMedia({video: true}); + * await sendrecv.replaceVideoTrack(mediaStream, replacedMediaStream.getVideoTracks()[0]); + * ``` + * * @remarks * stream の video track を停止後、新しい video track をセットします * @@ -2394,7 +2440,7 @@ class ConnectionBase { this.ws.close(); this.ws = null; } - resolve(null); + resolve({ code: 1006, reason: "" }); }, this.disconnectWaitTimeout); } else { @@ -2531,6 +2577,11 @@ class ConnectionBase { /** * 切断処理をするメソッド * + * @example + * ``` + * await sendrecv.disconnect(); + * ``` + * * @public */ async disconnect() { @@ -3839,7 +3890,24 @@ class ConnectionBase { } } +/** + * Role が "sendonly" または "sendrecv" の場合に Sora との WebRTC 接続を扱うクラス + */ class ConnectionPublisher extends ConnectionBase { + /** + * Sora へ接続するメソッド + * + * @example + * ```typescript + * const sendrecv = connection.sendrecv("sora"); + * const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); + * await sendrecv.connect(mediaStream); + * ``` + * + * @param stream - メディアストリーム + * + * @public + */ async connect(stream) { if (this.options.multistream) { await Promise.race([ @@ -3865,6 +3933,11 @@ class ConnectionPublisher extends ConnectionBase { this.monitorPeerConnectionState(); return stream; } + /** + * シングルストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ async singleStream(stream) { await this.disconnect(); this.setupE2EE(); @@ -3892,6 +3965,11 @@ class ConnectionPublisher extends ConnectionBase { await this.waitChangeConnectionStateConnected(); return stream; } + /** + * マルチストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ async multiStream(stream) { await this.disconnect(); this.setupE2EE(); @@ -3969,7 +4047,23 @@ class ConnectionPublisher extends ConnectionBase { } } +/** + * Role が "recvonly" の場合に Sora との WebRTC 接続を扱うクラス + */ class ConnectionSubscriber extends ConnectionBase { + /** + * Sora へ接続するメソッド + * + * @example + * ```typescript + * const recvonly = connection.sendrecv("sora"); + * await recvonly.connect(); + * ``` + * + * @param stream - メディアストリーム + * + * @public + */ async connect() { if (this.options.multistream) { await Promise.race([ @@ -3998,6 +4092,11 @@ class ConnectionSubscriber extends ConnectionBase { return stream; } } + /** + * シングルストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ async singleStream() { await this.disconnect(); this.setupE2EE(); @@ -4055,6 +4154,11 @@ class ConnectionSubscriber extends ConnectionBase { await this.waitChangeConnectionStateConnected(); return this.stream || new MediaStream(); } + /** + * マルチストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ async multiStream() { await this.disconnect(); this.setupE2EE(); @@ -4152,6 +4256,12 @@ class SoraConnection { /** * role sendrecv で接続するための Connecion インスタンスを生成するメソッド * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const sendrecv = connection.sendrecv("sora"); + * ``` + * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション @@ -4171,6 +4281,12 @@ class SoraConnection { * @param metadata - メタデータ * @param options - コネクションオプション * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const sendonly = connection.sendonly("sora"); + * ``` + * * @returns * role sendonly な Connection オブジェクトを返します * @@ -4182,6 +4298,12 @@ class SoraConnection { /** * role recvonly で接続するための Connecion インスタンスを生成するメソッド * + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * const recvonly = connection.recvonly("sora"); + * ``` + * * @param channelId - チャネルID * @param metadata - メタデータ * @param options - コネクションオプション @@ -4211,6 +4333,10 @@ var sora = { /** * E2EE で使用する WASM の読み込みを行うメソッド * + * @example + * ```typescript + * Sora.initE2EE("http://192.0.2.100/wasm.wasm"); + * ``` * @param wasmUrl - E2EE WASM の URL * * @public @@ -4221,10 +4347,16 @@ var sora = { /** * SoraConnection インスタンスを生成するメソッド * - * @param wasmUrl - シグナリングに使用する URL 候補 + * @example + * ```typescript + * const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true); + * ``` + * + * @param signalingUrlCandidates - シグナリングに使用する URL 候補 * @param debug - デバッグフラグ * * @public + * */ connection: function (signalingUrlCandidates, debug = false) { return new SoraConnection(signalingUrlCandidates, debug); @@ -4235,7 +4367,7 @@ var sora = { * @public */ version: function () { - return "2021.2.0-canary.10"; + return "2021.2.0-canary.11"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/subscriber.d.ts b/dist/subscriber.d.ts index 094c88b9..5f5368e4 100644 --- a/dist/subscriber.d.ts +++ b/dist/subscriber.d.ts @@ -1,6 +1,32 @@ import ConnectionBase from "./base"; +/** + * Role が "recvonly" の場合に Sora との WebRTC 接続を扱うクラス + */ export default class ConnectionSubscriber extends ConnectionBase { + /** + * Sora へ接続するメソッド + * + * @example + * ```typescript + * const recvonly = connection.sendrecv("sora"); + * await recvonly.connect(); + * ``` + * + * @param stream - メディアストリーム + * + * @public + */ connect(): Promise; + /** + * シングルストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ private singleStream; + /** + * マルチストリームで Sora へ接続するメソッド + * + * @param stream - メディアストリーム + */ private multiStream; } diff --git a/package-lock.json b/package-lock.json index a6954b0a..8be43906 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.10", + "version": "2021.2.0-canary.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sora-js-sdk", - "version": "2021.2.0-canary.10", + "version": "2021.2.0-canary.11", "license": "Apache-2.0", "workspaces": [ "packages/go-wasm", diff --git a/package.json b/package.json index a3f54cc2..e08feb2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.10", + "version": "2021.2.0-canary.11", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", From 7bcedbe03c699bfdda08c868fcbbc312367d2964 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Thu, 9 Dec 2021 12:11:13 +0900 Subject: [PATCH 84/87] =?UTF-8?q?=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 2477 ++++++--------------------------------------- package.json | 4 +- 2 files changed, 334 insertions(+), 2147 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8be43906..e176dfac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,8 @@ "packages/sdk" ], "devDependencies": { - "npm-check-updates": "^11.8.5", - "serve": "^12.0.1", + "npm-check-updates": "^12.0.3", + "serve": "^13.0.2", "typedoc": "^0.22.10" } }, @@ -917,27 +917,6 @@ } } }, - "node_modules/@jest/core/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/core/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/environment": { "version": "27.3.1", "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-27.3.1.tgz", @@ -1220,14 +1199,14 @@ } }, "node_modules/@npmcli/run-script": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz", - "integrity": "sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-2.0.0.tgz", + "integrity": "sha512-fSan/Pu11xS/TdaTpTB0MRn9guwGU8dye+x56mEVgBEd/QsybBbYcAL0phPXi8SGWFEChkQd6M9qL4y6VOpFig==", "dev": true, "dependencies": { "@npmcli/node-gyp": "^1.0.2", "@npmcli/promise-spawn": "^1.3.2", - "node-gyp": "^7.1.0", + "node-gyp": "^8.2.0", "read-package-json-fast": "^2.0.1" } }, @@ -1789,55 +1768,12 @@ } }, "node_modules/ansi-align": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", - "dev": true, - "dependencies": { - "string-width": "^2.0.0" - } - }, - "node_modules/ansi-align/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ansi-align/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ansi-align/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ansi-align/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" + "string-width": "^4.1.0" } }, "node_modules/ansi-colors": { @@ -1877,12 +1813,12 @@ } }, "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/ansi-styles": { @@ -1914,9 +1850,9 @@ } }, "node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, "node_modules/arch": { @@ -1940,13 +1876,16 @@ ] }, "node_modules/are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", "dev": true, "dependencies": { "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" } }, "node_modules/arg": { @@ -1970,24 +1909,6 @@ "node": ">=8" } }, - "node_modules/asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -2003,21 +1924,6 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true - }, "node_modules/babel-jest": { "version": "27.3.1", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.3.1.tgz", @@ -2141,136 +2047,26 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/boxen": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", - "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", - "dev": true, - "dependencies": { - "ansi-align": "^2.0.0", - "camelcase": "^4.0.0", - "chalk": "^2.0.1", - "cli-boxes": "^1.0.0", - "string-width": "^2.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/boxen/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/boxen/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/boxen/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/boxen/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/boxen/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/boxen/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/boxen/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/boxen/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/boxen/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", "dev": true, "dependencies": { - "ansi-regex": "^3.0.0" + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/boxen/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" + "node": ">=10" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/brace-expansion": { @@ -2458,12 +2254,15 @@ } }, "node_modules/camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/caniuse-lite": { @@ -2476,12 +2275,6 @@ "url": "https://opencollective.com/browserslist" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2544,18 +2337,21 @@ } }, "node_modules/cli-boxes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-table": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.6.tgz", - "integrity": "sha512-ZkNZbnZjKERTY5NwC2SeMeLeifSPq/pubeRoTpdr3WchLlnZg6hEgvHkK5zL7KNFdd9PmHN8lxrENUwI3cE8vQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", + "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", "dev": true, "dependencies": { "colors": "1.0.3" @@ -2589,50 +2385,6 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", @@ -2652,15 +2404,6 @@ "node": ">= 0.12.0" } }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/collect-v8-coverage": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", @@ -2685,6 +2428,15 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, "node_modules/colors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", @@ -2707,12 +2459,12 @@ } }, "node_modules/commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true, "engines": { - "node": ">= 6" + "node": ">= 12" } }, "node_modules/commondir": { @@ -2813,12 +2565,6 @@ "safe-buffer": "~5.1.1" } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, "node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -2889,18 +2635,6 @@ "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", "dev": true }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/data-urls": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", @@ -3091,16 +2825,6 @@ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", "dev": true }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "node_modules/electron-to-chromium": { "version": "1.3.882", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.882.tgz", @@ -3409,15 +3133,6 @@ "node": ">=10" } }, - "node_modules/eslint/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -3529,18 +3244,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint/node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -3711,21 +3414,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true, - "engines": [ - "node >=0.6.0" - ] - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3886,29 +3574,6 @@ "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, "node_modules/fp-and-or": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-0.1.3.tgz", @@ -3976,19 +3641,23 @@ "dev": true }, "node_modules/gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.0.tgz", + "integrity": "sha512-F8sU45yQpjQjxKkm1UOAhf0U/O0aFt//Fl7hsrNVto+patMHjs7dPI9mFOGUKbhrgKm0S3EjW3scMFuQmWSROw==", "dev": true, "dependencies": { - "aproba": "^1.0.3", + "ansi-regex": "^5.0.1", + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", + "has-unicode": "^2.0.1", "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" } }, "node_modules/gensync": { @@ -4042,15 +3711,6 @@ "node": ">=6" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -4170,29 +3830,6 @@ "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", "dev": true }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "dev": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -4278,21 +3915,6 @@ "node": ">= 6" } }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, "node_modules/https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -4347,12 +3969,15 @@ } }, "node_modules/ignore-walk": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz", - "integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-4.0.1.tgz", + "integrity": "sha512-rzDQLaW4jQbh2YrOFlJdCtX8qgJTehFRYiUB2r1osqTeDzV/3+Jh8fz1oAPzUThf3iku8Ds4IDqawI5d8mUiQw==", "dev": true, "dependencies": { "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10" } }, "node_modules/import-fresh": { @@ -4497,15 +4122,12 @@ } }, "node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "dependencies": { - "number-is-nan": "^1.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/is-generator-fn": { @@ -4644,24 +4266,12 @@ "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", "dev": true }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", @@ -5525,18 +5135,6 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/jest-watcher": { "version": "27.3.1", "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-27.3.1.tgz", @@ -5607,12 +5205,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, "node_modules/jsdom": { "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", @@ -5741,12 +5333,6 @@ "jju": "^1.1.0" } }, - "node_modules/json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -5759,12 +5345,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, "node_modules/json5": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", @@ -5810,21 +5390,6 @@ "node >= 0.2.0" ] }, - "node_modules/jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "node_modules/keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -6320,20 +5885,20 @@ "dev": true }, "node_modules/node-gyp": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", - "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", "dev": true, "dependencies": { "env-paths": "^2.2.0", "glob": "^7.1.4", - "graceful-fs": "^4.2.3", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "request": "^2.88.2", + "npmlog": "^6.0.0", "rimraf": "^3.0.2", - "semver": "^7.3.2", - "tar": "^6.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", "which": "^2.0.2" }, "bin": { @@ -6407,15 +5972,15 @@ } }, "node_modules/npm-check-updates": { - "version": "11.8.5", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-11.8.5.tgz", - "integrity": "sha512-IYSHjlWe8UEugDy7X0qjBeJwcni4DlcWdBK4QQEbwgkNlEDlXyd4yQJYWFumKaJzrp/n5/EcvaboXsBD1Er/pw==", + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.0.3.tgz", + "integrity": "sha512-MTHzkDZY1ebhPaDvzWOU9bt4UYdHmY4tIcMCaZjgguGKUgwqokH/aB0Nrc4WcZ4rD491Spuj5DILo/RvKAefvw==", "dev": true, "dependencies": { "chalk": "^4.1.2", "cint": "^8.2.1", - "cli-table": "^0.3.6", - "commander": "^6.2.1", + "cli-table": "^0.3.11", + "commander": "^8.3.0", "fast-memoize": "^2.5.2", "find-up": "5.0.0", "fp-and-or": "^0.1.3", @@ -6428,24 +5993,25 @@ "lodash": "^4.17.21", "minimatch": "^3.0.4", "p-map": "^4.0.0", - "pacote": "^11.3.5", + "pacote": "^12.0.2", "parse-github-url": "^1.0.2", "progress": "^2.0.3", - "prompts": "^2.4.1", + "prompts": "^2.4.2", "rc-config-loader": "^4.0.0", "remote-git-tags": "^3.0.0", "rimraf": "^3.0.2", "semver": "^7.3.5", "semver-utils": "^1.1.4", + "source-map-support": "^0.5.21", "spawn-please": "^1.0.0", "update-notifier": "^5.1.0" }, "bin": { - "ncu": "bin/cli.js", - "npm-check-updates": "bin/cli.js" + "ncu": "build/src/bin/cli.js", + "npm-check-updates": "build/src/bin/cli.js" }, "engines": { - "node": ">=10.17" + "node": ">=12" } }, "node_modules/npm-install-checks": { @@ -6481,13 +6047,13 @@ } }, "node_modules/npm-packlist": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz", - "integrity": "sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-3.0.0.tgz", + "integrity": "sha512-L/cbzmutAwII5glUcf2DBRNY/d0TFd4e/FnaZigJV6JD85RHZXJFGwCndjMWiiViiWSsWt3tiOLpI3ByTnIdFQ==", "dev": true, "dependencies": { "glob": "^7.1.6", - "ignore-walk": "^3.0.3", + "ignore-walk": "^4.0.1", "npm-bundled": "^1.1.1", "npm-normalize-package-bin": "^1.0.1" }, @@ -6540,24 +6106,18 @@ } }, "node_modules/npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.0.tgz", + "integrity": "sha512-03ppFRGlsyUaQFbGC2C8QWJN/C/K7PsfyD9aQdhVKAQIH4sQBc8WASqFBP7O+Ut4d2oo5LoeoboB3cGdBZSp6Q==", "dev": true, "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.0", + "set-blocking": "^2.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16" } }, "node_modules/nwsapi": { @@ -6566,24 +6126,6 @@ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/on-headers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", @@ -6779,15 +6321,15 @@ } }, "node_modules/pacote": { - "version": "11.3.5", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz", - "integrity": "sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg==", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-12.0.2.tgz", + "integrity": "sha512-Ar3mhjcxhMzk+OVZ8pbnXdb0l8+pimvlsqBGRNkble2NVgyqOGE3yrCGi/lAYq7E7NRDMz89R1Wx5HIMCGgeYg==", "dev": true, "dependencies": { "@npmcli/git": "^2.1.0", "@npmcli/installed-package-contents": "^1.0.6", "@npmcli/promise-spawn": "^1.2.0", - "@npmcli/run-script": "^1.8.2", + "@npmcli/run-script": "^2.0.0", "cacache": "^15.0.5", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", @@ -6795,7 +6337,7 @@ "minipass": "^3.1.3", "mkdirp": "^1.0.3", "npm-package-arg": "^8.0.1", - "npm-packlist": "^2.1.4", + "npm-packlist": "^3.0.0", "npm-pick-manifest": "^6.0.0", "npm-registry-fetch": "^11.0.0", "promise-retry": "^2.0.1", @@ -6808,7 +6350,7 @@ "pacote": "lib/bin.js" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" } }, "node_modules/parent-module": { @@ -6895,12 +6437,6 @@ "node": ">=8" } }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -7052,15 +6588,6 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "node_modules/pretty-format/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", @@ -7073,12 +6600,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -7120,12 +6641,6 @@ "node": ">= 6" } }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -7160,15 +6675,6 @@ "node": ">=8" } }, - "node_modules/qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -7253,18 +6759,17 @@ } }, "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" } }, "node_modules/regexpp": { @@ -7310,38 +6815,6 @@ "node": ">=8" } }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dev": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -7623,15 +7096,15 @@ } }, "node_modules/serve": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.1.tgz", - "integrity": "sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/serve/-/serve-13.0.2.tgz", + "integrity": "sha512-71R6fKvNgKrqARAag6lYJNnxDzpH7DCNrMuvPY5PLVaC2PDhJsGTj/34o4o4tPWhTuLgEXqvgnAWbATQ9zGZTQ==", "dev": true, "dependencies": { "@zeit/schemas": "2.6.0", "ajv": "6.12.6", "arg": "2.0.0", - "boxen": "1.3.0", + "boxen": "5.1.2", "chalk": "2.4.1", "clipboardy": "2.3.0", "compression": "1.7.3", @@ -7817,15 +7290,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -7851,9 +7315,9 @@ } }, "node_modules/socks-proxy-agent": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz", - "integrity": "sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz", + "integrity": "sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew==", "dev": true, "dependencies": { "agent-base": "^6.0.2", @@ -7873,9 +7337,9 @@ } }, "node_modules/source-map-support": { - "version": "0.5.20", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", - "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -7902,31 +7366,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "node_modules/sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ssri": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", @@ -7961,14 +7400,34 @@ } }, "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -7982,16 +7441,21 @@ "node": ">=10" } }, - "node_modules/string-length/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { "node": ">=8" } }, - "node_modules/string-length/node_modules/strip-ansi": { + "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -8003,32 +7467,6 @@ "node": ">=8" } }, - "node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -8128,56 +7566,12 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/table/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/table/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, - "node_modules/table/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -8195,84 +7589,6 @@ "node": ">= 10" } }, - "node_modules/term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "dev": true, - "dependencies": { - "execa": "^0.7.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/term-size/node_modules/cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "dependencies": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "node_modules/term-size/node_modules/execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "dependencies": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/term-size/node_modules/get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/term-size/node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "node_modules/term-size/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/term-size/node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, "node_modules/terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -8380,28 +7696,6 @@ "node": ">=8.0" } }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tough-cookie/node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/tr46": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", @@ -8490,24 +7784,6 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -8674,117 +7950,6 @@ "url": "https://github.com/yeoman/update-notifier?sponsor=1" } }, - "node_modules/update-notifier/node_modules/ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "dev": true, - "dependencies": { - "string-width": "^4.1.0" - } - }, - "node_modules/update-notifier/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/update-notifier/node_modules/boxen": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", - "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", - "dev": true, - "dependencies": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/update-notifier/node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/update-notifier/node_modules/cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/update-notifier/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/update-notifier/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/update-notifier/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/update-notifier/node_modules/widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "dependencies": { - "string-width": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -8821,16 +7986,6 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -8878,26 +8033,6 @@ "node": ">= 0.8" } }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/verror/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, "node_modules/vscode-textmate": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", @@ -9009,58 +8144,15 @@ } }, "node_modules/widest-line": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", - "dev": true, - "dependencies": { - "string-width": "^2.1.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/widest-line/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/widest-line/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/widest-line/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/widest-line/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", "dev": true, "dependencies": { - "ansi-regex": "^3.0.0" + "string-width": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/word-wrap": { @@ -9089,50 +8181,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -9227,56 +8275,12 @@ } }, "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, "engines": { - "node": ">=8" + "node": ">=10" } }, "node_modules/yocto-queue": { @@ -10032,23 +9036,6 @@ "rimraf": "^3.0.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } } }, "@jest/environment": { @@ -10280,14 +9267,14 @@ } }, "@npmcli/run-script": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz", - "integrity": "sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-2.0.0.tgz", + "integrity": "sha512-fSan/Pu11xS/TdaTpTB0MRn9guwGU8dye+x56mEVgBEd/QsybBbYcAL0phPXi8SGWFEChkQd6M9qL4y6VOpFig==", "dev": true, "requires": { "@npmcli/node-gyp": "^1.0.2", "@npmcli/promise-spawn": "^1.3.2", - "node-gyp": "^7.1.0", + "node-gyp": "^8.2.0", "read-package-json-fast": "^2.0.1" } }, @@ -10750,45 +9737,12 @@ } }, "ansi-align": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "requires": { - "string-width": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } + "string-width": "^4.1.0" } }, "ansi-colors": { @@ -10815,9 +9769,9 @@ } }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -10840,9 +9794,9 @@ } }, "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, "arch": { @@ -10852,13 +9806,13 @@ "dev": true }, "are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", "dev": true, "requires": { "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "readable-stream": "^3.6.0" } }, "arg": { @@ -10879,21 +9833,6 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, "astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -10906,18 +9845,6 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true - }, "babel-jest": { "version": "27.3.1", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.3.1.tgz", @@ -11016,111 +9943,20 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, "boxen": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", - "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", "dev": true, "requires": { - "ansi-align": "^2.0.0", - "camelcase": "^4.0.0", - "chalk": "^2.0.1", - "cli-boxes": "^1.0.0", - "string-width": "^2.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" } }, "brace-expansion": { @@ -11267,9 +10103,9 @@ "dev": true }, "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", "dev": true }, "caniuse-lite": { @@ -11278,12 +10114,6 @@ "integrity": "sha512-DV1j9Oot5dydyH1v28g25KoVm7l8MTxazwuiH3utWiAS6iL/9Nh//TGwqFEeqqN8nnWYQ8HHhUq+o4QPt9kvYw==", "dev": true }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -11331,15 +10161,15 @@ "dev": true }, "cli-boxes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", "dev": true }, "cli-table": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.6.tgz", - "integrity": "sha512-ZkNZbnZjKERTY5NwC2SeMeLeifSPq/pubeRoTpdr3WchLlnZg6hEgvHkK5zL7KNFdd9PmHN8lxrENUwI3cE8vQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", + "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", "dev": true, "requires": { "colors": "1.0.3" @@ -11365,40 +10195,6 @@ "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } } }, "clone-response": { @@ -11416,12 +10212,6 @@ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, "collect-v8-coverage": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", @@ -11443,6 +10233,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, "colors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", @@ -11459,9 +10255,9 @@ } }, "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true }, "commondir": { @@ -11552,12 +10348,6 @@ "safe-buffer": "~5.1.1" } }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -11617,15 +10407,6 @@ } } }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "data-urls": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", @@ -11771,16 +10552,6 @@ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", "dev": true }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "electron-to-chromium": { "version": "1.3.882", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.882.tgz", @@ -11964,12 +10735,6 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -12050,15 +10815,6 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -12228,18 +10984,6 @@ } } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -12376,23 +11120,6 @@ "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "fp-and-or": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-0.1.3.tgz", @@ -12444,19 +11171,20 @@ "dev": true }, "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.0.tgz", + "integrity": "sha512-F8sU45yQpjQjxKkm1UOAhf0U/O0aFt//Fl7hsrNVto+patMHjs7dPI9mFOGUKbhrgKm0S3EjW3scMFuQmWSROw==", "dev": true, "requires": { - "aproba": "^1.0.3", + "ansi-regex": "^5.0.1", + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", + "has-unicode": "^2.0.1", "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" } }, "gensync": { @@ -12492,15 +11220,6 @@ "pump": "^3.0.0" } }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -12589,22 +11308,6 @@ "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", "dev": true }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "dev": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -12672,17 +11375,6 @@ "debug": "4" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -12725,9 +11417,9 @@ "dev": true }, "ignore-walk": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz", - "integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-4.0.1.tgz", + "integrity": "sha512-rzDQLaW4jQbh2YrOFlJdCtX8qgJTehFRYiUB2r1osqTeDzV/3+Jh8fz1oAPzUThf3iku8Ds4IDqawI5d8mUiQw==", "dev": true, "requires": { "minimatch": "^3.0.4" @@ -12836,13 +11528,10 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true }, "is-generator-fn": { "version": "2.1.0", @@ -12947,24 +11636,12 @@ "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", "dev": true }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, "istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", @@ -13628,17 +12305,9 @@ "@jest/types": "^27.2.5", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^27.3.1", - "leven": "^3.1.0", - "pretty-format": "^27.3.1" - }, - "dependencies": { - "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true - } + "jest-get-type": "^27.3.1", + "leven": "^3.1.0", + "pretty-format": "^27.3.1" } }, "jest-watcher": { @@ -13698,12 +12367,6 @@ "argparse": "^2.0.1" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, "jsdom": { "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", @@ -13802,12 +12465,6 @@ "jju": "^1.1.0" } }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -13820,12 +12477,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, "json5": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", @@ -13862,18 +12513,6 @@ "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -14266,20 +12905,20 @@ "dev": true }, "node-gyp": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", - "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", "dev": true, "requires": { "env-paths": "^2.2.0", "glob": "^7.1.4", - "graceful-fs": "^4.2.3", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "request": "^2.88.2", + "npmlog": "^6.0.0", "rimraf": "^3.0.2", - "semver": "^7.3.2", - "tar": "^6.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", "which": "^2.0.2" } }, @@ -14332,15 +12971,15 @@ } }, "npm-check-updates": { - "version": "11.8.5", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-11.8.5.tgz", - "integrity": "sha512-IYSHjlWe8UEugDy7X0qjBeJwcni4DlcWdBK4QQEbwgkNlEDlXyd4yQJYWFumKaJzrp/n5/EcvaboXsBD1Er/pw==", + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.0.3.tgz", + "integrity": "sha512-MTHzkDZY1ebhPaDvzWOU9bt4UYdHmY4tIcMCaZjgguGKUgwqokH/aB0Nrc4WcZ4rD491Spuj5DILo/RvKAefvw==", "dev": true, "requires": { "chalk": "^4.1.2", "cint": "^8.2.1", - "cli-table": "^0.3.6", - "commander": "^6.2.1", + "cli-table": "^0.3.11", + "commander": "^8.3.0", "fast-memoize": "^2.5.2", "find-up": "5.0.0", "fp-and-or": "^0.1.3", @@ -14353,15 +12992,16 @@ "lodash": "^4.17.21", "minimatch": "^3.0.4", "p-map": "^4.0.0", - "pacote": "^11.3.5", + "pacote": "^12.0.2", "parse-github-url": "^1.0.2", "progress": "^2.0.3", - "prompts": "^2.4.1", + "prompts": "^2.4.2", "rc-config-loader": "^4.0.0", "remote-git-tags": "^3.0.0", "rimraf": "^3.0.2", "semver": "^7.3.5", "semver-utils": "^1.1.4", + "source-map-support": "^0.5.21", "spawn-please": "^1.0.0", "update-notifier": "^5.1.0" } @@ -14393,13 +13033,13 @@ } }, "npm-packlist": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz", - "integrity": "sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-3.0.0.tgz", + "integrity": "sha512-L/cbzmutAwII5glUcf2DBRNY/d0TFd4e/FnaZigJV6JD85RHZXJFGwCndjMWiiViiWSsWt3tiOLpI3ByTnIdFQ==", "dev": true, "requires": { "glob": "^7.1.6", - "ignore-walk": "^3.0.3", + "ignore-walk": "^4.0.1", "npm-bundled": "^1.1.1", "npm-normalize-package-bin": "^1.0.1" } @@ -14440,41 +13080,23 @@ } }, "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.0.tgz", + "integrity": "sha512-03ppFRGlsyUaQFbGC2C8QWJN/C/K7PsfyD9aQdhVKAQIH4sQBc8WASqFBP7O+Ut4d2oo5LoeoboB3cGdBZSp6Q==", "dev": true, "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.0", + "set-blocking": "^2.0.0" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, "on-headers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", @@ -14623,15 +13245,15 @@ } }, "pacote": { - "version": "11.3.5", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz", - "integrity": "sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg==", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-12.0.2.tgz", + "integrity": "sha512-Ar3mhjcxhMzk+OVZ8pbnXdb0l8+pimvlsqBGRNkble2NVgyqOGE3yrCGi/lAYq7E7NRDMz89R1Wx5HIMCGgeYg==", "dev": true, "requires": { "@npmcli/git": "^2.1.0", "@npmcli/installed-package-contents": "^1.0.6", "@npmcli/promise-spawn": "^1.2.0", - "@npmcli/run-script": "^1.8.2", + "@npmcli/run-script": "^2.0.0", "cacache": "^15.0.5", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", @@ -14639,7 +13261,7 @@ "minipass": "^3.1.3", "mkdirp": "^1.0.3", "npm-package-arg": "^8.0.1", - "npm-packlist": "^2.1.4", + "npm-packlist": "^3.0.0", "npm-pick-manifest": "^6.0.0", "npm-registry-fetch": "^11.0.0", "promise-retry": "^2.0.1", @@ -14712,12 +13334,6 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -14826,12 +13442,6 @@ "react-is": "^17.0.1" }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, "ansi-styles": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", @@ -14840,12 +13450,6 @@ } } }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -14878,12 +13482,6 @@ "sisteransi": "^1.0.5" } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -14915,12 +13513,6 @@ "escape-goat": "^2.0.0" } }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -14982,18 +13574,14 @@ } }, "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "regexpp": { @@ -15027,34 +13615,6 @@ "integrity": "sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w==", "dev": true }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -15262,15 +13822,15 @@ } }, "serve": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.1.tgz", - "integrity": "sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/serve/-/serve-13.0.2.tgz", + "integrity": "sha512-71R6fKvNgKrqARAag6lYJNnxDzpH7DCNrMuvPY5PLVaC2PDhJsGTj/34o4o4tPWhTuLgEXqvgnAWbATQ9zGZTQ==", "dev": true, "requires": { "@zeit/schemas": "2.6.0", "ajv": "6.12.6", "arg": "2.0.0", - "boxen": "1.3.0", + "boxen": "5.1.2", "chalk": "2.4.1", "clipboardy": "2.3.0", "compression": "1.7.3", @@ -15422,14 +13982,6 @@ "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - } } }, "smart-buffer": { @@ -15449,9 +14001,9 @@ } }, "socks-proxy-agent": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz", - "integrity": "sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz", + "integrity": "sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew==", "dev": true, "requires": { "agent-base": "^6.0.2", @@ -15465,9 +14017,9 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-support": { - "version": "0.5.20", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", - "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -15491,23 +14043,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "ssri": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", @@ -15535,12 +14070,20 @@ } }, "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } } }, "string-length": { @@ -15551,43 +14094,26 @@ "requires": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } } }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^5.0.1" } }, "strip-bom": { @@ -15664,43 +14190,11 @@ "uri-js": "^4.2.2" } }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } } } }, @@ -15718,74 +14212,6 @@ "yallist": "^4.0.0" } }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "dev": true, - "requires": { - "execa": "^0.7.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - } - } - }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -15868,24 +14294,6 @@ "is-number": "^7.0.0" } }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } - }, "tr46": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", @@ -15942,21 +14350,6 @@ } } }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -16077,86 +14470,6 @@ "semver": "^7.3.4", "semver-diff": "^3.1.1", "xdg-basedir": "^4.0.0" - }, - "dependencies": { - "ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "dev": true, - "requires": { - "string-width": "^4.1.0" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "boxen": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", - "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", - "dev": true, - "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - } - }, - "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true - }, - "cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "requires": { - "string-width": "^4.0.0" - } - } } }, "uri-js": { @@ -16191,12 +14504,6 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -16237,25 +14544,6 @@ "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", "dev": true }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - } - } - }, "vscode-textmate": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", @@ -16351,45 +14639,12 @@ } }, "widest-line": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", "dev": true, "requires": { - "string-width": "^2.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } + "string-width": "^4.0.0" } }, "word-wrap": { @@ -16407,40 +14662,6 @@ "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } } }, "wrappy": { @@ -16511,40 +14732,6 @@ "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } } }, "yargs-parser": { diff --git a/package.json b/package.json index e08feb2c..c40104fe 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ "dist" ], "devDependencies": { - "npm-check-updates": "^11.8.5", - "serve": "^12.0.1", + "npm-check-updates": "^12.0.3", + "serve": "^13.0.2", "typedoc": "^0.22.10" }, "resolutions": { From 5fa8c8bcb3f56ed75f1b9ccdfd1f34af03035a81 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Tue, 14 Dec 2021 10:36:12 +0900 Subject: [PATCH 85/87] =?UTF-8?q?CHANGES=20=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index b49b6b1b..63d45288 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,7 +9,7 @@ - FIX - バグ修正 -## develop +## 2021.2.0 - [UPDATE] simulcast 時の transceiver 判定条件に offer.mids.video での分岐を追加する - @yuitowest - [UPDATE] 複数パッケージの管理を lerna から npm workspace に変更する From cd90f91ffb5cc37d11305d02c1ecdb5d5514aed2 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Tue, 14 Dec 2021 10:36:36 +0900 Subject: [PATCH 86/87] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e176dfac..d5778b21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.11", + "version": "2021.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sora-js-sdk", - "version": "2021.2.0-canary.11", + "version": "2021.2.0", "license": "Apache-2.0", "workspaces": [ "packages/go-wasm", diff --git a/package.json b/package.json index c40104fe..ed0dd4fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2021.2.0-canary.11", + "version": "2021.2.0", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.min.js", "module": "dist/sora.mjs", From 07d452ab2133ac86054ff97b20410fec62c0bbdc Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Tue, 14 Dec 2021 10:38:36 +0900 Subject: [PATCH 87/87] =?UTF-8?q?=E6=88=90=E6=9E=9C=E7=89=A9=E3=82=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/sora.js | 6 +++--- dist/sora.min.js | 2 +- dist/sora.mjs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/sora.js b/dist/sora.js index 122512dd..f47ab642 100644 --- a/dist/sora.js +++ b/dist/sora.js @@ -1,7 +1,7 @@ /** * sora-js-sdk * WebRTC SFU Sora JavaScript SDK - * @version: 2021.2.0-canary.11 + * @version: 2021.2.0 * @author: Shiguredo Inc. * @license: Apache-2.0 **/ @@ -1635,7 +1635,7 @@ } const message = { type: "connect", - sora_client: "Sora JavaScript SDK 2021.2.0-canary.11", + sora_client: "Sora JavaScript SDK 2021.2.0", environment: window.navigator.userAgent, role: role, channel_id: channelId, @@ -4373,7 +4373,7 @@ * @public */ version: function () { - return "2021.2.0-canary.11"; + return "2021.2.0"; }, /** * WebRTC のユーティリティ関数群 diff --git a/dist/sora.min.js b/dist/sora.min.js index 7cc511db..57a77701 100644 --- a/dist/sora.min.js +++ b/dist/sora.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sora=t()}(this,(function(){"use strict";class e{constructor(){if(!!!RTCRtpSender.prototype.createEncodedStreams)throw new Error("E2EE is not supported in this browser.");this.worker=null,this.onWorkerDisconnect=null}startWorker(){const e=atob("InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3Vud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bcywgY291bnQsIGtleUlkXSA9IHBhcnNlU0ZyYW1lSGVhZGVyKHNmcmFtZUhlYWRlckJ1ZmZlcik7CiAgICAgICAgLy8g5LuK5Zue44GvIHMgZmxhZyDjga8gMCDjga7jgb8KICAgICAgICBpZiAocyAhPT0gMCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIlVORVhQRUNURUQtUy1GTEFHIik7CiAgICAgICAgfQogICAgICAgIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5UZXh0LmJ5dGVMZW5ndGgpOwogICAgICAgICAgICBjb25zdCBuZXdVaW50OC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sIikgewogICAgICAgIGNvbnN0IHsgc2VsZlNlY3JldEtleU1hdGVyaWFsLCBzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdhaXRpbmdUaW1lIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZ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VzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=");this.worker=new Worker(URL.createObjectURL(new Blob([e],{type:"application/javascript"}))),this.worker.onmessage=e=>{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var p=new t(32);for(m=0;m<32;++m)p[m]=5;var Z=A(b,9,0),w=A(b,9,1),S=A(p,5,0),V=A(p,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[d-1],m,0);if(u>i){a=0;var A=0,b=u-i,p=1<i))break;A+=p-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!D[o[U-1]];--U);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,p)+r,z=B(l,u)+B(c,f)+r+14+3*U+B(K,D)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(d,d+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=Z,j=b,Q=S,H=p;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),D=function(e,o,g,l,c){return function(e,o,g,l,c,C){var d=e.length,I=new t(l+d+5*(1+Math.ceil(d/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||d<8)for(var A=0;A<=d;A+=65535){var b=A+65535;b>>13,w=8191&p,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,D,A-D,u),N=O=E=0,D=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=U-M&32767;if(j>2&&F==R(A-z))for(var _=Math.min(Z,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&U!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(U=M)-(M=V[U])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,C,v,T,X,E,N,D,A-D,u),!C&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function F(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=D(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function U(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var C=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,p=i.m,Z=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(F=G(I)+4)-4]|e[F-3]<<8,X=F+T;if(X>g){r&&v(0);break}l&&C(m+T),n.set(e.subarray(F,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,p=9,Z=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=F;else{var M=0,j=0;for(16==F?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==F?(j=3+y(e,I,7),I+=3):18==F&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);p=f(Q),Z=f(H),u=A(Q,p,1),b=A(H,Z,1)}else v(1);if(I>S){r&&v(0);break}}l&&C(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=d[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&C(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0-canary.11",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const C=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&C&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const d=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&d&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n({code:1006,reason:""})}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise(((t,n)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.soraDataChannels)){const a=this.soraDataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(null!==e.mid&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return""!==this.mids.video&&this.mids.video===e.mid||0<=e.mid.indexOf("video")?e:void 0}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws){e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"));for(const e of this.datachannels)this.callbacks.datachannel($(e))}}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#.*/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=U(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=F((new TextEncoder).encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=F(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get datachannels(){if(!this.signalingSwitched)return[];const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#.*/.exec(e))),t=[];for(const n of e){const e=this.soraDataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class te extends ee{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ne extends ee{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const{operation:t}=e.data;"disconnect"===t&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect()}}clearWorker(){this.worker&&this.worker.postMessage({type:"clear"})}terminateWorker(){this.worker&&this.worker.terminate()}async init(){const{preKeyBundle:e}=await window.e2ee.init();return e}setupSenderTransform(e){if(!e.track)return;const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"encrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}setupReceiverTransform(e){const t=e.createEncodedStreams(),n=t.readableStream||t.readable,i=t.writableStream||t.writable;if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");const s={type:"decrypt",readableStream:n,writableStream:i};this.worker.postMessage(s,[n,i])}postRemoteSecretKeyMaterials(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"remoteSecretKeyMaterials",remoteSecretKeyMaterials:e.remoteSecretKeyMaterials})}postRemoveRemoteDeriveKey(e){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"removeRemoteDeriveKey",connectionId:e})}postSelfSecretKeyMaterial(e,t,n,i=0){if(!this.worker)throw new Error("Worker is null. Call startWorker in advance.");this.worker.postMessage({type:"selfSecretKeyMaterial",selfConnectionId:e,selfKeyId:t,selfSecretKeyMaterial:n,waitingTime:i})}startSession(e,t){const[n,i]=window.e2ee.startSession(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(i)throw i;return n}stopSession(e){const[t,n]=window.e2ee.stopSession(e);if(n)throw n;return t}receiveMessage(e){const[t,n]=window.e2ee.receiveMessage(e);if(n)throw n;return t}start(e){const[t,n]=window.e2ee.start(e);if(n)throw n;return t}addPreKeyBundle(e,t){const n=window.e2ee.addPreKeyBundle(e,t.identityKey,t.signedPreKey,t.preKeySignature);if(n)throw n}selfFingerprint(){return window.e2ee.selfFingerprint()}remoteFingerprints(){return window.e2ee.remoteFingerprints()}static async loadWasm(e){if(void 0===!window.e2ee)return void console.warn("E2ee wasm is already loaded. Will not be reload.");if((()=>{if("undefined"!=typeof global);else if("undefined"!=typeof window)window.global=window;else{if("undefined"==typeof self)throw new Error("cannot export Go (neither global, window nor self is defined)");self.global=self}if(global.require||"undefined"==typeof require||(global.require=require),!global.fs&&global.require){const e=require("fs");0!==Object.keys(e)&&(global.fs=e)}const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,i){t+=n.decode(i);const s=t.lastIndexOf("\n");return-1!=s&&(console.log(t.substr(0,s)),t=t.substr(s+1)),i.length},write(t,n,i,s,a,o){0===i&&s===n.length&&null===a?o(null,this.writeSync(t,n)):o(e())},chmod(t,n,i){i(e())},chown(t,n,i,s){s(e())},close(t,n){n(e())},fchmod(t,n,i){i(e())},fchown(t,n,i,s){s(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,i){i(e())},lchown(t,n,i,s){s(e())},link(t,n,i){i(e())},lstat(t,n){n(e())},mkdir(t,n,i){i(e())},open(t,n,i,s){s(e())},read(t,n,i,s,a,o){o(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,i){i(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,i){i(e())},truncate(t,n,i){i(e())},unlink(t,n){n(e())},utimes(t,n,i,s){s(e())}}}if(global.process||(global.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("util").TextDecoder);const t=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");if(global.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},i=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),s=e=>{const t=this.mem.getFloat64(e,!0);if(0===t)return;if(!isNaN(t))return t;const n=this.mem.getUint32(e,!0);return this._values[n]},a=(e,t)=>{const n=2146959360;if("number"==typeof t&&0!==t)return isNaN(t)?(this.mem.setUint32(e+4,n,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,t,!0);if(void 0===t)return void this.mem.setFloat64(e,0,!0);let i=this._ids.get(t);void 0===i&&(i=this._idPool.pop(),void 0===i&&(i=this._values.length),this._values[i]=t,this._goRefCounts[i]=0,this._ids.set(t,i)),this._goRefCounts[i]++;let s=0;switch(typeof t){case"object":null!==t&&(s=1);break;case"string":s=2;break;case"symbol":s=3;break;case"function":s=4}this.mem.setUint32(e+4,n|s,!0),this.mem.setUint32(e,i,!0)},o=e=>{const t=i(e+0),n=i(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,n)},g=e=>{const t=i(e+0),n=i(e+8),a=new Array(n);for(let e=0;e{const t=i(e+0),s=i(e+8);return n.decode(new DataView(this._inst.exports.mem.buffer,t,s))},c=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{const t=i(e+8),n=i(e+16),s=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,n,s))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{e(t+8,1e6*(c+performance.now()))},"runtime.walltime1":t=>{const n=(new Date).getTime();e(t+8,n/1e3),this.mem.setInt32(t+16,n%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),i(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{crypto.getRandomValues(o(e+8))},"syscall/js.finalizeRef":e=>{const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}},"syscall/js.stringVal":e=>{a(e+24,l(e+8))},"syscall/js.valueGet":e=>{const t=Reflect.get(s(e+8),l(e+16));e=this._inst.exports.getsp(),a(e+32,t)},"syscall/js.valueSet":e=>{Reflect.set(s(e+8),l(e+16),s(e+32))},"syscall/js.valueDelete":e=>{Reflect.deleteProperty(s(e+8),l(e+16))},"syscall/js.valueIndex":e=>{a(e+24,Reflect.get(s(e+8),i(e+16)))},"syscall/js.valueSetIndex":e=>{Reflect.set(s(e+8),i(e+16),s(e+24))},"syscall/js.valueCall":e=>{try{const t=s(e+8),n=Reflect.get(t,l(e+16)),i=g(e+32),o=Reflect.apply(n,t,i);e=this._inst.exports.getsp(),a(e+56,o),this.mem.setUint8(e+64,1)}catch(t){a(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.apply(t,void 0,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{try{const t=s(e+8),n=g(e+16),i=Reflect.construct(t,n);e=this._inst.exports.getsp(),a(e+40,i),this.mem.setUint8(e+48,1)}catch(t){a(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":t=>{e(t+16,parseInt(s(t+8).length))},"syscall/js.valuePrepareString":n=>{const i=t.encode(String(s(n+8)));a(n+16,i),e(n+24,i.length)},"syscall/js.valueLoadString":e=>{const t=s(e+8);o(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":t=>{const n=o(t+8),i=s(t+32);if(!(i instanceof Uint8Array||i instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{const n=s(t+8),i=o(t+16);if(!(n instanceof Uint8Array||n instanceof Uint8ClampedArray))return void this.mem.setUint8(t+48,0);const a=i.subarray(0,n.length);n.set(a),e(t+40,a.length),this.mem.setUint8(t+48,1)},debug:e=>{console.log(e)}}}}async run(e){this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const i=e=>{const i=n,s=t.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,s.length).set(s),n+=s.length,n%8!=0&&(n+=8-n%8),i},s=this.argv.length,a=[];this.argv.forEach((e=>{a.push(i(e))})),a.push(0),Object.keys(this.env).sort().forEach((e=>{a.push(i(`${e}=${this.env[e]}`))})),a.push(0);const o=n;a.forEach((e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8})),this._inst.exports.run(s,o),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}},global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const e=new Go;e.argv=process.argv.slice(2),e.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),e.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),e.importObject).then((t=>(process.on("exit",(t=>{0!==t||e.exited||(e._pendingEvent={id:0},e._resume())})),e.run(t.instance)))).catch((e=>{console.error(e),process.exit(1)}))}})(),!window.Go)throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);const t=new Go,{instance:n}=await WebAssembly.instantiateStreaming(fetch(e),t.importObject);if(t.run(n),!window.e2ee)throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`)}static version(){return"2021.1.0"}static wasmVersion(){return window.e2ee.version()}}var t=Uint8Array,n=Uint16Array,i=Uint32Array,s=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var s=new n(31),a=0;a<31;++a)s[a]=t+=1<>>1|(21845&m)<<1;u=(61680&(u=(52428&u)>>>2|(13107&u)<<2))>>>4|(3855&u)<<4,I[m]=((65280&u)>>>8|(255&u)<<8)>>>1}var A=function(e,t,i){for(var s=e.length,a=0,o=new n(t);a>>c]=r}else for(g=new n(s),a=0;a>>15-e[a]);return g},b=new t(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var p=new t(32);for(m=0;m<32;++m)p[m]=5;var Z=A(b,9,0),w=A(b,9,1),S=A(p,5,0),V=A(p,5,1),f=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},y=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},W=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},G=function(e){return(e+7)/8|0},k=function(e,s,a){(null==s||s<0)&&(s=0),(null==a||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof i?i:t)(a-s);return o.set(e.subarray(s,a)),o},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var i=new Error(t||R[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,v),!n)throw i;return i},T=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},X=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},O=function(e,i){for(var s=[],a=0;aI&&(I=g[a].s);var m=new n(I+1),u=E(s[d-1],m,0);if(u>i){a=0;var A=0,b=u-i,p=1<i))break;A+=p-(1<>>=b;A>0;){var w=g[a].s;m[w]=0&&A;--a){var S=g[a].s;m[S]==i&&(--m[S],++A)}u=i}return[new t(m),u]},E=function(e,t,n){return-1==e.s?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},N=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new n(++t),s=0,a=e[0],o=1,g=function(e){i[s++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)g(32754);o>2&&(g(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(g(a),--o;o>6;o-=6)g(8304);o>2&&(g(o-3<<5|8208),o=0)}for(;o--;)g(a);o=1,a=e[l]}return[i.subarray(0,s),t]},B=function(e,t){for(var n=0,i=0;i>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a4&&!D[o[U-1]];--U);var M,j,Q,H,x=h+5<<3,P=B(l,b)+B(c,p)+r,z=B(l,u)+B(c,f)+r+14+3*U+B(K,D)+(2*K[16]+3*K[17]+7*K[18]);if(x<=P&&x<=z)return Y(t,I,e.subarray(d,d+h));if(T(t,I,1+(z15&&(T(t,I,ee[L]>>>5&127),I+=ee[L]>>>12)}}}else M=Z,j=b,Q=S,H=p;for(L=0;L255){te=g[L]>>>18&31;X(t,I,M[te+257]),I+=j[te+257],te>7&&(T(t,I,g[L]>>>23&31),I+=s[te]);var ne=31&g[L];X(t,I,Q[ne]),I+=H[ne],ne>3&&(X(t,I,g[L]>>>5&8191),I+=a[ne])}else X(t,I,M[g[L]]),I+=j[g[L]];return X(t,I,M[256]),I+j[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),J=new t(0),D=function(e,o,g,l,c){return function(e,o,g,l,c,C){var d=e.length,I=new t(l+d+5*(1+Math.ceil(d/7e3))+c),m=I.subarray(l,I.length-c),u=0;if(!o||d<8)for(var A=0;A<=d;A+=65535){var b=A+65535;b>>13,w=8191&p,S=(1<7e3||N>24576)&&j>423){u=K(e,m,0,v,T,X,E,N,D,A-D,u),N=O=E=0,D=A;for(var Q=0;Q<286;++Q)T[Q]=0;for(Q=0;Q<30;++Q)X[Q]=0}var H=2,x=0,P=w,z=U-M&32767;if(j>2&&F==R(A-z))for(var _=Math.min(Z,j)-1,q=Math.min(32767,A),$=Math.min(258,j);z<=q&&--P&&U!=M;){if(e[A+H]==e[A+H-z]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-z];++ee);if(ee>H){if(H=ee,x=z,ee>_)break;var te=Math.min(z,ee-2),ne=0;for(Q=0;Qne&&(ne=se,M=ie)}}}z+=(U=M)-(M=V[U])+32768&32767}if(x){v[N++]=268435456|r[H]<<18|h[x];var ae=31&r[H],oe=31&h[x];E+=s[ae]+a[oe],++T[257+ae],++X[oe],B=A+H,++O}else v[N++]=e[A],++T[e[A]]}}u=K(e,m,C,v,T,X,E,N,D,A-D,u),!C&&7&u&&(u=Y(m,u+1,J))}return k(I,0,l+G(u)+c)}(e,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,g,l,!c)};function F(e,t){t||(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,a=0|n.length,o=0;o!=a;){for(var g=Math.min(o+2655,a);o>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}}();n.p(e);var i=D(e,t,2,4);return function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)}(i,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(i,i.length-4,n.d()),i}function U(e,n){return function(e,n,i){var g=e.length;if(!g||i&&i.f&&!i.l)return n||new t(0);var l=!n||i,r=!i||i.i;i||(i={}),n||(n=new t(3*g));var C=function(e){var i=n.length;if(e>i){var s=new t(Math.max(2*i,e));s.set(n),n=s}},h=i.f||0,I=i.p||0,m=i.b||0,u=i.l,b=i.d,p=i.m,Z=i.n,S=8*g;do{if(!u){h=y(e,I,1);var R=y(e,I+1,3);if(I+=3,!R){var T=e[(F=G(I)+4)-4]|e[F-3]<<8,X=F+T;if(X>g){r&&v(0);break}l&&C(m+T),n.set(e.subarray(F,X),m),i.b=m+=T,i.p=I=8*X,i.f=h;continue}if(1==R)u=w,b=V,p=9,Z=5;else if(2==R){var O=y(e,I,31)+257,E=y(e,I+10,15)+4,N=O+y(e,I+5,31)+1;I+=14;for(var B=new t(N),Y=new t(19),K=0;K>>4)<16)B[K++]=F;else{var M=0,j=0;for(16==F?(j=3+y(e,I,3),I+=2,M=B[K-1]):17==F?(j=3+y(e,I,7),I+=3):18==F&&(j=11+y(e,I,127),I+=7);j--;)B[K++]=M}}var Q=B.subarray(0,O),H=B.subarray(O);p=f(Q),Z=f(H),u=A(Q,p,1),b=A(H,Z,1)}else v(1);if(I>S){r&&v(0);break}}l&&C(m+131072);for(var x=(1<>>4;if((I+=15&M)>S){r&&v(0);break}if(M||v(2),_<256)n[m++]=_;else{if(256==_){z=I,u=null;break}var q=_-254;if(_>264){var $=s[K=_-257];q=y(e,I,(1<<$)-1)+c[K],I+=$}var ee=b[W(e,I)&P],te=ee>>>4;if(ee||v(3),I+=15&ee,H=d[te],te>3&&($=a[te],H+=W(e,I)&(1<<$)-1,I+=$),I>S){r&&v(0);break}l&&C(m+131072);for(var ne=m+q;m>>4>7||(i[0]<<8|i[1])%31)&&v(6,"invalid zlib data"),32&i[1]&&v(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),n);var i}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(J,{stream:!0}),1}catch(e){}function j(e){if("object"!=typeof e||null===e)throw new Error("Failed to parse options dataChannels. Options dataChannels element must be type 'object'");const t=e,n={};return"string"==typeof t.label&&(n.label=t.label),"string"==typeof t.direction&&(n.direction=t.direction),"boolean"==typeof t.ordered&&(n.ordered=t.ordered),"boolean"==typeof t.compress&&(n.compress=t.compress),"number"==typeof t.maxPacketLifeTime&&(n.max_packet_life_time=t.maxPacketLifeTime),"number"==typeof t.maxRetransmits&&(n.max_retransmits=t.maxRetransmits),"string"==typeof t.protocol&&(n.protocol=t.protocol),n}function Q(){return"safari"===function(){const e=window.navigator.userAgent.toLocaleLowerCase();return-1!==e.indexOf("edge")?"edge":-1!==e.indexOf("chrome")&&-1===e.indexOf("edge")?"chrome":-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")?"safari":-1!==e.indexOf("opera")?"opera":-1!==e.indexOf("firefox")?"firefox":null}()}function H(e,t,n,i,s,a){if("sendrecv"!==t&&"sendonly"!==t&&"recvonly"!==t)throw new Error("Unknown role type");if(null==n)throw new Error("channelId can not be null or undefined");const o={type:"connect",sora_client:"Sora JavaScript SDK 2021.2.0",environment:window.navigator.userAgent,role:t,channel_id:n,sdp:e,audio:!0,video:!0};if(void 0!==i&&(o.metadata=i),a&&(o.redirect=!0),"signalingNotifyMetadata"in s&&(o.signaling_notify_metadata=s.signalingNotifyMetadata),"multistream"in s&&!0===s.multistream&&(o.multistream=!0,"spotlight"in s&&(o.spotlight=s.spotlight,"spotlightNumber"in s&&(o.spotlight_number=s.spotlightNumber)),!0===o.spotlight)){const e=["none","r0","r1","r2"];void 0!==s.spotlightFocusRid&&0<=e.indexOf(s.spotlightFocusRid)&&(o.spotlight_focus_rid=s.spotlightFocusRid),void 0!==s.spotlightUnfocusRid&&0<=e.indexOf(s.spotlightUnfocusRid)&&(o.spotlight_unfocus_rid=s.spotlightUnfocusRid)}if("simulcast"in s||"simulcastRid"in s){"simulcast"in s&&!0===s.simulcast&&(o.simulcast=!0);const e=["r0","r1","r2"];void 0!==s.simulcastRid&&0<=e.indexOf(s.simulcastRid)&&(o.simulcast_rid=s.simulcastRid)}"clientId"in s&&void 0!==s.clientId&&(o.client_id=s.clientId),"dataChannelSignaling"in s&&"boolean"==typeof s.dataChannelSignaling&&(o.data_channel_signaling=s.dataChannelSignaling),"ignoreDisconnectWebSocket"in s&&"boolean"==typeof s.ignoreDisconnectWebSocket&&(o.ignore_disconnect_websocket=s.ignoreDisconnectWebSocket);const g=["audioCodecType","audioBitRate"],l=["audioOpusParamsChannels","audioOpusParamsClockRate","audioOpusParamsMaxplaybackrate","audioOpusParamsStereo","audioOpusParamsSpropStereo","audioOpusParamsMinptime","audioOpusParamsPtime","audioOpusParamsUseinbandfec","audioOpusParamsUsedtx"],c=["videoCodecType","videoBitRate"],r=Object.assign({},s);Object.keys(r).forEach((e=>{"audio"===e&&"boolean"==typeof r[e]||"video"===e&&"boolean"==typeof r[e]||0<=g.indexOf(e)&&null!==r[e]||0<=l.indexOf(e)&&null!==r[e]||0<=c.indexOf(e)&&null!==r[e]||delete r[e]})),void 0!==r.audio&&(o.audio=r.audio);const C=Object.keys(r).some((e=>0<=g.indexOf(e)));o.audio&&C&&(o.audio={},"audioCodecType"in r&&(o.audio.codec_type=r.audioCodecType),"audioBitRate"in r&&(o.audio.bit_rate=r.audioBitRate));const d=Object.keys(r).some((e=>0<=l.indexOf(e)));o.audio&&d&&("object"!=typeof o.audio&&(o.audio={}),o.audio.opus_params={},"audioOpusParamsChannels"in r&&(o.audio.opus_params.channels=r.audioOpusParamsChannels),"audioOpusParamsClockRate"in r&&(o.audio.opus_params.clock_rate=r.audioOpusParamsClockRate),"audioOpusParamsMaxplaybackrate"in r&&(o.audio.opus_params.maxplaybackrate=r.audioOpusParamsMaxplaybackrate),"audioOpusParamsStereo"in r&&(o.audio.opus_params.stereo=r.audioOpusParamsStereo),"audioOpusParamsSpropStereo"in r&&(o.audio.opus_params.sprop_stereo=r.audioOpusParamsSpropStereo),"audioOpusParamsMinptime"in r&&(o.audio.opus_params.minptime=r.audioOpusParamsMinptime),"audioOpusParamsPtime"in r&&(o.audio.opus_params.ptime=r.audioOpusParamsPtime),"audioOpusParamsUseinbandfec"in r&&(o.audio.opus_params.useinbandfec=r.audioOpusParamsUseinbandfec),"audioOpusParamsUsedtx"in r&&(o.audio.opus_params.usedtx=r.audioOpusParamsUsedtx)),void 0!==r.video&&(o.video=r.video);const h=Object.keys(r).some((e=>0<=c.indexOf(e)));if(o.video&&h&&(o.video={},"videoCodecType"in r&&(o.video.codec_type=r.videoCodecType),"videoBitRate"in r&&(o.video.bit_rate=r.videoBitRate)),o.simulcast&&!function(){if(!window.RTCRtpSender)return!1;if(!RTCRtpSender.getCapabilities)return!1;const e=RTCRtpSender.getCapabilities("video");if(!e)return!1;const t=e.headerExtensions.map((e=>e.uri));return["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"].every((e=>t.includes(e)))}()&&"recvonly"!==t)throw new Error("Simulcast can not be used with this browser");if(!0===s.e2ee){if(void 0===o.signaling_notify_metadata&&(o.signaling_notify_metadata={}),null===o.signaling_notify_metadata||"object"!=typeof o.signaling_notify_metadata)throw new Error("E2EE failed. Options signalingNotifyMetadata must be type 'object'");!0===o.video&&(o.video={}),o.video&&(o.video.codec_type="VP8"),o.e2ee=!0}return Array.isArray(s.dataChannels)&&0{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{},message:()=>{},datachannel:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={}}on(e,t){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"===e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=t)}stopAudioTrack(e){for(const t of e.getAudioTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getAudioTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}stopVideoTrack(e){for(const t of e.getVideoTracks())t.enabled=!1;return new Promise((t=>{setTimeout((async()=>{for(const t of e.getVideoTracks())if(t.stop(),e.removeTrack(t),null!==this.pc){const e=this.pc.getSenders().find((e=>e.track&&e.track.id===t.id));e&&await e.replaceTrack(null)}t()}),100)}))}async replaceAudioTrack(e,t){await this.stopAudioTrack(e);const n=this.getAudioTransceiver();if(null===n)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}async replaceVideoTrack(e,t){await this.stopVideoTrack(e);const n=this.getVideoTransceiver();if(null===n)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(t),await n.sender.replaceTrack(t)}stopStream(){return new Promise(((e,t)=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),this.stream?(this.stream.getTracks().forEach((e=>{e.stop()})),this.stream=null,e()):e())))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&t.close(),delete this.soraDataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const t=this.soraCloseEvent("abend",e);this.callbacks.disconnect(t),this.writeSoraTimelineLog("disconnect-abend",t)}async abend(e,t){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)},t.onmessage=null,t.onerror=null)}if(this.soraDataChannels.signaling){const t={type:"disconnect",reason:e};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(t)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,t)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&t&&(1e3===t.code||1005===t.code)){const e=this.soraCloseEvent("normal","DISCONNECT",t);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const n=this.soraCloseEvent("abend",e,t);this.writeSoraTimelineLog("disconnect-abend",n),this.callbacks.disconnect(this.soraCloseEvent("abend",e,t))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.soraDataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.signalingOfferMessageDataChannels={},this.clearConnectionTimeout()}disconnectWebSocket(e){let t=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(((n,i)=>{if(!this.ws)return n(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(t),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),n({code:e.code,reason:e.reason})),1!==this.ws.readyState)return this.ws.close(),this.ws=null,n(null);{const i={type:"disconnect",reason:e};this.ws.send(JSON.stringify(i)),this.writeWebSocketSignalingLog("send-disconnect",i),t=setTimeout((()=>{this.ws&&(this.ws.close(),this.ws=null),n({code:1006,reason:""})}),this.disconnectWaitTimeout)}}))}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onerror=null,t.close()),delete this.soraDataChannels[e]}};return new Promise(((t,n)=>{if(!this.soraDataChannels.signaling)return e(),t({code:4999,reason:""});const i=setTimeout((()=>(e(),n())),this.disconnectWaitTimeout),s=[];for(const n of Object.keys(this.soraDataChannels)){const a=this.soraDataChannels[n];if(a){a.onerror=()=>(clearTimeout(i),e(),t({code:4999,reason:""}));const n=()=>new Promise(((e,t)=>{let n=0;const i=setInterval((()=>{n++,"closed"===a.readyState&&(clearInterval(i),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(i))}),100)}));s.push(n())}}Promise.all(s).then((()=>{0===Object.keys(this.soraDataChannels).length?t(null):t({code:4999,reason:""})})).finally((()=>{e(),clearTimeout(i)}));const a={type:"disconnect",reason:"NO-ERROR"};if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const e=F((new TextEncoder).encode(JSON.stringify(a)),{});if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(e),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}else if("open"===this.soraDataChannels.signaling.readyState)try{this.soraDataChannels.signaling.send(JSON.stringify(a)),this.writeDataChannelSignalingLog("send-disconnect",this.soraDataChannels.signaling,a)}catch(e){const t=e.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.soraDataChannels.signaling,t)}}))}disconnectPeerConnection(){return new Promise(((e,t)=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e())))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.soraDataChannels)){const t=this.soraDataChannels[e];t&&(t.onmessage=null,t.onclose=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label)})}let e=null;if(this.signalingSwitched){try{const t=await this.disconnectDataChannel();null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}catch(t){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const t=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==t&&(e=this.soraCloseEvent("normal","DISCONNECT",t))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new e,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message="E2EE failed. Self connectionId is null",e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){const t=e;return new Promise(((e,n)=>{const i=new WebSocket(t);i.onclose=e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),n(t)},i.onopen=t=>{e(i)}}))}if(Array.isArray(e)){let t=!1;const n=e=>new Promise(((n,i)=>{const s=new WebSocket(e),a=setTimeout((()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:s.url}),s&&!t&&(s.onclose=null,s.onerror=null,s.onopen=null,s.close(),i())}),this.signalingCandidateTimeout);s.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:s.url,message:"WebSocket closed",code:e.code,reason:e.reason}),s&&s.close(),clearInterval(a),i()},s.onerror=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:s.url,message:"Failed to connect WebSocket"}),s&&(s.onclose=null,s.close()),clearInterval(a),i()},s.onopen=e=>{s&&(clearInterval(a),t?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!1}),s.onerror=null,s.onclose=null,s.onopen=null,s.close(),i()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:s.url,selected:!0}),s.onerror=null,s.onclose=null,s.onopen=null,t=!0,n(s)))}}));try{return await Promise.any(e.map((e=>n(e))))}catch(e){throw new z("Signaling failed. All signaling URL candidates failed to connect")}}throw new z("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,t=!1){const n=await this.createOffer();return this.trace("CREATE OFFER",n),new Promise(((i,s)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const t=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);t.code=e.code,t.reason=e.reason,this.writeWebSocketTimelineLog("onclose",t),await this.signalingTerminate(),s(t)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const t=JSON.parse(e.data);if("offer"==t.type)this.writeWebSocketSignalingLog("onmessage-offer",t),this.signalingOnMessageTypeOffer(t),i(t);else if("update"==t.type)this.writeWebSocketSignalingLog("onmessage-update",t),await this.signalingOnMessageTypeUpdate(t);else if("re-offer"==t.type)this.writeWebSocketSignalingLog("onmessage-re-offer",t),await this.signalingOnMessageTypeReOffer(t);else if("ping"==t.type)await this.signalingOnMessageTypePing(t);else if("push"==t.type)this.callbacks.push(t,"websocket");else if("notify"==t.type)"connection.created"===t.event_type?this.writeWebSocketTimelineLog("notify-connection.created",t):"connection.destroyed"===t.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",t),this.signalingOnMessageTypeNotify(t,"websocket");else if("switched"==t.type)this.writeWebSocketSignalingLog("onmessage-switched",t),this.signalingOnMessageTypeSwitched(t);else if("redirect"==t.type){this.writeWebSocketSignalingLog("onmessage-redirect",t);const e=await this.signalingOnMessageTypeRedirect(t);i(e)}},(async()=>{let i;try{i=H(n.sdp||"",this.role,this.channelId,this.metadata,this.options,t)}catch(e){return void s(e)}if(i.e2ee&&this.e2ee){const e=await this.e2ee.init();i.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",i),e&&(e.send(JSON.stringify(i)),this.writeWebSocketSignalingLog(`send-${i.type}`,i),this.ws=e)})()}))}async connectPeerConnection(e){let t=Object.assign({},e.config);if(this.e2ee&&(t=Object.assign({encodedInsertableStreams:!0},t)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});t=Object.assign({certificates:[e]},t)}this.trace("PEER CONNECTION CONFIG",t),this.writePeerConnectionTimelineLog("new-peerconnection",t),this.pc=new window.RTCPeerConnection(t,this.constraints),this.pc.oniceconnectionstatechange=e=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=e=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.ondatachannel=e=>{this.onDataChannel(e)}}async setRemoteDescription(e){if(!this.pc)return;const t=new RTCSessionDescription({type:"offer",sdp:e.sdp});await this.pc.setRemoteDescription(t),this.writePeerConnectionTimelineLog("set-remote-description",t)}async createAnswer(e){if(!this.pc)return;for(const e of Object.values(this.mids)){const t=this.pc.getTransceivers().find((t=>t.mid===e));t&&"recvonly"===t.direction&&(t.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const t=this.pc.getTransceivers().find((e=>{if(null!==e.mid&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return""!==this.mids.video&&this.mids.video===e.mid||0<=e.mid.indexOf("video")?e:void 0}));if(t){await this.setSenderParameters(t,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters()),await this.setSenderParameters(t,this.encodings);const n=await this.pc.createAnswer();return await this.pc.setLocalDescription(n),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",t.sender.getParameters())}}const t=await this.pc.createAnswer();this.writePeerConnectionTimelineLog("create-answer",t),await this.pc.setLocalDescription(t),this.writePeerConnectionTimelineLog("set-local-description",t)}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(((e,t)=>{this.pc&&(this.pc.oniceconnectionstatechange=t=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=t=>{if(this.writePeerConnectionTimelineLog("onicecandidate",t.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===t.candidate)e();else{const e=t.candidate.toJSON(),n=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",n),this.sendSignalingMessage(n)}})}))}waitChangeConnectionStateConnected(){return new Promise(((e,t)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const n=setInterval((()=>{if(this.pc)this.pc&&"connected"===this.pc.connectionState&&(clearInterval(n),e());else{const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(n),t(e)}}),10)}))}monitorSignalingWebSocketEvent(){return new Promise(((e,t)=>{this.monitorSignalingWebSocketEventTimerId=setInterval((()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const n=new z(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},this.ws.onerror=async e=>{const n=new z("Signaling failed. WebSocket onerror was called");this.writeWebSocketSignalingLog("onerror",n),await this.signalingTerminate(),t(n)})}),100)}))}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async e=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async e=>{this.pc&&void 0===this.pc.connectionState&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout((async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT")}),1e4)))},this.pc.onconnectionstatechange=async e=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&await this.abendPeerConnectionState("CONNECTION-STATE-FAILED"))})}setConnectionTimeout(){return new Promise(((e,t)=>{0{if(!this.pc||this.pc&&void 0!==this.pc.connectionState&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),t(e)}}),this.connectionTimeout))}))}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,t){this.callbacks.log(e,t),this.debug&&function(e,t,n){const i=e=>{if(e&&"object"==typeof e){let t=null;try{t=Object.keys(JSON.parse(JSON.stringify(e)))}catch(e){}t&&Array.isArray(t)?t.forEach((t=>{console.group(t),i(e[t]),console.groupEnd()})):console.info(e)}else console.info(e)};let s="";window.performance&&(s="["+(window.performance.now()/1e3).toFixed(3)+"]"),e&&(s=s+"["+e+"]"),void 0!==console.info&&void 0!==console.group?(console.group(s+" "+t),i(n),console.groupEnd()):console.log(s+" "+t+"\n",n)}(this.clientId,e,t)}writeWebSocketSignalingLog(e,t){this.callbacks.signaling(_(e,t,"websocket")),this.writeWebSocketTimelineLog(e,t)}writeDataChannelSignalingLog(e,t,n){this.callbacks.signaling(_(e,n,"datachannel")),this.writeDataChannelTimelineLog(e,t,n)}writeWebSocketTimelineLog(e,t){const n=q(e,t,"websocket");this.callbacks.timeline(n)}writeDataChannelTimelineLog(e,t,n){const i=q(e,n,"datachannel",t.id,t.label);this.callbacks.timeline(i)}writePeerConnectionTimelineLog(e,t){const n=q(e,t,"peerconnection");this.callbacks.timeline(n)}writeSoraTimelineLog(e,t){const n=q(e,t,"sora");this.callbacks.timeline(n)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(Q()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const t=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}const t=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",t),t}signalingOnMessageE2EE(e){if(this.e2ee){const t=new Uint8Array(e),n=this.e2ee.receiveMessage(t);this.e2ee.postRemoteSecretKeyMaterials(n),n.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)}))}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const t of e.data_channels)this.signalingOfferMessageDataChannels[t.label]=t;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendSignalingMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const t={type:"pong"};if(e.stats){const e=await this.getStats();t.stats=e}this.ws&&this.ws.send(JSON.stringify(t))}signalingOnMessageTypeNotify(e,t){if("connection.created"===e.event_type){const t=e.connection_id;if(this.connectionId!==t){const n=P(x(e));if(n&&this.e2ee&&t){const e=this.e2ee.startSession(t,n);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const n=function(e){return e.data&&Array.isArray(e.data)?e.data:e.metadata_list&&Array.isArray(e.metadata_list)?e.metadata_list:[]}(e);n.forEach((e=>{const t=P(x(e)),n=e.connection_id;n&&this.e2ee&&t&&this.e2ee.addPreKeyBundle(n,t)}))}else if("connection.destroyed"===e.event_type){const t=P(x(e)),n=e.connection_id;if(t&&this.e2ee&&n){const e=this.e2ee.stopSession(n);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach((e=>{this.sendE2EEMessage(e.buffer)})),this.e2ee.postRemoveRemoteDeriveKey(n)}}this.callbacks.notify(e,t)}signalingOnMessageTypeSwitched(e){if(this.signalingSwitched=!0,this.ws){e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"));for(const e of this.datachannels)this.callbacks.datachannel($(e))}}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const t=await this.getSignalingWebSocket(e.location);return await this.signaling(t,!0)}async setSenderParameters(e,t){const n=e.sender.getParameters();n.encodings=t,await e.sender.setParameters(n),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",n),this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",n)}async getStats(){const e=[];if(!this.pc)return e;return(await this.pc.getStats()).forEach((t=>{e.push(t)})),e}onDataChannel(e){const t=e.channel;var n;this.writeDataChannelTimelineLog("ondatachannel",t,{binaryType:(n=t).binaryType,bufferedAmount:n.bufferedAmount,bufferedAmountLowThreshold:n.bufferedAmountLowThreshold,id:n.id,label:n.label,maxPacketLifeTime:n.maxPacketLifeTime,maxRetransmits:n.maxRetransmits,negotiated:n.negotiated,ordered:n.ordered,protocol:n.protocol,readyState:n.readyState,reliable:n.reliable}),e.channel.onbufferedamountlow=e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",t)},e.channel.onopen=e=>{const t=e.currentTarget;t.bufferedAmountLowThreshold=65536,t.binaryType="arraybuffer",this.soraDataChannels[t.label]=t,this.trace("OPEN DATA CHANNEL",t.label),"signaling"===t.label&&this.ws?this.writeDataChannelSignalingLog("onopen",t):this.writeDataChannelTimelineLog("onopen",t)},e.channel.onclose=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onclose",t),this.trace("CLOSE DATA CHANNEL",t.label),await this.disconnect()},e.channel.onerror=async e=>{const t=e.currentTarget;this.writeDataChannelTimelineLog("onerror",t),this.trace("ERROR DATA CHANNEL",t.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:t.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);this.writeDataChannelSignalingLog(`onmessage-${i.type}`,t,i),"re-offer"===i.type&&await this.signalingOnMessageTypeReOffer(i)}:"notify"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget;let n=e.data;if(this.signalingOfferMessageDataChannels.notify&&!0===this.signalingOfferMessageDataChannels.notify.compress){const t=U(new Uint8Array(e.data));n=(new TextDecoder).decode(t)}const i=JSON.parse(n);"connection.created"===i.event_type?this.writeDataChannelTimelineLog("notify-connection.created",t,i):"connection.destroyed"===i.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",t,i),this.signalingOnMessageTypeNotify(i,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.push&&!0===this.signalingOfferMessageDataChannels.push.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}const n=JSON.parse(t);this.callbacks.push(n,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const t=e.currentTarget,n=e.data;this.signalingOnMessageE2EE(n),this.writeDataChannelSignalingLog("onmessage-e2ee",t,n)}:"stats"===e.channel.label?e.channel.onmessage=async e=>{let t=e.data;if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const n=U(new Uint8Array(e.data));t=(new TextDecoder).decode(n)}if("req-stats"===JSON.parse(t).type){const e=await this.getStats();this.sendStatsMessage(e)}}:/^#.*/.exec(e.channel.label)&&(e.channel.onmessage=e=>{if(null===e.target)return;const t=e.target;let n=e.data;const i=this.signalingOfferMessageDataChannels[t.label];void 0!==i&&!0===i.compress&&(n=U(new Uint8Array(e.data)).buffer),this.callbacks.message(function(e,t){const n=new Event("message");return n.label=e,n.data=t,n}(t.label,n))})}sendSignalingMessage(e){if(this.soraDataChannels.signaling){if(this.signalingOfferMessageDataChannels.signaling&&!0===this.signalingOfferMessageDataChannels.signaling.compress){const t=F((new TextEncoder).encode(JSON.stringify(e)),{});this.soraDataChannels.signaling.send(t)}else this.soraDataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.soraDataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.soraDataChannels.e2ee?(this.soraDataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.soraDataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.soraDataChannels.stats){const t={type:"stats",reports:e};if(this.signalingOfferMessageDataChannels.stats&&!0===this.signalingOfferMessageDataChannels.stats.compress){const e=F((new TextEncoder).encode(JSON.stringify(t)),{});this.soraDataChannels.stats.send(e)}else this.soraDataChannels.stats.send(JSON.stringify(t))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){return this.pc.getTransceivers().find((e=>e.mid===this.mids.audio))||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){return this.pc.getTransceivers().find((e=>e.mid===this.mids.video))||null}return null}soraCloseEvent(e,t,n){const i=class extends Event{constructor(e,t,n){super(e),n&&(n.code&&(this.code=n.code),n.reason&&(this.reason=n.reason),n.params&&(this.params=n.params)),this.title=t}};return new i(e,t,n)}sendMessage(e,t){const n=this.soraDataChannels[e];if(null===this.pc)return;if(void 0===n)throw new Error("Could not find DataChannel");const i=this.signalingOfferMessageDataChannels[e];if(void 0!==i&&!0===i.compress){const e=F(t,{});n.send(e)}else n.send(t)}get e2eeSelfFingerprint(){if(this.options.e2ee&&this.e2ee)return this.e2ee.selfFingerprint()}get e2eeRemoteFingerprints(){if(this.options.e2ee&&this.e2ee)return this.e2ee.remoteFingerprints()}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}get datachannels(){if(!this.signalingSwitched)return[];const e=Object.keys(this.signalingOfferMessageDataChannels).filter((e=>/^#.*/.exec(e))),t=[];for(const n of e){const e=this.soraDataChannels[n];if(!e)continue;const i=this.signalingOfferMessageDataChannels[n];if(!i)continue;const s={label:e.label,ordered:e.ordered,protocol:e.protocol,compress:i.compress,direction:i.direction};"number"==typeof e.maxPacketLifeTime&&(s.maxPacketLifeTime=e.maxPacketLifeTime),"number"==typeof e.maxRetransmits&&(s.maxRetransmits=e.maxRetransmits),t.push(s)}return t}}class te extends ee{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),await this.setRemoteDescription(n),e.getTracks().forEach((t=>{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const t=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(t);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{const t=e.streams[0];if(!t)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),"default"!==t.id&&t.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(t,e)})),this.stream=e,await this.createAnswer(n),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach((e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)})),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class ne extends ee{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();{const e=await Promise.race([this.singleStream().finally((()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()})),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),t=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(t),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const t=this.stream.id;if("default"===t)return;const n={"stream.id":t,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1{const t=e.streams[0];if("default"===t.id)return;if(t.id===this.connectionId)return;const n={"stream.id":t.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",n),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),t.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const t=this.remoteConnectionIds.indexOf(e.target.id);-1