@basemaps/lambda-tiler 6.40.0 → 6.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/build/__tests__/index.test.js +17 -5
- package/build/__tests__/index.test.js.map +1 -1
- package/build/__tests__/wmts.capability.test.js +98 -65
- package/build/__tests__/wmts.capability.test.js.map +1 -1
- package/build/cli/render.tile.js +28 -10
- package/build/cli/render.tile.js.map +1 -1
- package/build/routes/__tests__/attribution.test.js +2 -2
- package/build/routes/__tests__/attribution.test.js.map +1 -1
- package/build/routes/attribution.d.ts +1 -2
- package/build/routes/attribution.d.ts.map +1 -1
- package/build/routes/attribution.js +13 -13
- package/build/routes/attribution.js.map +1 -1
- package/build/routes/tile.wmts.d.ts.map +1 -1
- package/build/routes/tile.wmts.js +11 -8
- package/build/routes/tile.wmts.js.map +1 -1
- package/build/routes/tile.xyz.raster.d.ts.map +1 -1
- package/build/routes/tile.xyz.raster.js +0 -2
- package/build/routes/tile.xyz.raster.js.map +1 -1
- package/build/routes/version.d.ts.map +1 -1
- package/build/routes/version.js +17 -1
- package/build/routes/version.js.map +1 -1
- package/build/util/validate.d.ts.map +1 -1
- package/build/util/validate.js +4 -3
- package/build/util/validate.js.map +1 -1
- package/build/wmts.capability.d.ts +58 -28
- package/build/wmts.capability.d.ts.map +1 -1
- package/build/wmts.capability.js +167 -93
- package/build/wmts.capability.js.map +1 -1
- package/package.json +9 -10
- package/src/__tests__/index.test.ts +20 -5
- package/src/__tests__/wmts.capability.test.ts +110 -65
- package/src/cli/render.tile.ts +29 -10
- package/src/routes/__tests__/attribution.test.ts +2 -2
- package/src/routes/attribution.ts +13 -11
- package/src/routes/tile.wmts.ts +12 -7
- package/src/routes/tile.xyz.raster.ts +0 -1
- package/src/routes/version.ts +17 -1
- package/src/util/validate.ts +4 -3
- package/src/wmts.capability.ts +209 -121
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +0 -201
- package/dist/node_modules/.package-lock.json +0 -491
- package/dist/node_modules/base64-js/LICENSE +0 -21
- package/dist/node_modules/base64-js/README.md +0 -34
- package/dist/node_modules/base64-js/base64js.min.js +0 -1
- package/dist/node_modules/base64-js/index.d.ts +0 -3
- package/dist/node_modules/base64-js/index.js +0 -150
- package/dist/node_modules/base64-js/package.json +0 -47
- package/dist/node_modules/bl/.travis.yml +0 -17
- package/dist/node_modules/bl/BufferList.js +0 -396
- package/dist/node_modules/bl/LICENSE.md +0 -13
- package/dist/node_modules/bl/README.md +0 -247
- package/dist/node_modules/bl/bl.js +0 -84
- package/dist/node_modules/bl/package.json +0 -37
- package/dist/node_modules/bl/test/convert.js +0 -21
- package/dist/node_modules/bl/test/indexOf.js +0 -492
- package/dist/node_modules/bl/test/isBufferList.js +0 -32
- package/dist/node_modules/bl/test/test.js +0 -869
- package/dist/node_modules/buffer/AUTHORS.md +0 -70
- package/dist/node_modules/buffer/LICENSE +0 -21
- package/dist/node_modules/buffer/README.md +0 -410
- package/dist/node_modules/buffer/index.d.ts +0 -186
- package/dist/node_modules/buffer/index.js +0 -1817
- package/dist/node_modules/buffer/package.json +0 -96
- package/dist/node_modules/chownr/LICENSE +0 -15
- package/dist/node_modules/chownr/README.md +0 -3
- package/dist/node_modules/chownr/chownr.js +0 -167
- package/dist/node_modules/chownr/package.json +0 -29
- package/dist/node_modules/color/LICENSE +0 -21
- package/dist/node_modules/color/README.md +0 -123
- package/dist/node_modules/color/index.js +0 -496
- package/dist/node_modules/color/package.json +0 -47
- package/dist/node_modules/color-convert/CHANGELOG.md +0 -54
- package/dist/node_modules/color-convert/LICENSE +0 -21
- package/dist/node_modules/color-convert/README.md +0 -68
- package/dist/node_modules/color-convert/conversions.js +0 -839
- package/dist/node_modules/color-convert/index.js +0 -81
- package/dist/node_modules/color-convert/package.json +0 -48
- package/dist/node_modules/color-convert/route.js +0 -97
- package/dist/node_modules/color-name/LICENSE +0 -8
- package/dist/node_modules/color-name/README.md +0 -11
- package/dist/node_modules/color-name/index.js +0 -152
- package/dist/node_modules/color-name/package.json +0 -28
- package/dist/node_modules/color-string/LICENSE +0 -21
- package/dist/node_modules/color-string/README.md +0 -62
- package/dist/node_modules/color-string/index.js +0 -242
- package/dist/node_modules/color-string/package.json +0 -39
- package/dist/node_modules/decompress-response/index.d.ts +0 -22
- package/dist/node_modules/decompress-response/index.js +0 -58
- package/dist/node_modules/decompress-response/license +0 -9
- package/dist/node_modules/decompress-response/package.json +0 -56
- package/dist/node_modules/decompress-response/readme.md +0 -48
- package/dist/node_modules/deep-extend/CHANGELOG.md +0 -46
- package/dist/node_modules/deep-extend/LICENSE +0 -20
- package/dist/node_modules/deep-extend/README.md +0 -91
- package/dist/node_modules/deep-extend/index.js +0 -1
- package/dist/node_modules/deep-extend/lib/deep-extend.js +0 -150
- package/dist/node_modules/deep-extend/package.json +0 -62
- package/dist/node_modules/detect-libc/LICENSE +0 -201
- package/dist/node_modules/detect-libc/README.md +0 -160
- package/dist/node_modules/detect-libc/index.d.ts +0 -11
- package/dist/node_modules/detect-libc/lib/detect-libc.js +0 -178
- package/dist/node_modules/detect-libc/lib/process.js +0 -16
- package/dist/node_modules/detect-libc/package.json +0 -36
- package/dist/node_modules/end-of-stream/LICENSE +0 -21
- package/dist/node_modules/end-of-stream/README.md +0 -54
- package/dist/node_modules/end-of-stream/index.js +0 -94
- package/dist/node_modules/end-of-stream/package.json +0 -37
- package/dist/node_modules/expand-template/.travis.yml +0 -6
- package/dist/node_modules/expand-template/LICENSE +0 -21
- package/dist/node_modules/expand-template/README.md +0 -43
- package/dist/node_modules/expand-template/index.js +0 -26
- package/dist/node_modules/expand-template/package.json +0 -29
- package/dist/node_modules/expand-template/test.js +0 -67
- package/dist/node_modules/fs-constants/LICENSE +0 -21
- package/dist/node_modules/fs-constants/README.md +0 -26
- package/dist/node_modules/fs-constants/browser.js +0 -1
- package/dist/node_modules/fs-constants/index.js +0 -1
- package/dist/node_modules/fs-constants/package.json +0 -19
- package/dist/node_modules/github-from-package/.travis.yml +0 -4
- package/dist/node_modules/github-from-package/LICENSE +0 -18
- package/dist/node_modules/github-from-package/example/package.json +0 -8
- package/dist/node_modules/github-from-package/example/url.js +0 -3
- package/dist/node_modules/github-from-package/index.js +0 -17
- package/dist/node_modules/github-from-package/package.json +0 -30
- package/dist/node_modules/github-from-package/readme.markdown +0 -53
- package/dist/node_modules/github-from-package/test/a.json +0 -8
- package/dist/node_modules/github-from-package/test/b.json +0 -5
- package/dist/node_modules/github-from-package/test/c.json +0 -5
- package/dist/node_modules/github-from-package/test/d.json +0 -7
- package/dist/node_modules/github-from-package/test/e.json +0 -5
- package/dist/node_modules/github-from-package/test/url.js +0 -19
- package/dist/node_modules/ieee754/LICENSE +0 -11
- package/dist/node_modules/ieee754/README.md +0 -51
- package/dist/node_modules/ieee754/index.d.ts +0 -10
- package/dist/node_modules/ieee754/index.js +0 -85
- package/dist/node_modules/ieee754/package.json +0 -52
- package/dist/node_modules/inherits/LICENSE +0 -16
- package/dist/node_modules/inherits/README.md +0 -42
- package/dist/node_modules/inherits/inherits.js +0 -9
- package/dist/node_modules/inherits/inherits_browser.js +0 -27
- package/dist/node_modules/inherits/package.json +0 -29
- package/dist/node_modules/ini/LICENSE +0 -15
- package/dist/node_modules/ini/README.md +0 -102
- package/dist/node_modules/ini/ini.js +0 -206
- package/dist/node_modules/ini/package.json +0 -33
- package/dist/node_modules/is-arrayish/LICENSE +0 -21
- package/dist/node_modules/is-arrayish/README.md +0 -16
- package/dist/node_modules/is-arrayish/index.js +0 -9
- package/dist/node_modules/is-arrayish/package.json +0 -45
- package/dist/node_modules/is-arrayish/yarn-error.log +0 -1443
- package/dist/node_modules/lru-cache/LICENSE +0 -15
- package/dist/node_modules/lru-cache/README.md +0 -166
- package/dist/node_modules/lru-cache/index.js +0 -334
- package/dist/node_modules/lru-cache/package.json +0 -34
- package/dist/node_modules/mimic-response/index.d.ts +0 -17
- package/dist/node_modules/mimic-response/index.js +0 -77
- package/dist/node_modules/mimic-response/license +0 -9
- package/dist/node_modules/mimic-response/package.json +0 -42
- package/dist/node_modules/mimic-response/readme.md +0 -78
- package/dist/node_modules/minimist/.eslintrc +0 -29
- package/dist/node_modules/minimist/.github/FUNDING.yml +0 -12
- package/dist/node_modules/minimist/.nycrc +0 -14
- package/dist/node_modules/minimist/CHANGELOG.md +0 -298
- package/dist/node_modules/minimist/LICENSE +0 -18
- package/dist/node_modules/minimist/README.md +0 -121
- package/dist/node_modules/minimist/example/parse.js +0 -4
- package/dist/node_modules/minimist/index.js +0 -263
- package/dist/node_modules/minimist/package.json +0 -75
- package/dist/node_modules/minimist/test/all_bool.js +0 -34
- package/dist/node_modules/minimist/test/bool.js +0 -177
- package/dist/node_modules/minimist/test/dash.js +0 -43
- package/dist/node_modules/minimist/test/default_bool.js +0 -37
- package/dist/node_modules/minimist/test/dotted.js +0 -24
- package/dist/node_modules/minimist/test/kv_short.js +0 -32
- package/dist/node_modules/minimist/test/long.js +0 -33
- package/dist/node_modules/minimist/test/num.js +0 -38
- package/dist/node_modules/minimist/test/parse.js +0 -209
- package/dist/node_modules/minimist/test/parse_modified.js +0 -11
- package/dist/node_modules/minimist/test/proto.js +0 -64
- package/dist/node_modules/minimist/test/short.js +0 -69
- package/dist/node_modules/minimist/test/stop_early.js +0 -17
- package/dist/node_modules/minimist/test/unknown.js +0 -104
- package/dist/node_modules/minimist/test/whitespace.js +0 -10
- package/dist/node_modules/mkdirp-classic/LICENSE +0 -21
- package/dist/node_modules/mkdirp-classic/README.md +0 -18
- package/dist/node_modules/mkdirp-classic/index.js +0 -98
- package/dist/node_modules/mkdirp-classic/package.json +0 -18
- package/dist/node_modules/napi-build-utils/LICENSE +0 -21
- package/dist/node_modules/napi-build-utils/README.md +0 -48
- package/dist/node_modules/napi-build-utils/index.js +0 -213
- package/dist/node_modules/napi-build-utils/index.md +0 -81
- package/dist/node_modules/napi-build-utils/package.json +0 -41
- package/dist/node_modules/node-abi/.circleci/config.yml +0 -45
- package/dist/node_modules/node-abi/.github/CODEOWNERS +0 -1
- package/dist/node_modules/node-abi/.github/workflows/update-abi.yml +0 -42
- package/dist/node_modules/node-abi/.releaserc.json +0 -9
- package/dist/node_modules/node-abi/CODE_OF_CONDUCT.md +0 -73
- package/dist/node_modules/node-abi/CONTRIBUTING.md +0 -62
- package/dist/node_modules/node-abi/LICENSE +0 -21
- package/dist/node_modules/node-abi/README.md +0 -52
- package/dist/node_modules/node-abi/abi_registry.json +0 -245
- package/dist/node_modules/node-abi/index.js +0 -179
- package/dist/node_modules/node-abi/package.json +0 -38
- package/dist/node_modules/node-abi/scripts/update-abi-registry.js +0 -119
- package/dist/node_modules/node-abi/test/index.js +0 -166
- package/dist/node_modules/node-addon-api/LICENSE.md +0 -13
- package/dist/node_modules/node-addon-api/README.md +0 -317
- package/dist/node_modules/node-addon-api/common.gypi +0 -21
- package/dist/node_modules/node-addon-api/except.gypi +0 -25
- package/dist/node_modules/node-addon-api/index.js +0 -11
- package/dist/node_modules/node-addon-api/napi-inl.deprecated.h +0 -186
- package/dist/node_modules/node-addon-api/napi-inl.h +0 -6303
- package/dist/node_modules/node-addon-api/napi.h +0 -3114
- package/dist/node_modules/node-addon-api/node_api.gyp +0 -9
- package/dist/node_modules/node-addon-api/noexcept.gypi +0 -26
- package/dist/node_modules/node-addon-api/nothing.c +0 -0
- package/dist/node_modules/node-addon-api/package-support.json +0 -21
- package/dist/node_modules/node-addon-api/package.json +0 -456
- package/dist/node_modules/node-addon-api/tools/README.md +0 -73
- package/dist/node_modules/node-addon-api/tools/check-napi.js +0 -99
- package/dist/node_modules/node-addon-api/tools/clang-format.js +0 -71
- package/dist/node_modules/node-addon-api/tools/conversion.js +0 -301
- package/dist/node_modules/node-addon-api/tools/eslint-format.js +0 -79
- package/dist/node_modules/once/LICENSE +0 -15
- package/dist/node_modules/once/README.md +0 -79
- package/dist/node_modules/once/once.js +0 -42
- package/dist/node_modules/once/package.json +0 -33
- package/dist/node_modules/prebuild-install/CHANGELOG.md +0 -116
- package/dist/node_modules/prebuild-install/CONTRIBUTING.md +0 -6
- package/dist/node_modules/prebuild-install/LICENSE +0 -21
- package/dist/node_modules/prebuild-install/README.md +0 -163
- package/dist/node_modules/prebuild-install/asset.js +0 -44
- package/dist/node_modules/prebuild-install/bin.js +0 -78
- package/dist/node_modules/prebuild-install/download.js +0 -142
- package/dist/node_modules/prebuild-install/error.js +0 -14
- package/dist/node_modules/prebuild-install/help.txt +0 -16
- package/dist/node_modules/prebuild-install/index.js +0 -1
- package/dist/node_modules/prebuild-install/log.js +0 -33
- package/dist/node_modules/prebuild-install/package.json +0 -67
- package/dist/node_modules/prebuild-install/proxy.js +0 -35
- package/dist/node_modules/prebuild-install/rc.js +0 -64
- package/dist/node_modules/prebuild-install/util.js +0 -143
- package/dist/node_modules/pump/.travis.yml +0 -5
- package/dist/node_modules/pump/LICENSE +0 -21
- package/dist/node_modules/pump/README.md +0 -65
- package/dist/node_modules/pump/index.js +0 -82
- package/dist/node_modules/pump/package.json +0 -24
- package/dist/node_modules/pump/test-browser.js +0 -66
- package/dist/node_modules/pump/test-node.js +0 -53
- package/dist/node_modules/rc/LICENSE.APACHE2 +0 -15
- package/dist/node_modules/rc/LICENSE.BSD +0 -26
- package/dist/node_modules/rc/LICENSE.MIT +0 -24
- package/dist/node_modules/rc/README.md +0 -227
- package/dist/node_modules/rc/browser.js +0 -7
- package/dist/node_modules/rc/cli.js +0 -4
- package/dist/node_modules/rc/index.js +0 -53
- package/dist/node_modules/rc/lib/utils.js +0 -104
- package/dist/node_modules/rc/package.json +0 -29
- package/dist/node_modules/rc/test/ini.js +0 -16
- package/dist/node_modules/rc/test/nested-env-vars.js +0 -50
- package/dist/node_modules/rc/test/test.js +0 -59
- package/dist/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/dist/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/dist/node_modules/readable-stream/LICENSE +0 -47
- package/dist/node_modules/readable-stream/README.md +0 -106
- package/dist/node_modules/readable-stream/errors-browser.js +0 -127
- package/dist/node_modules/readable-stream/errors.js +0 -116
- package/dist/node_modules/readable-stream/experimentalWarning.js +0 -17
- package/dist/node_modules/readable-stream/lib/_stream_duplex.js +0 -126
- package/dist/node_modules/readable-stream/lib/_stream_passthrough.js +0 -37
- package/dist/node_modules/readable-stream/lib/_stream_readable.js +0 -1027
- package/dist/node_modules/readable-stream/lib/_stream_transform.js +0 -190
- package/dist/node_modules/readable-stream/lib/_stream_writable.js +0 -641
- package/dist/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -180
- package/dist/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -183
- package/dist/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -96
- package/dist/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -86
- package/dist/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
- package/dist/node_modules/readable-stream/lib/internal/streams/from.js +0 -52
- package/dist/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -86
- package/dist/node_modules/readable-stream/lib/internal/streams/state.js +0 -22
- package/dist/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/dist/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/dist/node_modules/readable-stream/package.json +0 -68
- package/dist/node_modules/readable-stream/readable-browser.js +0 -9
- package/dist/node_modules/readable-stream/readable.js +0 -16
- package/dist/node_modules/safe-buffer/LICENSE +0 -21
- package/dist/node_modules/safe-buffer/README.md +0 -584
- package/dist/node_modules/safe-buffer/index.d.ts +0 -187
- package/dist/node_modules/safe-buffer/index.js +0 -65
- package/dist/node_modules/safe-buffer/package.json +0 -51
- package/dist/node_modules/semver/LICENSE +0 -15
- package/dist/node_modules/semver/README.md +0 -568
- package/dist/node_modules/semver/bin/semver.js +0 -183
- package/dist/node_modules/semver/classes/comparator.js +0 -136
- package/dist/node_modules/semver/classes/index.js +0 -5
- package/dist/node_modules/semver/classes/range.js +0 -522
- package/dist/node_modules/semver/classes/semver.js +0 -287
- package/dist/node_modules/semver/functions/clean.js +0 -6
- package/dist/node_modules/semver/functions/cmp.js +0 -52
- package/dist/node_modules/semver/functions/coerce.js +0 -52
- package/dist/node_modules/semver/functions/compare-build.js +0 -7
- package/dist/node_modules/semver/functions/compare-loose.js +0 -3
- package/dist/node_modules/semver/functions/compare.js +0 -5
- package/dist/node_modules/semver/functions/diff.js +0 -23
- package/dist/node_modules/semver/functions/eq.js +0 -3
- package/dist/node_modules/semver/functions/gt.js +0 -3
- package/dist/node_modules/semver/functions/gte.js +0 -3
- package/dist/node_modules/semver/functions/inc.js +0 -18
- package/dist/node_modules/semver/functions/lt.js +0 -3
- package/dist/node_modules/semver/functions/lte.js +0 -3
- package/dist/node_modules/semver/functions/major.js +0 -3
- package/dist/node_modules/semver/functions/minor.js +0 -3
- package/dist/node_modules/semver/functions/neq.js +0 -3
- package/dist/node_modules/semver/functions/parse.js +0 -33
- package/dist/node_modules/semver/functions/patch.js +0 -3
- package/dist/node_modules/semver/functions/prerelease.js +0 -6
- package/dist/node_modules/semver/functions/rcompare.js +0 -3
- package/dist/node_modules/semver/functions/rsort.js +0 -3
- package/dist/node_modules/semver/functions/satisfies.js +0 -10
- package/dist/node_modules/semver/functions/sort.js +0 -3
- package/dist/node_modules/semver/functions/valid.js +0 -6
- package/dist/node_modules/semver/index.js +0 -88
- package/dist/node_modules/semver/internal/constants.js +0 -17
- package/dist/node_modules/semver/internal/debug.js +0 -9
- package/dist/node_modules/semver/internal/identifiers.js +0 -23
- package/dist/node_modules/semver/internal/parse-options.js +0 -11
- package/dist/node_modules/semver/internal/re.js +0 -182
- package/dist/node_modules/semver/package.json +0 -86
- package/dist/node_modules/semver/preload.js +0 -2
- package/dist/node_modules/semver/range.bnf +0 -16
- package/dist/node_modules/semver/ranges/gtr.js +0 -4
- package/dist/node_modules/semver/ranges/intersects.js +0 -7
- package/dist/node_modules/semver/ranges/ltr.js +0 -4
- package/dist/node_modules/semver/ranges/max-satisfying.js +0 -25
- package/dist/node_modules/semver/ranges/min-satisfying.js +0 -24
- package/dist/node_modules/semver/ranges/min-version.js +0 -61
- package/dist/node_modules/semver/ranges/outside.js +0 -80
- package/dist/node_modules/semver/ranges/simplify.js +0 -47
- package/dist/node_modules/semver/ranges/subset.js +0 -244
- package/dist/node_modules/semver/ranges/to-comparators.js +0 -8
- package/dist/node_modules/semver/ranges/valid.js +0 -11
- package/dist/node_modules/sharp/LICENSE +0 -191
- package/dist/node_modules/sharp/README.md +0 -117
- package/dist/node_modules/sharp/binding.gyp +0 -233
- package/dist/node_modules/sharp/build/Release/sharp-linux-x64.node +0 -0
- package/dist/node_modules/sharp/install/can-compile.js +0 -11
- package/dist/node_modules/sharp/install/dll-copy.js +0 -37
- package/dist/node_modules/sharp/install/libvips.js +0 -215
- package/dist/node_modules/sharp/lib/agent.js +0 -40
- package/dist/node_modules/sharp/lib/channel.js +0 -171
- package/dist/node_modules/sharp/lib/colour.js +0 -180
- package/dist/node_modules/sharp/lib/composite.js +0 -193
- package/dist/node_modules/sharp/lib/constructor.js +0 -386
- package/dist/node_modules/sharp/lib/index.js +0 -13
- package/dist/node_modules/sharp/lib/input.js +0 -507
- package/dist/node_modules/sharp/lib/is.js +0 -143
- package/dist/node_modules/sharp/lib/libvips.js +0 -136
- package/dist/node_modules/sharp/lib/operation.js +0 -803
- package/dist/node_modules/sharp/lib/output.js +0 -1231
- package/dist/node_modules/sharp/lib/platform.js +0 -27
- package/dist/node_modules/sharp/lib/resize.js +0 -473
- package/dist/node_modules/sharp/lib/sharp.js +0 -35
- package/dist/node_modules/sharp/lib/utility.js +0 -211
- package/dist/node_modules/sharp/package.json +0 -196
- package/dist/node_modules/sharp/src/common.cc +0 -966
- package/dist/node_modules/sharp/src/common.h +0 -352
- package/dist/node_modules/sharp/src/libvips/cplusplus/VConnection.cpp +0 -152
- package/dist/node_modules/sharp/src/libvips/cplusplus/VError.cpp +0 -50
- package/dist/node_modules/sharp/src/libvips/cplusplus/VImage.cpp +0 -1523
- package/dist/node_modules/sharp/src/libvips/cplusplus/VInterpolate.cpp +0 -63
- package/dist/node_modules/sharp/src/libvips/cplusplus/vips-operators.cpp +0 -3738
- package/dist/node_modules/sharp/src/metadata.cc +0 -291
- package/dist/node_modules/sharp/src/metadata.h +0 -92
- package/dist/node_modules/sharp/src/operations.cc +0 -412
- package/dist/node_modules/sharp/src/operations.h +0 -126
- package/dist/node_modules/sharp/src/pipeline.cc +0 -1624
- package/dist/node_modules/sharp/src/pipeline.h +0 -349
- package/dist/node_modules/sharp/src/sharp.cc +0 -52
- package/dist/node_modules/sharp/src/stats.cc +0 -193
- package/dist/node_modules/sharp/src/stats.h +0 -70
- package/dist/node_modules/sharp/src/utilities.cc +0 -243
- package/dist/node_modules/sharp/src/utilities.h +0 -29
- package/dist/node_modules/sharp/vendor/8.12.2/linux-x64/THIRD-PARTY-NOTICES.md +0 -43
- package/dist/node_modules/sharp/vendor/8.12.2/linux-x64/lib/libvips-cpp.so.42 +0 -0
- package/dist/node_modules/sharp/vendor/8.12.2/linux-x64/platform.json +0 -1
- package/dist/node_modules/sharp/vendor/8.12.2/linux-x64/versions.json +0 -31
- package/dist/node_modules/simple-concat/.travis.yml +0 -3
- package/dist/node_modules/simple-concat/LICENSE +0 -20
- package/dist/node_modules/simple-concat/README.md +0 -44
- package/dist/node_modules/simple-concat/index.js +0 -15
- package/dist/node_modules/simple-concat/package.json +0 -47
- package/dist/node_modules/simple-concat/test/basic.js +0 -41
- package/dist/node_modules/simple-get/.github/dependabot.yml +0 -15
- package/dist/node_modules/simple-get/.github/workflows/ci.yml +0 -23
- package/dist/node_modules/simple-get/LICENSE +0 -20
- package/dist/node_modules/simple-get/README.md +0 -333
- package/dist/node_modules/simple-get/index.js +0 -108
- package/dist/node_modules/simple-get/package.json +0 -67
- package/dist/node_modules/simple-swizzle/LICENSE +0 -21
- package/dist/node_modules/simple-swizzle/README.md +0 -39
- package/dist/node_modules/simple-swizzle/index.js +0 -29
- package/dist/node_modules/simple-swizzle/package.json +0 -36
- package/dist/node_modules/string_decoder/LICENSE +0 -48
- package/dist/node_modules/string_decoder/README.md +0 -47
- package/dist/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/dist/node_modules/string_decoder/package.json +0 -34
- package/dist/node_modules/strip-json-comments/index.js +0 -70
- package/dist/node_modules/strip-json-comments/license +0 -21
- package/dist/node_modules/strip-json-comments/package.json +0 -42
- package/dist/node_modules/strip-json-comments/readme.md +0 -64
- package/dist/node_modules/tar-fs/.travis.yml +0 -6
- package/dist/node_modules/tar-fs/LICENSE +0 -21
- package/dist/node_modules/tar-fs/README.md +0 -165
- package/dist/node_modules/tar-fs/index.js +0 -351
- package/dist/node_modules/tar-fs/package.json +0 -41
- package/dist/node_modules/tar-fs/test/fixtures/a/hello.txt +0 -1
- package/dist/node_modules/tar-fs/test/fixtures/b/a/test.txt +0 -1
- package/dist/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
- package/dist/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
- package/dist/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
- package/dist/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
- package/dist/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
- package/dist/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
- package/dist/node_modules/tar-fs/test/fixtures/e/file +0 -0
- package/dist/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
- package/dist/node_modules/tar-fs/test/index.js +0 -346
- package/dist/node_modules/tar-stream/LICENSE +0 -21
- package/dist/node_modules/tar-stream/README.md +0 -168
- package/dist/node_modules/tar-stream/extract.js +0 -257
- package/dist/node_modules/tar-stream/headers.js +0 -295
- package/dist/node_modules/tar-stream/index.js +0 -2
- package/dist/node_modules/tar-stream/pack.js +0 -255
- package/dist/node_modules/tar-stream/package.json +0 -58
- package/dist/node_modules/tar-stream/sandbox.js +0 -11
- package/dist/node_modules/tunnel-agent/LICENSE +0 -55
- package/dist/node_modules/tunnel-agent/README.md +0 -4
- package/dist/node_modules/tunnel-agent/index.js +0 -244
- package/dist/node_modules/tunnel-agent/package.json +0 -22
- package/dist/node_modules/util-deprecate/History.md +0 -16
- package/dist/node_modules/util-deprecate/LICENSE +0 -24
- package/dist/node_modules/util-deprecate/README.md +0 -53
- package/dist/node_modules/util-deprecate/browser.js +0 -67
- package/dist/node_modules/util-deprecate/node.js +0 -6
- package/dist/node_modules/util-deprecate/package.json +0 -27
- package/dist/node_modules/wrappy/LICENSE +0 -15
- package/dist/node_modules/wrappy/README.md +0 -36
- package/dist/node_modules/wrappy/package.json +0 -29
- package/dist/node_modules/wrappy/wrappy.js +0 -33
- package/dist/node_modules/yallist/LICENSE +0 -15
- package/dist/node_modules/yallist/README.md +0 -204
- package/dist/node_modules/yallist/iterator.js +0 -8
- package/dist/node_modules/yallist/package.json +0 -29
- package/dist/node_modules/yallist/yallist.js +0 -426
- package/dist/package-lock.json +0 -502
- package/dist/package.json +0 -39
- package/dist/static/expected_tile_2193_153_255_z7.png +0 -0
- package/dist/static/expected_tile_NZTM2000Quad_30_33_z6.png +0 -0
- package/dist/static/expected_tile_WebMercatorQuad_252_156_z8.png +0 -0
package/dist/index.js
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
"use strict";var D8=Object.create;var l1=Object.defineProperty;var z8=Object.getOwnPropertyDescriptor;var j8=Object.getOwnPropertyNames;var F8=Object.getPrototypeOf,$8=Object.prototype.hasOwnProperty;var q8=(t,e,r)=>e in t?l1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var u1=(t,e)=>()=>(t&&(e=t(t=0)),e);var G=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),q2=(t,e)=>{for(var r in e)l1(t,r,{get:e[r],enumerable:!0})},H2=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of j8(e))!$8.call(t,n)&&n!==r&&l1(t,n,{get:()=>e[n],enumerable:!(i=z8(e,n))||i.enumerable});return t};var me=(t,e,r)=>(r=t!=null?D8(F8(t)):{},H2(e||!t||!t.__esModule?l1(r,"default",{value:t,enumerable:!0}):r,t)),H8=t=>H2(l1({},"__esModule",{value:!0}),t);var ph=(t,e,r)=>(q8(t,typeof e!="symbol"?e+"":e,r),r),W2=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var Ee=(t,e,r)=>(W2(t,e,"read from private field"),r?r.call(t):e.get(t)),St=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},et=(t,e,r,i)=>(W2(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),gh=(t,e,r,i)=>({set _(n){et(t,e,n,r)},get _(){return Ee(t,e,i)}});var K2=G((VA,V2)=>{"use strict";var yh=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return r instanceof Error?r:void 0}else return e instanceof Error?e:void 0},U2=(t,e)=>{if(!(t instanceof Error))return"";let r=t.stack||"";if(e.has(t))return r+`
|
|
2
|
-
causes have become circular...`;let i=yh(t);return i?(e.add(t),r+`
|
|
3
|
-
caused by: `+U2(i,e)):r},W8=t=>U2(t,new Set),G2=(t,e,r)=>{if(!(t instanceof Error))return"";let i=r?"":t.message||"";if(e.has(t))return i+": ...";let n=yh(t);if(n){e.add(t);let o=typeof t.cause=="function";return i+(o?"":": ")+G2(n,e,o)}else return i},U8=t=>G2(t,new Set);V2.exports={getErrorCause:yh,stackWithCauses:W8,messageWithCauses:U8}});var Y2=G((KA,Z2)=>{"use strict";Z2.exports=wh;var{messageWithCauses:G8,stackWithCauses:V8}=K2(),{toString:K8}=Object.prototype,bh=Symbol("circular-ref-tag"),vh=Symbol("pino-raw-err-ref"),J2=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[vh]},set:function(t){this[vh]=t}}});Object.defineProperty(J2,vh,{writable:!0,value:{}});function wh(t){if(!(t instanceof Error))return t;t[bh]=void 0;let e=Object.create(J2);e.type=K8.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=G8(t),e.stack=V8(t),global.AggregateError!==void 0&&t instanceof global.AggregateError&&Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>wh(r)));for(let r in t)if(e[r]===void 0){let i=t[r];i instanceof Error?r!=="cause"&&!Object.prototype.hasOwnProperty.call(i,bh)&&(e[r]=wh(i)):e[r]=i}return delete t[bh],e.raw=t,e}});var t5=G((JA,e5)=>{"use strict";e5.exports={mapHttpRequest:J8,reqSerializer:Q2};var _h=Symbol("pino-raw-req-ref"),X2=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[_h]},set:function(t){this[_h]=t}}});Object.defineProperty(X2,_h,{writable:!0,value:{}});function Q2(t){let e=t.info||t.socket,r=Object.create(X2);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else{let i=t.path;r.url=typeof i=="string"?i:t.url?t.url.path||t.url:void 0}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function J8(t){return{req:Q2(t)}}});var s5=G((ZA,n5)=>{"use strict";n5.exports={mapHttpResponse:Z8,resSerializer:i5};var Sh=Symbol("pino-raw-res-ref"),r5=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Sh]},set:function(t){this[Sh]=t}}});Object.defineProperty(r5,Sh,{writable:!0,value:{}});function i5(t){let e=Object.create(r5);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function Z8(t){return{res:i5(t)}}});var f1=G((YA,o5)=>{"use strict";var xh=Y2(),au=t5(),lu=s5();o5.exports={err:xh,mapHttpRequest:au.mapHttpRequest,mapHttpResponse:lu.mapHttpResponse,req:au.reqSerializer,res:lu.resSerializer,wrapErrorSerializer:function(e){return e===xh?e:function(i){return e(xh(i))}},wrapRequestSerializer:function(e){return e===au.reqSerializer?e:function(i){return e(au.reqSerializer(i))}},wrapResponseSerializer:function(e){return e===lu.resSerializer?e:function(i){return e(lu.resSerializer(i))}}}});var Mh=G((XA,a5)=>{"use strict";function Y8(t,e){return e}a5.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=Y8;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let i=r.slice(2),n=[];for(let o of i)!o||n.push(o.getFileName());return n}});var u5=G((QA,l5)=>{"use strict";var{createContext:X8,runInContext:Q8}=require("vm");l5.exports=e3;function e3(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=i=>`fast-redact \u2013 Invalid path (${i})`}=t;return function({paths:n}){n.forEach(o=>{if(typeof o!="string")throw Error(e());try{if(/〇/.test(o))throw Error();let a=new Proxy({},{get:()=>a,set:()=>{throw Error()}}),c=(o[0]==="["?"":".")+o.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(c)||/\/\*/.test(c))throw Error();Q8(`
|
|
4
|
-
(function () {
|
|
5
|
-
'use strict'
|
|
6
|
-
o${c}
|
|
7
|
-
if ([o${c}].length !== 1) throw Error()
|
|
8
|
-
})()
|
|
9
|
-
`,X8({o:a,"\u3007":null}),{codeGeneration:{strings:!1,wasm:!1}})}catch{throw Error(r(o))}})}}});var uu=G((eT,c5)=>{"use strict";c5.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var h5=G((tT,f5)=>{"use strict";var t3=uu();f5.exports=r3;function r3({paths:t}){let e=[];var r=0;let i=t.reduce(function(n,o,a){var c=o.match(t3).map(m=>m.replace(/'|"|`/g,""));let d=o[0]==="[";c=c.map(m=>m[0]==="["?m.substr(1,m.length-2):m);let p=c.indexOf("*");if(p>-1){let m=c.slice(0,p),v=m.join("."),x=c.slice(p+1,c.length),w=x.length>0;r++,e.push({before:m,beforeStr:v,after:x,nested:w})}else n[o]={path:c,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(o),leadingBracket:d};return n},{});return{wildcards:e,wcLen:r,secret:i}}});var m5=G((rT,d5)=>{"use strict";var i3=uu();d5.exports=n3;function n3({secret:t,serialize:e,wcLen:r,strict:i,isCensorFct:n,censorFctTakesPath:o},a){let c=Function("o",`
|
|
10
|
-
if (typeof o !== 'object' || o == null) {
|
|
11
|
-
${l3(i,e)}
|
|
12
|
-
}
|
|
13
|
-
const { censor, secret } = this
|
|
14
|
-
${s3(t,n,o)}
|
|
15
|
-
this.compileRestore()
|
|
16
|
-
${o3(r>0,n,o)}
|
|
17
|
-
${a3(e)}
|
|
18
|
-
`).bind(a);return e===!1&&(c.restore=d=>a.restore(d)),c}function s3(t,e,r){return Object.keys(t).map(i=>{let{escPath:n,leadingBracket:o,path:a}=t[i],c=o?1:0,d=o?"":".",p=[];for(var m;(m=i3.exec(i))!==null;){let[,b]=m,{index:E,input:A}=m;E>c&&p.push(A.substring(0,E-(b?0:1)))}var v=p.map(b=>`o${d}${b}`).join(" && ");v.length===0?v+=`o${d}${i} != null`:v+=` && o${d}${i} != null`;let x=`
|
|
19
|
-
switch (true) {
|
|
20
|
-
${p.reverse().map(b=>`
|
|
21
|
-
case o${d}${b} === censor:
|
|
22
|
-
secret[${n}].circle = ${JSON.stringify(b)}
|
|
23
|
-
break
|
|
24
|
-
`).join(`
|
|
25
|
-
`)}
|
|
26
|
-
}
|
|
27
|
-
`,w=r?`val, ${JSON.stringify(a)}`:"val";return`
|
|
28
|
-
if (${v}) {
|
|
29
|
-
const val = o${d}${i}
|
|
30
|
-
if (val === censor) {
|
|
31
|
-
secret[${n}].precensored = true
|
|
32
|
-
} else {
|
|
33
|
-
secret[${n}].val = val
|
|
34
|
-
o${d}${i} = ${e?`censor(${w})`:"censor"}
|
|
35
|
-
${x}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
`}).join(`
|
|
39
|
-
`)}function o3(t,e,r){return t===!0?`
|
|
40
|
-
{
|
|
41
|
-
const { wildcards, wcLen, groupRedact, nestedRedact } = this
|
|
42
|
-
for (var i = 0; i < wcLen; i++) {
|
|
43
|
-
const { before, beforeStr, after, nested } = wildcards[i]
|
|
44
|
-
if (nested === true) {
|
|
45
|
-
secret[beforeStr] = secret[beforeStr] || []
|
|
46
|
-
nestedRedact(secret[beforeStr], o, before, after, censor, ${e}, ${r})
|
|
47
|
-
} else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${r})
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
`:""}function a3(t){return t===!1?"return o":`
|
|
51
|
-
var s = this.serialize(o)
|
|
52
|
-
this.restore(o)
|
|
53
|
-
return s
|
|
54
|
-
`}function l3(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Eh=G((iT,g5)=>{"use strict";g5.exports={groupRedact:c3,groupRestore:u3,nestedRedact:h3,nestedRestore:f3};function u3({keys:t,values:e,target:r}){if(r==null)return;let i=t.length;for(var n=0;n<i;n++){let o=t[n];r[o]=e[n]}}function c3(t,e,r,i,n){let o=p5(t,e);if(o==null)return{keys:null,values:null,target:null,flat:!0};let a=Object.keys(o),c=a.length,d=e.length,p=n?[...e]:void 0,m=new Array(c);for(var v=0;v<c;v++){let x=a[v];m[v]=o[x],n?(p[d]=x,o[x]=r(o[x],p)):i?o[x]=r(o[x]):o[x]=r}return{keys:a,values:m,target:o,flat:!0}}function f3(t){let e=t.length;for(var r=0;r<e;r++){let{key:n,target:o,value:a}=t[r];if(cu(o,n)&&(o[n]=a),typeof o=="object"){let c=Object.keys(o);for(var i=0;i<c.length;i++){let d=c[i],p=o[d];cu(p,n)&&(p[n]=a)}}}}function h3(t,e,r,i,n,o,a){let c=p5(e,r);if(c==null)return;let d=Object.keys(c),p=d.length;for(var m=0;m<p;m++){let v=d[m],{value:x,parent:w,exists:b}=d3(c,v,r,i,n,o,a);b===!0&&w!==null&&t.push({key:i[i.length-1],target:w,value:x})}return t}function cu(t,e){return t!=null?"hasOwn"in Object?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e):!1}function d3(t,e,r,i,n,o,a){let c=i.length,d=c-1,p=e;var m=-1,v,x,w,b=null,E=!0,A=null;if(w=v=t[e],typeof v!="object")return{value:null,parent:null,exists:E};for(;v!=null&&++m<c;){if(e=i[m],b=w,e!=="*"&&!A&&!(typeof v=="object"&&e in v)){E=!1;break}if(!(e==="*"&&(A=e,m!==d))){if(A){let P=Object.keys(v);for(var C=0;C<P.length;C++){let L=P[C],k=v[L],z=e==="*";(z||typeof k=="object"&&k!==null&&e in k)&&(z?w=k:w=k[e],x=m!==d?w:o?a?n(w,[...r,p,...i]):n(w):n,z?v[L]=x:k[e]=x===void 0&&n!==void 0||cu(k,e)&&x===w?k[e]:x)}A=null}else w=v[e],x=m!==d?w:o?a?n(w,[...r,p,...i]):n(w):n,v[e]=cu(v,e)&&x===w||x===void 0&&n!==void 0?v[e]:x,v=v[e];if(typeof v!="object")break}}return{value:w,parent:b,exists:E}}function p5(t,e){for(var r=-1,i=e.length,n=t;n!=null&&++r<i;)n=n[e[r]];return n}});var b5=G((nT,y5)=>{"use strict";var{groupRestore:m3,nestedRestore:p3}=Eh();y5.exports=g3;function g3({secret:t,wcLen:e}){return function(){if(this.restore)return;let i=Object.keys(t),n=y3(t,i),o=e>0,a=o?{secret:t,groupRestore:m3,nestedRestore:p3}:{secret:t};this.restore=Function("o",b3(n,i,o)).bind(a)}}function y3(t,e){return e.map(r=>{let{circle:i,escPath:n,leadingBracket:o}=t[r],c=i?`o.${i} = secret[${n}].val`:`o${o?"":"."}${r} = secret[${n}].val`,d=`secret[${n}].val = undefined`;return`
|
|
55
|
-
if (secret[${n}].val !== undefined) {
|
|
56
|
-
try { ${c} } catch (e) {}
|
|
57
|
-
${d}
|
|
58
|
-
}
|
|
59
|
-
`}).join("")}function b3(t,e,r){return`
|
|
60
|
-
const secret = this.secret
|
|
61
|
-
${r===!0?`
|
|
62
|
-
const keys = Object.keys(secret)
|
|
63
|
-
const len = keys.length
|
|
64
|
-
for (var i = len - 1; i >= ${e.length}; i--) {
|
|
65
|
-
const k = keys[i]
|
|
66
|
-
const o = secret[k]
|
|
67
|
-
if (o.flat === true) this.groupRestore(o)
|
|
68
|
-
else this.nestedRestore(o)
|
|
69
|
-
secret[k] = null
|
|
70
|
-
}
|
|
71
|
-
`:""}
|
|
72
|
-
${t}
|
|
73
|
-
return o
|
|
74
|
-
`}});var w5=G((sT,v5)=>{"use strict";v5.exports=v3;function v3(t){let{secret:e,censor:r,compileRestore:i,serialize:n,groupRedact:o,nestedRedact:a,wildcards:c,wcLen:d}=t,p=[{secret:e,censor:r,compileRestore:i}];return n!==!1&&p.push({serialize:n}),d>0&&p.push({groupRedact:o,nestedRedact:a,wildcards:c,wcLen:d}),Object.assign(...p)}});var Ah=G((oT,S5)=>{"use strict";var _5=u5(),w3=h5(),_3=m5(),S3=b5(),{groupRedact:x3,nestedRedact:M3}=Eh(),E3=w5(),R3=uu(),C3=_5(),Rh=t=>t;Rh.restore=Rh;var A3="[REDACTED]";Ch.rx=R3;Ch.validator=_5;S5.exports=Ch;function Ch(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,i=t.remove;if(i===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let n=i===!0?void 0:"censor"in t?t.censor:A3,o=typeof n=="function",a=o&&n.length>1;if(e.length===0)return r||Rh;C3({paths:e,serialize:r,censor:n});let{wildcards:c,wcLen:d,secret:p}=w3({paths:e,censor:n}),m=S3({secret:p,wcLen:d}),v="strict"in t?t.strict:!0;return _3({secret:p,wcLen:d,serialize:r,strict:v,isCensorFct:o,censorFctTakesPath:a},E3({secret:p,censor:n,compileRestore:m,serialize:r,groupRedact:x3,nestedRedact:M3,wildcards:c,wcLen:d}))}});var xo=G((aT,x5)=>{"use strict";var T3=Symbol("pino.setLevel"),P3=Symbol("pino.getLevel"),O3=Symbol("pino.levelVal"),I3=Symbol("pino.useLevelLabels"),L3=Symbol("pino.useOnlyCustomLevels"),k3=Symbol("pino.mixin"),N3=Symbol("pino.lsCache"),B3=Symbol("pino.chindings"),D3=Symbol("pino.asJson"),z3=Symbol("pino.write"),j3=Symbol("pino.redactFmt"),F3=Symbol("pino.time"),$3=Symbol("pino.timeSliceIndex"),q3=Symbol("pino.stream"),H3=Symbol("pino.stringify"),W3=Symbol("pino.stringifySafe"),U3=Symbol("pino.stringifiers"),G3=Symbol("pino.end"),V3=Symbol("pino.formatOpts"),K3=Symbol("pino.messageKey"),J3=Symbol("pino.errorKey"),Z3=Symbol("pino.nestedKey"),Y3=Symbol("pino.nestedKeyStr"),X3=Symbol("pino.mixinMergeStrategy"),Q3=Symbol("pino.wildcardFirst"),e7=Symbol.for("pino.serializers"),t7=Symbol.for("pino.formatters"),r7=Symbol.for("pino.hooks"),i7=Symbol.for("pino.metadata");x5.exports={setLevelSym:T3,getLevelSym:P3,levelValSym:O3,useLevelLabelsSym:I3,mixinSym:k3,lsCacheSym:N3,chindingsSym:B3,asJsonSym:D3,writeSym:z3,serializersSym:e7,redactFmtSym:j3,timeSym:F3,timeSliceIndexSym:$3,streamSym:q3,stringifySym:H3,stringifySafeSym:W3,stringifiersSym:U3,endSym:G3,formatOptsSym:V3,messageKeySym:K3,errorKeySym:J3,nestedKeySym:Z3,wildcardFirstSym:Q3,needsMetadataGsym:i7,useOnlyCustomLevelsSym:L3,formattersSym:t7,hooksSym:r7,nestedKeyStrSym:Y3,mixinMergeStrategySym:X3}});var Oh=G((lT,C5)=>{"use strict";var Ph=Ah(),{redactFmtSym:n7,wildcardFirstSym:fu}=xo(),{rx:Th,validator:s7}=Ph,M5=s7({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),E5="[Redacted]",R5=!1;function o7(t,e){let{paths:r,censor:i}=a7(t),n=r.reduce((c,d)=>{Th.lastIndex=0;let p=Th.exec(d),m=Th.exec(d),v=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(v==="*"&&(v=fu),m===null)return c[v]=null,c;if(c[v]===null)return c;let{index:x}=m,w=`${d.substr(x,d.length-1)}`;return c[v]=c[v]||[],v!==fu&&c[v].length===0&&c[v].push(...c[fu]||[]),v===fu&&Object.keys(c).forEach(function(b){c[b]&&c[b].push(w)}),c[v].push(w),c},{}),o={[n7]:Ph({paths:r,censor:i,serialize:e,strict:R5})},a=(...c)=>e(typeof i=="function"?i(...c):i);return[...Object.keys(n),...Object.getOwnPropertySymbols(n)].reduce((c,d)=>{if(n[d]===null)c[d]=p=>a(p,[d]);else{let p=typeof i=="function"?(m,v)=>i(m,[d,...v]):i;c[d]=Ph({paths:n[d],censor:p,serialize:e,strict:R5})}return c},o)}function a7(t){if(Array.isArray(t))return t={paths:t,censor:E5},M5(t),t;let{paths:e,censor:r=E5,remove:i}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return i===!0&&(r=void 0),M5({paths:e,censor:r}),{paths:e,censor:r}}C5.exports=o7});var T5=G((uT,A5)=>{"use strict";var l7=()=>"",u7=()=>`,"time":${Date.now()}`,c7=()=>`,"time":${Math.round(Date.now()/1e3)}`,f7=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;A5.exports={nullTime:l7,epochTime:u7,unixTime:c7,isoTime:f7}});var Ih=G((cT,P5)=>{"use strict";function h7(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}P5.exports=d7;function d7(t,e,r){var i=r&&r.stringify||h7,n=1;if(typeof t=="object"&&t!==null){var o=e.length+n;if(o===1)return t;var a=new Array(o);a[0]=i(t);for(var c=1;c<o;c++)a[c]=i(e[c]);return a.join(" ")}if(typeof t!="string")return t;var d=e.length;if(d===0)return t;for(var p="",m=1-n,v=-1,x=t&&t.length||0,w=0;w<x;){if(t.charCodeAt(w)===37&&w+1<x){switch(v=v>-1?v:0,t.charCodeAt(w+1)){case 100:case 102:if(m>=d||(v<w&&(p+=t.slice(v,w)),e[m]==null))break;p+=Number(e[m]),v=w=w+2;break;case 105:if(m>=d||(v<w&&(p+=t.slice(v,w)),e[m]==null))break;p+=Math.floor(Number(e[m])),v=w=w+2;break;case 79:case 111:case 106:if(m>=d||(v<w&&(p+=t.slice(v,w)),e[m]===void 0))break;var b=typeof e[m];if(b==="string"){p+="'"+e[m]+"'",v=w+2,w++;break}if(b==="function"){p+=e[m].name||"<anonymous>",v=w+2,w++;break}p+=i(e[m]),v=w+2,w++;break;case 115:if(m>=d)break;v<w&&(p+=t.slice(v,w)),p+=String(e[m]),v=w+2,w++;break;case 37:v<w&&(p+=t.slice(v,w)),p+="%",v=w+2,w++,m--;break}++m}++w}return v===-1?t:(v<x&&(p+=t.slice(v)),p)}});var hu=G((fT,Lh)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));Lh.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let i=Date.now()+Number(e);for(;i>Date.now(););};Lh.exports=t}});var Nh=G((hT,k5)=>{"use strict";var Kt=require("fs"),m7=require("events"),p7=require("util").inherits,O5=require("path"),I5=hu(),kh=100,g7=16*1024;function L5(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(o,a){if(o){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",o)}):e.emit("error",o);return}e.fd=a,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e._reopening&&!e._writing&&e._len>e.minLength&&!e.destroyed&&Mo(e)}let i=e.append?"a":"w",n=e.mode;if(e.sync)try{e.mkdir&&Kt.mkdirSync(O5.dirname(t),{recursive:!0});let o=Kt.openSync(t,i,n);r(null,o)}catch(o){throw r(o),o}else e.mkdir?Kt.mkdir(O5.dirname(t),{recursive:!0},o=>{if(o)return r(o);Kt.open(t,i,n,r)}):Kt.open(t,i,n,r)}function Jt(t){if(!(this instanceof Jt))return new Jt(t);let{fd:e,dest:r,minLength:i,maxLength:n,maxWrite:o,sync:a,append:c=!0,mode:d,mkdir:p,retryEAGAIN:m,fsync:v}=t||{};if(e=e||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=n||0,this.maxWrite=o||g7,this.sync=a||!1,this._fsync=v||!1,this.append=c||!1,this.mode=d,this.retryEAGAIN=m||(()=>!0),this.mkdir=p||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")L5(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(x,w)=>{if(x){if(x.code==="EAGAIN"&&this.retryEAGAIN(x,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{I5(kh),this.release(void 0,0)}catch(E){this.release(E)}else setTimeout(()=>{Kt.write(this.fd,this._writingBuf,"utf8",this.release)},kh);else this._writing=!1,this.emit("error",x);return}if(this.emit("write",w),this._len-=w,this._writingBuf=this._writingBuf.slice(w),this._writingBuf.length){if(!this.sync){Kt.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let E=Kt.writeSync(this.fd,this._writingBuf,"utf8");this._len-=E,this._writingBuf=this._writingBuf.slice(E)}while(this._writingBuf)}catch(E){this.release(E);return}}this._fsync&&Kt.fsyncSync(this.fd);let b=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):b>this.minLength?Mo(this):this._ending?b>0?Mo(this):(this._writing=!1,du(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(y7,this)):this.emit("drain"))},this.on("newListener",function(x){x==="drain"&&(this._asyncDrainScheduled=!1)})}function y7(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}p7(Jt,m7);Jt.prototype.write=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||r[r.length-1].length+t.length>this.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&Mo(this),this._len<this._hwm)};Jt.prototype.flush=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");this._writing||this.minLength<=0||(this._bufs.length===0&&this._bufs.push(""),Mo(this))};Jt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&Kt.close(e,r=>{if(r)return this.emit("error",r)})}),L5(t||this.file,this)};Jt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?Mo(this):du(this)))};Jt.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");for(!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");this._bufs.length;){let t=this._bufs[0];try{this._len-=Kt.writeSync(this.fd,t,"utf8"),this._bufs.shift()}catch(e){if(e.code!=="EAGAIN"||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;I5(kh)}}};Jt.prototype.destroy=function(){this.destroyed||du(this)};function Mo(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift()||"",t.sync)try{let r=Kt.writeSync(t.fd,t._writingBuf,"utf8");e(null,r)}catch(r){e(r)}else Kt.write(t.fd,t._writingBuf,"utf8",e)}function du(t){if(t.fd===-1){t.once("ready",du.bind(null,t));return}t.destroyed=!0,t._bufs=[],t.fd!==1&&t.fd!==2?Kt.close(t.fd,e):setImmediate(e);function e(r){if(r){t.emit("error",r);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}Jt.SonicBoom=Jt;Jt.default=Jt;k5.exports=Jt});var h1=G((dT,F5)=>{"use strict";var cn={exit:[],beforeExit:[]},N5={exit:v7,beforeExit:w7},B5=new FinalizationRegistry(_7);function b7(t){cn[t].length>0||process.on(t,N5[t])}function D5(t){cn[t].length>0||process.removeListener(t,N5[t])}function v7(){z5("exit")}function w7(){z5("beforeExit")}function z5(t){for(let e of cn[t]){let r=e.deref(),i=e.fn;r!==void 0&&i(r,t)}}function _7(t){for(let e of["exit","beforeExit"]){let r=cn[e].indexOf(t);cn[e].splice(r,r+1),D5(e)}}function j5(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");b7(t);let i=new WeakRef(e);i.fn=r,B5.register(e,i),cn[t].push(i)}function S7(t,e){j5("exit",t,e)}function x7(t,e){j5("beforeExit",t,e)}function M7(t){B5.unregister(t);for(let e of["exit","beforeExit"])cn[e]=cn[e].filter(r=>{let i=r.deref();return i&&i!==t}),D5(e)}F5.exports={register:S7,registerBeforeExit:x7,unregister:M7}});var q5=G((mT,$5)=>{"use strict";function E7(t,e,r,i,n){let o=Date.now()+i,a=Atomics.load(t,e);if(a===r){n(null,"ok");return}let c=a,d=p=>{Date.now()>o?n(null,"timed-out"):setTimeout(()=>{c=a,a=Atomics.load(t,e),a===c?d(p>=1e3?1e3:p*2):a===r?n(null,"ok"):n(null,"not-equal")},p)};d(1)}function R7(t,e,r,i,n){let o=Date.now()+i,a=Atomics.load(t,e);if(a!==r){n(null,"ok");return}let c=d=>{Date.now()>o?n(null,"timed-out"):setTimeout(()=>{a=Atomics.load(t,e),a!==r?n(null,"ok"):c(d>=1e3?1e3:d*2)},d)};c(1)}$5.exports={wait:E7,waitDiff:R7}});var W5=G((pT,H5)=>{"use strict";H5.exports={WRITE_INDEX:4,READ_INDEX:8}});var $h=G((yT,K5)=>{"use strict";var{EventEmitter:C7}=require("events"),{Worker:A7}=require("worker_threads"),{join:T7}=require("path"),{pathToFileURL:P7}=require("url"),{wait:O7}=q5(),{WRITE_INDEX:Zt,READ_INDEX:ii}=W5(),I7=require("buffer"),L7=require("assert"),$=Symbol("kImpl"),k7=I7.constants.MAX_STRING_LENGTH,pu=class{constructor(e){this._value=e}deref(){return this._value}},N7=global.FinalizationRegistry||class{register(){}unregister(){}},B7=global.WeakRef||pu,U5=new N7(t=>{t.exited||t.terminate()});function D7(t,e){let{filename:r,workerData:i}=e,o=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||T7(__dirname,"lib","worker.js"),a=new A7(o,{...e.workerOpts,workerData:{filename:r.indexOf("file://")===0?r:P7(r).href,dataBuf:t[$].dataBuf,stateBuf:t[$].stateBuf,workerData:i}});return a.stream=new pu(t),a.on("message",z7),a.on("exit",V5),U5.register(t,a),a}function G5(t){L7(!t[$].sync),t[$].needDrain&&(t[$].needDrain=!1,t.emit("drain"))}function mu(t){let e=Atomics.load(t[$].state,Zt),r=t[$].data.length-e;if(r>0){if(t[$].buf.length===0){t[$].flushing=!1,t[$].ending?Fh(t):t[$].needDrain&&process.nextTick(G5,t);return}let i=t[$].buf.slice(0,r),n=Buffer.byteLength(i);n<=r?(t[$].buf=t[$].buf.slice(r),gu(t,i,mu.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[$].state,ii,0),Atomics.store(t[$].state,Zt,0);n>t[$].data.length;)r=r/2,i=t[$].buf.slice(0,r),n=Buffer.byteLength(i);t[$].buf=t[$].buf.slice(r),gu(t,i,mu.bind(null,t))}})}else if(r===0){if(e===0&&t[$].buf.length===0)return;t.flush(()=>{Atomics.store(t[$].state,ii,0),Atomics.store(t[$].state,Zt,0),mu(t)})}else ni(t,new Error("overwritten"))}function z7(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new B7(e),e.flush(()=>{e[$].ready=!0,e.emit("ready")});break;case"ERROR":ni(e,t.err);break;default:ni(e,new Error("this should not happen: "+t.code))}}function V5(t){let e=this.stream.deref();e!==void 0&&(U5.unregister(e),e.worker.exited=!0,e.worker.off("exit",V5),ni(e,t!==0?new Error("the worker thread exited"):null))}var Dh=class extends C7{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[$]={},this[$].stateBuf=new SharedArrayBuffer(128),this[$].state=new Int32Array(this[$].stateBuf),this[$].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[$].data=Buffer.from(this[$].dataBuf),this[$].sync=e.sync||!1,this[$].ending=!1,this[$].ended=!1,this[$].needDrain=!1,this[$].destroyed=!1,this[$].flushing=!1,this[$].ready=!1,this[$].finished=!1,this[$].errored=null,this[$].closed=!1,this[$].buf="",this.worker=D7(this,e)}write(e){if(this[$].destroyed)return zh(this,new Error("the worker has exited")),!1;if(this[$].ending)return zh(this,new Error("the worker is ending")),!1;if(this[$].flushing&&this[$].buf.length+e.length>=k7)try{Bh(this),this[$].flushing=!0}catch(r){return ni(this,r),!1}if(this[$].buf+=e,this[$].sync)try{return Bh(this),!0}catch(r){return ni(this,r),!1}return this[$].flushing||(this[$].flushing=!0,setImmediate(mu,this)),this[$].needDrain=this[$].data.length-this[$].buf.length-Atomics.load(this[$].state,Zt)<=0,!this[$].needDrain}end(){this[$].destroyed||(this[$].ending=!0,Fh(this))}flush(e){if(this[$].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[$].state,Zt);O7(this[$].state,ii,r,1/0,(i,n)=>{if(i){ni(this,i),process.nextTick(e,i);return}if(n==="not-equal"){this.flush(e);return}process.nextTick(e)})}flushSync(){this[$].destroyed||(Bh(this),jh(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[$].ready}get destroyed(){return this[$].destroyed}get closed(){return this[$].closed}get writable(){return!this[$].destroyed&&!this[$].ending}get writableEnded(){return this[$].ending}get writableFinished(){return this[$].finished}get writableNeedDrain(){return this[$].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[$].errored}};function zh(t,e){setImmediate(()=>{t.emit("error",e)})}function ni(t,e){t[$].destroyed||(t[$].destroyed=!0,e&&(t[$].errored=e,zh(t,e)),t.worker.exited?setImmediate(()=>{t[$].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[$].closed=!0,t.emit("close")}))}function gu(t,e,r){let i=Atomics.load(t[$].state,Zt),n=Buffer.byteLength(e);return t[$].data.write(e,i),Atomics.store(t[$].state,Zt,i+n),Atomics.notify(t[$].state,Zt),r(),!0}function Fh(t){if(!(t[$].ended||!t[$].ending||t[$].flushing)){t[$].ended=!0;try{t.flushSync();let e=Atomics.load(t[$].state,ii);Atomics.store(t[$].state,Zt,-1),Atomics.notify(t[$].state,Zt);let r=0;for(;e!==-1;){if(Atomics.wait(t[$].state,ii,e,1e3),e=Atomics.load(t[$].state,ii),e===-2){ni(t,new Error("end() failed"));return}if(++r===10){ni(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[$].finished=!0,t.emit("finish")})}catch(e){ni(t,e)}}}function Bh(t){let e=()=>{t[$].ending?Fh(t):t[$].needDrain&&process.nextTick(G5,t)};for(t[$].flushing=!1;t[$].buf.length!==0;){let r=Atomics.load(t[$].state,Zt),i=t[$].data.length-r;if(i===0){jh(t),Atomics.store(t[$].state,ii,0),Atomics.store(t[$].state,Zt,0);continue}else if(i<0)throw new Error("overwritten");let n=t[$].buf.slice(0,i),o=Buffer.byteLength(n);if(o<=i)t[$].buf=t[$].buf.slice(i),gu(t,n,e);else{for(jh(t),Atomics.store(t[$].state,ii,0),Atomics.store(t[$].state,Zt,0);o>t[$].buf.length;)i=i/2,n=t[$].buf.slice(0,i),o=Buffer.byteLength(n);t[$].buf=t[$].buf.slice(i),gu(t,n,e)}}}function jh(t){if(t[$].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[$].state,Zt),r=0;for(;;){let i=Atomics.load(t[$].state,ii);if(i===-2)throw Error("_flushSync failed");if(i!==e)Atomics.wait(t[$].state,ii,i,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}K5.exports=Dh});var Wh=G((bT,J5)=>{"use strict";var{createRequire:j7}=require("module"),F7=Mh(),{join:qh,isAbsolute:$7}=require("path"),q7=hu(),Hh=h1(),H7=$h();function W7(t){Hh.register(t,G7),Hh.registerBeforeExit(t,V7),t.on("close",function(){Hh.unregister(t)})}function U7(t,e,r){let i=new H7({filename:t,workerData:e,workerOpts:r});i.on("ready",n),i.on("close",function(){process.removeListener("exit",o)}),process.on("exit",o);function n(){process.removeListener("exit",o),i.unref(),r.autoEnd!==!1&&W7(i)}function o(){i.closed||(i.flushSync(),q7(100),i.end())}return i}function G7(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function V7(t){t.flushSync()}function K7(t){let{pipeline:e,targets:r,levels:i,options:n={},worker:o={},caller:a=F7()}=t,c=typeof a=="string"?[a]:a,d="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},p=t.target;if(p&&r)throw new Error("only one of target or targets can be specified");return r?(p=d["pino-worker"]||qh(__dirname,"worker.js"),n.targets=r.map(v=>({...v,target:m(v.target)}))):e&&(p=d["pino-pipeline-worker"]||qh(__dirname,"worker-pipeline.js"),n.targets=e.map(v=>({...v,target:m(v.target)}))),i&&(n.levels=i),U7(m(p),n,o);function m(v){if(v=d[v]||v,$7(v)||v.indexOf("file://")===0)return v;if(v==="pino/file")return qh(__dirname,"..","file.js");let x;for(let w of c)try{x=j7(w).resolve(v);break}catch{continue}if(!x)throw new Error(`unable to determine transport target for "${v}"`);return x}}J5.exports=K7});var bu=G((vT,am)=>{"use strict";var Z5=Ih(),{mapHttpRequest:J7,mapHttpResponse:Z7}=f1(),Uh=Nh(),Y5=h1(),{lsCacheSym:Y7,chindingsSym:tm,writeSym:X5,serializersSym:rm,formatOptsSym:Q5,endSym:X7,stringifiersSym:im,stringifySym:nm,stringifySafeSym:Gh,wildcardFirstSym:sm,nestedKeySym:Q7,formattersSym:om,messageKeySym:eb,nestedKeyStrSym:tb}=xo(),{isMainThread:rb}=require("worker_threads"),ib=Wh();function Eo(){}function nb(t,e){if(!e)return r;return function(...n){e.call(this,n,r,t)};function r(i,...n){if(typeof i=="object"){let o=i;i!==null&&(i.method&&i.headers&&i.socket?i=J7(i):typeof i.setHeader=="function"&&(i=Z7(i)));let a;o===null&&n.length===0?a=[null]:(o=n.shift(),a=n),this[X5](i,Z5(o,a,this[Q5]),t)}else this[X5](null,Z5(i===void 0?n.shift():i,n,this[Q5]),t)}}function em(t){let e="",r=0,i=!1,n=255,o=t.length;if(o>100)return JSON.stringify(t);for(var a=0;a<o&&n>=32;a++)n=t.charCodeAt(a),(n===34||n===92)&&(e+=t.slice(r,a)+"\\",r=a,i=!0);return i?e+=t.slice(r):e=t,n<32?JSON.stringify(t):'"'+e+'"'}function sb(t,e,r,i){let n=this[nm],o=this[Gh],a=this[im],c=this[X7],d=this[tm],p=this[rm],m=this[om],v=this[eb],x=this[Y7][r]+i;x=x+d;let w;m.log&&(t=m.log(t));let b=a[sm],E="";for(let C in t)if(w=t[C],Object.prototype.hasOwnProperty.call(t,C)&&w!==void 0){w=p[C]?p[C](w):w;let P=a[C]||b;switch(typeof w){case"undefined":case"function":continue;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":P&&(w=P(w));break;case"string":w=(P||em)(w);break;default:w=(P||n)(w,o)}if(w===void 0)continue;E+=',"'+C+'":'+w}let A="";if(e!==void 0){w=p[v]?p[v](e):e;let C=a[v]||b;switch(typeof w){case"function":break;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":C&&(w=C(w)),A=',"'+v+'":'+w;break;case"string":w=(C||em)(w),A=',"'+v+'":'+w;break;default:w=(C||n)(w,o),A=',"'+v+'":'+w}}return this[Q7]&&E?x+this[tb]+E.slice(1)+"}"+A+c:x+E+A+c}function ob(t,e){let r,i=t[tm],n=t[nm],o=t[Gh],a=t[im],c=a[sm],d=t[rm],p=t[om].bindings;e=p(e);for(let m in e)if(r=e[m],(m!=="level"&&m!=="serializers"&&m!=="formatters"&&m!=="customLevels"&&e.hasOwnProperty(m)&&r!==void 0)===!0){if(r=d[m]?d[m](r):r,r=(a[m]||c||n)(r,o),r===void 0)continue;i+=',"'+m+'":'+r}return i}function ab(t){return t.write!==t.constructor.prototype.write}function yu(t){let e=new Uh(t);return e.on("error",r),!t.sync&&rb&&(Y5.register(e,lb),e.on("close",function(){Y5.unregister(e)})),e;function r(i){if(i.code==="EPIPE"){e.write=Eo,e.end=Eo,e.flushSync=Eo,e.destroy=Eo;return}e.removeListener("error",r),e.emit("error",i)}}function lb(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function ub(t){return function(r,i,n={},o){if(typeof n=="string")o=yu({dest:n}),n={};else if(typeof o=="string"){if(n&&n.transport)throw Error("only one of option.transport or stream can be specified");o=yu({dest:o})}else if(n instanceof Uh||n.writable||n._writableState)o=n,n={};else if(n.transport){if(n.transport instanceof Uh||n.transport.writable||n.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(n.transport.targets&&n.transport.targets.length&&n.formatters&&typeof n.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let d;n.customLevels&&(d=n.useOnlyCustomLevels?n.customLevels:Object.assign({},n.levels,n.customLevels)),o=ib({caller:i,...n.transport,levels:d})}if(n=Object.assign({},t,n),n.serializers=Object.assign({},t.serializers,n.serializers),n.formatters=Object.assign({},t.formatters,n.formatters),n.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:a,onChild:c}=n;return a===!1&&(n.level="silent"),c||(n.onChild=Eo),o||(ab(process.stdout)?o=process.stdout:o=yu({fd:process.stdout.fd||1})),{opts:n,stream:o}}}function cb(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Gh])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function fb(t,e,r){return{level:t,bindings:e,log:r}}function hb(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}am.exports={noop:Eo,buildSafeSonicBoom:yu,asChindings:ob,asJson:sb,genLog:nb,createArgsNormalizer:ub,stringify:cb,buildFormatters:fb,normalizeDestFileDescriptor:hb}});var vu=G((wT,um)=>{"use strict";var{lsCacheSym:db,levelValSym:Vh,useOnlyCustomLevelsSym:mb,streamSym:pb,formattersSym:gb,hooksSym:yb}=xo(),{noop:bb,genLog:ns}=bu(),Fr={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},lm={fatal:t=>{let e=ns(Fr.fatal,t);return function(...r){let i=this[pb];if(e.call(this,...r),typeof i.flushSync=="function")try{i.flushSync()}catch{}}},error:t=>ns(Fr.error,t),warn:t=>ns(Fr.warn,t),info:t=>ns(Fr.info,t),debug:t=>ns(Fr.debug,t),trace:t=>ns(Fr.trace,t)},Kh=Object.keys(Fr).reduce((t,e)=>(t[Fr[e]]=e,t),{}),vb=Object.keys(Kh).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function wb(t){let e=t[gb].level,{labels:r}=t.levels,i={};for(let n in r){let o=e(r[n],Number(n));i[n]=JSON.stringify(o).slice(0,-1)}return t[db]=i,t}function _b(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function Sb(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let i=this[Vh],n=this[Vh]=r[t],o=this[mb],a=this[yb].logMethod;for(let c in r){if(n>r[c]){this[c]=bb;continue}this[c]=_b(c,o)?lm[c](a):ns(r[c],a)}this.emit("level-change",t,n,e[i],i)}function xb(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function Mb(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[Vh]}function Eb(t=null,e=!1){let r=t?Object.keys(t).reduce((o,a)=>(o[t[a]]=a,o),{}):null,i=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Kh,r),n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Fr,t);return{labels:i,values:n}}function Rb(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(o=>e[o]),r?[]:Object.keys(Kh).map(o=>+o),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Fr,e);if(!(t in i))throw Error(`default level:${t} must be included in custom levels`)}function Cb(t,e){let{labels:r,values:i}=t;for(let n in e){if(n in i)throw Error("levels cannot be overridden");if(e[n]in r)throw Error("pre-existing level values cannot be used for new levels")}}um.exports={initialLsCache:vb,genLsCache:wb,levelMethods:lm,getLevel:xb,setLevel:Sb,isLevelEnabled:Mb,mappings:Eb,levels:Fr,assertNoLevelCollisions:Cb,assertDefaultLevelFound:Rb}});var Jh=G((_T,cm)=>{"use strict";cm.exports={version:"8.6.1"}});var wm=G((xT,vm)=>{"use strict";var{EventEmitter:Ab}=require("events"),{lsCacheSym:Tb,levelValSym:Pb,setLevelSym:Yh,getLevelSym:fm,chindingsSym:Xh,parsedChindingsSym:Ob,mixinSym:Ib,asJsonSym:pm,writeSym:Lb,mixinMergeStrategySym:kb,timeSym:Nb,timeSliceIndexSym:Bb,streamSym:gm,serializersSym:ss,formattersSym:Zh,errorKeySym:Db,useOnlyCustomLevelsSym:zb,needsMetadataGsym:jb,redactFmtSym:Fb,stringifySym:$b,formatOptsSym:qb,stringifiersSym:Hb}=xo(),{getLevel:Wb,setLevel:Ub,isLevelEnabled:Gb,mappings:Vb,initialLsCache:Kb,genLsCache:Jb,assertNoLevelCollisions:Zb}=vu(),{asChindings:ym,asJson:Yb,buildFormatters:hm,stringify:dm}=bu(),{version:Xb}=Jh(),Qb=Oh(),ev=class{},bm={constructor:ev,child:tv,bindings:rv,setBindings:iv,flush:av,isLevelEnabled:Gb,version:Xb,get level(){return this[fm]()},set level(t){this[Yh](t)},get levelVal(){return this[Pb]},set levelVal(t){throw Error("levelVal is read-only")},[Tb]:Kb,[Lb]:sv,[pm]:Yb,[fm]:Wb,[Yh]:Ub};Object.setPrototypeOf(bm,Ab.prototype);vm.exports=function(){return Object.create(bm)};var mm=t=>t;function tv(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[ss],i=this[Zh],n=Object.create(this);if(e.hasOwnProperty("serializers")===!0){n[ss]=Object.create(null);for(let m in r)n[ss][m]=r[m];let d=Object.getOwnPropertySymbols(r);for(var o=0;o<d.length;o++){let m=d[o];n[ss][m]=r[m]}for(let m in e.serializers)n[ss][m]=e.serializers[m];let p=Object.getOwnPropertySymbols(e.serializers);for(var a=0;a<p.length;a++){let m=p[a];n[ss][m]=e.serializers[m]}}else n[ss]=r;if(e.hasOwnProperty("formatters")){let{level:d,bindings:p,log:m}=e.formatters;n[Zh]=hm(d||i.level,p||mm,m||i.log)}else n[Zh]=hm(i.level,mm,i.log);if(e.hasOwnProperty("customLevels")===!0&&(Zb(this.levels,e.customLevels),n.levels=Vb(e.customLevels,n[zb]),Jb(n)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){n.redact=e.redact;let d=Qb(n.redact,dm),p={stringify:d[Fb]};n[$b]=dm,n[Hb]=d,n[qb]=p}n[Xh]=ym(n,t);let c=e.level||this.level;return n[Yh](c),this.onChild(n),n}function rv(){let e=`{${this[Xh].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function iv(t){let e=ym(this,t);this[Xh]=e,delete this[Ob]}function nv(t,e){return Object.assign(e,t)}function sv(t,e,r){let i=this[Nb](),n=this[Ib],o=this[Db],a=this[kb]||nv,c;t==null?c={}:t instanceof Error?(c={[o]:t},e===void 0&&(e=t.message)):(c=t,e===void 0&&t[o]&&(e=t[o].message)),n&&(c=a(c,n(c,r)));let d=this[pm](c,e,r,i),p=this[gm];p[jb]===!0&&(p.lastLevel=r,p.lastObj=c,p.lastMsg=e,p.lastTime=i.slice(this[Bb]),p.lastLogger=this),p.write(d)}function ov(){}function av(){let t=this[gm];"flush"in t&&t.flush(ov)}});var s0=G((n0,xm)=>{"use strict";var as=i0();as.configure=i0;as.stringify=as;as.default=as;n0.stringify=as;n0.configure=i0;xm.exports=as;var lv=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/,uv=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/g,r0=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\"];function cv(t){if(t.length===2){let r=t.charCodeAt(1);return`${t[0]}\\u${r.toString(16)}`}let e=t.charCodeAt(0);return r0.length>e?r0[e]:`\\u${e.toString(16)}`}function fn(t){if(t.length<5e3&&!lv.test(t))return t;if(t.length>100)return t.replace(uv,cv);let e="",r=0;for(let i=0;i<t.length;i++){let n=t.charCodeAt(i);if(n===34||n===92||n<32)e+=`${t.slice(r,i)}${r0[n]}`,r=i+1;else if(n>=55296&&n<=57343){if(n<=56319&&i+1<t.length){let o=t.charCodeAt(i+1);if(o>=56320&&o<=57343){i++;continue}}e+=`${t.slice(r,i)}${`\\u${n.toString(16)}`}`,r=i+1}}return e+=t.slice(r),e}function Qh(t){if(t.length>200)return t.sort();for(let e=1;e<t.length;e++){let r=t[e],i=e;for(;i!==0&&t[i-1]>r;)t[i]=t[i-1],i--;t[i]=r}return t}var fv=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Uint8Array)),Symbol.toStringTag).get;function e0(t){return fv.call(t)!==void 0&&t.length!==0}function t0(t,e,r){t.length<r&&(r=t.length);let i=e===","?"":" ",n=`"0":${i}${t[0]}`;for(let o=1;o<r;o++)n+=`${e}"${o}":${i}${t[o]}`;return n}function hv(t){if(t&&Object.prototype.hasOwnProperty.call(t,"circularValue")){var e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function _m(t,e){if(t&&Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(typeof r!="boolean")throw new TypeError(`The "${e}" argument must be of type boolean`)}return r===void 0?!0:r}function Sm(t,e){if(t&&Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function os(t){return t===1?"1 item":`${t} items`}function dv(t){let e=new Set;for(let r of t)typeof r=="string"?e.add(r):typeof r=="number"&&e.add(String(r));return e}function i0(t){let e=hv(t),r=_m(t,"bigint"),i=_m(t,"deterministic"),n=Sm(t,"maximumDepth"),o=Sm(t,"maximumBreadth");function a(v,x,w,b,E,A){let C=x[v];switch(typeof C=="object"&&C!==null&&typeof C.toJSON=="function"&&(C=C.toJSON(v)),C=b.call(x,v,C),typeof C){case"string":return`"${fn(C)}"`;case"object":{if(C===null)return"null";if(w.indexOf(C)!==-1)return e;let P="",L=",",k=A;if(Array.isArray(C)){if(C.length===0)return"[]";if(n<w.length+1)return'"[Array]"';w.push(C),E!==""&&(A+=E,P+=`
|
|
75
|
-
${A}`,L=`,
|
|
76
|
-
${A}`);let De=Math.min(C.length,o),Me=0;for(;Me<De-1;Me++){let tt=a(Me,C,w,b,E,A);P+=tt!==void 0?tt:"null",P+=L}let ke=a(Me,C,w,b,E,A);if(P+=ke!==void 0?ke:"null",C.length-1>o){let tt=C.length-o-1;P+=`${L}"... ${os(tt)} not stringified"`}return E!==""&&(P+=`
|
|
77
|
-
${k}`),w.pop(),`[${P}]`}let z=Object.keys(C),U=z.length;if(U===0)return"{}";if(n<w.length+1)return'"[Object]"';let Z="",ie="";E!==""&&(A+=E,L=`,
|
|
78
|
-
${A}`,Z=" ");let ge=Math.min(U,o);e0(C)&&(P+=t0(C,L,o),z=z.slice(C.length),ge-=C.length,ie=L),i&&(z=Qh(z)),w.push(C);for(let De=0;De<ge;De++){let Me=z[De],ke=a(Me,C,w,b,E,A);ke!==void 0&&(P+=`${ie}"${fn(Me)}":${Z}${ke}`,ie=L)}if(U>o){let De=U-o;P+=`${ie}"...":${Z}"${os(De)} not stringified"`,ie=L}return E!==""&&ie.length>1&&(P=`
|
|
79
|
-
${A}${P}
|
|
80
|
-
${k}`),w.pop(),`{${P}}`}case"number":return isFinite(C)?String(C):"null";case"boolean":return C===!0?"true":"false";case"bigint":return r?String(C):void 0}}function c(v,x,w,b,E,A){switch(typeof x=="object"&&x!==null&&typeof x.toJSON=="function"&&(x=x.toJSON(v)),typeof x){case"string":return`"${fn(x)}"`;case"object":{if(x===null)return"null";if(w.indexOf(x)!==-1)return e;let C=A,P="",L=",";if(Array.isArray(x)){if(x.length===0)return"[]";if(n<w.length+1)return'"[Array]"';w.push(x),E!==""&&(A+=E,P+=`
|
|
81
|
-
${A}`,L=`,
|
|
82
|
-
${A}`);let U=Math.min(x.length,o),Z=0;for(;Z<U-1;Z++){let ge=c(Z,x[Z],w,b,E,A);P+=ge!==void 0?ge:"null",P+=L}let ie=c(Z,x[Z],w,b,E,A);if(P+=ie!==void 0?ie:"null",x.length-1>o){let ge=x.length-o-1;P+=`${L}"... ${os(ge)} not stringified"`}return E!==""&&(P+=`
|
|
83
|
-
${C}`),w.pop(),`[${P}]`}if(b.size===0)return"{}";w.push(x);let k="";E!==""&&(A+=E,L=`,
|
|
84
|
-
${A}`,k=" ");let z="";for(let U of b){let Z=c(U,x[U],w,b,E,A);Z!==void 0&&(P+=`${z}"${fn(U)}":${k}${Z}`,z=L)}return E!==""&&z.length>1&&(P=`
|
|
85
|
-
${A}${P}
|
|
86
|
-
${C}`),w.pop(),`{${P}}`}case"number":return isFinite(x)?String(x):"null";case"boolean":return x===!0?"true":"false";case"bigint":return r?String(x):void 0}}function d(v,x,w,b,E){switch(typeof x){case"string":return`"${fn(x)}"`;case"object":{if(x===null)return"null";if(typeof x.toJSON=="function"){if(x=x.toJSON(v),typeof x!="object")return d(v,x,w,b,E);if(x===null)return"null"}if(w.indexOf(x)!==-1)return e;let A=E;if(Array.isArray(x)){if(x.length===0)return"[]";if(n<w.length+1)return'"[Array]"';w.push(x),E+=b;let Z=`
|
|
87
|
-
${E}`,ie=`,
|
|
88
|
-
${E}`,ge=Math.min(x.length,o),De=0;for(;De<ge-1;De++){let ke=d(De,x[De],w,b,E);Z+=ke!==void 0?ke:"null",Z+=ie}let Me=d(De,x[De],w,b,E);if(Z+=Me!==void 0?Me:"null",x.length-1>o){let ke=x.length-o-1;Z+=`${ie}"... ${os(ke)} not stringified"`}return Z+=`
|
|
89
|
-
${A}`,w.pop(),`[${Z}]`}let C=Object.keys(x),P=C.length;if(P===0)return"{}";if(n<w.length+1)return'"[Object]"';E+=b;let L=`,
|
|
90
|
-
${E}`,k="",z="",U=Math.min(P,o);e0(x)&&(k+=t0(x,L,o),C=C.slice(x.length),U-=x.length,z=L),i&&(C=Qh(C)),w.push(x);for(let Z=0;Z<U;Z++){let ie=C[Z],ge=d(ie,x[ie],w,b,E);ge!==void 0&&(k+=`${z}"${fn(ie)}": ${ge}`,z=L)}if(P>o){let Z=P-o;k+=`${z}"...": "${os(Z)} not stringified"`,z=L}return z!==""&&(k=`
|
|
91
|
-
${E}${k}
|
|
92
|
-
${A}`),w.pop(),`{${k}}`}case"number":return isFinite(x)?String(x):"null";case"boolean":return x===!0?"true":"false";case"bigint":return r?String(x):void 0}}function p(v,x,w){switch(typeof x){case"string":return`"${fn(x)}"`;case"object":{if(x===null)return"null";if(typeof x.toJSON=="function"){if(x=x.toJSON(v),typeof x!="object")return p(v,x,w);if(x===null)return"null"}if(w.indexOf(x)!==-1)return e;let b="";if(Array.isArray(x)){if(x.length===0)return"[]";if(n<w.length+1)return'"[Array]"';w.push(x);let L=Math.min(x.length,o),k=0;for(;k<L-1;k++){let U=p(k,x[k],w);b+=U!==void 0?U:"null",b+=","}let z=p(k,x[k],w);if(b+=z!==void 0?z:"null",x.length-1>o){let U=x.length-o-1;b+=`,"... ${os(U)} not stringified"`}return w.pop(),`[${b}]`}let E=Object.keys(x),A=E.length;if(A===0)return"{}";if(n<w.length+1)return'"[Object]"';let C="",P=Math.min(A,o);e0(x)&&(b+=t0(x,",",o),E=E.slice(x.length),P-=x.length,C=","),i&&(E=Qh(E)),w.push(x);for(let L=0;L<P;L++){let k=E[L],z=p(k,x[k],w);z!==void 0&&(b+=`${C}"${fn(k)}":${z}`,C=",")}if(A>o){let L=A-o;b+=`${C}"...":"${os(L)} not stringified"`}return w.pop(),`{${b}}`}case"number":return isFinite(x)?String(x):"null";case"boolean":return x===!0?"true":"false";case"bigint":return r?String(x):void 0}}function m(v,x,w){if(arguments.length>1){let b="";if(typeof w=="number"?b=" ".repeat(Math.min(w,10)):typeof w=="string"&&(b=w.slice(0,10)),x!=null){if(typeof x=="function")return a("",{"":v},[],x,b,"");if(Array.isArray(x))return c("",v,[],dv(x),b,"")}if(b.length!==0)return d("",v,[],b,"")}return p("",v,[])}return m}});var Cm=G((MT,Rm)=>{"use strict";var o0=Symbol.for("pino.metadata"),{levels:Mm}=vu(),Em=Object.create(Mm);Em.silent=1/0;var mv=Mm.info;function pv(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let i=Em;e.levels&&typeof e.levels=="object"&&(i=e.levels);let n={write:o,add:c,flushSync:a,end:d,minLevel:0,streams:[],clone:p,[o0]:!0};return Array.isArray(t)?t.forEach(c,n):c.call(n,t),t=null,n;function o(m){let v,x=this.lastLevel,{streams:w}=this,b=0,E;for(let A=yv(w.length,e.dedupe);vv(A,w.length,e.dedupe);A=bv(A,e.dedupe))if(v=w[A],v.level<=x){if(b!==0&&b!==v.level)break;if(E=v.stream,E[o0]){let{lastTime:C,lastMsg:P,lastObj:L,lastLogger:k}=this;E.lastLevel=x,E.lastTime=C,E.lastMsg=P,E.lastObj=L,E.lastLogger=k}E.write(m),e.dedupe&&(b=v.level)}else if(!e.dedupe)break}function a(){for(let{stream:m}of this.streams)typeof m.flushSync=="function"&&m.flushSync()}function c(m){if(!m)return n;let v=typeof m.write=="function"||m.stream,x=m.write?m:m.stream;if(!v)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:w}=this,b;typeof m.levelVal=="number"?b=m.levelVal:typeof m.level=="string"?b=i[m.level]:typeof m.level=="number"?b=m.level:b=mv;let E={stream:x,level:b,levelVal:void 0,id:r++};return w.unshift(E),w.sort(gv),this.minLevel=w[0].level,n}function d(){for(let{stream:m}of this.streams)typeof m.flushSync=="function"&&m.flushSync(),m.end()}function p(m){let v=new Array(this.streams.length);for(let x=0;x<v.length;x++)v[x]={level:m,stream:this.streams[x].stream};return{write:o,add:c,minLevel:m,streams:v,clone:p,flushSync:a,[o0]:!0}}}function gv(t,e){return t.level-e.level}function yv(t,e){return e?t-1:0}function bv(t,e){return e?t-1:t+1}function vv(t,e,r){return r?t>=0:t<e}Rm.exports=pv});var Fm=G((ET,br)=>{"use strict";var wv=require("os"),Nm=f1(),_v=Mh(),Sv=Oh(),Bm=T5(),xv=wm(),Dm=xo(),{configure:Mv}=s0(),{assertDefaultLevelFound:Ev,mappings:zm,genLsCache:Rv,levels:Cv}=vu(),{createArgsNormalizer:Av,asChindings:Tv,buildSafeSonicBoom:Am,buildFormatters:Pv,stringify:wu,normalizeDestFileDescriptor:Tm,noop:Ov}=bu(),{version:Iv}=Jh(),{chindingsSym:Pm,redactFmtSym:Lv,serializersSym:Om,timeSym:kv,timeSliceIndexSym:Nv,streamSym:Bv,stringifySym:Im,stringifySafeSym:a0,stringifiersSym:Lm,setLevelSym:Dv,endSym:zv,formatOptsSym:jv,messageKeySym:Fv,errorKeySym:$v,nestedKeySym:qv,mixinSym:Hv,useOnlyCustomLevelsSym:Wv,formattersSym:km,hooksSym:Uv,nestedKeyStrSym:Gv,mixinMergeStrategySym:Vv}=Dm,{epochTime:jm,nullTime:Kv}=Bm,{pid:Jv}=process,Zv=wv.hostname(),Yv=Nm.err,Xv={level:"info",levels:Cv,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:Jv,hostname:Zv},serializers:Object.assign(Object.create(null),{err:Yv}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0},timestamp:jm,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Qv=Av(Xv),ew=Object.assign(Object.create(null),Nm);function l0(...t){let e={},{opts:r,stream:i}=Qv(e,_v(),...t),{redact:n,crlf:o,serializers:a,timestamp:c,messageKey:d,errorKey:p,nestedKey:m,base:v,name:x,level:w,customLevels:b,mixin:E,mixinMergeStrategy:A,useOnlyCustomLevels:C,formatters:P,hooks:L,depthLimit:k,edgeLimit:z,onChild:U}=r,Z=Mv({maximumDepth:k,maximumBreadth:z}),ie=Pv(P.level,P.bindings,P.log),ge=n?Sv(n,wu):{},De=wu.bind({[a0]:Z}),Me=n?{stringify:ge[Lv]}:{stringify:De},ke="}"+(o?`\r
|
|
93
|
-
`:`
|
|
94
|
-
`),tt=Tv.bind(null,{[Pm]:"",[Om]:a,[Lm]:ge,[Im]:wu,[a0]:Z,[km]:ie}),pt="";v!==null&&(x===void 0?pt=tt(v):pt=tt(Object.assign({},v,{name:x})));let dr=c instanceof Function?c:c?jm:Kv,Dn=dr().indexOf(":")+1;if(C&&!b)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(E&&typeof E!="function")throw Error(`Unknown mixin type "${typeof E}" - expected "function"`);Ev(w,b,C);let Pa=zm(b,C);return Object.assign(e,{levels:Pa,[Wv]:C,[Bv]:i,[kv]:dr,[Nv]:Dn,[Im]:wu,[a0]:Z,[Lm]:ge,[zv]:ke,[jv]:Me,[Fv]:d,[$v]:p,[qv]:m,[Gv]:m?`,${JSON.stringify(m)}:{`:"",[Om]:a,[Hv]:E,[Vv]:A,[Pm]:pt,[km]:ie,[Uv]:L,silent:Ov,onChild:U}),Object.setPrototypeOf(e,xv()),Rv(e),e[Dv](w),e}br.exports=l0;br.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Tm(t.dest||process.stdout.fd),Am(t)):Am({dest:Tm(t),minLength:0});br.exports.transport=Wh();br.exports.multistream=Cm();br.exports.levels=zm();br.exports.stdSerializers=ew;br.exports.stdTimeFunctions=Object.assign({},Bm);br.exports.symbols=Dm;br.exports.version=Iv;br.exports.default=l0;br.exports.pino=l0});var Wm=G((RT,d1)=>{"use strict";var tw=process.env.TERM_PROGRAM==="Hyper",rw=process.platform==="win32",$m=process.platform==="linux",u0={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},qm=Object.assign({},u0,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",question:"?",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),Hm=Object.assign({},u0,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",question:"?",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:$m?"\u25B8":"\u276F",pointerSmall:$m?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});d1.exports=rw&&!tw?qm:Hm;Reflect.defineProperty(d1.exports,"common",{enumerable:!1,value:u0});Reflect.defineProperty(d1.exports,"windows",{enumerable:!1,value:qm});Reflect.defineProperty(d1.exports,"other",{enumerable:!1,value:Hm})});var Gm=G((CT,c0)=>{"use strict";var iw=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),nw=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,Um=()=>{let t={enabled:!0,visible:!0,styles:{},keys:{}};"FORCE_COLOR"in process.env&&(t.enabled=process.env.FORCE_COLOR!=="0");let e=o=>{let a=o.open=`\x1B[${o.codes[0]}m`,c=o.close=`\x1B[${o.codes[1]}m`,d=o.regex=new RegExp(`\\u001b\\[${o.codes[1]}m`,"g");return o.wrap=(p,m)=>{p.includes(c)&&(p=p.replace(d,c+a));let v=a+p+c;return m?v.replace(/\r*\n/g,`${c}$&${a}`):v},o},r=(o,a,c)=>typeof o=="function"?o(a):o.wrap(a,c),i=(o,a)=>{if(o===""||o==null)return"";if(t.enabled===!1)return o;if(t.visible===!1)return"";let c=""+o,d=c.includes(`
|
|
95
|
-
`),p=a.length;for(p>0&&a.includes("unstyle")&&(a=[...new Set(["unstyle",...a])].reverse());p-- >0;)c=r(t.styles[a[p]],c,d);return c},n=(o,a,c)=>{t.styles[o]=e({name:o,codes:a}),(t.keys[c]||(t.keys[c]=[])).push(o),Reflect.defineProperty(t,o,{configurable:!0,enumerable:!0,set(p){t.alias(o,p)},get(){let p=m=>i(m,p.stack);return Reflect.setPrototypeOf(p,t),p.stack=this.stack?this.stack.concat(o):[o],p}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=nw,t.hasColor=t.hasAnsi=o=>(t.ansiRegex.lastIndex=0,typeof o=="string"&&o!==""&&t.ansiRegex.test(o)),t.alias=(o,a)=>{let c=typeof a=="string"?t[a]:a;if(typeof c!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");c.stack||(Reflect.defineProperty(c,"name",{value:o}),t.styles[o]=c,c.stack=[o]),Reflect.defineProperty(t,o,{configurable:!0,enumerable:!0,set(d){t.alias(o,d)},get(){let d=p=>i(p,d.stack);return Reflect.setPrototypeOf(d,t),d.stack=this.stack?this.stack.concat(c.stack):c.stack,d}})},t.theme=o=>{if(!iw(o))throw new TypeError("Expected theme to be an object");for(let a of Object.keys(o))t.alias(a,o[a]);return t},t.alias("unstyle",o=>typeof o=="string"&&o!==""?(t.ansiRegex.lastIndex=0,o.replace(t.ansiRegex,"")):""),t.alias("noop",o=>o),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=Wm(),t.define=n,t};c0.exports=Um();c0.exports.create=Um});var f0=G((TT,Vm)=>{Vm.exports=require("stream")});var Ym=G((PT,Zm)=>{"use strict";function Km(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function ow(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Km(Object(r),!0).forEach(function(i){aw(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Km(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function aw(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jm(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function uw(t,e,r){return e&&Jm(t.prototype,e),r&&Jm(t,r),t}var cw=require("buffer"),_u=cw.Buffer,fw=require("util"),h0=fw.inspect,hw=h0&&h0.custom||"inspect";function dw(t,e,r){_u.prototype.copy.call(t,e,r)}Zm.exports=function(){function t(){lw(this,t),this.head=null,this.tail=null,this.length=0}return uw(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return _u.alloc(0);for(var i=_u.allocUnsafe(r>>>0),n=this.head,o=0;n;)dw(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var a=i.data,c=r>a.length?a.length:r;if(c===a.length?o+=a:o+=a.slice(0,r),r-=c,r===0){c===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(c));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=_u.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var a=n.data,c=r>a.length?a.length:r;if(a.copy(i,i.length-r,0,c),r-=c,r===0){c===a.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(c));break}++o}return this.length-=o,i}},{key:hw,value:function(r,i){return h0(this,ow({},i,{depth:0,customInspect:!1}))}}]),t}()});var m0=G((OT,Qm)=>{"use strict";function mw(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(d0,this,t)):process.nextTick(d0,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Su,r):(r._writableState.errorEmitted=!0,process.nextTick(Xm,r,o)):process.nextTick(Xm,r,o):e?(process.nextTick(Su,r),e(o)):process.nextTick(Su,r)}),this)}function Xm(t,e){d0(t,e),Su(t)}function Su(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function pw(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function d0(t,e){t.emit("error",e)}function gw(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}Qm.exports={destroy:mw,undestroy:pw,errorOrDestroy:gw}});var hn=G((IT,rp)=>{"use strict";var tp={};function vr(t,e,r){r||(r=Error);function i(o,a,c){return typeof e=="string"?e:e(o,a,c)}class n extends r{constructor(a,c,d){super(i(a,c,d))}}n.prototype.name=r.name,n.prototype.code=t,tp[t]=n}function ep(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(i=>String(i)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function yw(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function bw(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function vw(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}vr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);vr("ERR_INVALID_ARG_TYPE",function(t,e,r){let i;typeof e=="string"&&yw(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(bw(t," argument"))n=`The ${t} ${i} ${ep(e,"type")}`;else{let o=vw(t,".")?"property":"argument";n=`The "${t}" ${o} ${i} ${ep(e,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);vr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");vr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});vr("ERR_STREAM_PREMATURE_CLOSE","Premature close");vr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});vr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");vr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");vr("ERR_STREAM_WRITE_AFTER_END","write after end");vr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);vr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);vr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");rp.exports.codes=tp});var p0=G((LT,ip)=>{"use strict";var ww=hn().codes.ERR_INVALID_OPT_VALUE;function _w(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Sw(t,e,r,i){var n=_w(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new ww(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}ip.exports={getHighWaterMark:Sw}});var np=G((kT,g0)=>{typeof Object.create=="function"?g0.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:g0.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var Ro=G((NT,b0)=>{try{if(y0=require("util"),typeof y0.inherits!="function")throw"";b0.exports=y0.inherits}catch{b0.exports=np()}var y0});var op=G((BT,sp)=>{sp.exports=require("util").deprecate});var _0=G((DT,hp)=>{"use strict";hp.exports=ot;function lp(t){var e=this;this.next=null,this.entry=null,this.finish=function(){Jw(e,t)}}var Co;ot.WritableState=p1;var xw={deprecate:op()},up=f0(),Mu=require("buffer").Buffer,Mw=global.Uint8Array||function(){};function Ew(t){return Mu.from(t)}function Rw(t){return Mu.isBuffer(t)||t instanceof Mw}var w0=m0(),Cw=p0(),Aw=Cw.getHighWaterMark,dn=hn().codes,Tw=dn.ERR_INVALID_ARG_TYPE,Pw=dn.ERR_METHOD_NOT_IMPLEMENTED,Ow=dn.ERR_MULTIPLE_CALLBACK,Iw=dn.ERR_STREAM_CANNOT_PIPE,Lw=dn.ERR_STREAM_DESTROYED,kw=dn.ERR_STREAM_NULL_VALUES,Nw=dn.ERR_STREAM_WRITE_AFTER_END,Bw=dn.ERR_UNKNOWN_ENCODING,Ao=w0.errorOrDestroy;Ro()(ot,up);function Dw(){}function p1(t,e,r){Co=Co||ls(),t=t||{},typeof r!="boolean"&&(r=e instanceof Co),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Aw(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){Ww(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new lp(this)}p1.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(p1.prototype,"buffer",{get:xw.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var xu;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(xu=Function.prototype[Symbol.hasInstance],Object.defineProperty(ot,Symbol.hasInstance,{value:function(e){return xu.call(this,e)?!0:this!==ot?!1:e&&e._writableState instanceof p1}})):xu=function(e){return e instanceof this};function ot(t){Co=Co||ls();var e=this instanceof Co;if(!e&&!xu.call(ot,this))return new ot(t);this._writableState=new p1(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),up.call(this)}ot.prototype.pipe=function(){Ao(this,new Iw)};function zw(t,e){var r=new Nw;Ao(t,r),process.nextTick(e,r)}function jw(t,e,r,i){var n;return r===null?n=new kw:typeof r!="string"&&!e.objectMode&&(n=new Tw("chunk",["string","Buffer"],r)),n?(Ao(t,n),process.nextTick(i,n),!1):!0}ot.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&Rw(t);return o&&!Mu.isBuffer(t)&&(t=Ew(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=Dw),i.ending?zw(this,r):(o||jw(this,i,t,r))&&(i.pendingcb++,n=$w(this,i,o,t,e,r)),n};ot.prototype.cork=function(){this._writableState.corked++};ot.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&cp(this,t))};ot.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new Bw(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(ot.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Fw(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Mu.from(e,r)),e}Object.defineProperty(ot.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $w(t,e,r,i,n,o){if(!r){var a=Fw(e,i,n);i!==a&&(r=!0,n="buffer",i=a)}var c=e.objectMode?1:i.length;e.length+=c;var d=e.length<e.highWaterMark;if(d||(e.needDrain=!0),e.writing||e.corked){var p=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},p?p.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else v0(t,e,!1,c,i,n,o);return d}function v0(t,e,r,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Lw("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function qw(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(m1,t,e),t._writableState.errorEmitted=!0,Ao(t,i)):(n(i),t._writableState.errorEmitted=!0,Ao(t,i),m1(t,e))}function Hw(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function Ww(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new Ow;if(Hw(r),e)qw(t,r,i,e,n);else{var o=fp(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&cp(t,r),i?process.nextTick(ap,t,r,o,n):ap(t,r,o,n)}}function ap(t,e,r,i){r||Uw(t,e),e.pendingcb--,i(),m1(t,e)}function Uw(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function cp(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)n[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;n.allBuffers=c,v0(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new lp(e),e.bufferedRequestCount=0}else{for(;r;){var d=r.chunk,p=r.encoding,m=r.callback,v=e.objectMode?1:d.length;if(v0(t,e,!1,v,d,p,m),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}ot.prototype._write=function(t,e,r){r(new Pw("_write()"))};ot.prototype._writev=null;ot.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||Kw(this,i,r),this};Object.defineProperty(ot.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function fp(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function Gw(t,e){t._final(function(r){e.pendingcb--,r&&Ao(t,r),e.prefinished=!0,t.emit("prefinish"),m1(t,e)})}function Vw(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(Gw,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function m1(t,e){var r=fp(e);if(r&&(Vw(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function Kw(t,e,r){e.ending=!0,m1(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function Jw(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(ot.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});ot.prototype.destroy=w0.destroy;ot.prototype._undestroy=w0.undestroy;ot.prototype._destroy=function(t,e){e(t)}});var ls=G((zT,mp)=>{"use strict";var Zw=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};mp.exports=si;var dp=M0(),x0=_0();Ro()(si,dp);for(S0=Zw(x0.prototype),Eu=0;Eu<S0.length;Eu++)Ru=S0[Eu],si.prototype[Ru]||(si.prototype[Ru]=x0.prototype[Ru]);var S0,Ru,Eu;function si(t){if(!(this instanceof si))return new si(t);dp.call(this,t),x0.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Yw)))}Object.defineProperty(si.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(si.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(si.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Yw(){this._writableState.ended||process.nextTick(Xw,this)}function Xw(t){t.end()}Object.defineProperty(si.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var yp=G((E0,gp)=>{var Cu=require("buffer"),oi=Cu.Buffer;function pp(t,e){for(var r in t)e[r]=t[r]}oi.from&&oi.alloc&&oi.allocUnsafe&&oi.allocUnsafeSlow?gp.exports=Cu:(pp(Cu,E0),E0.Buffer=us);function us(t,e,r){return oi(t,e,r)}us.prototype=Object.create(oi.prototype);pp(oi,us);us.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return oi(t,e,r)};us.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=oi(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};us.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return oi(t)};us.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Cu.SlowBuffer(t)}});var A0=G(vp=>{"use strict";var C0=yp().Buffer,bp=C0.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Qw(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function e_(t){var e=Qw(t);if(typeof e!="string"&&(C0.isEncoding===bp||!bp(t)))throw new Error("Unknown encoding: "+t);return e||t}vp.StringDecoder=g1;function g1(t){this.encoding=e_(t);var e;switch(this.encoding){case"utf16le":this.text=o_,this.end=a_,e=4;break;case"utf8":this.fillLast=i_,e=4;break;case"base64":this.text=l_,this.end=u_,e=3;break;default:this.write=c_,this.end=f_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=C0.allocUnsafe(e)}g1.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};g1.prototype.end=s_;g1.prototype.text=n_;g1.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function R0(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function t_(t,e,r){var i=e.length-1;if(i<r)return 0;var n=R0(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=R0(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=R0(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function r_(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function i_(t){var e=this.lastTotal-this.lastNeed,r=r_(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function n_(t,e){var r=t_(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function s_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function o_(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function a_(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l_(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c_(t){return t.toString(this.encoding)}function f_(t){return t&&t.length?this.write(t):""}});var Au=G((FT,Sp)=>{"use strict";var wp=hn().codes.ERR_STREAM_PREMATURE_CLOSE;function h_(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function d_(){}function m_(t){return t.setHeader&&typeof t.abort=="function"}function _p(t,e,r){if(typeof e=="function")return _p(t,null,e);e||(e={}),r=h_(r||d_);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||c()},a=t._writableState&&t._writableState.finished,c=function(){n=!1,a=!0,i||r.call(t)},d=t._readableState&&t._readableState.endEmitted,p=function(){i=!1,d=!0,n||r.call(t)},m=function(b){r.call(t,b)},v=function(){var b;if(i&&!d)return(!t._readableState||!t._readableState.ended)&&(b=new wp),r.call(t,b);if(n&&!a)return(!t._writableState||!t._writableState.ended)&&(b=new wp),r.call(t,b)},x=function(){t.req.on("finish",c)};return m_(t)?(t.on("complete",c),t.on("abort",v),t.req?x():t.on("request",x)):n&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",p),t.on("finish",c),e.error!==!1&&t.on("error",m),t.on("close",v),function(){t.removeListener("complete",c),t.removeListener("abort",v),t.removeListener("request",x),t.req&&t.req.removeListener("finish",c),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",c),t.removeListener("end",p),t.removeListener("error",m),t.removeListener("close",v)}}Sp.exports=_p});var Mp=G(($T,xp)=>{"use strict";var Tu;function mn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p_=Au(),pn=Symbol("lastResolve"),cs=Symbol("lastReject"),y1=Symbol("error"),Pu=Symbol("ended"),fs=Symbol("lastPromise"),T0=Symbol("handlePromise"),hs=Symbol("stream");function gn(t,e){return{value:t,done:e}}function g_(t){var e=t[pn];if(e!==null){var r=t[hs].read();r!==null&&(t[fs]=null,t[pn]=null,t[cs]=null,e(gn(r,!1)))}}function y_(t){process.nextTick(g_,t)}function b_(t,e){return function(r,i){t.then(function(){if(e[Pu]){r(gn(void 0,!0));return}e[T0](r,i)},i)}}var v_=Object.getPrototypeOf(function(){}),w_=Object.setPrototypeOf((Tu={get stream(){return this[hs]},next:function(){var e=this,r=this[y1];if(r!==null)return Promise.reject(r);if(this[Pu])return Promise.resolve(gn(void 0,!0));if(this[hs].destroyed)return new Promise(function(a,c){process.nextTick(function(){e[y1]?c(e[y1]):a(gn(void 0,!0))})});var i=this[fs],n;if(i)n=new Promise(b_(i,this));else{var o=this[hs].read();if(o!==null)return Promise.resolve(gn(o,!1));n=new Promise(this[T0])}return this[fs]=n,n}},mn(Tu,Symbol.asyncIterator,function(){return this}),mn(Tu,"return",function(){var e=this;return new Promise(function(r,i){e[hs].destroy(null,function(n){if(n){i(n);return}r(gn(void 0,!0))})})}),Tu),v_),__=function(e){var r,i=Object.create(w_,(r={},mn(r,hs,{value:e,writable:!0}),mn(r,pn,{value:null,writable:!0}),mn(r,cs,{value:null,writable:!0}),mn(r,y1,{value:null,writable:!0}),mn(r,Pu,{value:e._readableState.endEmitted,writable:!0}),mn(r,T0,{value:function(o,a){var c=i[hs].read();c?(i[fs]=null,i[pn]=null,i[cs]=null,o(gn(c,!1))):(i[pn]=o,i[cs]=a)},writable:!0}),r));return i[fs]=null,p_(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[cs];o!==null&&(i[fs]=null,i[pn]=null,i[cs]=null,o(n)),i[y1]=n;return}var a=i[pn];a!==null&&(i[fs]=null,i[pn]=null,i[cs]=null,a(gn(void 0,!0))),i[Pu]=!0}),e.on("readable",y_.bind(null,i)),i};xp.exports=__});var Ap=G((qT,Cp)=>{"use strict";function Ep(t,e,r,i,n,o,a){try{var c=t[o](a),d=c.value}catch(p){r(p);return}c.done?e(d):Promise.resolve(d).then(i,n)}function S_(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function a(d){Ep(o,i,n,a,c,"next",d)}function c(d){Ep(o,i,n,a,c,"throw",d)}a(void 0)})}}function Rp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function x_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Rp(Object(r),!0).forEach(function(i){M_(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rp(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function M_(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var E_=hn().codes.ERR_INVALID_ARG_TYPE;function R_(t,e,r){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new E_("iterable",["Iterable"],e);var n=new t(x_({objectMode:!0},r)),o=!1;n._read=function(){o||(o=!0,a())};function a(){return c.apply(this,arguments)}function c(){return c=S_(function*(){try{var d=yield i.next(),p=d.value,m=d.done;m?n.push(null):n.push(yield p)?a():o=!1}catch(v){n.destroy(v)}}),c.apply(this,arguments)}return n}Cp.exports=R_});var M0=G((WT,zp)=>{"use strict";zp.exports=Oe;var To;Oe.ReadableState=Ip;var HT=require("events").EventEmitter,Op=function(e,r){return e.listeners(r).length},v1=f0(),Ou=require("buffer").Buffer,C_=global.Uint8Array||function(){};function A_(t){return Ou.from(t)}function T_(t){return Ou.isBuffer(t)||t instanceof C_}var P0=require("util"),ve;P0&&P0.debuglog?ve=P0.debuglog("stream"):ve=function(){};var P_=Ym(),D0=m0(),O_=p0(),I_=O_.getHighWaterMark,Iu=hn().codes,L_=Iu.ERR_INVALID_ARG_TYPE,k_=Iu.ERR_STREAM_PUSH_AFTER_EOF,N_=Iu.ERR_METHOD_NOT_IMPLEMENTED,B_=Iu.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Po,O0,I0;Ro()(Oe,v1);var b1=D0.errorOrDestroy,L0=["error","close","destroy","pause","resume"];function D_(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Ip(t,e,r){To=To||ls(),t=t||{},typeof r!="boolean"&&(r=e instanceof To),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=I_(this,t,"readableHighWaterMark",r),this.buffer=new P_,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Po||(Po=A0().StringDecoder),this.decoder=new Po(t.encoding),this.encoding=t.encoding)}function Oe(t){if(To=To||ls(),!(this instanceof Oe))return new Oe(t);var e=this instanceof To;this._readableState=new Ip(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),v1.call(this)}Object.defineProperty(Oe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});Oe.prototype.destroy=D0.destroy;Oe.prototype._undestroy=D0.undestroy;Oe.prototype._destroy=function(t,e){e(t)};Oe.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Ou.from(t,e),e=""),i=!0),Lp(this,t,e,!1,i)};Oe.prototype.unshift=function(t){return Lp(this,t,null,!0,!1)};function Lp(t,e,r,i,n){ve("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,F_(t,o);else{var a;if(n||(a=z_(o,e)),a)b1(t,a);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Ou.prototype&&(e=A_(e)),i)o.endEmitted?b1(t,new B_):k0(t,o,e,!0);else if(o.ended)b1(t,new k_);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?k0(t,o,e,!1):B0(t,o)):k0(t,o,e,!1)}else i||(o.reading=!1,B0(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function k0(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Lu(t)),B0(t,e)}function z_(t,e){var r;return!T_(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new L_("chunk",["string","Buffer","Uint8Array"],e)),r}Oe.prototype.isPaused=function(){return this._readableState.flowing===!1};Oe.prototype.setEncoding=function(t){Po||(Po=A0().StringDecoder);var e=new Po(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var Tp=1073741824;function j_(t){return t>=Tp?t=Tp:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Pp(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=j_(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Oe.prototype.read=function(t){ve("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ve("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?N0(this):Lu(this),null;if(t=Pp(t,e),t===0&&e.ended)return e.length===0&&N0(this),null;var i=e.needReadable;ve("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,ve("length less than watermark",i)),e.ended||e.reading?(i=!1,ve("reading or ended",i)):i&&(ve("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Pp(r,e)));var n;return t>0?n=Bp(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&N0(this)),n!==null&&this.emit("data",n),n};function F_(t,e){if(ve("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Lu(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,kp(t)))}}function Lu(t){var e=t._readableState;ve("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ve("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(kp,t))}function kp(t){var e=t._readableState;ve("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,z0(t)}function B0(t,e){e.readingMore||(e.readingMore=!0,process.nextTick($_,t,e))}function $_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ve("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}Oe.prototype._read=function(t){b1(this,new N_("_read()"))};Oe.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,ve("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=n?c:E;i.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(A,C){ve("onunpipe"),A===r&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,m())}function c(){ve("onend"),t.end()}var d=q_(r);t.on("drain",d);var p=!1;function m(){ve("cleanup"),t.removeListener("close",w),t.removeListener("finish",b),t.removeListener("drain",d),t.removeListener("error",x),t.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",E),r.removeListener("data",v),p=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&d()}r.on("data",v);function v(A){ve("ondata");var C=t.write(A);ve("dest.write",C),C===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&Dp(i.pipes,t)!==-1)&&!p&&(ve("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function x(A){ve("onerror",A),E(),t.removeListener("error",x),Op(t,"error")===0&&b1(t,A)}D_(t,"error",x);function w(){t.removeListener("finish",b),E()}t.once("close",w);function b(){ve("onfinish"),t.removeListener("close",w),E()}t.once("finish",b);function E(){ve("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(ve("pipe resume"),r.resume()),t};function q_(t){return function(){var r=t._readableState;ve("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Op(t,"data")&&(r.flowing=!0,z0(t))}}Oe.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=Dp(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Oe.prototype.on=function(t,e){var r=v1.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,ve("on readable",i.length,i.reading),i.length?Lu(this):i.reading||process.nextTick(H_,this)),r};Oe.prototype.addListener=Oe.prototype.on;Oe.prototype.removeListener=function(t,e){var r=v1.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Np,this),r};Oe.prototype.removeAllListeners=function(t){var e=v1.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Np,this),e};function Np(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function H_(t){ve("readable nexttick read 0"),t.read(0)}Oe.prototype.resume=function(){var t=this._readableState;return t.flowing||(ve("resume"),t.flowing=!t.readableListening,W_(this,t)),t.paused=!1,this};function W_(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(U_,t,e))}function U_(t,e){ve("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),z0(t),e.flowing&&!e.reading&&t.read(0)}Oe.prototype.pause=function(){return ve("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ve("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function z0(t){var e=t._readableState;for(ve("flow",e.flowing);e.flowing&&t.read()!==null;);}Oe.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(ve("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(ve("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var c=e.push(a);c||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(c){return function(){return t[c].apply(t,arguments)}}(n));for(var o=0;o<L0.length;o++)t.on(L0[o],this.emit.bind(this,L0[o]));return this._read=function(a){ve("wrapped _read",a),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(Oe.prototype[Symbol.asyncIterator]=function(){return O0===void 0&&(O0=Mp()),O0(this)});Object.defineProperty(Oe.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Oe.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Oe.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Oe._fromList=Bp;Object.defineProperty(Oe.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Bp(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function N0(t){var e=t._readableState;ve("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(G_,e,t))}function G_(t,e){if(ve("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Oe.from=function(t,e){return I0===void 0&&(I0=Ap()),I0(Oe,t,e)});function Dp(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var j0=G((UT,Fp)=>{"use strict";Fp.exports=Ci;var ku=hn().codes,V_=ku.ERR_METHOD_NOT_IMPLEMENTED,K_=ku.ERR_MULTIPLE_CALLBACK,J_=ku.ERR_TRANSFORM_ALREADY_TRANSFORMING,Z_=ku.ERR_TRANSFORM_WITH_LENGTH_0,Nu=ls();Ro()(Ci,Nu);function Y_(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new K_);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Ci(t){if(!(this instanceof Ci))return new Ci(t);Nu.call(this,t),this._transformState={afterTransform:Y_.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",X_)}function X_(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){jp(t,e,r)}):jp(this,null,null)}Ci.prototype.push=function(t,e){return this._transformState.needTransform=!1,Nu.prototype.push.call(this,t,e)};Ci.prototype._transform=function(t,e,r){r(new V_("_transform()"))};Ci.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Ci.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Ci.prototype._destroy=function(t,e){Nu.prototype._destroy.call(this,t,function(r){e(r)})};function jp(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new Z_;if(t._transformState.transforming)throw new J_;return t.push(null)}});var Hp=G((GT,qp)=>{"use strict";qp.exports=w1;var $p=j0();Ro()(w1,$p);function w1(t){if(!(this instanceof w1))return new w1(t);$p.call(this,t)}w1.prototype._transform=function(t,e,r){r(null,t)}});var Kp=G((VT,Vp)=>{"use strict";var F0;function Q_(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Gp=hn().codes,eS=Gp.ERR_MISSING_ARGS,tS=Gp.ERR_STREAM_DESTROYED;function Wp(t){if(t)throw t}function rS(t){return t.setHeader&&typeof t.abort=="function"}function iS(t,e,r,i){i=Q_(i);var n=!1;t.on("close",function(){n=!0}),F0===void 0&&(F0=Au()),F0(t,{readable:e,writable:r},function(a){if(a)return i(a);n=!0,i()});var o=!1;return function(a){if(!n&&!o){if(o=!0,rS(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(a||new tS("pipe"))}}}function Up(t){t()}function nS(t,e){return t.pipe(e)}function sS(t){return!t.length||typeof t[t.length-1]!="function"?Wp:t.pop()}function oS(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=sS(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new eS("streams");var n,o=e.map(function(a,c){var d=c<e.length-1,p=c>0;return iS(a,d,p,function(m){n||(n=m),m&&o.forEach(Up),!d&&(o.forEach(Up),i(n))})});return e.reduce(nS)}Vp.exports=oS});var Jp=G((wr,S1)=>{var _1=require("stream");process.env.READABLE_STREAM==="disable"&&_1?(S1.exports=_1.Readable,Object.assign(S1.exports,_1),S1.exports.Stream=_1):(wr=S1.exports=M0(),wr.Stream=_1||wr,wr.Readable=wr,wr.Writable=_0(),wr.Duplex=ls(),wr.Transform=j0(),wr.PassThrough=Hp(),wr.finished=Au(),wr.pipeline=Kp())});var Qp=G((KT,Xp)=>{"use strict";var{Transform:aS}=Jp(),{StringDecoder:lS}=require("string_decoder"),yn=Symbol("last"),Bu=Symbol("decoder");function uS(t,e,r){var i;if(this.overflow){var n=this[Bu].write(t);if(i=n.split(this.matcher),i.length===1)return r();i.shift(),this.overflow=!1}else this[yn]+=this[Bu].write(t),i=this[yn].split(this.matcher);this[yn]=i.pop();for(var o=0;o<i.length;o++)Yp(this,this.mapper(i[o]));if(this.overflow=this[yn].length>this.maxLength,this.overflow&&!this.skipOverflow)return r(new Error("maximum buffer reached"));r()}function cS(t){this[yn]+=this[Bu].end(),this[yn]&&Yp(this,this.mapper(this[yn])),t()}function Yp(t,e){e!==void 0&&t.push(e)}function Zp(t){return t}function fS(t,e,r){switch(t=t||/\r?\n/,e=e||Zp,r=r||{},arguments.length){case 1:typeof t=="function"?(e=t,t=/\r?\n/):typeof t=="object"&&!(t instanceof RegExp)&&(r=t,t=/\r?\n/);break;case 2:typeof t=="function"?(r=e,e=t,t=/\r?\n/):typeof e=="object"&&(r=e,e=Zp)}r=Object.assign({},r),r.transform=uS,r.flush=cS,r.readableObjectMode=!0;let i=new aS(r);return i[yn]="",i[Bu]=new lS("utf8"),i.matcher=t,i.mapper=e,i.maxLength=r.maxLength,i.skipOverflow=r.skipOverflow,i.overflow=!1,i}Xp.exports=fS});var Lo=G((zu,i9)=>{(function(t,e){typeof zu=="object"&&typeof i9<"u"?e(zu):typeof define=="function"&&define.amd?define(["exports"],e):e(t.ULID={})})(zu,function(t){"use strict";function e(C){var P=new Error(C);return P.source="ulid",P}var r="0123456789ABCDEFGHJKMNPQRSTVWXYZ",i=r.length,n=Math.pow(2,48)-1,o=10,a=16;function c(C,P,L){return P>C.length-1?C:C.substr(0,P)+L+C.substr(P+1)}function d(C){for(var P=void 0,L=C.length,k=void 0,z=void 0,U=i-1;!P&&L-->=0;){if(k=C[L],z=r.indexOf(k),z===-1)throw e("incorrectly encoded string");if(z===U){C=c(C,L,r[0]);continue}P=c(C,L,r[z+1])}if(typeof P=="string")return P;throw e("cannot increment this string")}function p(C){var P=Math.floor(C()*i);return P===i&&(P=i-1),r.charAt(P)}function m(C,P){if(isNaN(C))throw new Error(C+" must be a number");if(C>n)throw e("cannot encode time greater than "+n);if(C<0)throw e("time must be positive");if(Number.isInteger(C)===!1)throw e("time must be an integer");for(var L=void 0,k="";P>0;P--)L=C%i,k=r.charAt(L)+k,C=(C-L)/i;return k}function v(C,P){for(var L="";C>0;C--)L=p(P)+L;return L}function x(C){if(C.length!==o+a)throw e("malformed ulid");var P=C.substr(0,o).split("").reverse().reduce(function(L,k,z){var U=r.indexOf(k);if(U===-1)throw e("invalid character found: "+k);return L+=U*Math.pow(i,z)},0);if(P>n)throw e("malformed ulid, timestamp too large");return P}function w(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,P=arguments[1];P||(P=typeof window<"u"?window:null);var L=P&&(P.crypto||P.msCrypto);if(L)return function(){var z=new Uint8Array(1);return L.getRandomValues(z),z[0]/255};try{var k=require("crypto");return function(){return k.randomBytes(1).readUInt8()/255}}catch{}if(C){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw e("secure crypto unusable, insecure Math.random not allowed")}function b(C){return C||(C=w()),function(L){return isNaN(L)&&(L=Date.now()),m(L,o)+v(a,C)}}function E(C){C||(C=w());var P=0,L=void 0;return function(z){if(isNaN(z)&&(z=Date.now()),z<=P){var U=L=d(L);return m(P,o)+U}P=z;var Z=L=v(a,C);return m(z,o)+Z}}var A=b();t.replaceCharAt=c,t.incrementBase32=d,t.randomChar=p,t.encodeTime=m,t.encodeRandom=v,t.decodeTime=x,t.detectPrng=w,t.factory=b,t.monotonicFactory=E,t.ulid=A,Object.defineProperty(t,"__esModule",{value:!0})})});var x9=G(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.Nztm2000Quad=void 0;Fu.Nztm2000Quad={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid V2",abstract:"",identifier:"NZTM2000Quad",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[419435.9938,-32605867284e-4],upperCorner:[104381901652e-4,6758167443e-3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:139770566007179e-6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:698852830035895e-7,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:3494264150179475e-8,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:17471320750897374e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:8735660375448687e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:4.3678301877243435e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:2.1839150938621718e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:1.0919575469310859e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:545978.7734655429,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:272989.38673277147,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:136494.69336638573,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:68247.34668319287,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:34123.67334159643,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:17061.836670798217,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:8530.918335399108,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:4265.459167699554,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:2132.729583849777,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:1066.3647919248886,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:533.1823959624443,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:266.59119798122214,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:133.29559899061107,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:66.64779949530553,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152}]}});var M9=G($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.Nztm2000=void 0;$u.Nztm2000={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid",abstract:"See https://www.linz.govt.nz/data/linz-data-service/guides-and-documentation/nztm2000-map-tile-service-schema",identifier:"NZTM2000",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[3087e3,274e3],upperCorner:[7173e3,3327e3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:32e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:4},{type:"TileMatrixType",identifier:"1",scaleDenominator:16e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:8},{type:"TileMatrixType",identifier:"2",scaleDenominator:8e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:16},{type:"TileMatrixType",identifier:"3",scaleDenominator:4e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:32},{type:"TileMatrixType",identifier:"4",scaleDenominator:2e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:64},{type:"TileMatrixType",identifier:"5",scaleDenominator:1e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:128},{type:"TileMatrixType",identifier:"6",scaleDenominator:5e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:256},{type:"TileMatrixType",identifier:"7",scaleDenominator:25e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:512},{type:"TileMatrixType",identifier:"8",scaleDenominator:1e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:640,matrixHeight:1280},{type:"TileMatrixType",identifier:"9",scaleDenominator:5e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:1280,matrixHeight:2560},{type:"TileMatrixType",identifier:"10",scaleDenominator:25e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2560,matrixHeight:5120},{type:"TileMatrixType",identifier:"11",scaleDenominator:1e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:6400,matrixHeight:12800},{type:"TileMatrixType",identifier:"12",scaleDenominator:5e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:12800,matrixHeight:25600},{type:"TileMatrixType",identifier:"13",scaleDenominator:2500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:25600,matrixHeight:51200},{type:"TileMatrixType",identifier:"14",scaleDenominator:1e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64e3,matrixHeight:128e3},{type:"TileMatrixType",identifier:"15",scaleDenominator:500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128e3,matrixHeight:256e3},{type:"TileMatrixType",identifier:"16",scaleDenominator:250,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256e3,matrixHeight:512e3}]}});var E9=G(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.Nztm2000=zo.Nztm2000Quad=void 0;var TS=x9();Object.defineProperty(zo,"Nztm2000Quad",{enumerable:!0,get:function(){return TS.Nztm2000Quad}});var PS=M9();Object.defineProperty(zo,"Nztm2000",{enumerable:!0,get:function(){return PS.Nztm2000}})});var C9=G((HO,R9)=>{"use strict";function kS(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var n=t.charAt(i),o=n.charCodeAt(0);if(e[o]!==255)throw new TypeError(n+" is ambiguous");e[o]=i}var a=t.length,c=t.charAt(0),d=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function m(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var b=0,E=0,A=0,C=w.length;A!==C&&w[A]===0;)A++,b++;for(var P=(C-A)*p+1>>>0,L=new Uint8Array(P);A!==C;){for(var k=w[A],z=0,U=P-1;(k!==0||z<E)&&U!==-1;U--,z++)k+=256*L[U]>>>0,L[U]=k%a>>>0,k=k/a>>>0;if(k!==0)throw new Error("Non-zero carry");E=z,A++}for(var Z=P-E;Z!==P&&L[Z]===0;)Z++;for(var ie=c.repeat(b);Z<P;++Z)ie+=t.charAt(L[Z]);return ie}function v(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;for(var b=0,E=0,A=0;w[b]===c;)E++,b++;for(var C=(w.length-b)*d+1>>>0,P=new Uint8Array(C);w[b];){var L=e[w.charCodeAt(b)];if(L===255)return;for(var k=0,z=C-1;(L!==0||k<A)&&z!==-1;z--,k++)L+=a*P[z]>>>0,P[z]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");A=k,b++}for(var U=C-A;U!==C&&P[U]===0;)U++;for(var Z=new Uint8Array(E+(C-U)),ie=E;U!==C;)Z[ie++]=P[U++];return Z}function x(w){var b=v(w);if(b)return b;throw new Error("Non-base"+a+" character")}return{encode:m,decodeUnsafe:v,decode:x}}R9.exports=kS});var k9=G((Ju,L9)=>{(function(t,e){typeof Ju=="object"&&typeof L9<"u"?e(Ju):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(Ju,function(t){"use strict";let e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:u=>`Symbol(${u})`;function r(){}function i(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}let n=i();function o(u){return typeof u=="object"&&u!==null||typeof u=="function"}let a=r,c=Promise,d=Promise.prototype.then,p=Promise.resolve.bind(c),m=Promise.reject.bind(c);function v(u){return new c(u)}function x(u){return p(u)}function w(u){return m(u)}function b(u,h,M){return d.call(u,h,M)}function E(u,h,M){b(b(u,h,M),void 0,a)}function A(u,h){E(u,h)}function C(u,h){E(u,void 0,h)}function P(u,h,M){return b(u,h,M)}function L(u){b(u,void 0,a)}let k=(()=>{let u=n&&n.queueMicrotask;if(typeof u=="function")return u;let h=x(void 0);return M=>b(h,M)})();function z(u,h,M){if(typeof u!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(u,h,M)}function U(u,h,M){try{return x(z(u,h,M))}catch(O){return w(O)}}let Z=16384;class ie{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(h){let M=this._back,O=M;M._elements.length===Z-1&&(O={_elements:[],_next:void 0}),M._elements.push(h),O!==M&&(this._back=O,M._next=O),++this._size}shift(){let h=this._front,M=h,O=this._cursor,B=O+1,F=h._elements,q=F[O];return B===Z&&(M=h._next,B=0),--this._size,this._cursor=B,h!==M&&(this._front=M),F[O]=void 0,q}forEach(h){let M=this._cursor,O=this._front,B=O._elements;for(;(M!==B.length||O._next!==void 0)&&!(M===B.length&&(O=O._next,B=O._elements,M=0,B.length===0));)h(B[M]),++M}peek(){let h=this._front,M=this._cursor;return h._elements[M]}}function ge(u,h){u._ownerReadableStream=h,h._reader=u,h._state==="readable"?tt(u):h._state==="closed"?dr(u):pt(u,h._storedError)}function De(u,h){let M=u._ownerReadableStream;return nr(M,h)}function Me(u){u._ownerReadableStream._state==="readable"?Dn(u,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Pa(u,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._ownerReadableStream._reader=void 0,u._ownerReadableStream=void 0}function ke(u){return new TypeError("Cannot "+u+" a stream using a released reader")}function tt(u){u._closedPromise=v((h,M)=>{u._closedPromise_resolve=h,u._closedPromise_reject=M})}function pt(u,h){tt(u),Dn(u,h)}function dr(u){tt(u),zn(u)}function Dn(u,h){u._closedPromise_reject!==void 0&&(L(u._closedPromise),u._closedPromise_reject(h),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0)}function Pa(u,h){pt(u,h)}function zn(u){u._closedPromise_resolve!==void 0&&(u._closedPromise_resolve(void 0),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0)}let Oa=e("[[AbortSteps]]"),mr=e("[[ErrorSteps]]"),Ia=e("[[CancelSteps]]"),Fs=e("[[PullSteps]]"),gi=Number.isFinite||function(u){return typeof u=="number"&&isFinite(u)},hf=Math.trunc||function(u){return u<0?Math.ceil(u):Math.floor(u)};function df(u){return typeof u=="object"||typeof u=="function"}function ft(u,h){if(u!==void 0&&!df(u))throw new TypeError(`${h} is not an object.`)}function rr(u,h){if(typeof u!="function")throw new TypeError(`${h} is not a function.`)}function ol(u){return typeof u=="object"&&u!==null||typeof u=="function"}function gt(u,h){if(!ol(u))throw new TypeError(`${h} is not an object.`)}function kr(u,h,M){if(u===void 0)throw new TypeError(`Parameter ${h} is required in '${M}'.`)}function La(u,h,M){if(u===void 0)throw new TypeError(`${h} is required in '${M}'.`)}function ka(u){return Number(u)}function al(u){return u===0?0:u}function mf(u){return al(hf(u))}function ll(u,h){let O=Number.MAX_SAFE_INTEGER,B=Number(u);if(B=al(B),!gi(B))throw new TypeError(`${h} is not a finite number`);if(B=mf(B),B<0||B>O)throw new TypeError(`${h} is outside the accepted range of ${0} to ${O}, inclusive`);return!gi(B)||B===0?0:B}function Na(u,h){if(!Xr(u))throw new TypeError(`${h} is not a ReadableStream.`)}function Wi(u){return new Y(u)}function ul(u,h){u._reader._readRequests.push(h)}function $s(u,h,M){let B=u._reader._readRequests.shift();M?B._closeSteps():B._chunkSteps(h)}function kt(u){return u._reader._readRequests.length}function Ui(u){let h=u._reader;return!(h===void 0||!ct(h))}class Y{constructor(h){if(kr(h,1,"ReadableStreamDefaultReader"),Na(h,"First parameter"),Qr(h))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ge(this,h),this._readRequests=new ie}get closed(){return ct(this)?this._closedPromise:w(qs("closed"))}cancel(h=void 0){return ct(this)?this._ownerReadableStream===void 0?w(ke("cancel")):De(this,h):w(qs("cancel"))}read(){if(!ct(this))return w(qs("read"));if(this._ownerReadableStream===void 0)return w(ke("read from"));let h,M,O=v((F,q)=>{h=F,M=q});return Nr(this,{_chunkSteps:F=>h({value:F,done:!1}),_closeSteps:()=>h({value:void 0,done:!0}),_errorSteps:F=>M(F)}),O}releaseLock(){if(!ct(this))throw qs("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Me(this)}}}Object.defineProperties(Y.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Y.prototype,e.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ct(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_readRequests")?!1:u instanceof Y}function Nr(u,h){let M=u._ownerReadableStream;M._disturbed=!0,M._state==="closed"?h._closeSteps():M._state==="errored"?h._errorSteps(M._storedError):M._readableStreamController[Fs](h)}function qs(u){return new TypeError(`ReadableStreamDefaultReader.prototype.${u} can only be used on a ReadableStreamDefaultReader`)}let cl=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class fl{constructor(h,M){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=h,this._preventCancel=M}next(){let h=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?P(this._ongoingPromise,h,h):h(),this._ongoingPromise}return(h){let M=()=>this._returnSteps(h);return this._ongoingPromise?P(this._ongoingPromise,M,M):M()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let h=this._reader;if(h._ownerReadableStream===void 0)return w(ke("iterate"));let M,O,B=v((q,te)=>{M=q,O=te});return Nr(h,{_chunkSteps:q=>{this._ongoingPromise=void 0,k(()=>M({value:q,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Me(h),M({value:void 0,done:!0})},_errorSteps:q=>{this._ongoingPromise=void 0,this._isFinished=!0,Me(h),O(q)}}),B}_returnSteps(h){if(this._isFinished)return Promise.resolve({value:h,done:!0});this._isFinished=!0;let M=this._reader;if(M._ownerReadableStream===void 0)return w(ke("finish iterating"));if(!this._preventCancel){let O=De(M,h);return Me(M),P(O,()=>({value:h,done:!0}))}return Me(M),x({value:h,done:!0})}}let hl={next(){return dl(this)?this._asyncIteratorImpl.next():w(Ba("next"))},return(u){return dl(this)?this._asyncIteratorImpl.return(u):w(Ba("return"))}};cl!==void 0&&Object.setPrototypeOf(hl,cl);function pf(u,h){let M=Wi(u),O=new fl(M,h),B=Object.create(hl);return B._asyncIteratorImpl=O,B}function dl(u){if(!o(u)||!Object.prototype.hasOwnProperty.call(u,"_asyncIteratorImpl"))return!1;try{return u._asyncIteratorImpl instanceof fl}catch{return!1}}function Ba(u){return new TypeError(`ReadableStreamAsyncIterator.${u} can only be used on a ReadableSteamAsyncIterator`)}let ml=Number.isNaN||function(u){return u!==u};function jn(u){return u.slice()}function pl(u,h,M,O,B){new Uint8Array(u).set(new Uint8Array(M,O,B),h)}function Da(u){return u}function yi(u){return!1}function za(u,h,M){if(u.slice)return u.slice(h,M);let O=M-h,B=new ArrayBuffer(O);return pl(B,0,u,h,O),B}function gf(u){return!(typeof u!="number"||ml(u)||u<0)}function gl(u){let h=za(u.buffer,u.byteOffset,u.byteOffset+u.byteLength);return new Uint8Array(h)}function ja(u){let h=u._queue.shift();return u._queueTotalSize-=h.size,u._queueTotalSize<0&&(u._queueTotalSize=0),h.value}function ue(u,h,M){if(!gf(M)||M===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");u._queue.push({value:h,size:M}),u._queueTotalSize+=M}function yf(u){return u._queue.peek().value}function Vr(u){u._queue=new ie,u._queueTotalSize=0}class Fn{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Hs(this))throw Gi("view");return this._view}respond(h){if(!Hs(this))throw Gi("respond");if(kr(h,1,"respond"),h=ll(h,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");yi(this._view.buffer),qn(this._associatedReadableByteStreamController,h)}respondWithNewView(h){if(!Hs(this))throw Gi("respondWithNewView");if(kr(h,1,"respondWithNewView"),!ArrayBuffer.isView(h))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");yi(h.buffer),Hn(this._associatedReadableByteStreamController,h)}}Object.defineProperties(Fn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Fn.prototype,e.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Ye{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!bi(this))throw Vi("byobRequest");return Ha(this)}get desiredSize(){if(!bi(this))throw Vi("desiredSize");return Wa(this)}close(){if(!bi(this))throw Vi("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let h=this._controlledReadableByteStream._state;if(h!=="readable")throw new TypeError(`The stream (in ${h} state) is not in the readable state and cannot be closed`);Kr(this)}enqueue(h){if(!bi(this))throw Vi("enqueue");if(kr(h,1,"enqueue"),!ArrayBuffer.isView(h))throw new TypeError("chunk must be an array buffer view");if(h.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(h.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let M=this._controlledReadableByteStream._state;if(M!=="readable")throw new TypeError(`The stream (in ${M} state) is not in the readable state and cannot be enqueued to`);Vs(this,h)}error(h=void 0){if(!bi(this))throw Vi("error");Ut(this,h)}[Ia](h){yl(this),Vr(this);let M=this._cancelAlgorithm(h);return Gs(this),M}[Fs](h){let M=this._controlledReadableByteStream;if(this._queueTotalSize>0){let B=this._queue.shift();this._queueTotalSize-=B.byteLength,vl(this);let F=new Uint8Array(B.buffer,B.byteOffset,B.byteLength);h._chunkSteps(F);return}let O=this._autoAllocateChunkSize;if(O!==void 0){let B;try{B=new ArrayBuffer(O)}catch(q){h._errorSteps(q);return}let F={buffer:B,bufferByteLength:O,byteOffset:0,byteLength:O,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(F)}ul(M,h),vi(this)}}Object.defineProperties(Ye.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Ye.prototype,e.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function bi(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_controlledReadableByteStream")?!1:u instanceof Ye}function Hs(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_associatedReadableByteStreamController")?!1:u instanceof Fn}function vi(u){if(!wf(u))return;if(u._pulling){u._pullAgain=!0;return}u._pulling=!0;let M=u._pullAlgorithm();E(M,()=>{u._pulling=!1,u._pullAgain&&(u._pullAgain=!1,vi(u))},O=>{Ut(u,O)})}function yl(u){$a(u),u._pendingPullIntos=new ie}function Fa(u,h){let M=!1;u._state==="closed"&&(M=!0);let O=wi(h);h.readerType==="default"?$s(u,O,M):Nt(u,O,M)}function wi(u){let h=u.bytesFilled,M=u.elementSize;return new u.viewConstructor(u.buffer,u.byteOffset,h/M)}function Ws(u,h,M,O){u._queue.push({buffer:h,byteOffset:M,byteLength:O}),u._queueTotalSize+=O}function bl(u,h){let M=h.elementSize,O=h.bytesFilled-h.bytesFilled%M,B=Math.min(u._queueTotalSize,h.byteLength-h.bytesFilled),F=h.bytesFilled+B,q=F-F%M,te=B,he=!1;q>O&&(te=q-h.bytesFilled,he=!0);let _e=u._queue;for(;te>0;){let Te=_e.peek(),Pe=Math.min(te,Te.byteLength),nt=h.byteOffset+h.bytesFilled;pl(h.buffer,nt,Te.buffer,Te.byteOffset,Pe),Te.byteLength===Pe?_e.shift():(Te.byteOffset+=Pe,Te.byteLength-=Pe),u._queueTotalSize-=Pe,Us(u,Pe,h),te-=Pe}return he}function Us(u,h,M){M.bytesFilled+=h}function vl(u){u._queueTotalSize===0&&u._closeRequested?(Gs(u),Qn(u._controlledReadableByteStream)):vi(u)}function $a(u){u._byobRequest!==null&&(u._byobRequest._associatedReadableByteStreamController=void 0,u._byobRequest._view=null,u._byobRequest=null)}function wl(u){for(;u._pendingPullIntos.length>0;){if(u._queueTotalSize===0)return;let h=u._pendingPullIntos.peek();bl(u,h)&&($n(u),Fa(u._controlledReadableByteStream,h))}}function bf(u,h,M){let O=u._controlledReadableByteStream,B=1;h.constructor!==DataView&&(B=h.constructor.BYTES_PER_ELEMENT);let F=h.constructor,q=h.buffer,te={buffer:q,bufferByteLength:q.byteLength,byteOffset:h.byteOffset,byteLength:h.byteLength,bytesFilled:0,elementSize:B,viewConstructor:F,readerType:"byob"};if(u._pendingPullIntos.length>0){u._pendingPullIntos.push(te),Ua(O,M);return}if(O._state==="closed"){let he=new F(te.buffer,te.byteOffset,0);M._closeSteps(he);return}if(u._queueTotalSize>0){if(bl(u,te)){let he=wi(te);vl(u),M._chunkSteps(he);return}if(u._closeRequested){let he=new TypeError("Insufficient bytes to fill elements in the given buffer");Ut(u,he),M._errorSteps(he);return}}u._pendingPullIntos.push(te),Ua(O,M),vi(u)}function pr(u,h){let M=u._controlledReadableByteStream;if(Js(M))for(;Ga(M)>0;){let O=$n(u);Fa(M,O)}}function vf(u,h,M){if(Us(u,h,M),M.bytesFilled<M.elementSize)return;$n(u);let O=M.bytesFilled%M.elementSize;if(O>0){let B=M.byteOffset+M.bytesFilled,F=za(M.buffer,B-O,B);Ws(u,F,0,F.byteLength)}M.bytesFilled-=O,Fa(u._controlledReadableByteStream,M),wl(u)}function qa(u,h){let M=u._pendingPullIntos.peek();$a(u),u._controlledReadableByteStream._state==="closed"?pr(u):vf(u,h,M),vi(u)}function $n(u){return u._pendingPullIntos.shift()}function wf(u){let h=u._controlledReadableByteStream;return h._state!=="readable"||u._closeRequested||!u._started?!1:!!(Ui(h)&&kt(h)>0||Js(h)&&Ga(h)>0||Wa(u)>0)}function Gs(u){u._pullAlgorithm=void 0,u._cancelAlgorithm=void 0}function Kr(u){let h=u._controlledReadableByteStream;if(!(u._closeRequested||h._state!=="readable")){if(u._queueTotalSize>0){u._closeRequested=!0;return}if(u._pendingPullIntos.length>0&&u._pendingPullIntos.peek().bytesFilled>0){let O=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Ut(u,O),O}Gs(u),Qn(h)}}function Vs(u,h){let M=u._controlledReadableByteStream;if(u._closeRequested||M._state!=="readable")return;let O=h.buffer,B=h.byteOffset,F=h.byteLength,q=O;if(u._pendingPullIntos.length>0){let te=u._pendingPullIntos.peek();yi(te.buffer),te.buffer=te.buffer}if($a(u),Ui(M))if(kt(M)===0)Ws(u,q,B,F);else{u._pendingPullIntos.length>0&&$n(u);let te=new Uint8Array(q,B,F);$s(M,te,!1)}else Js(M)?(Ws(u,q,B,F),wl(u)):Ws(u,q,B,F);vi(u)}function Ut(u,h){let M=u._controlledReadableByteStream;M._state==="readable"&&(yl(u),Vr(u),Gs(u),Wl(M,h))}function Ha(u){if(u._byobRequest===null&&u._pendingPullIntos.length>0){let h=u._pendingPullIntos.peek(),M=new Uint8Array(h.buffer,h.byteOffset+h.bytesFilled,h.byteLength-h.bytesFilled),O=Object.create(Fn.prototype);_f(O,u,M),u._byobRequest=O}return u._byobRequest}function Wa(u){let h=u._controlledReadableByteStream._state;return h==="errored"?null:h==="closed"?0:u._strategyHWM-u._queueTotalSize}function qn(u,h){let M=u._pendingPullIntos.peek();if(u._controlledReadableByteStream._state==="closed"){if(h!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(h===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(M.bytesFilled+h>M.byteLength)throw new RangeError("bytesWritten out of range")}M.buffer=M.buffer,qa(u,h)}function Hn(u,h){let M=u._pendingPullIntos.peek();if(u._controlledReadableByteStream._state==="closed"){if(h.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(h.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(M.byteOffset+M.bytesFilled!==h.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(M.bufferByteLength!==h.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(M.bytesFilled+h.byteLength>M.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let B=h.byteLength;M.buffer=h.buffer,qa(u,B)}function _l(u,h,M,O,B,F,q){h._controlledReadableByteStream=u,h._pullAgain=!1,h._pulling=!1,h._byobRequest=null,h._queue=h._queueTotalSize=void 0,Vr(h),h._closeRequested=!1,h._started=!1,h._strategyHWM=F,h._pullAlgorithm=O,h._cancelAlgorithm=B,h._autoAllocateChunkSize=q,h._pendingPullIntos=new ie,u._readableStreamController=h;let te=M();E(x(te),()=>{h._started=!0,vi(h)},he=>{Ut(h,he)})}function Sl(u,h,M){let O=Object.create(Ye.prototype),B=()=>{},F=()=>x(void 0),q=()=>x(void 0);h.start!==void 0&&(B=()=>h.start(O)),h.pull!==void 0&&(F=()=>h.pull(O)),h.cancel!==void 0&&(q=he=>h.cancel(he));let te=h.autoAllocateChunkSize;if(te===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");_l(u,O,B,F,q,M,te)}function _f(u,h,M){u._associatedReadableByteStreamController=h,u._view=M}function Gi(u){return new TypeError(`ReadableStreamBYOBRequest.prototype.${u} can only be used on a ReadableStreamBYOBRequest`)}function Vi(u){return new TypeError(`ReadableByteStreamController.prototype.${u} can only be used on a ReadableByteStreamController`)}function Ks(u){return new Ki(u)}function Ua(u,h){u._reader._readIntoRequests.push(h)}function Nt(u,h,M){let B=u._reader._readIntoRequests.shift();M?B._closeSteps(h):B._chunkSteps(h)}function Ga(u){return u._reader._readIntoRequests.length}function Js(u){let h=u._reader;return!(h===void 0||!Gt(h))}class Ki{constructor(h){if(kr(h,1,"ReadableStreamBYOBReader"),Na(h,"First parameter"),Qr(h))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!bi(h._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ge(this,h),this._readIntoRequests=new ie}get closed(){return Gt(this)?this._closedPromise:w(vt("closed"))}cancel(h=void 0){return Gt(this)?this._ownerReadableStream===void 0?w(ke("cancel")):De(this,h):w(vt("cancel"))}read(h){if(!Gt(this))return w(vt("read"));if(!ArrayBuffer.isView(h))return w(new TypeError("view must be an array buffer view"));if(h.byteLength===0)return w(new TypeError("view must have non-zero byteLength"));if(h.buffer.byteLength===0)return w(new TypeError("view's buffer must have non-zero byteLength"));if(yi(h.buffer),this._ownerReadableStream===void 0)return w(ke("read from"));let M,O,B=v((q,te)=>{M=q,O=te});return bt(this,h,{_chunkSteps:q=>M({value:q,done:!1}),_closeSteps:q=>M({value:q,done:!0}),_errorSteps:q=>O(q)}),B}releaseLock(){if(!Gt(this))throw vt("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Me(this)}}}Object.defineProperties(Ki.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Ki.prototype,e.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Gt(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_readIntoRequests")?!1:u instanceof Ki}function bt(u,h,M){let O=u._ownerReadableStream;O._disturbed=!0,O._state==="errored"?M._errorSteps(O._storedError):bf(O._readableStreamController,h,M)}function vt(u){return new TypeError(`ReadableStreamBYOBReader.prototype.${u} can only be used on a ReadableStreamBYOBReader`)}function Br(u,h){let{highWaterMark:M}=u;if(M===void 0)return h;if(ml(M)||M<0)throw new RangeError("Invalid highWaterMark");return M}function Jr(u){let{size:h}=u;return h||(()=>1)}function Zs(u,h){ft(u,h);let M=u?.highWaterMark,O=u?.size;return{highWaterMark:M===void 0?void 0:ka(M),size:O===void 0?void 0:xl(O,`${h} has member 'size' that`)}}function xl(u,h){return rr(u,h),M=>ka(u(M))}function Sf(u,h){ft(u,h);let M=u?.abort,O=u?.close,B=u?.start,F=u?.type,q=u?.write;return{abort:M===void 0?void 0:Ml(M,u,`${h} has member 'abort' that`),close:O===void 0?void 0:Va(O,u,`${h} has member 'close' that`),start:B===void 0?void 0:El(B,u,`${h} has member 'start' that`),write:q===void 0?void 0:xf(q,u,`${h} has member 'write' that`),type:F}}function Ml(u,h,M){return rr(u,M),O=>U(u,h,[O])}function Va(u,h,M){return rr(u,M),()=>U(u,h,[])}function El(u,h,M){return rr(u,M),O=>z(u,h,[O])}function xf(u,h,M){return rr(u,M),(O,B)=>U(u,h,[O,B])}function Ys(u,h){if(!Zi(u))throw new TypeError(`${h} is not a WritableStream.`)}function Mf(u){if(typeof u!="object"||u===null)return!1;try{return typeof u.aborted=="boolean"}catch{return!1}}let Ef=typeof AbortController=="function";function Rf(){if(Ef)return new AbortController}class Ji{constructor(h={},M={}){h===void 0?h=null:gt(h,"First parameter");let O=Zs(M,"Second parameter"),B=Sf(h,"First parameter");if(Al(this),B.type!==void 0)throw new RangeError("Invalid type is specified");let q=Jr(O),te=Br(O,1);Bf(this,B,te,q)}get locked(){if(!Zi(this))throw so("locked");return Yi(this)}abort(h=void 0){return Zi(this)?Yi(this)?w(new TypeError("Cannot abort a stream that already has a writer")):Dr(this,h):w(so("abort"))}close(){return Zi(this)?Yi(this)?w(new TypeError("Cannot close a stream that already has a writer")):gr(this)?w(new TypeError("Cannot close an already-closing stream")):Tl(this):w(so("close"))}getWriter(){if(!Zi(this))throw so("getWriter");return Rl(this)}}Object.defineProperties(Ji.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Ji.prototype,e.toStringTag,{value:"WritableStream",configurable:!0});function Rl(u){return new Xi(u)}function Cl(u,h,M,O,B=1,F=()=>1){let q=Object.create(Ji.prototype);Al(q);let te=Object.create(Qi.prototype);return Ya(q,te,u,h,M,O,B,F),q}function Al(u){u._state="writable",u._storedError=void 0,u._writer=void 0,u._writableStreamController=void 0,u._writeRequests=new ie,u._inFlightWriteRequest=void 0,u._closeRequest=void 0,u._inFlightCloseRequest=void 0,u._pendingAbortRequest=void 0,u._backpressure=!1}function Zi(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_writableStreamController")?!1:u instanceof Ji}function Yi(u){return u._writer!==void 0}function Dr(u,h){var M;if(u._state==="closed"||u._state==="errored")return x(void 0);u._writableStreamController._abortReason=h,(M=u._writableStreamController._abortController)===null||M===void 0||M.abort();let O=u._state;if(O==="closed"||O==="errored")return x(void 0);if(u._pendingAbortRequest!==void 0)return u._pendingAbortRequest._promise;let B=!1;O==="erroring"&&(B=!0,h=void 0);let F=v((q,te)=>{u._pendingAbortRequest={_promise:void 0,_resolve:q,_reject:te,_reason:h,_wasAlreadyErroring:B}});return u._pendingAbortRequest._promise=F,B||Qs(u,h),F}function Tl(u){let h=u._state;if(h==="closed"||h==="errored")return w(new TypeError(`The stream (in ${h} state) is not in the writable state and cannot be closed`));let M=v((B,F)=>{let q={_resolve:B,_reject:F};u._closeRequest=q}),O=u._writer;return O!==void 0&&u._backpressure&&h==="writable"&&r1(O),Df(u._writableStreamController),M}function Cf(u){return v((M,O)=>{let B={_resolve:M,_reject:O};u._writeRequests.push(B)})}function Xs(u,h){if(u._state==="writable"){Qs(u,h);return}eo(u)}function Qs(u,h){let M=u._writableStreamController;u._state="erroring",u._storedError=h;let O=u._writer;O!==void 0&&Ja(O,h),!If(u)&&M._started&&eo(u)}function eo(u){u._state="errored",u._writableStreamController[mr]();let h=u._storedError;if(u._writeRequests.forEach(B=>{B._reject(h)}),u._writeRequests=new ie,u._pendingAbortRequest===void 0){_i(u);return}let M=u._pendingAbortRequest;if(u._pendingAbortRequest=void 0,M._wasAlreadyErroring){M._reject(h),_i(u);return}let O=u._writableStreamController[Oa](M._reason);E(O,()=>{M._resolve(),_i(u)},B=>{M._reject(B),_i(u)})}function Af(u){u._inFlightWriteRequest._resolve(void 0),u._inFlightWriteRequest=void 0}function Tf(u,h){u._inFlightWriteRequest._reject(h),u._inFlightWriteRequest=void 0,Xs(u,h)}function Pf(u){u._inFlightCloseRequest._resolve(void 0),u._inFlightCloseRequest=void 0,u._state==="erroring"&&(u._storedError=void 0,u._pendingAbortRequest!==void 0&&(u._pendingAbortRequest._resolve(),u._pendingAbortRequest=void 0)),u._state="closed";let M=u._writer;M!==void 0&&Bl(M)}function Of(u,h){u._inFlightCloseRequest._reject(h),u._inFlightCloseRequest=void 0,u._pendingAbortRequest!==void 0&&(u._pendingAbortRequest._reject(h),u._pendingAbortRequest=void 0),Xs(u,h)}function gr(u){return!(u._closeRequest===void 0&&u._inFlightCloseRequest===void 0)}function If(u){return!(u._inFlightWriteRequest===void 0&&u._inFlightCloseRequest===void 0)}function Lf(u){u._inFlightCloseRequest=u._closeRequest,u._closeRequest=void 0}function Pl(u){u._inFlightWriteRequest=u._writeRequests.shift()}function _i(u){u._closeRequest!==void 0&&(u._closeRequest._reject(u._storedError),u._closeRequest=void 0);let h=u._writer;h!==void 0&&e1(h,u._storedError)}function Ka(u,h){let M=u._writer;M!==void 0&&h!==u._backpressure&&(h?Wf(M):r1(M)),u._backpressure=h}class Xi{constructor(h){if(kr(h,1,"WritableStreamDefaultWriter"),Ys(h,"First parameter"),Yi(h))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=h,h._writer=this;let M=h._state;if(M==="writable")!gr(h)&&h._backpressure?oo(this):Dl(this),en(this);else if(M==="erroring")t1(this,h._storedError),en(this);else if(M==="closed")Dl(this),qf(this);else{let O=h._storedError;t1(this,O),Nl(this,O)}}get closed(){return Si(this)?this._closedPromise:w(xi("closed"))}get desiredSize(){if(!Si(this))throw xi("desiredSize");if(this._ownerWritableStream===void 0)throw Gn("desiredSize");return ir(this)}get ready(){return Si(this)?this._readyPromise:w(xi("ready"))}abort(h=void 0){return Si(this)?this._ownerWritableStream===void 0?w(Gn("abort")):kf(this,h):w(xi("abort"))}close(){if(!Si(this))return w(xi("close"));let h=this._ownerWritableStream;return h===void 0?w(Gn("close")):gr(h)?w(new TypeError("Cannot close an already-closing stream")):Ol(this)}releaseLock(){if(!Si(this))throw xi("releaseLock");this._ownerWritableStream!==void 0&&Il(this)}write(h=void 0){return Si(this)?this._ownerWritableStream===void 0?w(Gn("write to")):Ll(this,h):w(xi("write"))}}Object.defineProperties(Xi.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Xi.prototype,e.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Si(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_ownerWritableStream")?!1:u instanceof Xi}function kf(u,h){let M=u._ownerWritableStream;return Dr(M,h)}function Ol(u){let h=u._ownerWritableStream;return Tl(h)}function Nf(u){let h=u._ownerWritableStream,M=h._state;return gr(h)||M==="closed"?x(void 0):M==="errored"?w(h._storedError):Ol(u)}function to(u,h){u._closedPromiseState==="pending"?e1(u,h):Hf(u,h)}function Ja(u,h){u._readyPromiseState==="pending"?zl(u,h):Uf(u,h)}function ir(u){let h=u._ownerWritableStream,M=h._state;return M==="errored"||M==="erroring"?null:M==="closed"?0:Wn(h._writableStreamController)}function Il(u){let h=u._ownerWritableStream,M=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Ja(u,M),to(u,M),h._writer=void 0,u._ownerWritableStream=void 0}function Ll(u,h){let M=u._ownerWritableStream,O=M._writableStreamController,B=zf(O,h);if(M!==u._ownerWritableStream)return w(Gn("write to"));let F=M._state;if(F==="errored")return w(M._storedError);if(gr(M)||F==="closed")return w(new TypeError("The stream is closing or closed and cannot be written to"));if(F==="erroring")return w(M._storedError);let q=Cf(M);return jf(O,h,B),q}let ro={};class Qi{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Za(this))throw Qa("abortReason");return this._abortReason}get signal(){if(!Za(this))throw Qa("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(h=void 0){if(!Za(this))throw Qa("error");this._controlledWritableStream._state==="writable"&&kl(this,h)}[Oa](h){let M=this._abortAlgorithm(h);return io(this),M}[mr](){Vr(this)}}Object.defineProperties(Qi.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Qi.prototype,e.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Za(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_controlledWritableStream")?!1:u instanceof Qi}function Ya(u,h,M,O,B,F,q,te){h._controlledWritableStream=u,u._writableStreamController=h,h._queue=void 0,h._queueTotalSize=void 0,Vr(h),h._abortReason=void 0,h._abortController=Rf(),h._started=!1,h._strategySizeAlgorithm=te,h._strategyHWM=q,h._writeAlgorithm=O,h._closeAlgorithm=B,h._abortAlgorithm=F;let he=Un(h);Ka(u,he);let _e=M(),Te=x(_e);E(Te,()=>{h._started=!0,no(h)},Pe=>{h._started=!0,Xs(u,Pe)})}function Bf(u,h,M,O){let B=Object.create(Qi.prototype),F=()=>{},q=()=>x(void 0),te=()=>x(void 0),he=()=>x(void 0);h.start!==void 0&&(F=()=>h.start(B)),h.write!==void 0&&(q=_e=>h.write(_e,B)),h.close!==void 0&&(te=()=>h.close()),h.abort!==void 0&&(he=_e=>h.abort(_e)),Ya(u,B,F,q,te,he,M,O)}function io(u){u._writeAlgorithm=void 0,u._closeAlgorithm=void 0,u._abortAlgorithm=void 0,u._strategySizeAlgorithm=void 0}function Df(u){ue(u,ro,0),no(u)}function zf(u,h){try{return u._strategySizeAlgorithm(h)}catch(M){return Xa(u,M),1}}function Wn(u){return u._strategyHWM-u._queueTotalSize}function jf(u,h,M){try{ue(u,h,M)}catch(B){Xa(u,B);return}let O=u._controlledWritableStream;if(!gr(O)&&O._state==="writable"){let B=Un(u);Ka(O,B)}no(u)}function no(u){let h=u._controlledWritableStream;if(!u._started||h._inFlightWriteRequest!==void 0)return;if(h._state==="erroring"){eo(h);return}if(u._queue.length===0)return;let O=yf(u);O===ro?Ff(u):$f(u,O)}function Xa(u,h){u._controlledWritableStream._state==="writable"&&kl(u,h)}function Ff(u){let h=u._controlledWritableStream;Lf(h),ja(u);let M=u._closeAlgorithm();io(u),E(M,()=>{Pf(h)},O=>{Of(h,O)})}function $f(u,h){let M=u._controlledWritableStream;Pl(M);let O=u._writeAlgorithm(h);E(O,()=>{Af(M);let B=M._state;if(ja(u),!gr(M)&&B==="writable"){let F=Un(u);Ka(M,F)}no(u)},B=>{M._state==="writable"&&io(u),Tf(M,B)})}function Un(u){return Wn(u)<=0}function kl(u,h){let M=u._controlledWritableStream;io(u),Qs(M,h)}function so(u){return new TypeError(`WritableStream.prototype.${u} can only be used on a WritableStream`)}function Qa(u){return new TypeError(`WritableStreamDefaultController.prototype.${u} can only be used on a WritableStreamDefaultController`)}function xi(u){return new TypeError(`WritableStreamDefaultWriter.prototype.${u} can only be used on a WritableStreamDefaultWriter`)}function Gn(u){return new TypeError("Cannot "+u+" a stream using a released writer")}function en(u){u._closedPromise=v((h,M)=>{u._closedPromise_resolve=h,u._closedPromise_reject=M,u._closedPromiseState="pending"})}function Nl(u,h){en(u),e1(u,h)}function qf(u){en(u),Bl(u)}function e1(u,h){u._closedPromise_reject!==void 0&&(L(u._closedPromise),u._closedPromise_reject(h),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0,u._closedPromiseState="rejected")}function Hf(u,h){Nl(u,h)}function Bl(u){u._closedPromise_resolve!==void 0&&(u._closedPromise_resolve(void 0),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0,u._closedPromiseState="resolved")}function oo(u){u._readyPromise=v((h,M)=>{u._readyPromise_resolve=h,u._readyPromise_reject=M}),u._readyPromiseState="pending"}function t1(u,h){oo(u),zl(u,h)}function Dl(u){oo(u),r1(u)}function zl(u,h){u._readyPromise_reject!==void 0&&(L(u._readyPromise),u._readyPromise_reject(h),u._readyPromise_resolve=void 0,u._readyPromise_reject=void 0,u._readyPromiseState="rejected")}function Wf(u){oo(u)}function Uf(u,h){t1(u,h)}function r1(u){u._readyPromise_resolve!==void 0&&(u._readyPromise_resolve(void 0),u._readyPromise_resolve=void 0,u._readyPromise_reject=void 0,u._readyPromiseState="fulfilled")}let jl=typeof DOMException<"u"?DOMException:void 0;function Gf(u){if(!(typeof u=="function"||typeof u=="object"))return!1;try{return new u,!0}catch{return!1}}function Vf(){let u=function(M,O){this.message=M||"",this.name=O||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return u.prototype=Object.create(Error.prototype),Object.defineProperty(u.prototype,"constructor",{value:u,writable:!0,configurable:!0}),u}let Kf=Gf(jl)?jl:Vf();function Mi(u,h,M,O,B,F){let q=Wi(u),te=Rl(h);u._disturbed=!0;let he=!1,_e=x(void 0);return v((Te,Pe)=>{let nt;if(F!==void 0){if(nt=()=>{let se=new Kf("Aborted","AbortError"),ye=[];O||ye.push(()=>h._state==="writable"?Dr(h,se):x(void 0)),B||ye.push(()=>u._state==="readable"?nr(u,se):x(void 0)),Mt(()=>Promise.all(ye.map(Ge=>Ge())),!0,se)},F.aborted){nt();return}F.addEventListener("abort",nt)}function sr(){return v((se,ye)=>{function Ge(Bt){Bt?se():b(on(),Ge,ye)}Ge(!1)})}function on(){return he?x(!0):b(te._readyPromise,()=>v((se,ye)=>{Nr(q,{_chunkSteps:Ge=>{_e=b(Ll(te,Ge),void 0,r),se(!1)},_closeSteps:()=>se(!0),_errorSteps:ye})}))}if(zr(u,q._closedPromise,se=>{O?Vt(!0,se):Mt(()=>Dr(h,se),!0,se)}),zr(h,te._closedPromise,se=>{B?Vt(!0,se):Mt(()=>nr(u,se),!0,se)}),_t(u,q._closedPromise,()=>{M?Vt():Mt(()=>Nf(te))}),gr(h)||h._state==="closed"){let se=new TypeError("the destination writable stream closed before all data could be piped to it");B?Vt(!0,se):Mt(()=>nr(u,se),!0,se)}L(sr());function ti(){let se=_e;return b(_e,()=>se!==_e?ti():void 0)}function zr(se,ye,Ge){se._state==="errored"?Ge(se._storedError):C(ye,Ge)}function _t(se,ye,Ge){se._state==="closed"?Ge():A(ye,Ge)}function Mt(se,ye,Ge){if(he)return;he=!0,h._state==="writable"&&!gr(h)?A(ti(),Bt):Bt();function Bt(){E(se(),()=>jr(ye,Ge),an=>jr(!0,an))}}function Vt(se,ye){he||(he=!0,h._state==="writable"&&!gr(h)?A(ti(),()=>jr(se,ye)):jr(se,ye))}function jr(se,ye){Il(te),Me(q),F!==void 0&&F.removeEventListener("abort",nt),se?Pe(ye):Te(void 0)}})}class tn{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ao(this))throw co("desiredSize");return i1(this)}close(){if(!ao(this))throw co("close");if(!rn(this))throw new TypeError("The stream is not in a state that permits close");Kn(this)}enqueue(h=void 0){if(!ao(this))throw co("enqueue");if(!rn(this))throw new TypeError("The stream is not in a state that permits enqueue");return uo(this,h)}error(h=void 0){if(!ao(this))throw co("error");Zr(this,h)}[Ia](h){Vr(this);let M=this._cancelAlgorithm(h);return lo(this),M}[Fs](h){let M=this._controlledReadableStream;if(this._queue.length>0){let O=ja(this);this._closeRequested&&this._queue.length===0?(lo(this),Qn(M)):Vn(this),h._chunkSteps(O)}else ul(M,h),Vn(this)}}Object.defineProperties(tn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(tn.prototype,e.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function ao(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_controlledReadableStream")?!1:u instanceof tn}function Vn(u){if(!Fl(u))return;if(u._pulling){u._pullAgain=!0;return}u._pulling=!0;let M=u._pullAlgorithm();E(M,()=>{u._pulling=!1,u._pullAgain&&(u._pullAgain=!1,Vn(u))},O=>{Zr(u,O)})}function Fl(u){let h=u._controlledReadableStream;return!rn(u)||!u._started?!1:!!(Qr(h)&&kt(h)>0||i1(u)>0)}function lo(u){u._pullAlgorithm=void 0,u._cancelAlgorithm=void 0,u._strategySizeAlgorithm=void 0}function Kn(u){if(!rn(u))return;let h=u._controlledReadableStream;u._closeRequested=!0,u._queue.length===0&&(lo(u),Qn(h))}function uo(u,h){if(!rn(u))return;let M=u._controlledReadableStream;if(Qr(M)&&kt(M)>0)$s(M,h,!1);else{let O;try{O=u._strategySizeAlgorithm(h)}catch(B){throw Zr(u,B),B}try{ue(u,h,O)}catch(B){throw Zr(u,B),B}}Vn(u)}function Zr(u,h){let M=u._controlledReadableStream;M._state==="readable"&&(Vr(u),lo(u),Wl(M,h))}function i1(u){let h=u._controlledReadableStream._state;return h==="errored"?null:h==="closed"?0:u._strategyHWM-u._queueTotalSize}function Jf(u){return!Fl(u)}function rn(u){let h=u._controlledReadableStream._state;return!u._closeRequested&&h==="readable"}function $l(u,h,M,O,B,F,q){h._controlledReadableStream=u,h._queue=void 0,h._queueTotalSize=void 0,Vr(h),h._started=!1,h._closeRequested=!1,h._pullAgain=!1,h._pulling=!1,h._strategySizeAlgorithm=q,h._strategyHWM=F,h._pullAlgorithm=O,h._cancelAlgorithm=B,u._readableStreamController=h;let te=M();E(x(te),()=>{h._started=!0,Vn(h)},he=>{Zr(h,he)})}function Zf(u,h,M,O){let B=Object.create(tn.prototype),F=()=>{},q=()=>x(void 0),te=()=>x(void 0);h.start!==void 0&&(F=()=>h.start(B)),h.pull!==void 0&&(q=()=>h.pull(B)),h.cancel!==void 0&&(te=he=>h.cancel(he)),$l(u,B,F,q,te,M,O)}function co(u){return new TypeError(`ReadableStreamDefaultController.prototype.${u} can only be used on a ReadableStreamDefaultController`)}function Yf(u,h){return bi(u._readableStreamController)?wt(u):Xf(u)}function Xf(u,h){let M=Wi(u),O=!1,B=!1,F=!1,q=!1,te,he,_e,Te,Pe,nt=v(_t=>{Pe=_t});function sr(){return O?(B=!0,x(void 0)):(O=!0,Nr(M,{_chunkSteps:Mt=>{k(()=>{B=!1;let Vt=Mt,jr=Mt;F||uo(_e._readableStreamController,Vt),q||uo(Te._readableStreamController,jr),O=!1,B&&sr()})},_closeSteps:()=>{O=!1,F||Kn(_e._readableStreamController),q||Kn(Te._readableStreamController),(!F||!q)&&Pe(void 0)},_errorSteps:()=>{O=!1}}),x(void 0))}function on(_t){if(F=!0,te=_t,q){let Mt=jn([te,he]),Vt=nr(u,Mt);Pe(Vt)}return nt}function ti(_t){if(q=!0,he=_t,F){let Mt=jn([te,he]),Vt=nr(u,Mt);Pe(Vt)}return nt}function zr(){}return _e=yr(zr,sr,on),Te=yr(zr,sr,ti),C(M._closedPromise,_t=>{Zr(_e._readableStreamController,_t),Zr(Te._readableStreamController,_t),(!F||!q)&&Pe(void 0)}),[_e,Te]}function wt(u){let h=Wi(u),M=!1,O=!1,B=!1,F=!1,q=!1,te,he,_e,Te,Pe,nt=v(se=>{Pe=se});function sr(se){C(se._closedPromise,ye=>{se===h&&(Ut(_e._readableStreamController,ye),Ut(Te._readableStreamController,ye),(!F||!q)&&Pe(void 0))})}function on(){Gt(h)&&(Me(h),h=Wi(u),sr(h)),Nr(h,{_chunkSteps:ye=>{k(()=>{O=!1,B=!1;let Ge=ye,Bt=ye;if(!F&&!q)try{Bt=gl(ye)}catch(an){Ut(_e._readableStreamController,an),Ut(Te._readableStreamController,an),Pe(nr(u,an));return}F||Vs(_e._readableStreamController,Ge),q||Vs(Te._readableStreamController,Bt),M=!1,O?zr():B&&_t()})},_closeSteps:()=>{M=!1,F||Kr(_e._readableStreamController),q||Kr(Te._readableStreamController),_e._readableStreamController._pendingPullIntos.length>0&&qn(_e._readableStreamController,0),Te._readableStreamController._pendingPullIntos.length>0&&qn(Te._readableStreamController,0),(!F||!q)&&Pe(void 0)},_errorSteps:()=>{M=!1}})}function ti(se,ye){ct(h)&&(Me(h),h=Ks(u),sr(h));let Ge=ye?Te:_e,Bt=ye?_e:Te;bt(h,se,{_chunkSteps:ln=>{k(()=>{O=!1,B=!1;let un=ye?q:F;if(ye?F:q)un||Hn(Ge._readableStreamController,ln);else{let iu;try{iu=gl(ln)}catch(s1){Ut(Ge._readableStreamController,s1),Ut(Bt._readableStreamController,s1),Pe(nr(u,s1));return}un||Hn(Ge._readableStreamController,ln),Vs(Bt._readableStreamController,iu)}M=!1,O?zr():B&&_t()})},_closeSteps:ln=>{M=!1;let un=ye?q:F,wo=ye?F:q;un||Kr(Ge._readableStreamController),wo||Kr(Bt._readableStreamController),ln!==void 0&&(un||Hn(Ge._readableStreamController,ln),!wo&&Bt._readableStreamController._pendingPullIntos.length>0&&qn(Bt._readableStreamController,0)),(!un||!wo)&&Pe(void 0)},_errorSteps:()=>{M=!1}})}function zr(){if(M)return O=!0,x(void 0);M=!0;let se=Ha(_e._readableStreamController);return se===null?on():ti(se._view,!1),x(void 0)}function _t(){if(M)return B=!0,x(void 0);M=!0;let se=Ha(Te._readableStreamController);return se===null?on():ti(se._view,!0),x(void 0)}function Mt(se){if(F=!0,te=se,q){let ye=jn([te,he]),Ge=nr(u,ye);Pe(Ge)}return nt}function Vt(se){if(q=!0,he=se,F){let ye=jn([te,he]),Ge=nr(u,ye);Pe(Ge)}return nt}function jr(){}return _e=Hl(jr,zr,Mt),Te=Hl(jr,_t,Vt),sr(h),[_e,Te]}function Jn(u,h){ft(u,h);let M=u,O=M?.autoAllocateChunkSize,B=M?.cancel,F=M?.pull,q=M?.start,te=M?.type;return{autoAllocateChunkSize:O===void 0?void 0:ll(O,`${h} has member 'autoAllocateChunkSize' that`),cancel:B===void 0?void 0:Zn(B,M,`${h} has member 'cancel' that`),pull:F===void 0?void 0:Yn(F,M,`${h} has member 'pull' that`),start:q===void 0?void 0:Xn(q,M,`${h} has member 'start' that`),type:te===void 0?void 0:nn(te,`${h} has member 'type' that`)}}function Zn(u,h,M){return rr(u,M),O=>U(u,h,[O])}function Yn(u,h,M){return rr(u,M),O=>U(u,h,[O])}function Xn(u,h,M){return rr(u,M),O=>z(u,h,[O])}function nn(u,h){if(u=`${u}`,u!=="bytes")throw new TypeError(`${h} '${u}' is not a valid enumeration value for ReadableStreamType`);return u}function sn(u,h){ft(u,h);let M=u?.mode;return{mode:M===void 0?void 0:fo(M,`${h} has member 'mode' that`)}}function fo(u,h){if(u=`${u}`,u!=="byob")throw new TypeError(`${h} '${u}' is not a valid enumeration value for ReadableStreamReaderMode`);return u}function Qf(u,h){ft(u,h);let M=u?.preventCancel;return{preventCancel:Boolean(M)}}function ql(u,h){ft(u,h);let M=u?.preventAbort,O=u?.preventCancel,B=u?.preventClose,F=u?.signal;return F!==void 0&&eh(F,`${h} has member 'signal' that`),{preventAbort:Boolean(M),preventCancel:Boolean(O),preventClose:Boolean(B),signal:F}}function eh(u,h){if(!Mf(u))throw new TypeError(`${h} is not an AbortSignal.`)}function th(u,h){ft(u,h);let M=u?.readable;La(M,"readable","ReadableWritablePair"),Na(M,`${h} has member 'readable' that`);let O=u?.writable;return La(O,"writable","ReadableWritablePair"),Ys(O,`${h} has member 'writable' that`),{readable:M,writable:O}}class Yr{constructor(h={},M={}){h===void 0?h=null:gt(h,"First parameter");let O=Zs(M,"Second parameter"),B=Jn(h,"First parameter");if(n1(this),B.type==="bytes"){if(O.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let F=Br(O,0);Sl(this,B,F)}else{let F=Jr(O),q=Br(O,1);Zf(this,B,q,F)}}get locked(){if(!Xr(this))throw Ei("locked");return Qr(this)}cancel(h=void 0){return Xr(this)?Qr(this)?w(new TypeError("Cannot cancel a stream that already has a reader")):nr(this,h):w(Ei("cancel"))}getReader(h=void 0){if(!Xr(this))throw Ei("getReader");return sn(h,"First parameter").mode===void 0?Wi(this):Ks(this)}pipeThrough(h,M={}){if(!Xr(this))throw Ei("pipeThrough");kr(h,1,"pipeThrough");let O=th(h,"First parameter"),B=ql(M,"Second parameter");if(Qr(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Yi(O.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let F=Mi(this,O.writable,B.preventClose,B.preventAbort,B.preventCancel,B.signal);return L(F),O.readable}pipeTo(h,M={}){if(!Xr(this))return w(Ei("pipeTo"));if(h===void 0)return w("Parameter 1 is required in 'pipeTo'.");if(!Zi(h))return w(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let O;try{O=ql(M,"Second parameter")}catch(B){return w(B)}return Qr(this)?w(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Yi(h)?w(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Mi(this,h,O.preventClose,O.preventAbort,O.preventCancel,O.signal)}tee(){if(!Xr(this))throw Ei("tee");let h=Yf(this);return jn(h)}values(h=void 0){if(!Xr(this))throw Ei("values");let M=Qf(h,"First parameter");return pf(this,M.preventCancel)}}Object.defineProperties(Yr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Yr.prototype,e.toStringTag,{value:"ReadableStream",configurable:!0}),typeof e.asyncIterator=="symbol"&&Object.defineProperty(Yr.prototype,e.asyncIterator,{value:Yr.prototype.values,writable:!0,configurable:!0});function yr(u,h,M,O=1,B=()=>1){let F=Object.create(Yr.prototype);n1(F);let q=Object.create(tn.prototype);return $l(F,q,u,h,M,O,B),F}function Hl(u,h,M){let O=Object.create(Yr.prototype);n1(O);let B=Object.create(Ye.prototype);return _l(O,B,u,h,M,0,void 0),O}function n1(u){u._state="readable",u._reader=void 0,u._storedError=void 0,u._disturbed=!1}function Xr(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_readableStreamController")?!1:u instanceof Yr}function Qr(u){return u._reader!==void 0}function nr(u,h){if(u._disturbed=!0,u._state==="closed")return x(void 0);if(u._state==="errored")return w(u._storedError);Qn(u);let M=u._reader;M!==void 0&&Gt(M)&&(M._readIntoRequests.forEach(B=>{B._closeSteps(void 0)}),M._readIntoRequests=new ie);let O=u._readableStreamController[Ia](h);return P(O,r)}function Qn(u){u._state="closed";let h=u._reader;h!==void 0&&(zn(h),ct(h)&&(h._readRequests.forEach(M=>{M._closeSteps()}),h._readRequests=new ie))}function Wl(u,h){u._state="errored",u._storedError=h;let M=u._reader;M!==void 0&&(Dn(M,h),ct(M)?(M._readRequests.forEach(O=>{O._errorSteps(h)}),M._readRequests=new ie):(M._readIntoRequests.forEach(O=>{O._errorSteps(h)}),M._readIntoRequests=new ie))}function Ei(u){return new TypeError(`ReadableStream.prototype.${u} can only be used on a ReadableStream`)}function Ul(u,h){ft(u,h);let M=u?.highWaterMark;return La(M,"highWaterMark","QueuingStrategyInit"),{highWaterMark:ka(M)}}let Gl=u=>u.byteLength;Object.defineProperty(Gl,"name",{value:"size",configurable:!0});class ho{constructor(h){kr(h,1,"ByteLengthQueuingStrategy"),h=Ul(h,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=h.highWaterMark}get highWaterMark(){if(!Kl(this))throw Vl("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Kl(this))throw Vl("size");return Gl}}Object.defineProperties(ho.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(ho.prototype,e.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Vl(u){return new TypeError(`ByteLengthQueuingStrategy.prototype.${u} can only be used on a ByteLengthQueuingStrategy`)}function Kl(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_byteLengthQueuingStrategyHighWaterMark")?!1:u instanceof ho}let Jl=()=>1;Object.defineProperty(Jl,"name",{value:"size",configurable:!0});class mo{constructor(h){kr(h,1,"CountQueuingStrategy"),h=Ul(h,"First parameter"),this._countQueuingStrategyHighWaterMark=h.highWaterMark}get highWaterMark(){if(!Yl(this))throw Zl("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Yl(this))throw Zl("size");return Jl}}Object.defineProperties(mo.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(mo.prototype,e.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Zl(u){return new TypeError(`CountQueuingStrategy.prototype.${u} can only be used on a CountQueuingStrategy`)}function Yl(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_countQueuingStrategyHighWaterMark")?!1:u instanceof mo}function ei(u,h){ft(u,h);let M=u?.flush,O=u?.readableType,B=u?.start,F=u?.transform,q=u?.writableType;return{flush:M===void 0?void 0:rh(M,u,`${h} has member 'flush' that`),readableType:O,start:B===void 0?void 0:ih(B,u,`${h} has member 'start' that`),transform:F===void 0?void 0:nh(F,u,`${h} has member 'transform' that`),writableType:q}}function rh(u,h,M){return rr(u,M),O=>U(u,h,[O])}function ih(u,h,M){return rr(u,M),O=>z(u,h,[O])}function nh(u,h,M){return rr(u,M),(O,B)=>U(u,h,[O,B])}class po{constructor(h={},M={},O={}){h===void 0&&(h=null);let B=Zs(M,"Second parameter"),F=Zs(O,"Third parameter"),q=ei(h,"First parameter");if(q.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(q.writableType!==void 0)throw new RangeError("Invalid writableType specified");let te=Br(F,0),he=Jr(F),_e=Br(B,1),Te=Jr(B),Pe,nt=v(sr=>{Pe=sr});sh(this,nt,_e,Te,te,he),ah(this,q),q.start!==void 0?Pe(q.start(this._transformStreamController)):Pe(void 0)}get readable(){if(!Xl(this))throw ru("readable");return this._readable}get writable(){if(!Xl(this))throw ru("writable");return this._writable}}Object.defineProperties(po.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(po.prototype,e.toStringTag,{value:"TransformStream",configurable:!0});function sh(u,h,M,O,B,F){function q(){return h}function te(nt){return ch(u,nt)}function he(nt){return fh(u,nt)}function _e(){return hh(u)}u._writable=Cl(q,te,_e,he,M,O);function Te(){return dh(u)}function Pe(nt){return yo(u,nt),x(void 0)}u._readable=yr(q,Te,Pe,B,F),u._backpressure=void 0,u._backpressureChangePromise=void 0,u._backpressureChangePromise_resolve=void 0,bo(u,!0),u._transformStreamController=void 0}function Xl(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_transformStreamController")?!1:u instanceof po}function go(u,h){Zr(u._readable._readableStreamController,h),yo(u,h)}function yo(u,h){Ql(u._transformStreamController),Xa(u._writable._writableStreamController,h),u._backpressure&&bo(u,!1)}function bo(u,h){u._backpressureChangePromise!==void 0&&u._backpressureChangePromise_resolve(),u._backpressureChangePromise=v(M=>{u._backpressureChangePromise_resolve=M}),u._backpressure=h}class es{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!vo(this))throw ts("desiredSize");let h=this._controlledTransformStream._readable._readableStreamController;return i1(h)}enqueue(h=void 0){if(!vo(this))throw ts("enqueue");eu(this,h)}error(h=void 0){if(!vo(this))throw ts("error");lh(this,h)}terminate(){if(!vo(this))throw ts("terminate");uh(this)}}Object.defineProperties(es.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(es.prototype,e.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function vo(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_controlledTransformStream")?!1:u instanceof es}function oh(u,h,M,O){h._controlledTransformStream=u,u._transformStreamController=h,h._transformAlgorithm=M,h._flushAlgorithm=O}function ah(u,h){let M=Object.create(es.prototype),O=F=>{try{return eu(M,F),x(void 0)}catch(q){return w(q)}},B=()=>x(void 0);h.transform!==void 0&&(O=F=>h.transform(F,M)),h.flush!==void 0&&(B=()=>h.flush(M)),oh(u,M,O,B)}function Ql(u){u._transformAlgorithm=void 0,u._flushAlgorithm=void 0}function eu(u,h){let M=u._controlledTransformStream,O=M._readable._readableStreamController;if(!rn(O))throw new TypeError("Readable side is not in a state that permits enqueue");try{uo(O,h)}catch(F){throw yo(M,F),M._readable._storedError}Jf(O)!==M._backpressure&&bo(M,!0)}function lh(u,h){go(u._controlledTransformStream,h)}function tu(u,h){let M=u._transformAlgorithm(h);return P(M,void 0,O=>{throw go(u._controlledTransformStream,O),O})}function uh(u){let h=u._controlledTransformStream,M=h._readable._readableStreamController;Kn(M);let O=new TypeError("TransformStream terminated");yo(h,O)}function ch(u,h){let M=u._transformStreamController;if(u._backpressure){let O=u._backpressureChangePromise;return P(O,()=>{let B=u._writable;if(B._state==="erroring")throw B._storedError;return tu(M,h)})}return tu(M,h)}function fh(u,h){return go(u,h),x(void 0)}function hh(u){let h=u._readable,M=u._transformStreamController,O=M._flushAlgorithm();return Ql(M),P(O,()=>{if(h._state==="errored")throw h._storedError;Kn(h._readableStreamController)},B=>{throw go(u,B),h._storedError})}function dh(u){return bo(u,!1),u._backpressureChangePromise}function ts(u){return new TypeError(`TransformStreamDefaultController.prototype.${u} can only be used on a TransformStreamDefaultController`)}function ru(u){return new TypeError(`TransformStream.prototype.${u} can only be used on a TransformStream`)}t.ByteLengthQueuingStrategy=ho,t.CountQueuingStrategy=mo,t.ReadableByteStreamController=Ye,t.ReadableStream=Yr,t.ReadableStreamBYOBReader=Ki,t.ReadableStreamBYOBRequest=Fn,t.ReadableStreamDefaultController=tn,t.ReadableStreamDefaultReader=Y,t.TransformStream=po,t.TransformStreamDefaultController=es,t.WritableStream=Ji,t.WritableStreamDefaultController=Qi,t.WritableStreamDefaultWriter=Xi,Object.defineProperty(t,"__esModule",{value:!0})})});var N9=G(()=>{if(!globalThis.ReadableStream)try{let t=require("process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("stream/web")),t.emitWarning=e}catch(r){throw t.emitWarning=e,r}}catch{Object.assign(globalThis,k9())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=function(r){let i=0,n=this;return new ReadableStream({type:"bytes",async pull(o){let c=await n.slice(i,Math.min(n.size,i+65536)).arrayBuffer();i+=c.byteLength,o.enqueue(new Uint8Array(c)),i===n.size&&o.close()}})})}catch{}});async function*Q0(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let i=r.byteOffset,n=r.byteOffset+r.byteLength;for(;i!==n;){let o=Math.min(n-i,B9),a=r.buffer.slice(i,i+o);i+=a.byteLength,yield new Uint8Array(a)}}else yield r;else{let i=0,n=r;for(;i!==n.size;){let a=await n.slice(i,Math.min(n.size,i+B9)).arrayBuffer();i+=a.byteLength,yield new Uint8Array(a)}}}var dI,B9,Li,T1,Fo,Zu,$o,D9,FS,ki,P1=u1(()=>{dI=me(N9(),1);B9=65536;D9=($o=class{constructor(e=[],r={}){St(this,Li,[]);St(this,T1,"");St(this,Fo,0);St(this,Zu,"transparent");if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let i=new TextEncoder;for(let o of e){let a;ArrayBuffer.isView(o)?a=new Uint8Array(o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)):o instanceof ArrayBuffer?a=new Uint8Array(o.slice(0)):o instanceof $o?a=o:a=i.encode(`${o}`),et(this,Fo,Ee(this,Fo)+(ArrayBuffer.isView(a)?a.byteLength:a.size)),Ee(this,Li).push(a)}et(this,Zu,`${r.endings===void 0?"transparent":r.endings}`);let n=r.type===void 0?"":String(r.type);et(this,T1,/^[\x20-\x7E]*$/.test(n)?n:"")}get size(){return Ee(this,Fo)}get type(){return Ee(this,T1)}async text(){let e=new TextDecoder,r="";for await(let i of Q0(Ee(this,Li),!1))r+=e.decode(i,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let i of Q0(Ee(this,Li),!1))e.set(i,r),r+=i.length;return e.buffer}stream(){let e=Q0(Ee(this,Li),!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let i=await e.next();i.done?r.close():r.enqueue(i.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,i=""){let{size:n}=this,o=e<0?Math.max(n+e,0):Math.min(e,n),a=r<0?Math.max(n+r,0):Math.min(r,n),c=Math.max(a-o,0),d=Ee(this,Li),p=[],m=0;for(let x of d){if(m>=c)break;let w=ArrayBuffer.isView(x)?x.byteLength:x.size;if(o&&w<=o)o-=w,a-=w;else{let b;ArrayBuffer.isView(x)?(b=x.subarray(o,Math.min(w,a)),m+=b.byteLength):(b=x.slice(o,Math.min(w,a)),m+=b.size),a-=w,p.push(b),o=0}}let v=new $o([],{type:String(i).toLowerCase()});return et(v,Fo,c),et(v,Li,p),v}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}},Li=new WeakMap,T1=new WeakMap,Fo=new WeakMap,Zu=new WeakMap,$o);Object.defineProperties(D9.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});FS=D9,ki=FS});var O1,I1,z9,$S,qS,qo,ed=u1(()=>{P1();$S=(z9=class extends ki{constructor(r,i,n={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(r,n);St(this,O1,0);St(this,I1,"");n===null&&(n={});let o=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(o)||et(this,O1,o),et(this,I1,String(i))}get name(){return Ee(this,I1)}get lastModified(){return Ee(this,O1)}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](r){return!!r&&r instanceof ki&&/^(File)$/.test(r[Symbol.toStringTag])}},O1=new WeakMap,I1=new WeakMap,z9),qS=$S,qo=qS});function q9(t,e=ki){var r=`${j9()}${j9()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),i=[],n=`--${r}\r
|
|
96
|
-
Content-Disposition: form-data; name="`;return t.forEach((o,a)=>typeof o=="string"?i.push(n+td(a)+`"\r
|
|
97
|
-
\r
|
|
98
|
-
${o.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
99
|
-
`)}\r
|
|
100
|
-
`):i.push(n+td(a)+`"; filename="${td(o.name,1)}"\r
|
|
101
|
-
Content-Type: ${o.type||"application/octet-stream"}\r
|
|
102
|
-
\r
|
|
103
|
-
`,o,`\r
|
|
104
|
-
`)),i.push(`--${r}--`),new e(i,{type:"multipart/form-data; boundary="+r})}var L1,HS,WS,j9,US,F9,td,vs,Sr,$9,ws,Yu=u1(()=>{P1();ed();({toStringTag:L1,iterator:HS,hasInstance:WS}=Symbol),j9=Math.random,US="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),F9=(t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[L1])?[(r=r!==void 0?r+"":e[L1]=="File"?e.name:"blob",t),e.name!==r||e[L1]=="blob"?new qo([e],r,e):e]:[t,e+""]),td=(t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
|
|
105
|
-
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),vs=(t,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${t}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},ws=($9=class{constructor(...e){St(this,Sr,[]);if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[L1](){return"FormData"}[HS](){return this.entries()}static[WS](e){return e&&typeof e=="object"&&e[L1]==="FormData"&&!US.some(r=>typeof e[r]!="function")}append(...e){vs("append",arguments,2),Ee(this,Sr).push(F9(...e))}delete(e){vs("delete",arguments,1),e+="",et(this,Sr,Ee(this,Sr).filter(([r])=>r!==e))}get(e){vs("get",arguments,1),e+="";for(var r=Ee(this,Sr),i=r.length,n=0;n<i;n++)if(r[n][0]===e)return r[n][1];return null}getAll(e,r){return vs("getAll",arguments,1),r=[],e+="",Ee(this,Sr).forEach(i=>i[0]===e&&r.push(i[1])),r}has(e){return vs("has",arguments,1),e+="",Ee(this,Sr).some(r=>r[0]===e)}forEach(e,r){vs("forEach",arguments,1);for(var[i,n]of this)e.call(r,n,i,this)}set(...e){vs("set",arguments,2);var r=[],i=!0;e=F9(...e),Ee(this,Sr).forEach(n=>{n[0]===e[0]?i&&(i=!r.push(e)):r.push(n)}),i&&r.push(e),et(this,Sr,r)}*entries(){yield*Ee(this,Sr)}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}},Sr=new WeakMap,$9)});var G9=G((RI,U9)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),e=new t().port1,r=new ArrayBuffer;e.postMessage(r,[r,r])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}U9.exports=globalThis.DOMException});var N1,K9,GS,_s,Ss,id,V9,nd=u1(()=>{N1=require("fs"),K9=me(G9(),1);ed();P1();({stat:GS}=N1.promises),id=class{constructor(e){St(this,_s,void 0);St(this,Ss,void 0);et(this,_s,e.path),et(this,Ss,e.start),this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new id({path:Ee(this,_s),lastModified:this.lastModified,size:r-e,start:Ee(this,Ss)+e})}async*stream(){let{mtimeMs:e}=await GS(Ee(this,_s));if(e>this.lastModified)throw new K9.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,N1.createReadStream)(Ee(this,_s),{start:Ee(this,Ss),end:Ee(this,Ss)+this.size-1})}get[Symbol.toStringTag](){return"Blob"}},V9=id;_s=new WeakMap,Ss=new WeakMap});var Z9={};q2(Z9,{toFormData:()=>QS});function XS(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",i=r.slice(r.lastIndexOf("\\")+1);return i=i.replace(/%22/g,'"'),i=i.replace(/&#(\d{4});/g,(n,o)=>String.fromCharCode(o)),i}async function QS(t,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let r=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let i=new sd(r[1]||r[2]),n,o,a,c,d,p,m=[],v=new ws,x=C=>{a+=A.decode(C,{stream:!0})},w=C=>{m.push(C)},b=()=>{let C=new qo(m,p,{type:d});v.append(c,C)},E=()=>{v.append(c,a)},A=new TextDecoder("utf-8");A.decode(),i.onPartBegin=function(){i.onPartData=x,i.onPartEnd=E,n="",o="",a="",c="",d="",p=null,m.length=0},i.onHeaderField=function(C){n+=A.decode(C,{stream:!0})},i.onHeaderValue=function(C){o+=A.decode(C,{stream:!0})},i.onHeaderEnd=function(){if(o+=A.decode(),n=n.toLowerCase(),n==="content-disposition"){let C=o.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);C&&(c=C[2]||C[3]||""),p=XS(o),p&&(i.onPartData=w,i.onPartEnd=b)}else n==="content-type"&&(d=o);o="",n=""};for await(let C of t)i.write(C);return i.end(),v}var li,Je,J9,Sn,Qu,ec,VS,B1,KS,JS,ZS,YS,xs,sd,Y9=u1(()=>{nd();Yu();li=0,Je={START_BOUNDARY:li++,HEADER_FIELD_START:li++,HEADER_FIELD:li++,HEADER_VALUE_START:li++,HEADER_VALUE:li++,HEADER_VALUE_ALMOST_DONE:li++,HEADERS_ALMOST_DONE:li++,PART_DATA_START:li++,PART_DATA:li++,END:li++},J9=1,Sn={PART_BOUNDARY:J9,LAST_BOUNDARY:J9*=2},Qu=10,ec=13,VS=32,B1=45,KS=58,JS=97,ZS=122,YS=t=>t|32,xs=()=>{},sd=class{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=xs,this.onHeaderField=xs,this.onHeadersEnd=xs,this.onHeaderValue=xs,this.onPartBegin=xs,this.onPartData=xs,this.onPartEnd=xs,this.boundaryChars={},e=`\r
|
|
106
|
-
--`+e;let r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i),this.boundaryChars[r[i]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Je.START_BOUNDARY}write(e){let r=0,i=e.length,n=this.index,{lookbehind:o,boundary:a,boundaryChars:c,index:d,state:p,flags:m}=this,v=this.boundary.length,x=v-1,w=e.length,b,E,A=k=>{this[k+"Mark"]=r},C=k=>{delete this[k+"Mark"]},P=(k,z,U,Z)=>{(z===void 0||z!==U)&&this[k](Z&&Z.subarray(z,U))},L=(k,z)=>{let U=k+"Mark";U in this&&(z?(P(k,this[U],r,e),delete this[U]):(P(k,this[U],e.length,e),this[U]=0))};for(r=0;r<i;r++)switch(b=e[r],p){case Je.START_BOUNDARY:if(d===a.length-2){if(b===B1)m|=Sn.LAST_BOUNDARY;else if(b!==ec)return;d++;break}else if(d-1===a.length-2){if(m&Sn.LAST_BOUNDARY&&b===B1)p=Je.END,m=0;else if(!(m&Sn.LAST_BOUNDARY)&&b===Qu)d=0,P("onPartBegin"),p=Je.HEADER_FIELD_START;else return;break}b!==a[d+2]&&(d=-2),b===a[d+2]&&d++;break;case Je.HEADER_FIELD_START:p=Je.HEADER_FIELD,A("onHeaderField"),d=0;case Je.HEADER_FIELD:if(b===ec){C("onHeaderField"),p=Je.HEADERS_ALMOST_DONE;break}if(d++,b===B1)break;if(b===KS){if(d===1)return;L("onHeaderField",!0),p=Je.HEADER_VALUE_START;break}if(E=YS(b),E<JS||E>ZS)return;break;case Je.HEADER_VALUE_START:if(b===VS)break;A("onHeaderValue"),p=Je.HEADER_VALUE;case Je.HEADER_VALUE:b===ec&&(L("onHeaderValue",!0),P("onHeaderEnd"),p=Je.HEADER_VALUE_ALMOST_DONE);break;case Je.HEADER_VALUE_ALMOST_DONE:if(b!==Qu)return;p=Je.HEADER_FIELD_START;break;case Je.HEADERS_ALMOST_DONE:if(b!==Qu)return;P("onHeadersEnd"),p=Je.PART_DATA_START;break;case Je.PART_DATA_START:p=Je.PART_DATA,A("onPartData");case Je.PART_DATA:if(n=d,d===0){for(r+=x;r<w&&!(e[r]in c);)r+=v;r-=x,b=e[r]}if(d<a.length)a[d]===b?(d===0&&L("onPartData",!0),d++):d=0;else if(d===a.length)d++,b===ec?m|=Sn.PART_BOUNDARY:b===B1?m|=Sn.LAST_BOUNDARY:d=0;else if(d-1===a.length)if(m&Sn.PART_BOUNDARY){if(d=0,b===Qu){m&=~Sn.PART_BOUNDARY,P("onPartEnd"),P("onPartBegin"),p=Je.HEADER_FIELD_START;break}}else m&Sn.LAST_BOUNDARY&&b===B1?(P("onPartEnd"),p=Je.END,m=0):d=0;if(d>0)o[d-1]=b;else if(n>0){let k=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);P("onPartData",0,n,k),n=0,A("onPartData"),r--}break;case Je.END:break;default:throw new Error(`Unexpected state entered: ${p}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=d,this.state=p,this.flags=m}end(){if(this.state===Je.HEADER_FIELD_START&&this.index===0||this.state===Je.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Je.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var kg=G((LN,Lg)=>{"use strict";Lg.exports=Cc;Cc.polyline=Cc;Cc.polygon=gM;function Cc(t,e,r){var i=t.length,n=ua(t[0],e),o=[],a,c,d,p,m;for(r||(r=[]),a=1;a<i;a++){for(c=t[a-1],d=t[a],p=m=ua(d,e);;)if(n|p){if(n&p)break;n?(c=wd(c,d,n,e),n=ua(c,e)):(d=wd(c,d,p,e),p=ua(d,e))}else{o.push(c),p!==m?(o.push(d),a<i-1&&(r.push(o),o=[])):a===i-1&&o.push(d);break}n=m}return o.length&&r.push(o),r}function gM(t,e){var r,i,n,o,a,c,d;for(i=1;i<=8;i*=2){for(r=[],n=t[t.length-1],o=!(ua(n,e)&i),a=0;a<t.length;a++)c=t[a],d=!(ua(c,e)&i),d!==o&&r.push(wd(n,c,i,e)),d&&r.push(c),n=c,o=d;if(t=r,!t.length)break}return r}function wd(t,e,r,i){return r&8?[t[0]+(e[0]-t[0])*(i[3]-t[1])/(e[1]-t[1]),i[3]]:r&4?[t[0]+(e[0]-t[0])*(i[1]-t[1])/(e[1]-t[1]),i[1]]:r&2?[i[2],t[1]+(e[1]-t[1])*(i[2]-t[0])/(e[0]-t[0])]:r&1?[i[0],t[1]+(e[1]-t[1])*(i[0]-t[0])/(e[0]-t[0])]:null}function ua(t,e){var r=0;return t[0]<e[0]?r|=1:t[0]>e[2]&&(r|=2),t[1]<e[1]?r|=4:t[1]>e[3]&&(r|=8),r}});var Ng=G((_d,Sd)=>{(function(t,e){typeof _d=="object"&&typeof Sd<"u"?Sd.exports=e():typeof define=="function"&&define.amd?define(e):t.SplayTree=e()})(_d,function(){"use strict";var t=function(){function b(E,A){this.next=null,this.key=E,this.data=A,this.left=null,this.right=null}return b}();function e(b,E){return b>E?1:b<E?-1:0}function r(b,E,A){for(var C=new t(null,null),P=C,L=C;;){var k=A(b,E.key);if(k<0){if(E.left===null)break;if(A(b,E.left.key)<0){var z=E.left;if(E.left=z.right,z.right=E,E=z,E.left===null)break}L.left=E,L=E,E=E.left}else if(k>0){if(E.right===null)break;if(A(b,E.right.key)>0){var z=E.right;if(E.right=z.left,z.left=E,E=z,E.right===null)break}P.right=E,P=E,E=E.right}else break}return P.right=E.left,L.left=E.right,E.left=C.right,E.right=C.left,E}function i(b,E,A,C){var P=new t(b,E);if(A===null)return P.left=P.right=null,P;A=r(b,A,C);var L=C(b,A.key);return L<0?(P.left=A.left,P.right=A,A.left=null):L>=0&&(P.right=A.right,P.left=A,A.right=null),P}function n(b,E,A){var C=null,P=null;if(E){E=r(b,E,A);var L=A(E.key,b);L===0?(C=E.left,P=E.right):L<0?(P=E.right,E.right=null,C=E):(C=E.left,E.left=null,P=E)}return{left:C,right:P}}function o(b,E,A){return E===null?b:(b===null||(E=r(b.key,E,A),E.left=b),E)}function a(b,E,A,C,P){if(b){C(""+E+(A?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+P(b)+`
|
|
107
|
-
`);var L=E+(A?" ":"\u2502 ");b.left&&a(b.left,L,!1,C,P),b.right&&a(b.right,L,!0,C,P)}}var c=function(){function b(E){E===void 0&&(E=e),this._root=null,this._size=0,this._comparator=E}return b.prototype.insert=function(E,A){return this._size++,this._root=i(E,A,this._root,this._comparator)},b.prototype.add=function(E,A){var C=new t(E,A);this._root===null&&(C.left=C.right=null,this._size++,this._root=C);var P=this._comparator,L=r(E,this._root,P),k=P(E,L.key);return k===0?this._root=L:(k<0?(C.left=L.left,C.right=L,L.left=null):k>0&&(C.right=L.right,C.left=L,L.right=null),this._size++,this._root=C),this._root},b.prototype.remove=function(E){this._root=this._remove(E,this._root,this._comparator)},b.prototype._remove=function(E,A,C){var P;if(A===null)return null;A=r(E,A,C);var L=C(E,A.key);return L===0?(A.left===null?P=A.right:(P=r(E,A.left,C),P.right=A.right),this._size--,P):A},b.prototype.pop=function(){var E=this._root;if(E){for(;E.left;)E=E.left;return this._root=r(E.key,this._root,this._comparator),this._root=this._remove(E.key,this._root,this._comparator),{key:E.key,data:E.data}}return null},b.prototype.findStatic=function(E){for(var A=this._root,C=this._comparator;A;){var P=C(E,A.key);if(P===0)return A;P<0?A=A.left:A=A.right}return null},b.prototype.find=function(E){return this._root&&(this._root=r(E,this._root,this._comparator),this._comparator(E,this._root.key)!==0)?null:this._root},b.prototype.contains=function(E){for(var A=this._root,C=this._comparator;A;){var P=C(E,A.key);if(P===0)return!0;P<0?A=A.left:A=A.right}return!1},b.prototype.forEach=function(E,A){for(var C=this._root,P=[],L=!1;!L;)C!==null?(P.push(C),C=C.left):P.length!==0?(C=P.pop(),E.call(A,C),C=C.right):L=!0;return this},b.prototype.range=function(E,A,C,P){for(var L=[],k=this._comparator,z=this._root,U;L.length!==0||z;)if(z)L.push(z),z=z.left;else{if(z=L.pop(),U=k(z.key,A),U>0)break;if(k(z.key,E)>=0&&C.call(P,z))return this;z=z.right}return this},b.prototype.keys=function(){var E=[];return this.forEach(function(A){var C=A.key;return E.push(C)}),E},b.prototype.values=function(){var E=[];return this.forEach(function(A){var C=A.data;return E.push(C)}),E},b.prototype.min=function(){return this._root?this.minNode(this._root).key:null},b.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},b.prototype.minNode=function(E){if(E===void 0&&(E=this._root),E)for(;E.left;)E=E.left;return E},b.prototype.maxNode=function(E){if(E===void 0&&(E=this._root),E)for(;E.right;)E=E.right;return E},b.prototype.at=function(E){for(var A=this._root,C=!1,P=0,L=[];!C;)if(A)L.push(A),A=A.left;else if(L.length>0){if(A=L.pop(),P===E)return A;P++,A=A.right}else C=!0;return null},b.prototype.next=function(E){var A=this._root,C=null;if(E.right){for(C=E.right;C.left;)C=C.left;return C}for(var P=this._comparator;A;){var L=P(E.key,A.key);if(L===0)break;L<0?(C=A,A=A.left):A=A.right}return C},b.prototype.prev=function(E){var A=this._root,C=null;if(E.left!==null){for(C=E.left;C.right;)C=C.right;return C}for(var P=this._comparator;A;){var L=P(E.key,A.key);if(L===0)break;L<0?A=A.left:(C=A,A=A.right)}return C},b.prototype.clear=function(){return this._root=null,this._size=0,this},b.prototype.toList=function(){return m(this._root)},b.prototype.load=function(E,A,C){A===void 0&&(A=[]),C===void 0&&(C=!1);var P=E.length,L=this._comparator;if(C&&w(E,A,0,P-1,L),this._root===null)this._root=d(E,A,0,P),this._size=P;else{var k=x(this.toList(),p(E,A),L);P=this._size+P,this._root=v({head:k},0,P)}return this},b.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(b.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),b.prototype.toString=function(E){E===void 0&&(E=function(C){return String(C.key)});var A=[];return a(this._root,"",!0,function(C){return A.push(C)},E),A.join("")},b.prototype.update=function(E,A,C){var P=this._comparator,L=n(E,this._root,P),k=L.left,z=L.right;P(E,A)<0?z=i(A,C,z,P):k=i(A,C,k,P),this._root=o(k,z,P)},b.prototype.split=function(E){return n(E,this._root,this._comparator)},b}();function d(b,E,A,C){var P=C-A;if(P>0){var L=A+Math.floor(P/2),k=b[L],z=E[L],U=new t(k,z);return U.left=d(b,E,A,L),U.right=d(b,E,L+1,C),U}return null}function p(b,E){for(var A=new t(null,null),C=A,P=0;P<b.length;P++)C=C.next=new t(b[P],E[P]);return C.next=null,A.next}function m(b){for(var E=b,A=[],C=!1,P=new t(null,null),L=P;!C;)E?(A.push(E),E=E.left):A.length>0?(E=L=L.next=A.pop(),E=E.right):C=!0;return L.next=null,P.next}function v(b,E,A){var C=A-E;if(C>0){var P=E+Math.floor(C/2),L=v(b,E,P),k=b.head;return k.left=L,b.head=b.head.next,k.right=v(b,P+1,A),k}return null}function x(b,E,A){for(var C=new t(null,null),P=C,L=b,k=E;L!==null&&k!==null;)A(L.key,k.key)<0?(P.next=L,L=L.next):(P.next=k,k=k.next),P=P.next;return L!==null?P.next=L:k!==null&&(P.next=k),C.next}function w(b,E,A,C,P){if(!(A>=C)){for(var L=b[A+C>>1],k=A-1,z=C+1;;){do k++;while(P(b[k],L)<0);do z--;while(P(b[z],L)>0);if(k>=z)break;var U=b[k];b[k]=b[z],b[z]=U,U=E[k],E[k]=E[z],E[z]=U}w(b,E,A,z,P),w(b,E,z+1,C,P)}}return c})});var Vg=G((kN,Gg)=>{"use strict";var yM=Ng();function bM(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var Ed=bM(yM);function Tr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bg(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ft(t,e,r){return e&&Bg(t.prototype,e),r&&Bg(t,r),t}var U1=function(e,r){return e.ll.x<=r.x&&r.x<=e.ur.x&&e.ll.y<=r.y&&r.y<=e.ur.y},xd=function(e,r){if(r.ur.x<e.ll.x||e.ur.x<r.ll.x||r.ur.y<e.ll.y||e.ur.y<r.ll.y)return null;var i=e.ll.x<r.ll.x?r.ll.x:e.ll.x,n=e.ur.x<r.ur.x?e.ur.x:r.ur.x,o=e.ll.y<r.ll.y?r.ll.y:e.ll.y,a=e.ur.y<r.ur.y?e.ur.y:r.ur.y;return{ll:{x:i,y:o},ur:{x:n,y:a}}},Cn=Number.EPSILON;Cn===void 0&&(Cn=Math.pow(2,-52));var vM=Cn*Cn,Md=function(e,r){if(-Cn<e&&e<Cn&&-Cn<r&&r<Cn)return 0;var i=e-r;return i*i<vM*e*r?0:e<r?-1:1},wM=function(){function t(){Tr(this,t),this.reset()}return Ft(t,[{key:"reset",value:function(){this.xRounder=new Dg,this.yRounder=new Dg}},{key:"round",value:function(r,i){return{x:this.xRounder.round(r),y:this.yRounder.round(i)}}}]),t}(),Dg=function(){function t(){Tr(this,t),this.tree=new Ed.default,this.round(0)}return Ft(t,[{key:"round",value:function(r){var i=this.tree.add(r),n=this.tree.prev(i);if(n!==null&&Md(i.key,n.key)===0)return this.tree.remove(r),n.key;var o=this.tree.next(i);return o!==null&&Md(i.key,o.key)===0?(this.tree.remove(r),o.key):r}}]),t}(),V1=new wM,G1=function(e,r){return e.x*r.y-e.y*r.x},Ug=function(e,r){return e.x*r.x+e.y*r.y},zg=function(e,r,i){var n={x:r.x-e.x,y:r.y-e.y},o={x:i.x-e.x,y:i.y-e.y},a=G1(n,o);return Md(a,0)},Ac=function(e){return Math.sqrt(Ug(e,e))},_M=function(e,r,i){var n={x:r.x-e.x,y:r.y-e.y},o={x:i.x-e.x,y:i.y-e.y};return G1(o,n)/Ac(o)/Ac(n)},SM=function(e,r,i){var n={x:r.x-e.x,y:r.y-e.y},o={x:i.x-e.x,y:i.y-e.y};return Ug(o,n)/Ac(o)/Ac(n)},jg=function(e,r,i){return r.y===0?null:{x:e.x+r.x/r.y*(i-e.y),y:i}},Fg=function(e,r,i){return r.x===0?null:{x:i,y:e.y+r.y/r.x*(i-e.x)}},xM=function(e,r,i,n){if(r.x===0)return Fg(i,n,e.x);if(n.x===0)return Fg(e,r,i.x);if(r.y===0)return jg(i,n,e.y);if(n.y===0)return jg(e,r,i.y);var o=G1(r,n);if(o==0)return null;var a={x:i.x-e.x,y:i.y-e.y},c=G1(a,r)/o,d=G1(a,n)/o,p=e.x+d*r.x,m=i.x+c*n.x,v=e.y+d*r.y,x=i.y+c*n.y,w=(p+m)/2,b=(v+x)/2;return{x:w,y:b}},di=function(){Ft(t,null,[{key:"compare",value:function(r,i){var n=t.comparePoints(r.point,i.point);return n!==0?n:(r.point!==i.point&&r.link(i),r.isLeft!==i.isLeft?r.isLeft?1:-1:Tc.compare(r.segment,i.segment))}},{key:"comparePoints",value:function(r,i){return r.x<i.x?-1:r.x>i.x?1:r.y<i.y?-1:r.y>i.y?1:0}}]);function t(e,r){Tr(this,t),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=r}return Ft(t,[{key:"link",value:function(r){if(r.point===this.point)throw new Error("Tried to link already linked events");for(var i=r.point.events,n=0,o=i.length;n<o;n++){var a=i[n];this.point.events.push(a),a.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var r=this.point.events.length,i=0;i<r;i++){var n=this.point.events[i];if(n.segment.consumedBy===void 0)for(var o=i+1;o<r;o++){var a=this.point.events[o];a.consumedBy===void 0&&n.otherSE.point.events===a.otherSE.point.events&&n.segment.consume(a.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var r=[],i=0,n=this.point.events.length;i<n;i++){var o=this.point.events[i];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&r.push(o)}return r}},{key:"getLeftmostComparator",value:function(r){var i=this,n=new Map,o=function(c){var d=c.otherSE;n.set(c,{sine:_M(i.point,r.point,d.point),cosine:SM(i.point,r.point,d.point)})};return function(a,c){n.has(a)||o(a),n.has(c)||o(c);var d=n.get(a),p=d.sine,m=d.cosine,v=n.get(c),x=v.sine,w=v.cosine;return p>=0&&x>=0?m<w?1:m>w?-1:0:p<0&&x<0?m<w?-1:m>w?1:0:x<p?-1:x>p?1:0}}}]),t}(),MM=0,Tc=function(){Ft(t,null,[{key:"compare",value:function(r,i){var n=r.leftSE.point.x,o=i.leftSE.point.x,a=r.rightSE.point.x,c=i.rightSE.point.x;if(c<n)return 1;if(a<o)return-1;var d=r.leftSE.point.y,p=i.leftSE.point.y,m=r.rightSE.point.y,v=i.rightSE.point.y;if(n<o){if(p<d&&p<m)return 1;if(p>d&&p>m)return-1;var x=r.comparePoint(i.leftSE.point);if(x<0)return 1;if(x>0)return-1;var w=i.comparePoint(r.rightSE.point);return w!==0?w:-1}if(n>o){if(d<p&&d<v)return-1;if(d>p&&d>v)return 1;var b=i.comparePoint(r.leftSE.point);if(b!==0)return b;var E=r.comparePoint(i.rightSE.point);return E<0?1:E>0?-1:1}if(d<p)return-1;if(d>p)return 1;if(a<c){var A=i.comparePoint(r.rightSE.point);if(A!==0)return A}if(a>c){var C=r.comparePoint(i.rightSE.point);if(C<0)return 1;if(C>0)return-1}if(a!==c){var P=m-d,L=a-n,k=v-p,z=c-o;if(P>L&&k<z)return 1;if(P<L&&k>z)return-1}return a>c?1:a<c||m<v?-1:m>v?1:r.id<i.id?-1:r.id>i.id?1:0}}]);function t(e,r,i,n){Tr(this,t),this.id=++MM,this.leftSE=e,e.segment=this,e.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=e,this.rings=i,this.windings=n}return Ft(t,[{key:"replaceRightSE",value:function(r){this.rightSE=r,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var r=this.leftSE.point.y,i=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:r<i?r:i},ur:{x:this.rightSE.point.x,y:r>i?r:i}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(r){return r.x===this.leftSE.point.x&&r.y===this.leftSE.point.y||r.x===this.rightSE.point.x&&r.y===this.rightSE.point.y}},{key:"comparePoint",value:function(r){if(this.isAnEndpoint(r))return 0;var i=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(i.x===n.x)return r.x===i.x?0:r.x<i.x?1:-1;var a=(r.y-i.y)/o.y,c=i.x+a*o.x;if(r.x===c)return 0;var d=(r.x-i.x)/o.x,p=i.y+d*o.y;return r.y===p?0:r.y<p?-1:1}},{key:"getIntersection",value:function(r){var i=this.bbox(),n=r.bbox(),o=xd(i,n);if(o===null)return null;var a=this.leftSE.point,c=this.rightSE.point,d=r.leftSE.point,p=r.rightSE.point,m=U1(i,d)&&this.comparePoint(d)===0,v=U1(n,a)&&r.comparePoint(a)===0,x=U1(i,p)&&this.comparePoint(p)===0,w=U1(n,c)&&r.comparePoint(c)===0;if(v&&m)return w&&!x?c:!w&&x?p:null;if(v)return x&&a.x===p.x&&a.y===p.y?null:a;if(m)return w&&c.x===d.x&&c.y===d.y?null:d;if(w&&x)return null;if(w)return c;if(x)return p;var b=xM(a,this.vector(),d,r.vector());return b===null||!U1(o,b)?null:V1.round(b.x,b.y)}},{key:"split",value:function(r){var i=[],n=r.events!==void 0,o=new di(r,!0),a=new di(r,!1),c=this.rightSE;this.replaceRightSE(a),i.push(a),i.push(o);var d=new t(o,c,this.rings.slice(),this.windings.slice());return di.comparePoints(d.leftSE.point,d.rightSE.point)>0&&d.swapEvents(),di.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),a.checkForConsuming()),i}},{key:"swapEvents",value:function(){var r=this.rightSE;this.rightSE=this.leftSE,this.leftSE=r,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var i=0,n=this.windings.length;i<n;i++)this.windings[i]*=-1}},{key:"consume",value:function(r){for(var i=this,n=r;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var o=t.compare(i,n);if(o!==0){if(o>0){var a=i;i=n,n=a}if(i.prev===n){var c=i;i=n,n=c}for(var d=0,p=n.rings.length;d<p;d++){var m=n.rings[d],v=n.windings[d],x=i.rings.indexOf(m);x===-1?(i.rings.push(m),i.windings.push(v)):i.windings[x]+=v}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var r=this.prev.consumedBy||this.prev;this._beforeState=r.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var r=this.beforeState();this._afterState={rings:r.rings.slice(0),windings:r.windings.slice(0),multiPolys:[]};for(var i=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys,a=0,c=this.rings.length;a<c;a++){var d=this.rings[a],p=this.windings[a],m=i.indexOf(d);m===-1?(i.push(d),n.push(p)):n[m]+=p}for(var v=[],x=[],w=0,b=i.length;w<b;w++)if(n[w]!==0){var E=i[w],A=E.poly;if(x.indexOf(A)===-1)if(E.isExterior)v.push(A);else{x.indexOf(A)===-1&&x.push(A);var C=v.indexOf(E.poly);C!==-1&&v.splice(C,1)}}for(var P=0,L=v.length;P<L;P++){var k=v[P].multiPoly;o.indexOf(k)===-1&&o.push(k)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var r=this.beforeState().multiPolys,i=this.afterState().multiPolys;switch(Ur.type){case"union":{var n=r.length===0,o=i.length===0;this._isInResult=n!==o;break}case"intersection":{var a,c;r.length<i.length?(a=r.length,c=i.length):(a=i.length,c=r.length),this._isInResult=c===Ur.numMultiPolys&&a<c;break}case"xor":{var d=Math.abs(r.length-i.length);this._isInResult=d%2===1;break}case"difference":{var p=function(v){return v.length===1&&v[0].isSubject};this._isInResult=p(r)!==p(i);break}default:throw new Error("Unrecognized operation type found ".concat(Ur.type))}return this._isInResult}}],[{key:"fromRing",value:function(r,i,n){var o,a,c,d=di.comparePoints(r,i);if(d<0)o=r,a=i,c=1;else if(d>0)o=i,a=r,c=-1;else throw new Error("Tried to create degenerate segment at [".concat(r.x,", ").concat(r.y,"]"));var p=new di(o,!0),m=new di(a,!1);return new t(p,m,[n],[c])}}]),t}(),$g=function(){function t(e,r,i){if(Tr(this,t),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=V1.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var o=n,a=1,c=e.length;a<c;a++){if(typeof e[a][0]!="number"||typeof e[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var d=V1.round(e[a][0],e[a][1]);d.x===o.x&&d.y===o.y||(this.segments.push(Tc.fromRing(o,d,this)),d.x<this.bbox.ll.x&&(this.bbox.ll.x=d.x),d.y<this.bbox.ll.y&&(this.bbox.ll.y=d.y),d.x>this.bbox.ur.x&&(this.bbox.ur.x=d.x),d.y>this.bbox.ur.y&&(this.bbox.ur.y=d.y),o=d)}(n.x!==o.x||n.y!==o.y)&&this.segments.push(Tc.fromRing(o,n,this))}return Ft(t,[{key:"getSweepEvents",value:function(){for(var r=[],i=0,n=this.segments.length;i<n;i++){var o=this.segments[i];r.push(o.leftSE),r.push(o.rightSE)}return r}}]),t}(),EM=function(){function t(e,r){if(Tr(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new $g(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,n=e.length;i<n;i++){var o=new $g(e[i],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=r}return Ft(t,[{key:"getSweepEvents",value:function(){for(var r=this.exteriorRing.getSweepEvents(),i=0,n=this.interiorRings.length;i<n;i++)for(var o=this.interiorRings[i].getSweepEvents(),a=0,c=o.length;a<c;a++)r.push(o[a]);return r}}]),t}(),qg=function(){function t(e,r){if(Tr(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,n=e.length;i<n;i++){var o=new EM(e[i],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=r}return Ft(t,[{key:"getSweepEvents",value:function(){for(var r=[],i=0,n=this.polys.length;i<n;i++)for(var o=this.polys[i].getSweepEvents(),a=0,c=o.length;a<c;a++)r.push(o[a]);return r}}]),t}(),RM=function(){Ft(t,null,[{key:"factory",value:function(r){for(var i=[],n=0,o=r.length;n<o;n++){var a=r[n];if(!(!a.isInResult()||a.ringOut)){for(var c=null,d=a.leftSE,p=a.rightSE,m=[d],v=d.point,x=[];c=d,d=p,m.push(d),d.point!==v;)for(;;){var w=d.getAvailableLinkedEvents();if(w.length===0){var b=m[0].point,E=m[m.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(b.x,",")+" ".concat(b.y,"]. Last matching segment found ends at")+" [".concat(E.x,", ").concat(E.y,"]."))}if(w.length===1){p=w[0].otherSE;break}for(var A=null,C=0,P=x.length;C<P;C++)if(x[C].point===d.point){A=C;break}if(A!==null){var L=x.splice(A)[0],k=m.splice(L.index);k.unshift(k[0].otherSE),i.push(new t(k.reverse()));continue}x.push({index:m.length,point:d.point});var z=d.getLeftmostComparator(c);p=w.sort(z)[0].otherSE;break}i.push(new t(m))}}return i}}]);function t(e){Tr(this,t),this.events=e;for(var r=0,i=e.length;r<i;r++)e[r].segment.ringOut=this;this.poly=null}return Ft(t,[{key:"getGeom",value:function(){for(var r=this.events[0].point,i=[r],n=1,o=this.events.length-1;n<o;n++){var a=this.events[n].point,c=this.events[n+1].point;zg(a,r,c)!==0&&(i.push(a),r=a)}if(i.length===1)return null;var d=i[0],p=i[1];zg(d,r,p)===0&&i.shift(),i.push(i[0]);for(var m=this.isExteriorRing()?1:-1,v=this.isExteriorRing()?0:i.length-1,x=this.isExteriorRing()?i.length:-1,w=[],b=v;b!=x;b+=m)w.push([i[b].x,i[b].y]);return w}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var r=this.enclosingRing();this._isExteriorRing=r?!r.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var r=this.events[0],i=1,n=this.events.length;i<n;i++){var o=this.events[i];di.compare(r,o)>0&&(r=o)}for(var a=r.segment.prevInResult(),c=a?a.prevInResult():null;;){if(!a)return null;if(!c)return a.ringOut;if(c.ringOut!==a.ringOut)return c.ringOut.enclosingRing()!==a.ringOut?a.ringOut:a.ringOut.enclosingRing();a=c.prevInResult(),c=a?a.prevInResult():null}}}]),t}(),Hg=function(){function t(e){Tr(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Ft(t,[{key:"addInterior",value:function(r){this.interiorRings.push(r),r.poly=this}},{key:"getGeom",value:function(){var r=[this.exteriorRing.getGeom()];if(r[0]===null)return null;for(var i=0,n=this.interiorRings.length;i<n;i++){var o=this.interiorRings[i].getGeom();o!==null&&r.push(o)}return r}}]),t}(),CM=function(){function t(e){Tr(this,t),this.rings=e,this.polys=this._composePolys(e)}return Ft(t,[{key:"getGeom",value:function(){for(var r=[],i=0,n=this.polys.length;i<n;i++){var o=this.polys[i].getGeom();o!==null&&r.push(o)}return r}},{key:"_composePolys",value:function(r){for(var i=[],n=0,o=r.length;n<o;n++){var a=r[n];if(!a.poly)if(a.isExteriorRing())i.push(new Hg(a));else{var c=a.enclosingRing();c.poly||i.push(new Hg(c)),c.poly.addInterior(a)}}return i}}]),t}(),AM=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tc.compare;Tr(this,t),this.queue=e,this.tree=new Ed.default(r),this.segments=[]}return Ft(t,[{key:"process",value:function(r){var i=r.segment,n=[];if(r.consumedBy)return r.isLeft?this.queue.remove(r.otherSE):this.tree.remove(i),n;var o=r.isLeft?this.tree.insert(i):this.tree.find(i);if(!o)throw new Error("Unable to find segment #".concat(i.id," ")+"[".concat(i.leftSE.point.x,", ").concat(i.leftSE.point.y,"] -> ")+"[".concat(i.rightSE.point.x,", ").concat(i.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var a=o,c=o,d=void 0,p=void 0;d===void 0;)a=this.tree.prev(a),a===null?d=null:a.key.consumedBy===void 0&&(d=a.key);for(;p===void 0;)c=this.tree.next(c),c===null?p=null:c.key.consumedBy===void 0&&(p=c.key);if(r.isLeft){var m=null;if(d){var v=d.getIntersection(i);if(v!==null&&(i.isAnEndpoint(v)||(m=v),!d.isAnEndpoint(v)))for(var x=this._splitSafely(d,v),w=0,b=x.length;w<b;w++)n.push(x[w])}var E=null;if(p){var A=p.getIntersection(i);if(A!==null&&(i.isAnEndpoint(A)||(E=A),!p.isAnEndpoint(A)))for(var C=this._splitSafely(p,A),P=0,L=C.length;P<L;P++)n.push(C[P])}if(m!==null||E!==null){var k=null;if(m===null)k=E;else if(E===null)k=m;else{var z=di.comparePoints(m,E);k=z<=0?m:E}this.queue.remove(i.rightSE),n.push(i.rightSE);for(var U=i.split(k),Z=0,ie=U.length;Z<ie;Z++)n.push(U[Z])}n.length>0?(this.tree.remove(i),n.push(r)):(this.segments.push(i),i.prev=d)}else{if(d&&p){var ge=d.getIntersection(p);if(ge!==null){if(!d.isAnEndpoint(ge))for(var De=this._splitSafely(d,ge),Me=0,ke=De.length;Me<ke;Me++)n.push(De[Me]);if(!p.isAnEndpoint(ge))for(var tt=this._splitSafely(p,ge),pt=0,dr=tt.length;pt<dr;pt++)n.push(tt[pt])}}this.tree.remove(i)}return n}},{key:"_splitSafely",value:function(r,i){this.tree.remove(r);var n=r.rightSE;this.queue.remove(n);var o=r.split(i);return o.push(n),r.consumedBy===void 0&&this.tree.insert(r),o}}]),t}(),Wg=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,TM=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,PM=function(){function t(){Tr(this,t)}return Ft(t,[{key:"run",value:function(r,i,n){Ur.type=r,V1.reset();for(var o=[new qg(i,!0)],a=0,c=n.length;a<c;a++)o.push(new qg(n[a],!1));if(Ur.numMultiPolys=o.length,Ur.type==="difference")for(var d=o[0],p=1;p<o.length;)xd(o[p].bbox,d.bbox)!==null?p++:o.splice(p,1);if(Ur.type==="intersection"){for(var m=0,v=o.length;m<v;m++)for(var x=o[m],w=m+1,b=o.length;w<b;w++)if(xd(x.bbox,o[w].bbox)===null)return[]}for(var E=new Ed.default(di.compare),A=0,C=o.length;A<C;A++)for(var P=o[A].getSweepEvents(),L=0,k=P.length;L<k;L++)if(E.insert(P[L]),E.size>Wg)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var z=new AM(E),U=E.size,Z=E.pop();Z;){var ie=Z.key;if(E.size===U){var ge=ie.segment;throw new Error("Unable to pop() ".concat(ie.isLeft?"left":"right"," SweepEvent ")+"[".concat(ie.point.x,", ").concat(ie.point.y,"] from segment #").concat(ge.id," ")+"[".concat(ge.leftSE.point.x,", ").concat(ge.leftSE.point.y,"] -> ")+"[".concat(ge.rightSE.point.x,", ").concat(ge.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(E.size>Wg)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(z.segments.length>TM)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var De=z.process(ie),Me=0,ke=De.length;Me<ke;Me++){var tt=De[Me];tt.consumedBy===void 0&&E.insert(tt)}U=E.size,Z=E.pop()}V1.reset();var pt=RM.factory(z.segments),dr=new CM(pt);return dr.getGeom()}}]),t}(),Ur=new PM,OM=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return Ur.run("union",e,i)},IM=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return Ur.run("intersection",e,i)},LM=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return Ur.run("xor",e,i)},kM=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return Ur.run("difference",e,i)},NM={union:OM,intersection:IM,xor:LM,difference:kM};Gg.exports=NM});var e6=G((Cd,Ad)=>{(function(t,e){typeof Cd=="object"&&typeof Ad<"u"?Ad.exports=e():typeof define=="function"&&define.amd?define(e):t.proj4=e()})(Cd,function(){"use strict";var t=function(s){s("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),s("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),s("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),s.WGS84=s["EPSG:4326"],s["EPSG:3785"]=s["EPSG:3857"],s.GOOGLE=s["EPSG:3857"],s["EPSG:900913"]=s["EPSG:3857"],s["EPSG:102113"]=s["EPSG:3857"]},e=1,r=2,i=3,n=4,o=5,a=6378137,c=6356752314e-3,d=.0066943799901413165,p=484813681109536e-20,m=Math.PI/2,v=.16666666666666666,x=.04722222222222222,w=.022156084656084655,b=1e-10,E=.017453292519943295,A=57.29577951308232,C=Math.PI/4,P=Math.PI*2,L=3.14159265359,k={};k.greenwich=0,k.lisbon=-9.131906111111,k.paris=2.337229166667,k.bogota=-74.080916666667,k.madrid=-3.687938888889,k.rome=12.452333333333,k.bern=7.439583333333,k.jakarta=106.807719444444,k.ferro=-17.666666666667,k.brussels=4.367975,k.stockholm=18.058277777778,k.athens=23.7163375,k.oslo=10.722916666667;var z={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},U=/[\s_\-\/\(\)]/g;function Z(s,l){if(s[l])return s[l];for(var f=Object.keys(s),y=l.toLowerCase().replace(U,""),g=-1,S,R;++g<f.length;)if(S=f[g],R=S.toLowerCase().replace(U,""),R===y)return s[S]}var ie=function(s){var l={},f=s.split("+").map(function(_){return _.trim()}).filter(function(_){return _}).reduce(function(_,T){var I=T.split("=");return I.push(!0),_[I[0].toLowerCase()]=I[1],_},{}),y,g,S,R={proj:"projName",datum:"datumCode",rf:function(_){l.rf=parseFloat(_)},lat_0:function(_){l.lat0=_*E},lat_1:function(_){l.lat1=_*E},lat_2:function(_){l.lat2=_*E},lat_ts:function(_){l.lat_ts=_*E},lon_0:function(_){l.long0=_*E},lon_1:function(_){l.long1=_*E},lon_2:function(_){l.long2=_*E},alpha:function(_){l.alpha=parseFloat(_)*E},gamma:function(_){l.rectified_grid_angle=parseFloat(_)},lonc:function(_){l.longc=_*E},x_0:function(_){l.x0=parseFloat(_)},y_0:function(_){l.y0=parseFloat(_)},k_0:function(_){l.k0=parseFloat(_)},k:function(_){l.k0=parseFloat(_)},a:function(_){l.a=parseFloat(_)},b:function(_){l.b=parseFloat(_)},r_a:function(){l.R_A=!0},zone:function(_){l.zone=parseInt(_,10)},south:function(){l.utmSouth=!0},towgs84:function(_){l.datum_params=_.split(",").map(function(T){return parseFloat(T)})},to_meter:function(_){l.to_meter=parseFloat(_)},units:function(_){l.units=_;var T=Z(z,_);T&&(l.to_meter=T.to_meter)},from_greenwich:function(_){l.from_greenwich=_*E},pm:function(_){var T=Z(k,_);l.from_greenwich=(T||parseFloat(_))*E},nadgrids:function(_){_==="@null"?l.datumCode="none":l.nadgrids=_},axis:function(_){var T="ewnsud";_.length===3&&T.indexOf(_.substr(0,1))!==-1&&T.indexOf(_.substr(1,1))!==-1&&T.indexOf(_.substr(2,1))!==-1&&(l.axis=_)},approx:function(){l.approx=!0}};for(y in f)g=f[y],y in R?(S=R[y],typeof S=="function"?S(g):l[S]=g):l[y]=g;return typeof l.datumCode=="string"&&l.datumCode!=="WGS84"&&(l.datumCode=l.datumCode.toLowerCase()),l},ge=1,De=2,Me=3,ke=4,tt=5,pt=-1,dr=/\s/,Dn=/[A-Za-z]/,Pa=/[A-Za-z84]/,zn=/[,\]]/,Oa=/[\d\.E\-\+]/;function mr(s){if(typeof s!="string")throw new Error("not a string");this.text=s.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=ge}mr.prototype.readCharicter=function(){var s=this.text[this.place++];if(this.state!==ke)for(;dr.test(s);){if(this.place>=this.text.length)return;s=this.text[this.place++]}switch(this.state){case ge:return this.neutral(s);case De:return this.keyword(s);case ke:return this.quoted(s);case tt:return this.afterquote(s);case Me:return this.number(s);case pt:return}},mr.prototype.afterquote=function(s){if(s==='"'){this.word+='"',this.state=ke;return}if(zn.test(s)){this.word=this.word.trim(),this.afterItem(s);return}throw new Error(`havn't handled "`+s+'" in afterquote yet, index '+this.place)},mr.prototype.afterItem=function(s){if(s===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=ge;return}if(s==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=ge,this.currentObject=this.stack.pop(),this.currentObject||(this.state=pt);return}},mr.prototype.number=function(s){if(Oa.test(s)){this.word+=s;return}if(zn.test(s)){this.word=parseFloat(this.word),this.afterItem(s);return}throw new Error(`havn't handled "`+s+'" in number yet, index '+this.place)},mr.prototype.quoted=function(s){if(s==='"'){this.state=tt;return}this.word+=s},mr.prototype.keyword=function(s){if(Pa.test(s)){this.word+=s;return}if(s==="["){var l=[];l.push(this.word),this.level++,this.root===null?this.root=l:this.currentObject.push(l),this.stack.push(this.currentObject),this.currentObject=l,this.state=ge;return}if(zn.test(s)){this.afterItem(s);return}throw new Error(`havn't handled "`+s+'" in keyword yet, index '+this.place)},mr.prototype.neutral=function(s){if(Dn.test(s)){this.word=s,this.state=De;return}if(s==='"'){this.word="",this.state=ke;return}if(Oa.test(s)){this.word=s,this.state=Me;return}if(zn.test(s)){this.afterItem(s);return}throw new Error(`havn't handled "`+s+'" in neutral yet, index '+this.place)},mr.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===pt)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function Ia(s){var l=new mr(s);return l.output()}function Fs(s,l,f){Array.isArray(l)&&(f.unshift(l),l=null);var y=l?{}:s,g=f.reduce(function(S,R){return gi(R,S),S},y);l&&(s[l]=g)}function gi(s,l){if(!Array.isArray(s)){l[s]=!0;return}var f=s.shift();if(f==="PARAMETER"&&(f=s.shift()),s.length===1){if(Array.isArray(s[0])){l[f]={},gi(s[0],l[f]);return}l[f]=s[0];return}if(!s.length){l[f]=!0;return}if(f==="TOWGS84"){l[f]=s;return}if(f==="AXIS"){f in l||(l[f]=[]),l[f].push(s);return}Array.isArray(f)||(l[f]={});var y;switch(f){case"UNIT":case"PRIMEM":case"VERT_DATUM":l[f]={name:s[0].toLowerCase(),convert:s[1]},s.length===3&&gi(s[2],l[f]);return;case"SPHEROID":case"ELLIPSOID":l[f]={name:s[0],a:s[1],rf:s[2]},s.length===4&&gi(s[3],l[f]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":s[0]=["name",s[0]],Fs(l,f,s);return;default:for(y=-1;++y<s.length;)if(!Array.isArray(s[y]))return gi(s,l[f]);return Fs(l,f,s)}}var hf=.017453292519943295;function df(s,l){var f=l[0],y=l[1];!(f in s)&&y in s&&(s[f]=s[y],l.length===3&&(s[f]=l[2](s[f])))}function ft(s){return s*hf}function rr(s){if(s.type==="GEOGCS"?s.projName="longlat":s.type==="LOCAL_CS"?(s.projName="identity",s.local=!0):typeof s.PROJECTION=="object"?s.projName=Object.keys(s.PROJECTION)[0]:s.projName=s.PROJECTION,s.AXIS){for(var l="",f=0,y=s.AXIS.length;f<y;++f){var g=[s.AXIS[f][0].toLowerCase(),s.AXIS[f][1].toLowerCase()];g[0].indexOf("north")!==-1||(g[0]==="y"||g[0]==="lat")&&g[1]==="north"?l+="n":g[0].indexOf("south")!==-1||(g[0]==="y"||g[0]==="lat")&&g[1]==="south"?l+="s":g[0].indexOf("east")!==-1||(g[0]==="x"||g[0]==="lon")&&g[1]==="east"?l+="e":(g[0].indexOf("west")!==-1||(g[0]==="x"||g[0]==="lon")&&g[1]==="west")&&(l+="w")}l.length===2&&(l+="u"),l.length===3&&(s.axis=l)}s.UNIT&&(s.units=s.UNIT.name.toLowerCase(),s.units==="metre"&&(s.units="meter"),s.UNIT.convert&&(s.type==="GEOGCS"?s.DATUM&&s.DATUM.SPHEROID&&(s.to_meter=s.UNIT.convert*s.DATUM.SPHEROID.a):s.to_meter=s.UNIT.convert));var S=s.GEOGCS;s.type==="GEOGCS"&&(S=s),S&&(S.DATUM?s.datumCode=S.DATUM.name.toLowerCase():s.datumCode=S.name.toLowerCase(),s.datumCode.slice(0,2)==="d_"&&(s.datumCode=s.datumCode.slice(2)),(s.datumCode==="new_zealand_geodetic_datum_1949"||s.datumCode==="new_zealand_1949")&&(s.datumCode="nzgd49"),(s.datumCode==="wgs_1984"||s.datumCode==="world_geodetic_system_1984")&&(s.PROJECTION==="Mercator_Auxiliary_Sphere"&&(s.sphere=!0),s.datumCode="wgs84"),s.datumCode.slice(-6)==="_ferro"&&(s.datumCode=s.datumCode.slice(0,-6)),s.datumCode.slice(-8)==="_jakarta"&&(s.datumCode=s.datumCode.slice(0,-8)),~s.datumCode.indexOf("belge")&&(s.datumCode="rnb72"),S.DATUM&&S.DATUM.SPHEROID&&(s.ellps=S.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),s.ellps.toLowerCase().slice(0,13)==="international"&&(s.ellps="intl"),s.a=S.DATUM.SPHEROID.a,s.rf=parseFloat(S.DATUM.SPHEROID.rf,10)),S.DATUM&&S.DATUM.TOWGS84&&(s.datum_params=S.DATUM.TOWGS84),~s.datumCode.indexOf("osgb_1936")&&(s.datumCode="osgb36"),~s.datumCode.indexOf("osni_1952")&&(s.datumCode="osni52"),(~s.datumCode.indexOf("tm65")||~s.datumCode.indexOf("geodetic_datum_of_1965"))&&(s.datumCode="ire65"),s.datumCode==="ch1903+"&&(s.datumCode="ch1903"),~s.datumCode.indexOf("israel")&&(s.datumCode="isr93")),s.b&&!isFinite(s.b)&&(s.b=s.a);function R(I){var D=s.to_meter||1;return I*D}var _=function(I){return df(s,I)},T=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",ft],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",ft],["x0","false_easting",R],["y0","false_northing",R],["long0","central_meridian",ft],["lat0","latitude_of_origin",ft],["lat0","standard_parallel_1",ft],["lat1","standard_parallel_1",ft],["lat2","standard_parallel_2",ft],["azimuth","Azimuth"],["alpha","azimuth",ft],["srsCode","name"]];T.forEach(_),!s.long0&&s.longc&&(s.projName==="Albers_Conic_Equal_Area"||s.projName==="Lambert_Azimuthal_Equal_Area")&&(s.long0=s.longc),!s.lat_ts&&s.lat1&&(s.projName==="Stereographic_South_Pole"||s.projName==="Polar Stereographic (variant B)")&&(s.lat0=ft(s.lat1>0?90:-90),s.lat_ts=s.lat1)}var ol=function(s){var l=Ia(s),f=l.shift(),y=l.shift();l.unshift(["name",y]),l.unshift(["type",f]);var g={};return gi(l,g),rr(g),g};function gt(s){var l=this;if(arguments.length===2){var f=arguments[1];typeof f=="string"?f.charAt(0)==="+"?gt[s]=ie(arguments[1]):gt[s]=ol(arguments[1]):gt[s]=f}else if(arguments.length===1){if(Array.isArray(s))return s.map(function(y){Array.isArray(y)?gt.apply(l,y):gt(y)});if(typeof s=="string"){if(s in gt)return gt[s]}else"EPSG"in s?gt["EPSG:"+s.EPSG]=s:"ESRI"in s?gt["ESRI:"+s.ESRI]=s:"IAU2000"in s?gt["IAU2000:"+s.IAU2000]=s:console.log(s);return}}t(gt);function kr(s){return typeof s=="string"}function La(s){return s in gt}var ka=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function al(s){return ka.some(function(l){return s.indexOf(l)>-1})}var mf=["3857","900913","3785","102113"];function ll(s){var l=Z(s,"authority");if(!!l){var f=Z(l,"epsg");return f&&mf.indexOf(f)>-1}}function Na(s){var l=Z(s,"extension");if(!!l)return Z(l,"proj4")}function Wi(s){return s[0]==="+"}function ul(s){if(kr(s)){if(La(s))return gt[s];if(al(s)){var l=ol(s);if(ll(l))return gt["EPSG:3857"];var f=Na(l);return f?ie(f):l}if(Wi(s))return ie(s)}else return s}var $s=function(s,l){s=s||{};var f,y;if(!l)return s;for(y in l)f=l[y],f!==void 0&&(s[y]=f);return s},kt=function(s,l,f){var y=s*l;return f/Math.sqrt(1-y*y)},Ui=function(s){return s<0?-1:1},Y=function(s){return Math.abs(s)<=L?s:s-Ui(s)*P},ct=function(s,l,f){var y=s*f,g=.5*s;return y=Math.pow((1-y)/(1+y),g),Math.tan(.5*(m-l))/y},Nr=function(s,l){for(var f=.5*s,y,g,S=m-2*Math.atan(l),R=0;R<=15;R++)if(y=s*Math.sin(S),g=m-2*Math.atan(l*Math.pow((1-y)/(1+y),f))-S,S+=g,Math.abs(g)<=1e-10)return S;return-9999};function qs(){var s=this.b/this.a;this.es=1-s*s,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=kt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function cl(s){var l=s.x,f=s.y;if(f*A>90&&f*A<-90&&l*A>180&&l*A<-180)return null;var y,g;if(Math.abs(Math.abs(f)-m)<=b)return null;if(this.sphere)y=this.x0+this.a*this.k0*Y(l-this.long0),g=this.y0+this.a*this.k0*Math.log(Math.tan(C+.5*f));else{var S=Math.sin(f),R=ct(this.e,f,S);y=this.x0+this.a*this.k0*Y(l-this.long0),g=this.y0-this.a*this.k0*Math.log(R)}return s.x=y,s.y=g,s}function fl(s){var l=s.x-this.x0,f=s.y-this.y0,y,g;if(this.sphere)g=m-2*Math.atan(Math.exp(-f/(this.a*this.k0)));else{var S=Math.exp(-f/(this.a*this.k0));if(g=Nr(this.e,S),g===-9999)return null}return y=Y(this.long0+l/(this.a*this.k0)),s.x=y,s.y=g,s}var hl=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],pf={init:qs,forward:cl,inverse:fl,names:hl};function dl(){}function Ba(s){return s}var ml=["longlat","identity"],jn={init:dl,forward:Ba,inverse:Ba,names:ml},pl=[pf,jn],Da={},yi=[];function za(s,l){var f=yi.length;return s.names?(yi[f]=s,s.names.forEach(function(y){Da[y.toLowerCase()]=f}),this):(console.log(l),!0)}function gf(s){if(!s)return!1;var l=s.toLowerCase();if(typeof Da[l]<"u"&&yi[Da[l]])return yi[Da[l]]}function gl(){pl.forEach(za)}var ja={start:gl,add:za,get:gf},ue={};ue.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},ue.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},ue.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},ue.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},ue.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},ue.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},ue.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},ue.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},ue.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},ue.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},ue.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},ue.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},ue.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},ue.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},ue.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},ue.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},ue.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},ue.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},ue.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},ue.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},ue.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},ue.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},ue.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},ue.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},ue.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},ue.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},ue.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},ue.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},ue.hough={a:6378270,rf:297,ellipseName:"Hough"},ue.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},ue.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},ue.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},ue.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},ue.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},ue.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},ue.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},ue.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},ue.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},ue.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},ue.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},ue.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var yf=ue.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};ue.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Vr(s,l,f,y){var g=s*s,S=l*l,R=(g-S)/g,_=0;y?(s*=1-R*(v+R*(x+R*w)),g=s*s,R=0):_=Math.sqrt(R);var T=(g-S)/S;return{es:R,e:_,ep2:T}}function Fn(s,l,f,y,g){if(!s){var S=Z(ue,y);S||(S=yf),s=S.a,l=S.b,f=S.rf}return f&&!l&&(l=(1-1/f)*s),(f===0||Math.abs(s-l)<b)&&(g=!0,l=s),{a:s,b:l,rf:f,sphere:g}}var Ye={};Ye.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Ye.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Ye.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Ye.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Ye.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Ye.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Ye.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Ye.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},Ye.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Ye.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Ye.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Ye.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Ye.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Ye.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Ye.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Ye.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Ye.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function bi(s,l,f,y,g,S,R){var _={};return s===void 0||s==="none"?_.datum_type=o:_.datum_type=n,l&&(_.datum_params=l.map(parseFloat),(_.datum_params[0]!==0||_.datum_params[1]!==0||_.datum_params[2]!==0)&&(_.datum_type=e),_.datum_params.length>3&&(_.datum_params[3]!==0||_.datum_params[4]!==0||_.datum_params[5]!==0||_.datum_params[6]!==0)&&(_.datum_type=r,_.datum_params[3]*=p,_.datum_params[4]*=p,_.datum_params[5]*=p,_.datum_params[6]=_.datum_params[6]/1e6+1)),R&&(_.datum_type=i,_.grids=R),_.a=f,_.b=y,_.es=g,_.ep2=S,_}var Hs={};function vi(s,l){var f=new DataView(l),y=Ws(f),g=bl(f,y);g.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var S=vl(f,g,y),R={header:g,subgrids:S};return Hs[s]=R,R}function yl(s){if(s===void 0)return null;var l=s.split(",");return l.map(Fa)}function Fa(s){if(s.length===0)return null;var l=s[0]==="@";return l&&(s=s.slice(1)),s==="null"?{name:"null",mandatory:!l,grid:null,isNull:!0}:{name:s,mandatory:!l,grid:Hs[s]||null,isNull:!1}}function wi(s){return s/3600*Math.PI/180}function Ws(s){var l=s.getInt32(8,!1);return l===11?!1:(l=s.getInt32(8,!0),l!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function bl(s,l){return{nFields:s.getInt32(8,l),nSubgridFields:s.getInt32(24,l),nSubgrids:s.getInt32(40,l),shiftType:Us(s,56,56+8).trim(),fromSemiMajorAxis:s.getFloat64(120,l),fromSemiMinorAxis:s.getFloat64(136,l),toSemiMajorAxis:s.getFloat64(152,l),toSemiMinorAxis:s.getFloat64(168,l)}}function Us(s,l,f){return String.fromCharCode.apply(null,new Uint8Array(s.buffer.slice(l,f)))}function vl(s,l,f){for(var y=176,g=[],S=0;S<l.nSubgrids;S++){var R=wl(s,y,f),_=bf(s,y,R,f),T=Math.round(1+(R.upperLongitude-R.lowerLongitude)/R.longitudeInterval),I=Math.round(1+(R.upperLatitude-R.lowerLatitude)/R.latitudeInterval);g.push({ll:[wi(R.lowerLongitude),wi(R.lowerLatitude)],del:[wi(R.longitudeInterval),wi(R.latitudeInterval)],lim:[T,I],count:R.gridNodeCount,cvs:$a(_)})}return g}function $a(s){return s.map(function(l){return[wi(l.longitudeShift),wi(l.latitudeShift)]})}function wl(s,l,f){return{name:Us(s,l+8,l+16).trim(),parent:Us(s,l+24,l+24+8).trim(),lowerLatitude:s.getFloat64(l+72,f),upperLatitude:s.getFloat64(l+88,f),lowerLongitude:s.getFloat64(l+104,f),upperLongitude:s.getFloat64(l+120,f),latitudeInterval:s.getFloat64(l+136,f),longitudeInterval:s.getFloat64(l+152,f),gridNodeCount:s.getInt32(l+168,f)}}function bf(s,l,f,y){for(var g=l+176,S=16,R=[],_=0;_<f.gridNodeCount;_++){var T={latitudeShift:s.getFloat32(g+_*S,y),longitudeShift:s.getFloat32(g+_*S+4,y),latitudeAccuracy:s.getFloat32(g+_*S+8,y),longitudeAccuracy:s.getFloat32(g+_*S+12,y)};R.push(T)}return R}function pr(s,l){if(!(this instanceof pr))return new pr(s);l=l||function(I){if(I)throw I};var f=ul(s);if(typeof f!="object"){l(s);return}var y=pr.projections.get(f.projName);if(!y){l(s);return}if(f.datumCode&&f.datumCode!=="none"){var g=Z(Ye,f.datumCode);g&&(f.datum_params=f.datum_params||(g.towgs84?g.towgs84.split(","):null),f.ellps=g.ellipse,f.datumName=g.datumName?g.datumName:f.datumCode)}f.k0=f.k0||1,f.axis=f.axis||"enu",f.ellps=f.ellps||"wgs84",f.lat1=f.lat1||f.lat0;var S=Fn(f.a,f.b,f.rf,f.ellps,f.sphere),R=Vr(S.a,S.b,S.rf,f.R_A),_=yl(f.nadgrids),T=f.datum||bi(f.datumCode,f.datum_params,S.a,S.b,R.es,R.ep2,_);$s(this,f),$s(this,y),this.a=S.a,this.b=S.b,this.rf=S.rf,this.sphere=S.sphere,this.es=R.es,this.e=R.e,this.ep2=R.ep2,this.datum=T,this.init(),l(null,this)}pr.projections=ja,pr.projections.start();function vf(s,l){return s.datum_type!==l.datum_type||s.a!==l.a||Math.abs(s.es-l.es)>5e-11?!1:s.datum_type===e?s.datum_params[0]===l.datum_params[0]&&s.datum_params[1]===l.datum_params[1]&&s.datum_params[2]===l.datum_params[2]:s.datum_type===r?s.datum_params[0]===l.datum_params[0]&&s.datum_params[1]===l.datum_params[1]&&s.datum_params[2]===l.datum_params[2]&&s.datum_params[3]===l.datum_params[3]&&s.datum_params[4]===l.datum_params[4]&&s.datum_params[5]===l.datum_params[5]&&s.datum_params[6]===l.datum_params[6]:!0}function qa(s,l,f){var y=s.x,g=s.y,S=s.z?s.z:0,R,_,T,I;if(g<-m&&g>-1.001*m)g=-m;else if(g>m&&g<1.001*m)g=m;else{if(g<-m)return{x:-1/0,y:-1/0,z:s.z};if(g>m)return{x:1/0,y:1/0,z:s.z}}return y>Math.PI&&(y-=2*Math.PI),_=Math.sin(g),I=Math.cos(g),T=_*_,R=f/Math.sqrt(1-l*T),{x:(R+S)*I*Math.cos(y),y:(R+S)*I*Math.sin(y),z:(R*(1-l)+S)*_}}function $n(s,l,f,y){var g=1e-12,S=g*g,R=30,_,T,I,D,N,j,W,H,V,J,ne,fe,be,Ke=s.x,ze=s.y,He=s.z?s.z:0,Rt,st,ri;if(_=Math.sqrt(Ke*Ke+ze*ze),T=Math.sqrt(Ke*Ke+ze*ze+He*He),_/f<g){if(Rt=0,T/f<g)return st=m,ri=-y,{x:s.x,y:s.y,z:s.z}}else Rt=Math.atan2(ze,Ke);I=He/T,D=_/T,N=1/Math.sqrt(1-l*(2-l)*D*D),H=D*(1-l)*N,V=I*N,be=0;do be++,W=f/Math.sqrt(1-l*V*V),ri=_*H+He*V-W*(1-l*V*V),j=l*W/(W+ri),N=1/Math.sqrt(1-j*(2-j)*D*D),J=D*(1-j)*N,ne=I*N,fe=ne*H-J*V,H=J,V=ne;while(fe*fe>S&&be<R);return st=Math.atan(ne/Math.abs(J)),{x:Rt,y:st,z:ri}}function wf(s,l,f){if(l===e)return{x:s.x+f[0],y:s.y+f[1],z:s.z+f[2]};if(l===r){var y=f[0],g=f[1],S=f[2],R=f[3],_=f[4],T=f[5],I=f[6];return{x:I*(s.x-T*s.y+_*s.z)+y,y:I*(T*s.x+s.y-R*s.z)+g,z:I*(-_*s.x+R*s.y+s.z)+S}}}function Gs(s,l,f){if(l===e)return{x:s.x-f[0],y:s.y-f[1],z:s.z-f[2]};if(l===r){var y=f[0],g=f[1],S=f[2],R=f[3],_=f[4],T=f[5],I=f[6],D=(s.x-y)/I,N=(s.y-g)/I,j=(s.z-S)/I;return{x:D+T*N-_*j,y:-T*D+N+R*j,z:_*D-R*N+j}}}function Kr(s){return s===e||s===r}var Vs=function(s,l,f){if(vf(s,l)||s.datum_type===o||l.datum_type===o)return f;var y=s.a,g=s.es;if(s.datum_type===i){var S=Ut(s,!1,f);if(S!==0)return;y=a,g=d}var R=l.a,_=l.b,T=l.es;if(l.datum_type===i&&(R=a,_=c,T=d),g===T&&y===R&&!Kr(s.datum_type)&&!Kr(l.datum_type))return f;if(f=qa(f,g,y),Kr(s.datum_type)&&(f=wf(f,s.datum_type,s.datum_params)),Kr(l.datum_type)&&(f=Gs(f,l.datum_type,l.datum_params)),f=$n(f,T,R,_),l.datum_type===i){var I=Ut(l,!0,f);if(I!==0)return}return f};function Ut(s,l,f){if(s.grids===null||s.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var y={x:-f.x,y:f.y},g={x:Number.NaN,y:Number.NaN},S=[],R=0;R<s.grids.length;R++){var _=s.grids[R];if(S.push(_.name),_.isNull){g=y;break}if(_.grid===null){if(_.mandatory)return console.log("Unable to find mandatory grid '"+_.name+"'"),-1;continue}var T=_.grid.subgrids[0],I=(Math.abs(T.del[1])+Math.abs(T.del[0]))/1e4,D=T.ll[0]-I,N=T.ll[1]-I,j=T.ll[0]+(T.lim[0]-1)*T.del[0]+I,W=T.ll[1]+(T.lim[1]-1)*T.del[1]+I;if(!(N>y.y||D>y.x||W<y.y||j<y.x)&&(g=Ha(y,l,T),!isNaN(g.x)))break}return isNaN(g.x)?(console.log("Failed to find a grid shift table for location '"+-y.x*A+" "+y.y*A+" tried: '"+S+"'"),-1):(f.x=-g.x,f.y=g.y,0)}function Ha(s,l,f){var y={x:Number.NaN,y:Number.NaN};if(isNaN(s.x))return y;var g={x:s.x,y:s.y};g.x-=f.ll[0],g.y-=f.ll[1],g.x=Y(g.x-Math.PI)+Math.PI;var S=Wa(g,f);if(l){if(isNaN(S.x))return y;S.x=g.x-S.x,S.y=g.y-S.y;var R=9,_=1e-12,T,I;do{if(I=Wa(S,f),isNaN(I.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}T={x:g.x-(I.x+S.x),y:g.y-(I.y+S.y)},S.x+=T.x,S.y+=T.y}while(R--&&Math.abs(T.x)>_&&Math.abs(T.y)>_);if(R<0)return console.log("Inverse grid shift iterator failed to converge."),y;y.x=Y(S.x+f.ll[0]),y.y=S.y+f.ll[1]}else isNaN(S.x)||(y.x=s.x+S.x,y.y=s.y+S.y);return y}function Wa(s,l){var f={x:s.x/l.del[0],y:s.y/l.del[1]},y={x:Math.floor(f.x),y:Math.floor(f.y)},g={x:f.x-1*y.x,y:f.y-1*y.y},S={x:Number.NaN,y:Number.NaN},R;if(y.x<0||y.x>=l.lim[0]||y.y<0||y.y>=l.lim[1])return S;R=y.y*l.lim[0]+y.x;var _={x:l.cvs[R][0],y:l.cvs[R][1]};R++;var T={x:l.cvs[R][0],y:l.cvs[R][1]};R+=l.lim[0];var I={x:l.cvs[R][0],y:l.cvs[R][1]};R--;var D={x:l.cvs[R][0],y:l.cvs[R][1]},N=g.x*g.y,j=g.x*(1-g.y),W=(1-g.x)*(1-g.y),H=(1-g.x)*g.y;return S.x=W*_.x+j*T.x+H*D.x+N*I.x,S.y=W*_.y+j*T.y+H*D.y+N*I.y,S}var qn=function(s,l,f){var y=f.x,g=f.y,S=f.z||0,R,_,T,I={};for(T=0;T<3;T++)if(!(l&&T===2&&f.z===void 0))switch(T===0?(R=y,"ew".indexOf(s.axis[T])!==-1?_="x":_="y"):T===1?(R=g,"ns".indexOf(s.axis[T])!==-1?_="y":_="x"):(R=S,_="z"),s.axis[T]){case"e":I[_]=R;break;case"w":I[_]=-R;break;case"n":I[_]=R;break;case"s":I[_]=-R;break;case"u":f[_]!==void 0&&(I.z=R);break;case"d":f[_]!==void 0&&(I.z=-R);break;default:return null}return I},Hn=function(s){var l={x:s[0],y:s[1]};return s.length>2&&(l.z=s[2]),s.length>3&&(l.m=s[3]),l},_l=function(s){Sl(s.x),Sl(s.y)};function Sl(s){if(typeof Number.isFinite=="function"){if(Number.isFinite(s))return;throw new TypeError("coordinates must be finite numbers")}if(typeof s!="number"||s!==s||!isFinite(s))throw new TypeError("coordinates must be finite numbers")}function _f(s,l){return(s.datum.datum_type===e||s.datum.datum_type===r)&&l.datumCode!=="WGS84"||(l.datum.datum_type===e||l.datum.datum_type===r)&&s.datumCode!=="WGS84"}function Gi(s,l,f,y){var g;if(Array.isArray(f)&&(f=Hn(f)),_l(f),s.datum&&l.datum&&_f(s,l)&&(g=new pr("WGS84"),f=Gi(s,g,f,y),s=g),y&&s.axis!=="enu"&&(f=qn(s,!1,f)),s.projName==="longlat")f={x:f.x*E,y:f.y*E,z:f.z||0};else if(s.to_meter&&(f={x:f.x*s.to_meter,y:f.y*s.to_meter,z:f.z||0}),f=s.inverse(f),!f)return;if(s.from_greenwich&&(f.x+=s.from_greenwich),f=Vs(s.datum,l.datum,f),!!f)return l.from_greenwich&&(f={x:f.x-l.from_greenwich,y:f.y,z:f.z||0}),l.projName==="longlat"?f={x:f.x*A,y:f.y*A,z:f.z||0}:(f=l.forward(f),l.to_meter&&(f={x:f.x/l.to_meter,y:f.y/l.to_meter,z:f.z||0})),y&&l.axis!=="enu"?qn(l,!0,f):f}var Vi=pr("WGS84");function Ks(s,l,f,y){var g,S,R;return Array.isArray(f)?(g=Gi(s,l,f,y)||{x:NaN,y:NaN},f.length>2?typeof s.name<"u"&&s.name==="geocent"||typeof l.name<"u"&&l.name==="geocent"?typeof g.z=="number"?[g.x,g.y,g.z].concat(f.splice(3)):[g.x,g.y,f[2]].concat(f.splice(3)):[g.x,g.y].concat(f.splice(2)):[g.x,g.y]):(S=Gi(s,l,f,y),R=Object.keys(f),R.length===2||R.forEach(function(_){if(typeof s.name<"u"&&s.name==="geocent"||typeof l.name<"u"&&l.name==="geocent"){if(_==="x"||_==="y"||_==="z")return}else if(_==="x"||_==="y")return;S[_]=f[_]}),S)}function Ua(s){return s instanceof pr?s:s.oProj?s.oProj:pr(s)}function Nt(s,l,f){s=Ua(s);var y=!1,g;return typeof l>"u"?(l=s,s=Vi,y=!0):(typeof l.x<"u"||Array.isArray(l))&&(f=l,l=s,s=Vi,y=!0),l=Ua(l),f?Ks(s,l,f):(g={forward:function(S,R){return Ks(s,l,S,R)},inverse:function(S,R){return Ks(l,s,S,R)}},y&&(g.oProj=l),g)}var Ga=6,Js="AJSAJS",Ki="AFAFAF",Gt=65,bt=73,vt=79,Br=86,Jr=90,Zs={forward:xl,inverse:Sf,toPoint:Ml};function xl(s,l){return l=l||5,Ef(xf({lat:s[1],lon:s[0]}),l)}function Sf(s){var l=Ys(Cl(s.toUpperCase()));return l.lat&&l.lon?[l.lon,l.lat,l.lon,l.lat]:[l.left,l.bottom,l.right,l.top]}function Ml(s){var l=Ys(Cl(s.toUpperCase()));return l.lat&&l.lon?[l.lon,l.lat]:[(l.left+l.right)/2,(l.top+l.bottom)/2]}function Va(s){return s*(Math.PI/180)}function El(s){return 180*(s/Math.PI)}function xf(s){var l=s.lat,f=s.lon,y=6378137,g=.00669438,S=.9996,R,_,T,I,D,N,j,W=Va(l),H=Va(f),V,J;J=Math.floor((f+180)/6)+1,f===180&&(J=60),l>=56&&l<64&&f>=3&&f<12&&(J=32),l>=72&&l<84&&(f>=0&&f<9?J=31:f>=9&&f<21?J=33:f>=21&&f<33?J=35:f>=33&&f<42&&(J=37)),R=(J-1)*6-180+3,V=Va(R),_=g/(1-g),T=y/Math.sqrt(1-g*Math.sin(W)*Math.sin(W)),I=Math.tan(W)*Math.tan(W),D=_*Math.cos(W)*Math.cos(W),N=Math.cos(W)*(H-V),j=y*((1-g/4-3*g*g/64-5*g*g*g/256)*W-(3*g/8+3*g*g/32+45*g*g*g/1024)*Math.sin(2*W)+(15*g*g/256+45*g*g*g/1024)*Math.sin(4*W)-35*g*g*g/3072*Math.sin(6*W));var ne=S*T*(N+(1-I+D)*N*N*N/6+(5-18*I+I*I+72*D-58*_)*N*N*N*N*N/120)+5e5,fe=S*(j+T*Math.tan(W)*(N*N/2+(5-I+9*D+4*D*D)*N*N*N*N/24+(61-58*I+I*I+600*D-330*_)*N*N*N*N*N*N/720));return l<0&&(fe+=1e7),{northing:Math.round(fe),easting:Math.round(ne),zoneNumber:J,zoneLetter:Mf(l)}}function Ys(s){var l=s.northing,f=s.easting,y=s.zoneLetter,g=s.zoneNumber;if(g<0||g>60)return null;var S=.9996,R=6378137,_=.00669438,T,I=(1-Math.sqrt(1-_))/(1+Math.sqrt(1-_)),D,N,j,W,H,V,J,ne,fe,be=f-5e5,Ke=l;y<"N"&&(Ke-=1e7),J=(g-1)*6-180+3,T=_/(1-_),V=Ke/S,ne=V/(R*(1-_/4-3*_*_/64-5*_*_*_/256)),fe=ne+(3*I/2-27*I*I*I/32)*Math.sin(2*ne)+(21*I*I/16-55*I*I*I*I/32)*Math.sin(4*ne)+151*I*I*I/96*Math.sin(6*ne),D=R/Math.sqrt(1-_*Math.sin(fe)*Math.sin(fe)),N=Math.tan(fe)*Math.tan(fe),j=T*Math.cos(fe)*Math.cos(fe),W=R*(1-_)/Math.pow(1-_*Math.sin(fe)*Math.sin(fe),1.5),H=be/(D*S);var ze=fe-D*Math.tan(fe)/W*(H*H/2-(5+3*N+10*j-4*j*j-9*T)*H*H*H*H/24+(61+90*N+298*j+45*N*N-252*T-3*j*j)*H*H*H*H*H*H/720);ze=El(ze);var He=(H-(1+2*N+j)*H*H*H/6+(5-2*j+28*N-3*j*j+8*T+24*N*N)*H*H*H*H*H/120)/Math.cos(fe);He=J+El(He);var Rt;if(s.accuracy){var st=Ys({northing:s.northing+s.accuracy,easting:s.easting+s.accuracy,zoneLetter:s.zoneLetter,zoneNumber:s.zoneNumber});Rt={top:st.lat,right:st.lon,bottom:ze,left:He}}else Rt={lat:ze,lon:He};return Rt}function Mf(s){var l="Z";return 84>=s&&s>=72?l="X":72>s&&s>=64?l="W":64>s&&s>=56?l="V":56>s&&s>=48?l="U":48>s&&s>=40?l="T":40>s&&s>=32?l="S":32>s&&s>=24?l="R":24>s&&s>=16?l="Q":16>s&&s>=8?l="P":8>s&&s>=0?l="N":0>s&&s>=-8?l="M":-8>s&&s>=-16?l="L":-16>s&&s>=-24?l="K":-24>s&&s>=-32?l="J":-32>s&&s>=-40?l="H":-40>s&&s>=-48?l="G":-48>s&&s>=-56?l="F":-56>s&&s>=-64?l="E":-64>s&&s>=-72?l="D":-72>s&&s>=-80&&(l="C"),l}function Ef(s,l){var f="00000"+s.easting,y="00000"+s.northing;return s.zoneNumber+s.zoneLetter+Rf(s.easting,s.northing,s.zoneNumber)+f.substr(f.length-5,l)+y.substr(y.length-5,l)}function Rf(s,l,f){var y=Ji(f),g=Math.floor(s/1e5),S=Math.floor(l/1e5)%20;return Rl(g,S,y)}function Ji(s){var l=s%Ga;return l===0&&(l=Ga),l}function Rl(s,l,f){var y=f-1,g=Js.charCodeAt(y),S=Ki.charCodeAt(y),R=g+s-1,_=S+l,T=!1;R>Jr&&(R=R-Jr+Gt-1,T=!0),(R===bt||g<bt&&R>bt||(R>bt||g<bt)&&T)&&R++,(R===vt||g<vt&&R>vt||(R>vt||g<vt)&&T)&&(R++,R===bt&&R++),R>Jr&&(R=R-Jr+Gt-1),_>Br?(_=_-Br+Gt-1,T=!0):T=!1,(_===bt||S<bt&&_>bt||(_>bt||S<bt)&&T)&&_++,(_===vt||S<vt&&_>vt||(_>vt||S<vt)&&T)&&(_++,_===bt&&_++),_>Br&&(_=_-Br+Gt-1);var I=String.fromCharCode(R)+String.fromCharCode(_);return I}function Cl(s){if(s&&s.length===0)throw"MGRSPoint coverting from nothing";for(var l=s.length,f=null,y="",g,S=0;!/[A-Z]/.test(g=s.charAt(S));){if(S>=2)throw"MGRSPoint bad conversion from: "+s;y+=g,S++}var R=parseInt(y,10);if(S===0||S+3>l)throw"MGRSPoint bad conversion from: "+s;var _=s.charAt(S++);if(_<="A"||_==="B"||_==="Y"||_>="Z"||_==="I"||_==="O")throw"MGRSPoint zone letter "+_+" not handled: "+s;f=s.substring(S,S+=2);for(var T=Ji(R),I=Al(f.charAt(0),T),D=Zi(f.charAt(1),T);D<Yi(_);)D+=2e6;var N=l-S;if(N%2!==0)throw`MGRSPoint has to have an even number
|
|
108
|
-
of digits after the zone letter and two 100km letters - front
|
|
109
|
-
half for easting meters, second half for
|
|
110
|
-
northing meters`+s;var j=N/2,W=0,H=0,V,J,ne,fe,be;return j>0&&(V=1e5/Math.pow(10,j),J=s.substring(S,S+j),W=parseFloat(J)*V,ne=s.substring(S+j),H=parseFloat(ne)*V),fe=W+I,be=H+D,{easting:fe,northing:be,zoneLetter:_,zoneNumber:R,accuracy:V}}function Al(s,l){for(var f=Js.charCodeAt(l-1),y=1e5,g=!1;f!==s.charCodeAt(0);){if(f++,f===bt&&f++,f===vt&&f++,f>Jr){if(g)throw"Bad character: "+s;f=Gt,g=!0}y+=1e5}return y}function Zi(s,l){if(s>"V")throw"MGRSPoint given invalid Northing "+s;for(var f=Ki.charCodeAt(l-1),y=0,g=!1;f!==s.charCodeAt(0);){if(f++,f===bt&&f++,f===vt&&f++,f>Br){if(g)throw"Bad character: "+s;f=Gt,g=!0}y+=1e5}return y}function Yi(s){var l;switch(s){case"C":l=11e5;break;case"D":l=2e6;break;case"E":l=28e5;break;case"F":l=37e5;break;case"G":l=46e5;break;case"H":l=55e5;break;case"J":l=64e5;break;case"K":l=73e5;break;case"L":l=82e5;break;case"M":l=91e5;break;case"N":l=0;break;case"P":l=8e5;break;case"Q":l=17e5;break;case"R":l=26e5;break;case"S":l=35e5;break;case"T":l=44e5;break;case"U":l=53e5;break;case"V":l=62e5;break;case"W":l=7e6;break;case"X":l=79e5;break;default:l=-1}if(l>=0)return l;throw"Invalid zone letter: "+s}function Dr(s,l,f){if(!(this instanceof Dr))return new Dr(s,l,f);if(Array.isArray(s))this.x=s[0],this.y=s[1],this.z=s[2]||0;else if(typeof s=="object")this.x=s.x,this.y=s.y,this.z=s.z||0;else if(typeof s=="string"&&typeof l>"u"){var y=s.split(",");this.x=parseFloat(y[0],10),this.y=parseFloat(y[1],10),this.z=parseFloat(y[2],10)||0}else this.x=s,this.y=l,this.z=f||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Dr.fromMGRS=function(s){return new Dr(Ml(s))},Dr.prototype.toMGRS=function(s){return xl([this.x,this.y],s)};var Tl=1,Cf=.25,Xs=.046875,Qs=.01953125,eo=.01068115234375,Af=.75,Tf=.46875,Pf=.013020833333333334,Of=.007120768229166667,gr=.3645833333333333,If=.005696614583333333,Lf=.3076171875,Pl=function(s){var l=[];l[0]=Tl-s*(Cf+s*(Xs+s*(Qs+s*eo))),l[1]=s*(Af-s*(Xs+s*(Qs+s*eo)));var f=s*s;return l[2]=f*(Tf-s*(Pf+s*Of)),f*=s,l[3]=f*(gr-s*If),l[4]=f*s*Lf,l},_i=function(s,l,f,y){return f*=l,l*=l,y[0]*s-f*(y[1]+l*(y[2]+l*(y[3]+l*y[4])))},Ka=20,Xi=function(s,l,f){for(var y=1/(1-l),g=s,S=Ka;S;--S){var R=Math.sin(g),_=1-l*R*R;if(_=(_i(g,R,Math.cos(g),f)-s)*(_*Math.sqrt(_))*y,g-=_,Math.abs(_)<b)return g}return g};function Si(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Pl(this.es),this.ml0=_i(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function kf(s){var l=s.x,f=s.y,y=Y(l-this.long0),g,S,R,_=Math.sin(f),T=Math.cos(f);if(this.es){var D=T*y,N=Math.pow(D,2),j=this.ep2*Math.pow(T,2),W=Math.pow(j,2),H=Math.abs(T)>b?Math.tan(f):0,V=Math.pow(H,2),J=Math.pow(V,2);g=1-this.es*Math.pow(_,2),D=D/Math.sqrt(g);var ne=_i(f,_,T,this.en);S=this.a*(this.k0*D*(1+N/6*(1-V+j+N/20*(5-18*V+J+14*j-58*V*j+N/42*(61+179*J-J*V-479*V)))))+this.x0,R=this.a*(this.k0*(ne-this.ml0+_*y*D/2*(1+N/12*(5-V+9*j+4*W+N/30*(61+J-58*V+270*j-330*V*j+N/56*(1385+543*J-J*V-3111*V))))))+this.y0}else{var I=T*Math.sin(y);if(Math.abs(Math.abs(I)-1)<b)return 93;if(S=.5*this.a*this.k0*Math.log((1+I)/(1-I))+this.x0,R=T*Math.cos(y)/Math.sqrt(1-Math.pow(I,2)),I=Math.abs(R),I>=1){if(I-1>b)return 93;R=0}else R=Math.acos(R);f<0&&(R=-R),R=this.a*this.k0*(R-this.lat0)+this.y0}return s.x=S,s.y=R,s}function Ol(s){var l,f,y,g,S=(s.x-this.x0)*(1/this.a),R=(s.y-this.y0)*(1/this.a);if(this.es)if(l=this.ml0+R/this.k0,f=Xi(l,this.es,this.en),Math.abs(f)<m){var N=Math.sin(f),j=Math.cos(f),W=Math.abs(j)>b?Math.tan(f):0,H=this.ep2*Math.pow(j,2),V=Math.pow(H,2),J=Math.pow(W,2),ne=Math.pow(J,2);l=1-this.es*Math.pow(N,2);var fe=S*Math.sqrt(l)/this.k0,be=Math.pow(fe,2);l=l*W,y=f-l*be/(1-this.es)*.5*(1-be/12*(5+3*J-9*H*J+H-4*V-be/30*(61+90*J-252*H*J+45*ne+46*H-be/56*(1385+3633*J+4095*ne+1574*ne*J)))),g=Y(this.long0+fe*(1-be/6*(1+2*J+H-be/20*(5+28*J+24*ne+8*H*J+6*H-be/42*(61+662*J+1320*ne+720*ne*J))))/j)}else y=m*Ui(R),g=0;else{var _=Math.exp(S/this.k0),T=.5*(_-1/_),I=this.lat0+R/this.k0,D=Math.cos(I);l=Math.sqrt((1-Math.pow(D,2))/(1+Math.pow(T,2))),y=Math.asin(l),R<0&&(y=-y),T===0&&D===0?g=0:g=Y(Math.atan2(T,D)+this.long0)}return s.x=g,s.y=y,s}var Nf=["Fast_Transverse_Mercator","Fast Transverse Mercator"],to={init:Si,forward:kf,inverse:Ol,names:Nf},Ja=function(s){var l=Math.exp(s);return l=(l-1/l)/2,l},ir=function(s,l){s=Math.abs(s),l=Math.abs(l);var f=Math.max(s,l),y=Math.min(s,l)/(f||1);return f*Math.sqrt(1+Math.pow(y,2))},Il=function(s){var l=1+s,f=l-1;return f===0?s:s*Math.log(l)/f},Ll=function(s){var l=Math.abs(s);return l=Il(l*(1+l/(ir(1,l)+1))),s<0?-l:l},ro=function(s,l){for(var f=2*Math.cos(2*l),y=s.length-1,g=s[y],S=0,R;--y>=0;)R=-S+f*g+s[y],S=g,g=R;return l+R*Math.sin(2*l)},Qi=function(s,l){for(var f=2*Math.cos(l),y=s.length-1,g=s[y],S=0,R;--y>=0;)R=-S+f*g+s[y],S=g,g=R;return Math.sin(l)*R},Za=function(s){var l=Math.exp(s);return l=(l+1/l)/2,l},Ya=function(s,l,f){for(var y=Math.sin(l),g=Math.cos(l),S=Ja(f),R=Za(f),_=2*g*R,T=-2*y*S,I=s.length-1,D=s[I],N=0,j=0,W=0,H,V;--I>=0;)H=j,V=N,j=D,N=W,D=-H+_*j-T*N+s[I],W=-V+T*j+_*N;return _=y*R,T=g*S,[_*D-T*W,_*W+T*D]};function Bf(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(to.init.apply(this),this.forward=to.forward,this.inverse=to.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var s=this.es/(1+Math.sqrt(1-this.es)),l=s/(2-s),f=l;this.cgb[0]=l*(2+l*(-2/3+l*(-2+l*(116/45+l*(26/45+l*(-2854/675)))))),this.cbg[0]=l*(-2+l*(2/3+l*(4/3+l*(-82/45+l*(32/45+l*(4642/4725)))))),f=f*l,this.cgb[1]=f*(7/3+l*(-8/5+l*(-227/45+l*(2704/315+l*(2323/945))))),this.cbg[1]=f*(5/3+l*(-16/15+l*(-13/9+l*(904/315+l*(-1522/945))))),f=f*l,this.cgb[2]=f*(56/15+l*(-136/35+l*(-1262/105+l*(73814/2835)))),this.cbg[2]=f*(-26/15+l*(34/21+l*(8/5+l*(-12686/2835)))),f=f*l,this.cgb[3]=f*(4279/630+l*(-332/35+l*(-399572/14175))),this.cbg[3]=f*(1237/630+l*(-12/5+l*(-24832/14175))),f=f*l,this.cgb[4]=f*(4174/315+l*(-144838/6237)),this.cbg[4]=f*(-734/315+l*(109598/31185)),f=f*l,this.cgb[5]=f*(601676/22275),this.cbg[5]=f*(444337/155925),f=Math.pow(l,2),this.Qn=this.k0/(1+l)*(1+f*(1/4+f*(1/64+f/256))),this.utg[0]=l*(-.5+l*(2/3+l*(-37/96+l*(1/360+l*(81/512+l*(-96199/604800)))))),this.gtu[0]=l*(.5+l*(-2/3+l*(5/16+l*(41/180+l*(-127/288+l*(7891/37800)))))),this.utg[1]=f*(-1/48+l*(-1/15+l*(437/1440+l*(-46/105+l*(1118711/3870720))))),this.gtu[1]=f*(13/48+l*(-3/5+l*(557/1440+l*(281/630+l*(-1983433/1935360))))),f=f*l,this.utg[2]=f*(-17/480+l*(37/840+l*(209/4480+l*(-5569/90720)))),this.gtu[2]=f*(61/240+l*(-103/140+l*(15061/26880+l*(167603/181440)))),f=f*l,this.utg[3]=f*(-4397/161280+l*(11/504+l*(830251/7257600))),this.gtu[3]=f*(49561/161280+l*(-179/168+l*(6601661/7257600))),f=f*l,this.utg[4]=f*(-4583/161280+l*(108847/3991680)),this.gtu[4]=f*(34729/80640+l*(-3418889/1995840)),f=f*l,this.utg[5]=f*(-20648693/638668800),this.gtu[5]=f*(212378941/319334400);var y=ro(this.cbg,this.lat0);this.Zb=-this.Qn*(y+Qi(this.gtu,2*y))}function io(s){var l=Y(s.x-this.long0),f=s.y;f=ro(this.cbg,f);var y=Math.sin(f),g=Math.cos(f),S=Math.sin(l),R=Math.cos(l);f=Math.atan2(y,R*g),l=Math.atan2(S*g,ir(y,g*R)),l=Ll(Math.tan(l));var _=Ya(this.gtu,2*f,2*l);f=f+_[0],l=l+_[1];var T,I;return Math.abs(l)<=2.623395162778?(T=this.a*(this.Qn*l)+this.x0,I=this.a*(this.Qn*f+this.Zb)+this.y0):(T=1/0,I=1/0),s.x=T,s.y=I,s}function Df(s){var l=(s.x-this.x0)*(1/this.a),f=(s.y-this.y0)*(1/this.a);f=(f-this.Zb)/this.Qn,l=l/this.Qn;var y,g;if(Math.abs(l)<=2.623395162778){var S=Ya(this.utg,2*f,2*l);f=f+S[0],l=l+S[1],l=Math.atan(Ja(l));var R=Math.sin(f),_=Math.cos(f),T=Math.sin(l),I=Math.cos(l);f=Math.atan2(R*I,ir(T,I*_)),l=Math.atan2(T,I*_),y=Y(l+this.long0),g=ro(this.cgb,f)}else y=1/0,g=1/0;return s.x=y,s.y=g,s}var zf=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"],Wn={init:Bf,forward:io,inverse:Df,names:zf},jf=function(s,l){if(s===void 0){if(s=Math.floor((Y(l)+Math.PI)*30/Math.PI)+1,s<0)return 0;if(s>60)return 60}return s},no="etmerc";function Xa(){var s=jf(this.zone,this.long0);if(s===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(s)-183)*E,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Wn.init.apply(this),this.forward=Wn.forward,this.inverse=Wn.inverse}var Ff=["Universal Transverse Mercator System","utm"],$f={init:Xa,names:Ff,dependsOn:no},Un=function(s,l){return Math.pow((1-s)/(1+s),l)},kl=20;function so(){var s=Math.sin(this.lat0),l=Math.cos(this.lat0);l*=l,this.rc=Math.sqrt(1-this.es)/(1-this.es*s*s),this.C=Math.sqrt(1+this.es*l*l/(1-this.es)),this.phic0=Math.asin(s/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+C)/(Math.pow(Math.tan(.5*this.lat0+C),this.C)*Un(this.e*s,this.ratexp))}function Qa(s){var l=s.x,f=s.y;return s.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*f+C),this.C)*Un(this.e*Math.sin(f),this.ratexp))-m,s.x=this.C*l,s}function xi(s){for(var l=1e-14,f=s.x/this.C,y=s.y,g=Math.pow(Math.tan(.5*y+C)/this.K,1/this.C),S=kl;S>0&&(y=2*Math.atan(g*Un(this.e*Math.sin(s.y),-.5*this.e))-m,!(Math.abs(y-s.y)<l));--S)s.y=y;return S?(s.x=f,s.y=y,s):null}var Gn=["gauss"],en={init:so,forward:Qa,inverse:xi,names:Gn};function Nl(){en.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function qf(s){var l,f,y,g;return s.x=Y(s.x-this.long0),en.forward.apply(this,[s]),l=Math.sin(s.y),f=Math.cos(s.y),y=Math.cos(s.x),g=this.k0*this.R2/(1+this.sinc0*l+this.cosc0*f*y),s.x=g*f*Math.sin(s.x),s.y=g*(this.cosc0*l-this.sinc0*f*y),s.x=this.a*s.x+this.x0,s.y=this.a*s.y+this.y0,s}function e1(s){var l,f,y,g,S;if(s.x=(s.x-this.x0)/this.a,s.y=(s.y-this.y0)/this.a,s.x/=this.k0,s.y/=this.k0,S=Math.sqrt(s.x*s.x+s.y*s.y)){var R=2*Math.atan2(S,this.R2);l=Math.sin(R),f=Math.cos(R),g=Math.asin(f*this.sinc0+s.y*l*this.cosc0/S),y=Math.atan2(s.x*l,S*this.cosc0*f-s.y*this.sinc0*l)}else g=this.phic0,y=0;return s.x=y,s.y=g,en.inverse.apply(this,[s]),s.x=Y(s.x+this.long0),s}var Hf=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],Bl={init:Nl,forward:qf,inverse:e1,names:Hf};function oo(s,l,f){return l*=f,Math.tan(.5*(m+s))*Math.pow((1-l)/(1+l),.5*f)}function t1(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=b&&(this.k0=.5*(1+Ui(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=b&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=b&&(this.k0=.5*this.cons*kt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/ct(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=kt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-m,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Dl(s){var l=s.x,f=s.y,y=Math.sin(f),g=Math.cos(f),S,R,_,T,I,D,N=Y(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=b&&Math.abs(f+this.lat0)<=b?(s.x=NaN,s.y=NaN,s):this.sphere?(S=2*this.k0/(1+this.sinlat0*y+this.coslat0*g*Math.cos(N)),s.x=this.a*S*g*Math.sin(N)+this.x0,s.y=this.a*S*(this.coslat0*y-this.sinlat0*g*Math.cos(N))+this.y0,s):(R=2*Math.atan(this.ssfn_(f,y,this.e))-m,T=Math.cos(R),_=Math.sin(R),Math.abs(this.coslat0)<=b?(I=ct(this.e,f*this.con,this.con*y),D=2*this.a*this.k0*I/this.cons,s.x=this.x0+D*Math.sin(l-this.long0),s.y=this.y0-this.con*D*Math.cos(l-this.long0),s):(Math.abs(this.sinlat0)<b?(S=2*this.a*this.k0/(1+T*Math.cos(N)),s.y=S*_):(S=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*_+this.cosX0*T*Math.cos(N))),s.y=S*(this.cosX0*_-this.sinX0*T*Math.cos(N))+this.y0),s.x=S*T*Math.sin(N)+this.x0,s))}function zl(s){s.x-=this.x0,s.y-=this.y0;var l,f,y,g,S,R=Math.sqrt(s.x*s.x+s.y*s.y);if(this.sphere){var _=2*Math.atan(R/(2*this.a*this.k0));return l=this.long0,f=this.lat0,R<=b?(s.x=l,s.y=f,s):(f=Math.asin(Math.cos(_)*this.sinlat0+s.y*Math.sin(_)*this.coslat0/R),Math.abs(this.coslat0)<b?this.lat0>0?l=Y(this.long0+Math.atan2(s.x,-1*s.y)):l=Y(this.long0+Math.atan2(s.x,s.y)):l=Y(this.long0+Math.atan2(s.x*Math.sin(_),R*this.coslat0*Math.cos(_)-s.y*this.sinlat0*Math.sin(_))),s.x=l,s.y=f,s)}else if(Math.abs(this.coslat0)<=b){if(R<=b)return f=this.lat0,l=this.long0,s.x=l,s.y=f,s;s.x*=this.con,s.y*=this.con,y=R*this.cons/(2*this.a*this.k0),f=this.con*Nr(this.e,y),l=this.con*Y(this.con*this.long0+Math.atan2(s.x,-1*s.y))}else g=2*Math.atan(R*this.cosX0/(2*this.a*this.k0*this.ms1)),l=this.long0,R<=b?S=this.X0:(S=Math.asin(Math.cos(g)*this.sinX0+s.y*Math.sin(g)*this.cosX0/R),l=Y(this.long0+Math.atan2(s.x*Math.sin(g),R*this.cosX0*Math.cos(g)-s.y*this.sinX0*Math.sin(g)))),f=-1*Nr(this.e,Math.tan(.5*(m+S)));return s.x=l,s.y=f,s}var Wf=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],Uf={init:t1,forward:Dl,inverse:zl,names:Wf,ssfn_:oo};function r1(){var s=this.lat0;this.lambda0=this.long0;var l=Math.sin(s),f=this.a,y=this.rf,g=1/y,S=2*g-Math.pow(g,2),R=this.e=Math.sqrt(S);this.R=this.k0*f*Math.sqrt(1-S)/(1-S*Math.pow(l,2)),this.alpha=Math.sqrt(1+S/(1-S)*Math.pow(Math.cos(s),4)),this.b0=Math.asin(l/this.alpha);var _=Math.log(Math.tan(Math.PI/4+this.b0/2)),T=Math.log(Math.tan(Math.PI/4+s/2)),I=Math.log((1+R*l)/(1-R*l));this.K=_-this.alpha*T+this.alpha*R/2*I}function jl(s){var l=Math.log(Math.tan(Math.PI/4-s.y/2)),f=this.e/2*Math.log((1+this.e*Math.sin(s.y))/(1-this.e*Math.sin(s.y))),y=-this.alpha*(l+f)+this.K,g=2*(Math.atan(Math.exp(y))-Math.PI/4),S=this.alpha*(s.x-this.lambda0),R=Math.atan(Math.sin(S)/(Math.sin(this.b0)*Math.tan(g)+Math.cos(this.b0)*Math.cos(S))),_=Math.asin(Math.cos(this.b0)*Math.sin(g)-Math.sin(this.b0)*Math.cos(g)*Math.cos(S));return s.y=this.R/2*Math.log((1+Math.sin(_))/(1-Math.sin(_)))+this.y0,s.x=this.R*R+this.x0,s}function Gf(s){for(var l=s.x-this.x0,f=s.y-this.y0,y=l/this.R,g=2*(Math.atan(Math.exp(f/this.R))-Math.PI/4),S=Math.asin(Math.cos(this.b0)*Math.sin(g)+Math.sin(this.b0)*Math.cos(g)*Math.cos(y)),R=Math.atan(Math.sin(y)/(Math.cos(this.b0)*Math.cos(y)-Math.sin(this.b0)*Math.tan(g))),_=this.lambda0+R/this.alpha,T=0,I=S,D=-1e3,N=0;Math.abs(I-D)>1e-7;){if(++N>20)return;T=1/this.alpha*(Math.log(Math.tan(Math.PI/4+S/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(I))/2)),D=I,I=2*Math.atan(Math.exp(T))-Math.PI/2}return s.x=_,s.y=I,s}var Vf=["somerc"],Kf={init:r1,forward:jl,inverse:Gf,names:Vf},Mi=1e-7;function tn(s){var l=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],f=typeof s.PROJECTION=="object"?Object.keys(s.PROJECTION)[0]:s.PROJECTION;return"no_uoff"in s||"no_off"in s||l.indexOf(f)!==-1}function ao(){var s,l,f,y,g,S,R,_,T,I,D=0,N,j=0,W=0,H=0,V=0,J=0,ne=0;this.no_off=tn(this),this.no_rot="no_rot"in this;var fe=!1;"alpha"in this&&(fe=!0);var be=!1;if("rectified_grid_angle"in this&&(be=!0),fe&&(ne=this.alpha),be&&(D=this.rectified_grid_angle*E),fe||be)j=this.longc;else if(W=this.long1,V=this.lat1,H=this.long2,J=this.lat2,Math.abs(V-J)<=Mi||(s=Math.abs(V))<=Mi||Math.abs(s-m)<=Mi||Math.abs(Math.abs(this.lat0)-m)<=Mi||Math.abs(Math.abs(J)-m)<=Mi)throw new Error;var Ke=1-this.es;l=Math.sqrt(Ke),Math.abs(this.lat0)>b?(_=Math.sin(this.lat0),f=Math.cos(this.lat0),s=1-this.es*_*_,this.B=f*f,this.B=Math.sqrt(1+this.es*this.B*this.B/Ke),this.A=this.B*this.k0*l/s,y=this.B*l/(f*Math.sqrt(s)),g=y*y-1,g<=0?g=0:(g=Math.sqrt(g),this.lat0<0&&(g=-g)),this.E=g+=y,this.E*=Math.pow(ct(this.e,this.lat0,_),this.B)):(this.B=1/l,this.A=this.k0,this.E=y=g=1),fe||be?(fe?(N=Math.asin(Math.sin(ne)/y),be||(D=ne)):(N=D,ne=Math.asin(y*Math.sin(N))),this.lam0=j-Math.asin(.5*(g-1/g)*Math.tan(N))/this.B):(S=Math.pow(ct(this.e,V,Math.sin(V)),this.B),R=Math.pow(ct(this.e,J,Math.sin(J)),this.B),g=this.E/S,T=(R-S)/(R+S),I=this.E*this.E,I=(I-R*S)/(I+R*S),s=W-H,s<-Math.pi?H-=P:s>Math.pi&&(H+=P),this.lam0=Y(.5*(W+H)-Math.atan(I*Math.tan(.5*this.B*(W-H))/T)/this.B),N=Math.atan(2*Math.sin(this.B*Y(W-this.lam0))/(g-1/g)),D=ne=Math.asin(y*Math.sin(N))),this.singam=Math.sin(N),this.cosgam=Math.cos(N),this.sinrot=Math.sin(D),this.cosrot=Math.cos(D),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(y*y-1)/Math.cos(ne))),this.lat0<0&&(this.u_0=-this.u_0)),g=.5*N,this.v_pole_n=this.ArB*Math.log(Math.tan(C-g)),this.v_pole_s=this.ArB*Math.log(Math.tan(C+g))}function Vn(s){var l={},f,y,g,S,R,_,T,I;if(s.x=s.x-this.lam0,Math.abs(Math.abs(s.y)-m)>b){if(R=this.E/Math.pow(ct(this.e,s.y,Math.sin(s.y)),this.B),_=1/R,f=.5*(R-_),y=.5*(R+_),S=Math.sin(this.B*s.x),g=(f*this.singam-S*this.cosgam)/y,Math.abs(Math.abs(g)-1)<b)throw new Error;I=.5*this.ArB*Math.log((1-g)/(1+g)),_=Math.cos(this.B*s.x),Math.abs(_)<Mi?T=this.A*s.x:T=this.ArB*Math.atan2(f*this.cosgam+S*this.singam,_)}else I=s.y>0?this.v_pole_n:this.v_pole_s,T=this.ArB*s.y;return this.no_rot?(l.x=T,l.y=I):(T-=this.u_0,l.x=I*this.cosrot+T*this.sinrot,l.y=T*this.cosrot-I*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l}function Fl(s){var l,f,y,g,S,R,_,T={};if(s.x=(s.x-this.x0)*(1/this.a),s.y=(s.y-this.y0)*(1/this.a),this.no_rot?(f=s.y,l=s.x):(f=s.x*this.cosrot-s.y*this.sinrot,l=s.y*this.cosrot+s.x*this.sinrot+this.u_0),y=Math.exp(-this.BrA*f),g=.5*(y-1/y),S=.5*(y+1/y),R=Math.sin(this.BrA*l),_=(R*this.cosgam+g*this.singam)/S,Math.abs(Math.abs(_)-1)<b)T.x=0,T.y=_<0?-m:m;else{if(T.y=this.E/Math.sqrt((1+_)/(1-_)),T.y=Nr(this.e,Math.pow(T.y,1/this.B)),T.y===1/0)throw new Error;T.x=-this.rB*Math.atan2(g*this.cosgam-R*this.singam,Math.cos(this.BrA*l))}return T.x+=this.lam0,T}var lo=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"],Kn={init:ao,forward:Vn,inverse:Fl,names:lo};function uo(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<b)){var s=this.b/this.a;this.e=Math.sqrt(1-s*s);var l=Math.sin(this.lat1),f=Math.cos(this.lat1),y=kt(this.e,l,f),g=ct(this.e,this.lat1,l),S=Math.sin(this.lat2),R=Math.cos(this.lat2),_=kt(this.e,S,R),T=ct(this.e,this.lat2,S),I=ct(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>b?this.ns=Math.log(y/_)/Math.log(g/T):this.ns=l,isNaN(this.ns)&&(this.ns=l),this.f0=y/(this.ns*Math.pow(g,this.ns)),this.rh=this.a*this.f0*Math.pow(I,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Zr(s){var l=s.x,f=s.y;Math.abs(2*Math.abs(f)-Math.PI)<=b&&(f=Ui(f)*(m-2*b));var y=Math.abs(Math.abs(f)-m),g,S;if(y>b)g=ct(this.e,f,Math.sin(f)),S=this.a*this.f0*Math.pow(g,this.ns);else{if(y=f*this.ns,y<=0)return null;S=0}var R=this.ns*Y(l-this.long0);return s.x=this.k0*(S*Math.sin(R))+this.x0,s.y=this.k0*(this.rh-S*Math.cos(R))+this.y0,s}function i1(s){var l,f,y,g,S,R=(s.x-this.x0)/this.k0,_=this.rh-(s.y-this.y0)/this.k0;this.ns>0?(l=Math.sqrt(R*R+_*_),f=1):(l=-Math.sqrt(R*R+_*_),f=-1);var T=0;if(l!==0&&(T=Math.atan2(f*R,f*_)),l!==0||this.ns>0){if(f=1/this.ns,y=Math.pow(l/(this.a*this.f0),f),g=Nr(this.e,y),g===-9999)return null}else g=-m;return S=Y(T/this.ns+this.long0),s.x=S,s.y=g,s}var Jf=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],rn={init:uo,forward:Zr,inverse:i1,names:Jf};function $l(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Zf(s){var l,f,y,g,S,R,_,T=s.x,I=s.y,D=Y(T-this.long0);return l=Math.pow((1+this.e*Math.sin(I))/(1-this.e*Math.sin(I)),this.alfa*this.e/2),f=2*(Math.atan(this.k*Math.pow(Math.tan(I/2+this.s45),this.alfa)/l)-this.s45),y=-D*this.alfa,g=Math.asin(Math.cos(this.ad)*Math.sin(f)+Math.sin(this.ad)*Math.cos(f)*Math.cos(y)),S=Math.asin(Math.cos(f)*Math.sin(y)/Math.cos(g)),R=this.n*S,_=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(g/2+this.s45),this.n),s.y=_*Math.cos(R)/1,s.x=_*Math.sin(R)/1,this.czech||(s.y*=-1,s.x*=-1),s}function co(s){var l,f,y,g,S,R,_,T,I=s.x;s.x=s.y,s.y=I,this.czech||(s.y*=-1,s.x*=-1),R=Math.sqrt(s.x*s.x+s.y*s.y),S=Math.atan2(s.y,s.x),g=S/Math.sin(this.s0),y=2*(Math.atan(Math.pow(this.ro0/R,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),l=Math.asin(Math.cos(this.ad)*Math.sin(y)-Math.sin(this.ad)*Math.cos(y)*Math.cos(g)),f=Math.asin(Math.cos(y)*Math.sin(g)/Math.cos(l)),s.x=this.long0-f/this.alfa,_=l,T=0;var D=0;do s.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(l/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(_))/(1-this.e*Math.sin(_)),this.e/2))-this.s45),Math.abs(_-s.y)<1e-10&&(T=1),_=s.y,D+=1;while(T===0&&D<15);return D>=15?null:s}var Yf=["Krovak","krovak"],Xf={init:$l,forward:Zf,inverse:co,names:Yf},wt=function(s,l,f,y,g){return s*g-l*Math.sin(2*g)+f*Math.sin(4*g)-y*Math.sin(6*g)},Jn=function(s){return 1-.25*s*(1+s/16*(3+1.25*s))},Zn=function(s){return .375*s*(1+.25*s*(1+.46875*s))},Yn=function(s){return .05859375*s*s*(1+.75*s)},Xn=function(s){return s*s*s*(35/3072)},nn=function(s,l,f){var y=l*f;return s/Math.sqrt(1-y*y)},sn=function(s){return Math.abs(s)<m?s:s-Ui(s)*Math.PI},fo=function(s,l,f,y,g){var S,R;S=s/l;for(var _=0;_<15;_++)if(R=(s-(l*S-f*Math.sin(2*S)+y*Math.sin(4*S)-g*Math.sin(6*S)))/(l-2*f*Math.cos(2*S)+4*y*Math.cos(4*S)-6*g*Math.cos(6*S)),S+=R,Math.abs(R)<=1e-10)return S;return NaN};function Qf(){this.sphere||(this.e0=Jn(this.es),this.e1=Zn(this.es),this.e2=Yn(this.es),this.e3=Xn(this.es),this.ml0=this.a*wt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function ql(s){var l,f,y=s.x,g=s.y;if(y=Y(y-this.long0),this.sphere)l=this.a*Math.asin(Math.cos(g)*Math.sin(y)),f=this.a*(Math.atan2(Math.tan(g),Math.cos(y))-this.lat0);else{var S=Math.sin(g),R=Math.cos(g),_=nn(this.a,this.e,S),T=Math.tan(g)*Math.tan(g),I=y*Math.cos(g),D=I*I,N=this.es*R*R/(1-this.es),j=this.a*wt(this.e0,this.e1,this.e2,this.e3,g);l=_*I*(1-D*T*(1/6-(8-T+8*N)*D/120)),f=j-this.ml0+_*S/R*D*(.5+(5-T+6*N)*D/24)}return s.x=l+this.x0,s.y=f+this.y0,s}function eh(s){s.x-=this.x0,s.y-=this.y0;var l=s.x/this.a,f=s.y/this.a,y,g;if(this.sphere){var S=f+this.lat0;y=Math.asin(Math.sin(S)*Math.cos(l)),g=Math.atan2(Math.tan(l),Math.cos(S))}else{var R=this.ml0/this.a+f,_=fo(R,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(_)-m)<=b)return s.x=this.long0,s.y=m,f<0&&(s.y*=-1),s;var T=nn(this.a,this.e,Math.sin(_)),I=T*T*T/this.a/this.a*(1-this.es),D=Math.pow(Math.tan(_),2),N=l*this.a/T,j=N*N;y=_-T*Math.tan(_)/I*N*N*(.5-(1+3*D)*N*N/24),g=N*(1-j*(D/3+(1+3*D)*D*j/15))/Math.cos(_)}return s.x=Y(g+this.long0),s.y=sn(y),s}var th=["Cassini","Cassini_Soldner","cass"],Yr={init:Qf,forward:ql,inverse:eh,names:th},yr=function(s,l){var f;return s>1e-7?(f=s*l,(1-s*s)*(l/(1-f*f)-.5/s*Math.log((1-f)/(1+f)))):2*l},Hl=1,n1=2,Xr=3,Qr=4;function nr(){var s=Math.abs(this.lat0);if(Math.abs(s-m)<b?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(s)<b?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var l;switch(this.qp=yr(this.e,1),this.mmf=.5/(1-this.es),this.apa=Jl(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),l=Math.sin(this.lat0),this.sinb1=yr(this.e,l)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*l*l)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Qn(s){var l,f,y,g,S,R,_,T,I,D,N=s.x,j=s.y;if(N=Y(N-this.long0),this.sphere){if(S=Math.sin(j),D=Math.cos(j),y=Math.cos(N),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f=this.mode===this.EQUIT?1+D*y:1+this.sinph0*S+this.cosph0*D*y,f<=b)return null;f=Math.sqrt(2/f),l=f*D*Math.sin(N),f*=this.mode===this.EQUIT?S:this.cosph0*S-this.sinph0*D*y}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(y=-y),Math.abs(j+this.lat0)<b)return null;f=C-j*.5,f=2*(this.mode===this.S_POLE?Math.cos(f):Math.sin(f)),l=f*Math.sin(N),f*=y}}else{switch(_=0,T=0,I=0,y=Math.cos(N),g=Math.sin(N),S=Math.sin(j),R=yr(this.e,S),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(_=R/this.qp,T=Math.sqrt(1-_*_)),this.mode){case this.OBLIQ:I=1+this.sinb1*_+this.cosb1*T*y;break;case this.EQUIT:I=1+T*y;break;case this.N_POLE:I=m+j,R=this.qp-R;break;case this.S_POLE:I=j-m,R=this.qp+R;break}if(Math.abs(I)<b)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:I=Math.sqrt(2/I),this.mode===this.OBLIQ?f=this.ymf*I*(this.cosb1*_-this.sinb1*T*y):f=(I=Math.sqrt(2/(1+T*y)))*_*this.ymf,l=this.xmf*I*T*g;break;case this.N_POLE:case this.S_POLE:R>=0?(l=(I=Math.sqrt(R))*g,f=y*(this.mode===this.S_POLE?I:-I)):l=f=0;break}}return s.x=this.a*l+this.x0,s.y=this.a*f+this.y0,s}function Wl(s){s.x-=this.x0,s.y-=this.y0;var l=s.x/this.a,f=s.y/this.a,y,g,S,R,_,T,I;if(this.sphere){var D=0,N,j=0;if(N=Math.sqrt(l*l+f*f),g=N*.5,g>1)return null;switch(g=2*Math.asin(g),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(j=Math.sin(g),D=Math.cos(g)),this.mode){case this.EQUIT:g=Math.abs(N)<=b?0:Math.asin(f*j/N),l*=j,f=D*N;break;case this.OBLIQ:g=Math.abs(N)<=b?this.lat0:Math.asin(D*this.sinph0+f*j*this.cosph0/N),l*=j*this.cosph0,f=(D-Math.sin(g)*this.sinph0)*N;break;case this.N_POLE:f=-f,g=m-g;break;case this.S_POLE:g-=m;break}y=f===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(l,f)}else{if(I=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,f*=this.dd,T=Math.sqrt(l*l+f*f),T<b)return s.x=this.long0,s.y=this.lat0,s;R=2*Math.asin(.5*T/this.rq),S=Math.cos(R),l*=R=Math.sin(R),this.mode===this.OBLIQ?(I=S*this.sinb1+f*R*this.cosb1/T,_=this.qp*I,f=T*this.cosb1*S-f*this.sinb1*R):(I=f*R/T,_=this.qp*I,f=T*S)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(f=-f),_=l*l+f*f,!_)return s.x=this.long0,s.y=this.lat0,s;I=1-_/this.qp,this.mode===this.S_POLE&&(I=-I)}y=Math.atan2(l,f),g=mo(Math.asin(I),this.apa)}return s.x=Y(this.long0+y),s.y=g,s}var Ei=.3333333333333333,Ul=.17222222222222222,Gl=.10257936507936508,ho=.06388888888888888,Vl=.0664021164021164,Kl=.016415012942191543;function Jl(s){var l,f=[];return f[0]=s*Ei,l=s*s,f[0]+=l*Ul,f[1]=l*ho,l*=s,f[0]+=l*Gl,f[1]+=l*Vl,f[2]=l*Kl,f}function mo(s,l){var f=s+s;return s+l[0]*Math.sin(f)+l[1]*Math.sin(f+f)+l[2]*Math.sin(f+f+f)}var Zl=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],Yl={init:nr,forward:Qn,inverse:Wl,names:Zl,S_POLE:Hl,N_POLE:n1,EQUIT:Xr,OBLIQ:Qr},ei=function(s){return Math.abs(s)>1&&(s=s>1?1:-1),Math.asin(s)};function rh(){Math.abs(this.lat1+this.lat2)<b||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=kt(this.e3,this.sin_po,this.cos_po),this.qs1=yr(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=kt(this.e3,this.sin_po,this.cos_po),this.qs2=yr(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=yr(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>b?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function ih(s){var l=s.x,f=s.y;this.sin_phi=Math.sin(f),this.cos_phi=Math.cos(f);var y=yr(this.e3,this.sin_phi,this.cos_phi),g=this.a*Math.sqrt(this.c-this.ns0*y)/this.ns0,S=this.ns0*Y(l-this.long0),R=g*Math.sin(S)+this.x0,_=this.rh-g*Math.cos(S)+this.y0;return s.x=R,s.y=_,s}function nh(s){var l,f,y,g,S,R;return s.x-=this.x0,s.y=this.rh-s.y+this.y0,this.ns0>=0?(l=Math.sqrt(s.x*s.x+s.y*s.y),y=1):(l=-Math.sqrt(s.x*s.x+s.y*s.y),y=-1),g=0,l!==0&&(g=Math.atan2(y*s.x,y*s.y)),y=l*this.ns0/this.a,this.sphere?R=Math.asin((this.c-y*y)/(2*this.ns0)):(f=(this.c-y*y)/this.ns0,R=this.phi1z(this.e3,f)),S=Y(g/this.ns0+this.long0),s.x=S,s.y=R,s}function po(s,l){var f,y,g,S,R,_=ei(.5*l);if(s<b)return _;for(var T=s*s,I=1;I<=25;I++)if(f=Math.sin(_),y=Math.cos(_),g=s*f,S=1-g*g,R=.5*S*S/y*(l/(1-T)-f/S+.5/s*Math.log((1-g)/(1+g))),_=_+R,Math.abs(R)<=1e-7)return _;return null}var sh=["Albers_Conic_Equal_Area","Albers","aea"],Xl={init:rh,forward:ih,inverse:nh,names:sh,phi1z:po};function go(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function yo(s){var l,f,y,g,S,R,_,T,I=s.x,D=s.y;return y=Y(I-this.long0),l=Math.sin(D),f=Math.cos(D),g=Math.cos(y),R=this.sin_p14*l+this.cos_p14*f*g,S=1,R>0||Math.abs(R)<=b?(_=this.x0+this.a*S*f*Math.sin(y)/R,T=this.y0+this.a*S*(this.cos_p14*l-this.sin_p14*f*g)/R):(_=this.x0+this.infinity_dist*f*Math.sin(y),T=this.y0+this.infinity_dist*(this.cos_p14*l-this.sin_p14*f*g)),s.x=_,s.y=T,s}function bo(s){var l,f,y,g,S,R;return s.x=(s.x-this.x0)/this.a,s.y=(s.y-this.y0)/this.a,s.x/=this.k0,s.y/=this.k0,(l=Math.sqrt(s.x*s.x+s.y*s.y))?(g=Math.atan2(l,this.rc),f=Math.sin(g),y=Math.cos(g),R=ei(y*this.sin_p14+s.y*f*this.cos_p14/l),S=Math.atan2(s.x*f,l*this.cos_p14*y-s.y*this.sin_p14*f),S=Y(this.long0+S)):(R=this.phic0,S=0),s.x=S,s.y=R,s}var es=["gnom"],vo={init:go,forward:yo,inverse:bo,names:es},oh=function(s,l){var f=1-(1-s*s)/(2*s)*Math.log((1-s)/(1+s));if(Math.abs(Math.abs(l)-f)<1e-6)return l<0?-1*m:m;for(var y=Math.asin(.5*l),g,S,R,_,T=0;T<30;T++)if(S=Math.sin(y),R=Math.cos(y),_=s*S,g=Math.pow(1-_*_,2)/(2*R)*(l/(1-s*s)-S/(1-_*_)+.5/s*Math.log((1-_)/(1+_))),y+=g,Math.abs(g)<=1e-10)return y;return NaN};function ah(){this.sphere||(this.k0=kt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Ql(s){var l=s.x,f=s.y,y,g,S=Y(l-this.long0);if(this.sphere)y=this.x0+this.a*S*Math.cos(this.lat_ts),g=this.y0+this.a*Math.sin(f)/Math.cos(this.lat_ts);else{var R=yr(this.e,Math.sin(f));y=this.x0+this.a*this.k0*S,g=this.y0+this.a*R*.5/this.k0}return s.x=y,s.y=g,s}function eu(s){s.x-=this.x0,s.y-=this.y0;var l,f;return this.sphere?(l=Y(this.long0+s.x/this.a/Math.cos(this.lat_ts)),f=Math.asin(s.y/this.a*Math.cos(this.lat_ts))):(f=oh(this.e,2*s.y*this.k0/this.a),l=Y(this.long0+s.x/(this.a*this.k0))),s.x=l,s.y=f,s}var lh=["cea"],tu={init:ah,forward:Ql,inverse:eu,names:lh};function uh(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function ch(s){var l=s.x,f=s.y,y=Y(l-this.long0),g=sn(f-this.lat0);return s.x=this.x0+this.a*y*this.rc,s.y=this.y0+this.a*g,s}function fh(s){var l=s.x,f=s.y;return s.x=Y(this.long0+(l-this.x0)/(this.a*this.rc)),s.y=sn(this.lat0+(f-this.y0)/this.a),s}var hh=["Equirectangular","Equidistant_Cylindrical","eqc"],dh={init:uh,forward:ch,inverse:fh,names:hh},ts=20;function ru(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Jn(this.es),this.e1=Zn(this.es),this.e2=Yn(this.es),this.e3=Xn(this.es),this.ml0=this.a*wt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function u(s){var l=s.x,f=s.y,y,g,S,R=Y(l-this.long0);if(S=R*Math.sin(f),this.sphere)Math.abs(f)<=b?(y=this.a*R,g=-1*this.a*this.lat0):(y=this.a*Math.sin(S)/Math.tan(f),g=this.a*(sn(f-this.lat0)+(1-Math.cos(S))/Math.tan(f)));else if(Math.abs(f)<=b)y=this.a*R,g=-1*this.ml0;else{var _=nn(this.a,this.e,Math.sin(f))/Math.tan(f);y=_*Math.sin(S),g=this.a*wt(this.e0,this.e1,this.e2,this.e3,f)-this.ml0+_*(1-Math.cos(S))}return s.x=y+this.x0,s.y=g+this.y0,s}function h(s){var l,f,y,g,S,R,_,T,I;if(y=s.x-this.x0,g=s.y-this.y0,this.sphere)if(Math.abs(g+this.a*this.lat0)<=b)l=Y(y/this.a+this.long0),f=0;else{R=this.lat0+g/this.a,_=y*y/this.a/this.a+R*R,T=R;var D;for(S=ts;S;--S)if(D=Math.tan(T),I=-1*(R*(T*D+1)-T-.5*(T*T+_)*D)/((T-R)/D-1),T+=I,Math.abs(I)<=b){f=T;break}l=Y(this.long0+Math.asin(y*Math.tan(T)/this.a)/Math.sin(f))}else if(Math.abs(g+this.ml0)<=b)f=0,l=Y(this.long0+y/this.a);else{R=(this.ml0+g)/this.a,_=y*y/this.a/this.a+R*R,T=R;var N,j,W,H,V;for(S=ts;S;--S)if(V=this.e*Math.sin(T),N=Math.sqrt(1-V*V)*Math.tan(T),j=this.a*wt(this.e0,this.e1,this.e2,this.e3,T),W=this.e0-2*this.e1*Math.cos(2*T)+4*this.e2*Math.cos(4*T)-6*this.e3*Math.cos(6*T),H=j/this.a,I=(R*(N*H+1)-H-.5*N*(H*H+_))/(this.es*Math.sin(2*T)*(H*H+_-2*R*H)/(4*N)+(R-H)*(N*W-2/Math.sin(2*T))-W),T-=I,Math.abs(I)<=b){f=T;break}N=Math.sqrt(1-this.es*Math.pow(Math.sin(f),2))*Math.tan(f),l=Y(this.long0+Math.asin(y*N/this.a)/Math.sin(f))}return s.x=l,s.y=f,s}var M=["Polyconic","poly"],O={init:ru,forward:u,inverse:h,names:M};function B(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function F(s){var l,f=s.x,y=s.y,g=y-this.lat0,S=f-this.long0,R=g/p*1e-5,_=S,T=1,I=0;for(l=1;l<=10;l++)T=T*R,I=I+this.A[l]*T;var D=I,N=_,j=1,W=0,H,V,J=0,ne=0;for(l=1;l<=6;l++)H=j*D-W*N,V=W*D+j*N,j=H,W=V,J=J+this.B_re[l]*j-this.B_im[l]*W,ne=ne+this.B_im[l]*j+this.B_re[l]*W;return s.x=ne*this.a+this.x0,s.y=J*this.a+this.y0,s}function q(s){var l,f=s.x,y=s.y,g=f-this.x0,S=y-this.y0,R=S/this.a,_=g/this.a,T=1,I=0,D,N,j=0,W=0;for(l=1;l<=6;l++)D=T*R-I*_,N=I*R+T*_,T=D,I=N,j=j+this.C_re[l]*T-this.C_im[l]*I,W=W+this.C_im[l]*T+this.C_re[l]*I;for(var H=0;H<this.iterations;H++){var V=j,J=W,ne,fe,be=R,Ke=_;for(l=2;l<=6;l++)ne=V*j-J*W,fe=J*j+V*W,V=ne,J=fe,be=be+(l-1)*(this.B_re[l]*V-this.B_im[l]*J),Ke=Ke+(l-1)*(this.B_im[l]*V+this.B_re[l]*J);V=1,J=0;var ze=this.B_re[1],He=this.B_im[1];for(l=2;l<=6;l++)ne=V*j-J*W,fe=J*j+V*W,V=ne,J=fe,ze=ze+l*(this.B_re[l]*V-this.B_im[l]*J),He=He+l*(this.B_im[l]*V+this.B_re[l]*J);var Rt=ze*ze+He*He;j=(be*ze+Ke*He)/Rt,W=(Ke*ze-be*He)/Rt}var st=j,ri=W,rs=1,is=0;for(l=1;l<=9;l++)rs=rs*st,is=is+this.D[l]*rs;var ou=this.lat0+is*p*1e5,B8=this.long0+ri;return s.x=B8,s.y=ou,s}var te=["New_Zealand_Map_Grid","nzmg"],he={init:B,forward:F,inverse:q,names:te};function _e(){}function Te(s){var l=s.x,f=s.y,y=Y(l-this.long0),g=this.x0+this.a*y,S=this.y0+this.a*Math.log(Math.tan(Math.PI/4+f/2.5))*1.25;return s.x=g,s.y=S,s}function Pe(s){s.x-=this.x0,s.y-=this.y0;var l=Y(this.long0+s.x/this.a),f=2.5*(Math.atan(Math.exp(.8*s.y/this.a))-Math.PI/4);return s.x=l,s.y=f,s}var nt=["Miller_Cylindrical","mill"],sr={init:_e,forward:Te,inverse:Pe,names:nt},on=20;function ti(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Pl(this.es)}function zr(s){var l,f,y=s.x,g=s.y;if(y=Y(y-this.long0),this.sphere){if(!this.m)g=this.n!==1?Math.asin(this.n*Math.sin(g)):g;else for(var S=this.n*Math.sin(g),R=on;R;--R){var _=(this.m*g+Math.sin(g)-S)/(this.m+Math.cos(g));if(g-=_,Math.abs(_)<b)break}l=this.a*this.C_x*y*(this.m+Math.cos(g)),f=this.a*this.C_y*g}else{var T=Math.sin(g),I=Math.cos(g);f=this.a*_i(g,T,I,this.en),l=this.a*y*I/Math.sqrt(1-this.es*T*T)}return s.x=l,s.y=f,s}function _t(s){var l,f,y,g;return s.x-=this.x0,y=s.x/this.a,s.y-=this.y0,l=s.y/this.a,this.sphere?(l/=this.C_y,y=y/(this.C_x*(this.m+Math.cos(l))),this.m?l=ei((this.m*l+Math.sin(l))/this.n):this.n!==1&&(l=ei(Math.sin(l)/this.n)),y=Y(y+this.long0),l=sn(l)):(l=Xi(s.y/this.a,this.es,this.en),g=Math.abs(l),g<m?(g=Math.sin(l),f=this.long0+s.x*Math.sqrt(1-this.es*g*g)/(this.a*Math.cos(l)),y=Y(f)):g-b<m&&(y=this.long0)),s.x=y,s.y=l,s}var Mt=["Sinusoidal","sinu"],Vt={init:ti,forward:zr,inverse:_t,names:Mt};function jr(){}function se(s){for(var l=s.x,f=s.y,y=Y(l-this.long0),g=f,S=Math.PI*Math.sin(f);;){var R=-(g+Math.sin(g)-S)/(1+Math.cos(g));if(g+=R,Math.abs(R)<b)break}g/=2,Math.PI/2-Math.abs(f)<b&&(y=0);var _=.900316316158*this.a*y*Math.cos(g)+this.x0,T=1.4142135623731*this.a*Math.sin(g)+this.y0;return s.x=_,s.y=T,s}function ye(s){var l,f;s.x-=this.x0,s.y-=this.y0,f=s.y/(1.4142135623731*this.a),Math.abs(f)>.999999999999&&(f=.999999999999),l=Math.asin(f);var y=Y(this.long0+s.x/(.900316316158*this.a*Math.cos(l)));y<-Math.PI&&(y=-Math.PI),y>Math.PI&&(y=Math.PI),f=(2*l+Math.sin(2*l))/Math.PI,Math.abs(f)>1&&(f=1);var g=Math.asin(f);return s.x=y,s.y=g,s}var Ge=["Mollweide","moll"],Bt={init:jr,forward:se,inverse:ye,names:Ge};function an(){Math.abs(this.lat1+this.lat2)<b||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Jn(this.es),this.e1=Zn(this.es),this.e2=Yn(this.es),this.e3=Xn(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=kt(this.e,this.sinphi,this.cosphi),this.ml1=wt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<b?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=kt(this.e,this.sinphi,this.cosphi),this.ml2=wt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=wt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function ln(s){var l=s.x,f=s.y,y;if(this.sphere)y=this.a*(this.g-f);else{var g=wt(this.e0,this.e1,this.e2,this.e3,f);y=this.a*(this.g-g)}var S=this.ns*Y(l-this.long0),R=this.x0+y*Math.sin(S),_=this.y0+this.rh-y*Math.cos(S);return s.x=R,s.y=_,s}function un(s){s.x-=this.x0,s.y=this.rh-s.y+this.y0;var l,f,y,g;this.ns>=0?(f=Math.sqrt(s.x*s.x+s.y*s.y),l=1):(f=-Math.sqrt(s.x*s.x+s.y*s.y),l=-1);var S=0;if(f!==0&&(S=Math.atan2(l*s.x,l*s.y)),this.sphere)return g=Y(this.long0+S/this.ns),y=sn(this.g-f/this.a),s.x=g,s.y=y,s;var R=this.g-f/this.a;return y=fo(R,this.e0,this.e1,this.e2,this.e3),g=Y(this.long0+S/this.ns),s.x=g,s.y=y,s}var wo=["Equidistant_Conic","eqdc"],iu={init:an,forward:ln,inverse:un,names:wo};function s1(){this.R=this.a}function V4(s){var l=s.x,f=s.y,y=Y(l-this.long0),g,S;Math.abs(f)<=b&&(g=this.x0+this.R*y,S=this.y0);var R=ei(2*Math.abs(f/Math.PI));(Math.abs(y)<=b||Math.abs(Math.abs(f)-m)<=b)&&(g=this.x0,f>=0?S=this.y0+Math.PI*this.R*Math.tan(.5*R):S=this.y0+Math.PI*this.R*-Math.tan(.5*R));var _=.5*Math.abs(Math.PI/y-y/Math.PI),T=_*_,I=Math.sin(R),D=Math.cos(R),N=D/(I+D-1),j=N*N,W=N*(2/I-1),H=W*W,V=Math.PI*this.R*(_*(N-H)+Math.sqrt(T*(N-H)*(N-H)-(H+T)*(j-H)))/(H+T);y<0&&(V=-V),g=this.x0+V;var J=T+N;return V=Math.PI*this.R*(W*J-_*Math.sqrt((H+T)*(T+1)-J*J))/(H+T),f>=0?S=this.y0+V:S=this.y0-V,s.x=g,s.y=S,s}function K4(s){var l,f,y,g,S,R,_,T,I,D,N,j,W;return s.x-=this.x0,s.y-=this.y0,N=Math.PI*this.R,y=s.x/N,g=s.y/N,S=y*y+g*g,R=-Math.abs(g)*(1+S),_=R-2*g*g+y*y,T=-2*R+1+2*g*g+S*S,W=g*g/T+(2*_*_*_/T/T/T-9*R*_/T/T)/27,I=(R-_*_/3/T)/T,D=2*Math.sqrt(-I/3),N=3*W/I/D,Math.abs(N)>1&&(N>=0?N=1:N=-1),j=Math.acos(N)/3,s.y>=0?f=(-D*Math.cos(j+Math.PI/3)-_/3/T)*Math.PI:f=-(-D*Math.cos(j+Math.PI/3)-_/3/T)*Math.PI,Math.abs(y)<b?l=this.long0:l=Y(this.long0+Math.PI*(S-1+Math.sqrt(1+2*(y*y-g*g)+S*S))/2/y),s.x=l,s.y=f,s}var J4=["Van_der_Grinten_I","VanDerGrinten","vandg"],Z4={init:s1,forward:V4,inverse:K4,names:J4};function Y4(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function X4(s){var l=s.x,f=s.y,y=Math.sin(s.y),g=Math.cos(s.y),S=Y(l-this.long0),R,_,T,I,D,N,j,W,H,V,J,ne,fe,be,Ke,ze,He,Rt,st,ri,rs,is,ou;return this.sphere?Math.abs(this.sin_p12-1)<=b?(s.x=this.x0+this.a*(m-f)*Math.sin(S),s.y=this.y0-this.a*(m-f)*Math.cos(S),s):Math.abs(this.sin_p12+1)<=b?(s.x=this.x0+this.a*(m+f)*Math.sin(S),s.y=this.y0+this.a*(m+f)*Math.cos(S),s):(Rt=this.sin_p12*y+this.cos_p12*g*Math.cos(S),ze=Math.acos(Rt),He=ze?ze/Math.sin(ze):1,s.x=this.x0+this.a*He*g*Math.sin(S),s.y=this.y0+this.a*He*(this.cos_p12*y-this.sin_p12*g*Math.cos(S)),s):(R=Jn(this.es),_=Zn(this.es),T=Yn(this.es),I=Xn(this.es),Math.abs(this.sin_p12-1)<=b?(D=this.a*wt(R,_,T,I,m),N=this.a*wt(R,_,T,I,f),s.x=this.x0+(D-N)*Math.sin(S),s.y=this.y0-(D-N)*Math.cos(S),s):Math.abs(this.sin_p12+1)<=b?(D=this.a*wt(R,_,T,I,m),N=this.a*wt(R,_,T,I,f),s.x=this.x0+(D+N)*Math.sin(S),s.y=this.y0+(D+N)*Math.cos(S),s):(j=y/g,W=nn(this.a,this.e,this.sin_p12),H=nn(this.a,this.e,y),V=Math.atan((1-this.es)*j+this.es*W*this.sin_p12/(H*g)),J=Math.atan2(Math.sin(S),this.cos_p12*Math.tan(V)-this.sin_p12*Math.cos(S)),J===0?st=Math.asin(this.cos_p12*Math.sin(V)-this.sin_p12*Math.cos(V)):Math.abs(Math.abs(J)-Math.PI)<=b?st=-Math.asin(this.cos_p12*Math.sin(V)-this.sin_p12*Math.cos(V)):st=Math.asin(Math.sin(S)*Math.cos(V)/Math.sin(J)),ne=this.e*this.sin_p12/Math.sqrt(1-this.es),fe=this.e*this.cos_p12*Math.cos(J)/Math.sqrt(1-this.es),be=ne*fe,Ke=fe*fe,ri=st*st,rs=ri*st,is=rs*st,ou=is*st,ze=W*st*(1-ri*Ke*(1-Ke)/6+rs/8*be*(1-2*Ke)+is/120*(Ke*(4-7*Ke)-3*ne*ne*(1-7*Ke))-ou/48*be),s.x=this.x0+ze*Math.sin(J),s.y=this.y0+ze*Math.cos(J),s))}function Q4(s){s.x-=this.x0,s.y-=this.y0;var l,f,y,g,S,R,_,T,I,D,N,j,W,H,V,J,ne,fe,be,Ke,ze,He,Rt,st;return this.sphere?(l=Math.sqrt(s.x*s.x+s.y*s.y),l>2*m*this.a?void 0:(f=l/this.a,y=Math.sin(f),g=Math.cos(f),S=this.long0,Math.abs(l)<=b?R=this.lat0:(R=ei(g*this.sin_p12+s.y*y*this.cos_p12/l),_=Math.abs(this.lat0)-m,Math.abs(_)<=b?this.lat0>=0?S=Y(this.long0+Math.atan2(s.x,-s.y)):S=Y(this.long0-Math.atan2(-s.x,s.y)):S=Y(this.long0+Math.atan2(s.x*y,l*this.cos_p12*g-s.y*this.sin_p12*y))),s.x=S,s.y=R,s)):(T=Jn(this.es),I=Zn(this.es),D=Yn(this.es),N=Xn(this.es),Math.abs(this.sin_p12-1)<=b?(j=this.a*wt(T,I,D,N,m),l=Math.sqrt(s.x*s.x+s.y*s.y),W=j-l,R=fo(W/this.a,T,I,D,N),S=Y(this.long0+Math.atan2(s.x,-1*s.y)),s.x=S,s.y=R,s):Math.abs(this.sin_p12+1)<=b?(j=this.a*wt(T,I,D,N,m),l=Math.sqrt(s.x*s.x+s.y*s.y),W=l-j,R=fo(W/this.a,T,I,D,N),S=Y(this.long0+Math.atan2(s.x,s.y)),s.x=S,s.y=R,s):(l=Math.sqrt(s.x*s.x+s.y*s.y),J=Math.atan2(s.x,s.y),H=nn(this.a,this.e,this.sin_p12),ne=Math.cos(J),fe=this.e*this.cos_p12*ne,be=-fe*fe/(1-this.es),Ke=3*this.es*(1-be)*this.sin_p12*this.cos_p12*ne/(1-this.es),ze=l/H,He=ze-be*(1+be)*Math.pow(ze,3)/6-Ke*(1+3*be)*Math.pow(ze,4)/24,Rt=1-be*He*He/2-ze*He*He*He/6,V=Math.asin(this.sin_p12*Math.cos(He)+this.cos_p12*Math.sin(He)*ne),S=Y(this.long0+Math.asin(Math.sin(J)*Math.sin(He)/Math.cos(V))),st=Math.sin(V),R=Math.atan2((st-this.es*Rt*this.sin_p12)*Math.tan(V),st*(1-this.es)),s.x=S,s.y=R,s))}var e8=["Azimuthal_Equidistant","aeqd"],t8={init:Y4,forward:X4,inverse:Q4,names:e8};function r8(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function i8(s){var l,f,y,g,S,R,_,T,I=s.x,D=s.y;return y=Y(I-this.long0),l=Math.sin(D),f=Math.cos(D),g=Math.cos(y),R=this.sin_p14*l+this.cos_p14*f*g,S=1,(R>0||Math.abs(R)<=b)&&(_=this.a*S*f*Math.sin(y),T=this.y0+this.a*S*(this.cos_p14*l-this.sin_p14*f*g)),s.x=_,s.y=T,s}function n8(s){var l,f,y,g,S,R,_;return s.x-=this.x0,s.y-=this.y0,l=Math.sqrt(s.x*s.x+s.y*s.y),f=ei(l/this.a),y=Math.sin(f),g=Math.cos(f),R=this.long0,Math.abs(l)<=b?(_=this.lat0,s.x=R,s.y=_,s):(_=ei(g*this.sin_p14+s.y*y*this.cos_p14/l),S=Math.abs(this.lat0)-m,Math.abs(S)<=b?(this.lat0>=0?R=Y(this.long0+Math.atan2(s.x,-s.y)):R=Y(this.long0-Math.atan2(-s.x,s.y)),s.x=R,s.y=_,s):(R=Y(this.long0+Math.atan2(s.x*y,l*this.cos_p14*g-s.y*this.sin_p14*y)),s.x=R,s.y=_,s))}var s8=["ortho"],o8={init:r8,forward:i8,inverse:n8,names:s8},rt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},qe={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function a8(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=m-C/2?this.face=rt.TOP:this.lat0<=-(m-C/2)?this.face=rt.BOTTOM:Math.abs(this.long0)<=C?this.face=rt.FRONT:Math.abs(this.long0)<=m+C?this.face=this.long0>0?rt.RIGHT:rt.LEFT:this.face=rt.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function l8(s){var l={x:0,y:0},f,y,g,S,R,_,T={value:0};if(s.x-=this.long0,this.es!==0?f=Math.atan(this.one_minus_f_squared*Math.tan(s.y)):f=s.y,y=s.x,this.face===rt.TOP)S=m-f,y>=C&&y<=m+C?(T.value=qe.AREA_0,g=y-m):y>m+C||y<=-(m+C)?(T.value=qe.AREA_1,g=y>0?y-L:y+L):y>-(m+C)&&y<=-C?(T.value=qe.AREA_2,g=y+m):(T.value=qe.AREA_3,g=y);else if(this.face===rt.BOTTOM)S=m+f,y>=C&&y<=m+C?(T.value=qe.AREA_0,g=-y+m):y<C&&y>=-C?(T.value=qe.AREA_1,g=-y):y<-C&&y>=-(m+C)?(T.value=qe.AREA_2,g=-y-m):(T.value=qe.AREA_3,g=y>0?-y+L:-y-L);else{var I,D,N,j,W,H,V;this.face===rt.RIGHT?y=_o(y,+m):this.face===rt.BACK?y=_o(y,+L):this.face===rt.LEFT&&(y=_o(y,-m)),j=Math.sin(f),W=Math.cos(f),H=Math.sin(y),V=Math.cos(y),I=W*V,D=W*H,N=j,this.face===rt.FRONT?(S=Math.acos(I),g=nu(S,N,D,T)):this.face===rt.RIGHT?(S=Math.acos(D),g=nu(S,N,-I,T)):this.face===rt.BACK?(S=Math.acos(-I),g=nu(S,N,-D,T)):this.face===rt.LEFT?(S=Math.acos(-D),g=nu(S,N,I,T)):(S=g=0,T.value=qe.AREA_0)}return _=Math.atan(12/L*(g+Math.acos(Math.sin(g)*Math.cos(C))-m)),R=Math.sqrt((1-Math.cos(S))/(Math.cos(_)*Math.cos(_))/(1-Math.cos(Math.atan(1/Math.cos(g))))),T.value===qe.AREA_1?_+=m:T.value===qe.AREA_2?_+=L:T.value===qe.AREA_3&&(_+=1.5*L),l.x=R*Math.cos(_),l.y=R*Math.sin(_),l.x=l.x*this.a+this.x0,l.y=l.y*this.a+this.y0,s.x=l.x,s.y=l.y,s}function u8(s){var l={lam:0,phi:0},f,y,g,S,R,_,T,I,D,N={value:0};if(s.x=(s.x-this.x0)/this.a,s.y=(s.y-this.y0)/this.a,y=Math.atan(Math.sqrt(s.x*s.x+s.y*s.y)),f=Math.atan2(s.y,s.x),s.x>=0&&s.x>=Math.abs(s.y)?N.value=qe.AREA_0:s.y>=0&&s.y>=Math.abs(s.x)?(N.value=qe.AREA_1,f-=m):s.x<0&&-s.x>=Math.abs(s.y)?(N.value=qe.AREA_2,f=f<0?f+L:f-L):(N.value=qe.AREA_3,f+=m),D=L/12*Math.tan(f),R=Math.sin(D)/(Math.cos(D)-1/Math.sqrt(2)),_=Math.atan(R),g=Math.cos(f),S=Math.tan(y),T=1-g*g*S*S*(1-Math.cos(Math.atan(1/Math.cos(_)))),T<-1?T=-1:T>1&&(T=1),this.face===rt.TOP)I=Math.acos(T),l.phi=m-I,N.value===qe.AREA_0?l.lam=_+m:N.value===qe.AREA_1?l.lam=_<0?_+L:_-L:N.value===qe.AREA_2?l.lam=_-m:l.lam=_;else if(this.face===rt.BOTTOM)I=Math.acos(T),l.phi=I-m,N.value===qe.AREA_0?l.lam=-_+m:N.value===qe.AREA_1?l.lam=-_:N.value===qe.AREA_2?l.lam=-_-m:l.lam=_<0?-_-L:-_+L;else{var j,W,H;j=T,D=j*j,D>=1?H=0:H=Math.sqrt(1-D)*Math.sin(_),D+=H*H,D>=1?W=0:W=Math.sqrt(1-D),N.value===qe.AREA_1?(D=W,W=-H,H=D):N.value===qe.AREA_2?(W=-W,H=-H):N.value===qe.AREA_3&&(D=W,W=H,H=-D),this.face===rt.RIGHT?(D=j,j=-W,W=D):this.face===rt.BACK?(j=-j,W=-W):this.face===rt.LEFT&&(D=j,j=W,W=-D),l.phi=Math.acos(-H)-m,l.lam=Math.atan2(W,j),this.face===rt.RIGHT?l.lam=_o(l.lam,-m):this.face===rt.BACK?l.lam=_o(l.lam,-L):this.face===rt.LEFT&&(l.lam=_o(l.lam,+m))}if(this.es!==0){var V,J,ne;V=l.phi<0?1:0,J=Math.tan(l.phi),ne=this.b/Math.sqrt(J*J+this.one_minus_f_squared),l.phi=Math.atan(Math.sqrt(this.a*this.a-ne*ne)/(this.one_minus_f*ne)),V&&(l.phi=-l.phi)}return l.lam+=this.long0,s.x=l.lam,s.y=l.phi,s}function nu(s,l,f,y){var g;return s<b?(y.value=qe.AREA_0,g=0):(g=Math.atan2(l,f),Math.abs(g)<=C?y.value=qe.AREA_0:g>C&&g<=m+C?(y.value=qe.AREA_1,g-=m):g>m+C||g<=-(m+C)?(y.value=qe.AREA_2,g=g>=0?g-L:g+L):(y.value=qe.AREA_3,g+=m)),g}function _o(s,l){var f=s+l;return f<-L?f+=P:f>+L&&(f-=P),f}var c8=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],f8={init:a8,forward:l8,inverse:u8,names:c8},mh=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],o1=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],j2=.8487,F2=1.3523,$2=A/5,h8=1/$2,So=18,su=function(s,l){return s[0]+l*(s[1]+l*(s[2]+l*s[3]))},d8=function(s,l){return s[1]+l*(2*s[2]+l*3*s[3])};function m8(s,l,f,y){for(var g=l;y;--y){var S=s(g);if(g-=S,Math.abs(S)<f)break}return g}function p8(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function g8(s){var l=Y(s.x-this.long0),f=Math.abs(s.y),y=Math.floor(f*$2);y<0?y=0:y>=So&&(y=So-1),f=A*(f-h8*y);var g={x:su(mh[y],f)*l,y:su(o1[y],f)};return s.y<0&&(g.y=-g.y),g.x=g.x*this.a*j2+this.x0,g.y=g.y*this.a*F2+this.y0,g}function y8(s){var l={x:(s.x-this.x0)/(this.a*j2),y:Math.abs(s.y-this.y0)/(this.a*F2)};if(l.y>=1)l.x/=mh[So][0],l.y=s.y<0?-m:m;else{var f=Math.floor(l.y*So);for(f<0?f=0:f>=So&&(f=So-1);;)if(o1[f][0]>l.y)--f;else if(o1[f+1][0]<=l.y)++f;else break;var y=o1[f],g=5*(l.y-y[0])/(o1[f+1][0]-y[0]);g=m8(function(S){return(su(y,S)-l.y)/d8(y,S)},g,b,100),l.x/=su(mh[f],g),l.y=(5*f+g)*E,s.y<0&&(l.y=-l.y)}return l.x=Y(l.x+this.long0),l}var b8=["Robinson","robin"],v8={init:p8,forward:g8,inverse:y8,names:b8};function w8(){this.name="geocent"}function _8(s){var l=qa(s,this.es,this.a);return l}function S8(s){var l=$n(s,this.es,this.a,this.b);return l}var x8=["Geocentric","geocentric","geocent","Geocent"],M8={init:w8,forward:_8,inverse:S8,names:x8},Et={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},a1={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function E8(){if(Object.keys(a1).forEach(function(f){if(typeof this[f]>"u")this[f]=a1[f].def;else{if(a1[f].num&&isNaN(this[f]))throw new Error("Invalid parameter value, must be numeric "+f+" = "+this[f]);a1[f].num&&(this[f]=parseFloat(this[f]))}a1[f].degrees&&(this[f]=this[f]*E)}.bind(this)),Math.abs(Math.abs(this.lat0)-m)<b?this.mode=this.lat0<0?Et.S_POLE:Et.N_POLE:Math.abs(this.lat0)<b?this.mode=Et.EQUIT:(this.mode=Et.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var s=this.tilt,l=this.azi;this.cg=Math.cos(l),this.sg=Math.sin(l),this.cw=Math.cos(s),this.sw=Math.sin(s)}function R8(s){s.x-=this.long0;var l=Math.sin(s.y),f=Math.cos(s.y),y=Math.cos(s.x),g,S;switch(this.mode){case Et.OBLIQ:S=this.sinph0*l+this.cosph0*f*y;break;case Et.EQUIT:S=f*y;break;case Et.S_POLE:S=-l;break;case Et.N_POLE:S=l;break}switch(S=this.pn1/(this.p-S),g=S*f*Math.sin(s.x),this.mode){case Et.OBLIQ:S*=this.cosph0*l-this.sinph0*f*y;break;case Et.EQUIT:S*=l;break;case Et.N_POLE:S*=-(f*y);break;case Et.S_POLE:S*=f*y;break}var R,_;return R=S*this.cg+g*this.sg,_=1/(R*this.sw*this.h1+this.cw),g=(g*this.cg-S*this.sg)*this.cw*_,S=R*_,s.x=g*this.a,s.y=S*this.a,s}function C8(s){s.x/=this.a,s.y/=this.a;var l={x:s.x,y:s.y},f,y,g;g=1/(this.pn1-s.y*this.sw),f=this.pn1*s.x*g,y=this.pn1*s.y*this.cw*g,s.x=f*this.cg+y*this.sg,s.y=y*this.cg-f*this.sg;var S=ir(s.x,s.y);if(Math.abs(S)<b)l.x=0,l.y=s.y;else{var R,_;switch(_=1-S*S*this.pfact,_=(this.p-Math.sqrt(_))/(this.pn1/S+S/this.pn1),R=Math.sqrt(1-_*_),this.mode){case Et.OBLIQ:l.y=Math.asin(R*this.sinph0+s.y*_*this.cosph0/S),s.y=(R-this.sinph0*Math.sin(l.y))*S,s.x*=_*this.cosph0;break;case Et.EQUIT:l.y=Math.asin(s.y*_/S),s.y=R*S,s.x*=_;break;case Et.N_POLE:l.y=Math.asin(R),s.y=-s.y;break;case Et.S_POLE:l.y=-Math.asin(R);break}l.x=Math.atan2(s.x,s.y)}return s.x=l.x+this.long0,s.y=l.y,s}var A8=["Tilted_Perspective","tpers"],T8={init:E8,forward:R8,inverse:C8,names:A8};function P8(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var s=1-this.es,l=1/s;this.radius_p=Math.sqrt(s),this.radius_p2=s,this.radius_p_inv2=l,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function O8(s){var l=s.x,f=s.y,y,g,S,R;if(l=l-this.long0,this.shape==="ellipse"){f=Math.atan(this.radius_p2*Math.tan(f));var _=this.radius_p/ir(this.radius_p*Math.cos(f),Math.sin(f));if(g=_*Math.cos(l)*Math.cos(f),S=_*Math.sin(l)*Math.cos(f),R=_*Math.sin(f),(this.radius_g-g)*g-S*S-R*R*this.radius_p_inv2<0)return s.x=Number.NaN,s.y=Number.NaN,s;y=this.radius_g-g,this.flip_axis?(s.x=this.radius_g_1*Math.atan(S/ir(R,y)),s.y=this.radius_g_1*Math.atan(R/y)):(s.x=this.radius_g_1*Math.atan(S/y),s.y=this.radius_g_1*Math.atan(R/ir(S,y)))}else this.shape==="sphere"&&(y=Math.cos(f),g=Math.cos(l)*y,S=Math.sin(l)*y,R=Math.sin(f),y=this.radius_g-g,this.flip_axis?(s.x=this.radius_g_1*Math.atan(S/ir(R,y)),s.y=this.radius_g_1*Math.atan(R/y)):(s.x=this.radius_g_1*Math.atan(S/y),s.y=this.radius_g_1*Math.atan(R/ir(S,y))));return s.x=s.x*this.a,s.y=s.y*this.a,s}function I8(s){var l=-1,f=0,y=0,g,S,R,_;if(s.x=s.x/this.a,s.y=s.y/this.a,this.shape==="ellipse"){this.flip_axis?(y=Math.tan(s.y/this.radius_g_1),f=Math.tan(s.x/this.radius_g_1)*ir(1,y)):(f=Math.tan(s.x/this.radius_g_1),y=Math.tan(s.y/this.radius_g_1)*ir(1,f));var T=y/this.radius_p;if(g=f*f+T*T+l*l,S=2*this.radius_g*l,R=S*S-4*g*this.C,R<0)return s.x=Number.NaN,s.y=Number.NaN,s;_=(-S-Math.sqrt(R))/(2*g),l=this.radius_g+_*l,f*=_,y*=_,s.x=Math.atan2(f,l),s.y=Math.atan(y*Math.cos(s.x)/l),s.y=Math.atan(this.radius_p_inv2*Math.tan(s.y))}else if(this.shape==="sphere"){if(this.flip_axis?(y=Math.tan(s.y/this.radius_g_1),f=Math.tan(s.x/this.radius_g_1)*Math.sqrt(1+y*y)):(f=Math.tan(s.x/this.radius_g_1),y=Math.tan(s.y/this.radius_g_1)*Math.sqrt(1+f*f)),g=f*f+y*y+l*l,S=2*this.radius_g*l,R=S*S-4*g*this.C,R<0)return s.x=Number.NaN,s.y=Number.NaN,s;_=(-S-Math.sqrt(R))/(2*g),l=this.radius_g+_*l,f*=_,y*=_,s.x=Math.atan2(f,l),s.y=Math.atan(y*Math.cos(s.x)/l)}return s.x=s.x+this.long0,s}var L8=["Geostationary Satellite View","Geostationary_Satellite","geos"],k8={init:P8,forward:O8,inverse:I8,names:L8},N8=function(s){s.Proj.projections.add(to),s.Proj.projections.add(Wn),s.Proj.projections.add($f),s.Proj.projections.add(Bl),s.Proj.projections.add(Uf),s.Proj.projections.add(Kf),s.Proj.projections.add(Kn),s.Proj.projections.add(rn),s.Proj.projections.add(Xf),s.Proj.projections.add(Yr),s.Proj.projections.add(Yl),s.Proj.projections.add(Xl),s.Proj.projections.add(vo),s.Proj.projections.add(tu),s.Proj.projections.add(dh),s.Proj.projections.add(O),s.Proj.projections.add(he),s.Proj.projections.add(sr),s.Proj.projections.add(Vt),s.Proj.projections.add(Bt),s.Proj.projections.add(iu),s.Proj.projections.add(Z4),s.Proj.projections.add(t8),s.Proj.projections.add(o8),s.Proj.projections.add(f8),s.Proj.projections.add(v8),s.Proj.projections.add(M8),s.Proj.projections.add(T8),s.Proj.projections.add(k8)};return Nt.defaultDatum="WGS84",Nt.Proj=pr,Nt.WGS84=new Nt.Proj("WGS84"),Nt.Point=Dr,Nt.toPoint=Hn,Nt.defs=gt,Nt.nadgrid=vi,Nt.transform=Gi,Nt.mgrs=Zs,Nt.version="2.8.0",N8(Nt),Nt})});var Pd=G((QB,f6)=>{"use strict";function KM(t,e){return e}f6.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=KM;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let i=r.slice(2),n=[];for(let o of i)!o||n.push(o.getFileName());return n}});var ha=G((eD,h6)=>{"use strict";var JM=Symbol("pino.setLevel"),ZM=Symbol("pino.getLevel"),YM=Symbol("pino.levelVal"),XM=Symbol("pino.useLevelLabels"),QM=Symbol("pino.useOnlyCustomLevels"),eE=Symbol("pino.mixin"),tE=Symbol("pino.lsCache"),rE=Symbol("pino.chindings"),iE=Symbol("pino.asJson"),nE=Symbol("pino.write"),sE=Symbol("pino.redactFmt"),oE=Symbol("pino.time"),aE=Symbol("pino.timeSliceIndex"),lE=Symbol("pino.stream"),uE=Symbol("pino.stringify"),cE=Symbol("pino.stringifySafe"),fE=Symbol("pino.stringifiers"),hE=Symbol("pino.end"),dE=Symbol("pino.formatOpts"),mE=Symbol("pino.messageKey"),pE=Symbol("pino.nestedKey"),gE=Symbol("pino.nestedKeyStr"),yE=Symbol("pino.mixinMergeStrategy"),bE=Symbol("pino.wildcardFirst"),vE=Symbol.for("pino.serializers"),wE=Symbol.for("pino.formatters"),_E=Symbol.for("pino.hooks"),SE=Symbol.for("pino.metadata");h6.exports={setLevelSym:JM,getLevelSym:ZM,levelValSym:YM,useLevelLabelsSym:XM,mixinSym:eE,lsCacheSym:tE,chindingsSym:rE,asJsonSym:iE,writeSym:nE,serializersSym:vE,redactFmtSym:sE,timeSym:oE,timeSliceIndexSym:aE,streamSym:lE,stringifySym:uE,stringifySafeSym:cE,stringifiersSym:fE,endSym:hE,formatOptsSym:dE,messageKeySym:mE,nestedKeySym:pE,wildcardFirstSym:bE,needsMetadataGsym:SE,useOnlyCustomLevelsSym:QM,formattersSym:wE,hooksSym:_E,nestedKeyStrSym:gE,mixinMergeStrategySym:yE}});var Ld=G((tD,g6)=>{"use strict";var Id=Ah(),{redactFmtSym:xE,wildcardFirstSym:Lc}=ha(),{rx:Od,validator:ME}=Id,d6=ME({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),m6="[Redacted]",p6=!1;function EE(t,e){let{paths:r,censor:i}=RE(t),n=r.reduce((c,d)=>{Od.lastIndex=0;let p=Od.exec(d),m=Od.exec(d),v=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(v==="*"&&(v=Lc),m===null)return c[v]=null,c;if(c[v]===null)return c;let{index:x}=m,w=`${d.substr(x,d.length-1)}`;return c[v]=c[v]||[],v!==Lc&&c[v].length===0&&c[v].push(...c[Lc]||[]),v===Lc&&Object.keys(c).forEach(function(b){c[b]&&c[b].push(w)}),c[v].push(w),c},{}),o={[xE]:Id({paths:r,censor:i,serialize:e,strict:p6})},a=(...c)=>e(typeof i=="function"?i(...c):i);return[...Object.keys(n),...Object.getOwnPropertySymbols(n)].reduce((c,d)=>{if(n[d]===null)c[d]=p=>a(p,[d]);else{let p=typeof i=="function"?(m,v)=>i(m,[d,...v]):i;c[d]=Id({paths:n[d],censor:p,serialize:e,strict:p6})}return c},o)}function RE(t){if(Array.isArray(t))return t={paths:t,censor:m6},d6(t),t;let{paths:e,censor:r=m6,remove:i}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return i===!0&&(r=void 0),d6({paths:e,censor:r}),{paths:e,censor:r}}g6.exports=EE});var b6=G((rD,y6)=>{"use strict";var CE=()=>"",AE=()=>`,"time":${Date.now()}`,TE=()=>`,"time":${Math.round(Date.now()/1e3)}`,PE=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;y6.exports={nullTime:CE,epochTime:AE,unixTime:TE,isoTime:PE}});var Bd=G((iD,v6)=>{"use strict";var{createRequire:OE}=require("module"),IE=Pd(),{join:kd,isAbsolute:LE}=require("path"),kE=hu(),Nd=h1(),NE=$h();function BE(t){Nd.register(t,zE),Nd.registerBeforeExit(t,jE),t.on("close",function(){Nd.unregister(t)})}function DE(t,e,r){let i=new NE({filename:t,workerData:e,workerOpts:r});i.on("ready",n),i.on("close",function(){process.removeListener("exit",o)}),process.on("exit",o);function n(){process.removeListener("exit",o),i.unref(),r.autoEnd!==!1&&BE(i)}function o(){i.closed||(i.flushSync(),kE(100),i.end())}return i}function zE(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function jE(t){t.flushSync()}function FE(t){let{pipeline:e,targets:r,levels:i,options:n={},worker:o={},caller:a=IE()}=t,c=typeof a=="string"?[a]:a,d="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},p=t.target;if(p&&r)throw new Error("only one of target or targets can be specified");return r?(p=d["pino-worker"]||kd(__dirname,"worker.js"),n.targets=r.map(v=>({...v,target:m(v.target)}))):e&&(p=d["pino-pipeline-worker"]||kd(__dirname,"worker-pipeline.js"),n.targets=e.map(v=>({...v,target:m(v.target)}))),i&&(n.levels=i),DE(m(p),n,o);function m(v){if(v=d[v]||v,LE(v)||v.indexOf("file://")===0)return v;if(v==="pino/file")return kd(__dirname,"..","file.js");let x;for(let w of c)try{x=OE(w).resolve(v);break}catch{continue}if(!x)throw new Error(`unable to determine transport target for "${v}"`);return x}}v6.exports=FE});var Nc=G((nD,O6)=>{"use strict";var w6=Ih(),{mapHttpRequest:$E,mapHttpResponse:qE}=f1(),Dd=Nh(),_6=h1(),{lsCacheSym:HE,chindingsSym:E6,writeSym:S6,serializersSym:R6,formatOptsSym:x6,endSym:WE,stringifiersSym:C6,stringifySym:A6,stringifySafeSym:zd,wildcardFirstSym:T6,nestedKeySym:UE,formattersSym:P6,messageKeySym:GE,nestedKeyStrSym:VE}=ha(),{isMainThread:KE}=require("worker_threads"),JE=Bd();function J1(){}function ZE(t,e){if(!e)return r;return function(...n){e.call(this,n,r,t)};function r(i,...n){if(typeof i=="object"){let o=i;i!==null&&(i.method&&i.headers&&i.socket?i=$E(i):typeof i.setHeader=="function"&&(i=qE(i)));let a;o===null&&n.length===0?a=[null]:(o=n.shift(),a=n),this[S6](i,w6(o,a,this[x6]),t)}else this[S6](null,w6(i,n,this[x6]),t)}}function M6(t){let e="",r=0,i=!1,n=255,o=t.length;if(o>100)return JSON.stringify(t);for(var a=0;a<o&&n>=32;a++)n=t.charCodeAt(a),(n===34||n===92)&&(e+=t.slice(r,a)+"\\",r=a,i=!0);return i?e+=t.slice(r):e=t,n<32?JSON.stringify(t):'"'+e+'"'}function YE(t,e,r,i){let n=this[A6],o=this[zd],a=this[C6],c=this[WE],d=this[E6],p=this[R6],m=this[P6],v=this[GE],x=this[HE][r]+i;x=x+d;let w;m.log&&(t=m.log(t));let b=a[T6],E="";for(let C in t)if(w=t[C],Object.prototype.hasOwnProperty.call(t,C)&&w!==void 0){w=p[C]?p[C](w):w;let P=a[C]||b;switch(typeof w){case"undefined":case"function":continue;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":P&&(w=P(w));break;case"string":w=(P||M6)(w);break;default:w=(P||n)(w,o)}if(w===void 0)continue;E+=',"'+C+'":'+w}let A="";if(e!==void 0){w=p[v]?p[v](e):e;let C=a[v]||b;switch(typeof w){case"function":break;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":C&&(w=C(w)),A=',"'+v+'":'+w;break;case"string":w=(C||M6)(w),A=',"'+v+'":'+w;break;default:w=(C||n)(w,o),A=',"'+v+'":'+w}}return this[UE]&&E?x+this[VE]+E.slice(1)+"}"+A+c:x+E+A+c}function XE(t,e){let r,i=t[E6],n=t[A6],o=t[zd],a=t[C6],c=a[T6],d=t[R6],p=t[P6].bindings;e=p(e);for(let m in e)if(r=e[m],(m!=="level"&&m!=="serializers"&&m!=="formatters"&&m!=="customLevels"&&e.hasOwnProperty(m)&&r!==void 0)===!0){if(r=d[m]?d[m](r):r,r=(a[m]||c||n)(r,o),r===void 0)continue;i+=',"'+m+'":'+r}return i}function QE(t){return t.write!==t.constructor.prototype.write}function kc(t){let e=new Dd(t);return e.on("error",r),!t.sync&&KE&&(_6.register(e,eR),e.on("close",function(){_6.unregister(e)})),e;function r(i){if(i.code==="EPIPE"){e.write=J1,e.end=J1,e.flushSync=J1,e.destroy=J1;return}e.removeListener("error",r),e.emit("error",i)}}function eR(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function tR(t){return function(r,i,n={},o){if(typeof n=="string")o=kc({dest:n}),n={};else if(typeof o=="string"){if(n&&n.transport)throw Error("only one of option.transport or stream can be specified");o=kc({dest:o})}else if(n instanceof Dd||n.writable||n._writableState)o=n,n={};else if(n.transport){if(n.transport instanceof Dd||n.transport.writable||n.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(n.transport.targets&&n.transport.targets.length&&n.formatters&&typeof n.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;n.customLevels&&(c=n.useOnlyCustomLevels?n.customLevels:Object.assign({},n.levels,n.customLevels)),o=JE({caller:i,...n.transport,levels:c})}if(n=Object.assign({},t,n),n.serializers=Object.assign({},t.serializers,n.serializers),n.formatters=Object.assign({},t.formatters,n.formatters),n.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");if("onTerminated"in n)throw Error("The onTerminated option has been removed, use pino.final instead");let{enabled:a}=n;return a===!1&&(n.level="silent"),o||(QE(process.stdout)?o=process.stdout:o=kc({fd:process.stdout.fd})),{opts:n,stream:o}}}function rR(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[zd])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function iR(t,e,r){return{level:t,bindings:e,log:r}}function nR(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t}O6.exports={noop:J1,buildSafeSonicBoom:kc,asChindings:XE,asJson:YE,genLog:ZE,createArgsNormalizer:tR,stringify:rR,buildFormatters:iR,normalizeDestFileDescriptor:nR}});var Bc=G((sD,L6)=>{"use strict";var{lsCacheSym:sR,levelValSym:jd,useOnlyCustomLevelsSym:oR,streamSym:aR,formattersSym:lR,hooksSym:uR}=ha(),{noop:cR,genLog:Ps}=Nc(),Gr={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},I6={fatal:t=>{let e=Ps(Gr.fatal,t);return function(...r){let i=this[aR];if(e.call(this,...r),typeof i.flushSync=="function")try{i.flushSync()}catch{}}},error:t=>Ps(Gr.error,t),warn:t=>Ps(Gr.warn,t),info:t=>Ps(Gr.info,t),debug:t=>Ps(Gr.debug,t),trace:t=>Ps(Gr.trace,t)},Fd=Object.keys(Gr).reduce((t,e)=>(t[Gr[e]]=e,t),{}),fR=Object.keys(Fd).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function hR(t){let e=t[lR].level,{labels:r}=t.levels,i={};for(let n in r){let o=e(r[n],Number(n));i[n]=JSON.stringify(o).slice(0,-1)}return t[sR]=i,t}function dR(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function mR(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let i=this[jd],n=this[jd]=r[t],o=this[oR],a=this[uR].logMethod;for(let c in r){if(n>r[c]){this[c]=cR;continue}this[c]=dR(c,o)?I6[c](a):Ps(r[c],a)}this.emit("level-change",t,n,e[i],i)}function pR(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function gR(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[jd]}function yR(t=null,e=!1){let r=t?Object.keys(t).reduce((o,a)=>(o[t[a]]=a,o),{}):null,i=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Fd,r),n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Gr,t);return{labels:i,values:n}}function bR(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(o=>e[o]),r?[]:Object.keys(Fd).map(o=>+o),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Gr,e);if(!(t in i))throw Error(`default level:${t} must be included in custom levels`)}function vR(t,e){let{labels:r,values:i}=t;for(let n in e){if(n in i)throw Error("levels cannot be overridden");if(e[n]in r)throw Error("pre-existing level values cannot be used for new levels")}}L6.exports={initialLsCache:fR,genLsCache:hR,levelMethods:I6,getLevel:pR,setLevel:mR,isLevelEnabled:gR,mappings:yR,levels:Gr,assertNoLevelCollisions:vR,assertDefaultLevelFound:bR}});var $d=G((oD,k6)=>{"use strict";k6.exports={version:"8.3.0"}});var W6=G((lD,H6)=>{"use strict";var{EventEmitter:wR}=require("events"),{lsCacheSym:_R,levelValSym:SR,setLevelSym:Hd,getLevelSym:N6,chindingsSym:Wd,parsedChindingsSym:xR,mixinSym:MR,asJsonSym:j6,writeSym:ER,mixinMergeStrategySym:RR,timeSym:CR,timeSliceIndexSym:AR,streamSym:F6,serializersSym:Os,formattersSym:qd,useOnlyCustomLevelsSym:TR,needsMetadataGsym:PR,redactFmtSym:OR,stringifySym:IR,formatOptsSym:LR,stringifiersSym:kR}=ha(),{getLevel:NR,setLevel:BR,isLevelEnabled:DR,mappings:zR,initialLsCache:jR,genLsCache:FR,assertNoLevelCollisions:$R}=Bc(),{asChindings:$6,asJson:qR,buildFormatters:B6,stringify:D6}=Nc(),{version:HR}=$d(),WR=Ld(),UR=class{},q6={constructor:UR,child:GR,bindings:VR,setBindings:KR,flush:XR,isLevelEnabled:DR,version:HR,get level(){return this[N6]()},set level(t){this[Hd](t)},get levelVal(){return this[SR]},set levelVal(t){throw Error("levelVal is read-only")},[_R]:jR,[ER]:ZR,[j6]:qR,[N6]:NR,[Hd]:BR};Object.setPrototypeOf(q6,wR.prototype);H6.exports=function(){return Object.create(q6)};var z6=t=>t;function GR(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[Os],i=this[qd],n=Object.create(this);if(e.hasOwnProperty("serializers")===!0){n[Os]=Object.create(null);for(let m in r)n[Os][m]=r[m];let d=Object.getOwnPropertySymbols(r);for(var o=0;o<d.length;o++){let m=d[o];n[Os][m]=r[m]}for(let m in e.serializers)n[Os][m]=e.serializers[m];let p=Object.getOwnPropertySymbols(e.serializers);for(var a=0;a<p.length;a++){let m=p[a];n[Os][m]=e.serializers[m]}}else n[Os]=r;if(e.hasOwnProperty("formatters")){let{level:d,bindings:p,log:m}=e.formatters;n[qd]=B6(d||i.level,p||z6,m||i.log)}else n[qd]=B6(i.level,z6,i.log);if(e.hasOwnProperty("customLevels")===!0&&($R(this.levels,e.customLevels),n.levels=zR(e.customLevels,n[TR]),FR(n)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){n.redact=e.redact;let d=WR(n.redact,D6),p={stringify:d[OR]};n[IR]=D6,n[kR]=d,n[LR]=p}n[Wd]=$6(n,t);let c=e.level||this.level;return n[Hd](c),n}function VR(){let e=`{${this[Wd].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function KR(t){let e=$6(this,t);this[Wd]=e,delete this[xR]}function JR(t,e){return Object.assign(e,t)}function ZR(t,e,r){let i=this[CR](),n=this[MR],o=this[RR]||JR,a;t==null?a={}:t instanceof Error?(a={err:t},e===void 0&&(e=t.message)):(a=t,e===void 0&&t.err&&(e=t.err.message)),n&&(a=o(a,n(a,r)));let c=this[j6](a,e,r,i),d=this[F6];d[PR]===!0&&(d.lastLevel=r,d.lastObj=a,d.lastMsg=e,d.lastTime=i.slice(this[AR]),d.lastLogger=this),d.write(c)}function YR(){}function XR(){let t=this[F6];"flush"in t&&t.flush(YR)}});var K6=G((uD,V6)=>{"use strict";var Ud=Symbol.for("pino.metadata"),{levels:U6}=Bc(),G6=Object.create(U6);G6.silent=1/0;var QR=U6.info;function eC(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let i=G6;e.levels&&typeof e.levels=="object"&&(i=e.levels);let n={write:o,add:c,flushSync:a,end:d,minLevel:0,streams:[],clone:p,[Ud]:!0};return Array.isArray(t)?t.forEach(c,n):c.call(n,t),t=null,n;function o(m){let v,x=this.lastLevel,{streams:w}=this,b;for(let E=0;E<w.length&&(v=w[E],v.level<=x);E++){if(b=v.stream,b[Ud]){let{lastTime:A,lastMsg:C,lastObj:P,lastLogger:L}=this;b.lastLevel=x,b.lastTime=A,b.lastMsg=C,b.lastObj=P,b.lastLogger=L}(!e.dedupe||v.level===x)&&b.write(m)}}function a(){for(let{stream:m}of this.streams)typeof m.flushSync=="function"&&m.flushSync()}function c(m){if(!m)return n;let v=typeof m.write=="function"||m.stream,x=m.write?m:m.stream;if(!v)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:w}=this,b;typeof m.levelVal=="number"?b=m.levelVal:typeof m.level=="string"?b=i[m.level]:typeof m.level=="number"?b=m.level:b=QR;let E={stream:x,level:b,levelVal:void 0,id:r++};return w.unshift(E),w.sort(tC),this.minLevel=w[0].level,n}function d(){for(let{stream:m}of this.streams)typeof m.flushSync=="function"&&m.flushSync(),m.end()}function p(m){let v=new Array(this.streams.length);for(let x=0;x<v.length;x++)v[x]={level:m,stream:this.streams[x].stream};return{write:o,add:c,minLevel:m,streams:v,clone:p,flushSync:a,[Ud]:!0}}}function tC(t,e){return t.level-e.level}V6.exports=eC});var ay=G((cD,Or)=>{"use strict";var rC=require("os"),ry=f1(),iC=Pd(),nC=Ld(),iy=b6(),sC=W6(),ny=ha(),{configure:oC}=s0(),{assertDefaultLevelFound:aC,mappings:sy,genLsCache:lC,levels:uC}=Bc(),{createArgsNormalizer:cC,asChindings:fC,buildSafeSonicBoom:J6,buildFormatters:hC,stringify:Dc,normalizeDestFileDescriptor:Z6,noop:dC}=Nc(),{version:mC}=$d(),{chindingsSym:Y6,redactFmtSym:pC,serializersSym:X6,timeSym:gC,timeSliceIndexSym:yC,streamSym:bC,stringifySym:Q6,stringifySafeSym:Gd,stringifiersSym:ey,setLevelSym:vC,endSym:wC,formatOptsSym:_C,messageKeySym:SC,nestedKeySym:xC,mixinSym:MC,useOnlyCustomLevelsSym:EC,formattersSym:ty,hooksSym:RC,nestedKeyStrSym:CC,mixinMergeStrategySym:AC}=ny,{epochTime:oy,nullTime:TC}=iy,{pid:PC}=process,OC=rC.hostname(),IC=ry.err,LC={level:"info",levels:uC,messageKey:"msg",nestedKey:null,enabled:!0,base:{pid:PC,hostname:OC},serializers:Object.assign(Object.create(null),{err:IC}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0},timestamp:oy,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},kC=cC(LC),NC=Object.assign(Object.create(null),ry);function Vd(...t){let e={},{opts:r,stream:i}=kC(e,iC(),...t),{redact:n,crlf:o,serializers:a,timestamp:c,messageKey:d,nestedKey:p,base:m,name:v,level:x,customLevels:w,mixin:b,mixinMergeStrategy:E,useOnlyCustomLevels:A,formatters:C,hooks:P,depthLimit:L,edgeLimit:k}=r,z=oC({maximumDepth:L,maximumBreadth:k}),U=hC(C.level,C.bindings,C.log),Z=n?nC(n,Dc):{},ie=Dc.bind({[Gd]:z}),ge=n?{stringify:Z[pC]}:{stringify:ie},De="}"+(o?`\r
|
|
111
|
-
`:`
|
|
112
|
-
`),Me=fC.bind(null,{[Y6]:"",[X6]:a,[ey]:Z,[Q6]:Dc,[Gd]:z,[ty]:U}),ke="";m!==null&&(v===void 0?ke=Me(m):ke=Me(Object.assign({},m,{name:v})));let tt=c instanceof Function?c:c?oy:TC,pt=tt().indexOf(":")+1;if(A&&!w)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(b&&typeof b!="function")throw Error(`Unknown mixin type "${typeof b}" - expected "function"`);aC(x,w,A);let dr=sy(w,A);return Object.assign(e,{levels:dr,[EC]:A,[bC]:i,[gC]:tt,[yC]:pt,[Q6]:Dc,[Gd]:z,[ey]:Z,[wC]:De,[_C]:ge,[SC]:d,[xC]:p,[CC]:p?`,${JSON.stringify(p)}:{`:"",[X6]:a,[MC]:b,[AC]:E,[Y6]:ke,[ty]:U,[RC]:P,silent:dC}),Object.setPrototypeOf(e,sC()),lC(e),e[vC](x),e}Or.exports=Vd;Or.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Z6(t.dest||process.stdout.fd),J6(t)):J6({dest:Z6(t),minLength:0});Or.exports.transport=Bd();Or.exports.multistream=K6();Or.exports.levels=sy();Or.exports.stdSerializers=NC;Or.exports.stdTimeFunctions=Object.assign({},iy);Or.exports.symbols=ny;Or.exports.version=mC;Or.exports.default=Vd;Or.exports.pino=Vd});var Z1=G((LD,my)=>{my.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var Zd=G(In=>{var We=Z1(),Jd=()=>[{type:We.RANGE,from:48,to:57}],py=()=>[{type:We.CHAR,value:95},{type:We.RANGE,from:97,to:122},{type:We.RANGE,from:65,to:90}].concat(Jd()),gy=()=>[{type:We.CHAR,value:9},{type:We.CHAR,value:10},{type:We.CHAR,value:11},{type:We.CHAR,value:12},{type:We.CHAR,value:13},{type:We.CHAR,value:32},{type:We.CHAR,value:160},{type:We.CHAR,value:5760},{type:We.RANGE,from:8192,to:8202},{type:We.CHAR,value:8232},{type:We.CHAR,value:8233},{type:We.CHAR,value:8239},{type:We.CHAR,value:8287},{type:We.CHAR,value:12288},{type:We.CHAR,value:65279}],DC=()=>[{type:We.CHAR,value:10},{type:We.CHAR,value:13},{type:We.CHAR,value:8232},{type:We.CHAR,value:8233}];In.words=()=>({type:We.SET,set:py(),not:!1});In.notWords=()=>({type:We.SET,set:py(),not:!0});In.ints=()=>({type:We.SET,set:Jd(),not:!1});In.notInts=()=>({type:We.SET,set:Jd(),not:!0});In.whitespace=()=>({type:We.SET,set:gy(),not:!1});In.notWhitespace=()=>({type:We.SET,set:gy(),not:!0});In.anyChar=()=>({type:We.SET,set:DC(),not:!0})});var by=G(Y1=>{var yy=Z1(),ya=Zd(),zC="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",jC={0:0,t:9,n:10,v:11,f:12,r:13};Y1.strToChars=function(t){var e=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return t=t.replace(e,function(r,i,n,o,a,c,d,p){if(n)return r;var m=i?8:o?parseInt(o,16):a?parseInt(a,16):c?parseInt(c,8):d?zC.indexOf(d):jC[p],v=String.fromCharCode(m);return/[[\]{}^$.|?*+()]/.test(v)&&(v="\\"+v),v}),t};Y1.tokenizeClass=(t,e)=>{for(var r=[],i=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,n,o;(n=i.exec(t))!=null;)if(n[1])r.push(ya.words());else if(n[2])r.push(ya.ints());else if(n[3])r.push(ya.whitespace());else if(n[4])r.push(ya.notWords());else if(n[5])r.push(ya.notInts());else if(n[6])r.push(ya.notWhitespace());else if(n[7])r.push({type:yy.RANGE,from:(n[8]||n[9]).charCodeAt(0),to:n[10].charCodeAt(0)});else if(o=n[12])r.push({type:yy.CHAR,value:o.charCodeAt(0)});else return[r,i.lastIndex];Y1.error(e,"Unterminated character class")};Y1.error=(t,e)=>{throw new SyntaxError("Invalid regular expression: /"+t+"/: "+e)}});var vy=G(X1=>{var jc=Z1();X1.wordBoundary=()=>({type:jc.POSITION,value:"b"});X1.nonWordBoundary=()=>({type:jc.POSITION,value:"B"});X1.begin=()=>({type:jc.POSITION,value:"^"});X1.end=()=>({type:jc.POSITION,value:"$"})});var wy=G((DD,Yd)=>{var ba=by(),Ir=Z1(),Ls=Zd(),Fc=vy();Yd.exports=t=>{var e=0,r,i,n={type:Ir.ROOT,stack:[]},o=n,a=n.stack,c=[],d=C=>{ba.error(t,`Nothing to repeat at column ${C-1}`)},p=ba.strToChars(t);for(r=p.length;e<r;)switch(i=p[e++],i){case"\\":switch(i=p[e++],i){case"b":a.push(Fc.wordBoundary());break;case"B":a.push(Fc.nonWordBoundary());break;case"w":a.push(Ls.words());break;case"W":a.push(Ls.notWords());break;case"d":a.push(Ls.ints());break;case"D":a.push(Ls.notInts());break;case"s":a.push(Ls.whitespace());break;case"S":a.push(Ls.notWhitespace());break;default:/\d/.test(i)?a.push({type:Ir.REFERENCE,value:parseInt(i,10)}):a.push({type:Ir.CHAR,value:i.charCodeAt(0)})}break;case"^":a.push(Fc.begin());break;case"$":a.push(Fc.end());break;case"[":var m;p[e]==="^"?(m=!0,e++):m=!1;var v=ba.tokenizeClass(p.slice(e),t);e+=v[1],a.push({type:Ir.SET,set:v[0],not:m});break;case".":a.push(Ls.anyChar());break;case"(":var x={type:Ir.GROUP,stack:[],remember:!0};i=p[e],i==="?"&&(i=p[e+1],e+=2,i==="="?x.followedBy=!0:i==="!"?x.notFollowedBy=!0:i!==":"&&ba.error(t,`Invalid group, character '${i}' after '?' at column ${e-1}`),x.remember=!1),a.push(x),c.push(o),o=x,a=x.stack;break;case")":c.length===0&&ba.error(t,`Unmatched ) at column ${e-1}`),o=c.pop(),a=o.options?o.options[o.options.length-1]:o.stack;break;case"|":o.options||(o.options=[o.stack],delete o.stack);var w=[];o.options.push(w),a=w;break;case"{":var b=/^(\d+)(,(\d+)?)?\}/.exec(p.slice(e)),E,A;b!==null?(a.length===0&&d(e),E=parseInt(b[1],10),A=b[2]?b[3]?parseInt(b[3],10):1/0:E,e+=b[0].length,a.push({type:Ir.REPETITION,min:E,max:A,value:a.pop()})):a.push({type:Ir.CHAR,value:123});break;case"?":a.length===0&&d(e),a.push({type:Ir.REPETITION,min:0,max:1,value:a.pop()});break;case"+":a.length===0&&d(e),a.push({type:Ir.REPETITION,min:1,max:1/0,value:a.pop()});break;case"*":a.length===0&&d(e),a.push({type:Ir.REPETITION,min:0,max:1/0,value:a.pop()});break;default:a.push({type:Ir.CHAR,value:i.charCodeAt(0)})}return c.length!==0&&ba.error(t,"Unterminated group"),n};Yd.exports.types=Ir});var xy=G((zD,Sy)=>{"use strict";var _y=wy(),FC=_y.types;Sy.exports=function(t,e){e||(e={});var r=e.limit===void 0?25:e.limit;$C(t)?t=t.source:typeof t!="string"&&(t=String(t));try{t=_y(t)}catch{return!1}var i=0;return function n(o,a){var c,d,p;if(o.type===FC.REPETITION&&(a++,i++,a>1||i>r))return!1;if(o.options){for(c=0,p=o.options.length;c<p;c++)if(d=n({stack:o.options[c]},a),!d)return!1}var m=o.stack||o.value&&o.value.stack;if(!m)return!0;for(c=0;c<m.length;c++)if(d=n(m[c],a),!d)return!1;return!0}(t,0)};function $C(t){return{}.toString.call(t)==="[object RegExp]"}});var Ey=G((jD,My)=>{"use strict";My.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(e)){if(i=e.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),i=o.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;n--!==0;){var a=o[n];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var ky=G((FD,Ly)=>{"use strict";var va=" ",wa="\u2502 ",Ry="\u251C\u2500\u2500 ",Cy="\u2514\u2500\u2500 ",Ay="*",Q1="/",Ty=/(?=\/)/;function qC(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}function Py(t){return Array.isArray(t)?t.map(e=>Py(e)):typeof t=="symbol"?t.toString():typeof t=="function"?qC(t):t}function Xd(t,e){let r={},i=this.buildPrettyMeta(t);return Array.isArray(e)||(e=i?Reflect.ownKeys(i):[]),e.forEach(n=>{let o=typeof n=="symbol"?n.toString():n;i&&i[n]&&(r[o]=Py(i[n]))}),r}function HC(t,e={}){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");e.includeMeta=e.includeMeta||null;let r=[],i="";t.sort((o,a)=>!o.path||!a.path?0:o.path.localeCompare(a.path));for(let o=0;o<t.length;o++){let a=t[o],c=r.find(p=>a.path===p.path);if(c){c.handlers.push({method:a.method,opts:a.opts.constraints||void 0,meta:e.includeMeta?Xd.call(this,a,e.includeMeta):null});continue}let d={method:a.method,opts:a.opts.constraints||void 0,meta:e.includeMeta?Xd.call(this,a,e.includeMeta):null};r.push({path:a.path,methods:[a.method],opts:[a.opts],handlers:[d]})}if(!r.filter(o=>o.path===Q1).length){let o={path:Q1,truncatedPath:"",methods:[],opts:[],handlers:[{}]};r.filter(a=>a.path===Ay).length?r.splice(1,0,o):r.unshift(o)}let n=WC(r);return n.forEach((o,a)=>{i+=Oy(o,null,a===n.length-1,!1,!0),i+=`
|
|
113
|
-
`}),i}function WC(t,e){e=e||Q1;let r=[],i={result:r};return t.forEach((n,o)=>{let a=n.path.split(Ty);a[0]!==Q1&&a[0]!==Ay&&(a=[Q1,a[0].slice(1),...a.slice(1)]),a.reduce((c,d,p)=>{if(!c[d]){c[d]={result:[]};let m={path:d,children:c[d].result};p===a.length-1&&(m.handlers=n.handlers),c.result.push(m)}return c[d]},i)}),r}function Oy(t,e,r,i,n){let o="";if(!i&&!n&&(o+=`
|
|
114
|
-
`),i||(o+=`${e||""}${r?Cy:Ry}`),o+=`${t.path}`,t.handlers){let a=t.handlers.reduce((c,d)=>{let p=c.findIndex(m=>JSON.stringify(m.opts)===JSON.stringify(d.opts));return p!==-1?c[p].method=[c[p].method,d.method].join(", "):c.push(d),c},[]);a.forEach((c,d)=>{d>0&&(o+=`${i?"":e||""}${r?va:wa}${t.path}`),o+=` (${c.method||"-"})`,c.opts&&JSON.stringify(c.opts)!=="{}"&&(o+=` ${JSON.stringify(c.opts)}`),c.meta&&Reflect.ownKeys(c.meta).forEach((p,m)=>{o+=`
|
|
115
|
-
${i?"":e||""}${r?va:wa}`,o+=`\u2022 (${p}) ${JSON.stringify(c.meta[p])}`}),a.length>1&&d!==a.length-1&&(o+=`
|
|
116
|
-
`)})}else t.children.length>1&&(o+=" (-)");return i||(e=`${e||""}${r?va:wa}`),t.children.forEach((a,c)=>{let d=c===t.children.length-1,p=!t.handlers&&t.children.length===1;o+=Oy(a,e,d,p)}),o}function Iy(t,e,r,i){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");i.includeMeta=i.includeMeta||null;let n="",o=[];for(let{node:d,method:p}of t.nodes)for(let m of d.handlerStorage.handlers)o.push({method:p,...m});o.length?o.forEach((d,p)=>{let m=`(${d.method||"-"})`;Object.keys(d.constraints).length>0&&(m+=" "+JSON.stringify(d.constraints));let v="",x=t.prefix.split("").map((w,b)=>w===":"?b:null).filter(w=>w!==null);if(x.length){let w=0;x.forEach((b,E)=>{v+=t.prefix.slice(w,b+1),v+=d.params[d.params.length-x.length+E],E===x.length-1&&(v+=t.prefix.slice(b+1)),w=b+1})}else v=t.prefix;if(p===0?n+=`${v} ${m}`:n+=`
|
|
117
|
-
${e}${r?va:wa}${v} ${m}`,i.includeMeta){let w=Xd.call(this,d,i.includeMeta);Object.keys(w).forEach((b,E)=>{n+=`
|
|
118
|
-
${e||""}${r?va:wa}`,n+=`\u2022 (${b}) ${JSON.stringify(w[b])}`})}}):n=t.prefix;let a=`${e}${r?Cy:Ry}${n}
|
|
119
|
-
`;e=`${e}${r?va:wa}`;let c=Object.keys(t.children);for(let d=0;d<c.length;d++){let p=t.children[c[d]];a+=Iy.call(this,p,e,d===c.length-1,i)}return a}function $c(t,e,r){if(e.handlerStorage.handlers.length!==0&&t.nodes.push({method:r,node:e}),e.parametricChildren&&e.parametricChildren[0]&&(t.children[":"]||(t.children[":"]={prefix:":",nodes:[],children:{}}),$c(t.children[":"],e.parametricChildren[0],r)),e.wildcardChild&&(t.children["*"]||(t.children["*"]={prefix:"*",nodes:[],children:{}}),$c(t.children["*"],e.wildcardChild,r)),e.staticChildren)for(let i of Object.values(e.staticChildren)){let n=i.prefix.split(Ty),o=t,a;for(let c of n)a=o,o=o.children[c],o||(o={prefix:c,nodes:[],children:{}},a.children[c]=o);$c(o,i,r)}}function Qd(t){let e=Object.keys(t.children);if(t.nodes.length===0&&e.length===1){let r=t.children[e[0]];if(r.nodes.length<=1)return Qd(r),t.nodes=r.nodes,t.prefix+=r.prefix,t.children=r.children,t}for(let r of Object.keys(t.children))Qd(t.children[r]);return t}Ly.exports={flattenNode:$c,compressFlattenedNode:Qd,prettyPrintFlattenedNode:Iy,prettyPrintRoutesArray:HC}});var By=G(($D,Ny)=>{"use strict";var e2=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(e){return e===void 0?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}addHandler(e,r,i,n,o){let a={handler:e,params:r,constraints:o,store:i||null,_createParamsObject:this._compileCreateParamsObject(r)};Object.keys(o).length===0&&(this.unconstrainedHandler=a);for(let c of Object.keys(o))this.constraints.includes(c)||(c==="version"?this.constraints.unshift(c):this.constraints.push(c));if(this.handlers.length>=32)throw new Error("find-my-way supports a maximum of 32 route handlers per node when there are constraints, limit reached");this.handlers.push(a),this.handlers.sort((c,d)=>Object.keys(c.constraints).length-Object.keys(d.constraints).length),this._compileGetHandlerMatchingConstraints(n,o)}_compileCreateParamsObject(e){let r=[];for(let i=0;i<e.length;i++)r.push(`'${e[i]}': paramsArray[${i}]`);return new Function("paramsArray",`return {${r.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,r){for(let i=0;i<this.handlers.length;i++){let o=this.handlers[i].constraints[r];if(o!==void 0){let a=e.get(o)||0;a|=1<<i,e.set(o,a)}}}_constrainedIndexBitmask(e){let r=0;for(let i=0;i<this.handlers.length;i++)this.handlers[i].constraints[e]!==void 0&&(r|=1<<i);return~r}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let i of this.constraints){let n=e.newStoreForConstraint(i);this.constrainedHandlerStores[i]=n,this._buildConstraintStore(n,i)}let r=[];r.push(`
|
|
120
|
-
let candidates = ${(1<<this.handlers.length)-1}
|
|
121
|
-
let mask, matches
|
|
122
|
-
`);for(let i of this.constraints){r.push(`
|
|
123
|
-
mask = ${this._constrainedIndexBitmask(i)}
|
|
124
|
-
value = derivedConstraints.${i}
|
|
125
|
-
`);let o=e.strategies[i].mustMatchWhenDerived?"matches":"(matches | mask)";r.push(`
|
|
126
|
-
if (value === undefined) {
|
|
127
|
-
candidates &= mask
|
|
128
|
-
} else {
|
|
129
|
-
matches = this.constrainedHandlerStores.${i}.get(value) || 0
|
|
130
|
-
candidates &= ${o}
|
|
131
|
-
}
|
|
132
|
-
if (candidates === 0) return null;
|
|
133
|
-
`)}for(let i in e.strategies)e.strategies[i].mustMatchWhenDerived&&!this.constraints.includes(i)&&r.push(`if (derivedConstraints.${i} !== undefined) return null`);r.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",r.join(`
|
|
134
|
-
`))}};Ny.exports=e2});var zy=G((qD,Dy)=>{"use strict";var UC=By(),Gc={STATIC:0,PARAMETRIC:1,WILDCARD:2},qc=class{constructor(){this.handlerStorage=new UC}},Hc=class extends qc{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,r){let i=this.staticChildren[e.charAt(r)];return i===void 0||!i.matchPrefix(e,r)?null:i}createStaticChild(e){if(e.length===0)return this;let r=this.staticChildren[e.charAt(0)];if(r){let n=1;for(;n<r.prefix.length;n++)if(e.charCodeAt(n)!==r.prefix.charCodeAt(n)){r=r.split(this,n);break}return r.createStaticChild(e.slice(n))}let i=e.charAt(0);return this.staticChildren[i]=new _a(e),this.staticChildren[i]}},_a=class extends Hc{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=Gc.STATIC,this._compilePrefixMatch()}createParametricChild(e){let r=e&&e.source,i=this.parametricChildren.find(n=>(n.regex&&n.regex.source)===r);return i||(i=new Wc(e),e?this.parametricChildren.unshift(i):this.parametricChildren.push(i),i)}createWildcardChild(){return this.wildcardChild?this.wildcardChild:(this.wildcardChild=new Uc,this.wildcardChild)}split(e,r){let i=this.prefix.slice(0,r),n=this.prefix.slice(r);this.prefix=n,this._compilePrefixMatch();let o=new _a(i);return o.staticChildren[n.charAt(0)]=this,e.staticChildren[i.charAt(0)]=o,o}getNextNode(e,r,i,n){let o=this.findStaticMatchingChild(e,r),a=0;if(o===null){if(this.parametricChildren.length===0)return this.wildcardChild;o=this.parametricChildren[0],a=1}this.wildcardChild!==null&&i.push({paramsCount:n,brotherPathIndex:r,brotherNode:this.wildcardChild});for(let c=this.parametricChildren.length-1;c>=a;c--)i.push({paramsCount:n,brotherPathIndex:r,brotherNode:this.parametricChildren[c]});return o}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let r=1;r<this.prefix.length;r++){let i=this.prefix.charCodeAt(r);e.push(`path.charCodeAt(i + ${r}) === ${i}`)}this.matchPrefix=new Function("path","i",`return ${e.join(" && ")}`)}},Wc=class extends Hc{constructor(e){super(),this.regex=e||null,this.isRegex=!!e,this.kind=Gc.PARAMETRIC}getNextNode(e,r){return this.findStaticMatchingChild(e,r)}},Uc=class extends qc{constructor(){super(),this.kind=Gc.WILDCARD}getNextNode(){return null}};Dy.exports={StaticNode:_a,ParametricNode:Wc,WildcardNode:Uc,NODE_TYPES:Gc}});var Fy=G((HD,jy)=>{"use strict";var GC=require("assert");function el(){if(!(this instanceof el))return new el;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}el.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[r,i,n]=t.split(".");return r=Number(r)||0,i=Number(i)||0,n=Number(n)||0,r>=this.maxMajor&&(this.maxMajor=r,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),i>=(this.maxMinors[r]||0)&&(this.maxMinors[r]=i,this.store[`${r}.x`]=e,this.store[`${r}.x.x`]=e),n>=(this.store[`${r}.${i}`]||0)&&(this.maxPatches[`${r}.${i}`]=n,this.store[`${r}.${i}.x`]=e),this.store[`${r}.${i}.${n}`]=e,this};el.prototype.get=function(t){return this.store[t]};jy.exports={name:"version",mustMatchWhenDerived:!0,storage:el,validate(t){GC(typeof t=="string","Version should be a string")}}});var qy=G((WD,$y)=>{"use strict";var VC=require("assert");function KC(){let t={},e=[];return{get:r=>{let i=t[r];if(i)return i;for(let n of e)if(n.host.test(r))return n.value},set:(r,i)=>{r instanceof RegExp?e.push({host:r,value:i}):t[r]=i}}}$y.exports={name:"host",mustMatchWhenDerived:!1,storage:KC,validate(t){VC(typeof t=="string"||Object.prototype.toString.call(t)==="[object RegExp]","Host should be a string or a RegExp")}}});var Wy=G((UD,Hy)=>{"use strict";var JC=Fy(),ZC=qy(),t2=require("assert"),r2=class{constructor(e){if(this.strategies={version:JC,host:ZC},this.strategiesInUse=new Set,e)for(let r of Object.values(e))this.addConstraintStrategy(r)}hasConstraintStrategy(e){let r=this.strategies[e];return r!==void 0?r.isCustom||this.strategiesInUse.has(e):!1}addConstraintStrategy(e){if(t2(typeof e.name=="string"&&e.name!=="","strategy.name is required."),t2(e.storage&&typeof e.storage=="function","strategy.storage function is required."),t2(e.deriveConstraint&&typeof e.deriveConstraint=="function","strategy.deriveConstraint function is required."),this.strategies[e.name]&&this.strategies[e.name].isCustom)throw new Error(`There already exists a custom constraint with the name ${e.name}.`);if(this.strategiesInUse.has(e.name))throw new Error(`There already exists a route with ${e.name} constraint.`);e.isCustom=!0,this.strategies[e.name]=e,e.mustMatchWhenDerived&&this.noteUsage({[e.name]:e})}deriveConstraints(e,r){}noteUsage(e){if(e){let r=this.strategiesInUse.size;for(let i in e)this.strategiesInUse.add(i);r!==this.strategiesInUse.size&&this._buildDeriveConstraints()}}newStoreForConstraint(e){if(!this.strategies[e])throw new Error(`No strategy registered for constraint key ${e}`);return this.strategies[e].storage()}validateConstraints(e){for(let r in e){let i=e[r];if(typeof i>"u")throw new Error("Can't pass an undefined constraint value, must pass null or no key at all");let n=this.strategies[r];if(!n)throw new Error(`No strategy registered for constraint key ${r}`);n.validate&&n.validate(i)}}_buildDeriveConstraints(){if(this.strategiesInUse.size===0)return;let e=["return {"];for(let r of this.strategiesInUse){let i=this.strategies[r];if(i.isCustom)e.push(` ${i.name}: this.strategies.${r}.deriveConstraint(req, ctx),`);else if(r==="version")e.push(" version: req.headers['accept-version'],");else if(r==="host")e.push(" host: req.headers.host || req.headers[':authority'],");else throw new Error("unknown non-custom strategy for compiling constraint derivation function")}e.push("}"),this.deriveConstraints=new Function("req","ctx",e.join(`
|
|
135
|
-
`)).bind(this)}};Hy.exports=r2});var Vy=G((GD,Gy)=>{"use strict";function Uy(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function YC(t){let e=!1,r=!1,i="";for(let o=1;o<t.length;o++){let a=t.charCodeAt(o);if(a===37){let c=t.charCodeAt(o+1),d=t.charCodeAt(o+2);Uy(c,d)===null?e=!0:(r=!0,c===50&&d===53&&(e=!0,t=t.slice(0,o+1)+"25"+t.slice(o+1),o+=2),o+=2)}else if(a===63||a===59||a===35){i=t.slice(o+1),t=t.slice(0,o);break}}return{path:e?decodeURI(t):t,querystring:i,shouldDecodeParam:r}}function XC(t){let e=t.indexOf("%");if(e===-1)return t;let r="",i=e;for(let n=e;n<t.length;n++)if(t.charCodeAt(n)===37){let o=t.charCodeAt(n+1),a=t.charCodeAt(n+2),c=Uy(o,a);r+=t.slice(i,n)+c,i=n+3}return t.slice(0,e)+r+t.slice(i)}Gy.exports={safeDecodeURI:YC,safeDecodeURIComponent:XC}});var Qy=G((VD,Xy)=>{"use strict";var dt=require("assert"),Vc=require("http"),QC=require("querystring"),s2=xy(),Zy=Ey(),{flattenNode:eA,compressFlattenedNode:tA,prettyPrintFlattenedNode:rA,prettyPrintRoutesArray:iA}=ky(),{StaticNode:Ky,NODE_TYPES:i2}=zy(),nA=Wy(),{safeDecodeURI:sA,safeDecodeURIComponent:Jy}=Vy(),o2=Vc.METHODS,Yy=/^https?:\/\/.*?\//,ks=/(\/:[^/()]*?)\?(\/?)/;if(!s2(Yy))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!s2(ks))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function mt(t){if(!(this instanceof mt))return new mt(t);t=t||{},t.defaultRoute?(dt(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(dt(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(dt(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=uA,t.querystringParser?(dt(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e===""?{}:QC.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.routes=[],this.trees={},this.constrainer=new nA(t.constraints),this._routesPatterns=[]}mt.prototype.on=function(e,r,i,n,o){typeof i=="function"&&(n!==void 0&&(o=n),n=i,i={}),dt(typeof r=="string","Path should be a string"),dt(r.length>0,"The path could not be empty"),dt(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),dt(typeof n=="function","Handler should be a function");let a=r.match(ks);if(a){dt(r.length===a.index+a[0].length,"Optional Parameter needs to be the last parameter of the path");let p=r.replace(ks,"$1$2"),m=r.replace(ks,"$2");this.on(e,p,i,n,o),this.on(e,m,i,n,o);return}let c=r;this.ignoreDuplicateSlashes&&(r=a2(r)),this.ignoreTrailingSlash&&(r=l2(r));let d=Array.isArray(e)?e:[e];for(let p of d)this._on(p,r,i,n,o,c),this.routes.push({method:p,path:r,opts:i,handler:n,store:o})};mt.prototype._on=function(e,r,i,n,o){dt(typeof e=="string","Method should be a string"),dt(o2.includes(e),`Method '${e}' is not an http method.`);let a={};if(i.constraints!==void 0&&(dt(typeof i.constraints=="object"&&i.constraints!==null,"Constraints should be an object"),Object.keys(i.constraints).length!==0&&(a=i.constraints)),this.constrainer.validateConstraints(a),this.constrainer.noteUsage(a),this.trees[e]===void 0&&(this.trees[e]=new Ky("/")),r==="*"&&this.trees[e].prefix.length!==0){let m=this.trees[e];this.trees[e]=new Ky(""),this.trees[e].staticChildren["/"]=m}let c=this.trees[e],d=c.prefix.length,p=[];for(let m=0;m<=r.length;m++){if(r.charCodeAt(m)===58&&r.charCodeAt(m+1)===58){m++;continue}let v=r.charCodeAt(m)===58&&r.charCodeAt(m+1)!==58,x=r.charCodeAt(m)===42;if(v||x||m===r.length&&m!==d){let w=r.slice(d,m);this.caseSensitive||(w=w.toLowerCase()),w=w.split("::").join(":"),w=w.split("%").join("%25"),c=c.createStaticChild(w)}if(v){let w=!1,b=[],E=0,A=m+1;for(let P=A;;P++){let L=r.charCodeAt(P);if(L===40||L===45||L===46){w=!0;let k=r.slice(A,P);if(p.push(k),L===40){let Z=lA(r,P),ie=r.slice(P,Z+1);this.allowUnsafeRegex||dt(s2(new RegExp(ie)),`The regex '${ie}' is not safe!`),b.push(aA(ie)),P=Z+1}else b.push("(.*?)");let z=P;for(;z<r.length;z++){let Z=r.charCodeAt(z);if(Z===58||Z===47)break}let U=r.slice(P,z);U&&b.push(oA(U)),A=z+1,P=z,(r.charCodeAt(P)===47||P===r.length)&&(E=U.length)}else if(L===47||P===r.length){let k=r.slice(A,P);p.push(k),b.length!==0&&b.push("(.*?)")}if(r.charCodeAt(P)===47||P===r.length){r=r.slice(0,m+1)+r.slice(P-E),m+=E;break}}let C=null;w&&(C=new RegExp("^"+b.join("")+"$")),c=c.createParametricChild(C),d=m+1}else x&&(p.push("*"),c=c.createWildcardChild(),d=m+1)}this.caseSensitive||(r=r.toLowerCase());for(let m of this._routesPatterns)if(m.path===r&&m.method===e&&Zy(m.constraints,a))throw new Error(`Method '${e}' already declared for route '${r}' with constraints '${JSON.stringify(a)}'`);this._routesPatterns.push({method:e,path:r,constraints:a}),c.handlerStorage.addHandler(n,p,o,this.constrainer,a)};mt.prototype.hasConstraintStrategy=function(t){return this.constrainer.hasConstraintStrategy(t)};mt.prototype.addConstraintStrategy=function(t){this.constrainer.addConstraintStrategy(t),this._rebuild(this.routes)};mt.prototype.reset=function(){this.trees={},this.routes=[],this._routesPatterns=[]};mt.prototype.off=function(e,r,i){dt(typeof r=="string","Path should be a string"),dt(r.length>0,"The path could not be empty"),dt(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`");let n=r.match(ks);if(n){dt(r.length===n.index+n[0].length,"Optional Parameter needs to be the last parameter of the path");let a=r.replace(ks,"$1$2"),c=r.replace(ks,"$2");this.off(e,a,i),this.off(e,c,i);return}this.ignoreDuplicateSlashes&&(r=a2(r)),this.ignoreTrailingSlash&&(r=l2(r));let o=Array.isArray(e)?e:[e];for(let a of o)this._off(a,r,i)};mt.prototype._off=function(e,r,i){dt(typeof e=="string","Method should be a string"),dt(o2.includes(e),`Method '${e}' is not an http method.`);function n(a){return!i||!a?!0:Zy(i,a)}let o=this.routes.filter(a=>e!==a.method||r!==a.path||!n(a.opts.constraints));this._rebuild(o)};mt.prototype.lookup=function(e,r,i){var n=this.find(e.method,e.url,this.constrainer.deriveConstraints(e,i));return n===null?this._defaultRoute(e,r,i):i===void 0?n.handler(e,r,n.params,n.store,n.searchParams):n.handler.call(i,e,r,n.params,n.store,n.searchParams)};mt.prototype.find=function(e,r,i){let n=this.trees[e];if(n===void 0)return null;r.charCodeAt(0)!==47&&(r=r.replace(Yy,"/")),this.ignoreDuplicateSlashes&&(r=a2(r));let o,a,c;try{o=sA(r),r=o.path,a=o.querystring,c=o.shouldDecodeParam}catch{return this._onBadUrl(r)}this.ignoreTrailingSlash&&(r=l2(r));let d=r;this.caseSensitive===!1&&(r=r.toLowerCase());let p=this.maxParamLength,m=n.prefix.length,v=[],x=r.length,w=[];for(;;){if(m===x){let E=n.handlerStorage.getMatchingHandler(i);if(E!==null)return{handler:E.handler,store:E.store,params:E._createParamsObject(v),searchParams:this.querystringParser(a)}}let b=n.getNextNode(r,m,w,v.length);if(b===null){if(w.length===0)return null;let E=w.pop();m=E.brotherPathIndex,v.splice(E.paramsCount),b=E.brotherNode}if(n=b,n.kind===i2.STATIC){m+=n.prefix.length;continue}if(n.kind===i2.WILDCARD){let E=d.slice(m);c&&(E=Jy(E)),v.push(E),m=x;continue}if(n.kind===i2.PARAMETRIC){let E=d.indexOf("/",m);E===-1&&(E=x);let A=d.slice(m,E);if(c&&(A=Jy(A)),n.isRegex){let C=n.regex.exec(A);if(C===null)continue;for(let P=1;P<C.length;P++){let L=C[P];if(L.length>p)return null;v.push(L)}}else{if(A.length>p)return null;v.push(A)}m=E}}};mt.prototype._rebuild=function(t){this.reset();for(let e of t){let{method:r,path:i,opts:n,handler:o,store:a}=e;this._on(r,i,n,o,a),this.routes.push({method:r,path:i,opts:n,handler:o,store:a})}};mt.prototype._defaultRoute=function(t,e,r){if(this.defaultRoute!==null)return r===void 0?this.defaultRoute(t,e):this.defaultRoute.call(r,t,e);e.statusCode=404,e.end()};mt.prototype._onBadUrl=function(t){if(this.onBadUrl===null)return null;let e=this.onBadUrl;return{handler:(r,i,n)=>e(t,r,i),params:{},store:null}};mt.prototype.prettyPrint=function(t={}){if(t.commonPrefix=t.commonPrefix===void 0?!0:t.commonPrefix,!t.commonPrefix)return iA.call(this,this.routes,t);let e={prefix:"/",nodes:[],children:{}};for(let r in this.trees){let i=this.trees[r];i&&eA(e,i,r)}return tA(e),rA.call(this,e,"",!0,t)};for(n2 in Vc.METHODS){if(!Vc.METHODS.hasOwnProperty(n2))continue;let t=Vc.METHODS[n2],e=t.toLowerCase();if(mt.prototype[e])throw new Error("Method already exists: "+e);mt.prototype[e]=function(r,i,n){return this.on(t,r,i,n)}}var n2;mt.prototype.all=function(t,e,r){this.on(o2,t,e,r)};Xy.exports=mt;function oA(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a2(t){return t.replace(/\/\/+/g,"/")}function l2(t){return t.length>1&&t.charCodeAt(t.length-1)===47?t.slice(0,-1):t}function aA(t){return t.charCodeAt(1)===94&&(t=t.slice(0,1)+t.slice(2)),t.charCodeAt(t.length-2)===36&&(t=t.slice(0,t.length-2)+t.slice(t.length-1)),t}function lA(t,e){for(var r=1;e<t.length;){if(e++,t[e]==="\\"){e++;continue}if(t[e]===")"?r--:t[e]==="("&&r++,!r)return e}throw new TypeError('Invalid regexp expression in "'+t+'"')}function uA(t){return t?t.store?Object.assign({},t.store):{}:{}}});var v2=G(b2=>{b2.read=function(t,e,r,i,n){var o,a,c=n*8-i-1,d=(1<<c)-1,p=d>>1,m=-7,v=r?n-1:0,x=r?-1:1,w=t[e+v];for(v+=x,o=w&(1<<-m)-1,w>>=-m,m+=c;m>0;o=o*256+t[e+v],v+=x,m-=8);for(a=o&(1<<-m)-1,o>>=-m,m+=i;m>0;a=a*256+t[e+v],v+=x,m-=8);if(o===0)o=1-p;else{if(o===d)return a?NaN:(w?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-p}return(w?-1:1)*a*Math.pow(2,o-i)};b2.write=function(t,e,r,i,n,o){var a,c,d,p=o*8-n-1,m=(1<<p)-1,v=m>>1,x=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=i?0:o-1,b=i?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=m):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+v>=1?e+=x/d:e+=x*Math.pow(2,1-v),e*d>=2&&(a++,d/=2),a+v>=m?(c=0,a=m):a+v>=1?(c=(e*d-1)*Math.pow(2,n),a=a+v):(c=e*Math.pow(2,v-1)*Math.pow(2,n),a=0));n>=8;t[r+w]=c&255,w+=b,c/=256,n-=8);for(a=a<<n|c,p+=n;p>0;t[r+w]=a&255,w+=b,a/=256,p-=8);t[r+w-b]|=E*128}});var T4=G((eq,A4)=>{"use strict";A4.exports=PA;var TA={threshold:.1,includeAA:!1,alpha:.1,aaColor:[255,255,0],diffColor:[255,0,0],diffColorAlt:null,diffMask:!1};function PA(t,e,r,i,n,o){if(!A2(t)||!A2(e)||r&&!A2(r))throw new Error("Image data: Uint8Array, Uint8ClampedArray or Buffer expected.");if(t.length!==e.length||r&&r.length!==t.length)throw new Error("Image sizes do not match.");if(t.length!==i*n*4)throw new Error("Image data size does not match width/height.");o=Object.assign({},TA,o);let a=i*n,c=new Uint32Array(t.buffer,t.byteOffset,a),d=new Uint32Array(e.buffer,e.byteOffset,a),p=!0;for(let x=0;x<a;x++)if(c[x]!==d[x]){p=!1;break}if(p){if(r&&!o.diffMask)for(let x=0;x<a;x++)R4(t,4*x,o.alpha,r);return 0}let m=35215*o.threshold*o.threshold,v=0;for(let x=0;x<n;x++)for(let w=0;w<i;w++){let b=(x*i+w)*4,E=C4(t,e,b,b);Math.abs(E)>m?!o.includeAA&&(x4(t,w,x,i,n,e)||x4(e,w,x,i,n,t))?r&&!o.diffMask&&P2(r,b,...o.aaColor):(r&&P2(r,b,...E<0&&o.diffColorAlt||o.diffColor),v++):r&&(o.diffMask||R4(t,b,o.alpha,r))}return v}function A2(t){return ArrayBuffer.isView(t)&&t.constructor.BYTES_PER_ELEMENT===1}function x4(t,e,r,i,n,o){let a=Math.max(e-1,0),c=Math.max(r-1,0),d=Math.min(e+1,i-1),p=Math.min(r+1,n-1),m=(r*i+e)*4,v=e===a||e===d||r===c||r===p?1:0,x=0,w=0,b,E,A,C;for(let P=a;P<=d;P++)for(let L=c;L<=p;L++){if(P===e&&L===r)continue;let k=C4(t,t,m,(L*i+P)*4,!0);if(k===0){if(v++,v>2)return!1}else k<x?(x=k,b=P,E=L):k>w&&(w=k,A=P,C=L)}return x===0||w===0?!1:rf(t,b,E,i,n)&&rf(o,b,E,i,n)||rf(t,A,C,i,n)&&rf(o,A,C,i,n)}function rf(t,e,r,i,n){let o=Math.max(e-1,0),a=Math.max(r-1,0),c=Math.min(e+1,i-1),d=Math.min(r+1,n-1),p=(r*i+e)*4,m=e===o||e===c||r===a||r===d?1:0;for(let v=o;v<=c;v++)for(let x=a;x<=d;x++){if(v===e&&x===r)continue;let w=(x*i+v)*4;if(t[p]===t[w]&&t[p+1]===t[w+1]&&t[p+2]===t[w+2]&&t[p+3]===t[w+3]&&m++,m>2)return!0}return!1}function C4(t,e,r,i,n){let o=t[r+0],a=t[r+1],c=t[r+2],d=t[r+3],p=e[i+0],m=e[i+1],v=e[i+2],x=e[i+3];if(d===x&&o===p&&a===m&&c===v)return 0;d<255&&(d/=255,o=Ds(o,d),a=Ds(a,d),c=Ds(c,d)),x<255&&(x/=255,p=Ds(p,x),m=Ds(m,x),v=Ds(v,x));let w=T2(o,a,c),b=T2(p,m,v),E=w-b;if(n)return E;let A=M4(o,a,c)-M4(p,m,v),C=E4(o,a,c)-E4(p,m,v),P=.5053*E*E+.299*A*A+.1957*C*C;return w>b?-P:P}function T2(t,e,r){return t*.29889531+e*.58662247+r*.11448223}function M4(t,e,r){return t*.59597799-e*.2741761-r*.32180189}function E4(t,e,r){return t*.21147017-e*.52261711+r*.31114694}function Ds(t,e){return 255+(t-255)*e}function P2(t,e,r,i,n){t[e+0]=r,t[e+1]=i,t[e+2]=n,t[e+3]=255}function R4(t,e,r,i){let n=t[e+0],o=t[e+1],a=t[e+2],c=Ds(T2(n,o,a),r*t[e+3]/255);P2(i,e,c,c,c)}});var WA={};q2(WA,{handler:()=>$e});module.exports=H8(WA);var c1={Aws:{Region:"ap-southeast-2"},ApiKey:{QueryString:"api",TableName:"ApiKey",RequestLimitMinute:1e3},TileMetadata:{TableName:"TileMetadata",RequestLimitMinute:1e3}},Xe={PublicUrlBase:"BASEMAPS_PUBLIC_URL",TiffConcurrency:"TIFF_CONCURRENCY",TempFolder:"TEMP_FOLDER",BatchIndex:"AWS_BATCH_JOB_ARRAY_INDEX",AwsRoleDurationHours:"AWS_ROLE_DURATION_HOURS",AwsRoleConfigPath:"AWS_ROLE_CONFIG_PATH",GitHubToken:"GITHUB_API_TOKEN",Gdal:{UseDocker:"GDAL_DOCKER",DockerContainer:"GDAL_DOCKER_CONTAINER",DockerContainerTag:"GDAL_DOCKER_CONTAINER_TAG"},Analytics:{CloudFrontId:"ANALYTICS_CLOUD_FRONT_ID",CloudFrontSourceBucket:"ANALYTICS_CLOUD_FRONT_SOURCE_BUCKET",CacheBucket:"ANALYTICS_CACHE_BUCKET"},get(t){return process.env[t]},getNumber(t,e){let r=Xe.get(t);if(r===""||r==null)return e;let i=parseFloat(r);return isNaN(i)?e:i},isProduction(){return!0}};var $0=me(Fm(),1);var $r=me(Gm(),1);function sw(t){return t<=10?$r.default.gray("TRACE"):t<=20?$r.default.magenta("DEBUG"):t<=30?$r.default.cyan("INFO"):t<=40?$r.default.yellow("WARN"):t<=50?$r.default.red("ERROR"):$r.default.bgRed("FATAL")}var Ri=class{constructor(e){this.level=e}static formatObject(e){let r=[];for(let i of Object.keys(e)){if(Ri.Ignore.has(i))continue;let n=e[i];if(n==null||n==="")continue;let o="",a=typeof n;if(a==="number")o=$r.default.yellow(String(n));else if(a==="string")o=$r.default.green(n);else if(a==="object"){let c=this.formatObject(n);c.length>0&&(o=`{ ${c.join(" ")} }`)}else o=String(n);o!==""&&r.push(`${$r.default.dim(i)}=${o}`)}return r}pretty(e){if(e.level<this.level)return null;let r=new Date(e.time);if(isNaN(r.getTime()))return null;let n=Ri.formatObject(e).join(" ");return`[${r.toISOString()}] ${sw(e.level)} ${$r.default.blue(e.msg)} ${n}`}};Ri.Ignore=new Set(["pid","time","hostname","level","v","name","msg"]);var e9=me(Qp(),1),Oo=require("stream"),t9=require("string_decoder");function hS(t){try{return JSON.parse(t)}catch{return null}}function dS(t){t!=null&&console.error("PrettyTransformFailed",t)}var bn=class extends Oo.Transform{constructor(){super(),this.pretty=new Ri(-1),this.decoder=new t9.StringDecoder}static stream(e=process.stdout){let r=new Oo.PassThrough;return bn.pretty(r,e),r}static pretty(e,r=process.stdout){let i=new bn;return(0,Oo.pipeline)(e,(0,e9.default)(),i,r,dS),i}_transform(e,r,i){if(r!=="buffer")return i(new Error(`Unknown encoding: ${r}`));let n=this.decoder.write(e),o=hS(n);if(o==null)return i(null,e+`
|
|
136
|
-
`);let a=this.pretty.pretty(o);if(a==null)return i(null,e+`
|
|
137
|
-
`);i(null,a+`
|
|
138
|
-
`)}};var Du,r9={level:"debug"},Io={get(){return Du==null&&(Du=process.stdout.isTTY?(0,$0.default)(r9,bn.stream()):(0,$0.default)(r9)),Du},set(t){Du=t},disable(){Io.get().level="silent"}};var q0=me(Lo(),1);var n9=24*60*60*1e3,rP=30*n9,mS=91*n9;function s9(t){if(t==null)return{valid:!1,message:"missing"};if(!t.startsWith("c")&&!t.startsWith("d"))return{valid:!1,message:"malformed"};let e=t.slice(1).toUpperCase();try{let r=(0,q0.decodeTime)(e);if(t.startsWith("d"))return{valid:!0,key:t};if(Date.now()-r>mS)return{valid:!1,message:"expired"}}catch{return{valid:!1,message:"malformed"}}return{valid:!0,key:t}}var o9=new Uint16Array([7489,60,213,305,650,1181,1403,1488,1653,1758,1954,2006,2063,2634,2705,3489,3693,3849,3878,4298,4648,4833,5141,5277,5315,5343,5413,0,0,0,0,0,0,5483,5837,6541,7186,7645,8062,8288,8624,8845,9152,9211,9282,10276,10514,11528,11848,12238,12310,12986,13881,14252,14590,14888,14961,15072,15150,2048,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,92,98,102,109,115,127,132,139,144,149,152,166,179,185,200,207,108,105,103,32827,198,16582,80,32827,38,16422,99,117,116,101,32827,193,16577,114,101,118,101,59,16642,256,105,121,120,125,114,99,32827,194,16578,59,17424,114,59,49152,55349,56580,114,97,118,101,32827,192,16576,112,104,97,59,17297,97,99,114,59,16640,100,59,27219,256,103,112,157,161,111,110,59,16644,102,59,49152,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,24673,105,110,103,32827,197,16581,256,99,115,190,195,114,59,49152,55349,56476,105,103,110,59,25172,105,108,100,101,32827,195,16579,109,108,32827,196,16580,1024,97,99,101,102,111,114,115,117,229,251,254,279,284,290,295,298,256,99,114,234,242,107,115,108,97,115,104,59,25110,374,246,248,59,27367,101,100,59,25350,121,59,17425,384,99,114,116,261,267,276,97,117,115,101,59,25141,110,111,117,108,108,105,115,59,24876,97,59,17298,114,59,49152,55349,56581,112,102,59,49152,55349,56633,101,118,101,59,17112,99,242,275,109,112,101,113,59,25166,1792,72,79,97,99,100,101,102,104,105,108,111,114,115,117,333,337,342,384,414,418,437,439,442,476,533,627,632,638,99,121,59,17447,80,89,32827,169,16553,384,99,112,121,349,354,378,117,116,101,59,16646,256,59,105,359,360,25298,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,24901,108,101,121,115,59,24877,512,97,101,105,111,393,398,404,408,114,111,110,59,16652,100,105,108,32827,199,16583,114,99,59,16648,110,105,110,116,59,25136,111,116,59,16650,256,100,110,423,429,105,108,108,97,59,16568,116,101,114,68,111,116,59,16567,242,383,105,59,17319,114,99,108,101,512,68,77,80,84,455,459,465,470,111,116,59,25241,105,110,117,115,59,25238,108,117,115,59,25237,105,109,101,115,59,25239,111,256,99,115,482,504,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,25138,101,67,117,114,108,121,256,68,81,515,527,111,117,98,108,101,81,117,111,116,101,59,24605,117,111,116,101,59,24601,512,108,110,112,117,542,552,583,597,111,110,256,59,101,549,550,25143,59,27252,384,103,105,116,559,566,570,114,117,101,110,116,59,25185,110,116,59,25135,111,117,114,73,110,116,101,103,114,97,108,59,25134,256,102,114,588,590,59,24834,111,100,117,99,116,59,25104,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,25139,111,115,115,59,27183,99,114,59,49152,55349,56478,112,256,59,67,644,645,25299,97,112,59,25165,1408,68,74,83,90,97,99,101,102,105,111,115,672,684,688,692,696,715,727,737,742,819,1165,256,59,111,377,677,116,114,97,104,100,59,26897,99,121,59,17410,99,121,59,17413,99,121,59,17423,384,103,114,115,703,708,711,103,101,114,59,24609,114,59,24993,104,118,59,27364,256,97,121,720,725,114,111,110,59,16654,59,17428,108,256,59,116,733,734,25095,97,59,17300,114,59,49152,55349,56583,256,97,102,747,807,256,99,109,752,802,114,105,116,105,99,97,108,512,65,68,71,84,768,774,790,796,99,117,116,101,59,16564,111,372,779,781,59,17113,98,108,101,65,99,117,116,101,59,17117,114,97,118,101,59,16480,105,108,100,101,59,17116,111,110,100,59,25284,102,101,114,101,110,116,105,97,108,68,59,24902,1136,829,0,0,0,834,852,0,1029,102,59,49152,55349,56635,384,59,68,69,840,841,845,16552,111,116,59,24796,113,117,97,108,59,25168,98,108,101,768,67,68,76,82,85,86,867,882,898,975,994,1016,111,110,116,111,117,114,73,110,116,101,103,114,97,236,569,111,628,889,0,0,891,187,841,110,65,114,114,111,119,59,25043,256,101,111,903,932,102,116,384,65,82,84,912,918,929,114,114,111,119,59,25040,105,103,104,116,65,114,114,111,119,59,25044,101,229,714,110,103,256,76,82,939,964,101,102,116,256,65,82,947,953,114,114,111,119,59,26616,105,103,104,116,65,114,114,111,119,59,26618,105,103,104,116,65,114,114,111,119,59,26617,105,103,104,116,256,65,84,984,990,114,114,111,119,59,25042,101,101,59,25256,112,577,1001,0,0,1007,114,114,111,119,59,25041,111,119,110,65,114,114,111,119,59,25045,101,114,116,105,99,97,108,66,97,114,59,25125,110,768,65,66,76,82,84,97,1042,1066,1072,1118,1151,892,114,114,111,119,384,59,66,85,1053,1054,1058,24979,97,114,59,26899,112,65,114,114,111,119,59,25077,114,101,118,101,59,17169,101,102,116,722,1082,0,1094,0,1104,105,103,104,116,86,101,99,116,111,114,59,26960,101,101,86,101,99,116,111,114,59,26974,101,99,116,111,114,256,59,66,1113,1114,25021,97,114,59,26966,105,103,104,116,468,1127,0,1137,101,101,86,101,99,116,111,114,59,26975,101,99,116,111,114,256,59,66,1146,1147,25025,97,114,59,26967,101,101,256,59,65,1158,1159,25252,114,114,111,119,59,24999,256,99,116,1170,1175,114,59,49152,55349,56479,114,111,107,59,16656,2048,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1213,1216,1220,1227,1246,1250,1255,1262,1269,1313,1327,1334,1362,1373,1376,1381,71,59,16714,72,32827,208,16592,99,117,116,101,32827,201,16585,384,97,105,121,1234,1239,1244,114,111,110,59,16666,114,99,32827,202,16586,59,17453,111,116,59,16662,114,59,49152,55349,56584,114,97,118,101,32827,200,16584,101,109,101,110,116,59,25096,256,97,112,1274,1278,99,114,59,16658,116,121,595,1286,0,0,1298,109,97,108,108,83,113,117,97,114,101,59,26107,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,26027,256,103,112,1318,1322,111,110,59,16664,102,59,49152,55349,56636,115,105,108,111,110,59,17301,117,256,97,105,1340,1353,108,256,59,84,1346,1347,27253,105,108,100,101,59,25154,108,105,98,114,105,117,109,59,25036,256,99,105,1367,1370,114,59,24880,109,59,27251,97,59,17303,109,108,32827,203,16587,256,105,112,1386,1391,115,116,115,59,25091,111,110,101,110,116,105,97,108,69,59,24903,640,99,102,105,111,115,1413,1416,1421,1458,1484,121,59,17444,114,59,49152,55349,56585,108,108,101,100,595,1431,0,0,1443,109,97,108,108,83,113,117,97,114,101,59,26108,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,26026,880,1466,0,1471,0,0,1476,102,59,49152,55349,56637,65,108,108,59,25088,114,105,101,114,116,114,102,59,24881,99,242,1483,1536,74,84,97,98,99,100,102,103,111,114,115,116,1512,1516,1519,1530,1536,1554,1558,1563,1565,1571,1644,1650,99,121,59,17411,32827,62,16446,109,109,97,256,59,100,1527,1528,17299,59,17372,114,101,118,101,59,16670,384,101,105,121,1543,1548,1552,100,105,108,59,16674,114,99,59,16668,59,17427,111,116,59,16672,114,59,49152,55349,56586,59,25305,112,102,59,49152,55349,56638,101,97,116,101,114,768,69,70,71,76,83,84,1589,1604,1614,1622,1627,1638,113,117,97,108,256,59,76,1598,1599,25189,101,115,115,59,25307,117,108,108,69,113,117,97,108,59,25191,114,101,97,116,101,114,59,27298,101,115,115,59,25207,108,97,110,116,69,113,117,97,108,59,27262,105,108,100,101,59,25203,99,114,59,49152,55349,56482,59,25195,1024,65,97,99,102,105,111,115,117,1669,1675,1686,1691,1694,1706,1726,1738,82,68,99,121,59,17450,256,99,116,1680,1684,101,107,59,17095,59,16478,105,114,99,59,16676,114,59,24844,108,98,101,114,116,83,112,97,99,101,59,24843,496,1711,0,1714,102,59,24845,105,122,111,110,116,97,108,76,105,110,101,59,25856,256,99,116,1731,1733,242,1705,114,111,107,59,16678,109,112,324,1744,1752,111,119,110,72,117,109,240,303,113,117,97,108,59,25167,1792,69,74,79,97,99,100,102,103,109,110,111,115,116,117,1786,1790,1795,1799,1806,1818,1822,1825,1832,1860,1912,1931,1935,1941,99,121,59,17429,108,105,103,59,16690,99,121,59,17409,99,117,116,101,32827,205,16589,256,105,121,1811,1816,114,99,32827,206,16590,59,17432,111,116,59,16688,114,59,24849,114,97,118,101,32827,204,16588,384,59,97,112,1824,1839,1855,256,99,103,1844,1847,114,59,16682,105,110,97,114,121,73,59,24904,108,105,101,243,989,500,1865,0,1890,256,59,101,1869,1870,25132,256,103,114,1875,1880,114,97,108,59,25131,115,101,99,116,105,111,110,59,25282,105,115,105,98,108,101,256,67,84,1900,1906,111,109,109,97,59,24675,105,109,101,115,59,24674,384,103,112,116,1919,1923,1928,111,110,59,16686,102,59,49152,55349,56640,97,59,17305,99,114,59,24848,105,108,100,101,59,16680,491,1946,0,1950,99,121,59,17414,108,32827,207,16591,640,99,102,111,115,117,1964,1975,1980,1986,2e3,256,105,121,1969,1973,114,99,59,16692,59,17433,114,59,49152,55349,56589,112,102,59,49152,55349,56641,483,1991,0,1996,114,59,49152,55349,56485,114,99,121,59,17416,107,99,121,59,17412,896,72,74,97,99,102,111,115,2020,2024,2028,2033,2045,2050,2056,99,121,59,17445,99,121,59,17420,112,112,97,59,17306,256,101,121,2038,2043,100,105,108,59,16694,59,17434,114,59,49152,55349,56590,112,102,59,49152,55349,56642,99,114,59,49152,55349,56486,1408,74,84,97,99,101,102,108,109,111,115,116,2085,2089,2092,2128,2147,2483,2488,2503,2509,2615,2631,99,121,59,17417,32827,60,16444,640,99,109,110,112,114,2103,2108,2113,2116,2125,117,116,101,59,16697,98,100,97,59,17307,103,59,26602,108,97,99,101,116,114,102,59,24850,114,59,24990,384,97,101,121,2135,2140,2145,114,111,110,59,16701,100,105,108,59,16699,59,17435,256,102,115,2152,2416,116,1280,65,67,68,70,82,84,85,86,97,114,2174,2217,2225,2272,2278,2300,2351,2395,912,2410,256,110,114,2179,2191,103,108,101,66,114,97,99,107,101,116,59,26600,114,111,119,384,59,66,82,2201,2202,2206,24976,97,114,59,25060,105,103,104,116,65,114,114,111,119,59,25030,101,105,108,105,110,103,59,25352,111,501,2231,0,2243,98,108,101,66,114,97,99,107,101,116,59,26598,110,468,2248,0,2258,101,101,86,101,99,116,111,114,59,26977,101,99,116,111,114,256,59,66,2267,2268,25027,97,114,59,26969,108,111,111,114,59,25354,105,103,104,116,256,65,86,2287,2293,114,114,111,119,59,24980,101,99,116,111,114,59,26958,256,101,114,2305,2327,101,384,59,65,86,2313,2314,2320,25251,114,114,111,119,59,24996,101,99,116,111,114,59,26970,105,97,110,103,108,101,384,59,66,69,2340,2341,2345,25266,97,114,59,27087,113,117,97,108,59,25268,112,384,68,84,86,2359,2370,2380,111,119,110,86,101,99,116,111,114,59,26961,101,101,86,101,99,116,111,114,59,26976,101,99,116,111,114,256,59,66,2390,2391,25023,97,114,59,26968,101,99,116,111,114,256,59,66,2405,2406,25020,97,114,59,26962,105,103,104,116,225,924,115,768,69,70,71,76,83,84,2430,2443,2453,2461,2466,2477,113,117,97,108,71,114,101,97,116,101,114,59,25306,117,108,108,69,113,117,97,108,59,25190,114,101,97,116,101,114,59,25206,101,115,115,59,27297,108,97,110,116,69,113,117,97,108,59,27261,105,108,100,101,59,25202,114,59,49152,55349,56591,256,59,101,2493,2494,25304,102,116,97,114,114,111,119,59,25050,105,100,111,116,59,16703,384,110,112,119,2516,2582,2587,103,512,76,82,108,114,2526,2551,2562,2576,101,102,116,256,65,82,2534,2540,114,114,111,119,59,26613,105,103,104,116,65,114,114,111,119,59,26615,105,103,104,116,65,114,114,111,119,59,26614,101,102,116,256,97,114,947,2570,105,103,104,116,225,959,105,103,104,116,225,970,102,59,49152,55349,56643,101,114,256,76,82,2594,2604,101,102,116,65,114,114,111,119,59,24985,105,103,104,116,65,114,114,111,119,59,24984,384,99,104,116,2622,2624,2626,242,2124,59,25008,114,111,107,59,16705,59,25194,1024,97,99,101,102,105,111,115,117,2650,2653,2656,2679,2684,2693,2699,2702,112,59,26885,121,59,17436,256,100,108,2661,2671,105,117,109,83,112,97,99,101,59,24671,108,105,110,116,114,102,59,24883,114,59,49152,55349,56592,110,117,115,80,108,117,115,59,25107,112,102,59,49152,55349,56644,99,242,2678,59,17308,1152,74,97,99,101,102,111,115,116,117,2723,2727,2733,2752,2836,2841,3473,3479,3486,99,121,59,17418,99,117,116,101,59,16707,384,97,101,121,2740,2745,2750,114,111,110,59,16711,100,105,108,59,16709,59,17437,384,103,115,119,2759,2800,2830,97,116,105,118,101,384,77,84,86,2771,2783,2792,101,100,105,117,109,83,112,97,99,101,59,24587,104,105,256,99,110,2790,2776,235,2777,101,114,121,84,104,105,238,2777,116,101,100,256,71,76,2808,2822,114,101,97,116,101,114,71,114,101,97,116,101,242,1651,101,115,115,76,101,115,243,2632,76,105,110,101,59,16394,114,59,49152,55349,56593,512,66,110,112,116,2850,2856,2871,2874,114,101,97,107,59,24672,66,114,101,97,107,105,110,103,83,112,97,99,101,59,16544,102,59,24853,1664,59,67,68,69,71,72,76,78,80,82,83,84,86,2901,2902,2922,2940,2977,3051,3076,3166,3204,3238,3288,3425,3461,27372,256,111,117,2907,2916,110,103,114,117,101,110,116,59,25186,112,67,97,112,59,25197,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,25126,384,108,113,120,2947,2954,2971,101,109,101,110,116,59,25097,117,97,108,256,59,84,2962,2963,25184,105,108,100,101,59,49152,8770,824,105,115,116,115,59,25092,114,101,97,116,101,114,896,59,69,70,71,76,83,84,2998,2999,3005,3017,3027,3032,3045,25199,113,117,97,108,59,25201,117,108,108,69,113,117,97,108,59,49152,8807,824,114,101,97,116,101,114,59,49152,8811,824,101,115,115,59,25209,108,97,110,116,69,113,117,97,108,59,49152,10878,824,105,108,100,101,59,25205,117,109,112,324,3058,3069,111,119,110,72,117,109,112,59,49152,8782,824,113,117,97,108,59,49152,8783,824,101,256,102,115,3082,3111,116,84,114,105,97,110,103,108,101,384,59,66,69,3098,3099,3105,25322,97,114,59,49152,10703,824,113,117,97,108,59,25324,115,768,59,69,71,76,83,84,3125,3126,3132,3140,3147,3160,25198,113,117,97,108,59,25200,114,101,97,116,101,114,59,25208,101,115,115,59,49152,8810,824,108,97,110,116,69,113,117,97,108,59,49152,10877,824,105,108,100,101,59,25204,101,115,116,101,100,256,71,76,3176,3193,114,101,97,116,101,114,71,114,101,97,116,101,114,59,49152,10914,824,101,115,115,76,101,115,115,59,49152,10913,824,114,101,99,101,100,101,115,384,59,69,83,3218,3219,3227,25216,113,117,97,108,59,49152,10927,824,108,97,110,116,69,113,117,97,108,59,25312,256,101,105,3243,3257,118,101,114,115,101,69,108,101,109,101,110,116,59,25100,103,104,116,84,114,105,97,110,103,108,101,384,59,66,69,3275,3276,3282,25323,97,114,59,49152,10704,824,113,117,97,108,59,25325,256,113,117,3293,3340,117,97,114,101,83,117,256,98,112,3304,3321,115,101,116,256,59,69,3312,3315,49152,8847,824,113,117,97,108,59,25314,101,114,115,101,116,256,59,69,3331,3334,49152,8848,824,113,117,97,108,59,25315,384,98,99,112,3347,3364,3406,115,101,116,256,59,69,3355,3358,49152,8834,8402,113,117,97,108,59,25224,99,101,101,100,115,512,59,69,83,84,3378,3379,3387,3398,25217,113,117,97,108,59,49152,10928,824,108,97,110,116,69,113,117,97,108,59,25313,105,108,100,101,59,49152,8831,824,101,114,115,101,116,256,59,69,3416,3419,49152,8835,8402,113,117,97,108,59,25225,105,108,100,101,512,59,69,70,84,3438,3439,3445,3455,25153,113,117,97,108,59,25156,117,108,108,69,113,117,97,108,59,25159,105,108,100,101,59,25161,101,114,116,105,99,97,108,66,97,114,59,25124,99,114,59,49152,55349,56489,105,108,100,101,32827,209,16593,59,17309,1792,69,97,99,100,102,103,109,111,112,114,115,116,117,118,3517,3522,3529,3541,3547,3552,3559,3580,3586,3616,3618,3634,3647,3652,108,105,103,59,16722,99,117,116,101,32827,211,16595,256,105,121,3534,3539,114,99,32827,212,16596,59,17438,98,108,97,99,59,16720,114,59,49152,55349,56594,114,97,118,101,32827,210,16594,384,97,101,105,3566,3570,3574,99,114,59,16716,103,97,59,17321,99,114,111,110,59,17311,112,102,59,49152,55349,56646,101,110,67,117,114,108,121,256,68,81,3598,3610,111,117,98,108,101,81,117,111,116,101,59,24604,117,111,116,101,59,24600,59,27220,256,99,108,3623,3628,114,59,49152,55349,56490,97,115,104,32827,216,16600,105,364,3639,3644,100,101,32827,213,16597,101,115,59,27191,109,108,32827,214,16598,101,114,256,66,80,3659,3680,256,97,114,3664,3667,114,59,24638,97,99,256,101,107,3674,3676,59,25566,101,116,59,25524,97,114,101,110,116,104,101,115,105,115,59,25564,1152,97,99,102,104,105,108,111,114,115,3711,3719,3722,3727,3730,3732,3741,3760,3836,114,116,105,97,108,68,59,25090,121,59,17439,114,59,49152,55349,56595,105,59,17318,59,17312,117,115,77,105,110,117,115,59,16561,256,105,112,3746,3757,110,99,97,114,101,112,108,97,110,229,1693,102,59,24857,512,59,101,105,111,3769,3770,3808,3812,27323,99,101,100,101,115,512,59,69,83,84,3784,3785,3791,3802,25210,113,117,97,108,59,27311,108,97,110,116,69,113,117,97,108,59,25212,105,108,100,101,59,25214,109,101,59,24627,256,100,112,3817,3822,117,99,116,59,25103,111,114,116,105,111,110,256,59,97,549,3833,108,59,25117,256,99,105,3841,3846,114,59,49152,55349,56491,59,17320,512,85,102,111,115,3857,3862,3867,3871,79,84,32827,34,16418,114,59,49152,55349,56596,112,102,59,24858,99,114,59,49152,55349,56492,1536,66,69,97,99,101,102,104,105,111,114,115,117,3902,3907,3911,3936,3955,4007,4010,4013,4246,4265,4276,4286,97,114,114,59,26896,71,32827,174,16558,384,99,110,114,3918,3923,3926,117,116,101,59,16724,103,59,26603,114,256,59,116,3932,3933,24992,108,59,26902,384,97,101,121,3943,3948,3953,114,111,110,59,16728,100,105,108,59,16726,59,17440,256,59,118,3960,3961,24860,101,114,115,101,256,69,85,3970,3993,256,108,113,3975,3982,101,109,101,110,116,59,25099,117,105,108,105,98,114,105,117,109,59,25035,112,69,113,117,105,108,105,98,114,105,117,109,59,26991,114,187,3961,111,59,17313,103,104,116,1024,65,67,68,70,84,85,86,97,4033,4075,4083,4130,4136,4187,4231,984,256,110,114,4038,4050,103,108,101,66,114,97,99,107,101,116,59,26601,114,111,119,384,59,66,76,4060,4061,4065,24978,97,114,59,25061,101,102,116,65,114,114,111,119,59,25028,101,105,108,105,110,103,59,25353,111,501,4089,0,4101,98,108,101,66,114,97,99,107,101,116,59,26599,110,468,4106,0,4116,101,101,86,101,99,116,111,114,59,26973,101,99,116,111,114,256,59,66,4125,4126,25026,97,114,59,26965,108,111,111,114,59,25355,256,101,114,4141,4163,101,384,59,65,86,4149,4150,4156,25250,114,114,111,119,59,24998,101,99,116,111,114,59,26971,105,97,110,103,108,101,384,59,66,69,4176,4177,4181,25267,97,114,59,27088,113,117,97,108,59,25269,112,384,68,84,86,4195,4206,4216,111,119,110,86,101,99,116,111,114,59,26959,101,101,86,101,99,116,111,114,59,26972,101,99,116,111,114,256,59,66,4226,4227,25022,97,114,59,26964,101,99,116,111,114,256,59,66,4241,4242,25024,97,114,59,26963,256,112,117,4251,4254,102,59,24861,110,100,73,109,112,108,105,101,115,59,26992,105,103,104,116,97,114,114,111,119,59,25051,256,99,104,4281,4284,114,59,24859,59,25009,108,101,68,101,108,97,121,101,100,59,27124,1664,72,79,97,99,102,104,105,109,111,113,115,116,117,4324,4337,4343,4349,4377,4382,4433,4438,4449,4455,4533,4539,4543,256,67,99,4329,4334,72,99,121,59,17449,121,59,17448,70,84,99,121,59,17452,99,117,116,101,59,16730,640,59,97,101,105,121,4360,4361,4366,4371,4375,27324,114,111,110,59,16736,100,105,108,59,16734,114,99,59,16732,59,17441,114,59,49152,55349,56598,111,114,116,512,68,76,82,85,4394,4404,4414,4425,111,119,110,65,114,114,111,119,187,1054,101,102,116,65,114,114,111,119,187,2202,105,103,104,116,65,114,114,111,119,187,4061,112,65,114,114,111,119,59,24977,103,109,97,59,17315,97,108,108,67,105,114,99,108,101,59,25112,112,102,59,49152,55349,56650,626,4461,0,0,4464,116,59,25114,97,114,101,512,59,73,83,85,4475,4476,4489,4527,26017,110,116,101,114,115,101,99,116,105,111,110,59,25235,117,256,98,112,4495,4510,115,101,116,256,59,69,4503,4504,25231,113,117,97,108,59,25233,101,114,115,101,116,256,59,69,4520,4521,25232,113,117,97,108,59,25234,110,105,111,110,59,25236,99,114,59,49152,55349,56494,97,114,59,25286,512,98,99,109,112,4552,4571,4617,4619,256,59,115,4557,4558,25296,101,116,256,59,69,4557,4565,113,117,97,108,59,25222,256,99,104,4576,4613,101,101,100,115,512,59,69,83,84,4589,4590,4596,4607,25211,113,117,97,108,59,27312,108,97,110,116,69,113,117,97,108,59,25213,105,108,100,101,59,25215,84,104,225,3980,59,25105,384,59,101,115,4626,4627,4643,25297,114,115,101,116,256,59,69,4636,4637,25219,113,117,97,108,59,25223,101,116,187,4627,1408,72,82,83,97,99,102,104,105,111,114,115,4670,4676,4681,4693,4702,4721,4726,4767,4802,4808,4817,79,82,78,32827,222,16606,65,68,69,59,24866,256,72,99,4686,4690,99,121,59,17419,121,59,17446,256,98,117,4698,4700,59,16393,59,17316,384,97,101,121,4709,4714,4719,114,111,110,59,16740,100,105,108,59,16738,59,17442,114,59,49152,55349,56599,256,101,105,4731,4745,498,4736,0,4743,101,102,111,114,101,59,25140,97,59,17304,256,99,110,4750,4760,107,83,112,97,99,101,59,49152,8287,8202,83,112,97,99,101,59,24585,108,100,101,512,59,69,70,84,4779,4780,4786,4796,25148,113,117,97,108,59,25155,117,108,108,69,113,117,97,108,59,25157,105,108,100,101,59,25160,112,102,59,49152,55349,56651,105,112,108,101,68,111,116,59,24795,256,99,116,4822,4827,114,59,49152,55349,56495,114,111,107,59,16742,2785,4855,4878,4890,4902,0,4908,4913,0,0,0,0,0,4920,4925,4983,4997,0,5119,5124,5130,5136,256,99,114,4859,4865,117,116,101,32827,218,16602,114,256,59,111,4871,4872,24991,99,105,114,59,26953,114,483,4883,0,4886,121,59,17422,118,101,59,16748,256,105,121,4894,4899,114,99,32827,219,16603,59,17443,98,108,97,99,59,16752,114,59,49152,55349,56600,114,97,118,101,32827,217,16601,97,99,114,59,16746,256,100,105,4929,4969,101,114,256,66,80,4936,4957,256,97,114,4941,4944,114,59,16479,97,99,256,101,107,4951,4953,59,25567,101,116,59,25525,97,114,101,110,116,104,101,115,105,115,59,25565,111,110,256,59,80,4976,4977,25283,108,117,115,59,25230,256,103,112,4987,4991,111,110,59,16754,102,59,49152,55349,56652,1024,65,68,69,84,97,100,112,115,5013,5038,5048,5060,1e3,5074,5079,5107,114,114,111,119,384,59,66,68,4432,5024,5028,97,114,59,26898,111,119,110,65,114,114,111,119,59,25029,111,119,110,65,114,114,111,119,59,24981,113,117,105,108,105,98,114,105,117,109,59,26990,101,101,256,59,65,5067,5068,25253,114,114,111,119,59,24997,111,119,110,225,1011,101,114,256,76,82,5086,5096,101,102,116,65,114,114,111,119,59,24982,105,103,104,116,65,114,114,111,119,59,24983,105,256,59,108,5113,5114,17362,111,110,59,17317,105,110,103,59,16750,99,114,59,49152,55349,56496,105,108,100,101,59,16744,109,108,32827,220,16604,1152,68,98,99,100,101,102,111,115,118,5159,5164,5168,5171,5182,5253,5258,5264,5270,97,115,104,59,25259,97,114,59,27371,121,59,17426,97,115,104,256,59,108,5179,5180,25257,59,27366,256,101,114,5187,5189,59,25281,384,98,116,121,5196,5200,5242,97,114,59,24598,256,59,105,5199,5205,99,97,108,512,66,76,83,84,5217,5221,5226,5236,97,114,59,25123,105,110,101,59,16508,101,112,97,114,97,116,111,114,59,26456,105,108,100,101,59,25152,84,104,105,110,83,112,97,99,101,59,24586,114,59,49152,55349,56601,112,102,59,49152,55349,56653,99,114,59,49152,55349,56497,100,97,115,104,59,25258,640,99,101,102,111,115,5287,5292,5297,5302,5308,105,114,99,59,16756,100,103,101,59,25280,114,59,49152,55349,56602,112,102,59,49152,55349,56654,99,114,59,49152,55349,56498,512,102,105,111,115,5323,5328,5330,5336,114,59,49152,55349,56603,59,17310,112,102,59,49152,55349,56655,99,114,59,49152,55349,56499,1152,65,73,85,97,99,102,111,115,117,5361,5365,5369,5373,5380,5391,5396,5402,5408,99,121,59,17455,99,121,59,17415,99,121,59,17454,99,117,116,101,32827,221,16605,256,105,121,5385,5389,114,99,59,16758,59,17451,114,59,49152,55349,56604,112,102,59,49152,55349,56656,99,114,59,49152,55349,56500,109,108,59,16760,1024,72,97,99,100,101,102,111,115,5429,5433,5439,5451,5455,5469,5472,5476,99,121,59,17430,99,117,116,101,59,16761,256,97,121,5444,5449,114,111,110,59,16765,59,17431,111,116,59,16763,498,5460,0,5467,111,87,105,100,116,232,2777,97,59,17302,114,59,24872,112,102,59,24868,99,114,59,49152,55349,56501,3041,5507,5514,5520,0,5552,5558,5567,0,0,0,0,5574,5595,5611,5727,5741,0,5781,5787,5810,5817,0,5822,99,117,116,101,32827,225,16609,114,101,118,101,59,16643,768,59,69,100,105,117,121,5532,5533,5537,5539,5544,5549,25150,59,49152,8766,819,59,25151,114,99,32827,226,16610,116,101,32955,180,774,59,17456,108,105,103,32827,230,16614,256,59,114,178,5562,59,49152,55349,56606,114,97,118,101,32827,224,16608,256,101,112,5578,5590,256,102,112,5583,5588,115,121,109,59,24885,232,5587,104,97,59,17329,256,97,112,5599,99,256,99,108,5604,5607,114,59,16641,103,59,27199,612,5616,0,0,5642,640,59,97,100,115,118,5626,5627,5631,5633,5639,25127,110,100,59,27221,59,27228,108,111,112,101,59,27224,59,27226,896,59,101,108,109,114,115,122,5656,5657,5659,5662,5695,5711,5721,25120,59,27044,101,187,5657,115,100,256,59,97,5669,5670,25121,1121,5680,5682,5684,5686,5688,5690,5692,5694,59,27048,59,27049,59,27050,59,27051,59,27052,59,27053,59,27054,59,27055,116,256,59,118,5701,5702,25119,98,256,59,100,5708,5709,25278,59,27037,256,112,116,5716,5719,104,59,25122,187,185,97,114,114,59,25468,256,103,112,5731,5735,111,110,59,16645,102,59,49152,55349,56658,896,59,69,97,101,105,111,112,4801,5755,5757,5762,5764,5767,5770,59,27248,99,105,114,59,27247,59,25162,100,59,25163,115,59,16423,114,111,120,256,59,101,4801,5778,241,5763,105,110,103,32827,229,16613,384,99,116,121,5793,5798,5800,114,59,49152,55349,56502,59,16426,109,112,256,59,101,4801,5807,241,648,105,108,100,101,32827,227,16611,109,108,32827,228,16612,256,99,105,5826,5832,111,110,105,110,244,626,110,116,59,27153,2048,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,5869,5873,5936,5948,5955,5960,6008,6013,6112,6118,6201,6224,5901,6461,6472,6512,111,116,59,27373,256,99,114,5878,5918,107,512,99,101,112,115,5888,5893,5901,5907,111,110,103,59,25164,112,115,105,108,111,110,59,17398,114,105,109,101,59,24629,105,109,256,59,101,5914,5915,25149,113,59,25293,374,5922,5926,101,101,59,25277,101,100,256,59,103,5932,5933,25349,101,187,5933,114,107,256,59,116,4956,5943,98,114,107,59,25526,256,111,121,5889,5953,59,17457,113,117,111,59,24606,640,99,109,112,114,116,5971,5979,5985,5988,5992,97,117,115,256,59,101,266,265,112,116,121,118,59,27056,115,233,5900,110,111,245,275,384,97,104,119,5999,6001,6003,59,17330,59,24886,101,101,110,59,25196,114,59,49152,55349,56607,103,896,99,111,115,116,117,118,119,6029,6045,6067,6081,6101,6107,6110,384,97,105,117,6036,6038,6042,240,1888,114,99,59,26095,112,187,4977,384,100,112,116,6052,6056,6061,111,116,59,27136,108,117,115,59,27137,105,109,101,115,59,27138,625,6073,0,0,6078,99,117,112,59,27142,97,114,59,26117,114,105,97,110,103,108,101,256,100,117,6093,6098,111,119,110,59,26045,112,59,26035,112,108,117,115,59,27140,101,229,5188,229,5293,97,114,111,119,59,26893,384,97,107,111,6125,6182,6197,256,99,110,6130,6179,107,384,108,115,116,6138,1451,6146,111,122,101,110,103,101,59,27115,114,105,97,110,103,108,101,512,59,100,108,114,6162,6163,6168,6173,26036,111,119,110,59,26046,101,102,116,59,26050,105,103,104,116,59,26040,107,59,25635,433,6187,0,6195,434,6191,0,6193,59,26002,59,26001,52,59,26003,99,107,59,25992,256,101,111,6206,6221,256,59,113,6211,6214,49152,61,8421,117,105,118,59,49152,8801,8421,116,59,25360,512,112,116,119,120,6233,6238,6247,6252,102,59,49152,55349,56659,256,59,116,5067,6243,111,109,187,5068,116,105,101,59,25288,1536,68,72,85,86,98,100,104,109,112,116,117,118,6277,6294,6314,6331,6359,6363,6380,6399,6405,6410,6416,6433,512,76,82,108,114,6286,6288,6290,6292,59,25943,59,25940,59,25942,59,25939,640,59,68,85,100,117,6305,6306,6308,6310,6312,25936,59,25958,59,25961,59,25956,59,25959,512,76,82,108,114,6323,6325,6327,6329,59,25949,59,25946,59,25948,59,25945,896,59,72,76,82,104,108,114,6346,6347,6349,6351,6353,6355,6357,25937,59,25964,59,25955,59,25952,59,25963,59,25954,59,25951,111,120,59,27081,512,76,82,108,114,6372,6374,6376,6378,59,25941,59,25938,59,25872,59,25868,640,59,68,85,100,117,1725,6391,6393,6395,6397,59,25957,59,25960,59,25900,59,25908,105,110,117,115,59,25247,108,117,115,59,25246,105,109,101,115,59,25248,512,76,82,108,114,6425,6427,6429,6431,59,25947,59,25944,59,25880,59,25876,896,59,72,76,82,104,108,114,6448,6449,6451,6453,6455,6457,6459,25858,59,25962,59,25953,59,25950,59,25916,59,25892,59,25884,256,101,118,291,6466,98,97,114,32827,166,16550,512,99,101,105,111,6481,6486,6490,6496,114,59,49152,55349,56503,109,105,59,24655,109,256,59,101,5914,5916,108,384,59,98,104,6504,6505,6507,16476,59,27077,115,117,98,59,26568,364,6516,6526,108,256,59,101,6521,6522,24610,116,187,6522,112,384,59,69,101,303,6533,6535,59,27310,256,59,113,1756,1755,3297,6567,0,6632,6673,6677,6706,0,6711,6736,0,0,6836,0,0,6849,0,0,6945,6958,6989,6994,0,7165,0,7180,384,99,112,114,6573,6578,6621,117,116,101,59,16647,768,59,97,98,99,100,115,6591,6592,6596,6602,6613,6617,25129,110,100,59,27204,114,99,117,112,59,27209,256,97,117,6607,6610,112,59,27211,112,59,27207,111,116,59,27200,59,49152,8745,65024,256,101,111,6626,6629,116,59,24641,238,1683,512,97,101,105,117,6640,6651,6657,6661,496,6645,0,6648,115,59,27213,111,110,59,16653,100,105,108,32827,231,16615,114,99,59,16649,112,115,256,59,115,6668,6669,27212,109,59,27216,111,116,59,16651,384,100,109,110,6683,6688,6694,105,108,32955,184,429,112,116,121,118,59,27058,116,33024,162,59,101,6701,6702,16546,114,228,434,114,59,49152,55349,56608,384,99,101,105,6717,6720,6733,121,59,17479,99,107,256,59,109,6727,6728,26387,97,114,107,187,6728,59,17351,114,896,59,69,99,101,102,109,115,6751,6752,6754,6763,6820,6826,6830,26059,59,27075,384,59,101,108,6761,6762,6765,17094,113,59,25175,101,609,6772,0,0,6792,114,114,111,119,256,108,114,6780,6785,101,102,116,59,25018,105,103,104,116,59,25019,640,82,83,97,99,100,6802,6804,6806,6810,6815,187,3911,59,25800,115,116,59,25243,105,114,99,59,25242,97,115,104,59,25245,110,105,110,116,59,27152,105,100,59,27375,99,105,114,59,27074,117,98,115,256,59,117,6843,6844,26211,105,116,187,6844,748,6855,6868,6906,0,6922,111,110,256,59,101,6861,6862,16442,256,59,113,199,198,621,6873,0,0,6882,97,256,59,116,6878,6879,16428,59,16448,384,59,102,108,6888,6889,6891,25089,238,4448,101,256,109,120,6897,6902,101,110,116,187,6889,101,243,589,487,6910,0,6919,256,59,100,4795,6914,111,116,59,27245,110,244,582,384,102,114,121,6928,6932,6935,59,49152,55349,56660,111,228,596,33024,169,59,115,341,6941,114,59,24855,256,97,111,6949,6953,114,114,59,25013,115,115,59,26391,256,99,117,6962,6967,114,59,49152,55349,56504,256,98,112,6972,6980,256,59,101,6977,6978,27343,59,27345,256,59,101,6985,6986,27344,59,27346,100,111,116,59,25327,896,100,101,108,112,114,118,119,7008,7020,7031,7042,7084,7124,7161,97,114,114,256,108,114,7016,7018,59,26936,59,26933,624,7026,0,0,7029,114,59,25310,99,59,25311,97,114,114,256,59,112,7039,7040,25014,59,26941,768,59,98,99,100,111,115,7055,7056,7062,7073,7077,7080,25130,114,99,97,112,59,27208,256,97,117,7067,7070,112,59,27206,112,59,27210,111,116,59,25229,114,59,27205,59,49152,8746,65024,512,97,108,114,118,7093,7103,7134,7139,114,114,256,59,109,7100,7101,25015,59,26940,121,384,101,118,119,7111,7124,7128,113,624,7118,0,0,7122,114,101,227,7027,117,227,7029,101,101,59,25294,101,100,103,101,59,25295,101,110,32827,164,16548,101,97,114,114,111,119,256,108,114,7150,7155,101,102,116,187,7040,105,103,104,116,187,7101,101,228,7133,256,99,105,7169,7175,111,110,105,110,244,503,110,116,59,25137,108,99,116,121,59,25389,2432,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,7224,7227,7231,7261,7273,7285,7306,7326,7340,7351,7419,7423,7437,7547,7569,7595,7611,7622,7629,114,242,897,97,114,59,26981,512,103,108,114,115,7240,7245,7250,7252,103,101,114,59,24608,101,116,104,59,24888,242,4403,104,256,59,118,7258,7259,24592,187,2314,363,7265,7271,97,114,111,119,59,26895,97,227,789,256,97,121,7278,7283,114,111,110,59,16655,59,17460,384,59,97,111,818,7292,7300,256,103,114,703,7297,114,59,25034,116,115,101,113,59,27255,384,103,108,109,7313,7316,7320,32827,176,16560,116,97,59,17332,112,116,121,118,59,27057,256,105,114,7331,7336,115,104,116,59,27007,59,49152,55349,56609,97,114,256,108,114,7347,7349,187,2268,187,4126,640,97,101,103,115,118,7362,888,7382,7388,7392,109,384,59,111,115,806,7370,7380,110,100,256,59,115,806,7377,117,105,116,59,26214,97,109,109,97,59,17373,105,110,59,25330,384,59,105,111,7399,7400,7416,16631,100,101,33024,247,59,111,7399,7408,110,116,105,109,101,115,59,25287,110,248,7415,99,121,59,17490,99,623,7430,0,0,7434,114,110,59,25374,111,112,59,25357,640,108,112,116,117,119,7448,7453,7458,7497,7509,108,97,114,59,16420,102,59,49152,55349,56661,640,59,101,109,112,115,779,7469,7479,7485,7490,113,256,59,100,850,7475,111,116,59,25169,105,110,117,115,59,25144,108,117,115,59,25108,113,117,97,114,101,59,25249,98,108,101,98,97,114,119,101,100,103,229,250,110,384,97,100,104,4398,7517,7527,111,119,110,97,114,114,111,119,243,7299,97,114,112,111,111,110,256,108,114,7538,7542,101,102,244,7348,105,103,104,244,7350,354,7551,7557,107,97,114,111,247,3906,623,7562,0,0,7566,114,110,59,25375,111,112,59,25356,384,99,111,116,7576,7587,7590,256,114,121,7581,7585,59,49152,55349,56505,59,17493,108,59,27126,114,111,107,59,16657,256,100,114,7600,7604,111,116,59,25329,105,256,59,102,7610,6166,26047,256,97,104,7616,7619,114,242,1065,97,242,4006,97,110,103,108,101,59,27046,256,99,105,7634,7637,121,59,17503,103,114,97,114,114,59,26623,2304,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,7681,7689,7705,7736,1400,7740,7753,7777,7806,7845,7855,7869,7905,7978,7991,8004,8014,8026,256,68,111,7686,7476,111,244,7305,256,99,115,7694,7700,117,116,101,32827,233,16617,116,101,114,59,27246,512,97,105,111,121,7714,7719,7729,7734,114,111,110,59,16667,114,256,59,99,7725,7726,25174,32827,234,16618,108,111,110,59,25173,59,17485,111,116,59,16663,256,68,114,7745,7749,111,116,59,25170,59,49152,55349,56610,384,59,114,115,7760,7761,7767,27290,97,118,101,32827,232,16616,256,59,100,7772,7773,27286,111,116,59,27288,512,59,105,108,115,7786,7787,7794,7796,27289,110,116,101,114,115,59,25575,59,24851,256,59,100,7801,7802,27285,111,116,59,27287,384,97,112,115,7813,7817,7831,99,114,59,16659,116,121,384,59,115,118,7826,7827,7829,25093,101,116,187,7827,112,256,49,59,7837,7844,307,7841,7843,59,24580,59,24581,24579,256,103,115,7850,7852,59,16715,112,59,24578,256,103,112,7860,7864,111,110,59,16665,102,59,49152,55349,56662,384,97,108,115,7876,7886,7890,114,256,59,115,7882,7883,25301,108,59,27107,117,115,59,27249,105,384,59,108,118,7898,7899,7903,17333,111,110,187,7899,59,17397,512,99,115,117,118,7914,7923,7947,7971,256,105,111,7919,7729,114,99,187,7726,617,7929,0,0,7931,237,1352,97,110,116,256,103,108,7938,7942,116,114,187,7773,101,115,115,187,7802,384,97,101,105,7954,7958,7962,108,115,59,16445,115,116,59,25183,118,256,59,68,565,7968,68,59,27256,112,97,114,115,108,59,27109,256,68,97,7983,7987,111,116,59,25171,114,114,59,26993,384,99,100,105,7998,8001,7928,114,59,24879,111,244,850,256,97,104,8009,8011,59,17335,32827,240,16624,256,109,114,8019,8023,108,32827,235,16619,111,59,24748,384,99,105,112,8033,8036,8039,108,59,16417,115,244,1390,256,101,111,8044,8052,99,116,97,116,105,111,238,1369,110,101,110,116,105,97,108,229,1401,2529,8082,0,8094,0,8097,8103,0,0,8134,8140,0,8147,0,8166,8170,8192,0,8200,8282,108,108,105,110,103,100,111,116,115,101,241,7748,121,59,17476,109,97,108,101,59,26176,384,105,108,114,8109,8115,8129,108,105,103,59,32768,64259,617,8121,0,0,8125,103,59,32768,64256,105,103,59,32768,64260,59,49152,55349,56611,108,105,103,59,32768,64257,108,105,103,59,49152,102,106,384,97,108,116,8153,8156,8161,116,59,26221,105,103,59,32768,64258,110,115,59,26033,111,102,59,16786,496,8174,0,8179,102,59,49152,55349,56663,256,97,107,1471,8183,256,59,118,8188,8189,25300,59,27353,97,114,116,105,110,116,59,27149,256,97,111,8204,8277,256,99,115,8209,8274,945,8218,8240,8248,8261,8264,0,8272,946,8226,8229,8231,8234,8236,0,8238,32827,189,16573,59,24915,32827,188,16572,59,24917,59,24921,59,24923,435,8244,0,8246,59,24916,59,24918,692,8254,8257,0,0,8259,32827,190,16574,59,24919,59,24924,53,59,24920,438,8268,0,8270,59,24922,59,24925,56,59,24926,108,59,24644,119,110,59,25378,99,114,59,49152,55349,56507,2176,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,8322,8329,8351,8357,8368,8372,8432,8437,8442,8447,8451,8466,8504,791,8510,8530,8606,256,59,108,1613,8327,59,27276,384,99,109,112,8336,8341,8349,117,116,101,59,16885,109,97,256,59,100,8348,7386,17331,59,27270,114,101,118,101,59,16671,256,105,121,8362,8366,114,99,59,16669,59,17459,111,116,59,16673,512,59,108,113,115,1598,1602,8381,8393,384,59,113,115,1598,1612,8388,108,97,110,244,1637,512,59,99,100,108,1637,8402,8405,8421,99,59,27305,111,116,256,59,111,8412,8413,27264,256,59,108,8418,8419,27266,59,27268,256,59,101,8426,8429,49152,8923,65024,115,59,27284,114,59,49152,55349,56612,256,59,103,1651,1563,109,101,108,59,24887,99,121,59,17491,512,59,69,97,106,1626,8460,8462,8464,59,27282,59,27301,59,27300,512,69,97,101,115,8475,8477,8489,8500,59,25193,112,256,59,112,8483,8484,27274,114,111,120,187,8484,256,59,113,8494,8495,27272,256,59,113,8494,8475,105,109,59,25319,112,102,59,49152,55349,56664,256,99,105,8515,8518,114,59,24842,109,384,59,101,108,1643,8526,8528,59,27278,59,27280,33536,62,59,99,100,108,113,114,1518,8544,8554,8558,8563,8569,256,99,105,8549,8551,59,27303,114,59,27258,111,116,59,25303,80,97,114,59,27029,117,101,115,116,59,27260,640,97,100,101,108,115,8580,8554,8592,1622,8603,496,8585,0,8590,112,114,111,248,8350,114,59,27e3,113,256,108,113,1599,8598,108,101,115,243,8328,105,237,1643,256,101,110,8611,8621,114,116,110,101,113,113,59,49152,8809,65024,197,8618,1280,65,97,98,99,101,102,107,111,115,121,8644,8647,8689,8693,8698,8728,8733,8751,8808,8829,114,242,928,512,105,108,109,114,8656,8660,8663,8667,114,115,240,5252,102,187,8228,105,108,244,1705,256,100,114,8672,8676,99,121,59,17482,384,59,99,119,2292,8683,8687,105,114,59,26952,59,25005,97,114,59,24847,105,114,99,59,16677,384,97,108,114,8705,8718,8723,114,116,115,256,59,117,8713,8714,26213,105,116,187,8714,108,105,112,59,24614,99,111,110,59,25273,114,59,49152,55349,56613,115,256,101,119,8739,8745,97,114,111,119,59,26917,97,114,111,119,59,26918,640,97,109,111,112,114,8762,8766,8771,8798,8803,114,114,59,25087,116,104,116,59,25147,107,256,108,114,8777,8787,101,102,116,97,114,114,111,119,59,25001,105,103,104,116,97,114,114,111,119,59,25002,102,59,49152,55349,56665,98,97,114,59,24597,384,99,108,116,8815,8820,8824,114,59,49152,55349,56509,97,115,232,8692,114,111,107,59,16679,256,98,112,8834,8839,117,108,108,59,24643,104,101,110,187,7259,2785,8867,0,8874,0,8888,8901,8910,0,8917,8947,0,0,8952,8994,9063,9058,9087,0,9094,9130,9140,99,117,116,101,32827,237,16621,384,59,105,121,1905,8880,8885,114,99,32827,238,16622,59,17464,256,99,120,8892,8895,121,59,17461,99,108,32827,161,16545,256,102,114,927,8905,59,49152,55349,56614,114,97,118,101,32827,236,16620,512,59,105,110,111,1854,8925,8937,8942,256,105,110,8930,8934,110,116,59,27148,116,59,25133,102,105,110,59,27100,116,97,59,24873,108,105,103,59,16691,384,97,111,112,8958,8986,8989,384,99,103,116,8965,8968,8983,114,59,16683,384,101,108,112,1823,8975,8979,105,110,229,1934,97,114,244,1824,104,59,16689,102,59,25271,101,100,59,16821,640,59,99,102,111,116,1268,9004,9009,9021,9025,97,114,101,59,24837,105,110,256,59,116,9016,9017,25118,105,101,59,27101,100,111,244,8985,640,59,99,101,108,112,1879,9036,9040,9051,9057,97,108,59,25274,256,103,114,9045,9049,101,114,243,5475,227,9037,97,114,104,107,59,27159,114,111,100,59,27196,512,99,103,112,116,9071,9074,9078,9083,121,59,17489,111,110,59,16687,102,59,49152,55349,56666,97,59,17337,117,101,115,116,32827,191,16575,256,99,105,9098,9103,114,59,49152,55349,56510,110,640,59,69,100,115,118,1268,9115,9117,9121,1267,59,25337,111,116,59,25333,256,59,118,9126,9127,25332,59,25331,256,59,105,1911,9134,108,100,101,59,16681,491,9144,0,9148,99,121,59,17494,108,32827,239,16623,768,99,102,109,111,115,117,9164,9175,9180,9185,9191,9205,256,105,121,9169,9173,114,99,59,16693,59,17465,114,59,49152,55349,56615,97,116,104,59,16951,112,102,59,49152,55349,56667,483,9196,0,9201,114,59,49152,55349,56511,114,99,121,59,17496,107,99,121,59,17492,1024,97,99,102,103,104,106,111,115,9227,9238,9250,9255,9261,9265,9269,9275,112,112,97,256,59,118,9235,9236,17338,59,17392,256,101,121,9243,9248,100,105,108,59,16695,59,17466,114,59,49152,55349,56616,114,101,101,110,59,16696,99,121,59,17477,99,121,59,17500,112,102,59,49152,55349,56668,99,114,59,49152,55349,56512,2944,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,9328,9345,9350,9357,9361,9486,9533,9562,9600,9806,9822,9829,9849,9853,9882,9906,9944,10077,10088,10123,10176,10241,10258,384,97,114,116,9335,9338,9340,114,242,2502,242,917,97,105,108,59,26907,97,114,114,59,26894,256,59,103,2452,9355,59,27275,97,114,59,26978,2403,9381,0,9386,0,9393,0,0,0,0,0,9397,9402,0,9414,9416,9421,0,9465,117,116,101,59,16698,109,112,116,121,118,59,27060,114,97,238,2124,98,100,97,59,17339,103,384,59,100,108,2190,9409,9411,59,27025,229,2190,59,27269,117,111,32827,171,16555,114,1024,59,98,102,104,108,112,115,116,2201,9438,9446,9449,9451,9454,9457,9461,256,59,102,2205,9443,115,59,26911,115,59,26909,235,8786,112,59,25003,108,59,26937,105,109,59,26995,108,59,24994,384,59,97,101,9471,9472,9476,27307,105,108,59,26905,256,59,115,9481,9482,27309,59,49152,10925,65024,384,97,98,114,9493,9497,9501,114,114,59,26892,114,107,59,26482,256,97,107,9506,9516,99,256,101,107,9512,9514,59,16507,59,16475,256,101,115,9521,9523,59,27019,108,256,100,117,9529,9531,59,27023,59,27021,512,97,101,117,121,9542,9547,9558,9560,114,111,110,59,16702,256,100,105,9552,9556,105,108,59,16700,236,2224,226,9513,59,17467,512,99,113,114,115,9571,9574,9581,9597,97,59,26934,117,111,256,59,114,3609,5958,256,100,117,9586,9591,104,97,114,59,26983,115,104,97,114,59,26955,104,59,25010,640,59,102,103,113,115,9611,9612,2441,9715,9727,25188,116,640,97,104,108,114,116,9624,9636,9655,9666,9704,114,114,111,119,256,59,116,2201,9633,97,233,9462,97,114,112,111,111,110,256,100,117,9647,9652,111,119,110,187,1114,112,187,2406,101,102,116,97,114,114,111,119,115,59,25031,105,103,104,116,384,97,104,115,9677,9686,9694,114,114,111,119,256,59,115,2292,2215,97,114,112,111,111,110,243,3992,113,117,105,103,97,114,114,111,247,8688,104,114,101,101,116,105,109,101,115,59,25291,384,59,113,115,9611,2451,9722,108,97,110,244,2476,640,59,99,100,103,115,2476,9738,9741,9757,9768,99,59,27304,111,116,256,59,111,9748,9749,27263,256,59,114,9754,9755,27265,59,27267,256,59,101,9762,9765,49152,8922,65024,115,59,27283,640,97,100,101,103,115,9779,9785,9789,9801,9803,112,112,114,111,248,9414,111,116,59,25302,113,256,103,113,9795,9797,244,2441,103,116,242,9356,244,2459,105,237,2482,384,105,108,114,9813,2273,9818,115,104,116,59,27004,59,49152,55349,56617,256,59,69,2460,9827,59,27281,353,9833,9846,114,256,100,117,9650,9838,256,59,108,2405,9843,59,26986,108,107,59,25988,99,121,59,17497,640,59,97,99,104,116,2632,9864,9867,9873,9878,114,242,9665,111,114,110,101,242,7432,97,114,100,59,26987,114,105,59,26106,256,105,111,9887,9892,100,111,116,59,16704,117,115,116,256,59,97,9900,9901,25520,99,104,101,187,9901,512,69,97,101,115,9915,9917,9929,9940,59,25192,112,256,59,112,9923,9924,27273,114,111,120,187,9924,256,59,113,9934,9935,27271,256,59,113,9934,9915,105,109,59,25318,1024,97,98,110,111,112,116,119,122,9961,9972,9975,10010,10031,10049,10055,10064,256,110,114,9966,9969,103,59,26604,114,59,25085,114,235,2241,103,384,108,109,114,9983,9997,10004,101,102,116,256,97,114,2534,9991,105,103,104,116,225,2546,97,112,115,116,111,59,26620,105,103,104,116,225,2557,112,97,114,114,111,119,256,108,114,10021,10025,101,102,244,9453,105,103,104,116,59,25004,384,97,102,108,10038,10041,10045,114,59,27013,59,49152,55349,56669,117,115,59,27181,105,109,101,115,59,27188,353,10059,10063,115,116,59,25111,225,4942,384,59,101,102,10071,10072,6144,26058,110,103,101,187,10072,97,114,256,59,108,10084,10085,16424,116,59,27027,640,97,99,104,109,116,10099,10102,10108,10117,10119,114,242,2216,111,114,110,101,242,7564,97,114,256,59,100,3992,10115,59,26989,59,24590,114,105,59,25279,768,97,99,104,105,113,116,10136,10141,2624,10146,10158,10171,113,117,111,59,24633,114,59,49152,55349,56513,109,384,59,101,103,2482,10154,10156,59,27277,59,27279,256,98,117,9514,10163,111,256,59,114,3615,10169,59,24602,114,111,107,59,16706,33792,60,59,99,100,104,105,108,113,114,2091,10194,9785,10204,10208,10213,10218,10224,256,99,105,10199,10201,59,27302,114,59,27257,114,101,229,9714,109,101,115,59,25289,97,114,114,59,26998,117,101,115,116,59,27259,256,80,105,10229,10233,97,114,59,27030,384,59,101,102,10240,2349,6171,26051,114,256,100,117,10247,10253,115,104,97,114,59,26954,104,97,114,59,26982,256,101,110,10263,10273,114,116,110,101,113,113,59,49152,8808,65024,197,10270,1792,68,97,99,100,101,102,104,105,108,110,111,112,115,117,10304,10309,10370,10382,10387,10400,10405,10408,10458,10466,10468,2691,10483,10498,68,111,116,59,25146,512,99,108,112,114,10318,10322,10339,10365,114,32827,175,16559,256,101,116,10327,10329,59,26178,256,59,101,10334,10335,26400,115,101,187,10335,256,59,115,4155,10344,116,111,512,59,100,108,117,4155,10355,10359,10363,111,119,238,1164,101,102,244,2319,240,5073,107,101,114,59,26030,256,111,121,10375,10380,109,109,97,59,27177,59,17468,97,115,104,59,24596,97,115,117,114,101,100,97,110,103,108,101,187,5670,114,59,49152,55349,56618,111,59,24871,384,99,100,110,10415,10420,10441,114,111,32827,181,16565,512,59,97,99,100,5220,10429,10432,10436,115,244,5799,105,114,59,27376,111,116,32955,183,437,117,115,384,59,98,100,10450,6403,10451,25106,256,59,117,7484,10456,59,27178,355,10462,10465,112,59,27355,242,8722,240,2689,256,100,112,10473,10478,101,108,115,59,25255,102,59,49152,55349,56670,256,99,116,10488,10493,114,59,49152,55349,56514,112,111,115,187,5533,384,59,108,109,10505,10506,10509,17340,116,105,109,97,112,59,25272,3072,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,10562,10579,10622,10633,10648,10714,10729,10773,10778,10840,10845,10883,10901,10916,10920,11012,11015,11076,11135,11182,11316,11367,11388,11497,256,103,116,10567,10571,59,49152,8921,824,256,59,118,10576,3023,49152,8811,8402,384,101,108,116,10586,10610,10614,102,116,256,97,114,10593,10599,114,114,111,119,59,25037,105,103,104,116,97,114,114,111,119,59,25038,59,49152,8920,824,256,59,118,10619,3143,49152,8810,8402,105,103,104,116,97,114,114,111,119,59,25039,256,68,100,10638,10643,97,115,104,59,25263,97,115,104,59,25262,640,98,99,110,112,116,10659,10663,10668,10673,10700,108,97,187,734,117,116,101,59,16708,103,59,49152,8736,8402,640,59,69,105,111,112,3460,10684,10688,10693,10696,59,49152,10864,824,100,59,49152,8779,824,115,59,16713,114,111,248,3460,117,114,256,59,97,10707,10708,26222,108,256,59,115,10707,2872,499,10719,0,10723,112,32955,160,2871,109,112,256,59,101,3065,3072,640,97,101,111,117,121,10740,10750,10755,10768,10771,496,10745,0,10747,59,27203,111,110,59,16712,100,105,108,59,16710,110,103,256,59,100,3454,10762,111,116,59,49152,10861,824,112,59,27202,59,17469,97,115,104,59,24595,896,59,65,97,100,113,115,120,2962,10793,10797,10811,10817,10821,10832,114,114,59,25047,114,256,104,114,10803,10806,107,59,26916,256,59,111,5106,5104,111,116,59,49152,8784,824,117,105,246,2915,256,101,105,10826,10830,97,114,59,26920,237,2968,105,115,116,256,59,115,2976,2975,114,59,49152,55349,56619,512,69,101,115,116,3013,10854,10873,10876,384,59,113,115,3004,10861,3041,384,59,113,115,3004,3013,10868,108,97,110,244,3042,105,237,3050,256,59,114,2998,10881,187,2999,384,65,97,112,10890,10893,10897,114,242,10609,114,114,59,25006,97,114,59,27378,384,59,115,118,3981,10908,3980,256,59,100,10913,10914,25340,59,25338,99,121,59,17498,896,65,69,97,100,101,115,116,10935,10938,10942,10946,10949,10998,11001,114,242,10598,59,49152,8806,824,114,114,59,24986,114,59,24613,512,59,102,113,115,3131,10958,10979,10991,116,256,97,114,10964,10969,114,114,111,247,10945,105,103,104,116,97,114,114,111,247,10896,384,59,113,115,3131,10938,10986,108,97,110,244,3157,256,59,115,3157,10996,187,3126,105,237,3165,256,59,114,3125,11006,105,256,59,101,3098,3109,105,228,3472,256,112,116,11020,11025,102,59,49152,55349,56671,33152,172,59,105,110,11033,11034,11062,16556,110,512,59,69,100,118,2953,11044,11048,11054,59,49152,8953,824,111,116,59,49152,8949,824,481,2953,11059,11061,59,25335,59,25334,105,256,59,118,3256,11068,481,3256,11073,11075,59,25342,59,25341,384,97,111,114,11083,11107,11113,114,512,59,97,115,116,2939,11093,11098,11103,108,108,101,236,2939,108,59,49152,11005,8421,59,49152,8706,824,108,105,110,116,59,27156,384,59,99,101,3218,11120,11123,117,229,3237,256,59,99,3224,11128,256,59,101,3218,11133,241,3224,512,65,97,105,116,11144,11147,11165,11175,114,242,10632,114,114,384,59,99,119,11156,11157,11161,24987,59,49152,10547,824,59,49152,8605,824,103,104,116,97,114,114,111,119,187,11157,114,105,256,59,101,3275,3286,896,99,104,105,109,112,113,117,11197,11213,11225,11012,2936,11236,11247,512,59,99,101,114,3378,11206,3383,11209,117,229,3397,59,49152,55349,56515,111,114,116,621,11013,0,0,11222,97,114,225,11094,109,256,59,101,3438,11231,256,59,113,3444,3443,115,117,256,98,112,11243,11245,229,3320,229,3339,384,98,99,112,11254,11281,11289,512,59,69,101,115,11263,11264,3362,11268,25220,59,49152,10949,824,101,116,256,59,101,3355,11275,113,256,59,113,3363,11264,99,256,59,101,3378,11287,241,3384,512,59,69,101,115,11298,11299,3423,11303,25221,59,49152,10950,824,101,116,256,59,101,3416,11310,113,256,59,113,3424,11299,512,103,105,108,114,11325,11327,11333,11335,236,3031,108,100,101,32827,241,16625,231,3139,105,97,110,103,108,101,256,108,114,11346,11356,101,102,116,256,59,101,3098,11354,241,3110,105,103,104,116,256,59,101,3275,11365,241,3287,256,59,109,11372,11373,17341,384,59,101,115,11380,11381,11385,16419,114,111,59,24854,112,59,24583,1152,68,72,97,100,103,105,108,114,115,11407,11412,11417,11422,11427,11440,11446,11475,11491,97,115,104,59,25261,97,114,114,59,26884,112,59,49152,8781,8402,97,115,104,59,25260,256,101,116,11432,11436,59,49152,8805,8402,59,49152,62,8402,110,102,105,110,59,27102,384,65,101,116,11453,11457,11461,114,114,59,26882,59,49152,8804,8402,256,59,114,11466,11469,49152,60,8402,105,101,59,49152,8884,8402,256,65,116,11480,11484,114,114,59,26883,114,105,101,59,49152,8885,8402,105,109,59,49152,8764,8402,384,65,97,110,11504,11508,11522,114,114,59,25046,114,256,104,114,11514,11517,107,59,26915,256,59,111,5095,5093,101,97,114,59,26919,4691,6805,0,0,0,0,0,0,0,0,0,0,0,0,0,11565,0,11576,11592,11616,11621,11634,11652,6919,0,0,11661,11691,0,11720,11726,0,11740,11801,11819,11838,11843,256,99,115,11569,6807,117,116,101,32827,243,16627,256,105,121,11580,11589,114,256,59,99,6814,11586,32827,244,16628,59,17470,640,97,98,105,111,115,6816,11602,11607,456,11610,108,97,99,59,16721,118,59,27192,111,108,100,59,27068,108,105,103,59,16723,256,99,114,11625,11629,105,114,59,27071,59,49152,55349,56620,879,11641,0,0,11644,0,11650,110,59,17115,97,118,101,32827,242,16626,59,27073,256,98,109,11656,3572,97,114,59,27061,512,97,99,105,116,11669,11672,11685,11688,114,242,6784,256,105,114,11677,11680,114,59,27070,111,115,115,59,27067,110,229,3666,59,27072,384,97,101,105,11697,11701,11705,99,114,59,16717,103,97,59,17353,384,99,100,110,11712,11717,461,114,111,110,59,17343,59,27062,112,102,59,49152,55349,56672,384,97,101,108,11732,11735,466,114,59,27063,114,112,59,27065,896,59,97,100,105,111,115,118,11754,11755,11758,11784,11789,11792,11798,25128,114,242,6790,512,59,101,102,109,11767,11768,11778,11781,27229,114,256,59,111,11774,11775,24884,102,187,11775,32827,170,16554,32827,186,16570,103,111,102,59,25270,114,59,27222,108,111,112,101,59,27223,59,27227,384,99,108,111,11807,11809,11815,242,11777,97,115,104,32827,248,16632,108,59,25240,105,364,11823,11828,100,101,32827,245,16629,101,115,256,59,97,475,11834,115,59,27190,109,108,32827,246,16630,98,97,114,59,25405,2785,11870,0,11901,0,11904,11933,0,11938,11961,0,0,11979,3740,0,12051,0,0,12075,12220,0,12232,114,512,59,97,115,116,1027,11879,11890,3717,33024,182,59,108,11885,11886,16566,108,101,236,1027,617,11896,0,0,11899,109,59,27379,59,27389,121,59,17471,114,640,99,105,109,112,116,11915,11919,11923,6245,11927,110,116,59,16421,111,100,59,16430,105,108,59,24624,101,110,107,59,24625,114,59,49152,55349,56621,384,105,109,111,11944,11952,11956,256,59,118,11949,11950,17350,59,17365,109,97,244,2678,110,101,59,26126,384,59,116,118,11967,11968,11976,17344,99,104,102,111,114,107,187,8189,59,17366,256,97,117,11983,11999,110,256,99,107,11989,11997,107,256,59,104,8692,11995,59,24846,246,8692,115,1152,59,97,98,99,100,101,109,115,116,12019,12020,6408,12025,12029,12036,12038,12042,12046,16427,99,105,114,59,27171,105,114,59,27170,256,111,117,7488,12034,59,27173,59,27250,110,32955,177,3741,105,109,59,27174,119,111,59,27175,384,105,112,117,12057,12064,12069,110,116,105,110,116,59,27157,102,59,49152,55349,56673,110,100,32827,163,16547,1280,59,69,97,99,101,105,110,111,115,117,3784,12095,12097,12100,12103,12161,12169,12178,12158,12214,59,27315,112,59,27319,117,229,3801,256,59,99,3790,12108,768,59,97,99,101,110,115,3784,12121,12127,12134,12136,12158,112,112,114,111,248,12099,117,114,108,121,101,241,3801,241,3790,384,97,101,115,12143,12150,12154,112,112,114,111,120,59,27321,113,113,59,27317,105,109,59,25320,105,237,3807,109,101,256,59,115,12168,3758,24626,384,69,97,115,12152,12176,12154,240,12149,384,100,102,112,3820,12185,12207,384,97,108,115,12192,12197,12202,108,97,114,59,25390,105,110,101,59,25362,117,114,102,59,25363,256,59,116,3835,12212,239,3835,114,101,108,59,25264,256,99,105,12224,12229,114,59,49152,55349,56517,59,17352,110,99,115,112,59,24584,768,102,105,111,112,115,117,12250,8930,12255,12261,12267,12273,114,59,49152,55349,56622,112,102,59,49152,55349,56674,114,105,109,101,59,24663,99,114,59,49152,55349,56518,384,97,101,111,12280,12297,12307,116,256,101,105,12286,12293,114,110,105,111,110,243,1712,110,116,59,27158,115,116,256,59,101,12304,12305,16447,241,7961,244,3860,2688,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,12352,12369,12373,12377,12512,12558,12587,12615,12642,12658,12686,12806,12821,12836,12841,12888,12910,12914,12944,12976,12983,384,97,114,116,12359,12362,12364,114,242,4275,242,989,97,105,108,59,26908,97,114,242,7269,97,114,59,26980,896,99,100,101,110,113,114,116,12392,12405,12408,12415,12431,12436,12492,256,101,117,12397,12401,59,49152,8765,817,116,101,59,16725,105,227,4462,109,112,116,121,118,59,27059,103,512,59,100,101,108,4049,12425,12427,12429,59,27026,59,27045,229,4049,117,111,32827,187,16571,114,1408,59,97,98,99,102,104,108,112,115,116,119,4060,12460,12463,12471,12473,12476,12478,12480,12483,12487,12490,112,59,26997,256,59,102,4064,12468,115,59,26912,59,26931,115,59,26910,235,8797,240,10030,108,59,26949,105,109,59,26996,108,59,24995,59,24989,256,97,105,12497,12501,105,108,59,26906,111,256,59,110,12507,12508,25142,97,108,243,3870,384,97,98,114,12519,12522,12526,114,242,6117,114,107,59,26483,256,97,107,12531,12541,99,256,101,107,12537,12539,59,16509,59,16477,256,101,115,12546,12548,59,27020,108,256,100,117,12554,12556,59,27022,59,27024,512,97,101,117,121,12567,12572,12583,12585,114,111,110,59,16729,256,100,105,12577,12581,105,108,59,16727,236,4082,226,12538,59,17472,512,99,108,113,115,12596,12599,12605,12612,97,59,26935,100,104,97,114,59,26985,117,111,256,59,114,526,525,104,59,25011,384,97,99,103,12622,12639,3908,108,512,59,105,112,115,3960,12632,12635,4252,110,229,4283,97,114,244,4009,116,59,26029,384,105,108,114,12649,4131,12654,115,104,116,59,27005,59,49152,55349,56623,256,97,111,12663,12678,114,256,100,117,12669,12671,187,1147,256,59,108,4241,12676,59,26988,256,59,118,12683,12684,17345,59,17393,384,103,110,115,12693,12793,12796,104,116,768,97,104,108,114,115,116,12708,12720,12738,12760,12772,12782,114,114,111,119,256,59,116,4060,12717,97,233,12488,97,114,112,111,111,110,256,100,117,12731,12735,111,119,238,12670,112,187,4242,101,102,116,256,97,104,12746,12752,114,114,111,119,243,4074,97,114,112,111,111,110,243,1361,105,103,104,116,97,114,114,111,119,115,59,25033,113,117,105,103,97,114,114,111,247,12491,104,114,101,101,116,105,109,101,115,59,25292,103,59,17114,105,110,103,100,111,116,115,101,241,7986,384,97,104,109,12813,12816,12819,114,242,4074,97,242,1361,59,24591,111,117,115,116,256,59,97,12830,12831,25521,99,104,101,187,12831,109,105,100,59,27374,512,97,98,112,116,12850,12861,12864,12882,256,110,114,12855,12858,103,59,26605,114,59,25086,114,235,4099,384,97,102,108,12871,12874,12878,114,59,27014,59,49152,55349,56675,117,115,59,27182,105,109,101,115,59,27189,256,97,112,12893,12903,114,256,59,103,12899,12900,16425,116,59,27028,111,108,105,110,116,59,27154,97,114,242,12771,512,97,99,104,113,12923,12928,4284,12933,113,117,111,59,24634,114,59,49152,55349,56519,256,98,117,12539,12938,111,256,59,114,532,531,384,104,105,114,12951,12955,12960,114,101,229,12792,109,101,115,59,25290,105,512,59,101,102,108,12970,4185,6177,12971,26041,116,114,105,59,27086,108,117,104,97,114,59,26984,59,24862,3425,13013,13019,13023,13100,13112,13169,0,13178,13220,0,0,13292,13296,0,13352,13384,13402,13485,13489,13514,13553,0,13846,0,0,13875,99,117,116,101,59,16731,113,117,239,10170,1280,59,69,97,99,101,105,110,112,115,121,4589,13043,13045,13055,13058,13067,13071,13087,13094,13097,59,27316,496,13050,0,13052,59,27320,111,110,59,16737,117,229,4606,256,59,100,4595,13063,105,108,59,16735,114,99,59,16733,384,69,97,115,13078,13080,13083,59,27318,112,59,27322,105,109,59,25321,111,108,105,110,116,59,27155,105,237,4612,59,17473,111,116,384,59,98,101,13108,7495,13109,25285,59,27238,896,65,97,99,109,115,116,120,13126,13130,13143,13147,13150,13155,13165,114,114,59,25048,114,256,104,114,13136,13138,235,8744,256,59,111,2614,2612,116,32827,167,16551,105,59,16443,119,97,114,59,26921,109,256,105,110,13161,240,110,117,243,241,116,59,26422,114,256,59,111,13174,8277,49152,55349,56624,512,97,99,111,121,13186,13190,13201,13216,114,112,59,26223,256,104,121,13195,13199,99,121,59,17481,59,17480,114,116,621,13209,0,0,13212,105,228,5220,97,114,97,236,11887,32827,173,16557,256,103,109,13224,13236,109,97,384,59,102,118,13233,13234,13234,17347,59,17346,1024,59,100,101,103,108,110,112,114,4779,13253,13257,13262,13270,13278,13281,13286,111,116,59,27242,256,59,113,4785,4784,256,59,69,13267,13268,27294,59,27296,256,59,69,13275,13276,27293,59,27295,101,59,25158,108,117,115,59,27172,97,114,114,59,26994,97,114,242,4413,512,97,101,105,116,13304,13320,13327,13335,256,108,115,13309,13316,108,115,101,116,109,233,13162,104,112,59,27187,112,97,114,115,108,59,27108,256,100,108,5219,13332,101,59,25379,256,59,101,13340,13341,27306,256,59,115,13346,13347,27308,59,49152,10924,65024,384,102,108,112,13358,13363,13378,116,99,121,59,17484,256,59,98,13368,13369,16431,256,59,97,13374,13375,27076,114,59,25407,102,59,49152,55349,56676,97,256,100,114,13389,1026,101,115,256,59,117,13396,13397,26208,105,116,187,13397,384,99,115,117,13408,13433,13471,256,97,117,13413,13423,112,256,59,115,4488,13419,59,49152,8851,65024,112,256,59,115,4532,13429,59,49152,8852,65024,117,256,98,112,13439,13455,384,59,101,115,4503,4508,13446,101,116,256,59,101,4503,13453,241,4509,384,59,101,115,4520,4525,13462,101,116,256,59,101,4520,13469,241,4526,384,59,97,102,4475,13478,1456,114,357,13483,1457,187,4476,97,114,242,4424,512,99,101,109,116,13497,13502,13506,13509,114,59,49152,55349,56520,116,109,238,241,105,236,13333,97,114,230,4542,256,97,114,13518,13525,114,256,59,102,13524,6079,26118,256,97,110,13530,13549,105,103,104,116,256,101,112,13539,13546,112,115,105,108,111,238,7904,104,233,11951,115,187,10322,640,98,99,109,110,112,13563,13662,4617,13707,13710,1152,59,69,100,101,109,110,112,114,115,13582,13583,13585,13589,13598,13603,13612,13617,13622,25218,59,27333,111,116,59,27325,256,59,100,4570,13594,111,116,59,27331,117,108,116,59,27329,256,69,101,13608,13610,59,27339,59,25226,108,117,115,59,27327,97,114,114,59,27001,384,101,105,117,13629,13650,13653,116,384,59,101,110,13582,13637,13643,113,256,59,113,4570,13583,101,113,256,59,113,13611,13608,109,59,27335,256,98,112,13658,13660,59,27349,59,27347,99,768,59,97,99,101,110,115,4589,13676,13682,13689,13691,13094,112,112,114,111,248,13050,117,114,108,121,101,241,4606,241,4595,384,97,101,115,13698,13704,13083,112,112,114,111,248,13082,113,241,13079,103,59,26218,1664,49,50,51,59,69,100,101,104,108,109,110,112,115,13737,13740,13743,4636,13746,13748,13760,13769,13781,13786,13791,13800,13805,32827,185,16569,32827,178,16562,32827,179,16563,59,27334,256,111,115,13753,13756,116,59,27326,117,98,59,27352,256,59,100,4642,13765,111,116,59,27332,115,256,111,117,13775,13778,108,59,26569,98,59,27351,97,114,114,59,27003,117,108,116,59,27330,256,69,101,13796,13798,59,27340,59,25227,108,117,115,59,27328,384,101,105,117,13812,13833,13836,116,384,59,101,110,4636,13820,13826,113,256,59,113,4642,13746,101,113,256,59,113,13799,13796,109,59,27336,256,98,112,13841,13843,59,27348,59,27350,384,65,97,110,13852,13856,13869,114,114,59,25049,114,256,104,114,13862,13864,235,8750,256,59,111,2603,2601,119,97,114,59,26922,108,105,103,32827,223,16607,3041,13905,13917,13920,4814,13939,13945,0,13950,14018,0,0,0,0,0,14043,14083,0,14089,14188,0,0,0,14215,626,13910,0,0,13915,103,101,116,59,25366,59,17348,114,235,3679,384,97,101,121,13926,13931,13936,114,111,110,59,16741,100,105,108,59,16739,59,17474,108,114,101,99,59,25365,114,59,49152,55349,56625,512,101,105,107,111,13958,13981,14005,14012,498,13963,0,13969,101,256,52,102,4740,4737,97,384,59,115,118,13976,13977,13979,17336,121,109,59,17361,256,99,110,13986,14002,107,256,97,115,13992,13998,112,112,114,111,248,4801,105,109,187,4780,115,240,4766,256,97,115,14010,13998,240,4801,114,110,32827,254,16638,492,799,14022,8935,101,115,33152,215,59,98,100,14031,14032,14040,16599,256,59,97,6415,14037,114,59,27185,59,27184,384,101,112,115,14049,14051,14080,225,10829,512,59,98,99,102,1158,14060,14064,14068,111,116,59,25398,105,114,59,27377,256,59,111,14073,14076,49152,55349,56677,114,107,59,27354,225,13154,114,105,109,101,59,24628,384,97,105,112,14095,14098,14180,100,229,4680,896,97,100,101,109,112,115,116,14113,14157,14144,14161,14167,14172,14175,110,103,108,101,640,59,100,108,113,114,14128,14129,14134,14144,14146,26037,111,119,110,187,7611,101,102,116,256,59,101,10240,14142,241,2350,59,25180,105,103,104,116,256,59,101,12970,14155,241,4186,111,116,59,26092,105,110,117,115,59,27194,108,117,115,59,27193,98,59,27085,105,109,101,59,27195,101,122,105,117,109,59,25570,384,99,104,116,14194,14205,14209,256,114,121,14199,14203,59,49152,55349,56521,59,17478,99,121,59,17499,114,111,107,59,16743,256,105,111,14219,14222,120,244,6007,104,101,97,100,256,108,114,14231,14240,101,102,116,97,114,114,111,247,2127,105,103,104,116,97,114,114,111,119,187,3933,2304,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,14288,14291,14295,14308,14320,14332,14350,14364,14371,14388,14417,14429,14443,14505,14540,14546,14570,14582,114,242,1005,97,114,59,26979,256,99,114,14300,14306,117,116,101,32827,250,16634,242,4432,114,483,14314,0,14317,121,59,17502,118,101,59,16749,256,105,121,14325,14330,114,99,32827,251,16635,59,17475,384,97,98,104,14339,14342,14347,114,242,5037,108,97,99,59,16753,97,242,5059,256,105,114,14355,14360,115,104,116,59,27006,59,49152,55349,56626,114,97,118,101,32827,249,16633,353,14375,14385,114,256,108,114,14380,14382,187,2391,187,4227,108,107,59,25984,256,99,116,14393,14413,623,14399,0,0,14410,114,110,256,59,101,14405,14406,25372,114,187,14406,111,112,59,25359,114,105,59,26104,256,97,108,14422,14426,99,114,59,16747,32955,168,841,256,103,112,14434,14438,111,110,59,16755,102,59,49152,55349,56678,768,97,100,104,108,115,117,4427,14456,14461,4978,14481,14496,111,119,110,225,5043,97,114,112,111,111,110,256,108,114,14472,14476,101,102,244,14381,105,103,104,244,14383,105,384,59,104,108,14489,14490,14492,17349,187,5114,111,110,187,14490,112,97,114,114,111,119,115,59,25032,384,99,105,116,14512,14532,14536,623,14518,0,0,14529,114,110,256,59,101,14524,14525,25373,114,187,14525,111,112,59,25358,110,103,59,16751,114,105,59,26105,99,114,59,49152,55349,56522,384,100,105,114,14553,14557,14562,111,116,59,25328,108,100,101,59,16745,105,256,59,102,14128,14568,187,6163,256,97,109,14575,14578,114,242,14504,108,32827,252,16636,97,110,103,108,101,59,27047,1920,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,14620,14623,14633,14637,14773,14776,14781,14815,14820,14824,14835,14841,14845,14849,14880,114,242,1015,97,114,256,59,118,14630,14631,27368,59,27369,97,115,232,993,256,110,114,14642,14647,103,114,116,59,27036,896,101,107,110,112,114,115,116,13539,14662,14667,14674,14685,14692,14742,97,112,112,225,9237,111,116,104,105,110,231,7830,384,104,105,114,13547,11976,14681,111,112,244,12213,256,59,104,5047,14690,239,12685,256,105,117,14697,14701,103,109,225,13235,256,98,112,14706,14724,115,101,116,110,101,113,256,59,113,14717,14720,49152,8842,65024,59,49152,10955,65024,115,101,116,110,101,113,256,59,113,14735,14738,49152,8843,65024,59,49152,10956,65024,256,104,114,14747,14751,101,116,225,13980,105,97,110,103,108,101,256,108,114,14762,14767,101,102,116,187,2341,105,103,104,116,187,4177,121,59,17458,97,115,104,187,4150,384,101,108,114,14788,14802,14807,384,59,98,101,11754,14795,14799,97,114,59,25275,113,59,25178,108,105,112,59,25326,256,98,116,14812,5224,97,242,5225,114,59,49152,55349,56627,116,114,233,14766,115,117,256,98,112,14831,14833,187,3356,187,3417,112,102,59,49152,55349,56679,114,111,240,3835,116,114,233,14772,256,99,117,14854,14859,114,59,49152,55349,56523,256,98,112,14864,14872,110,256,69,101,14720,14870,187,14718,110,256,69,101,14738,14878,187,14736,105,103,122,97,103,59,27034,896,99,101,102,111,112,114,115,14902,14907,14934,14939,14932,14945,14954,105,114,99,59,16757,256,100,105,14912,14929,256,98,103,14917,14921,97,114,59,27231,101,256,59,113,5626,14927,59,25177,101,114,112,59,24856,114,59,49152,55349,56628,112,102,59,49152,55349,56680,256,59,101,5241,14950,97,116,232,5241,99,114,59,49152,55349,56524,2787,6030,14983,0,14987,0,14992,15003,0,0,15005,15016,15019,15023,0,0,15043,15054,0,15064,6108,6111,116,114,233,6097,114,59,49152,55349,56629,256,65,97,14996,14999,114,242,963,114,242,2550,59,17342,256,65,97,15009,15012,114,242,952,114,242,2539,97,240,10003,105,115,59,25339,384,100,112,116,6052,15029,15038,256,102,108,15034,6057,59,49152,55349,56681,105,109,229,6066,256,65,97,15047,15050,114,242,974,114,242,2561,256,99,113,15058,6072,114,59,49152,55349,56525,256,112,116,6102,15068,114,233,6100,1024,97,99,101,102,105,111,115,117,15088,15101,15112,15116,15121,15125,15131,15137,99,256,117,121,15094,15099,116,101,32827,253,16637,59,17487,256,105,121,15106,15110,114,99,59,16759,59,17483,110,32827,165,16549,114,59,49152,55349,56630,99,121,59,17495,112,102,59,49152,55349,56682,99,114,59,49152,55349,56526,256,99,109,15142,15145,121,59,17486,108,32827,255,16639,1280,97,99,100,101,102,104,105,111,115,119,15170,15176,15188,15192,15204,15209,15213,15220,15226,15232,99,117,116,101,59,16762,256,97,121,15181,15186,114,111,110,59,16766,59,17463,111,116,59,16764,256,101,116,15197,15201,116,114,230,5471,97,59,17334,114,59,49152,55349,56631,99,121,59,17462,103,114,97,114,114,59,25053,112,102,59,49152,55349,56683,99,114,59,49152,55349,56527,256,106,110,15237,15239,59,24589,106,59,24588]);var a9=new Uint16Array([512,97,103,108,113,9,21,24,27,621,15,0,0,18,112,59,16422,111,115,59,16423,116,59,16446,116,59,16444,117,111,116,59,16418]);var H0,pS=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),l9=(H0=String.fromCodePoint)!==null&&H0!==void 0?H0:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function u9(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=pS.get(t))!==null&&e!==void 0?e:t}function W0(t){return l9(u9(t))}var or;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.To_LOWER_BIT=32]="To_LOWER_BIT"})(or||(or={}));var ds;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(ds||(ds={}));function c9(t){return function(r,i){let n="",o=0,a=0;for(;(a=r.indexOf("&",a))>=0;){if(n+=r.slice(o,a),o=a,a+=1,r.charCodeAt(a)===or.NUM){let v=a+1,x=10,w=r.charCodeAt(v);(w|or.To_LOWER_BIT)===or.LOWER_X&&(x=16,a+=1,v+=1);do w=r.charCodeAt(++a);while(w>=or.ZERO&&w<=or.NINE||x===16&&(w|or.To_LOWER_BIT)>=or.LOWER_A&&(w|or.To_LOWER_BIT)<=or.LOWER_F);if(v!==a){let b=r.substring(v,a),E=parseInt(b,x);if(r.charCodeAt(a)===or.SEMI)a+=1;else if(i)continue;n+=W0(E),o=a}continue}let c=0,d=1,p=0,m=t[p];for(;a<r.length&&(p=gS(t,m,p+1,r.charCodeAt(a)),!(p<0));a++,d++){m=t[p];let v=m&ds.VALUE_LENGTH;if(v){(!i||r.charCodeAt(a)===or.SEMI)&&(c=p,d=0);let x=(v>>14)-1;if(x===0)break;p+=x}}if(c!==0){let v=(t[c]&ds.VALUE_LENGTH)>>14;n+=v===1?String.fromCharCode(t[c]&~ds.VALUE_LENGTH):v===2?String.fromCharCode(t[c+1]):String.fromCharCode(t[c+1],t[c+2]),o=a-d+1}}return n+r.slice(o)}}function gS(t,e,r,i){let n=(e&ds.BRANCH_LENGTH)>>7,o=e&ds.JUMP_TABLE;if(n===0)return o!==0&&i===o?r:-1;if(o){let d=i-o;return d<0||d>n?-1:t[r+d]-1}let a=r,c=a+n-1;for(;a<=c;){let d=a+c>>>1,p=t[d];if(p<i)a=d+1;else if(p>i)c=d-1;else return t[d+n]}return-1}var cP=c9(o9),fP=c9(a9);var yS=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),bS=String.prototype.codePointAt!=null?(t,e)=>t.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function U0(t,e){return function(i){let n,o=0,a="";for(;n=t.exec(i);)o!==n.index&&(a+=i.substring(o,n.index)),a+=e.get(n[0].charCodeAt(0)),o=n.index+1;return a+i.substring(o)}}var x1=U0(/[&<>'"]/g,yS),f9=U0(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),h9=U0(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var d9;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(d9||(d9={}));var m9;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict"})(m9||(m9={}));var p9;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(p9||(p9={}));var ju=t=>" ".repeat(t),M1=class{toString(e=0){return ju(e)+"[VNode]"}},ms=class extends M1{constructor(e){super(),this.text=e}toString(e=0){return ju(e)+this.textContent}get textContent(){return x1(this.text)}set textContent(e){this.text=e}},ko=class extends M1{constructor(e,r,i){super(),this.tag=e,this.attrs=r,this.children=i}get textContent(){return this.children.length===0?"":this.children.length===1?this.children[0].textContent:this.children.map(e=>e.textContent).join("")}set textContent(e){this.children=[new ms(e)]}toString(e=0){let r=this.toStringAttrs(),i=ju(e),n=this.toStringChildren(e),o=`${i}<${this.tag}${r}`;return n===""?`${o} />`:`${o}>${n}</${this.tag}>`}*tags(e){this.tag===e&&(yield this);for(let r of this.elementChildren())yield*r.tags(e);return null}find(e,...r){for(let i of this.tags(e)){if(i===this)continue;if(r.length===0)return i;let n=i.find(...r);if(n!=null)return n}return null}*elementChildren(){for(let e of this.children)e instanceof ko&&(yield e);return null}toStringAttrs(){let e=Object.keys(this.attrs);if(e.length===0)return"";let r="";for(let i of e){let n=this.attrs[i];n!=null&&(r+=` ${i}="${x1(n)}"`)}return r}toStringChildren(e=0){if(this.children.length===0)return"";if(this.children.length===1){let r=this.children[0];if(r instanceof ms)return r.textContent}return`
|
|
139
|
-
${this.children.map(r=>r.toString(e+1)).join(`
|
|
140
|
-
`)}
|
|
141
|
-
${ju(e)}`}};function _S(t){if(t==null)return[];if(Array.isArray(t)){let e=[];for(let r of t)if(r!=null){if(typeof r=="string"||typeof r=="number"){e.push(new ms(String(r)));continue}e.push(r)}return e}else if(typeof t=="string"||typeof t=="number")return[new ms(String(t))];return[t]}function X(t,e,r){let i=typeof e=="object"&&!Array.isArray(e);if(!i){if(r!=null)throw new Error("Invalid input");r=e}return new ko(t,i?e:{},_S(r))}var we;(function(t){t[t.UInt8=1]="UInt8",t[t.UInt16=2]="UInt16",t[t.UInt32=4]="UInt32",t[t.UInt64=8]="UInt64",t[t.Double=8]="Double",t[t.Float=4]="Float"})(we||(we={}));var y9=2**32,SS=typeof setImmediate>"u"?setTimeout:setImmediate,Dt=()=>{throw new Error("Method not implemented.")},Ct=class{constructor(){this.isLittleEndian=!0,this.delayMs=Ct.DefaultDelayMs,this.maxChunkCount=10,this.chunks=Ct.DefaultChunkCache(),this.blankFillCount=16,this.maxConcurrentRequests=50,this.toFetch=new Set,this.toFetchPromise=null,this.byteOffset=0,this.getFloat32=Dt,this.getFloat64=Dt,this.getInt8=Dt,this.getInt16=Dt,this.getInt32=Dt,this.setFloat32=Dt,this.setFloat64=Dt,this.setInt8=Dt,this.setInt16=Dt,this.setInt32=Dt,this.setUint8=Dt,this.setUint16=Dt,this.setUint32=Dt,this.setBigInt64=Dt,this.setBigUint64=Dt}static getByteRanges(e,r=32,i=16){if(e.size===0)return{chunks:[],blankFill:[]};let n=[...e.values()].sort((d,p)=>d-p),o=[],a=[];o.push(a);let c=[];for(let d=0;d<n.length;++d){let p=n[d],m=n[d-1];if(a.length>=r)a=[p],o.push(a);else if(d===0||p===m+1)a.push(p);else if(p<m+i){for(let v=m;v<p;v++)a.push(v+1),c.push(v+1);c.pop()}else a=[p],o.push(a)}return{chunks:o,blankFill:c}}async fetchData(){if(this.toFetch.size===0)return;let e=this.toFetch;this.toFetch=new Set,this.toFetchPromise=null;let r=Ct.getByteRanges(e,this.maxChunkCount,this.blankFillCount),i=[];for(let n of r.chunks){let o=n[0],a=n[n.length-1],c=o*this.chunkSize,d=a*this.chunkSize+this.chunkSize-c,p=await this.fetchBytes(c,d);if(n.length===1){i[o]=p,this.chunks.set(o,new DataView(p));continue}let m=o*this.chunkSize;for(let v of n){let x=v*this.chunkSize-m,w=p.slice(x,x+this.chunkSize);i[v]=w,this.chunks.set(v,new DataView(w))}}}async loadBytes(e,r){if(e<0)throw new Error("Offset must be positive");let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let o=i;o<=n;o++)this.chunks.has(o)||this.toFetch.add(o);if(this.toFetch.size!==0){if(this.toFetchPromise==null&&(this.toFetchPromise=new Promise(o=>SS(o,this.delayMs)).then(()=>this.fetchData())),this.toFetch.size>this.maxConcurrentRequests)throw new Error("Too many outstanding requests");await this.toFetchPromise}}getChunkId(e){return Math.floor(e/this.chunkSize)}getUint(e,r){switch(r){case we.UInt8:return this.getUint8(e);case we.UInt16:return this.getUint16(e);case we.UInt32:return this.getUint32(e);case we.UInt64:return this.getUint64(e)}}bytes(e,r){let i=this.isOneChunk(e,r);if(i){let p=this.getView(i),m=e-i*this.chunkSize;return new Uint8Array(p.buffer.slice(m,m+r))}let n=new Uint8Array(r),o=e+r,a=Math.floor(e/this.chunkSize),c=Math.ceil((e+r)/this.chunkSize)-1,d=0;for(let p=a;p<=c;p++){let m=e+d,v=p*this.chunkSize,x=this.getView(p),w=Math.min(o,v+this.chunkSize),b=x.buffer.slice(m-v,w-v);n.set(new Uint8Array(b),d),d+=b.byteLength}return n}getView(e){let r=this.chunks.get(e);if(r==null)throw new Error(`Chunk:${e} is not ready`);return r}isOneChunk(e,r){let i=e+r-1,n=Math.floor(e/this.chunkSize);return Math.floor(i/this.chunkSize)-n<1?n:null}hasBytes(e,r=1){let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let o=i;o<=n;o++)if(!this.chunks.has(o))return!1;return!0}toRange(e,r){if(r==null)return`bytes=${e}`;if(e<0)throw new Error("Cannot read from remote source with negative offset and length");return`bytes=${e}-${e+r}`}parseContentRange(e){let[r,i]=e.split(" ");if(r!=="bytes")throw new Error("Failed to parse content-range: "+e);if(i==null)throw new Error("Failed to parse content-range: "+e);let[,n]=i.split("/"),o=Number(n);if(isNaN(o))throw new Error("Failed to parse content-range: "+e);return o}get buffer(){throw new Error("Method not implemented.")}get byteLength(){if(this._byteLength)return this._byteLength;throw Error(".size() has not been fetched.")}getUint8(e){let r=Math.floor(e/this.chunkSize),i=this.chunks.get(r);if(i==null)throw new Error(`Chunk:${r} is not ready`);return i.getUint8(e-r*this.chunkSize)}getUint16(e){let r=this.isOneChunk(e,we.UInt16);if(r!=null)return this.getView(r).getUint16(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint8(e),n=this.getUint8(e+we.UInt8);return this.isLittleEndian?i+(n<<8):(i<<8)+n}getUint32(e){let r=this.isOneChunk(e,we.UInt32);if(r!=null)return this.getView(r).getUint32(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint16(e),n=this.getUint16(e+we.UInt16);return this.isLittleEndian?i+n*65536:i*65536+n}getUint64(e){let r=this.isOneChunk(e,we.UInt64);if(r!=null){let o=this.getView(r);return Number(o.getBigUint64(e-r*this.chunkSize,this.isLittleEndian))}let i=this.getUint32(e),n=this.getUint32(e+we.UInt32);return this.isLittleEndian?i+n*y9:i*y9+n}getBigUint64(e){let r=this.isOneChunk(e,we.UInt64);if(r!=null)return this.getView(r).getBigUint64(e-r*this.chunkSize,this.isLittleEndian);let i=BigInt(this.getUint32(e)),n=BigInt(this.getUint32(e+we.UInt32));return this.isLittleEndian?i+(n<<BigInt(32)):(i<<BigInt(32))+n}getBigInt64(){throw new Error("Not implemented.")}};Ct.DefaultChunkCache=()=>new Map;Ct.DefaultDelayMs=1;var ut=class extends Error{constructor(e,r,i){super(e),this.name="CompositeError",this.code=r,this.reason=i}static isCompositeError(e){return typeof e!="object"||e==null?!1:e.name==="CompositeError"}};function Ai(t){return typeof t=="object"&&t!==null}function Yt(t){let e=t.split("/"),r=e[0];if(r==null||r==="")return null;r.endsWith(":")&&(r=r.slice(0,r.length-1));let i=e[2];if(i==null||i.trim()==="")return null;if(e.length===3)return{protocol:r,bucket:i};let n=e.slice(3).join("/");return n==null||n.trim()===""?{protocol:r,bucket:i}:{key:n,bucket:i,protocol:r}}var MS=/\/$/,ES=/^\//;function J0(t,e){return t.replace(MS,"")+"/"+e.replace(ES,"")}function b9(t,...e){let r=t;for(let i=0;i<e.length;i++)r=J0(r,e[i]);return r}async function v9(t){let e=[];for await(let r of t)e.push(r);return e}var Z0;(function(t){t.aerial="aerial"})(Z0||(Z0={}));var je;(function(t){t.Imagery="im",t.TileSet="ts",t.Provider="pv",t.ImageryRule="ir",t.Style="st",t.ConfigBundle="cb"})(je||(je={}));var w9=new Set(Object.values(je));var ps=class{},gs=class{constructor(e){this.prefix=e}isWriteable(){return!1}id(e){return e.startsWith(`${this.prefix}_`)?e:`${this.prefix}_${e}`}is(e){return e!=null&&e.id.startsWith(this.prefix)}},_r={prefix(t,e){return e===""||e.startsWith(t)?e:`${t}_${e}`},getPrefix(t){let e=t.indexOf("_");if(e===-1)return null;let r=t.slice(0,e);return w9.has(r)?r:null},unprefix(t,e){return e.startsWith(t)?e.slice(3):e}};async function ys(t,e,r){let i=new Set;for(let n of r)for(let o of e){let a=o[n.code];a&&i.add(t.Imagery.id(a))}return t.Imagery.getAll(i)}var it;(function(t){t.Raster="raster",t.Vector="vector"})(it||(it={}));var _9=me(require("aws-sdk/clients/dynamodb.js"),1);var No=me(require("aws-sdk/clients/dynamodb.js"),1);function RS(t){return{id:{S:t}}}var vn=class extends gs{constructor(e,r){super(r),this.cfg=e}ensureId(e){if(e.startsWith(this.prefix+"_"))return e;throw new Error(`Trying to query "${e}" expected prefix of ${this.prefix}`)}get db(){return this.cfg.dynamo}isWriteable(){return!0}clone(e){return No.default.Converter.unmarshall(No.default.Converter.marshall(e))}async get(e){let r=await this.db.getItem({Key:{id:{S:this.ensureId(e)}},TableName:this.cfg.tableName}).promise();if(r==null||r.Item==null)return null;let i=No.default.Converter.unmarshall(r.Item);return this.is(i)?i:null}async getAll(e){var r;let i=[];for(let o of e)i.push(RS(this.ensureId(o)));let n=new Map;for(;i.length>0;){let o=i.length>100?i.slice(0,100):i;i=i.length>100?i.slice(100):[];let a={[this.cfg.tableName]:{Keys:o}};for(;a!=null&&Object.keys(a).length>0;){let c=await this.db.batchGetItem({RequestItems:a}).promise(),d=(r=c.Responses)===null||r===void 0?void 0:r[this.cfg.tableName];if(d==null)throw new Error("Failed to fetch from "+this.cfg.tableName);for(let p of d){let m=No.default.Converter.unmarshall(p);this.is(m)&&n.set(m.id,m)}a=c.UnprocessedKeys}}return n}async put(e){return e.updatedAt=Date.now(),await this.db.putItem({TableName:this.cfg.tableName,Item:No.default.Converter.marshall(e)}).promise(),e.id}};var Bo=class extends vn{constructor(){super(...arguments),this.cache=new Map}async get(e){let r=this.ensureId(e),i=this.cache.get(r);if(i==null){if(i=await super.get(r),i==null)return null;this.cache.set(r,i)}return i}async getAll(e){let r=new Map,i=new Set;for(let n of e){let o=this.ensureId(n),a=this.cache.get(o);a==null?i.add(o):r.set(o,a)}if(i.size>0){let n=await super.getAll(i);for(let o of n.values())r.set(o.id,o),this.cache.set(o.id,o)}return r}};var E1=class extends ps{constructor(e){super(),this.Prefix=je,this.type="dynamo",this.Imagery=new Bo(this,je.Imagery),this.Style=new Bo(this,je.Style),this.TileSet=new vn(this,je.TileSet),this.Provider=new Bo(this,je.Provider),this.ConfigBundle=new vn(this,je.ConfigBundle),this.dynamo=new _9.default({region:"ap-southeast-2"}),this.tableName=e}record(){let e=Date.now();return{id:"",name:"",updatedAt:e}}};var Se=class{constructor(e,r,i,n){this.x=e,this.y=r,this.width=i,this.height=n}get bottom(){return this.y+this.height}get right(){return this.x+this.width}intersects(e){return this.x<e.right&&e.x<this.right&&this.y<e.bottom&&e.y<this.bottom}containsBounds(e){return Se.contains(this,e)}intersection(e){let r=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return i>r&&o>n?new Se(r,n,i-r,o-n):null}static union(e){if(e.length===0)throw new Error("Union on empty list is not allowed");let{x:r,y:i}=e[0],n=r+e[0].width,o=i+e[0].height;for(let a=1;a<e.length;++a){let c=e[a];r=Math.min(r,c.x),n=Math.max(n,c.x+c.width),i=Math.min(i,c.y),o=Math.max(o,c.y+c.height)}return new Se(r,i,n-r,o-i)}union(e){return Se.union([this,e])}toJson(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toBbox(){return[this.x,this.y,this.right,this.bottom]}toPolygon(){return[[[this.x,this.y],[this.x,this.bottom],[this.right,this.bottom],[this.right,this.y],[this.x,this.y]]]}scale(e,r=e){return new Se(this.x*e,this.y*r,this.width*e,this.height*r)}scaleFromCenter(e,r=e){let i=this.width*e,n=this.height*r;return new Se(this.x-.5*(i-this.width),this.y-.5*(n-this.height),i,n)}pad(e,r=e){return new Se(this.x-e,this.y-r,this.width+e*2,this.height+r*2)}round(e=0){let r=Math.round(this.x-e),i=Math.round(this.y-e);return new Se(r,i,Math.round(this.right+e)-r,Math.round(this.bottom+e)-i)}add(e){return new Se(this.x+e.x,this.y+e.y,this.width,this.height)}subtract(e){return new Se(this.x-e.x,this.y-e.y,this.width,this.height)}static fromMultiPolygon(e){if(e.length===0)return new Se(0,0,0,0);let r=e[0][0][0][0],i=e[0][0][0][1],n=r,o=i;for(let[a]of e)for(let[c,d]of a)c<r?r=c:c>n&&(n=c),d<i?i=d:d>o&&(o=d);return new Se(r,i,n-r,o-i)}static fromBbox([e,r,i,n]){return new Se(Math.min(e,i),Math.min(r,n),Math.abs(i-e),Math.abs(n-r))}static fromUpperLeftLowerRight(e,r){return new Se(e.x,e.y,r.x-e.x,r.y-e.y)}static fromJson(e){return new Se(e.x,e.y,e.width,e.height)}static compareArea(e,r){let i=e.width*e.height-r.width*r.height;if(i!==0)return i;let n=e.x-r.x;return n===0?e.y-r.y:n}static contains(e,r){return e.x<=r.x&&e.x+e.width>=r.x+r.width&&e.y<=r.y&&e.y+e.height>=r.y+r.height}};var Ue;(function(t){t[t.Google=3857]="Google",t[t.Wgs84=4326]="Wgs84",t[t.Nztm2000=2193]="Nztm2000",t[t.Citm2000=3793]="Citm2000"})(Ue||(Ue={}));var Y0={google:Ue.Google,epsg3857:Ue.Google,[Ue.Google]:Ue.Google,globalmercator:Ue.Google,wgs84:Ue.Wgs84,epsg4326:Ue.Wgs84,[Ue.Wgs84]:Ue.Wgs84,nztm:Ue.Nztm2000,epsg2193:Ue.Nztm2000,[Ue.Nztm2000]:Ue.Nztm2000,nztm2000:Ue.Nztm2000,citm:Ue.Citm2000,epsg3793:Ue.Citm2000,[Ue.Citm2000]:Ue.Citm2000,citm2000:Ue.Citm2000},Re=class{constructor(e){if(this.code=e,Re.Codes.has(e))throw new Error(`Duplicate EPSG code created: ${e}`);Re.Codes.set(this.code,this)}toString(){return this.code.toString()}toJSON(){return this.code}toEpsgString(){return`EPSG:${this.code}`}toUrn(){return`urn:ogc:def:crs:EPSG::${this.code}`}static get(e){let r=Re.Codes.get(e);if(r==null)throw new Error(`Invalid EPSG:${e}`);return r}static tryGet(e){if(e!=null)return Re.Codes.get(e)}static parseCode(e){var r;return e.startsWith("urn:")?Y0[e.slice(e.lastIndexOf(":")+1)]:e.startsWith("https://")?Y0[e.slice(e.lastIndexOf("/")+1)]:(r=Y0[e.replace(/[\W_]/g,"").toLowerCase()])!==null&&r!==void 0?r:null}static parse(e){let r=Re.parseCode(e);return r==null?null:Re.get(r)}};Re.Codes=new Map;Re.Google=new Re(Ue.Google);Re.Wgs84=new Re(Ue.Wgs84);Re.Nztm2000=new Re(Ue.Nztm2000);Re.Citm2000=new Re(Ue.Citm2000);var aO="0".charCodeAt(0),lO="1".charCodeAt(0),uO="2".charCodeAt(0),cO="3".charCodeAt(0);var Do;(function(t){t[t.Xy=0]="Xy",t[t.Yx=1]="Yx"})(Do||(Do={}));function S9(t){return t===Re.Nztm2000?Do.Yx:Do.Xy}function CS(t,e){return e.scaleDenominator-t.scaleDenominator}var At=class{constructor(e){this.zooms=[],this.indexX=0,this.indexY=1,this.zoomConversionMap=new Map,this.def=e,this.tileSize=e.tileMatrix[0].tileHeight;let r=e.tileMatrix.slice().sort(CS),i={};for(let p of r){if(i[p.identifier])throw new Error(`Duplicate tileMatrix identifier ${p.identifier}`);if(p.tileHeight!==p.tileWidth)throw new Error("Only square tiles supported");if(p.tileHeight!==this.tileSize)throw new Error("All tiles must have the same tile size");i[p.identifier]=!0}this.zooms=r;let n=Re.parse(e.supportedCRS);if(n==null)throw new Error(`Unable to find supported projection ${e.supportedCRS}`);this.projection=n,S9(this.projection)===Do.Yx&&(this.indexX=1,this.indexY=0);let{lowerCorner:o,upperCorner:a}=e.boundingBox,c=o[this.indexX],d=o[this.indexY];this.extent=new Se(c,d,a[this.indexX]-c,a[this.indexY]-d)}get maxZoom(){return this.zooms.length-1}get identifier(){return this.def.identifier}pixelScale(e){let r=this.zooms[e];if(r==null)throw new Error(`Zoom not found :${e}`);return r.scaleDenominator*28e-5}tileToPixels(e,r){return{x:e*this.tileSize,y:r*this.tileSize}}pixelsToTile(e,r,i){let n=Math.floor(e/this.tileSize),o=Math.floor(r/this.tileSize);return{x:n,y:o,z:i}}sourceToPixels(e,r,i){let n=this.zooms[i],o=this.pixelScale(i),a=(e-n.topLeftCorner[this.indexX])/o,c=(n.topLeftCorner[this.indexY]-r)/o;return{x:a,y:c}}pixelsToSource(e,r,i){let n=this.zooms[i],o=this.pixelScale(i),a=n.topLeftCorner[this.indexX]+e*o,c=n.topLeftCorner[this.indexY]-r*o;return{x:a,y:c}}tileToSource(e){let r=this.tileToPixels(e.x,e.y);return this.pixelsToSource(r.x,r.y,e.z)}tileToSourceBounds(e){let r=this.tileToSource(e),i=this.pixelScale(e.z)*this.tileSize;return new Se(r.x,r.y-i,i,i)}*topLevelTiles(){let{matrixWidth:r,matrixHeight:i}=this.zooms[0];for(let n=0;n<i;++n)for(let o=0;o<r;++o)yield{x:o,y:n,z:0};return null}*coverTile(e){if(e==null)return yield*this.topLevelTiles(),null;let r=e.z+1,{matrixWidth:i,matrixHeight:n}=this.zooms[e.z],{matrixWidth:o,matrixHeight:a}=this.zooms[r],c=o/i,d=a/n,p=Math.floor(e.x*c),m=Math.floor(e.y*d),v=Math.ceil((e.x+1)*c),x=Math.ceil((e.y+1)*d);for(let w=m;w<x;++w)for(let b=p;b<v;++b)yield{x:b,y:w,z:r};return null}static tileToName(e){return`${e.z}-${e.x}-${e.y}`}static nameToTile(e){let r=e.split("-");if(r.length===3){let i=Number(r[0]),n=Number(r[1]),o=Number(r[2]);if(!(isNaN(i)||isNaN(o)||isNaN(n)))return{x:n,y:o,z:i}}throw new Error(`Invalid tile name '${e}'`)}findBestZoom(e){let r=this.zoomConversionMap.get(e);return r==null&&(r=this.convertZoomLevel(e),this.zoomConversionMap.set(e,r)),r}convertZoomLevel(e){for(let r=0;r<this.zooms.length;r++){let i=this.zooms[r].scaleDenominator-e;if(i>1e-5)continue;if(r===0)return r;let n=this.zooms[r-1].scaleDenominator-e;return Math.abs(i)<n?r:r-1}return this.maxZoom}static convertZoomLevel(e,r,i,n=!0){return r.identifier===i.identifier||(e>=r.maxZoom&&(e=r.maxZoom),n&&e===0)?e:n&&e===r.maxZoom?i.maxZoom:i.findBestZoom(r.zooms[e].scaleDenominator)}};var R1={Version:"1.0.0-beta.2",License:"CC BY 4.0",BaseMapsExtension:"https://basemaps.linz.govt.nz/json-schema/stac-basemaps-extension/1.0/schema.json"};var AS={type:"TileMatrixSetType",title:"Google Maps Compatible for the World",identifier:"WebMercatorQuad",boundingBox:{type:"BoundingBoxType",crs:"http://www.opengis.net/def/crs/EPSG/0/3857",lowerCorner:[-200375083427892e-7,-200375083427892e-7],upperCorner:[200375083427892e-7,200375083427892e-7]},supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/3857",wellKnownScaleSet:"https://www.opengis.net/def/wkss/OGC/1.0/GoogleMapsCompatible",tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:559082264028717e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:279541132014358e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:139770566007179e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:698852830035897e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:349426415017948e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:174713207508974e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:873566037544871e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:436783018772435e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:218391509386217e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:109195754693108e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:545978.773465544,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:272989.386732772,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:136494.693366386,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:68247.346683193,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:34123.6733415964,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:17061.8366707982,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:8530.91833539913,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:4265.45916769956,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:2132.72958384978,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:1066.36479192489,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:533.182395962445,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:266.591197981222,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152},{type:"TileMatrixType",identifier:"22",scaleDenominator:133.295598990611,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4194304,matrixHeight:4194304},{type:"TileMatrixType",identifier:"23",scaleDenominator:66.6477994953056,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8388608,matrixHeight:8388608},{type:"TileMatrixType",identifier:"24",scaleDenominator:33.3238997476528,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16777216,matrixHeight:16777216}]},Ie=new At(AS);var qu=me(E9(),1),Hu=new At(qu.Nztm2000),wn=new At(qu.Nztm2000Quad);var ar={All:[Ie,Hu,wn],Defaults:new Map([[Re.Google.code,Ie],[Re.Nztm2000.code,Hu]]),get(t){let e=this.tryGet(t);if(e==null)throw new Error("Failed to lookup TileMatrixSet: "+t);return e},tryGet(t){var e,r;return t==null?null:typeof t=="number"?(e=this.Defaults.get(t))!==null&&e!==void 0?e:null:(r=this.Defaults.get(t.code))!==null&&r!==void 0?r:null},find(t,e=!0){if(t==null)return null;let r=Re.parse(t);if(r!=null)return ar.tryGet(r);if(e){for(let i of ar.All)if(i.identifier===t)return i;return null}for(let i of ar.All)if(i.identifier.toLowerCase()===t.toLowerCase())return i;return null}};var Le;(function(t){t.Png="png",t.Jpeg="jpeg",t.Webp="webp",t.Avif="avif"})(Le||(Le={}));var lr;(function(t){t.MapboxVectorTiles="pbf"})(lr||(lr={}));var Uu=me(Lo(),1);function OS(t){if(!t.endsWith("m")||!t.includes("-"))return null;let e=Number(t.replace("-",".").slice(0,t.length-1));return isNaN(e)?null:String(e)+"m"}function IS(t){let e=t.split("-");return e.length!==2||e[0].length!==4?null:e[1].length===4?t:e[1].length===2?`${e[0]}-${e[0].slice(0,2)}${e[1]}`:null}var LS=[OS,IS];function ai(t){let e=new Set(t.split("_"));e.delete("RGB"),e.delete("RGBI"),e.delete("RGBA");let r=[];for(let i of e){let n=!1;for(let o of LS){let a=o(i);if(a!=null){n=!0,r.push(a);break}}n||r.push(i)}return r.join("-")}var P9=require("crypto");var A9=me(C9(),1),T9="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",jo=(0,A9.default)(T9),NS=new Set(T9);function Wu(t){for(let e=0;e<t.length;e++)if(!NS.has(t.charAt(e)))return!1;return!0}function Ti(t){return jo.encode((0,P9.createHash)("sha256").update(t).digest())}function BS(t){return _r.getPrefix(t.id)===je.Imagery}function DS(t){return _r.getPrefix(t.id)===je.TileSet}function zS(t){return!(typeof t!="object"||t==null||Array.isArray(t))}function O9(t){if(!!zS(t))for(let e of Object.keys(t))t[e]===void 0&&delete t[e]}var Pi=class extends ps{constructor(){super(...arguments),this.type="memory",this.Imagery=new bs(this,je.Imagery),this.Style=new bs(this,je.Style),this.TileSet=new bs(this,je.TileSet),this.Provider=new bs(this,je.Provider),this.ConfigBundle=new bs(this,je.ConfigBundle),this.objects=new Map}put(e){this.objects.set(e.id,e)}toJson(){let e={id:"",hash:"",assets:this.assets,imagery:[],style:[],provider:[],tileSet:[]};for(let r of this.objects.values()){let i=r.id.slice(0,r.id.indexOf("_"));switch(delete r.updatedAt,i){case je.Imagery:e.imagery.push(r);break;case je.Style:e.style.push(r);break;case je.Provider:e.provider.push(r);break;case je.TileSet:e.tileSet.push(r);break;default:throw new Error("Unable to parse configuration id: "+r.id)}}return e.hash=Ti(JSON.stringify(e)),e.id=_r.prefix(je.ConfigBundle,(0,Uu.ulid)()),e}createVirtualTileSets(){for(let e of this.objects.values())if(DS(e)&&e.name==="aerial")for(let r of e.layers)this.imageryToChildTileSet(e,r,Ue.Nztm2000),this.imageryToChildTileSet(e,r,Ue.Google);else BS(e)&&(this.put(Pi.imageryToTileSet(e)),this.imageryToTileSetByName(e))}imageryToTileSetByName(e){let r=ai(e.name),i=_r.prefix(je.TileSet,r),n=this.objects.get(i);return n==null&&(n={type:it.Raster,id:i,title:e.title,category:e.category,name:r,format:Le.Webp,layers:[{name:r,minZoom:0,maxZoom:32}],background:{r:0,g:0,b:0,alpha:0},updatedAt:Date.now()},O9(n),this.put(n)),n.layers[0][e.projection]=e.id,n}static imageryToTileSet(e){return{type:it.Raster,id:_r.prefix(je.TileSet,_r.unprefix(je.Imagery,e.id)),name:e.name,title:e.title,format:Le.Webp,layers:[{[e.projection]:e.id,name:e.name,minZoom:0,maxZoom:32,title:e.title}],background:{r:0,g:0,b:0,alpha:0},updatedAt:Date.now()}}imageryToChildTileSet(e,r,i){var n;let o=r[i];if(o==null)return;let a=this.objects.get(o);if(a==null)return;let c=e.name+":"+a.name,d=_r.prefix(je.TileSet,c),p=this.objects.get(d);p==null&&(p={type:it.Raster,id:d,title:r.title,category:(n=r.category)!==null&&n!==void 0?n:a.category,name:ai(a.name),format:Le.Webp,layers:[{name:c,minZoom:0,maxZoom:32}],background:{r:0,g:0,b:0,alpha:0},updatedAt:Date.now()},O9(p),this.put(p)),p.layers[0][a.projection]=a.id}static fromJson(e){if(e.id==null||_r.getPrefix(e.id)!==je.ConfigBundle)throw new Error("Provided configuration file is not a basemaps config bundle.");let r=(0,Uu.decodeTime)(_r.unprefix(je.ConfigBundle,e.id)),i=new Pi;for(let n of e.tileSet)i.put(n);for(let n of e.style)i.put(n);for(let n of e.provider)i.put(n);for(let n of e.imagery)i.put(n);for(let n of i.objects.values())n.updatedAt=r;return i.assets=e.assets,i}},bs=class extends gs{constructor(e,r){super(r),this.cfg=e}async get(e){let r=this.cfg.objects.get(this.id(e));return this.is(r)?r:null}async getAll(e){let r=new Map;for(let i of e){let n=await this.get(i);n!=null&&r.set(i,n)}return r}};function C1(t){if(t==="")return 0;let e=parseInt(t,16);if(isNaN(e))throw new Error("Invalid hex byte: "+t);return e}function Gu(t){if(t.startsWith("0x")?t=t.slice(2):t.startsWith("#")&&(t=t.slice(1)),t.length!==6&&t.length!==8)throw new Error("Invalid hex color: "+t);return{r:C1(t.substr(0,2)),g:C1(t.substr(2,2)),b:C1(t.substr(4,2)),alpha:C1(t.substr(6,2))}}var Oi=me(require("fs"),1),Ku=me(require("path"),1);var X0=require("fs"),Vu=require("path"),_n=class extends Ct{constructor(e){super(),this.type="file",this.protocol="file",this.chunkSize=_n.DefaultChunkSize,this.fd=null,this.closeAfterRead=!1,this.fileName=e}static isSource(e){return e.type==="file"}async close(){let e=await this.fd;e!=null&&(await e.close(),this.fd=null)}get uri(){return(0,Vu.resolve)(this.fileName)}get name(){return(0,Vu.basename)(this.fileName)}get size(){return this._size?this._size:(this._size=Promise.resolve().then(async()=>(await X0.promises.stat(this.fileName)).size),this._size)}async fetchBytes(e,r){if(e<0&&r!=null)throw new Error("Cannot fetch negative offsets with length");if(e<0&&(r=Math.abs(e),e=await this.size+e),r==null)throw new Error("Length is required for reading from files");this.fd==null&&(this.fd=X0.promises.open(this.fileName,"r"));let i=await this.fd,{buffer:n}=await i.read(Buffer.allocUnsafe(r),0,r,e);return this.closeAfterRead&&await this.close(),n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}};_n.DefaultChunkSize=16*1024;function A1(t,e){return Ai(t)?t.code==="ENOENT"?new ut(e,404,t):t.code==="EACCES"?new ut(e,403,t):new ut(e,500,t):new ut(e,500,t)}var Ii=class{constructor(){this.protocol=Ii.protocol}static is(e){return e.protocol===Ii.protocol}source(e){return new _n(e)}async*list(e,r){try{let i=await Oi.default.promises.readdir(e,{withFileTypes:!0}),n=Ku.default.resolve(e);for(let o of i){let a=Ku.default.join(n,o.name);o.isDirectory()&&r?.recursive!==!1?yield*this.list(a):yield a}}catch(i){throw A1(i,`Failed to list: ${e}`)}}async*details(e,r){for await(let i of this.list(e,r)){let n=await this.head(i);n!=null&&(yield n)}}async head(e){try{let r=await Oi.default.promises.stat(e);return{path:e,size:r.size,isDirectory:r.isDirectory()}}catch(r){if(Ai(r)&&r.code==="ENOENT")return null;throw A1(r,`Failed to stat: ${e}`)}}async read(e){try{return await Oi.default.promises.readFile(e)}catch(r){throw A1(r,`Failed to read: ${e}`)}}async write(e,r){let i=Ku.default.dirname(e);await Oi.default.promises.mkdir(i,{recursive:!0});try{if(Buffer.isBuffer(r)||typeof r=="string")await Oi.default.promises.writeFile(e,r);else{let n=Oi.default.createWriteStream(e);await new Promise((o,a)=>{n.on("finish",o),n.on("error",a),r.pipe(n)})}}catch(n){throw A1(n,`Failed to write: ${e}`)}}async delete(e){try{return await Oi.default.promises.unlink(e)}catch(r){throw A1(r,`Failed to read: ${e}`)}}stream(e){return Oi.default.createReadStream(e)}};Ii.protocol="file";var hg=me(require("http"),1),dg=me(require("https"),1),Ms=me(require("zlib"),1),cr=me(require("stream"),1),z1=require("buffer");function jS(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),i="",n=!1,o=r[0]||"text/plain",a=o;for(let m=1;m<r.length;m++)r[m]==="base64"?n=!0:(a+=`;${r[m]}`,r[m].indexOf("charset=")===0&&(i=r[m].substring(8)));!r[0]&&!i.length&&(a+=";charset=US-ASCII",i="US-ASCII");let c=n?"base64":"ascii",d=unescape(t.substring(e+1)),p=Buffer.from(d,c);return p.type=o,p.typeFull=a,p.charset=i,p}var I9=jS;var xr=me(require("stream"),1),Bi=require("util"),ur=require("buffer");P1();Yu();var Ni=class extends Error{constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var Xt=class extends Ni{constructor(e,r,i){super(e,r),i&&(this.code=this.errno=i.code,this.erroredSysCall=i.syscall)}};var Xu=Symbol.toStringTag,rd=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[Xu]==="URLSearchParams",k1=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[Xu]),H9=t=>typeof t=="object"&&(t[Xu]==="AbortSignal"||t[Xu]==="EventTarget"),W9=(t,e)=>{let r=new URL(e).hostname,i=new URL(t).hostname;return r===i||r.endsWith(`.${i}`)};var ex=(0,Bi.promisify)(xr.default.pipeline),Qt=Symbol("Body internals"),ui=class{constructor(e,{size:r=0}={}){let i=null;e===null?e=null:rd(e)?e=ur.Buffer.from(e.toString()):k1(e)||ur.Buffer.isBuffer(e)||(Bi.types.isAnyArrayBuffer(e)?e=ur.Buffer.from(e):ArrayBuffer.isView(e)?e=ur.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof xr.default||(e instanceof ws?(e=q9(e),i=e.type.split("=")[1]):e=ur.Buffer.from(String(e))));let n=e;ur.Buffer.isBuffer(e)?n=xr.default.Readable.from(e):k1(e)&&(n=xr.default.Readable.from(e.stream())),this[Qt]={body:e,stream:n,boundary:i,disturbed:!1,error:null},this.size=r,e instanceof xr.default&&e.on("error",o=>{let a=o instanceof Ni?o:new Xt(`Invalid response body while trying to fetch ${this.url}: ${o.message}`,"system",o);this[Qt].error=a})}get body(){return this[Qt].stream}get bodyUsed(){return this[Qt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:i}=await tc(this);return e.slice(r,r+i)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let i=new ws,n=new URLSearchParams(await this.text());for(let[o,a]of n)i.append(o,a);return i}let{toFormData:r}=await Promise.resolve().then(()=>(Y9(),Z9));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Qt].body&&this[Qt].body.type||"",r=await this.arrayBuffer();return new ki([r],{type:e})}async json(){let e=await tc(this);return JSON.parse(e.toString())}async text(){return(await tc(this)).toString()}buffer(){return tc(this)}};ui.prototype.buffer=(0,Bi.deprecate)(ui.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(ui.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,Bi.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function tc(t){if(t[Qt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Qt].disturbed=!0,t[Qt].error)throw t[Qt].error;let{body:e}=t;if(e===null)return ur.Buffer.alloc(0);if(!(e instanceof xr.default))return ur.Buffer.alloc(0);let r=[],i=0;try{for await(let n of e){if(t.size>0&&i+n.length>t.size){let o=new Xt(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(o),o}i+=n.length,r.push(n)}}catch(n){throw n instanceof Ni?n:new Xt(`Invalid response body while trying to fetch ${t.url}: ${n.message}`,"system",n)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(n=>typeof n=="string")?ur.Buffer.from(r.join("")):ur.Buffer.concat(r,i)}catch(n){throw new Xt(`Could not create Buffer from response body for ${t.url}: ${n.message}`,"system",n)}else throw new Xt(`Premature close of server response while trying to fetch ${t.url}`)}var Ho=(t,e)=>{let r,i,{body:n}=t[Qt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof xr.default&&typeof n.getBoundary!="function"&&(r=new xr.PassThrough({highWaterMark:e}),i=new xr.PassThrough({highWaterMark:e}),n.pipe(r),n.pipe(i),t[Qt].stream=r,n=i),n},tx=(0,Bi.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),rc=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":rd(t)?"application/x-www-form-urlencoded;charset=UTF-8":k1(t)?t.type||null:ur.Buffer.isBuffer(t)||Bi.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof ws?`multipart/form-data; boundary=${e[Qt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${tx(t)}`:t instanceof xr.default?null:"text/plain;charset=UTF-8",X9=t=>{let{body:e}=t[Qt];return e===null?0:k1(e)?e.size:ur.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},Q9=async(t,{body:e})=>{e===null?t.end():await ex(e,t)};var od=require("util"),D1=me(require("http"),1),ic=typeof D1.default.validateHeaderName=="function"?D1.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},ad=typeof D1.default.validateHeaderValue=="function"?D1.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},er=class extends URLSearchParams{constructor(e){let r=[];if(e instanceof er){let i=e.raw();for(let[n,o]of Object.entries(i))r.push(...o.map(a=>[n,a]))}else if(e!=null)if(typeof e=="object"&&!od.types.isBoxedPrimitive(e)){let i=e[Symbol.iterator];if(i==null)r.push(...Object.entries(e));else{if(typeof i!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(n=>{if(typeof n!="object"||od.types.isBoxedPrimitive(n))throw new TypeError("Each header pair must be an iterable object");return[...n]}).map(n=>{if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...n]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([i,n])=>(ic(i),ad(i,String(n)),[String(i).toLowerCase(),String(n)])):void 0,super(r),new Proxy(this,{get(i,n,o){switch(n){case"append":case"set":return(a,c)=>(ic(a),ad(a,String(c)),URLSearchParams.prototype[n].call(i,String(a).toLowerCase(),String(c)));case"delete":case"has":case"getAll":return a=>(ic(a),URLSearchParams.prototype[n].call(i,String(a).toLowerCase()));case"keys":return()=>(i.sort(),new Set(URLSearchParams.prototype.keys.call(i)).keys());default:return Reflect.get(i,n,o)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let i=r.join(", ");return/^content-encoding$/i.test(e)&&(i=i.toLowerCase()),i}forEach(e,r=void 0){for(let i of this.keys())Reflect.apply(e,r,[this.get(i),i,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let i=this.getAll(r);return r==="host"?e[r]=i[0]:e[r]=i.length>1?i:i[0],e},{})}};Object.defineProperties(er.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));function eg(t=[]){return new er(t.reduce((e,r,i,n)=>(i%2===0&&e.push(n.slice(i,i+2)),e),[]).filter(([e,r])=>{try{return ic(e),ad(e,String(r)),!0}catch{return!1}}))}var rx=new Set([301,302,303,307,308]),nc=t=>rx.has(t);var qr=Symbol("Response internals"),Tt=class extends ui{constructor(e=null,r={}){super(e,r);let i=r.status!=null?r.status:200,n=new er(r.headers);if(e!==null&&!n.has("Content-Type")){let o=rc(e,this);o&&n.append("Content-Type",o)}this[qr]={type:"default",url:r.url,status:i,statusText:r.statusText||"",headers:n,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[qr].type}get url(){return this[qr].url||""}get status(){return this[qr].status}get ok(){return this[qr].status>=200&&this[qr].status<300}get redirected(){return this[qr].counter>0}get statusText(){return this[qr].statusText}get headers(){return this[qr].headers}get highWaterMark(){return this[qr].highWaterMark}clone(){return new Tt(Ho(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!nc(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new Tt(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new Tt(null,{status:0,statusText:""});return e[qr].type="error",e}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Tt.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});var ug=require("url"),cg=require("util");var tg=t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""};var ig=require("net");function rg(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}var ng=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),sg="strict-origin-when-cross-origin";function og(t){if(!ng.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function ix(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,ig.isIP)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:/^(.+\.)*localhost$/.test(t.host)?!1:t.protocol==="file:"}function Wo(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:ix(t)}function ag(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let i=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let n=t.referrer,o=rg(n),a=rg(n,!0);o.toString().length>4096&&(o=a),e&&(o=e(o)),r&&(a=r(a));let c=new URL(t.url);switch(i){case"no-referrer":return"no-referrer";case"origin":return a;case"unsafe-url":return o;case"strict-origin":return Wo(o)&&!Wo(c)?"no-referrer":a.toString();case"strict-origin-when-cross-origin":return o.origin===c.origin?o:Wo(o)&&!Wo(c)?"no-referrer":a;case"same-origin":return o.origin===c.origin?o:"no-referrer";case"origin-when-cross-origin":return o.origin===c.origin?o:a;case"no-referrer-when-downgrade":return Wo(o)&&!Wo(c)?"no-referrer":o;default:throw new TypeError(`Invalid referrerPolicy: ${i}`)}}function lg(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let i of e)i&&ng.has(i)&&(r=i);return r}var yt=Symbol("Request internals"),sc=t=>typeof t=="object"&&typeof t[yt]=="object",nx=(0,cg.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Di=class extends ui{constructor(e,r={}){let i;if(sc(e)?i=new URL(e.url):(i=new URL(e),e={}),i.username!==""||i.password!=="")throw new TypeError(`${i} is an url with embedded credentails.`);let n=r.method||e.method||"GET";if(n=n.toUpperCase(),"data"in r&&nx(),(r.body!=null||sc(e)&&e.body!==null)&&(n==="GET"||n==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let o=r.body?r.body:sc(e)&&e.body!==null?Ho(e):null;super(o,{size:r.size||e.size||0});let a=new er(r.headers||e.headers||{});if(o!==null&&!a.has("Content-Type")){let p=rc(o,this);p&&a.set("Content-Type",p)}let c=sc(e)?e.signal:null;if("signal"in r&&(c=r.signal),c!=null&&!H9(c))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let d=r.referrer==null?e.referrer:r.referrer;if(d==="")d="no-referrer";else if(d){let p=new URL(d);d=/^about:(\/\/)?client$/.test(p)?"client":p}else d=void 0;this[yt]={method:n,redirect:r.redirect||e.redirect||"follow",headers:a,parsedURL:i,signal:c,referrer:d},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[yt].method}get url(){return(0,ug.format)(this[yt].parsedURL)}get headers(){return this[yt].headers}get redirect(){return this[yt].redirect}get signal(){return this[yt].signal}get referrer(){if(this[yt].referrer==="no-referrer")return"";if(this[yt].referrer==="client")return"about:client";if(this[yt].referrer)return this[yt].referrer.toString()}get referrerPolicy(){return this[yt].referrerPolicy}set referrerPolicy(e){this[yt].referrerPolicy=og(e)}clone(){return new Di(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Di.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});var fg=t=>{let{parsedURL:e}=t[yt],r=new er(t[yt].headers);r.has("Accept")||r.set("Accept","*/*");let i=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(i="0"),t.body!==null){let c=X9(t);typeof c=="number"&&!Number.isNaN(c)&&(i=String(c))}i&&r.set("Content-Length",i),t.referrerPolicy===""&&(t.referrerPolicy=sg),t.referrer&&t.referrer!=="no-referrer"?t[yt].referrer=ag(t):t[yt].referrer="no-referrer",t[yt].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate,br");let{agent:n}=t;typeof n=="function"&&(n=n(e)),!r.has("Connection")&&!n&&r.set("Connection","close");let o=tg(e),a={path:e.pathname+o,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:n};return{parsedURL:e,options:a}};var oc=class extends Ni{constructor(e,r="aborted"){super(e,r)}};Yu();nd();var sx=new Set(["data:","http:","https:"]);async function ac(t,e){return new Promise((r,i)=>{let n=new Di(t,e),{parsedURL:o,options:a}=fg(n);if(!sx.has(o.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${o.protocol.replace(/:$/,"")}" is not supported.`);if(o.protocol==="data:"){let b=I9(n.url),E=new Tt(b,{headers:{"Content-Type":b.typeFull}});r(E);return}let c=(o.protocol==="https:"?dg.default:hg.default).request,{signal:d}=n,p=null,m=()=>{let b=new oc("The operation was aborted.");i(b),n.body&&n.body instanceof cr.default.Readable&&n.body.destroy(b),!(!p||!p.body)&&p.body.emit("error",b)};if(d&&d.aborted){m();return}let v=()=>{m(),w()},x=c(o.toString(),a);d&&d.addEventListener("abort",v);let w=()=>{x.abort(),d&&d.removeEventListener("abort",v)};x.on("error",b=>{i(new Xt(`request to ${n.url} failed, reason: ${b.message}`,"system",b)),w()}),ox(x,b=>{p.body.destroy(b)}),process.version<"v14"&&x.on("socket",b=>{let E;b.prependListener("end",()=>{E=b._eventsCount}),b.prependListener("close",A=>{if(p&&E<b._eventsCount&&!A){let C=new Error("Premature close");C.code="ERR_STREAM_PREMATURE_CLOSE",p.body.emit("error",C)}})}),x.on("response",b=>{x.setTimeout(0);let E=eg(b.rawHeaders);if(nc(b.statusCode)){let k=E.get("Location"),z=null;try{z=k===null?null:new URL(k,n.url)}catch{if(n.redirect!=="manual"){i(new Xt(`uri requested responds with an invalid redirect URL: ${k}`,"invalid-redirect")),w();return}}switch(n.redirect){case"error":i(new Xt(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,"no-redirect")),w();return;case"manual":break;case"follow":{if(z===null)break;if(n.counter>=n.follow){i(new Xt(`maximum redirect reached at: ${n.url}`,"max-redirect")),w();return}let U={headers:new er(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:Ho(n),signal:n.signal,size:n.size,referrer:n.referrer,referrerPolicy:n.referrerPolicy};if(!W9(n.url,z))for(let ie of["authorization","www-authenticate","cookie","cookie2"])U.headers.delete(ie);if(b.statusCode!==303&&n.body&&e.body instanceof cr.default.Readable){i(new Xt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),w();return}(b.statusCode===303||(b.statusCode===301||b.statusCode===302)&&n.method==="POST")&&(U.method="GET",U.body=void 0,U.headers.delete("content-length"));let Z=lg(E);Z&&(U.referrerPolicy=Z),r(ac(new Di(z,U))),w();return}default:return i(new TypeError(`Redirect option '${n.redirect}' is not a valid value of RequestRedirect`))}}d&&b.once("end",()=>{d.removeEventListener("abort",v)});let A=(0,cr.pipeline)(b,new cr.PassThrough,k=>{k&&i(k)});process.version<"v12.10"&&b.on("aborted",v);let C={url:n.url,status:b.statusCode,statusText:b.statusMessage,headers:E,size:n.size,counter:n.counter,highWaterMark:n.highWaterMark},P=E.get("Content-Encoding");if(!n.compress||n.method==="HEAD"||P===null||b.statusCode===204||b.statusCode===304){p=new Tt(A,C),r(p);return}let L={flush:Ms.default.Z_SYNC_FLUSH,finishFlush:Ms.default.Z_SYNC_FLUSH};if(P==="gzip"||P==="x-gzip"){A=(0,cr.pipeline)(A,Ms.default.createGunzip(L),k=>{k&&i(k)}),p=new Tt(A,C),r(p);return}if(P==="deflate"||P==="x-deflate"){let k=(0,cr.pipeline)(b,new cr.PassThrough,z=>{z&&i(z)});k.once("data",z=>{(z[0]&15)===8?A=(0,cr.pipeline)(A,Ms.default.createInflate(),U=>{U&&i(U)}):A=(0,cr.pipeline)(A,Ms.default.createInflateRaw(),U=>{U&&i(U)}),p=new Tt(A,C),r(p)}),k.once("end",()=>{p||(p=new Tt(A,C),r(p))});return}if(P==="br"){A=(0,cr.pipeline)(A,Ms.default.createBrotliDecompress(),k=>{k&&i(k)}),p=new Tt(A,C),r(p);return}p=new Tt(A,C),r(p)}),Q9(x,n).catch(i)})}function ox(t,e){let r=z1.Buffer.from(`0\r
|
|
142
|
-
\r
|
|
143
|
-
`),i=!1,n=!1,o;t.on("response",a=>{let{headers:c}=a;i=c["transfer-encoding"]==="chunked"&&!c["content-length"]}),t.on("socket",a=>{let c=()=>{if(i&&!n){let d=new Error("Premature close");d.code="ERR_STREAM_PREMATURE_CLOSE",e(d)}};a.prependListener("close",c),t.on("abort",()=>{a.removeListener("close",c)}),a.on("data",d=>{n=z1.Buffer.compare(d.slice(-5),r)===0,!n&&o&&(n=z1.Buffer.compare(o.slice(-3),r.slice(0,3))===0&&z1.Buffer.compare(d.slice(-2),r.slice(3))===0),o=d})})}var zt=class extends Ct{constructor(e){super(),this.type="url",this.protocol="http",this.chunkSize=zt.DefaultChunkSize,this.uri=e}static isSource(e){return e.type==="url"}get size(){return this._size?this._size:(this._size=Promise.resolve().then(async()=>{let e=await zt.fetch(this.uri,{method:"HEAD"});return Number(e.headers.get("content-length"))}),this._size)}async fetchBytes(e,r){let n={Range:this.toRange(e,r)},o=await zt.fetch(this.uri,{headers:n});if(o.ok){let a=o.headers.get("content-range");return this._size==null&&a!=null&&(this._size=Promise.resolve(this.parseContentRange(a))),o.arrayBuffer()}throw new Error("Failed to fetch")}};zt.DefaultChunkSize=32*1024;zt.fetch=(t,e)=>fetch(t,e);function mg(t,e){return Ai(t)?t.code==="ENOENT"?new ut(e,404,t):t.code==="EACCES"?new ut(e,403,t):new ut(e,500,t):new ut(e,500,t)}var zi=class{constructor(){this.protocol=zi.protocol}static is(e){return e.protocol===zi.protocol}source(e){return new zt(e)}async*list(e){throw new Error(`Unable to "list" on ${e}`)}async*details(e){throw new Error(`Unable to "details" on ${e}`)}async head(e){let r=await zt.fetch(e,{method:"HEAD"});if(!r.ok)throw mg(new Error(r.statusText),`Failed to head: ${e}`);return{path:e,size:Number(r.headers.get("content-length")),isDirectory:!1}}async read(e){let r=await zt.fetch(e,{method:"GET"});if(!r.ok)throw mg(new Error(r.statusText),`Failed to head: ${e}`);return Buffer.from(await r.arrayBuffer())}async write(e){throw new Error(`Unable to "write" on ${e}`)}async delete(e){throw new Error(`Unable to "delete" on ${e}`)}stream(e){throw new Error(`Unable to "stream" on ${e}`)}};zi.protocol="http";zt.fetch=ac;function ax(t){return typeof t!="object"||t==null?!1:t.constructor===Object}var lc=class{constructor(){this.protocol="abstract",this.isOrdered=!0,this.systems=[],this.toArray=v9,this.join=J0,this.joinAll=b9}register(e,r,i="rw"){for(let n=0;n<this.systems.length;n++){let o=this.systems[n];if(o.path===e&&o.flag===i){this.systems.splice(n,1,{path:e,system:r,flag:i});return}}this.systems.push({path:e,system:r,flag:i}),this.isOrdered=!1}read(e){return this.get(e,"r").read(e)}async readJson(e){let r=await this.read(e);return JSON.parse(r.toString())}stream(e){return this.get(e,"r").stream(e)}write(e,r,i){if(Array.isArray(r)||ax(r)){let n=JSON.stringify(r,null,2);return this.get(e,"rw").write(e,n,{contentType:"application/json",...i})}return this.get(e,"rw").write(e,r,i)}delete(e){return this.get(e,"rw").delete(e)}list(e,r){return this.get(e,"r").list(e,r)}details(e,r){return this.get(e,"r").details(e,r)}exists(e){return this.get(e,"r").head(e).then(r=>r!=null)}head(e){return this.get(e,"r").head(e)}source(e){return this.get(e,"r").source(e)}sortSystems(){this.isOrdered||(this.systems.sort((e,r)=>r.path.length-e.path.length),this.isOrdered=!0)}get(e,r){this.sortSystems();for(let i of this.systems)if(e.startsWith(i.path)){if(r==="rw"&&i.flag==="r")continue;return i.system}throw new Error(`Unable to find file system for path:${e}`)}},xt=new lc;var pg=new Ii;xt.register("",pg);xt.register("file://",pg);var gg=new zi;xt.register("http://",gg);xt.register("https://",gg);var Fe=class{constructor(e){this.name=e}raw(e,r=0){return this.parse(e,{offset:r,startOffset:0})}read(e,r=0){let i={offset:r,startOffset:r};return{value:this.parse(e,i),offset:i.offset}}refine(e){return new ld(this,e)}},ld=class extends Fe{constructor(e,r){super("Function:"+e.name),this.input=e,this.cb=r}get size(){return this.input.size}parse(e,r){let i=this.input.parse(e,r);return this.cb(i,e,r)}};var uc=class extends Fe{constructor(e,r,i){super(`Array:${e}:${r.name}x${i}`),this.count=i,this.type=r}get size(){return this.count*this.type.size}parse(e,r){let i=[];for(let n=0;n<this.count;n++)i.push(this.type.parse(e,r));return i}},cc=class extends Fe{constructor(e,r,i,n){super("Array:Offset:"+e),this.isLookupRequired=!0,this.isMaxLength=n,this.lengthName=i,this.type=r}get size(){throw new Error("Unable to calculate size of dynamic object: "+this.name)}parse(e,r,i){let n=[],o=i?.[this.lengthName];if(o==null||typeof o!="number")throw new Error(`${this.name}: Missing variable a "${this.lengthName}"`);this.isMaxLength&&(o-=r.offset-r.startOffset);for(let a=0;a<o;a++)n.push(this.type.parse(e,r));return n}};var yg=[];for(let t=0;t<64;t++)yg[t]=Math.pow(2,t);var j1=class{constructor(e,r=0,i=e.length,n=!0){if(this.buffer=e,this.offset=r*8,this.maxOffset=i*8,this.isLittleEndian=n,!this.isLittleEndian)throw new Error("BigEndian is not supported")}get remainingBits(){return this.maxOffset-this.offset}getBitValue(e,r,i){return(e&((1<<r+i)-1&~((1<<r)-1)))>>r}skip(e){this.offset+=e}bit(){if(this.remainingBits<0)throw new Error("BitStream: Overflow "+this.remainingBits);let e=Math.floor(this.offset/8),r=this.offset%8,i=this.buffer[e];return this.offset++,this.getBitValue(i,r,1)}bool(){return this.bit()===1}bits(e){let r=e,i=0;for(;e>0;)this.bit()===1&&(i+=yg[r-e]),e--;return i}string(e){let r=[];e==null&&(e=Math.floor(this.remainingBits/8));for(let i=0;i<e;i++){let n=this.bits(8);if(n===0)break;r.push(String.fromCharCode(n))}return r.join("")}};var fc=class extends Fe{constructor(e,r){super("Bits:"+e);let i=0;this.fields=Object.keys(r).map(n=>{let o=r[n];return i+=o,{key:n,bits:o}}),this.size=Math.ceil(i/8)}parse(e,r){let i=r.offset,n={},o=new j1(e,i,i+this.size);for(let{key:a,bits:c}of this.fields)n[a]=o.bits(c);return r.offset+=this.size,n}},hc=class extends Fe{constructor(e,r,i){super("BitsFlags:"+e),this.type=r,this.fields=Object.entries(i)}get size(){return this.type.size}parse(e,r){let i=this.type.parse(e,r),n={};for(let[o,a]of this.fields){let c=(i&a)===a;c&&(n[o]=c)}return n}};var dc=class extends Fe{constructor(e){super("Bytes:"+e),this.size=e}parse(e,r){let i=e.slice(r.offset,r.offset+this.size);return r.offset+=this.size,i}};var ud=class extends Fe{constructor(){super(...arguments),this.size=1}parse(e,r){let i=r.offset;return r.offset+=this.size,e[i]}},cd=class extends Fe{constructor(){super(...arguments),this.size=2}parse(e,r){let i=r.offset,n=e[i++],o=e[i++]<<8;return r.offset+=2,n|o}},fd=class extends Fe{constructor(){super(...arguments),this.size=4}parse(e,r){let i=r.offset,n=e[i++],o=e[i++]<<8,a=e[i++]<<16,c=e[i++]*16777216;return r.offset=i,(n|o|a)+c}},lx=2**32,hd=class extends Fe{constructor(){super(...arguments),this.size=8}parse(e,r){let i=Uo.parse(e,r),n=Uo.parse(e,r);return i+n*lx}},dd=class extends Fe{constructor(){super(...arguments),this.size=8}parse(e,r){let i=BigInt(Uo.parse(e,r)),n=BigInt(Uo.parse(e,r));return i+(n<<BigInt(32))}},bg=new ud("UInt8"),vg=new cd("LUInt16"),Uo=new fd("LUInt32"),wg=new hd("LUInt64"),_g=new dd("BigLUInt64");var mc=class extends Fe{constructor(e,r,i){super("Lookup:"+e),this.lookup=i,this.type=r}get size(){return this.type.size}parse(e,r){let i=this.type.parse(e,r),n=this.lookup(i);if(n==null)throw new Error(`${this.name}: Failed to lookup ${i}`);return{id:i,name:n}}},pc=class extends Fe{constructor(e,r,i){super("Enum:"+e),this.enumeration=i,this.type=r}get size(){return this.type.size}parse(e,r){let i=this.type.parse(e,r),n=this.enumeration[i];if(n==null)throw new Error(`${this.name}: Failed to lookup ${i}`);return{id:i,name:n}}};var Go=class extends Fe{constructor(e,r){super(e),this._size=-1,this.fields=[];for(let[i,n]of Object.entries(r))this.fields.push({key:i,parser:n})}get size(){if(this._size>-1)return this._size;let e=0;for(let r of this.fields)e+=r.parser.size;return this._size=e,this._size}parse(e,r){let i={};for(let n of this.fields)i[n.key]=n.parser.parse(e,r,i);return i}},gc=class extends Fe{constructor(e,r){super(e),this.fields=[],this._size=-1;let i=Object.entries(r),n=!1;for(let[o,a]of i)a.isLookupRequired&&(n=!0),this.fields.push({key:o,parser:a});i.length!==0&&(n?this.generateObjectAssign():this.generateSingleObject())}generateSingleObject(){let e=[],r='"use strict"; return {';for(let n=0;n<this.fields.length;n++)e.push(this.fields[n].parser),r+=` ${JSON.stringify(this.fields[n].key)}: _bp[${n}].parse(buf, ctx),`;r+=" };";let i=new Function("_bp","buf","ctx",r);this.parse=i.bind(null,e)}generateObjectAssign(){let e=[],r=`"use strict"; const ret = {};
|
|
144
|
-
`;for(let n=0;n<this.fields.length;n++)e.push(this.fields[n].parser),r+=`ret[${JSON.stringify(this.fields[n].key)}] = _bp[${n}].parse(buf, ctx, ret)
|
|
145
|
-
`;r+="return ret";let i=new Function("_bp","buf","ctx",r);this.parse=i.bind(null,e)}get size(){if(this._size>-1)return this._size;let e=0;for(let r of this.fields)e+=r.parser.size;return this._size=e,this._size}parse(e,r){return{}}};function Vo(t,e=2){return"0x"+t.toString(16).padStart(e,"0")}var yc=class extends Fe{constructor(e,r){super("Offset:"+e.name+":"+r.name),this.type=r,this.offset=e}get size(){return this.type.size}parse(e,r){let i=this.offset.parse(e,r);if(i>e.length||i<0)throw new Error(`[${this.name}]: BufferOverflow attempted read at ${Vo(i)}`);return this.type.parse(e,{offset:i,startOffset:i})}};var bc=class extends Fe{constructor(e){super("Skip:"+e),this.size=e}parse(e,r){r.offset+=this.size}};var vc=class extends Fe{constructor(){super("String")}get size(){throw new Error("Unable to calculate size from dynamic object")}parse(e,r){let i=r.offset,n=[],o=0;for(;o+i<e.length;){let a=e[i+o];if(a===0)break;n.push(String.fromCharCode(a)),o++}return r.offset+=o+1,n.join("")}},wc=class extends Fe{constructor(e){super("String:"+e),this.size=e}parse(e,r){let i=r.offset;if(this.size+i>e.length)throw new Error(`BufferOverflow: ${this.name} offset: ${Vo(r.offset)}`);let n=[],o=0;for(;o<this.size;){let a=e[i+o];if(a===0)break;n.push(String.fromCharCode(a)),o++}return r.offset+=this.size,n.join("")}};function ux(t,e,r,i){return typeof r=="number"?new uc(t,e,r):new cc(t,e,r,i??!1)}var fr={u8:bg,lu16:vg,lu32:Uo,lu64:wg,blu64:_g,empty:new Go("Empty",{}),offset(t,e){return new yc(t,e)},string(t){return t==null?new vc:new wc(t)},bits(t,e){return new fc(t,e)},flags(t,e,r){return new hc(t,e,r)},object(t,e){return new gc(t,e)},static(t,e){return new Go(t,e)},lookup(t,e,r){return new mc(t,e,r)},enum(t,e,r){return new pc(t,e,r)},bytes(t){return new dc(t)},skip(t){return new bc(t)},array:ux};var Sg;(function(t){t[t.File="0".charCodeAt(0)]="File",t[t.HardLink="1".charCodeAt(0)]="HardLink",t[t.SymLink="2".charCodeAt(0)]="SymLink",t[t.CharDeviceNode="3".charCodeAt(0)]="CharDeviceNode",t[t.BlockDeviceNode="4".charCodeAt(0)]="BlockDeviceNode",t[t.Directory="5".charCodeAt(0)]="Directory",t[t.FifoNode="6".charCodeAt(0)]="FifoNode",t[t.Reserved="7".charCodeAt(0)]="Reserved",t[t.LongName="L".charCodeAt(0)]="LongName",t[t.LongLink="K".charCodeAt(0)]="LongLink"})(Sg||(Sg={}));var cx=fr.object("TarHeader",{path:fr.string(100),skip1:fr.skip(24),size:fr.bytes(12).refine(t=>parseInt(t.toString(),8)),skip2:fr.skip(20),type:fr.u8,linkName:fr.string(100)});var xg={32:16777619n,64:1099511628211n,128:309485009821345068724781371n,256:374144419156711147060143317175368453031918731002211n,512:35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759n,1024:5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573n},fx={32:2166136261n,64:14695981039346656037n,128:144066263297769815596495629667062367629n,256:100029257958052580907070968620625704837092796014241193945225284501741471925557n,512:9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785n,1024:14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915n};function md(t,{size:e=32}={}){if(!xg[e])throw new Error("The `size` option must be one of 32, 64, 128, 256, 512, or 1024");let r=fx[e],i=xg[e],n=!1;for(let o=0;o<t.length;o++){let a=t.charCodeAt(o);a>127&&!n&&(t=unescape(encodeURIComponent(t)),a=t.charCodeAt(o),n=!0),r^=BigInt(a),r=BigInt.asUintN(e,r*i)}return r}var _c="COT";var hx=BigInt(0),dx=BigInt(32),mx=BigInt(2**32-1),Mg=fr.object("CotarMetadata",{magic:fr.string(_c.length),version:fr.u8,count:fr.lu32}),Hr=class{constructor(e,r,i=0){this.isHeader=!0,this.source=e,this.sourceOffset=i,this.metadata=r}static hash(e){return md(e,{size:64})}static async loadMetadata(e,r,i){if(i){await e.loadBytes(r,e.chunkSize);let o=e.bytes(r,8);return Mg.read(o).value}let n=await e.fetchBytes(-8);return Mg.read(new Uint8Array(n)).value}static async getMetadata(e,r,i){let n=await this.loadMetadata(e,r,i);if(n.magic!==_c)throw new Error(`Invalid source: ${e.uri} invalid magic found: ${n.magic}`);if(n.version===1||n.version===2)return n;throw new Error(`Invalid source: ${e.uri} invalid version found: ${n.version}`)}static async create(e,r=0,i=!0){let n=await this.getMetadata(e,r,i);return new Hr(e,n,r)}async find(e){if(this.metadata.version===1)return this._findV1(e);if(this.metadata.version===2)return this._findV2(e);throw new Error("Invalid metadata version")}async _findV2(e){let r=Hr.hash(e),i=this.metadata.count,n=Number(r%BigInt(i)),o=Number(r>>dx),a=Number(r&mx),c=null,d=null,p=n;for(;;){let m=this.sourceOffset+p*16+8;if(await this.source.loadBytes(m,16),d=this.source.getUint32(m),c=this.source.getUint32(m+4),c===o&&d===a){let v=this.source.getUint32(m+8)*512,x=this.source.getUint32(m+12);return{offset:v,size:x}}if(c===0&&d===0||(p++,p>=i&&(p=0),p===n))return null}}async _findV1(e){let r=Hr.hash(e),i=this.metadata.count,n=Number(r%BigInt(i)),o=null,a=n;for(;;){let c=this.sourceOffset+a*24+8;if(await this.source.loadBytes(c,24),o=this.source.getBigUint64(c),o===r){let d=this.source.getUint64(c+8),p=this.source.getUint64(c+16);return{offset:d,size:p}}if(o===hx||(a++,a>=i&&(a=0),a===n))return null}}};var Ok=BigInt(0);var xn=class{constructor(e,r){this.source=e,this.index=r}static async fromTar(e){let r=await Hr.getMetadata(e,0,!1),i=await e.size,n=r.version===1?24:16,o=i-(r.count*n+16),a=new Hr(e,r,o);return new xn(e,a)}async get(e){let r=await this.index.find(e);return r==null?null:(await this.source.loadBytes(r.offset,r.size),this.source.bytes(r.offset,r.size))}};var mM=me(Lo(),1);var Qe;(function(t){function e(i){throw new Error}t.assertNever=e,t.arrayToEnum=i=>{let n={};for(let o of i)n[o]=o;return n},t.getValidEnumValues=i=>{let n=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of n)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(n){return i[n]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&n.push(o);return n},t.find=(i,n)=>{for(let o of i)if(n(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,n=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}t.joinValues=r})(Qe||(Qe={}));var ee=Qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Mn=t=>{switch(typeof t){case"undefined":return ee.undefined;case"string":return ee.string;case"number":return isNaN(t)?ee.nan:ee.number;case"boolean":return ee.boolean;case"function":return ee.function;case"bigint":return ee.bigint;case"object":return Array.isArray(t)?ee.array:t===null?ee.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ee.promise:typeof Map<"u"&&t instanceof Map?ee.map:typeof Set<"u"&&t instanceof Set?ee.set:typeof Date<"u"&&t instanceof Date?ee.date:ee.object;default:return ee.unknown}},Q=Qe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of"]),gx=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Wr=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(o){return o.message},i={_errors:[]},n=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let c=i,d=0;for(;d<a.path.length;){let p=a.path[d];d===a.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(r(a))):c[p]=c[p]||{_errors:[]},c=c[p],d++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,null,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Wr.create=t=>new Wr(t);var q1=(t,e)=>{let r;switch(t.code){case Q.invalid_type:t.received===ee.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected)}`;break;case Q.unrecognized_keys:r=`Unrecognized key(s) in object: ${Qe.joinValues(t.keys,", ")}`;break;case Q.invalid_union:r="Invalid input";break;case Q.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Qe.joinValues(t.options)}`;break;case Q.invalid_enum_value:r=`Invalid enum value. Expected ${Qe.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:r="Invalid function arguments";break;case Q.invalid_return_type:r="Invalid function return type";break;case Q.invalid_date:r="Invalid date";break;case Q.invalid_string:t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Q.too_small:t.type==="array"?r=`Array must contain ${t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be greater than ${t.inclusive?"or equal to ":""}${t.minimum}`:r="Invalid input";break;case Q.too_big:t.type==="array"?r=`Array must contain ${t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be less than ${t.inclusive?"or equal to ":""}${t.maximum}`:r="Invalid input";break;case Q.custom:r="Invalid input";break;case Q.invalid_intersection_types:r="Intersection results could not be merged";break;case Q.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;default:r=e.defaultError,Qe.assertNever(t)}return{message:r}},H1=q1,yx=t=>{H1=t},xc=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,o=[...r,...n.path||[]],a={...n,path:o},c="",d=i.filter(p=>!!p).slice().reverse();for(let p of d)c=p(a,{data:e,defaultError:c}).message;return{...n,path:o,message:n.message||c}},bx=[];function le(t,e){let r=xc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,H1,q1].filter(i=>!!i)});t.common.issues.push(r)}var Pt=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return pe;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return Pt.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),(typeof a.value<"u"||n.alwaysSet)&&(i[o.value]=a.value)}return{status:e.value,value:i}}},pe=Object.freeze({status:"aborted"}),vx=t=>({status:"dirty",value:t}),jt=t=>({status:"valid",value:t}),pd=t=>t.status==="aborted",gd=t=>t.status==="dirty",Mc=t=>t.status==="valid",yd=t=>typeof Promise!==void 0&&t instanceof Promise,Ve;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ve||(Ve={}));var Er=class{constructor(e,r,i,n){this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._path.concat(this._key)}},Rg=(t,e)=>{if(Mc(e))return{success:!0,data:e.value};{if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new Wr(t.common.issues);return{success:!1,error:r}}};function Ce(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,c)=>a.code!=="invalid_type"?{message:c.defaultError}:typeof c.data>"u"&&i?{message:i}:t.invalid_type_error?{message:t.invalid_type_error}:{message:c.defaultError},description:n}}var xe=class{constructor(e){this.spa=this.safeParseAsync,this.superRefine=this._refinement,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Mn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Mn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Pt,ctx:{common:e.parent.common,data:e.data,parsedType:Mn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(yd(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Mn(e)},o=this._parseSync({data:e,path:n.path,parent:n});return Rg(n,o)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Mn(e)},n=this._parse({data:e,path:[],parent:i}),o=await(yd(n)?n:Promise.resolve(n));return Rg(i,o)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,o)=>{let a=e(n),c=()=>o.addIssue({code:Q.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(d=>d?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new Ar({schema:this,typeName:de.ZodEffects,effect:{type:"refinement",refinement:e}})}optional(){return Mr.create(this)}nullable(){return qi.create(this)}nullish(){return this.optional().nullable()}array(){return Rr.create(this)}promise(){return Rn.create(this)}or(e){return Es.create([this,e])}and(e){return Rs.create(this,e)}transform(e){return new Ar({schema:this,typeName:de.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new W1({innerType:this,defaultValue:r,typeName:de.ZodDefault})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wx=/^c[^\s-]{8,}$/i,_x=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,Sx=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,fi=class extends xe{constructor(){super(...arguments),this._regex=(e,r,i)=>this.refinement(n=>e.test(n),{validation:r,code:Q.invalid_string,...Ve.errToObj(i)}),this.nonempty=e=>this.min(1,Ve.errToObj(e)),this.trim=()=>new fi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._getType(e)!==ee.string){let o=this._getOrReturnCtx(e);return le(o,{code:Q.invalid_type,expected:ee.string,received:o.parsedType}),pe}let i=new Pt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:Q.too_small,minimum:o.value,type:"string",inclusive:!0,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:Q.too_big,maximum:o.value,type:"string",inclusive:!0,message:o.message}),i.dirty());else if(o.kind==="email")Sx.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"email",code:Q.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")_x.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"uuid",code:Q.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")wx.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"cuid",code:Q.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),le(n,{validation:"url",code:Q.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"regex",code:Q.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():Qe.assertNever(o);return{status:i.value,value:e.data}}_addCheck(e){return new fi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ve.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ve.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ve.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ve.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Ve.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Ve.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Ve.errToObj(r)})}length(e,r){return this.min(e,r).max(e,r)}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=-1/0;return this._def.checks.map(r=>{r.kind==="min"&&(e===null||r.value>e)&&(e=r.value)}),e}get maxLength(){let e=null;return this._def.checks.map(r=>{r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}),e}};fi.create=t=>new fi({checks:[],typeName:de.ZodString,...Ce(t)});function xx(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,o=parseInt(t.toFixed(n).replace(".","")),a=parseInt(e.toFixed(n).replace(".",""));return o%a/Math.pow(10,n)}var ji=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._getType(e)!==ee.number){let o=this._getOrReturnCtx(e);return le(o,{code:Q.invalid_type,expected:ee.number,received:o.parsedType}),pe}let i,n=new Pt;for(let o of this._def.checks)o.kind==="int"?Qe.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),le(i,{code:Q.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),le(i,{code:Q.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),le(i,{code:Q.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?xx(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),le(i,{code:Q.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):Qe.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Ve.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Ve.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Ve.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Ve.toString(r))}setLimit(e,r,i,n){return new ji({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:Ve.toString(n)}]})}_addCheck(e){return new ji({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ve.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ve.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ve.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ve.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ve.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Ve.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};ji.create=t=>new ji({checks:[],typeName:de.ZodNumber,...Ce(t)});var Jo=class extends xe{_parse(e){if(this._getType(e)!==ee.bigint){let i=this._getOrReturnCtx(e);return le(i,{code:Q.invalid_type,expected:ee.bigint,received:i.parsedType}),pe}return jt(e.data)}};Jo.create=t=>new Jo({typeName:de.ZodBigInt,...Ce(t)});var Zo=class extends xe{_parse(e){if(this._getType(e)!==ee.boolean){let i=this._getOrReturnCtx(e);return le(i,{code:Q.invalid_type,expected:ee.boolean,received:i.parsedType}),pe}return jt(e.data)}};Zo.create=t=>new Zo({typeName:de.ZodBoolean,...Ce(t)});var Yo=class extends xe{_parse(e){if(this._getType(e)!==ee.date){let i=this._getOrReturnCtx(e);return le(i,{code:Q.invalid_type,expected:ee.date,received:i.parsedType}),pe}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return le(i,{code:Q.invalid_date}),pe}return{status:"valid",value:new Date(e.data.getTime())}}};Yo.create=t=>new Yo({typeName:de.ZodDate,...Ce(t)});var Xo=class extends xe{_parse(e){if(this._getType(e)!==ee.undefined){let i=this._getOrReturnCtx(e);return le(i,{code:Q.invalid_type,expected:ee.undefined,received:i.parsedType}),pe}return jt(e.data)}};Xo.create=t=>new Xo({typeName:de.ZodUndefined,...Ce(t)});var Qo=class extends xe{_parse(e){if(this._getType(e)!==ee.null){let i=this._getOrReturnCtx(e);return le(i,{code:Q.invalid_type,expected:ee.null,received:i.parsedType}),pe}return jt(e.data)}};Qo.create=t=>new Qo({typeName:de.ZodNull,...Ce(t)});var En=class extends xe{constructor(){super(...arguments),this._any=!0}_parse(e){return jt(e.data)}};En.create=t=>new En({typeName:de.ZodAny,...Ce(t)});var ci=class extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jt(e.data)}};ci.create=t=>new ci({typeName:de.ZodUnknown,...Ce(t)});var hi=class extends xe{_parse(e){let r=this._getOrReturnCtx(e);return le(r,{code:Q.invalid_type,expected:ee.never,received:r.parsedType}),pe}};hi.create=t=>new hi({typeName:de.ZodNever,...Ce(t)});var ea=class extends xe{_parse(e){if(this._getType(e)!==ee.undefined){let i=this._getOrReturnCtx(e);return le(i,{code:Q.invalid_type,expected:ee.void,received:i.parsedType}),pe}return jt(e.data)}};ea.create=t=>new ea({typeName:de.ZodVoid,...Ce(t)});var Rr=class extends xe{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==ee.array)return le(r,{code:Q.invalid_type,expected:ee.array,received:r.parsedType}),pe;if(n.minLength!==null&&r.data.length<n.minLength.value&&(le(r,{code:Q.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(le(r,{code:Q.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all(r.data.map((a,c)=>n.type._parseAsync(new Er(r,a,r.path,c)))).then(a=>Pt.mergeArray(i,a));let o=r.data.map((a,c)=>n.type._parseSync(new Er(r,a,r.path,c)));return Pt.mergeArray(i,o)}get element(){return this._def.type}min(e,r){return new Rr({...this._def,minLength:{value:e,message:Ve.toString(r)}})}max(e,r){return new Rr({...this._def,maxLength:{value:e,message:Ve.toString(r)}})}length(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Rr.create=(t,e)=>new Rr({type:t,minLength:null,maxLength:null,typeName:de.ZodArray,...Ce(e)});var Ec;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ec||(Ec={}));var Cg=t=>e=>new Ze({...t,shape:()=>({...t.shape(),...e})});function Ko(t){if(t instanceof Ze){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=Mr.create(Ko(i))}return new Ze({...t._def,shape:()=>e})}else return t instanceof Rr?Rr.create(Ko(t.element)):t instanceof Mr?Mr.create(Ko(t.unwrap())):t instanceof qi?qi.create(Ko(t.unwrap())):t instanceof Cr?Cr.create(t.items.map(e=>Ko(e))):t}var Ze=class extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=Cg(this._def),this.extend=Cg(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Qe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ee.object){let p=this._getOrReturnCtx(e);return le(p,{code:Q.invalid_type,expected:ee.object,received:p.parsedType}),pe}let{status:i,ctx:n}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),c=[];for(let p in n.data)a.includes(p)||c.push(p);let d=[];for(let p of a){let m=o[p],v=n.data[p];d.push({key:{status:"valid",value:p},value:m._parse(new Er(n,v,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof hi){let p=this._def.unknownKeys;if(p==="passthrough")for(let m of c)d.push({key:{status:"valid",value:m},value:{status:"valid",value:n.data[m]}});else if(p==="strict")c.length>0&&(le(n,{code:Q.unrecognized_keys,keys:c}),i.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let m of c){let v=n.data[m];d.push({key:{status:"valid",value:m},value:p._parse(new Er(n,v,n.path,m)),alwaysSet:m in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let p=[];for(let m of d){let v=await m.key;p.push({key:v,value:await m.value,alwaysSet:m.alwaysSet})}return p}).then(p=>Pt.mergeObjectSync(i,p)):Pt.mergeObjectSync(i,d)}get shape(){return this._def.shape()}strict(e){return Ve.errToObj,new Ze({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,o,a,c;let d=(a=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,r,i).message)!==null&&a!==void 0?a:i.defaultError;return r.code==="unrecognized_keys"?{message:(c=Ve.errToObj(e).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new Ze({...this._def,unknownKeys:"strip"})}passthrough(){return new Ze({...this._def,unknownKeys:"passthrough"})}setKey(e,r){return this.augment({[e]:r})}merge(e){return new Ze({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Ec.mergeShapes(this._def.shape(),e._def.shape()),typeName:de.ZodObject})}catchall(e){return new Ze({...this._def,catchall:e})}pick(e){let r={};return Qe.objectKeys(e).map(i=>{this.shape[i]&&(r[i]=this.shape[i])}),new Ze({...this._def,shape:()=>r})}omit(e){let r={};return Qe.objectKeys(this.shape).map(i=>{Qe.objectKeys(e).indexOf(i)===-1&&(r[i]=this.shape[i])}),new Ze({...this._def,shape:()=>r})}deepPartial(){return Ko(this)}partial(e){let r={};if(e)return Qe.objectKeys(this.shape).map(i=>{Qe.objectKeys(e).indexOf(i)===-1?r[i]=this.shape[i]:r[i]=this.shape[i].optional()}),new Ze({...this._def,shape:()=>r});for(let i in this.shape){let n=this.shape[i];r[i]=n.optional()}return new Ze({...this._def,shape:()=>r})}required(){let e={};for(let r in this.shape){let n=this.shape[r];for(;n instanceof Mr;)n=n._def.innerType;e[r]=n}return new Ze({...this._def,shape:()=>e})}};Ze.create=(t,e)=>new Ze({shape:()=>t,unknownKeys:"strip",catchall:hi.create(),typeName:de.ZodObject,...Ce(e)});Ze.strictCreate=(t,e)=>new Ze({shape:()=>t,unknownKeys:"strict",catchall:hi.create(),typeName:de.ZodObject,...Ce(e)});Ze.lazycreate=(t,e)=>new Ze({shape:t,unknownKeys:"strip",catchall:hi.create(),typeName:de.ZodObject,...Ce(e)});var Es=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let a=o.map(c=>new Wr(c.ctx.common.issues));return le(r,{code:Q.invalid_union,unionErrors:a}),pe}if(r.common.async)return Promise.all(i.map(async o=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let d of i){let p={...r,common:{...r.common,issues:[]},parent:null},m=d._parseSync({data:r.data,path:r.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!o&&(o={result:m,ctx:p}),p.common.issues.length&&a.push(p.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let c=a.map(d=>new Wr(d));return le(r,{code:Q.invalid_union,unionErrors:c}),pe}}get options(){return this._def.options}};Es.create=(t,e)=>new Es({options:t,typeName:de.ZodUnion,...Ce(e)});var ta=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ee.object)return le(r,{code:Q.invalid_type,expected:ee.object,received:r.parsedType}),pe;let i=this.discriminator,n=r.data[i],o=this.options.get(n);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(le(r,{code:Q.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[i]}),pe)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(e,r,i){let n=new Map;try{r.forEach(o=>{let a=o.shape[e].value;n.set(a,o)})}catch{throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(n.size!==r.length)throw new Error("Some of the discriminator values are not unique");return new ta({typeName:de.ZodDiscriminatedUnion,discriminator:e,options:n,...Ce(i)})}};function bd(t,e){let r=Mn(t),i=Mn(e);if(t===e)return{valid:!0,data:t};if(r===ee.object&&i===ee.object){let n=Qe.objectKeys(e),o=Qe.objectKeys(t).filter(c=>n.indexOf(c)!==-1),a={...t,...e};for(let c of o){let d=bd(t[c],e[c]);if(!d.valid)return{valid:!1};a[c]=d.data}return{valid:!0,data:a}}else if(r===ee.array&&i===ee.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let a=t[o],c=e[o],d=bd(a,c);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return r===ee.date&&i===ee.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Rs=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(o,a)=>{if(pd(o)||pd(a))return pe;let c=bd(o.value,a.value);return c.valid?((gd(o)||gd(a))&&r.dirty(),{status:r.value,value:c.data}):(le(i,{code:Q.invalid_intersection_types}),pe)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>n(o,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Rs.create=(t,e,r)=>new Rs({left:t,right:e,typeName:de.ZodIntersection,...Ce(r)});var Cr=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==ee.array)return le(i,{code:Q.invalid_type,expected:ee.array,received:i.parsedType}),pe;if(i.data.length<this._def.items.length)return le(i,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),pe;!this._def.rest&&i.data.length>this._def.items.length&&(le(i,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,type:"array"}),r.dirty());let o=i.data.map((a,c)=>{let d=this._def.items[c]||this._def.rest;return d?d._parse(new Er(i,a,i.path,c)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>Pt.mergeArray(r,a)):Pt.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new Cr({...this._def,rest:e})}};Cr.create=(t,e)=>new Cr({items:t,typeName:de.ZodTuple,rest:null,...Ce(e)});var Cs=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==ee.object)return le(i,{code:Q.invalid_type,expected:ee.object,received:i.parsedType}),pe;let n=[],o=this._def.keyType,a=this._def.valueType;for(let c in i.data)n.push({key:o._parse(new Er(i,c,i.path,c)),value:a._parse(new Er(i,i.data[c],i.path,c))});return i.common.async?Pt.mergeObjectAsync(r,n):Pt.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof xe?new Cs({keyType:e,valueType:r,typeName:de.ZodRecord,...Ce(i)}):new Cs({keyType:fi.create(),valueType:e,typeName:de.ZodRecord,...Ce(r)})}},ra=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==ee.map)return le(i,{code:Q.invalid_type,expected:ee.map,received:i.parsedType}),pe;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([c,d],p)=>({key:n._parse(new Er(i,c,i.path,[p,"key"])),value:o._parse(new Er(i,d,i.path,[p,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let d of a){let p=await d.key,m=await d.value;if(p.status==="aborted"||m.status==="aborted")return pe;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(p.value,m.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let d of a){let p=d.key,m=d.value;if(p.status==="aborted"||m.status==="aborted")return pe;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(p.value,m.value)}return{status:r.value,value:c}}}};ra.create=(t,e,r)=>new ra({valueType:e,keyType:t,typeName:de.ZodMap,...Ce(r)});var Fi=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==ee.set)return le(i,{code:Q.invalid_type,expected:ee.set,received:i.parsedType}),pe;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(le(i,{code:Q.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(le(i,{code:Q.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,message:n.maxSize.message}),r.dirty());let o=this._def.valueType;function a(d){let p=new Set;for(let m of d){if(m.status==="aborted")return pe;m.status==="dirty"&&r.dirty(),p.add(m.value)}return{status:r.value,value:p}}let c=[...i.data.values()].map((d,p)=>o._parse(new Er(i,d,i.path,p)));return i.common.async?Promise.all(c).then(d=>a(d)):a(c)}min(e,r){return new Fi({...this._def,minSize:{value:e,message:Ve.toString(r)}})}max(e,r){return new Fi({...this._def,maxSize:{value:e,message:Ve.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Fi.create=(t,e)=>new Fi({valueType:t,minSize:null,maxSize:null,typeName:de.ZodSet,...Ce(e)});var $i=class extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ee.function)return le(r,{code:Q.invalid_type,expected:ee.function,received:r.parsedType}),pe;function i(c,d){return xc({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,H1,q1].filter(p=>!!p),issueData:{code:Q.invalid_arguments,argumentsError:d}})}function n(c,d){return xc({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,H1,q1].filter(p=>!!p),issueData:{code:Q.invalid_return_type,returnTypeError:d}})}let o={errorMap:r.common.contextualErrorMap},a=r.data;return this._def.returns instanceof Rn?jt(async(...c)=>{let d=new Wr([]),p=await this._def.args.parseAsync(c,o).catch(x=>{throw d.addIssue(i(c,x)),d}),m=await a(...p);return await this._def.returns._def.type.parseAsync(m,o).catch(x=>{throw d.addIssue(n(m,x)),d})}):jt((...c)=>{let d=this._def.args.safeParse(c,o);if(!d.success)throw new Wr([i(c,d.error)]);let p=a(...d.data),m=this._def.returns.safeParse(p,o);if(!m.success)throw new Wr([n(p,m.error)]);return m.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new $i({...this._def,args:Cr.create(e).rest(ci.create())})}returns(e){return new $i({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}};$i.create=(t,e,r)=>new $i({args:t?t.rest(ci.create()):Cr.create([]).rest(ci.create()),returns:e||ci.create(),typeName:de.ZodFunction,...Ce(r)});var ia=class extends xe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ia.create=(t,e)=>new ia({getter:t,typeName:de.ZodLazy,...Ce(e)});var na=class extends xe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return le(r,{code:Q.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};na.create=(t,e)=>new na({value:t,typeName:de.ZodLiteral,...Ce(e)});function Mx(t,e){return new sa({values:t,typeName:de.ZodEnum,...Ce(e)})}var sa=class extends xe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return le(r,{expected:Qe.joinValues(i),received:r.parsedType,code:Q.invalid_type}),pe}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return le(r,{received:r.data,code:Q.invalid_enum_value,options:i}),pe}return jt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}};sa.create=Mx;var oa=class extends xe{_parse(e){let r=Qe.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==ee.string&&i.parsedType!==ee.number){let n=Qe.objectValues(r);return le(i,{expected:Qe.joinValues(n),received:i.parsedType,code:Q.invalid_type}),pe}if(r.indexOf(e.data)===-1){let n=Qe.objectValues(r);return le(i,{received:i.data,code:Q.invalid_enum_value,options:n}),pe}return jt(e.data)}get enum(){return this._def.values}};oa.create=(t,e)=>new oa({values:t,typeName:de.ZodNativeEnum,...Ce(e)});var Rn=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ee.promise&&r.common.async===!1)return le(r,{code:Q.invalid_type,expected:ee.promise,received:r.parsedType}),pe;let i=r.parsedType===ee.promise?r.data:Promise.resolve(r.data);return jt(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Rn.create=(t,e)=>new Rn({type:t,typeName:de.ZodPromise,...Ce(e)});var Ar=class extends xe{innerType(){return this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null;if(n.type==="preprocess"){let a=n.transform(i.data);return i.common.async?Promise.resolve(a).then(c=>this._def.schema._parseAsync({data:c,path:i.path,parent:i})):this._def.schema._parseSync({data:a,path:i.path,parent:i})}let o={addIssue:a=>{le(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="refinement"){let a=c=>{let d=n.refinement(c,o);if(i.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?pe:(c.status==="dirty"&&r.dirty(),a(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?pe:(c.status==="dirty"&&r.dirty(),a(c.value).then(()=>({status:r.value,value:c.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Mc(a))return a;let c=n.transform(a.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Mc(a)?Promise.resolve(n.transform(a.value,o)).then(c=>({status:r.value,value:c})):a);Qe.assertNever(n)}};Ar.create=(t,e,r)=>new Ar({schema:t,typeName:de.ZodEffects,effect:e,...Ce(r)});Ar.createWithPreprocess=(t,e,r)=>new Ar({schema:e,effect:{type:"preprocess",transform:t},typeName:de.ZodEffects,...Ce(r)});var Mr=class extends xe{_parse(e){return this._getType(e)===ee.undefined?jt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:de.ZodOptional,...Ce(e)});var qi=class extends xe{_parse(e){return this._getType(e)===ee.null?jt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};qi.create=(t,e)=>new qi({innerType:t,typeName:de.ZodNullable,...Ce(e)});var W1=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===ee.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};W1.create=(t,e)=>new Mr({innerType:t,typeName:de.ZodOptional,...Ce(e)});var aa=class extends xe{_parse(e){if(this._getType(e)!==ee.nan){let i=this._getOrReturnCtx(e);return le(i,{code:Q.invalid_type,expected:ee.nan,received:i.parsedType}),pe}return{status:"valid",value:e.data}}};aa.create=t=>new aa({typeName:de.ZodNaN,...Ce(t)});var Tg=(t,e={},r)=>t?En.create().superRefine((i,n)=>{if(!t(i)){let o=typeof e=="function"?e(i):e,a=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...a,fatal:r})}}):En.create(),Ex={object:Ze.lazycreate},de;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodPromise="ZodPromise"})(de||(de={}));var Rx=(t,e={message:`Input not instance of ${t.name}`})=>Tg(r=>r instanceof t,e,!0),Pg=fi.create,Og=ji.create,Cx=aa.create,Ax=Jo.create,Ig=Zo.create,Tx=Yo.create,Px=Xo.create,Ox=Qo.create,Ix=En.create,Lx=ci.create,kx=hi.create,Nx=ea.create,Bx=Rr.create,Dx=Ze.create,zx=Ze.strictCreate,jx=Es.create,Fx=ta.create,$x=Rs.create,qx=Cr.create,Hx=Cs.create,Wx=ra.create,Ux=Fi.create,Gx=$i.create,Vx=ia.create,Kx=na.create,Jx=sa.create,Zx=oa.create,Yx=Rn.create,Ag=Ar.create,Xx=Mr.create,Qx=qi.create,eM=Ar.createWithPreprocess,tM=()=>Pg().optional(),rM=()=>Og().optional(),iM=()=>Ig().optional(),oe=Object.freeze({__proto__:null,getParsedType:Mn,ZodParsedType:ee,makeIssue:xc,EMPTY_PATH:bx,addIssueToContext:le,ParseStatus:Pt,INVALID:pe,DIRTY:vx,OK:jt,isAborted:pd,isDirty:gd,isValid:Mc,isAsync:yd,ZodType:xe,ZodString:fi,ZodNumber:ji,ZodBigInt:Jo,ZodBoolean:Zo,ZodDate:Yo,ZodUndefined:Xo,ZodNull:Qo,ZodAny:En,ZodUnknown:ci,ZodNever:hi,ZodVoid:ea,ZodArray:Rr,get objectUtil(){return Ec},ZodObject:Ze,ZodUnion:Es,ZodDiscriminatedUnion:ta,ZodIntersection:Rs,ZodTuple:Cr,ZodRecord:Cs,ZodMap:ra,ZodSet:Fi,ZodFunction:$i,ZodLazy:ia,ZodLiteral:na,ZodEnum:sa,ZodNativeEnum:oa,ZodPromise:Rn,ZodEffects:Ar,ZodTransformer:Ar,ZodOptional:Mr,ZodNullable:qi,ZodDefault:W1,ZodNaN:aa,custom:Tg,Schema:xe,ZodSchema:xe,late:Ex,get ZodFirstPartyTypeKind(){return de},any:Ix,array:Bx,bigint:Ax,boolean:Ig,date:Tx,discriminatedUnion:Fx,effect:Ag,enum:Jx,function:Gx,instanceof:Rx,intersection:$x,lazy:Vx,literal:Kx,map:Wx,nan:Cx,nativeEnum:Zx,never:kx,null:Ox,nullable:Qx,number:Og,object:Dx,oboolean:iM,onumber:rM,optional:Xx,ostring:tM,preprocess:eM,promise:Yx,record:Hx,set:Ux,strictObject:zx,string:Pg,transformer:Ag,tuple:qx,undefined:Px,union:jx,unknown:Lx,void:Nx,ZodIssueCode:Q,quotelessJson:gx,ZodError:Wr,defaultErrorMap:q1,get overrideErrorMap(){return H1},setErrorMap:yx});var nM=oe.object({title:oe.string(),description:oe.string(),fees:oe.string(),accessConstraints:oe.string()}),sM=oe.object({deliveryPoint:oe.string(),city:oe.string(),postalCode:oe.string(),country:oe.string(),email:oe.string()}),oM=oe.object({individualName:oe.string(),position:oe.string(),phone:oe.string(),address:sM}),aM=oe.object({name:oe.string(),site:oe.string(),contact:oM}),lM=oe.object({id:oe.string(),serviceIdentification:nM,serviceProvider:aM});var uM=oe.object({id:oe.string(),version:oe.number(),name:oe.string(),metadata:oe.unknown().optional(),sprite:oe.string().optional(),glyphs:oe.string().optional(),sources:oe.unknown(),layers:oe.array(oe.unknown())});function cM(t){try{return Gu(t),!0}catch{return!1}}var fM=oe.string().refine(cM,{message:"Invalid hex color"}),la={minZoom:0,maxZoom:32},Rc=oe.number().refine(t=>t>=la.minZoom&&t<=la.maxZoom,{message:`must be between ${la.minZoom} and ${la.maxZoom}`}),hM=oe.object({name:oe.string(),title:oe.string(),category:oe.string().optional(),2193:oe.string().optional(),3857:oe.string().optional(),minZoom:Rc.optional(),maxZoom:Rc.optional(),disabled:oe.boolean().optional()}).refine(({minZoom:t,maxZoom:e})=>(t||la.minZoom)<=(e||la.maxZoom),{message:"minZoom may no be greater than maxZoom",path:["minZoom"]}),dM=oe.object({type:oe.nativeEnum(it),id:oe.string(),title:oe.string(),category:oe.string().optional(),description:oe.string().optional(),background:fM.optional(),layers:oe.array(hM),minZoom:Rc.optional(),maxZoom:Rc.optional(),format:oe.union([oe.nativeEnum(Le),oe.nativeEnum(lr)]).optional()});var pM=new E1(c1.TileMetadata.TableName);function vd(){return pM}function As(t){let e=Object.entries(t);if(e.length===0)return"";let r=new URLSearchParams;for(let n of e)n[1]!=null&&r.set(n[0],n[1]);r.sort();let i=r.toString();return i===""?"":`?${i}`}var Jg=me(kg(),1),Zg=me(Vg(),1);function Kg(t){return[[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],[t[0],t[1]]]]}var{intersection:BM,union:Yg}=Zg.default;function DM(t,e){return t[0]===e[0]&&t[1]===e[1]}function zM(t,e){return BM(t,Kg(e))}function Rd(t,e){let r=[];for(let i of t){let n=Jg.default.polygon(i[0],e);n.length!==0&&(DM(n[0],n[n.length-1])||n.push(n[0]),r.push([n]))}return zM(r,e)}var K1=t=>(t<-360?t=-(-t%360):t>360&&(t=t%360),t<-180?360+t:t>180?t-360:t),Ts=(t,e)=>{let r=e-t;return r>180?r-360:r<-180?r+360:r},jM=(t,e)=>K1(t+(e<t?e+360-t:e-t)),An={boxLonCenter(t){return K1(t[0]+.5*(t[2]<t[0]?360+t[2]-t[0]:t[2]-t[0]))},delta:Ts,crossesAM(t,e){return Math.sign(Ts(t,e))!==Math.sign(e-t)},normLon:K1,normExtent(t){return[K1(t[0]),t[1],K1(t[2]),t[3]]},union(t,e){if(e==null)return t.slice();let r=An.boxLonCenter(t),i=An.boxLonCenter(e);if(Ts(r,i)<0)return this.union(e,t);let n=t.slice(),o=jM(r,i);return Ts(o,e[0])<Ts(o,t[0])&&(n[0]=e[0]),Ts(o,e[2])>Ts(o,t[2])&&(n[2]=e[2]),e[1]<t[1]&&(n[1]=e[1]),e[3]>t[3]&&(n[3]=e[3]),n},intersects(t,e){if(t[1]>e[3]||e[1]>t[3])return!1;let r=t[0],i=e[0],n=r<t[2]?t[2]:t[2]+360,o=i<e[2]?e[2]:e[2]+360;return r<=o&&i<=n||r+360<=o&&i<=n+360||r<=o+360&&i+360<=n},ringToBbox(t){if(t.length<3)throw new Error("Invalid ring");let e=!1,r=t[0],i=r[0],n=r[1],o=i,a=n,c=i;for(let d=1;d<t.length;++d){let p=t[d],m=p[0];An.crossesAM(c,m)&&(e=!e),e&&(m<0?m+=360:(c+=360,d===1&&(i=o=c))),m<i?i=m:m>o&&(o=m);let x=p[1];x<n?n=x:x>a&&(a=x),c=p[0]}return[this.normLon(i),n,this.normLon(o),a]},multiPolygonToBbox(t){let e=null;for(let r of t){if(r.length===0)continue;let i=r[0];if(i.length<3)continue;let n=this.ringToBbox(i);e=e==null?n:this.union(e,n)}if(e==null)throw new Error("Invalid multipolygon");return e},bboxToMultiPolygon(t){let e=[t[0],t[1]],r=[t[2],t[1]],i=[t[0],t[3]],n=[t[2],t[3]];return t[0]<t[2]?[[[e,i,n,r,e]]]:[[[e,i,[180,n[1]],[180,r[1]],e]],[[n,r,[-180,e[1]],[-180,i[1]],n]]]}};var FM=[-180,-90,180,90],$M=[180,-90,360,90];function qM(t,e,r){return[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t]}function HM(t){let e=[];for(let r of Rd(t,FM))e.push(r);for(let r of Rd(t,$M))e.push(r.map(i=>i.map(n=>[n[0]-360,n[1]])));return e}function Pc(t,e,r=!0){let i=!1,n=!1,o=t.map(a=>a.map(c=>{let d=[];if(c.length===0)return d;let p=c[0],m=null,v=0;for(let x of c){let w=e(x),b=w[0];if(m!=null){let E=An.crossesAM(v,b);if(E&&(i=!0,n=!n),n&&(b<0?w[0]=b+360:m[0]=v+360),E){let A=(180-w[0])/(m[0]-w[0]),C=e(qM(A,x,p));d.push([180,C[1]])}}d.push(w),p=x,m=w,v=b}return d}));return i&&r?HM(o):o}function WM(t){return{type:"Polygon",coordinates:t}}function Xg(t,e={}){return{type:"Feature",geometry:WM(t),properties:e}}function Qg(t,e={}){return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:t},properties:e}}var ca=me(e6(),1);var t6=`PROJCS["NZGD2000 / Chatham Islands TM 2000",
|
|
146
|
-
GEOGCS["NZGD2000",
|
|
147
|
-
DATUM["New_Zealand_Geodetic_Datum_2000",
|
|
148
|
-
SPHEROID["GRS 1980",6378137,298.257222101,
|
|
149
|
-
AUTHORITY["EPSG","7019"]],
|
|
150
|
-
TOWGS84[0,0,0,0,0,0,0],
|
|
151
|
-
AUTHORITY["EPSG","6167"]],
|
|
152
|
-
PRIMEM["Greenwich",0,
|
|
153
|
-
AUTHORITY["EPSG","8901"]],
|
|
154
|
-
UNIT["degree",0.01745329251994328,
|
|
155
|
-
AUTHORITY["EPSG","9122"]],
|
|
156
|
-
AUTHORITY["EPSG","4167"]],
|
|
157
|
-
UNIT["metre",1,
|
|
158
|
-
AUTHORITY["EPSG","9001"]],
|
|
159
|
-
PROJECTION["Transverse_Mercator"],
|
|
160
|
-
PARAMETER["latitude_of_origin",0],
|
|
161
|
-
PARAMETER["central_meridian",-176.5],
|
|
162
|
-
PARAMETER["scale_factor",1],
|
|
163
|
-
PARAMETER["false_easting",3500000],
|
|
164
|
-
PARAMETER["false_northing",10000000],
|
|
165
|
-
AUTHORITY["EPSG","3793"],
|
|
166
|
-
AXIS["Easting",EAST],
|
|
167
|
-
AXIS["Northing",NORTH]]`;var r6=`PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
|
|
168
|
-
GEOGCS["NZGD2000",
|
|
169
|
-
DATUM["New_Zealand_Geodetic_Datum_2000",
|
|
170
|
-
SPHEROID["GRS 1980",6378137,298.257222101,
|
|
171
|
-
AUTHORITY["EPSG","7019"]],
|
|
172
|
-
TOWGS84[0,0,0,0,0,0,0],
|
|
173
|
-
AUTHORITY["EPSG","6167"]],
|
|
174
|
-
PRIMEM["Greenwich",0,
|
|
175
|
-
AUTHORITY["EPSG","8901"]],
|
|
176
|
-
UNIT["degree",0.0174532925199433,
|
|
177
|
-
AUTHORITY["EPSG","9122"]],
|
|
178
|
-
AUTHORITY["EPSG","4167"]],
|
|
179
|
-
PROJECTION["Transverse_Mercator"],
|
|
180
|
-
PARAMETER["latitude_of_origin",0],
|
|
181
|
-
PARAMETER["central_meridian",173],
|
|
182
|
-
PARAMETER["scale_factor",0.9996],
|
|
183
|
-
PARAMETER["false_easting",1600000],
|
|
184
|
-
PARAMETER["false_northing",10000000],
|
|
185
|
-
UNIT["metre",1,
|
|
186
|
-
AUTHORITY["EPSG","9001"]],
|
|
187
|
-
AUTHORITY["EPSG","2193"]]`;ca.default.defs(Re.Nztm2000.toEpsgString(),r6);ca.default.defs(Re.Citm2000.toEpsgString(),t6);var Td=new Map;function UM(t){return t==null?null:typeof t=="number"?t:"code"in t?t.code:"projection"in t?t.projection.code:null}var Pr=class{constructor(e){this.epsg=e;try{this.projection=(0,ca.default)(e.toEpsgString(),Re.Wgs84.toEpsgString())}catch(r){throw new ut(`Failed to create projection: ${e.toEpsgString()}, ${Re.Wgs84.toEpsgString()}`,500,r)}}static define(e,r){if(Td.get(e.code)!=null)throw new Error("Duplicate projection definition: "+e.toEpsgString());ca.default.defs(e.toEpsgString(),r)}static get(e){let r=this.tryGet(e);if(r==null)throw new Error(`Invalid projection: ${e}`);return r}static tryGet(e){let r=UM(e);if(r==null)return null;let i=Td.get(r);if(i!=null)return i;let n=Re.tryGet(r);return n==null||ca.default.defs(n.toEpsgString())==null?null:(i=new Pr(n),Td.set(r,i),i)}projectMultipolygon(e,r){if(r.epsg.code===this.epsg.code)return e;let{toWgs84:i}=this,{fromWgs84:n}=r;return e.map(o=>o.map(a=>a.map(c=>n(i(c)))))}get toWgs84(){return this.projection.forward}get fromWgs84(){return this.projection.inverse}boundsToWgs84BoundingBox(e){let r=this.toWgs84([e.x,e.y]),i=this.toWgs84([e.x+e.width,e.y+e.height]);return[r[0],r[1],i[0],i[1]]}boundsToGeoJsonFeature(e,r={}){let i=[e.x,e.y],n=[e.x+e.width,e.y],o=[e.x,e.y+e.height],a=[e.x+e.width,e.y+e.height],c=Pc([[[i,o,a,n,i]]],this.toWgs84),d=c.length===1?Xg(c[0],r):Qg(c,r);return d.bbox=this.boundsToWgs84BoundingBox(e),d}toGeoJson(e){return{type:"FeatureCollection",features:e.map(r=>this.boundsToGeoJsonFeature(r,{name:r.name}))}}static getTiffResZoom(e,r){for(let i=0;i<e.zooms.length;i++)if(e.pixelScale(i)-r<this.AllowedFloatingError)return i;return e.zooms.length-1}static tileToWgs84Bbox(e,r){let i=e.tileToSource(r),n=e.tileToSource({x:r.x+1,y:r.y+1,z:r.z}),o=this.get(e),[a,c]=o.toWgs84([i.x,n.y]),[d,p]=o.toWgs84([n.x,i.y]);return[a,c,d,p]}static tileCenterToLatLon(e,r){let i=e.tileToSource({x:r.x+.5,y:r.y+.5,z:r.z}),[n,o]=this.get(e).toWgs84([i.x,i.y]);return Pr.wrapLatLon(o,n)}static wrapLatLon(e,r){let i={lat:e,lon:r},n=Math.floor(Math.abs(e)/90)%4,o=e>0?90:-90,a=e%90;switch(n){case 0:i.lat=a;break;case 1:i.lat=o-a,i.lon+=180;break;case 2:i.lat=-a,i.lon+=180;break;case 3:i.lat=-o+a;break}return(i.lon>180||i.lon<-180)&&(i.lon-=Math.floor((i.lon+180)/360)*360),i}static findAlignmentLevels(e,r,i,n=2){return Math.max(0,this.getTiffResZoom(e,i*n)-r.z)}static getImagePixelWidth(e,r,i){let n=e.tileToSource(r),o=e.tileToSource({x:r.x+1,y:r.y+1,z:r.z});return Math.round((o.x-n.x)/e.pixelScale(i))*2}};Pr.AllowedFloatingError=1e-8;function i6(t){return t==null||typeof t=="string"?!1:"roleArn"in t&&typeof t.roleArn=="string"}function Tn(t){return"promise"in t?t.promise():t}function Pn(t,e){return Ai(t)?typeof t.statusCode!="number"?new ut(e,500,t):new ut(e,t.statusCode,t):new ut(e,500,t)}var tr=class extends Ct{constructor(e,r,i){super(),this.type=tr.type,this.protocol="s3",this.chunkSize=tr.DefaultChunkSize,this.maxChunkCount=tr.DefaultMaxChunkCount,this.bucket=e,this.key=r,this.remote=i}get uri(){return this.name}get name(){return`s3://${this.bucket}/${this.key}`}static isSource(e){return e.type===tr.type}get size(){return this._size?this._size:(this._size=Promise.resolve().then(async()=>(await Tn(this.remote.headObject({Bucket:this.bucket,Key:this.key}))).ContentLength||-1),this._size)}static fromUri(e,r){let i=Yt(e);return i==null||i.key==null||i.protocol!=="s3"?null:new tr(i.bucket,i.key,r)}async fetchBytes(e,r){let i=this.toRange(e,r);try{let n=await this.remote.getObject({Bucket:this.bucket,Key:this.key,Range:i}).promise();if(!Buffer.isBuffer(n.Body))throw new Error("Failed to fetch object, Body is not a buffer");n.ContentRange!=null&&this._size==null&&(this._size=Promise.resolve(this.parseContentRange(n.ContentRange)));let o=n.Body;return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)}catch(n){throw Pn(n,`Failed to fetch ${this.name} ${i}`)}}};tr.type="aws:s3";tr.DefaultChunkSize=64*1024;tr.DefaultMaxChunkCount=32;function GM(t){return typeof t.read=="function"}var Ot=class{constructor(e,r){this.protocol=Ot.protocol,this.writeTests=new Set,this.writeTestSuffix=Ot.WriteTestSuffix,this.s3=e,this.credentials=r}source(e){let r=tr.fromUri(e,this.s3);if(r==null)throw new Error(`Failed to create aws s3 source from uri: ${e}`);return r}static is(e){return e.protocol===Ot.protocol}static isPath(e){return e==null?!1:e.startsWith("s3://")}async*list(e,r){for await(let i of this.details(e,r))yield i.path}async*details(e,r){let i=Yt(e);if(i==null)return;let n,o=r?.recursive===!1?"/":void 0,a=i.bucket,c=i.key,d=0;try{for(;;){d++;let p=await Tn(this.s3.listObjectsV2({Bucket:a,Prefix:c,ContinuationToken:n,Delimiter:o}));if(p.CommonPrefixes!=null)for(let m of p.CommonPrefixes)m.Prefix!=null&&(yield{path:`s3://${a}/${m.Prefix}`,isDirectory:!0});if(p.Contents!=null)for(let m of p.Contents)m.Key!=null&&(yield{path:`s3://${a}/${m.Key}`,size:m.Size});if(!p.IsTruncated)break;if(d>=Ot.MaxListCount)throw new Error(`Failed to finish listing within ${Ot.MaxListCount} list attempts`);n=p.NextContinuationToken}}catch(p){let m=Pn(p,`Failed to list: "${e}"`);if(this.credentials!=null&&m.code===403){let v=await this.credentials.find(e);if(v){yield*v.details(e,r);return}}throw m}}async read(e){let r=Yt(e);if(r==null||r.key==null)throw new Error(`Failed to read: "${e}"`);try{return(await this.s3.getObject({Bucket:r.bucket,Key:r.key}).promise()).Body}catch(i){let n=Pn(i,`Failed to read: "${e}"`);if(this.credentials!=null&&n.code===403){let o=await this.credentials.find(e);if(o)return o.read(e)}throw n}}async _writeTest(e){let r=Yt(e);if(r==null||r.key==null)throw new Error(`Failed to write: "${e}"`);if(this.credentials==null||this.writeTests.has(r.bucket))return;let i=`${e}${this.writeTestSuffix}`;try{await Tn(this.s3.upload({Bucket:r.bucket,Key:r.key+this.writeTestSuffix,Body:Buffer.from("test")})),this.writeTests.add(r.bucket),this.writeTestSuffix!==""&&await this.delete(i)}catch(n){let o=Pn(n,`Failed to write to "s3://${i}"`);if(o.code===403){let a=await this.credentials.find(e);if(a)return a}throw o}}async write(e,r,i){let n=Yt(e);if(n==null||n.key==null)throw new Error(`Failed to write: "${e}"`);if(this.credentials!=null&&GM(r)){let o=await this._writeTest(e);if(o)return o.write(e,r,i)}try{await Tn(this.s3.upload({Bucket:n.bucket,Key:n.key,Body:r,ContentEncoding:i?.contentEncoding,ContentType:i?.contentType}))}catch(o){let a=Pn(o,`Failed to write: "${e}"`);if(this.credentials!=null&&a.code===403){let c=await this.credentials.find(e);if(c)return c.write(e,r,i)}throw a}}async delete(e){let r=Yt(e);if(r==null||r.key==null)throw new Error(`Failed to write: "${e}"`);try{await Tn(this.s3.deleteObject({Bucket:r.bucket,Key:r.key}));return}catch(i){let n=Pn(i,`Failed to delete: "${e}"`);if(this.credentials!=null&&n.code===403){let o=await this.credentials.find(e);if(o)return o.delete(e)}throw n}}exists(e){return this.head(e).then(r=>r!=null)}stream(e){let r=Yt(e);if(r==null||r.key==null)throw new Error(`S3: Unable to read "${e}"`);return this.s3.getObject({Bucket:r.bucket,Key:r.key}).createReadStream()}async head(e){let r=Yt(e);if(r==null||r.key==null)throw new Error(`Failed to head: "${e}"`);try{return{size:(await Tn(this.s3.headObject({Bucket:r.bucket,Key:r.key}))).ContentLength,path:e}}catch(i){if(Ai(i)&&i.code==="NotFound")return null;let n=Pn(i,`Failed to head: "${e}"`);if(this.credentials!=null&&n.code===403){let o=await this.credentials.find(e);if(o)return o.head(e)}throw n}}};Ot.protocol="s3";Ot.MaxListCount=100;Ot.WriteTestSuffix="";var n6=me(require("aws-sdk/clients/s3.js"),1),s6=me(require("aws-sdk/lib/core.js"),1),$t=class{static fsFromRole(e,r,i){if(typeof e=="object")return $t.fsFromRole(e.roleArn,e.externalId,e.durationSeconds);let n=$t.role(e,r,i);return new Ot(new n6.default({credentials:n}))}static role(e,r,i){i=i??$t.DefaultRoleDurationSeconds;let n=`role::${e}::${r}::${i}`,o=$t.cache.get(n);return o==null&&(o=new s6.default.ChainableTemporaryCredentials({params:{RoleArn:e,ExternalId:r,RoleSessionName:"fsa-"+Math.random().toString(32)+"-"+Date.now(),DurationSeconds:i}}),$t.cache.set(n,o)),o}};$t.DefaultRoleDurationSeconds=3600;$t.cache=new Map;var fa=class{constructor(e,r){this._config=null,this.path=e,this.fs=r}get config(){return this._config==null&&(this._config=this.fs.read(this.path).then(e=>JSON.parse(e.toString()))),this._config}async findCredentials(e){if(this.path===e)return null;let r=await this.config;if(r==null)return null;if(r.v!==2)throw new Error("Invalid bucket config version: "+r.v+" from: "+this.path);if(r.prefixes==null||!Array.isArray(r.prefixes))throw new Error('Invalid bucket config missing "prefixes" from: '+this.path);for(let i of r.prefixes)if(e.startsWith(i.prefix))return i;return null}async find(e){let r=await this.findCredentials(e);if(r==null)return null;let i=$t.fsFromRole(r.roleArn,r.externalId,r.roleSessionDuration);return this.onFileSystemCreated&&this.onFileSystemCreated(r,i),i}};var a6=me(require("aws-sdk/clients/s3.js"),1),l6=require("util"),Oc=require("zlib");var VM=(0,l6.promisify)(Oc.gunzip),ht=xt;ht.readJson=async function(e){let r=await this.read(e);return e.endsWith(".gz")?JSON.parse((await VM(r)).toString()):JSON.parse(r.toString())};ht.writeJson=async function(e,r){let i=Buffer.from(JSON.stringify(r,void 0,2));if(e.endsWith(".gz")){let n=(0,Oc.createGzip)();return n.end(i),this.write(e,n)}else return this.write(e,i)};ht.configure=function(e){if(e.type!=="s3"||!i6(e))return;let r=Yt(e.path);if(r==null)throw new Error("Failed to parse URI: "+e.path);let i=`s3://${r.bucket}/`;this.register(i,$t.fsFromRole(e.roleArn,e.externalId))};var u6=new Ot(new a6.default);ht.register("s3://",u6);var o6=Xe.get(Xe.AwsRoleConfigPath);if(o6!=null){let t=new fa(o6,ht);t.onFileSystemCreated=(e,r)=>{Io.get().debug({roleArn:e.roleArn,prefix:e.prefix},"FileSystem:Registered"),ht.register(e.prefix,r)},u6.credentials=t}function c6(t){let e=/(?:^|\D)(\d{4})(?:-(\d{2}))?(?:$|\D)/g,r=[];for(let i=e.exec(t);i!=null;i=e.exec(t))r.push(parseInt(i[1])),i[2]!=null&&r.push(parseInt(i[1].slice(0,2)+i[2]));return r.length===0?null:(r.sort(),[r[0],r[r.length-1]+1])}function Ic(t){let e=t.slice(t.lastIndexOf(" ")+1).trim();if(e==null||!e.endsWith(")")||!e.startsWith("("))return null;let r=e.slice(1,e.length-1).split("-").map(Number);return r.length===1&&!isNaN(r[0])||r.length===2&&!isNaN(r[0])&&!isNaN(r[1])?r:null}process.env.AWS_NODEJS_CONNECTION_REUSE_ENABLED="1";var i4=me(ay(),1);var On="application/json",re;(function(t){t.CacheControl="Cache-Control",t.ContentEncoding="Content-Encoding",t.ContentType="Content-Type",t.Cors="Access-Control-Allow-Origin",t.ETag="ETag",t.IfNoneMatch="If-None-Match",t.Server="Server",t.ServerTiming="Server-Timing"})(re||(re={}));var da;(function(t){t.CloudfrontId="X-Amz-Cf-Id",t.TraceId="X-Amzn-Trace-Id"})(da||(da={}));var hr;(function(t){t.CorrelationId="X-LINZ-Correlation-Id",t.RequestId="X-LINZ-Request-Id"})(hr||(hr={}));var fy=require("url");var ly=require("perf_hooks"),BC=4,zc=class{constructor(){this.timers=new Map}getTime(){return ly.performance.now()}start(e){let r=this.timers.get(e);if(r!=null&&r.duration==null)throw new Error(`Duplicate startTime for "${e}"`);this.timers.set(e,{start:this.getTime()})}end(e){let r=this.timers.get(e);if(r==null)throw new Error(`Missing startTime information for "${e}"`);let i=this.getTime()-r.start;return r.duration=Number(i.toFixed(BC)),i}get metrics(){if(this.timers.size===0)return;let e={};for(let[r,i]of this.timers.entries())i.duration!=null&&(e[r]=i.duration);return e}get unfinished(){let e=[];for(let[r,i]of this.timers.entries())i.duration==null&&e.push(r);if(e.length!==0)return e}};var uy=me(Lo(),1);function qt(t){return!(typeof t!="object"||t==null)}var Is=class{constructor(e,r,i){this.context=r,this.event=e,this.id=(0,uy.ulid)(),this.headers=new Map,this.logContext={},this.log=i,this.timer=new zc,this.log=i.child({id:this.id})}get isColdStart(){return this.requestCount===0}set(e,r){r==null&&(r=void 0),this.logContext[e]=r}toResponse(e){return e?.body}};var cy=me(Lo(),1);var Ht=class extends Is{constructor(e,r,i){var n;super(e,r,i),this.headers=new Map,this.abort=new AbortController,this.correlationId=(n=this.header(hr.CorrelationId))!==null&&n!==void 0?n:cy.ulid(),this.set("correlationId",this.correlationId)}header(e){return this._isHeadersLoaded!==!0&&(this.loadHeaders(),this._isHeadersLoaded=!0),this.headers.get(e.toLowerCase())}json(){var e;if(this.header(re.ContentType)!==On)throw new Error(`Invalid Content-Type: "${this.header("content-type")}"`);if(this.body==null)throw new Error("Cannot parse empty body as JSON");try{return this.isBase64Encoded?JSON.parse(Buffer.from((e=this.body)!==null&&e!==void 0?e:"","base64").toString()):JSON.parse(this.body)}catch{throw new Error("Body is not a JSON object")}}get query(){return this._query==null&&(this._query=this.loadQueryString()),this._query}get url(){return this.path}};var ma=class extends Ht{static is(e){return qt(e)&&qt(e.requestContext)&&qt(e.requestContext.elb)}toResponse(e){return{statusCode:e.status,statusDescription:e.statusDescription,body:e.body,headers:this.toHeaders(e.headers),isBase64Encoded:e.isBase64Encoded}}toHeaders(e){if(e.size===0)return;let r={};for(let i of e)r[i[0]]=i[1];return r}loadHeaders(){if(this.event.headers!=null)for(let[e,r]of Object.entries(this.event.headers))r!=null&&this.headers.set(e.toLowerCase(),r)}loadQueryString(){let e=new fy.URLSearchParams;if(this.event.queryStringParameters==null)return e;for(let[r,i]of Object.entries(this.event.queryStringParameters))e.append(r,i??"true");return e}get method(){return this.event.httpMethod.toUpperCase()}get path(){return this.event.path}get body(){return this.event.body}get isBase64Encoded(){return this.event.isBase64Encoded}};var hy=require("url");var mi=class extends Ht{static is(e){return!(!qt(e)||!qt(e.requestContext)||typeof e.requestContext.apiId!="string"||typeof e.requestContext.resourceId!="string"||typeof e.requestContext.httpMethod!="string")}toResponse(e){return{statusCode:e.status,body:e.body,headers:mi.toHeaders(e),isBase64Encoded:e.isBase64Encoded}}static toHeaders(e){if(e.headers.size===0)return;let r={};for(let i of e.headers)r[i[0]]=i[1];return r}loadHeaders(){if(this.event.headers!=null)for(let[e,r]of Object.entries(this.event.headers))r!=null&&this.headers.set(e.toLowerCase(),r)}loadQueryString(){let e=new hy.URLSearchParams;if(this.event.multiValueQueryStringParameters==null)return e;for(let[r,i]of Object.entries(this.event.multiValueQueryStringParameters))if(i!=null)for(let n of i)e.append(r,n);return e}get path(){return this.event.path}get method(){return this.event.httpMethod.toUpperCase()}get body(){return this.event.body}get isBase64Encoded(){return this.event.isBase64Encoded}};var Kd=require("url");var pa=class extends Ht{static is(e){if(!qt(e)||!Array.isArray(e.Records))return!1;let r=e.Records[0];return qt(r)?qt(r.cf):!1}toResponse(e){if(e.status===100&&this.event!=null){let r=this.event.Records[0].cf.request;for(let[i,n]of e.headers)r.headers[i.toLowerCase()]=[{key:i,value:String(n)}];return this.event.Records[0].cf.request}return{status:String(e.status),statusDescription:e.statusDescription,body:e.body,headers:this.toHeaders(e),bodyEncoding:"text"}}toHeaders(e){if(e.headers.size===0)return{};let r={};for(let i of e.headers)r[i[0]]=[{key:i[0],value:String(i[1])}];return r}loadHeaders(){var e;for(let[r,i]of Object.entries(this.event.Records[0].cf.request.headers))this.headers.set(r.toLowerCase(),(e=i[0])===null||e===void 0?void 0:e.value)}loadQueryString(){let e=this.event.Records[0].cf.request.querystring;return e==null?new Kd.URLSearchParams:new Kd.URLSearchParams(e)}get path(){return this.event.Records[0].cf.request.uri}get method(){return this.event.Records[0].cf.request.method.toUpperCase()}get body(){let e=this.event.Records[0].cf.request.body;return e==null?null:e.data}get isBase64Encoded(){var e;return((e=this.event.Records[0].cf.request.body)===null||e===void 0?void 0:e.encoding)==="base64"}};var dy=require("url");var ga=class extends Ht{toResponse(e){return{statusCode:e.status,body:e.body,headers:mi.toHeaders(e),isBase64Encoded:e.isBase64Encoded}}loadHeaders(){for(let[e,r]of Object.entries(this.event.headers))this.headers.set(e.toLowerCase(),r)}loadQueryString(){return new dy.URLSearchParams(this.event.rawQueryString)}get method(){return this.event.requestContext.http.method.toUpperCase()}get path(){return this.event.rawPath}get isBase64Encoded(){return this.event.isBase64Encoded}get body(){return this.event.body==null?null:this.event.body}static is(e){return!(!qt(e)||!qt(e.requestContext)||!qt(e.requestContext.http))}};var K=class{constructor(e,r,i){if(this._body=null,this.headers=new Map,this.status=e,this.statusDescription=r,i!=null)for(let n of Object.keys(i))this.header(n,i[n])}static is(e){return e instanceof K}static ok(e=200,r="Ok"){return new K(e,r)}header(e,r){let i=e.toLowerCase();if(r==null)return this.headers.get(i);this.headers.set(i,r)}get isBase64Encoded(){return Buffer.isBuffer(this._body)}json(e){return this.buffer(JSON.stringify(e),On),this}buffer(e,r=On){return this.header(re.ContentType,r),this._body=e,this}get body(){return this._body==null?(this.header(re.ContentType,On),JSON.stringify({id:this.header(hr.RequestId),status:this.status,message:this.statusDescription,correlationId:this.header(hr.CorrelationId)})):Buffer.isBuffer(this._body)?this._body.toString("base64"):this._body}};var e4=me(Qy(),1),t4=me(require("timers/promises"),1);var Kc=class{constructor(){this.hooks={request:[],response:[]},this.timeoutEarlyMs=0,this.router=(0,e4.default)({defaultRoute:()=>new K(404,"Not found")})}register(e,r,i){this.router.on(e,r,(n,o,a)=>n instanceof Ht?(n.params=a,Jc(n,i)):new K(500,"Internal server error"))}hook(e,r){this.hooks[e].push(r)}get(e,r){return this.register("GET",e,r)}post(e,r){return this.register("POST",e,r)}delete(e,r){return this.register("DELETE",e,r)}options(e,r){return this.register("OPTIONS",e,r)}patch(e,r){return this.register("PATCH",e,r)}head(e,r){return this.register("HEAD",e,r)}put(e,r){return this.register("PUT",e,r)}async after(e,r){try{for(let i of this.hooks.response)await i(e,r)}catch(i){return K.is(i)?i:(e.set("err",i),new K(500,"Internal Server Error"))}return r}async handle(e){let r=[this._handle(e)];if(this.timeoutEarlyMs&&typeof e.context.getRemainingTimeInMillis=="function"){let i=e.context.getRemainingTimeInMillis()-this.timeoutEarlyMs;r.push(t4.default.setTimeout(i,new K(408,"Request Timed Out"),{signal:e.abort.signal}))}return Promise.race(r).then(i=>(e.abort.abort(),u2(e,i)))}async _handle(e){e.requestCount===-1&&(e.requestCount=Wt.requestCount++);let r=e.header(da.CloudfrontId),i=e.header(da.TraceId),n=e.context.awsRequestId;(r||i||n)&&e.set("aws",{cloudFrontId:r,traceId:i,lambdaId:n}),e.set("method",e.method),e.set("path",e.path);for(let a of this.hooks.request){let c=await Jc(e,a);if(c)return this.after(e,c)}let o=await this.router.lookup(e,null);return o?this.after(e,o):this.after(e,new K(404,"Not found"))}};var cA="v6.40.0",fA="029c1e511531064dbf87b2b5204a50fe840daa79",r4={version:cA,hash:fA};async function Jc(t,e){t.timer.timers.has("lambda")||t.timer.start("lambda");try{return await e(t)}catch(r){return K.is(r)?r:(t.set("err",r),new K(500,"Internal Server Error"))}}function u2(t,e){let r=t.timer.timers.has("lambda")?t.timer.end("lambda"):0,i=200;return e instanceof K&&(e.status>=500&&e.header(re.CacheControl,"no-store"),e.header(re.ServerTiming,`total;dur=${r}`),!e.isBase64Encoded&&e.header(re.ContentType)==null&&e.header(re.ContentType,On),i=e.status,t.set("description",e.statusDescription),e.header(hr.RequestId,t.id),t instanceof Ht&&e.header(hr.CorrelationId,t.correlationId)),t.set("status",i),t.timer.timers.size>0&&t.set("metrics",t.timer.metrics),r4.hash&&t.set("package",r4),t.set("requestCount",t.requestCount),t.set("unfinished",t.timer.unfinished),t.set("duration",r),t.set("@type","report"),i>499?t.log.error(t.logContext,"Lambda:Done"):i>399?t.log.warn(t.logContext,"Lambda:Done"):t.log.info(t.logContext,"Lambda:Done"),e}function hA(t){let e={rejectOnError:!0,tracePercent:0,...t};if(isNaN(e.tracePercent)||e.tracePercent>1)throw new Error("tracePercent is not between 0-1 :"+e.tracePercent);return e}var Wt=class{static request(e,r,i){if(ma.is(e))return new ma(e,r,i);if(ga.is(e))return new ga(e,r,i);if(mi.is(e))return new mi(e,r,i);if(pa.is(e))return new pa(e,r,i);throw new Error("Request is not a a ALB, ApiGateway or Cloudfront event")}static handler(e,r,i){let n=hA(r);function o(a,c,d){let p=new Is(a,c,i??Wt.Logger);p.requestCount=Wt.requestCount++,n.tracePercent>0&&Math.random()<n.tracePercent&&(p.log.level="trace"),process.env.TRACE_LAMBDA&&(p.log.level="trace"),p.log.trace({event:a},"Lambda:Start");let m=c.awsRequestId;p.set("aws",{lambdaId:m}),Jc(p,e).then(v=>{if(u2(p,v),K.is(v)&&n.rejectOnError){if(p.logContext.err)return d(p.logContext.err);if(v.status>399)return d(p.toResponse(v))}return d(null,p.toResponse(v))})}return o}static http(e){let r=new Kc;async function i(n,o){let a=Wt.request(n,o,e??Wt.Logger);try{let c=await r.handle(a);return a.toResponse(c)}catch(c){a.log.fatal({err:c},"Lambda:Failed");let d=new K(500,"Internal Server Error");return a.set("err",c),d.header(hr.RequestId,a.id),d.header(hr.CorrelationId,a.correlationId),a.toResponse(d)}}return i.router=r,i}};Wt.Logger=(0,i4.default)();Wt.ServerName="linz";Wt.requestCount=0;var Ne={key(t){return Buffer.isBuffer(t)||typeof t=="string"?Ti(t):Ti(JSON.stringify(t))},isNotModified(t,e){let r=t.header(re.IfNoneMatch);return r!=null&&r.indexOf(e)>-1?(t.set("cache",{hit:!0,match:r}),!0):!1}};var ce=()=>new K(404,"Not Found"),at=()=>new K(304,"Not modified"),n4=()=>new K(204,"No Content"),s4=t=>new K(200,"ok").json({id:t.id,correlationId:t.correlationId,message:"ok"});async function o4(t){let e=Xe.get(Xe.PublicUrlBase);if(e==null)return ce();let r={currentVersion:10.1,fullVersion:"10.1",owningSystemUrl:e},i=JSON.stringify(r),n=Buffer.from(i),o=Ne.key(n);if(Ne.isNotModified(t,o))return at();let a=new K(200,"ok");return a.header(re.CacheControl,"public, max-age=604800, stale-while-revalidate=86400"),a.buffer(n,"application/json"),t.set("bytes",n.byteLength),a}var c4=require("url");var dA=.2;function mA(t){return t.source.uri.endsWith(".tar.co")}var Sa=class{constructor(e){this.tms=e}async tile(e,r,i,n){let o=[];for(let a of e)if(mA(a))o.push({type:"cotar",asset:a,path:`tiles/${n}/${r}/${i}.webp`});else{let c=this.getTiles(a,r,i,n);if(c==null)continue;o=o.concat(c)}return o}getRasterTiffIntersection(e,r,i,n){let o=this.tms.tileToPixels(r,i),a=new Se(o.x,o.y,this.tms.tileSize,this.tms.tileSize),c=e.images[0].bbox,d=this.tms.sourceToPixels(c[0],c[3],n),p=this.tms.sourceToPixels(c[2],c[1],n),m=Se.fromUpperLeftLowerRight(d,p),v=m.intersection(a);return v==null?null:{tiff:m,intersection:v,tile:a}}createComposition(e,r,i,n,o){let a=Se.fromJson(e.getTileBounds(r,i)),c=a.scale(n,n).add(o.tiff).round(dA),d=c.intersection(o.tile);if(d==null)return null;let p=d.subtract(c);if(p.height<.5||p.width<.5)return null;let m=c.subtract(o.tile),v={type:"tiff",asset:e.tif,source:{x:r,y:i,imageId:e.id,width:a.width,height:a.height},y:Math.max(0,Math.round(m.y)),x:Math.max(0,Math.round(m.x))};if((a.width<e.tileSize.width||a.height<e.tileSize.height)&&(v.extract={width:a.width,height:a.height}),a.width!==c.width||a.height!==c.height){let x=c.width/a.width,w=c.height/a.height;v.resize={width:c.width,height:c.height,scaleX:x,scaleY:w}}return(p.y!==0||p.x!==0||p.height!==c.height||p.width!==c.width)&&(v.crop=p.toJson()),v}getTiles(e,r,i,n){let o=this.getRasterTiffIntersection(e,r,i,n);if(o==null)return null;let a=this.tms.pixelScale(n),c=e.getImageByResolution(a),d=a/c.resolution[0],p=o.intersection.subtract(o.tiff),{tileSize:m,tileCount:v}=c,x=[],w=1/d;for(let b of Sa.getRequiredTiles(p,d,m,v)){let E=this.createComposition(c,b.x,b.y,w,o);E!=null&&x.push(E)}return x.length===0?null:x}static*getRequiredTiles(e,r,i,n){let o=Math.max(Math.floor(e.x/i.width*r),0),a=Math.min(Math.ceil(e.right/i.width*r),n.x),c=Math.max(Math.floor(e.y/i.height*r),0),d=Math.min(Math.ceil(e.bottom/i.height*r),n.y);for(let p=o;p<a;p++)for(let m=c;m<d;m++)yield{x:p,y:m}}};var a4=[Le.Jpeg,Le.Webp,Le.Png];function c2(t){if(t==null)return null;let e=t.toLowerCase();return e===Le.Png?Le.Png:e===Le.Webp?Le.Webp:e===Le.Jpeg||e==="jpg"?Le.Jpeg:e===Le.Avif?Le.Avif:null}var lt={apiKey(t){let e=t.query.get(c1.ApiKey.QueryString)??t.header("X-LINZ-Api-Key"),r=s9(e);if(!r.valid)throw new K(400,"API Key Invalid: "+r.message);return t.set("api",e),e},getTileMatrixSet(t){return ar.find(t)},getRequestedFormats(t){let e=[...t.query.getAll("format"),...t.query.getAll("tileFormat")];if(e.length===0)return null;let r=new Set;for(let i of e){let n=c2(i);n!=null&&r.add(n)}return r.size===0?null:[...r.values()]},getTileFormat(t){let e=c2(t);return e||(t===lr.MapboxVectorTiles?lr.MapboxVectorTiles:null)},xyz(t){lt.apiKey(t),t.set("tileSet",t.params.tileSet);let e=parseInt(t.params.x,10),r=parseInt(t.params.y,10),i=parseInt(t.params.z,10),n=lt.getTileMatrixSet(t.params.tileMatrix);if(n==null)throw new K(404,"Tile Matrix not found");t.set("tileMatrix",n.identifier),t.set("projection",n.projection.code);let o=lt.getTileFormat(t.params.tileType);if(o==null)throw new K(404,"Tile extension not found");if(t.set("extension",o),isNaN(i)||i>n.maxZoom||i<0)throw new K(404,`Zoom not found: ${i}`);let a=n.zooms[i];if(isNaN(e)||e<0||e>a.matrixWidth)throw new K(404,`X not found: ${e}`);if(isNaN(r)||r<0||r>a.matrixHeight)throw new K(404,`Y not found: ${r}`);let c={tile:{x:e,y:r,z:i},tileSet:t.params.tileSet,tileMatrix:n,tileType:o};t.set("xyz",c.tile);let d=Pr.tileCenterToLatLon(n,c.tile);return t.set("location",d),c}};var xa=class{constructor(e){this.cacheA=new Map;this.cacheB=new Map;this.hits=0;this.misses=0;this.resets=0;this.clears=0;this._lastCheckedAt=-1;this.maxSize=e}get(e){let r=this.cacheA.get(e);if(r)return this.hits++,r;let i=this.cacheB.get(e);return i==null?(this.misses++,null):(this.hits++,this.cacheA.set(e,i),this.cacheB.delete(e),i)}clear(){this.cacheA.clear(),this.cacheB.clear(),this.clears++}set(e,r){this.cacheA.set(e,r),this.check()}check(){if(this._lastCheckedAt=Date.now(),!(this.maxSize<=0)&&!(this.currentSize<=this.maxSize)){if(this.resets++,this.resets>100)return this.resets=0,this.clear();this.cacheB=this.cacheA,this.cacheA=new Map}}get currentSize(){let e=0;for(let r of this.cacheA.values())e+=r.size;return e}};var f2=class{constructor(e){this.configProvider=e.then(r=>{let i=Pi.fromJson(r);return i.createVirtualTileSets(),i}).catch(r=>{if(r.code===404)return null;throw r})}get size(){return 1}},h2=class{constructor(e){this.cache=new xa(e)}get(e){let r=this.cache.get(e)?.configProvider;if(r!=null)return r;let i=ht.readJson(e),n=new f2(i);return this.cache.set(e,n),n.configProvider}},l4=new h2(20);var pA=new Set(["linz-workflow-artifacts","linz-basemaps","linz-basemaps-staging"]),gA=new Set(["s3","memory"]),Be=class{static async getDefaultConfig(){let e=vd();if(e.assets==null){let r=await e.ConfigBundle.get(e.ConfigBundle.id("latest"));r&&(e.assets=r.assets)}return e}static extract(e){let r=e.query.get("config");return r==null?null:r.includes("/")?jo.encode(Buffer.from(r)):r}static async load(e){let r=e.query.get("config");if(r==null)return this.getDefaultConfig();let i=Wu(r)?Buffer.from(jo.decode(r)).toString():r,n=Yt(i);if(n==null)throw new K(400,"Invalid config location");if(!gA.has(n.protocol))throw new K(400,`Invalid configuration location protocol:${n.protocol}`);if(!pA.has(n.bucket))throw new K(400,`Bucket: "${n.bucket}" is not a allowed bucket location`);return e.set("config",i),e.timer.start("config:load"),l4.get(i).then(o=>{if(e.timer.end("config:load"),o==null)throw new K(404,`Config not found at ${i}`);return o})}};var Ln={DateBefore:"date[before]",DateAfter:"date[after]"};function Ma(t){return{[Ln.DateBefore]:t.query.get(Ln.DateBefore)??void 0,[Ln.DateAfter]:t.query.get(Ln.DateAfter)??void 0}}function d2(t){return t.length===1?[new Date(`${t[0]}-01-01T00:00:00.000Z`),new Date(`${t[0]}-12-31T23:59:59.999Z`)]:[new Date(`${t[0]}-01-01T00:00:00.000Z`),new Date(`${t[1]}-12-31T23:59:59.999Z`)]}function u4(t){if(t==null)return null;let e=new Date(t);if(isNaN(e.getTime()))throw new K(400,`Invalid date format: "${t}"`);return e}function Ea(t,e){let r=t.query.get(Ln.DateAfter),i=t.query.get(Ln.DateBefore);if(r==null&&i==null)return e;let n=u4(r),o=u4(i),a=e.filter(c=>{if(c.title==null)return!1;let d=Ic(c.title);if(d==null)return!1;let p=d2(d),m=p[0],v=p[1];return(n==null||v>=n)&&(o==null||m<=o)});return t.set("layerFilter",{[Ln.DateBefore]:o?.toISOString(),[Ln.DateAfter]:n?.toISOString(),layerCount:e.length,filterCount:a.length}),a}function Hi(t,e,r){if(t==null)return"";let i=Xe.get(Xe.PublicUrlBase)??"";if(!t.startsWith("/"))return t;let n=new c4.URL(xt.join(i,t));return e&&n.searchParams.set("api",e),r&&n.searchParams.set("config",r),n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")}function yA(t,e,r,i){let n=JSON.parse(JSON.stringify(t.sources));for(let[o,a]of Object.entries(n)){if(a.type==="vector")a.url=Hi(a.url,e,r);else if(a.type==="raster"&&Array.isArray(a.tiles))for(let c=0;c<a.tiles.length;c++)a.tiles[c]=Hi(a.tiles[c],e,r);n[o]=a}return{version:8,id:t.id,name:t.name,sources:n,layers:i||t.layers,metadata:t.metadata??{},glyphs:Hi(t.glyphs,void 0,r),sprite:Hi(t.sprite,void 0,r)}}async function bA(t,e,r){let i=ar.find(t.query.get("tileMatrix")??Ie.identifier);if(i==null)return new K(400,"Invalid tile matrix");let[n]=lt.getRequestedFormats(t)??[Le.Webp];if(n==null)return new K(400,"Invalid image format");let o=Be.extract(t),a=As({config:o,api:r,...Ma(t)}),c=xt.join(Xe.get(Xe.PublicUrlBase)??"",`/v1/tiles/${e.name}/${i.identifier}/{z}/{x}/{y}.${n}${a}`),d=`basemaps-${e.name}`,p={version:8,sources:{[d]:{type:"raster",tiles:[c],tileSize:256}},layers:[{id:d,type:"raster",source:d}]},m=Buffer.from(JSON.stringify(p)),v=Ne.key(m);if(Ne.isNotModified(t,v))return at();let x=new K(200,"ok");return x.header(re.ETag,v),x.header(re.CacheControl,"no-store"),x.buffer(m,"application/json"),t.set("bytes",m.byteLength),x}async function m2(t){let e=lt.apiKey(t),r=t.params.styleName,i=t.query.getAll("exclude"),n=new Set(i.map(x=>x.toLowerCase())),o=await Be.load(t),a=o.Style.id(r),c=await o.Style.get(a);if(c==null){let x=await o.TileSet.get(o.TileSet.id(r));return x==null?ce():x.type!==it.Raster?ce():bA(t,x,e)}let d=yA(c.style,e,Be.extract(t),c.style.layers.filter(x=>!n.has(x.id.toLowerCase()))),p=Buffer.from(JSON.stringify(d)),m=Ne.key(p);if(Ne.isNotModified(t,m))return at();let v=new K(200,"ok");return v.header(re.ETag,m),v.header(re.CacheControl,"no-store"),v.buffer(p,"application/json"),t.set("bytes",p.byteLength),v}function vA(t,e){let r=Xe.get(Xe.PublicUrlBase)??"",i=`/v1/arcgis/rest/services/${t}/VectorTileServer`,n=new URL(ht.join(r,i));return n.searchParams.set("api",e),n.searchParams.set("f","json"),n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")}function wA(t,e,r){let i=JSON.parse(JSON.stringify(e.sources));for(let[o,a]of Object.entries(i))a.type==="vector"?(a.url=vA(t,r),i[o]=a):delete i[o];let n=[];for(let o of e.layers)o.source!=null&&!i.hasOwnProperty(o.source)||n.push(o);return{version:8,id:e.id,name:e.name,sources:i,layers:n,metadata:e.metadata??{},glyphs:Hi(e.glyphs),sprite:Hi(e.sprite)}}async function f4(t){let e=lt.apiKey(t),r=await Be.load(t),i=await r.TileSet.get(r.TileSet.id(t.params.tileSet));if(i?.type!==it.Vector)return ce();let n=t.query.get("style"),o=n||"topographic",a=r.Style.id(o),c=await r.Style.get(a);if(c==null)return ce();let d=wA(i.name,c.style,e),p=Buffer.from(JSON.stringify(d)),m=Ne.key(p);if(Ne.isNotModified(t,m))return at();let v=new K(200,"ok");return v.header(re.ETag,m),v.header(re.CacheControl,"no-store"),v.buffer(p,"application/json"),t.set("bytes",p.byteLength),v}var _A=18,SA=1;async function h4(t){let e=await Be.load(t),r=await e.TileSet.get(e.TileSet.id(t.params.tileSet));if(r?.type!==it.Vector)return ce();let i=lt.apiKey(t);if(t.query.get("f")!=="json")return ce();let o={xmin:Ie.extent.x,ymin:Ie.extent.y,xmax:Ie.extent.right,ymax:Ie.extent.bottom,spatialReference:{wkid:102100,latestWkid:Ie.projection.code}},a={currentVersion:10.81,name:r.name,capabilities:"TilesOnly",type:"indexedVector",defaultStyles:"",tiles:[Hi(`/v1/tiles/${r.name}/WebMercatorQuad/{z}/{x}/{y}.pbf`,i)],exportTilesAllowed:!1,maxExportTilesCount:0,initialExtent:o,fullExtent:o,minScale:0,maxScale:0,tileInfo:{rows:512,cols:512,dpi:96,format:"pbf",origin:{x:Ie.extent.x,y:Ie.extent.bottom},spatialReference:{wkid:102100,latestWkid:Ie.projection.code},lods:Ie.zooms.slice(SA,_A).map((m,v)=>({level:v,resolution:m.scaleDenominator*28e-5,scale:m.scaleDenominator}))},maxzoom:22,minLOD:0,maxLOD:15,resourceInfo:{styleVersion:8,tileCompression:"gzip",cacheInfo:{storageInfo:{packetSize:128,storageFormat:"compactV2"}}}},c=JSON.stringify(a,null,2),d=Buffer.from(c),p=new K(200,"ok");return p.header(re.CacheControl,"no-store"),p.buffer(d,"application/json"),t.set("bytes",d.byteLength),p}var xA=1+1e-10,d4=10**8;function p2(t){return Math.round(t*d4)/d4}function MA(t){return[p2(t[0]),p2(t[1])]}function EA(t,e,r){if(An.delta(t[0],t[2])<=0)return An.bboxToMultiPolygon(t);let i=[];for(let a of e)i.push(Se.fromJson(a).pad(xA).toPolygon());let n=Yg(i);return Pc(n,a=>MA(r.toWgs84(a)))}function RA(t){if(t!=null)return[{name:t.serviceProvider.name,url:t.serviceProvider.site,roles:["host"]}]}async function CA(t,e,r){let i=Pr.get(r),n=[],o=[],a=await Be.load(t),c=await ys(a,e.layers,[r.projection]),d=Ea(t,e.layers),p=await a.Provider.get(a.Provider.id("linz"));for(let m of d){if(m.disabled)continue;let v=m[i.epsg.code];if(v==null)continue;let x=c.get(v);if(x==null)continue;let w=x.title,b=i.boundsToWgs84BoundingBox(x.bounds).map(p2),E={spatial:{bbox:[b]}},A={type:"Feature",stac_version:R1.Version,id:v+"_item",collection:v,assets:{},links:[],bbox:b,geometry:{type:"MultiPolygon",coordinates:EA(b,x.files,i)},properties:{title:w,category:x.category}},C=Ic(x.title)??c6(x.name);if(C){let k=d2(C);E.temporal={interval:[[k[0].toISOString(),k[1].toISOString()]]},A.properties.datetime=null,A.properties.start_datetime=k[0].toISOString(),A.properties.end_datetime=k[1].toISOString()}o.push(A);let P=At.convertZoomLevel(m.minZoom?m.minZoom:0,Ie,r,!0),L=At.convertZoomLevel(m.maxZoom?m.maxZoom:32,Ie,r,!0);n.push({stac_version:R1.Version,license:R1.License,id:x.id,providers:RA(p),title:w,description:"No description",extent:E,links:[],summaries:{"linz:category":x.category,"linz:zoom":{min:P,max:L},"linz:priority":[1e3+e.layers.indexOf(m)]}})}return{id:e.id,type:"FeatureCollection",stac_version:R1.Version,stac_extensions:["single-file-stac"],title:e.title??"No title",description:e.description??"No Description",features:o,collections:n,links:[]}}async function g2(t){let e=lt.getTileMatrixSet(t.params.tileMatrix);if(e==null)throw new K(404,"Tile Matrix not found");let r=await Be.load(t);t.timer.start("tileset:load");let i=await r.TileSet.get(r.TileSet.id(t.params.tileSet));if(t.timer.end("tileset:load"),i==null||i.type===it.Vector)return ce();let n=Ne.key(i);if(Ne.isNotModified(t,n))return at();t.timer.start("stac:load");let o=await CA(t,i,e);if(t.timer.end("stac:load"),o==null)return ce();let a=new K(200,"ok");return a.header(re.ETag,n),a.header(re.CacheControl,"public, max-age=604800, stale-while-revalidate=86400"),a.json(o),a}async function m4(t,e){let r=Buffer.from(JSON.stringify(e)),i=Ne.key(r);if(Ne.isNotModified(t,i))return at();let n=new K(200,"ok");return n.header(re.ETag,i),n.header(re.CacheControl,"no-store"),n.buffer(r,"application/json"),t.set("bytes",r.byteLength),n}async function p4(t){let e=await Be.load(t);t.timer.start("tileset:load");let r=await e.TileSet.get(e.TileSet.id(t.params.tileSet));return t.timer.end("tileset:load"),r==null?ce():m4(t,r)}async function g4(t){let e=await Be.load(t);t.timer.start("tileset:load");let r=await e.TileSet.get(e.TileSet.id(t.params.tileSet));if(t.timer.end("tileset:load"),r==null)return ce();t.timer.start("imagery:load");let i=await e.Imagery.get(e.Imagery.id(t.params.imageryId));if(t.timer.end("imagery:load"),i==null){let n=r.layers.find(c=>c.name===t.params.imageryId||ai(c.name)===t.params.imageryId);if(n==null)return ce();let o=ar.find(t.query.get("tileMatrix")??Ie.identifier);if(o==null)return ce();let a=n[o.projection.code];if(a==null)return ce();t.timer.start("imagery:load:sub"),i=await e.Imagery.get(e.Imagery.id(a)),t.timer.end("imagery:load:sub")}return i==null?ce():m4(t,i)}var C2=me(require("path"),1);var It;(function(t){t.NONE="application/octet-stream",t.JPEG="image/jpeg",t.JP2="image/jp2",t.JPEGXL="image/jpegxl",t.WEBP="image/webp",t.ZSTD="application/zstd",t.LZW="application/lzw",t.DEFLATE="application/deflate",t.LZERC="application/lerc",t.LZMA="application/x-lzma"})(It||(It={}));var y2={1:It.NONE,5:It.LZW,6:It.JPEG,7:It.JPEG,8:It.DEFLATE,34887:It.LZERC,34925:It.LZMA,34712:It.JP2,5e4:It.ZSTD,50001:It.WEBP,50002:It.JPEGXL};var ae;(function(t){t[t.Artist=315]="Artist",t[t.BitsPerSample=258]="BitsPerSample",t[t.CellLength=265]="CellLength",t[t.CellWidth=264]="CellWidth",t[t.ColorMap=320]="ColorMap",t[t.Compression=259]="Compression",t[t.Copyright=33432]="Copyright",t[t.DateTime=306]="DateTime",t[t.ExtraSamples=338]="ExtraSamples",t[t.FillOrder=266]="FillOrder",t[t.FreeByteCounts=289]="FreeByteCounts",t[t.FreeOffsets=288]="FreeOffsets",t[t.GrayResponseCurve=291]="GrayResponseCurve",t[t.GrayResponseUnit=290]="GrayResponseUnit",t[t.HostComputer=316]="HostComputer",t[t.ImageDescription=270]="ImageDescription",t[t.ImageHeight=257]="ImageHeight",t[t.ImageWidth=256]="ImageWidth",t[t.Make=271]="Make",t[t.MaxSampleValue=281]="MaxSampleValue",t[t.MinSampleValue=280]="MinSampleValue",t[t.Model=272]="Model",t[t.NewSubFileType=254]="NewSubFileType",t[t.Orientation=274]="Orientation",t[t.PhotometricInterpretation=262]="PhotometricInterpretation",t[t.PlanarConfiguration=284]="PlanarConfiguration",t[t.ResolutionUnit=296]="ResolutionUnit",t[t.RowsPerStrip=278]="RowsPerStrip",t[t.SamplesPerPixel=277]="SamplesPerPixel",t[t.Software=305]="Software",t[t.StripByteCounts=279]="StripByteCounts",t[t.StripOffsets=273]="StripOffsets",t[t.SubFileType=255]="SubFileType",t[t.Threshholding=263]="Threshholding",t[t.XResolution=282]="XResolution",t[t.YResolution=283]="YResolution",t[t.BadFaxLines=326]="BadFaxLines",t[t.CleanFaxData=327]="CleanFaxData",t[t.ClipPath=343]="ClipPath",t[t.ConsecutiveBadFaxLines=328]="ConsecutiveBadFaxLines",t[t.Decode=433]="Decode",t[t.DefaultImageColor=434]="DefaultImageColor",t[t.DocumentName=269]="DocumentName",t[t.DotRange=336]="DotRange",t[t.HalftoneHints=321]="HalftoneHints",t[t.Indexed=346]="Indexed",t[t.JPEGTables=347]="JPEGTables",t[t.PageName=285]="PageName",t[t.PageNumber=297]="PageNumber",t[t.Predictor=317]="Predictor",t[t.PrimaryChromaticities=319]="PrimaryChromaticities",t[t.ReferenceBlackWhite=532]="ReferenceBlackWhite",t[t.SampleFormat=339]="SampleFormat",t[t.SMinSampleValue=340]="SMinSampleValue",t[t.SMaxSampleValue=341]="SMaxSampleValue",t[t.StripRowCounts=559]="StripRowCounts",t[t.SubIFDs=330]="SubIFDs",t[t.T4Options=292]="T4Options",t[t.T6Options=293]="T6Options",t[t.TileByteCounts=325]="TileByteCounts",t[t.TileHeight=323]="TileHeight",t[t.TileOffsets=324]="TileOffsets",t[t.TileWidth=322]="TileWidth",t[t.TransferFunction=301]="TransferFunction",t[t.WhitePoint=318]="WhitePoint",t[t.XClipPathUnits=344]="XClipPathUnits",t[t.XPosition=286]="XPosition",t[t.YCbCrCoefficients=529]="YCbCrCoefficients",t[t.YCbCrPositioning=531]="YCbCrPositioning",t[t.YCbCrSubSampling=530]="YCbCrSubSampling",t[t.YClipPathUnits=345]="YClipPathUnits",t[t.YPosition=287]="YPosition",t[t.ApertureValue=37378]="ApertureValue",t[t.ColorSpace=40961]="ColorSpace",t[t.DateTimeDigitized=36868]="DateTimeDigitized",t[t.DateTimeOriginal=36867]="DateTimeOriginal",t[t.ExifIFD=34665]="ExifIFD",t[t.ExifVersion=36864]="ExifVersion",t[t.ExposureTime=33434]="ExposureTime",t[t.FileSource=41728]="FileSource",t[t.Flash=37385]="Flash",t[t.FlashpixVersion=40960]="FlashpixVersion",t[t.FNumber=33437]="FNumber",t[t.ImageUniqueID=42016]="ImageUniqueID",t[t.LightSource=37384]="LightSource",t[t.MakerNote=37500]="MakerNote",t[t.ShutterSpeedValue=37377]="ShutterSpeedValue",t[t.UserComment=37510]="UserComment",t[t.IPTC=33723]="IPTC",t[t.ICCProfile=34675]="ICCProfile",t[t.XMP=700]="XMP",t[t.GDAL_METADATA=42112]="GDAL_METADATA",t[t.GDAL_NODATA=42113]="GDAL_NODATA",t[t.Photoshop=34377]="Photoshop",t[t.ModelPixelScale=33550]="ModelPixelScale",t[t.ModelTiePoint=33922]="ModelTiePoint",t[t.ModelTransformation=34264]="ModelTransformation",t[t.GeoKeyDirectory=34735]="GeoKeyDirectory",t[t.GeoDoubleParams=34736]="GeoDoubleParams",t[t.GeoAsciiParams=34737]="GeoAsciiParams"})(ae||(ae={}));var tl;(function(t){t[t.GTModelTypeGeoKey=1024]="GTModelTypeGeoKey",t[t.GTRasterTypeGeoKey=1025]="GTRasterTypeGeoKey",t[t.GTCitationGeoKey=1026]="GTCitationGeoKey",t[t.GeographicTypeGeoKey=2048]="GeographicTypeGeoKey",t[t.GeogCitationGeoKey=2049]="GeogCitationGeoKey",t[t.GeogGeodeticDatumGeoKey=2050]="GeogGeodeticDatumGeoKey",t[t.GeogPrimeMeridianGeoKey=2051]="GeogPrimeMeridianGeoKey",t[t.GeogLinearUnitsGeoKey=2052]="GeogLinearUnitsGeoKey",t[t.GeogLinearUnitSizeGeoKey=2053]="GeogLinearUnitSizeGeoKey",t[t.GeogAngularUnitsGeoKey=2054]="GeogAngularUnitsGeoKey",t[t.GeogAngularUnitSizeGeoKey=2055]="GeogAngularUnitSizeGeoKey",t[t.GeogEllipsoidGeoKey=2056]="GeogEllipsoidGeoKey",t[t.GeogSemiMajorAxisGeoKey=2057]="GeogSemiMajorAxisGeoKey",t[t.GeogSemiMinorAxisGeoKey=2058]="GeogSemiMinorAxisGeoKey",t[t.GeogInvFlatteningGeoKey=2059]="GeogInvFlatteningGeoKey",t[t.GeogAzimuthUnitsGeoKey=2060]="GeogAzimuthUnitsGeoKey",t[t.GeogPrimeMeridianLongGeoKey=2061]="GeogPrimeMeridianLongGeoKey",t[t.GeogTOWGS84GeoKey=2062]="GeogTOWGS84GeoKey",t[t.ProjectedCSTypeGeoKey=3072]="ProjectedCSTypeGeoKey",t[t.PCSCitationGeoKey=3073]="PCSCitationGeoKey",t[t.ProjectionGeoKey=3074]="ProjectionGeoKey",t[t.ProjCoordTransGeoKey=3075]="ProjCoordTransGeoKey",t[t.ProjLinearUnitsGeoKey=3076]="ProjLinearUnitsGeoKey",t[t.ProjLinearUnitSizeGeoKey=3077]="ProjLinearUnitSizeGeoKey",t[t.ProjStdParallel1GeoKey=3078]="ProjStdParallel1GeoKey",t[t.ProjStdParallel2GeoKey=3079]="ProjStdParallel2GeoKey",t[t.ProjNatOriginLongGeoKey=3080]="ProjNatOriginLongGeoKey",t[t.ProjNatOriginLatGeoKey=3081]="ProjNatOriginLatGeoKey",t[t.ProjFalseEastingGeoKey=3082]="ProjFalseEastingGeoKey",t[t.ProjFalseNorthingGeoKey=3083]="ProjFalseNorthingGeoKey",t[t.ProjFalseOriginLongGeoKey=3084]="ProjFalseOriginLongGeoKey",t[t.ProjFalseOriginLatGeoKey=3085]="ProjFalseOriginLatGeoKey",t[t.ProjFalseOriginEastingGeoKey=3086]="ProjFalseOriginEastingGeoKey",t[t.ProjFalseOriginNorthingGeoKey=3087]="ProjFalseOriginNorthingGeoKey",t[t.ProjCenterLongGeoKey=3088]="ProjCenterLongGeoKey",t[t.ProjCenterLatGeoKey=3089]="ProjCenterLatGeoKey",t[t.ProjCenterEastingGeoKey=3090]="ProjCenterEastingGeoKey",t[t.ProjCenterNorthingGeoKey=3091]="ProjCenterNorthingGeoKey",t[t.ProjScaleAtNatOriginGeoKey=3092]="ProjScaleAtNatOriginGeoKey",t[t.ProjScaleAtCenterGeoKey=3093]="ProjScaleAtCenterGeoKey",t[t.ProjAzimuthAngleGeoKey=3094]="ProjAzimuthAngleGeoKey",t[t.ProjStraightVertPoleLongGeoKey=3095]="ProjStraightVertPoleLongGeoKey",t[t.ProjRectifiedGridAngleGeoKey=3096]="ProjRectifiedGridAngleGeoKey",t[t.VerticalCSTypeGeoKey=4096]="VerticalCSTypeGeoKey",t[t.VerticalCitationGeoKey=4097]="VerticalCitationGeoKey",t[t.VerticalDatumGeoKey=4098]="VerticalDatumGeoKey",t[t.VerticalUnitsGeoKey=4099]="VerticalUnitsGeoKey"})(tl||(tl={}));var Ae;(function(t){t[t.BYTE=1]="BYTE",t[t.ASCII=2]="ASCII",t[t.SHORT=3]="SHORT",t[t.LONG=4]="LONG",t[t.RATIONAL=5]="RATIONAL",t[t.SBYTE=6]="SBYTE",t[t.UNDEFINED=7]="UNDEFINED",t[t.SSHORT=8]="SSHORT",t[t.SLONG=9]="SLONG",t[t.SRATIONAL=10]="SRATIONAL",t[t.FLOAT=11]="FLOAT",t[t.DOUBLE=12]="DOUBLE",t[t.LONG8=16]="LONG8",t[t.SLONG8=17]="SLONG8",t[t.IFD8=18]="IFD8"})(Ae||(Ae={}));var y4=me(v2(),1);function b4(t){switch(t){case Ae.BYTE:case Ae.ASCII:case Ae.SBYTE:case Ae.UNDEFINED:return 1;case Ae.SHORT:case Ae.SSHORT:return 2;case Ae.LONG:case Ae.SLONG:case Ae.FLOAT:return 4;case Ae.RATIONAL:case Ae.SRATIONAL:case Ae.DOUBLE:case Ae.LONG8:case Ae.SLONG8:case Ae.IFD8:return 8;default:throw new Error(`Invalid fieldType ${t}`)}}var Ns={char:(t,e)=>String.fromCharCode(t.getUint8(e)),uint8:(t,e)=>t.getUint8(e),uint16:(t,e)=>t.getUint16(e),uint32:(t,e)=>t.getUint32(e),uint64:(t,e)=>t.getUint64(e),double:(t,e)=>y4.read(t.bytes(e,we.Double),0,t.isLittleEndian,52,8),rational:(t,e)=>[t.getUint32(e),t.getUint32(e+4)]};function Zc(t){switch(t){case Ae.ASCII:return Ns.char;case Ae.BYTE:case Ae.UNDEFINED:case Ae.SBYTE:return Ns.uint8;case Ae.SHORT:case Ae.SSHORT:return Ns.uint16;case Ae.LONG:case Ae.SLONG:return Ns.uint32;case Ae.RATIONAL:case Ae.SRATIONAL:return Ns.rational;case Ae.DOUBLE:return Ns.double;case Ae.LONG8:return Ns.uint64;default:throw new Error(`Unknown read type "${t}" "${Ae[t]}"`)}}var kn=class{constructor(e,r,i){this.tiff=r,this.byteOffset=i,this.id=e,this.name=ae[this.id],this.dataType=this.tiff.source.getUint16(i+2),this.dataCount=this.tiff.source.getUint(i+4,this.tiff.ifdConfig.pointer),this.dataTypeSize=b4(this.dataType),this.dataLength=this.dataTypeSize*this.dataCount}get hasBytes(){return this.tiff.source.hasBytes(this.valuePointer,this.dataLength)}get isReady(){return!0}get dataTypeName(){return Ae[this.dataType]}get valuePointer(){let e=this.size-this.tiff.ifdConfig.pointer;return this.isValueInline?this.byteOffset+e:this.tiff.source.getUint(this.byteOffset+e,this.tiff.ifdConfig.pointer)}get size(){return this.tiff.ifdConfig.ifd}get isValueInline(){return this.dataLength<=this.tiff.ifdConfig.pointer}readValue(){let e=this.valuePointer,r=this.dataTypeSize,i=Zc(this.dataType),n=this.dataCount,o=n*r;if(n===1)return i(this.tiff.source,e);let a=[];for(let c=0;c<o;c+=r)a.push(i(this.tiff.source,e+c));return this.dataType===Ae.ASCII?a.join("").trim():a}toJSON(){return{id:this.id,name:this.name,offset:this.byteOffset,isReady:this.isReady,type:this.dataTypeName,value:this.value}}};var Bs=class extends kn{constructor(){super(...arguments),this.value=null}get isReady(){return this.value!=null}async fetch(){return this.tiff.source.hasBytes(this.valuePointer,this.dataLength)===!1&&await this.tiff.source.loadBytes(this.valuePointer,this.dataLength),this.value=this.readValue(),this.value}};var rl=class extends kn{constructor(e,r,i){super(e,r,i),this.loadedValues=null}get value(){return this.loadedValues!=null?this.loadedValues:this.hasBytes?(this.readValue(),this.loadedValues):null}async load(){await this.tiff.source.loadBytes(this.valuePointer,this.dataLength),this.readValue()}readValue(){let e=super.readValue();return typeof e=="number"?this.loadedValues=[e]:this.loadedValues=e,this.loadedValues}async getValueAt(e){if(this.loadedValues)return this.loadedValues[e];let r=this.dataTypeSize,i=this.valuePointer+r*e,n=Zc(this.dataType);return this.tiff.source.hasBytes(i,r)||await this.tiff.source.loadBytes(i,r),n(this.tiff.source,i)}};var il=class extends kn{constructor(){super(...arguments),this._isRead=!1,this._value=null}get value(){return this._isRead===!1&&(this._value=this.readValue(),this._isRead=!0),this._value}};var Yc={create(t,e){let r=t.source.getUint16(e);if(r===ae.TileOffsets||r===ae.TileByteCounts||r===ae.StripByteCounts||r===ae.StripOffsets)return new rl(r,t,e);let i=new il(r,t,e);return i.hasBytes?i:new Bs(r,t,e)},isStatic(t){return t instanceof il},isLazy(t){return t instanceof Bs},isOffsetArray(t){return t instanceof rl}};var AA=32767,Xc=class{constructor(e,r,i){this.tagsGeoLoaded=!1,this.tagsGeo=new Map,this.tif=e,this.id=r,this.tags=i}async init(e=!1){let r=[this.fetch(ae.Compression),this.fetch(ae.ImageHeight),this.fetch(ae.ImageWidth),this.fetch(ae.ModelPixelScale),this.fetch(ae.ModelTiePoint),this.fetch(ae.ModelTransformation),this.fetch(ae.TileHeight),this.fetch(ae.TileWidth)];e&&(r.push(this.fetch(ae.GeoKeyDirectory)),r.push(this.fetch(ae.GeoAsciiParams)),r.push(this.fetch(ae.GeoDoubleParams))),await Promise.all(r),e&&await this.loadGeoTiffTags()}value(e){let r=this.tags.get(e);return r==null?null:r.value}async loadGeoTiffTags(){if(this.tagsGeoLoaded)return;let e=this.tags.get(ae.GeoKeyDirectory);if(e==null){this.tagsGeoLoaded=!0;return}if(!e.isReady&&e instanceof Bs&&await Promise.all([this.fetch(ae.GeoKeyDirectory),this.fetch(ae.GeoAsciiParams),this.fetch(ae.GeoDoubleParams)]),this.tagsGeoLoaded=!0,e.value==null)return;let r=e.value;if(!Array.isArray(r))throw new Error("Invalid geo tags found");for(let i=4;i<=r[3]*4;i+=4){let n=r[i],o=r[i+1],a=r[i+3];if(o===0){this.tagsGeo.set(n,a);continue}let c=this.tags.get(o);if(c==null||c.value==null)continue;let d=r[i+2];Array.isArray(c.value)?this.tagsGeo.set(n,c.value[a+d-1]):typeof c.value=="string"&&this.tagsGeo.set(n,c.value.substr(a,a+d-1).trim())}}valueGeo(e){if(this.tagsGeoLoaded===!1)throw new Error("loadGeoTiffTags() has not been called");return this.tagsGeo.get(e)}async fetch(e){let r=this.tags.get(e);return r==null?null:Yc.isLazy(r)?r.fetch():r.value}get origin(){let e=this.value(ae.ModelTiePoint);if(e!=null&&e.length===6)return[e[3],e[4],e[5]];let r=this.value(ae.ModelTransformation);if(r!=null)return[r[3],r[7],r[11]];if(this.value(ae.NewSubFileType)===1&&this.id!==0)return this.tif.images[0].origin;throw new Error("Image does not have a geo transformation.")}get isGeoLocated(){return this.value(ae.ModelPixelScale)!=null||this.value(ae.ModelTransformation)!=null?!0:this.value(ae.NewSubFileType)===1&&this.id!==0?this.tif.images[0].isGeoLocated:!1}get resolution(){let e=this.value(ae.ModelPixelScale);if(e!=null)return[e[0],-e[1],e[2]];let r=this.value(ae.ModelTransformation);if(r!=null)return[r[0],r[5],r[10]];if(this.value(ae.NewSubFileType)===1&&this.id!==0){let i=this.tif.images[0],[n,o,a]=i.resolution,c=i.size,d=this.size;return[n*c.width/d.width,o*c.height/d.height,a]}throw new Error("Image does not have a geo transformation.")}get bbox(){let e=this.size,r=this.origin,i=this.resolution;if(r==null||e==null||i==null)throw new Error("Unable to calculate bounding box");let n=r[0],o=r[1],a=n+i[0]*e.width,c=o+i[1]*e.height;return[Math.min(n,a),Math.min(o,c),Math.max(n,a),Math.max(o,c)]}get compression(){let e=this.value(ae.Compression);return e==null||typeof e!="number"?null:y2[e]}get epsg(){let e=this.valueGeo(tl.ProjectedCSTypeGeoKey);return e===AA?null:e}get size(){return{width:this.value(ae.ImageWidth),height:this.value(ae.ImageHeight)}}get tagList(){return[...this.tags.keys()].map(e=>ae[e])}isTiled(){return this.value(ae.TileWidth)!==null}get tileSize(){return{width:this.value(ae.TileWidth),height:this.value(ae.TileHeight)}}get tileCount(){let e=this.size,r=this.tileSize,i=Math.ceil(e.width/r.width),n=Math.ceil(e.height/r.height);return{x:i,y:n}}get tileOffset(){let e=this.tags.get(ae.TileOffsets);if(e==null)throw new Error("No tile offsets found");return e}get stripCount(){let e=this.tags.get(ae.StripByteCounts);return e==null?0:e.dataCount}async getTileOffset(e){let r=this.tileOffset;if(e<0||e>r.dataCount)throw new Error(`Tile offset: ${e} out of range: 0 -> ${r.dataCount}`);return r.getValueAt(e)}getTileBounds(e,r){let{size:i,tileSize:n}=this,o=r*n.height,a=e*n.width,c=a+n.width>=i.width?i.width-a:n.width,d=o+n.height>=i.height?i.height-o:n.height;return{x:a,y:o,width:c,height:d}}async getStrip(e){if(this.isTiled())throw new Error("Cannot read stripes, tiff is tiled");let r=this.tags.get(ae.StripByteCounts),i=this.tags.get(ae.StripOffsets);if(e>=r.dataCount)throw new Error("Cannot read strip, index out of bounds");let[n,o]=await Promise.all([i.getValueAt(e),r.getValueAt(e)]);return this.getBytes(n,o)}getJpegHeader(e){let r=this.value(ae.JPEGTables);if(r==null)throw new Error("Unable to find Jpeg header");let i=r.slice(0,r.length-2),n=new Uint8Array(e.byteLength+i.length-2);return n.set(i,0),n.set(e.slice(2),i.length),n}async getBytes(e,r){let i=this.compression;if(i==null)throw new Error("Unsupported compression: "+this.value(ae.Compression));if(r===0)return null;await this.tif.source.loadBytes(e,r);let n=this.tif.source.bytes(e,r);return this.compression===It.JPEG?{mimeType:i,bytes:this.getJpegHeader(n)}:{mimeType:i,bytes:n}}async getTile(e,r){let i=this.compression,n=this.size,o=this.tileSize;if(o==null)throw new Error("Tiff is not tiled");if(i==null)throw new Error("Unsupported compression: "+this.value(ae.Compression));let a=Math.ceil(n.height/o.height),c=Math.ceil(n.width/o.width);if(e>=c||r>=a)throw new Error(`Tile index is outside of range x:${e} >= ${c} or y:${r} >= ${a}`);let d=r*c+e,p=c*a;if(d>=p)throw new Error(`Tile index is outside of tile range: ${d} >= ${p}`);let{offset:m,imageSize:v}=await this.getTileSize(d);return this.getBytes(m,v)}async hasTile(e,r){let i=this.tileSize,n=this.size;if(i==null)throw new Error("Tiff is not tiled");let o=Math.ceil(n.height/i.height),a=Math.ceil(n.width/i.width);if(e>=a||r>=o)return!1;let c=r*a+e;return(await this.getTileSize(c)).offset>0}async getTileSize(e){let r=this.tif.options.tileLeaderByteSize;if(r){let a=await this.getTileOffset(e);return a===0?{offset:0,imageSize:0}:(await this.tif.source.loadBytes(a-r,r),{offset:a,imageSize:this.tif.source.getUint(a-r,r)})}let i=this.tags.get(ae.TileByteCounts);if(i==null)throw new Error("No tile byte counts found");let[n,o]=await Promise.all([this.getTileOffset(e),i.getValueAt(e)]);return{offset:n,imageSize:o}}};var nl;(function(t){t[t.Big=19789]="Big",t[t.Little=18761]="Little"})(nl||(nl={}));var Lr;(function(t){t[t.BigTiff=43]="BigTiff",t[t.Tiff=42]="Tiff"})(Lr||(Lr={}));var Ra;(function(t){t.GDAL_STRUCTURAL_METADATA_SIZE="GDAL_STRUCTURAL_METADATA_SIZE",t.LAYOUT="LAYOUT",t.BLOCK_ORDER="BLOCK_ORDER",t.BLOCK_LEADER="BLOCK_LEADER",t.BLOCK_TRAILER="BLOCK_TRAILER",t.KNOWN_INCOMPATIBLE_EDITION="KNOWN_INCOMPATIBLE_EDITION",t.MASK_INTERLEAVED_WITH_IMAGERY="MASK_INTERLEAVED_WITH_IMAGERY"})(Ra||(Ra={}));var v4;(function(t){t.RowMajor="ROW_MAJOR"})(v4||(v4={}));var w2;(function(t){t.uint32="SIZE_AS_UINT4"})(w2||(w2={}));var Qc=class{constructor(){this.options=new Map}get isCogOptimized(){return this.isBroken?!1:this.options.get(Ra.LAYOUT)==="IFDS_BEFORE_DATA"}get isBroken(){return this.options.get(Ra.KNOWN_INCOMPATIBLE_EDITION)==="YES"}process(e){let r="",i="",n=!1;for(let o=0;o<e.length;o++){let a=e[o];if(a===0)break;let c=String.fromCharCode(a);c===`
|
|
188
|
-
`?(this.options.set(r.trim(),i.trim()),r="",i="",n=!1):c==="="?n=!0:n?i+=c:r+=c}}get tileLeaderByteSize(){switch(this.options.get(Ra.BLOCK_LEADER)){case w2.uint32:return we.UInt32;default:return null}}get isMaskInterleaved(){return this.options.get(Ra.MASK_INTERLEAVED_WITH_IMAGERY)==="YES"}};var _2={version:Lr.Tiff,pointer:we.UInt32,offset:we.UInt16,ifd:we.UInt16+we.UInt16+2*we.UInt32},S2={version:Lr.BigTiff,pointer:we.UInt64,offset:we.UInt64,ifd:we.UInt16+we.UInt16+2*we.UInt64},n$={[Lr.BigTiff]:S2,[Lr.Tiff]:_2};var x2=me(v2(),1),ef=class{constructor(e,r=0){this.tiff=e,this.byteOffset=r,this.relativeOffset=0}get currentOffset(){return this.byteOffset+this.relativeOffset}seekTo(e){return this.byteOffset=e,this.relativeOffset=0,this}seek(e){let r=this.currentOffset;return this.relativeOffset+=e,r}bytes(e){return this.tiff.source.bytes(this.seek(e),e)}uint(e){return this.tiff.source.getUint(this.seek(e),e)}uint8(){return this.tiff.source.getUint8(this.seek(we.UInt8))}uint16(){return this.tiff.source.getUint16(this.seek(we.UInt16))}uint32(){return this.tiff.source.getUint32(this.seek(we.UInt32))}uint64(){return this.tiff.source.getUint64(this.seek(we.UInt64))}pointer(){let e=this.tiff.ifdConfig.pointer;return this.tiff.source.getUint(this.seek(e),e)}offset(){let e=this.tiff.ifdConfig.offset;return this.tiff.source.getUint(this.seek(e),e)}float(){return x2.read(this.bytes(we.Float),0,this.tiff.source.isLittleEndian,23,4)}double(){return x2.read(this.bytes(we.Double),0,this.tiff.source.isLittleEndian,52,8)}};function w4(t,e=4,r=!0){let i=t.toString(16).padStart(e,"0");return r?"0x"+i:i}var Ca=class{constructor(e){this.version=Lr.Tiff,this.images=[],this.options=new Qc,this.ifdConfig=_2,this.isInitialized=!1,this.source=e,this.cursor=new ef(this)}static create(e){return new Ca(e).init()}init(e=!1){return this._initPromise?this._initPromise:(this._initPromise=this.doInit(e),this._initPromise)}async doInit(e=!1){return this.isInitialized?this:(await this.source.loadBytes(0,this.source.chunkSize),await this.fetchIfd(),await Promise.all(this.images.map(r=>r.init(e))),this.isInitialized=!0,this)}async fetchIfd(){let e=this.cursor.seekTo(0),r=e.uint16();if(this.source.isLittleEndian=r===nl.Little,!this.source.isLittleEndian)throw new Error("Only little endian is supported");this.version=e.uint16();let i;if(this.version===Lr.BigTiff){if(this.ifdConfig=S2,e.uint16()!==8)throw new Error("Only 8byte pointers are supported");if(e.uint16()!==0)throw new Error("Invalid big tiff header");i=e.pointer()}else if(this.version===Lr.Tiff)i=e.pointer();else throw new Error(`Only tiff supported version:${this.version}`);let n=i-this.cursor.currentOffset;return n>0&&n<16*1024&&this.options.process(e.bytes(n)),this.processIfd(i)}getImage(e){return this.images[e]}getImageByResolution(e){let r=this.images[0],i=r.size,[n]=r.resolution,o=n*i.width;for(let a=this.images.length-1;a>0;a--){let c=this.images[a],d=c.size;if(o/d.width-e<=.01)return c}return r}async getTile(e,r,i){let n=this.getImage(i);if(n==null)throw new Error(`Missing z: ${i}`);if(!n.isTiled())throw new Error("Tif is not tiled");return n.getTile(e,r)}async processIfd(e){let{image:r,nextOffset:i}=await this.readIfd(e);this.images.push(r),i&&await this.processIfd(i)}async readIfd(e){this.source.hasBytes(e,4096)||await this.source.loadBytes(e,4096);let i=this.cursor.seekTo(e).offset(),n=e+this.ifdConfig.offset,o=new Map,a=n;for(let p=0;p<i;p++){let m=Yc.create(this,a);if(a+=m.size,m.name==null)throw new Error("Unknown IFD Tag: "+w4(m.id));o.set(m.id,m)}let c=new Xc(this,this.images.length,o);return{nextOffset:this.source.getUint(a,this.ifdConfig.pointer),image:c}}async close(){var e,r;await((r=(e=this.source)===null||e===void 0?void 0:e.close)===null||r===void 0?void 0:r.call(e))}};var M2=class{constructor(){this.requests=[]}reset(){this.requests=[]}trace(e){let r=e.fetchBytes;e.fetchBytes=async(i,n)=>{let o={source:e.uri,offset:i,length:n},a=Ti(`${o.source}:${o.offset}:${o.length}`);o.id=a,this.requests.push(o);let c=Date.now(),d=await r.apply(e,[i,n]);return o.duration=Date.now()-c,d}}},Nn=new M2;var tf=class{constructor(e){this.ob=e,this.ob._value==null&&this.ob.value.then(r=>this.ob._value=r)}get size(){let e=this.ob._value;return e==null?0:e.source.chunkSize*e.source.chunks.size}},E2=class{constructor(e){this.cache=new xa(e)}getCog(e){let r=this.cache.get(e)?.ob;if(r!=null){if(r.type==="cog")return r.value;throw new Error(`Existing object of type: ${r.type} made for location: ${e}`)}let i=ht.source(e);Nn.trace(i);let n=Ca.create(i);return this.cache.set(e,new tf({type:"cog",value:n})),n}getCotar(e){let r=this.cache.get(e)?.ob;if(r!=null){if(r.type==="cotar")return r.value;throw new Error(`Existing object of type: ${r.type} made for location: ${e}`)}let i=ht.source(e);Nn.trace(i);let n=xn.fromTar(i);return this.cache.set(e,new tf({type:"cotar",value:n})),n}},Lt=new E2(700*1e3*1e3);function Aa(t){return t[0]===31&&t[1]===139}var R2=class{async get(e,r){if(e.endsWith(".tar.co"))return await this.getFromCotar(e,r);try{let i=xt.join(e,r);return await xt.read(i)}catch(i){if(i.code===404)return null;throw i}}async getFromCotar(e,r){let n=await(await Lt.getCotar(e)).get(r);return n&&Buffer.from(n)}async serve(e,r,i){let n=await Be.load(e);if(n==null)return ce();if(n.assets==null)return ce();let o=await Ta.get(n.assets,r);if(o==null)return ce();let a=Ne.key(o);if(Ne.isNotModified(e,a))return at();let c=K.ok().buffer(o,i);return c.header(re.ETag,a),c.header(re.CacheControl,"public, max-age=604800, stale-while-revalidate=86400"),Aa(o)&&c.header(re.ContentEncoding,"gzip"),c}},Ta=new R2;async function _4(t){let e=C2.default.join("fonts",t.params.fontStack,t.params.range)+".pbf";return Ta.serve(t,e,"application/x-protobuf")}async function S4(t){return Ta.serve(t,C2.default.join("fonts","fonts.json"),"application/json")}var L2=me(require("fs"),1),lf=me(require("path"),1),O4=me(T4(),1),k2=me(require("sharp"),1),I4=me(require("url"),1);var of=me(require("sharp"),1);var nf=class{constructor(){if(this.timers=new Map,typeof process<"u"&&typeof process.hrtime.bigint=="function"){let e=BigInt(1e6);this.getTime=()=>Number(process.hrtime.bigint()/e)}else typeof typeof performance<"u"?this.getTime=()=>performance.now():this.getTime=()=>Date.now()}start(e){let r=this.timers.get(e);if(r!=null&&r.duration==null)throw new Error(`Duplicate startTime for "${e}"`);this.timers.set(e,{start:this.getTime()})}end(e){let r=this.timers.get(e);if(r==null)throw new Error(`Missing startTime information for "${e}"`);let i=this.getTime()-r.start;return r.duration=i,i}get metrics(){if(this.timers.size===0)return;let e={};for(let[r,i]of this.timers.entries())i.duration!=null&&(e[r]=i.duration);return e}get unfinished(){let e=[];for(let[r,i]of this.timers.entries())i.duration==null&&e.push(r);if(e.length!==0)return e}};function OA(t){return t!=null}var sf=new Map,Bn=class{constructor(e){this.tileSize=e}isTooLarge(e){return e.type==="cotar"?!1:!!(e.resize&&(e.resize.width>=Bn.MaxImageSize||e.resize.height>=Bn.MaxImageSize))}getEmptyImage(e,r){let i=[e,r.r,r.g,r.b,r.alpha].join("-"),n=sf.get(i);return n||(n=this.toImage(e,this.createImage(r)),sf.size>128&&sf.clear(),sf.set(i,n),n)}toImage(e,r){switch(e){case Le.Jpeg:return r.jpeg().toBuffer();case Le.Png:return r.png().toBuffer();case Le.Webp:return r.webp().toBuffer();case Le.Avif:return r.avif().toBuffer();default:throw new Error(`Invalid image format "${e}"`)}}async getImageBuffer(e,r,i){return e.length===0?this.getEmptyImage(r,i):this.toImage(r,this.createImage(i).composite(e))}isDirectCotar(e){return!(e.layers.length!==1||e.layers[0].type!=="cotar"||this.tileSize!==256||e.format!==Le.Webp||e.background.alpha!==0)}isDirectImage(e){var r;if(e.layers.length!==1)return!1;let i=e.layers[0];if(i.type!=="tiff"||i.x!==0||i.y!==0||i.crop!=null||i.extract!=null||i.resize!=null)return!1;let n=i.asset.getImage(i.source.imageId),o=n.tileSize;return!(o.height!==this.tileSize||o.width!==this.tileSize||!(!((r=n.compression)===null||r===void 0)&&r.includes(e.format))||e.background.alpha!==0)}async compose(e){var r;let i=(r=e.metrics)!==null&&r!==void 0?r:new nf;if(i.start("compose:overlay"),this.isDirectCotar(e)){let c=e.layers[0],d=await c.asset.get(c.path);return d==null?{buffer:await this.getEmptyImage(e.format,e.background),metrics:i,layers:0}:(i.start("compose:direct"),i.end("compose:direct"),{buffer:Buffer.from(d),metrics:i,layers:1})}if(this.isDirectImage(e)){let c=e.layers[0],d=await c.asset.getTile(c.source.x,c.source.y,c.source.imageId);return i.end("compose:overlay"),d==null?{buffer:await this.getEmptyImage(e.format,e.background),metrics:i,layers:0}:(i.start("compose:direct"),i.end("compose:direct"),{buffer:Buffer.from(d.bytes),metrics:i,layers:1})}let n=[];for(let c of e.layers)this.isTooLarge(c)||n.push(this.composeTile(c,e.resizeKernel));let o=await Promise.all(n).then(c=>c.filter(OA));i.end("compose:overlay"),i.start("compose:compress");let a=await this.getImageBuffer(o,e.format,e.background);return i.end("compose:compress"),{buffer:a,metrics:i,layers:o.length}}async composeTile(e,r){if(e.type==="tiff")return this.composeTileTiff(e,r);if(e.type==="cotar")return this.composeTileTar(e);throw new Error("Failed to compose tile from source")}async composeTileTar(e){let r=await e.asset.get(e.path);return r==null?null:{input:Buffer.from(r),top:0,left:0}}async composeTileTiff(e,r){let i=await e.asset.getTile(e.source.x,e.source.y,e.source.imageId);if(i==null)return null;let n=(0,of.default)(Buffer.from(i.bytes)),{extract:o,resize:a,crop:c}=e;if(o&&n.extract({top:0,left:0,width:o.width,height:o.height}),a){let d={fit:of.default.fit.cover,kernel:a.scaleX>1?r.in:r.out};n.resize(a.width,a.height,d)}return c&&n.extract({top:c.y,left:c.x,width:c.width,height:c.height}),{input:await n.toBuffer(),top:e.y,left:e.x}}createImage(e){return(0,of.default)({create:{width:this.tileSize,height:this.tileSize,channels:4,background:e}})}};Bn.MaxImageSize=256*2**15;var O2=class{constructor(e){ph(this,"value");ph(this,"next");this.value=e}},pi,zs,js,sl=class{constructor(){St(this,pi,void 0);St(this,zs,void 0);St(this,js,void 0);this.clear()}enqueue(e){let r=new O2(e);Ee(this,pi)?(Ee(this,zs).next=r,et(this,zs,r)):(et(this,pi,r),et(this,zs,r)),gh(this,js)._++}dequeue(){let e=Ee(this,pi);if(!!e)return et(this,pi,Ee(this,pi).next),gh(this,js)._--,e.value}clear(){et(this,pi,void 0),et(this,zs,void 0),et(this,js,0)}get size(){return Ee(this,js)}*[Symbol.iterator](){let e=Ee(this,pi);for(;e;)yield e.value,e=e.next}};pi=new WeakMap,zs=new WeakMap,js=new WeakMap;function I2(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new sl,r=0,i=()=>{r--,e.size>0&&e.dequeue()()},n=async(c,d,p)=>{r++;let m=(async()=>c(...p))();d(m);try{await m}catch{}i()},o=(c,d,p)=>{e.enqueue(n.bind(void 0,c,d,p)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},a=(c,...d)=>new Promise(p=>{o(c,p,d)});return Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),a}var IA=I2(Xe.getNumber(Xe.TiffConcurrency,25));function LA(t){let e=t.toLowerCase();return e.endsWith(".tif")||e.endsWith(".tiff")?t:`${t}.tiff`}var kA=new Bn(256),NA={in:"lanczos3",out:"lanczos3"},BA={r:0,g:0,b:0,alpha:0},af={async getAssetsForTile(t,e,r){let i=await Be.load(t),n=await ys(i,e.layers,[r.tileMatrix.projection]),o=Ea(t,e.layers),a=[],c=r.tileMatrix.tileToSourceBounds(r.tile),d=At.convertZoomLevel(r.tile.z,r.tileMatrix,ar.get(Re.Google));for(let p of o){if(p.disabled||p.maxZoom!=null&&d>p.maxZoom||p.minZoom!=null&&d<p.minZoom)continue;let m=p[r.tileMatrix.projection.code];if(m==null){t.log.warn({layer:p.name,projection:r.tileMatrix.projection.code},"Failed to lookup imagery");continue}let v=n.get(m);if(v==null){t.log.warn({layer:p.name,projection:r.tileMatrix.projection.code,imgId:m},"Failed to lookup imagery");continue}if(!!c.intersects(Se.fromJson(v.bounds)))for(let x of v.files){if(!c.intersects(Se.fromJson(x)))continue;if(v.overviews&&v.overviews.maxZoom>=d&&v.overviews.minZoom<=d){a.push(ht.join(v.uri,v.overviews.path));break}let w=ht.join(v.uri,LA(x.name));a.push(w)}}return a},async tile(t,e,r){if(r.tileType===lr.MapboxVectorTiles)return ce();let i=await this.getAssetsForTile(t,e,r),n=Ne.key(i);if(Ne.isNotModified(t,n))return at();let o=[];for(let v of i)o.push(IA(()=>v.endsWith(".tar.co")?Lt.getCotar(v).catch(x=>(t.log.warn({error:x,tiff:v},"Load:Cotar:Failed"),null)):Lt.getCog(v).catch(x=>(t.log.warn({error:x,tiff:v},"Load:Tiff:Failed"),null))));let a=(await Promise.all(o)).filter(v=>v!=null),d=await new Sa(r.tileMatrix).tile(a,r.tile.x,r.tile.y,r.tile.z),p=await kA.compose({layers:d,format:r.tileType,background:e.background??BA,resizeKernel:e.resizeKernel??NA,metrics:t.timer});t.set("layersUsed",p.layers),t.set("bytes",p.buffer.byteLength);let m=new K(200,"ok");return m.header(re.ETag,n),m.header(re.CacheControl,"public, max-age=604800, stale-while-revalidate=86400"),m.buffer(p.buffer,"image/"+r.tileType),m}};var jA={},DA=[{tileSet:"health",tileMatrix:Ie,tileType:Le.Png,tile:{x:252,y:156,z:8}},{tileSet:"health",tileMatrix:wn,tileType:Le.Png,tile:{x:30,y:33,z:6}}],P4=256;async function zA(t){if(Buffer.isBuffer(t.buf))return t.buf;let e=t.tile,r=`static/expected_tile_${t.tileMatrix.identifier}_${e.x}_${e.y}_z${e.z}.${t.tileType}`;try{return await L2.promises.readFile(r)}catch(i){if(i.code!=="ENOENT")throw i;let n=lf.join(lf.dirname(I4.default.fileURLToPath(jA.url)),"..","..",r);return await L2.promises.readFile(n)}}async function N2(t){let e=await Be.load(t),r=await e.TileSet.get(e.TileSet.id("health"));if(r==null)throw new K(500,'TileSet: "health" not found');for(let n of DA){let o=await af.tile(t,r,n);if(o.status!==200)return new K(500,o.statusDescription);if(!Buffer.isBuffer(o._body))throw new K(500,"Not a Buffer response content.");let a=await(0,k2.default)(o._body).raw().toBuffer(),c=await zA(n);n.buf=c;let d=await(0,k2.default)(c).raw().toBuffer(),p=Buffer.alloc(d.length),m=(0,O4.default)(d,a,p,P4,P4);if(m)return t.log.error({missMatchedPixels:m,projection:n.tileMatrix.identifier,xyz:n.tile},"Health:MissMatch"),new K(500,"TileSet does not match.")}let i=new K(200,"ok");return i.header(re.CacheControl,"no-store"),i}var L4=require("util"),k4=require("zlib");var FA=(0,L4.promisify)(k4.gzip);function $A(t){return t==null?!1:!!(t.endsWith(".geojson")||t.endsWith(".json"))}async function N4(t){let e=t.params.fileName;if(!$A(e))return ce();let r=await Be.load(t),i=await r.Imagery.get(r.Imagery.id(t.params.imageryId));if(i==null)return ce();let n=ht.join(i.uri,e);try{let o=await ht.read(n),a=Ne.key(o);if(Ne.isNotModified(t,a))return at();let c=new K(200,"ok");return c.header(re.ETag,a),c.header(re.ContentEncoding,"gzip"),c.header(re.CacheControl,"public, max-age=604800, stale-while-revalidate=86400"),c.buffer(Aa(o)?o:await FA(o),"application/json"),t.set("bytes",o.byteLength),c}catch{return t.log.warn({targetPath:n},"ImageryMetadata:Failed"),ce()}}var B4=new K(200,"ok");B4.header(re.CacheControl,"no-store");async function B2(){return B4}var D4=me(require("path"),1);var D2=new Map;D2.set(".png","image/png");D2.set(".json","application/json");async function z4(t){let e=D4.default.extname(t.params.spriteName),r=D2.get(e);if(r==null)return ce();let i=xt.join("sprites",t.params.spriteName);return Ta.serve(t,i,r)}async function j4(t){let e=lt.getTileMatrixSet(t.params.tileMatrix);if(e==null)return ce();let r=lt.apiKey(t),i=await Be.load(t);t.timer.start("tileset:load");let n=await i.TileSet.get(i.TileSet.id(t.params.tileSet));if(t.timer.end("tileset:load"),n==null)return ce();let o=lt.getRequestedFormats(t)??[n.format],a=Xe.get(Xe.PublicUrlBase)??"",c=Be.extract(t),d=As({api:r,config:c,...Ma(t)}),m={tiles:[[a,"v1","tiles",n.name,e.identifier,"{z}","{x}","{y}"].join("/")+`.${o[0]}${d}`],tilejson:"3.0.0"},v=At.convertZoomLevel(n.maxZoom??30,Ie,e,!0),x=At.convertZoomLevel(n.minZoom??0,Ie,e,!0);n.maxZoom&&(m.maxzoom=v),n.minZoom&&(m.minzoom=x);let w=JSON.stringify(m),b=Buffer.from(w),E=new K(200,"ok");return E.header(re.CacheControl,"no-store"),E.buffer(b,"application/json"),t.set("bytes",b.byteLength),E}var W4=require("crypto");var qA={xmlns:"http://www.opengis.net/wmts/1.0","xmlns:ows":"http://www.opengis.net/ows/1.1","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:gml":"http://www.opengis.net/gml","xsi:schemaLocation":"http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd",version:"1.0.0"};function F4(t,e){return Pr.get(t).boundsToWgs84BoundingBox(e)}var $4=6,q4=4;function H4(t,e){return Number(t.toFixed(e)).toString()}function uf(t,e,r){return`${H4(t,r)} ${H4(e,r)}`}var cf=class{constructor(e){this.tileMatrixSets=new Map;this.minZoom=0;this.maxZoom=32;this.httpBase=e.httpBase,this.provider=e.provider,this.tileSet=e.tileSet,this.config=e.config;for(let r of e.tileMatrix)this.tileMatrixSets.set(r.identifier,r);this.apiKey=e.apiKey,this.formats=e.formats??a4,this.imagery=e.imagery,this.layers=e.layers,this.filters=e.filters}buildWgs84BoundingBox(e,r){let i;if(r.length>0){let n=r[0];for(let o=1;o<r.length;o++)n=n.union(r[o]);i=F4(e,n.toJson())}else i=F4(e,e.extent);return i[2]<i[0]&&(i[0]=-180,i[2]=180),X("ows:WGS84BoundingBox",{crs:"urn:ogc:def:crs:OGC:2:84"},[X("ows:LowerCorner",uf(i[0],i[1],$4)),X("ows:UpperCorner",uf(i[2],i[3],$4))])}buildBoundingBoxFromImagery(e,r){let i;for(let o of r){let a=o[e.projection.code];if(a==null)continue;let c=this.imagery.get(a);c!=null&&(i==null?i=Se.fromJson(c.bounds):i=i.union(Se.fromJson(c.bounds)))}if(i==null)return null;let n=i.toBbox();return X("ows:BoundingBox",{crs:e.projection.toUrn()},[X("ows:LowerCorner",uf(n[e.indexX],n[e.indexY],q4)),X("ows:UpperCorner",uf(n[e.indexX+2],n[e.indexY+2],q4))])}buildProvider(){if(this.provider==null)return[];let{serviceIdentification:e,serviceProvider:r}=this.provider,{contact:i}=r;return[X("ows:ServiceIdentification",[X("ows:Title",e.title),X("ows:Abstract",e.description),X("ows:ServiceType","OGC WMTS"),X("ows:ServiceTypeVersion","1.0.0"),X("ows:Fees",e.fees),X("ows:AccessConstraints",e.accessConstraints)]),X("ows:ServiceProvider",[X("ows:ProviderName",r.name),X("ows:ProviderSite",{"xlink:href":r.site}),X("ows:ServiceContact",[X("ows:IndividualName",i.individualName),X("ows:PositionName",i.position),X("ows:ContactInfo",[X("ows:Phone",[X("ows:Voice",i.phone)]),X("ows:Address",[X("ows:DeliveryPoint",i.address.deliveryPoint),X("ows:City",i.address.city),X("ows:PostalCode",i.address.postalCode),X("ows:Country",i.address.country),X("ows:ElectronicMailAddress",i.address.email)])])])])]}buildTileUrl(e,r,i=!1){let n={api:this.apiKey,config:this.config};return i&&(n={api:this.apiKey,config:this.config,...this.filters}),[this.httpBase,"v1","tiles",e,"{TileMatrixSet}","{TileMatrix}","{TileCol}",`{TileRow}.${r}${As(n)}`].join("/")}buildResourceUrl(e,r,i=!1){return X("ResourceURL",{format:"image/"+r,resourceType:"tile",template:this.buildTileUrl(e,r,i)})}buildLayerFromImagery(e){let r=new Set,i=[];for(let d of this.tileMatrixSets.values()){let p=e[d.projection.code];p==null||this.imagery.get(p)==null||(i.push(X("TileMatrixSetLink",[X("TileMatrixSet",d.identifier)])),r.add(d))}let n=ai(e.name),o=[...r.values()],a=o[0];if(a==null)return null;let c=this.imagery.get(e[a.projection.code]??"");return c==null?null:X("Layer",[X("ows:Title",e.title),X("ows:Abstract",""),X("ows:Identifier",n),this.buildKeywords(c),...o.map(d=>this.buildBoundingBoxFromImagery(d,[e])),this.buildWgs84BoundingBox(a,[Se.fromJson(c.bounds)]),this.buildStyle(),...this.formats.map(d=>X("Format","image/"+d)),...i,...this.formats.map(d=>this.buildResourceUrl(n,d))])}buildLayer(e){let r=new Set,i=[];for(let p of this.tileMatrixSets.values())e.layers.find(m=>m[p.projection.code]!=null)&&(i.push(X("TileMatrixSetLink",[X("TileMatrixSet",p.identifier)])),r.add(p));let n=ai(e.name),o=[...r.values()],a=o[0];if(a==null)throw new Error("No matrix sets found for layer "+e.name);let c=o.find(p=>p.identifier===Ie.identifier)??a,d=[];for(let p of e.layers){let m=this.imagery.get(p[c.projection.code]??"");m!=null&&d.push(Se.fromJson(m.bounds))}return X("Layer",[X("ows:Title",e.title),X("ows:Abstract",e.description??""),X("ows:Identifier",n),this.buildKeywords(e),...[...r.values()].map(p=>this.buildBoundingBoxFromImagery(p,e.layers)),this.buildWgs84BoundingBox(c,d),this.buildStyle(),...this.formats.map(p=>X("Format","image/"+p)),...i,...this.formats.map(p=>this.buildResourceUrl(n,p,!0))])}buildKeywords(e){return e.category==null?X("ows:Keywords"):X("ows:Keywords",[X("ows:Keyword",e.category)])}buildStyle(){return X("Style",{isDefault:"true"},[X("ows:Title","Default Style"),X("ows:Identifier","default")])}buildTileMatrixSet(e){return X("TileMatrixSet",[X("ows:Title",e.def.title),e.def.abstract?X("ows:Abstract",e.def.abstract):null,X("ows:Identifier",e.identifier),X("ows:SupportedCRS",e.projection.toUrn()),e.def.wellKnownScaleSet?X("WellKnownScaleSet",e.def.wellKnownScaleSet):null,...e.def.tileMatrix.slice(this.minZoom,this.maxZoom+1).map(r=>X("TileMatrix",[X("ows:Identifier",r.identifier),X("ScaleDenominator",r.scaleDenominator),X("TopLeftCorner",r.topLeftCorner.join(" ")),X("TileWidth",r.tileWidth),X("TileHeight",r.tileHeight),X("MatrixWidth",r.matrixWidth),X("MatrixHeight",r.matrixHeight)]))])}toVNode(){let e=[];if(e.push(this.buildLayer(this.tileSet)),this.layers){let r=new Map;for(let n of this.layers)r.set(ai(n.name),n);let i=Array.from(r.values()).sort((n,o)=>(n.title??n.name).localeCompare(o.title??o.name));for(let n of i)e.push(this.buildLayerFromImagery(n))}for(let r of this.tileMatrixSets.values())e.push(this.buildTileMatrixSet(r));return X("Capabilities",qA,[...this.buildProvider(),X("Contents",e)])}toXml(){return`<?xml version="1.0" encoding="utf-8"?>
|
|
189
|
-
`+this.toVNode().toString()}};function HA(t){if(t==null)return[Ie,wn];let e=lt.getTileMatrixSet(t);return e==null?null:[e]}async function ff(t){let e=lt.apiKey(t),r=t.params.tileSet??"aerial",i=HA(t.params.tileMatrix);if(i==null)return ce();let n=Xe.get(Xe.PublicUrlBase)??"",o=await Be.load(t);t.timer.start("tileset:load");let a=await o.TileSet.get(o.TileSet.id(r??"aerial"));if(t.timer.end("tileset:load"),a==null||a.type!==it.Raster)return ce();let c=await o.Provider.get(o.Provider.id("linz"));t.timer.start("imagery:load");let d=await ys(o,a.layers,i.map(w=>w.projection));t.timer.end("imagery:load");let p=new cf({httpBase:n,provider:c??void 0,tileSet:a,tileMatrix:i,imagery:d,apiKey:e,config:Be.extract(t),formats:lt.getRequestedFormats(t),layers:t.params.tileMatrix==null?Ea(t,a.layers):null,filters:Ma(t)}).toXml();if(p==null)return ce();let m=Buffer.from(p),v=(0,W4.createHash)("sha256").update(m).digest("base64");if(Ne.isNotModified(t,v))return at();let x=new K(200,"ok");return x.header(re.ETag,v),x.header(re.CacheControl,"no-store"),x.buffer(m,"text/xml"),t.set("bytes",m.byteLength),x}var U4={async tile(t,e,r){if(r.tileType!==lr.MapboxVectorTiles)return ce();if(r.tileMatrix.identifier!==Ie.identifier)return ce();if(e.layers.length>1)return new K(500,"Too many layers in tileset");let[i]=e.layers,n=i[3857];if(n==null)return new K(500,"Layer url not found from tileset Config");let o=(1<<r.tile.z)-1-r.tile.y,a=`tiles/${r.tile.z}/${r.tile.x}/${o}.pbf.gz`,c=`${n}#${a}`,d=Ne.key(c);if(Ne.isNotModified(t,d))return at();t.timer.start("cotar:load");let p=await Lt.getCotar(n);if(p==null)return new K(500,"Failed to load VectorTiles");t.timer.end("cotar:load"),t.timer.start("cotar:tile");let m=await p.get(a);if(m==null)return n4();t.timer.end("cotar:tile");let v=Buffer.from(m),x=K.ok().buffer(v,"application/x-protobuf");return x.header(re.ETag,d),x.header(re.CacheControl,"public, max-age=604800, stale-while-revalidate=86400"),Aa(v)&&x.header(re.ContentEncoding,"gzip"),x}};async function G4(t){let e=lt.xyz(t),r=await Be.load(t);t.timer.start("tileset:load");let i=await r.TileSet.get(r.TileSet.id(e.tileSet));if(t.timer.end("tileset:load"),i==null)return ce();switch(i.type){case it.Vector:return U4.tile(t,i,e);case it.Raster:return af.tile(t,i,e);default:return new K(400,"Invalid tileset")}}async function z2(){let t=new K(200,"ok");return t.header(re.CacheControl,"no-store"),t.json({version:"v6.40.0",hash:"029c1e511531064dbf87b2b5204a50fe840daa79"}),t}var $e=Wt.http(Io.get());$e.router.timeoutEarlyMs=1e3;$e.router.hook("request",t=>{t.set("name","LambdaTiler"),Nn.reset()});$e.router.hook("response",(t,e)=>{Nn.requests.length>0&&(t.set("requests",Nn.requests.slice(0,100)),t.set("requestCount",Nn.requests.length)),t.set("sources",{hits:Lt.cache.hits,misses:Lt.cache.misses,size:Lt.cache.currentSize,resets:Lt.cache.resets,clears:Lt.cache.clears,cacheA:Lt.cache.cacheA.size,cacheB:Lt.cache.cacheB.size}),e.header("access-control-allow-origin","*")});$e.router.options("*",t=>$e.router.router.find("GET",t.path)==null?ce():K.ok());$e.router.get("/ping",B2);$e.router.get("/health",N2);$e.router.get("/version",z2);$e.router.get("/v1/ping",B2);$e.router.get("/v1/health",N2);$e.router.get("/v1/version",z2);$e.router.get("/v1/imagery/:imageryId/:fileName",N4);$e.router.get("/v1/config/:tileSet.json",p4);$e.router.get("/v1/config/:tileSet/:imageryId.json",g4);$e.router.get("/v1/sprites/:spriteName",z4);$e.router.get("/v1/fonts.json",S4);$e.router.get("/v1/fonts/:fontStack/:range.pbf",_4);$e.router.get("/v1/styles/:styleName.json",m2);$e.router.get("/v1/tiles/:tileSet/:tileMatrix/style/:styleName.json",m2);$e.router.get("/v1/tiles/:tileSet/:tileMatrix/tile.json",j4);$e.router.get("/v1/tiles/:tileSet/:tileMatrix/:z/:x/:y.:tileType",G4);$e.router.get("/v1/tiles/:tileSet/:tileMatrix/attribution.json",g2);$e.router.get("/v1/attribution/:tileSet/:tileMatrix/summary.json",g2);$e.router.get("/v1/tiles/:tileSet/:tileMatrix/WMTSCapabilities.xml",ff);$e.router.get("/v1/tiles/:tileSet/WMTSCapabilities.xml",ff);$e.router.get("/v1/tiles/WMTSCapabilities.xml",ff);$e.router.get("/v1/arcgis/rest/services/:tileSet/VectorTileServer",h4);$e.router.post("/v1/arcgis/rest/services/:tileSet/VectorTileServer",s4);$e.router.get("/v1/arcgis/rest/services/:tileSet/VectorTileServer/root.json",f4);$e.router.get("/v1/arcgis/rest/info",o4);0&&(module.exports={handler});
|
|
190
|
-
/*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
191
|
-
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
192
|
-
/*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
193
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
194
|
-
/**
|
|
195
|
-
* splaytree v3.1.0
|
|
196
|
-
* Fast Splay tree for Node and browser
|
|
197
|
-
*
|
|
198
|
-
* @author Alexander Milevski <info@w8r.name>
|
|
199
|
-
* @license MIT
|
|
200
|
-
* @preserve
|
|
201
|
-
*/
|