@ncino/web-components 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index_html.js +1 -1
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/avatar/gator/avatar.gator.js +15 -10
- package/dist/components/input/gator/dropdown/input-dropdown.gator.js +1 -1
- package/dist/components/input/gator/input-date/input-date.gator.js +1 -1
- package/dist/components/input/gator/input-file/input-file.gator.js +1 -1
- package/dist/components/input/gator/input-time/input-time.gator.js +1 -1
- package/dist/components/menu/base/gator/menu.gator.js +1 -1
- package/dist/components/popover/gator/popover.gator.js +1 -1
- package/dist/components/tooltip/gator/tooltip.gator.js +1 -1
- package/dist/components/tooltip/slds/tooltip.slds.js +1 -1
- package/dist/node_modules/.pnpm/@deltablot_dropzone@7.3.1/node_modules/@deltablot/dropzone/dist/dropzone.js +22 -0
- package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/common/fetch.js +1 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/package.json.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.1/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -0
- package/dist/node_modules/.pnpm/{@floating-ui_dom@1.7.0 → @floating-ui_dom@1.7.1}/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
- package/dist/node_modules/.pnpm/{@vitest_expect@3.1.4 → @vitest_expect@3.2.0}/node_modules/@vitest/expect/dist/index.js +17 -17
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.0/node_modules/@vitest/runner/dist/chunk-hooks.js +5 -0
- package/dist/node_modules/.pnpm/{@vitest_snapshot@3.1.4 → @vitest_snapshot@3.2.0}/node_modules/@vitest/snapshot/dist/index.js +5 -5
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.0/node_modules/@vitest/spy/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@vitest_utils@3.1.4 → @vitest_utils@3.2.0}/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +1 -1
- package/dist/node_modules/.pnpm/{@vitest_utils@3.1.4 → @vitest_utils@3.2.0}/node_modules/@vitest/utils/dist/diff.js +1 -1
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/error.js +2 -0
- package/dist/node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js +1 -0
- package/dist/node_modules/.pnpm/{string_decoder@1.3.0 → string_decoder@1.1.1}/node_modules/string_decoder/lib/string_decoder.js +1 -1
- package/dist/node_modules/.pnpm/tinyspy@4.0.3/node_modules/tinyspy/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/index.js +1 -0
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/util.js +1 -0
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/headers.js +1 -0
- package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fileapi/util.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/pool.js +1 -0
- package/dist/node_modules/.pnpm/{vitest@3.1.4_@types_debug@4.1.12_@types_node@22.15.21_@vitest_browser@3.1.4_@vitest_ui@_b157c97eca1209d41387a466815fb09f/node_modules/vitest/dist/chunks/utils.CgTj3MsC.js → vitest@3.2.0_@types_debug@4.1.12_@types_node@22.15.21_@vitest_browser@3.2.0_@vitest_ui@_14788fcd511f0c706d416dcd7d5ee669/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js} +1 -1
- package/dist/node_modules/.pnpm/{vitest@3.1.4_@types_debug@4.1.12_@types_node@22.15.21_@vitest_browser@3.1.4_@vitest_ui@_b157c97eca1209d41387a466815fb09f/node_modules/vitest/dist/chunks/vi.ClIskdbk.js → vitest@3.2.0_@types_debug@4.1.12_@types_node@22.15.21_@vitest_browser@3.2.0_@vitest_ui@_14788fcd511f0c706d416dcd7d5ee669/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js} +5 -5
- package/dist/packages/web-components/src/components/avatar/gator/avatar.gator.scss.js +1 -1
- package/dist/types/components/avatar/avatar.d.ts +21 -4
- package/dist/types/components/avatar/gator/avatar.gator.d.ts +4 -1
- package/dist/utils/vitest-a11y-utils.js +1 -1
- package/package.json +29 -29
- package/web-types.json +34 -6
- package/dist/node_modules/.pnpm/@deltablot_dropzone@7.3.0/node_modules/@deltablot/dropzone/dist/dropzone.js +0 -22
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.2/node_modules/@figma/code-connect/package.json.js +0 -1
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_runner@3.1.4/node_modules/@vitest/runner/dist/chunk-tasks.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_runner@3.1.4/node_modules/@vitest/runner/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@vitest_spy@3.1.4/node_modules/@vitest/spy/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_utils@3.1.4/node_modules/@vitest/utils/dist/error.js +0 -2
- package/dist/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js +0 -1
- package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/index.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/util.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/headers.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/pool.js +0 -1
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/client/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/client/figma_client.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/common/logging.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/common/updates.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/connect/external_types.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/connect/helpers.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/connect/index_common.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/html/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/html/index_html.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.2 → @figma_code-connect@1.3.3}/node_modules/@figma/code-connect/dist/html/template_literal.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_browser@3.1.4_msw@2.7.3_@types_node@22.15.21_typescript@5.8.3__playwright@1.52._ce6a4a1e71cccb66c0847e643d956555 → @vitest_browser@3.2.0_msw@2.7.3_@types_node@22.15.21_typescript@5.8.3__playwright@1.52._69fe3aa5bafb5870129d66fd4b43fd69}/node_modules/@vitest/browser/context.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_pretty-format@3.1.4 → @vitest_pretty-format@3.2.0}/node_modules/@vitest/pretty-format/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_utils@3.1.4 → @vitest_utils@3.2.0}/node_modules/@vitest/utils/dist/helpers.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_utils@3.1.4 → @vitest_utils@3.2.0}/node_modules/@vitest/utils/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_utils@3.1.4 → @vitest_utils@3.2.0}/node_modules/@vitest/utils/dist/source-map.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/index.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/agent.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/api/abort-signal.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/api/api-connect.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/api/api-pipeline.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/api/api-request.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/api/api-stream.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/api/api-upgrade.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/api/index.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/api/readable.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/api/util.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/balanced-pool.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/cache/cache.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/cache/cachestorage.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/cache/symbols.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/cache/util.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/client.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/compat/dispatcher-weakref.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/cookies/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/cookies/parse.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/core/connect.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/core/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/core/errors.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/core/request.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/core/symbols.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/core/util.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/dispatcher-base.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/dispatcher.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/body.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/dataURL.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/file.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/formdata.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/global.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/index.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/request.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/response.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/symbols.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/util.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fetch/webidl.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fileapi/encoding.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fileapi/filereader.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fileapi/progressevent.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/fileapi/symbols.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/global.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/handler/DecoratorHandler.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/handler/RedirectHandler.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/handler/RetryHandler.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/interceptor/redirectInterceptor.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/llhttp/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/llhttp/utils.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/mock/mock-agent.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/mock/mock-client.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/mock/mock-errors.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/mock/mock-interceptor.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/mock/mock-pool.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/mock/mock-symbols.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/mock/mock-utils.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/mock/pluralizer.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/node/fixed-queue.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/pool-base.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/pool-stats.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/proxy-agent.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/timers.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/websocket/connection.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/websocket/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/websocket/events.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/websocket/frame.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/websocket/receiver.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/websocket/symbols.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/websocket/util.js +0 -0
- /package/dist/node_modules/.pnpm/{undici@5.28.5 → undici@5.29.0}/node_modules/undici/lib/websocket/websocket.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.1.4_@types_debug@4.1.12_@types_node@22.15.21_@vitest_browser@3.1.4_@vitest_ui@_b157c97eca1209d41387a466815fb09f → vitest@3.2.0_@types_debug@4.1.12_@types_node@22.15.21_@vitest_browser@3.2.0_@vitest_ui@_14788fcd511f0c706d416dcd7d5ee669}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.1.4_@types_debug@4.1.12_@types_node@22.15.21_@vitest_browser@3.1.4_@vitest_ui@_b157c97eca1209d41387a466815fb09f/node_modules/vitest/dist/chunks/date.CDOsz-HY.js → vitest@3.2.0_@types_debug@4.1.12_@types_node@22.15.21_@vitest_browser@3.2.0_@vitest_ui@_14788fcd511f0c706d416dcd7d5ee669/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function E(n){return n&&n.__esModule?n.default:n}class v{on(e,i){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(i),this}emit(e,...i){this._callbacks=this._callbacks||{};let t=this._callbacks[e];if(t)for(let s of t)s.apply(this,i);return this.element&&this.element.dispatchEvent(this.makeEvent("dropzone:"+e,{args:i})),this}makeEvent(e,i){let t={bubbles:!0,cancelable:!0,detail:i};if(typeof window.CustomEvent=="function")return new CustomEvent(e,t);var s=document.createEvent("CustomEvent");return s.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),s}off(e,i){if(!this._callbacks||arguments.length===0)return this._callbacks={},this;let t=this._callbacks[e];if(!t)return this;if(arguments.length===1)return delete this._callbacks[e],this;for(let s=0;s<t.length;s++)if(t[s]===i){t.splice(s,1);break}return this}}var F={};F=`<html><head></head><body><div class="dz-preview dz-file-preview">
|
|
2
|
+
<div class="dz-image"><img data-dz-thumbnail=""></div>
|
|
3
|
+
<div class="dz-details">
|
|
4
|
+
<div class="dz-size"><span data-dz-size=""></span></div>
|
|
5
|
+
<div class="dz-filename"><span data-dz-name=""></span></div>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="dz-progress">
|
|
8
|
+
<span class="dz-upload" data-dz-uploadprogress=""></span>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="dz-error-message"><span data-dz-errormessage=""></span></div>
|
|
11
|
+
<div class="dz-success-mark">
|
|
12
|
+
<svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
+
<path d="M10.2071 29.7929L14.2929 25.7071C14.6834 25.3166 15.3166 25.3166 15.7071 25.7071L21.2929 31.2929C21.6834 31.6834 22.3166 31.6834 22.7071 31.2929L38.2929 15.7071C38.6834 15.3166 39.3166 15.3166 39.7071 15.7071L43.7929 19.7929C44.1834 20.1834 44.1834 20.8166 43.7929 21.2071L22.7071 42.2929C22.3166 42.6834 21.6834 42.6834 21.2929 42.2929L10.2071 31.2071C9.81658 30.8166 9.81658 30.1834 10.2071 29.7929Z"></path>
|
|
14
|
+
</svg>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="dz-error-mark">
|
|
17
|
+
<svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">
|
|
18
|
+
<path d="M26.2929 20.2929L19.2071 13.2071C18.8166 12.8166 18.1834 12.8166 17.7929 13.2071L13.2071 17.7929C12.8166 18.1834 12.8166 18.8166 13.2071 19.2071L20.2929 26.2929C20.6834 26.6834 20.6834 27.3166 20.2929 27.7071L13.2071 34.7929C12.8166 35.1834 12.8166 35.8166 13.2071 36.2071L17.7929 40.7929C18.1834 41.1834 18.8166 41.1834 19.2071 40.7929L26.2929 33.7071C26.6834 33.3166 27.3166 33.3166 27.7071 33.7071L34.7929 40.7929C35.1834 41.1834 35.8166 41.1834 36.2071 40.7929L40.7929 36.2071C41.1834 35.8166 41.1834 35.1834 40.7929 34.7929L33.7071 27.7071C33.3166 27.3166 33.3166 26.6834 33.7071 26.2929L40.7929 19.2071C41.1834 18.8166 41.1834 18.1834 40.7929 17.7929L36.2071 13.2071C35.8166 12.8166 35.1834 12.8166 34.7929 13.2071L27.7071 20.2929C27.3166 20.6834 26.6834 20.6834 26.2929 20.2929Z"></path>
|
|
19
|
+
</svg>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</body></html>`;let C={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2097152,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,defaultHeaders:!0,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You cannot upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init(){},params(n,e,i){if(i)return{dzuuid:i.file.upload.uuid,dzchunkindex:i.index,dztotalfilesize:i.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:i.file.upload.totalChunkCount,dzchunkbyteoffset:i.index*this.options.chunkSize}},accept(n,e){return e()},chunksUploaded:function(n,e){e()},binaryBody:!1,fallback(){let n;this.element.className=`${this.element.className} dz-browser-not-supported`;for(let i of this.element.getElementsByTagName("div"))if(/(^| )dz-message($| )/.test(i.className)){n=i,i.className="dz-message";break}n||(n=r.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(n));let e=n.getElementsByTagName("span")[0];return e&&(e.textContent!=null?e.textContent=this.options.dictFallbackMessage:e.innerText!=null&&(e.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(n,e,i,t){let s={srcX:0,srcY:0,srcWidth:n.width,srcHeight:n.height},l=n.width/n.height;e==null&&i==null?(e=s.srcWidth,i=s.srcHeight):e==null?e=i*l:i==null&&(i=e/l),e=Math.min(e,s.srcWidth),i=Math.min(i,s.srcHeight);let a=e/i;if(s.srcWidth>e||s.srcHeight>i)if(t==="crop")l>a?(s.srcHeight=n.height,s.srcWidth=s.srcHeight*a):(s.srcWidth=n.width,s.srcHeight=s.srcWidth/a);else if(t==="contain")l>a?i=e/l:e=i*l;else throw new Error(`Unknown resizeMethod '${t}'`);return s.srcX=(n.width-s.srcWidth)/2,s.srcY=(n.height-s.srcHeight)/2,s.trgWidth=e,s.trgHeight=i,s},transformFile(n,e){return(this.options.resizeWidth||this.options.resizeHeight)&&n.type.match(/image.*/)?this.resizeImage(n,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,e):e(n)},previewTemplate:E(F),drop(n){return this.element.classList.remove("dz-drag-hover")},dragstart(n){},dragend(n){return this.element.classList.remove("dz-drag-hover")},dragenter(n){return this.element.classList.add("dz-drag-hover")},dragover(n){return this.element.classList.add("dz-drag-hover")},dragleave(n){return this.element.classList.remove("dz-drag-hover")},paste(n){},reset(){return this.element.classList.remove("dz-started")},addedfile(n){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){n.previewElement=r.createElement(this.options.previewTemplate.trim()),n.previewTemplate=n.previewElement,this.previewsContainer.appendChild(n.previewElement);for(var e of n.previewElement.querySelectorAll("[data-dz-name]"))e.textContent=n.name;for(e of n.previewElement.querySelectorAll("[data-dz-size]"))e.innerHTML=this.filesize(n.size);this.options.addRemoveLinks&&(n._removeLink=r.createElement(`<a class="dz-remove" href="javascript:undefined;" data-dz-remove>${this.options.dictRemoveFile}</a>`),n.previewElement.appendChild(n._removeLink));let i=t=>(t.preventDefault(),t.stopPropagation(),n.status===r.UPLOADING?this.options.dictCancelUploadConfirmation?r.confirm(this.options.dictCancelUploadConfirmation,()=>this.removeFile(n)):this.removeFile(n):this.options.dictRemoveFileConfirmation?r.confirm(this.options.dictRemoveFileConfirmation,()=>this.removeFile(n)):this.removeFile(n));for(let t of n.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",i)}},removedfile(n){return n.previewElement!=null&&n.previewElement.parentNode!=null&&n.previewElement.parentNode.removeChild(n.previewElement),this._updateMaxFilesReachedClass()},thumbnail(n,e){if(n.previewElement){n.previewElement.classList.remove("dz-file-preview");for(let i of n.previewElement.querySelectorAll("[data-dz-thumbnail]"))i.alt=n.name,i.src=e;return setTimeout(()=>n.previewElement.classList.add("dz-image-preview"),1)}},error(n,e){if(n.previewElement){n.previewElement.classList.add("dz-error"),typeof e!="string"&&e.error&&(e=e.error);for(let i of n.previewElement.querySelectorAll("[data-dz-errormessage]"))i.textContent=e}},errormultiple(){},processing(n){if(n.previewElement&&(n.previewElement.classList.add("dz-processing"),n._removeLink))return n._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(n,e,i){if(n.previewElement)for(let t of n.previewElement.querySelectorAll("[data-dz-uploadprogress]"))t.nodeName==="PROGRESS"?t.value=e:t.style.width=`${e}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(n){if(n.previewElement)return n.previewElement.classList.add("dz-success")},successmultiple(){},canceled(n){return this.emit("error",n,this.options.dictUploadCanceled)},canceledmultiple(){},complete(n){if(n._removeLink&&(n._removeLink.innerHTML=this.options.dictRemoveFile),n.previewElement)return n.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){},emptyfolder(){}};var w=C;class r extends v{static initClass(){this.prototype.Emitter=v,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete","emptyfolder"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}constructor(e,i){super();let t,s;if(this.element=e,this.clickableElements=[],this.listeners=[],this.files=[],typeof this.element=="string"&&(this.element=document.querySelector(this.element)),this.element===null||!this.element instanceof HTMLElement)throw new Error("Invalid dropzone element: not an instance of HTMLElement.");if(this.element.dropzone)throw new Error("Dropzone already attached.");r.instances.push(this),this.element.dropzone=this;let l=(s=r.optionsForElement(this.element))!=null?s:{};if(this.options=Object.assign({},w,l,i??{}),this.options.previewTemplate=this.options.previewTemplate.replace(/\n*/g,""),this.options.forceFallback||!r.isBrowserSupported())return this.options.fallback.call(this);if(this.options.url==null&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");if(this.options.binaryBody&&this.options.uploadMultiple)throw new Error("You cannot set both: binaryBody and uploadMultiple.");typeof this.options.method=="string"&&(this.options.method=this.options.method.toUpperCase()),(t=this.getExistingFallback())&&t.parentNode&&t.parentNode.removeChild(t),this.options.previewsContainer!==!1&&(this.options.previewsContainer?this.previewsContainer=r.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(this.options.clickable===!0?this.clickableElements=[this.element]:this.clickableElements=r.getElements(this.options.clickable,"clickable")),this.init()}getAcceptedFiles(){return this.files.filter(e=>e.accepted).map(e=>e)}getRejectedFiles(){return this.files.filter(e=>!e.accepted).map(e=>e)}getFilesWithStatus(e){return this.files.filter(i=>i.status===e).map(i=>i)}getQueuedFiles(){return this.getFilesWithStatus(r.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(r.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(r.ADDED)}getActiveFiles(){return this.files.filter(e=>e.status===r.UPLOADING||e.status===r.QUEUED).map(e=>e)}init(){if(this.element.tagName==="form"&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(r.createElement(`<div class="dz-default dz-message"><button class="dz-button" type="button">${this.options.dictDefaultMessage}</button></div>`)),this.clickableElements.length){let t=()=>{var s;this.hiddenFileInput&&((s=this.hiddenFileInput.parentNode)==null||s.removeChild(this.hiddenFileInput)),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),this.hiddenFileInput.setAttribute("form",this.element.id),(this.options.maxFiles===null||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",this.options.acceptedFiles!==null&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),this.options.capture!==null&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.setAttribute("aria-label","dropzone hidden input"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",r.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",()=>{let{files:l}=this.hiddenFileInput;if(l.length)for(let a of l)this.addFile(a);this.emit("addedfiles",l),t()})};t()}this.URL=window.URL!==null?window.URL:window.webkitURL;for(let t of this.events)this.on(t,this.options[t]);this.on("uploadprogress",()=>this.updateTotalUploadProgress()),this.on("removedfile",()=>this.updateTotalUploadProgress()),this.on("canceled",t=>this.emit("complete",t)),this.on("complete",t=>{if(this.getAddedFiles().length===0&&this.getUploadingFiles().length===0&&this.getQueuedFiles().length===0)return setTimeout(()=>this.emit("queuecomplete"),0)});const e=function(t){return t.dataTransfer.types&&t.dataTransfer.types.includes("Files")};let i=function(t){if(e(t))return t.stopPropagation(),t.preventDefault()};return this.listeners=[{element:this.element,events:{dragstart:t=>this.emit("dragstart",t),dragenter:t=>(i(t),this.emit("dragenter",t)),dragover:t=>{const s=t.dataTransfer.effectAllowed;return t.dataTransfer.dropEffect=s==="move"||s==="linkMove"?"move":"copy",i(t),this.emit("dragover",t)},dragleave:t=>this.emit("dragleave",t),drop:t=>(i(t),this.drop(t)),dragend:t=>this.emit("dragend",t)}}],this.clickableElements.forEach(t=>this.listeners.push({element:t,events:{click:s=>((t!==this.element||s.target===this.element||r.elementInside(s.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}})),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),this.hiddenFileInput!=null&&this.hiddenFileInput.parentNode&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,r.instances.splice(r.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,i=0,t=0;if(this.getActiveFiles().length){for(let l of this.getActiveFiles())i+=l.upload.bytesSent,t+=l.upload.total;e=100*i/t}else e=100;return this.emit("totaluploadprogress",e,t,i)}_getParamName(e){return typeof this.options.paramName=="function"?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){const i={...e,name:e.name.replace(/\u202F/g," ")};return typeof this.options.renameFile!="function"?i.name:this.options.renameFile(i)}getFallbackForm(){let e,i;if(e=this.getExistingFallback())return e;let t='<div class="dz-fallback">';this.options.dictFallbackText&&(t+=`<p>${this.options.dictFallbackText}</p>`),t+=`<input type="file" name="${this._getParamName(0)}" ${this.options.uploadMultiple?'multiple="multiple"':void 0} /><input type="submit" value="Upload!"></div>`;let s=r.createElement(t);return this.element.tagName!=="FORM"?(i=r.createElement(`<form action="${this.options.url}" enctype="multipart/form-data" method="${this.options.method}"></form>`),i.appendChild(s)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),i??s}getExistingFallback(){let e=function(t){for(let s of t)if(/(^| )fallback($| )/.test(s.className))return s};for(let t of["div","form"]){var i;if(i=e(this.element.getElementsByTagName(t)))return i}}setupEventListeners(){return this.listeners.map(e=>(()=>{let i=[];for(let t in e.events){let s=e.events[t];i.push(e.element.addEventListener(t,s,!1))}return i})())}removeEventListeners(){return this.listeners.map(e=>(()=>{let i=[];for(let t in e.events){let s=e.events[t];i.push(e.element.removeEventListener(t,s,!1))}return i})())}disable(){return this.clickableElements.forEach(e=>e.classList.remove("dz-clickable")),this.removeEventListeners(),this.disabled=!0,this.files.map(e=>this.cancelUpload(e))}enable(){return delete this.disabled,this.clickableElements.forEach(e=>e.classList.add("dz-clickable")),this.setupEventListeners()}filesize(e){let i=0,t="b";if(e>0){let s=["tb","gb","mb","kb","b"];for(let l=0;l<s.length;l++){let a=s[l],u=Math.pow(this.options.filesizeBase,4-l)/10;if(e>=u){i=e/Math.pow(this.options.filesizeBase,4-l),t=a;break}}i=Math.round(10*i)/10}return`<strong>${i}</strong> ${this.options.dictFileSizeUnits[t]}`}_updateMaxFilesReachedClass(){return this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let i=[];for(let t=0;t<e.dataTransfer.files.length;t++)i[t]=e.dataTransfer.files[t];if(i.length){let{items:t}=e.dataTransfer;t&&t.length&&t[0].webkitGetAsEntry!=null?this._addFilesFromItems(t):this.handleFiles(i)}this.emit("addedfiles",i)}paste(e){if(S(e!=null?e.clipboardData:void 0,t=>t.items)==null)return;this.emit("paste",e);let{items:i}=e.clipboardData;if(i.length)return this._addFilesFromItems(i)}handleFiles(e){for(let i of e)this.addFile(i)}_addFilesFromItems(e){return(()=>{let i=[];for(let s of e){var t;s.webkitGetAsEntry!=null&&(t=s.webkitGetAsEntry())?t.isFile?i.push(this.addFile(s.getAsFile())):t.isDirectory?i.push(this._addFilesFromDirectory(t,t.name)):i.push(void 0):s.getAsFile!=null&&(s.kind==null||s.kind==="file")?i.push(this.addFile(s.getAsFile())):i.push(void 0)}return i})()}_addFilesFromDirectory(e,i){let t=e.createReader(),s=u=>T(console,"log",d=>d.log(u)),l=0;var a=()=>t.readEntries(u=>{if(u.length>0){for(let d of u)d.isFile?(++l,d.file(o=>{if(!(this.options.ignoreHiddenFiles&&o.name.substring(0,1)==="."))return o.fullPath=`${i}/${o.name}`,this.addFile(o)})):d.isDirectory&&this._addFilesFromDirectory(d,`${i}/${d.name}`);a()}else l===0&&this.emit("emptyfolder",i);return null},s);return a()}accept(e,i){this.options.maxFilesize&&e.size>this.options.maxFilesize*1048576?i(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):r.isValidFile(e,this.options.acceptedFiles)?this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(i(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,i):i(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:window.isSecureContext?self.crypto.randomUUID():r.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=r.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,i=>{i?(e.accepted=!1,this._errorProcessing([e],i)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()})}enqueueFiles(e){for(let i of e)this.enqueueFile(i);return null}enqueueFile(e){if(e.status===r.ADDED&&e.accepted===!0){if(e.status=r.QUEUED,this.options.autoProcessQueue)return setTimeout(()=>this.processQueue(),0)}else throw new Error("This file can't be queued because it has already been processed or was rejected.")}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=this.options.maxThumbnailFilesize*1048576)return this._thumbnailQueue.push(e),setTimeout(()=>this._processThumbnailQueue(),0)}_processThumbnailQueue(){if(this._processingThumbnail||this._thumbnailQueue.length===0)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,i=>(this.emit("thumbnail",e,i),this._processingThumbnail=!1,this._processThumbnailQueue()))}removeFile(e){if(e.status===r.UPLOADING&&this.cancelUpload(e),this.files=k(this.files,e),this.emit("removedfile",e),this.files.length===0)return this.emit("reset")}removeAllFiles(e){e==null&&(e=!1);for(let i of this.files.slice())(i.status!==r.UPLOADING||e)&&this.removeFile(i);return null}resizeImage(e,i,t,s,l){return this.createThumbnail(e,i,t,s,!0,(a,u)=>{if(u==null)return l(e);{let{resizeMimeType:d}=this.options;d==null&&(d=e.type);let o=u.toDataURL(d,this.options.resizeQuality);return(d==="image/jpeg"||d==="image/jpg")&&(o=A(e.dataURL,o)),l(r.dataURItoBlob(o))}},!0)}createThumbnail(e,i,t,s,l,a,u=!1){let d=new FileReader;d.onload=()=>{if(e.dataURL=d.result,e.type==="image/svg+xml"){a!=null&&a(d.result);return}this.createThumbnailFromUrl(e,i,t,s,l,a,void 0,u)},d.readAsDataURL(e)}displayExistingFile(e,i,t,s,l=!0){if(this.emit("addedfile",e),this.emit("complete",e),!l)this.emit("thumbnail",e,i),t&&t();else{let a=u=>{this.emit("thumbnail",e,u),t&&t()};e.dataURL=i,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,a,s)}}createThumbnailFromUrl(e,i,t,s,l,a,u,d=!1){let o=document.createElement("img");u&&(o.crossOrigin=u),l=getComputedStyle(document.body).imageOrientation=="from-image"?!1:l,o.onload=()=>{let g=f=>f(1);return typeof EXIF<"u"&&EXIF!==null&&l&&(g=f=>EXIF.getData(o,function(){return f(EXIF.getTag(this,"Orientation"))})),g(f=>{e.width=o.width,e.height=o.height;let p=this.options.resize.call(this,e,i,t,s),m=document.createElement("canvas"),c=m.getContext("2d");switch(m.width=p.trgWidth,m.height=p.trgHeight,f>4&&(m.width=p.trgHeight,m.height=p.trgWidth),f){case 2:c.translate(m.width,0),c.scale(-1,1);break;case 3:c.translate(m.width,m.height),c.rotate(Math.PI);break;case 4:c.translate(0,m.height),c.scale(1,-1);break;case 5:c.rotate(.5*Math.PI),c.scale(1,-1);break;case 6:c.rotate(.5*Math.PI),c.translate(0,-m.width);break;case 7:c.rotate(.5*Math.PI),c.translate(m.height,-m.width),c.scale(-1,1);break;case 8:c.rotate(-.5*Math.PI),c.translate(-m.height,0);break}L(c,o,p.srcX!=null?p.srcX:0,p.srcY!=null?p.srcY:0,p.srcWidth,p.srcHeight,p.trgX!=null?p.trgX:0,p.trgY!=null?p.trgY:0,p.trgWidth,p.trgHeight);let y=m.toDataURL("image/png");if(a!=null)return a(y,m)})},a!=null&&(o.onerror=a);var h=e.dataURL;return d&&(h=U(h)),o.src=h}processQueue(){let{parallelUploads:e}=this.options,i=this.getUploadingFiles().length,t=i;if(i>=e)return;let s=this.getQueuedFiles();if(s.length>0){if(this.options.uploadMultiple)return this.processFiles(s.slice(0,e-i));for(;t<e;){if(!s.length)return;this.processFile(s.shift()),t++}}}processFile(e){return this.processFiles([e])}processFiles(e){for(let i of e)i.processing=!0,i.status=r.UPLOADING,this.emit("processing",i);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}_getFilesWithXhr(e){return this.files.filter(i=>i.xhr===e).map(i=>i)}cancelUpload(e){if(e.status===r.UPLOADING){let i=this._getFilesWithXhr(e.xhr);for(let t of i)t.status=r.CANCELED;typeof e.xhr<"u"&&e.xhr.abort();for(let t of i)this.emit("canceled",t);this.options.uploadMultiple&&this.emit("canceledmultiple",i)}else(e.status===r.ADDED||e.status===r.QUEUED)&&(e.status=r.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...i){return typeof e=="function"?e.apply(this,i):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,i=>{if(this.options.chunking){let t=i[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||t.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(t.size/this.options.chunkSize),t.size===0&&(e[0].upload.totalChunkCount=1)}if(e[0].upload.chunked){let t=e[0],s=i[0];t.upload.chunks=[];let l=()=>{let a=0;for(;t.upload.chunks[a]!==void 0;)a++;if(a>=t.upload.totalChunkCount)return;let u=a*this.options.chunkSize,d=Math.min(u+this.options.chunkSize,s.size),o={name:this._getParamName(0),data:s.webkitSlice?s.webkitSlice(u,d):s.slice(u,d),filename:t.upload.filename,chunkIndex:a};t.upload.chunks[a]={file:t,index:a,dataBlock:o,status:r.UPLOADING,progress:0,retries:0},this._uploadData(e,[o])};if(t.upload.finishedChunkUpload=(a,u)=>{let d=!0;a.status=r.SUCCESS,a.dataBlock=null,a.response=a.xhr.responseText,a.responseHeaders=a.xhr.getAllResponseHeaders(),a.xhr=null;for(let o=0;o<t.upload.totalChunkCount;o++){if(t.upload.chunks[o]===void 0)return l();t.upload.chunks[o].status!==r.SUCCESS&&(d=!1)}d&&this.options.chunksUploaded(t,()=>{this._finished(e,u,null)})},this.options.parallelChunkUploads){const a=Math.min(this.options.parallelChunkUploads===!0?this.options.parallelUploads:this.options.parallelChunkUploads,t.upload.totalChunkCount);for(let u=0;u<a;u++)l()}else l()}else{let t=[];for(let s=0;s<e.length;s++)t[s]={name:this._getParamName(s),data:i[s],filename:e[s].upload.filename};this._uploadData(e,t)}})}_getChunk(e,i){for(let t=0;t<e.upload.totalChunkCount;t++)if(e.upload.chunks[t]!==void 0&&e.upload.chunks[t].xhr===i)return e.upload.chunks[t]}_uploadData(e,i){let t=new XMLHttpRequest;for(let o of e)o.xhr=t;e[0].upload.chunked&&(e[0].upload.chunks[i[0].chunkIndex].xhr=t);let s=this.resolveOption(this.options.method,e,i),l=this.resolveOption(this.options.url,e,i);t.open(s,l,!0),this.resolveOption(this.options.timeout,e)&&(t.timeout=this.resolveOption(this.options.timeout,e)),t.withCredentials=!!this.options.withCredentials,t.onload=o=>{this._finishedUploading(e,t,o)},t.ontimeout=()=>{this._handleUploadError(e,t,`Request timedout after ${this.options.timeout/1e3} seconds`)},t.onerror=()=>{this._handleUploadError(e,t)};let u=t.upload!=null?t.upload:t;u.onprogress=o=>this._updateFilesUploadProgress(e,t,o);let d=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(d["Content-Type"]=e[0].type),this.options.headers&&Object.assign(d,this.options.headers);for(let o in d){let h=d[o];h&&t.setRequestHeader(o,h)}if(this.options.binaryBody){for(let o of e)this.emit("sending",o,t);this.options.uploadMultiple&&this.emit("sendingmultiple",e,t),this.submitRequest(t,null,e)}else{let o=new FormData;if(this.options.params){let h=this.options.params;typeof h=="function"&&(h=h.call(this,e,t,e[0].upload.chunked?this._getChunk(e[0],t):null));for(let g in h){let f=h[g];if(Array.isArray(f))for(let p=0;p<f.length;p++)o.append(g,f[p]);else o.append(g,f)}}for(let h of e)this.emit("sending",h,t,o);this.options.uploadMultiple&&this.emit("sendingmultiple",e,t,o),this._addFormElementData(o);for(let h=0;h<i.length;h++){let g=i[h];o.append(g.name,g.data,g.filename)}this.submitRequest(t,o,e)}}_transformFiles(e,i){let t=[],s=0;for(let l=0;l<e.length;l++)this.options.transformFile.call(this,e[l],a=>{t[l]=a,++s===e.length&&i(t)})}_addFormElementData(e){if(this.element.tagName==="FORM")for(let i of this.element.querySelectorAll("input, textarea, select, button")){let t=i.getAttribute("name"),s=i.getAttribute("type");if(s&&(s=s.toLowerCase()),!(typeof t>"u"||t===null))if(i.tagName==="SELECT"&&i.hasAttribute("multiple"))for(let l of i.options)l.selected&&e.append(t,l.value);else(!s||s!=="checkbox"&&s!=="radio"||i.checked)&&e.append(t,i.value)}}_updateFilesUploadProgress(e,i,t){if(e[0].upload.chunked){let s=e[0],l=this._getChunk(s,i);t?(l.progress=100*t.loaded/t.total,l.total=t.total,l.bytesSent=t.loaded):(l.progress=100,l.bytesSent=l.total),s.upload.progress=0,s.upload.total=0,s.upload.bytesSent=0;for(let a=0;a<s.upload.totalChunkCount;a++)s.upload.chunks[a]&&typeof s.upload.chunks[a].progress<"u"&&(s.upload.progress+=s.upload.chunks[a].progress,s.upload.total+=s.upload.chunks[a].total,s.upload.bytesSent+=s.upload.chunks[a].bytesSent);s.upload.progress=s.upload.progress/s.upload.totalChunkCount,this.emit("uploadprogress",s,s.upload.progress,s.upload.bytesSent)}else for(let s of e)s.upload.total&&s.upload.bytesSent&&s.upload.bytesSent==s.upload.total||(t?(s.upload.progress=100*t.loaded/t.total,s.upload.total=t.total,s.upload.bytesSent=t.loaded):(s.upload.progress=100,s.upload.bytesSent=s.upload.total),this.emit("uploadprogress",s,s.upload.progress,s.upload.bytesSent))}_finishedUploading(e,i,t){let s;if(e[0].status!==r.CANCELED&&i.readyState===4){if(i.responseType!=="arraybuffer"&&i.responseType!=="blob"&&(s=i.responseText,i.getResponseHeader("content-type")&&~i.getResponseHeader("content-type").indexOf("application/json")))try{s=JSON.parse(s)}catch(l){t=l,s="Invalid JSON response from server."}this._updateFilesUploadProgress(e,i),200<=i.status&&i.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],i),s):this._finished(e,s,t):this._handleUploadError(e,i,s)}}_handleUploadError(e,i,t){if(e[0].status!==r.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){let s=this._getChunk(e[0],i);if(s.retries++<this.options.retryChunksLimit){this._uploadData(e,[s.dataBlock]);return}else console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(e,t||this.options.dictResponseError.replace("{{statusCode}}",i.status),i)}}submitRequest(e,i,t){if(e.readyState!=1){console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.");return}if(this.options.binaryBody)if(t[0].upload.chunked){const s=this._getChunk(t[0],e);e.send(s.dataBlock.data)}else e.send(t[0]);else e.send(i)}_finished(e,i,t){for(let s of e)s.status=r.SUCCESS,this.emit("success",s,i,t),this.emit("complete",s);if(this.options.uploadMultiple&&(this.emit("successmultiple",e,i,t),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}_errorProcessing(e,i,t){for(let s of e)s.status=r.ERROR,this.emit("error",s,i,t),this.emit("complete",s);if(this.options.uploadMultiple&&(this.emit("errormultiple",e,i,t),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}static uuidv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}}r.initClass();r.options={};r.optionsForElement=function(n){if(n.getAttribute("id")&&typeof r.options<"u")return r.options[z(n.getAttribute("id"))]};r.instances=[];r.forElement=function(n){if(typeof n=="string"&&(n=document.querySelector(n)),(n!=null?n.dropzone:void 0)==null)throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return n.dropzone};r.discover=function(){let n;if(document.querySelectorAll)n=document.querySelectorAll(".dropzone");else{n=[];let e=i=>(()=>{let t=[];for(let s of i)/(^| )dropzone($| )/.test(s.className)?t.push(n.push(s)):t.push(void 0);return t})();e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))}return(()=>{let e=[];for(let i of n)r.optionsForElement(i)!==!1?e.push(new r(i)):e.push(void 0);return e})()};r.isBrowserSupported=function(){return typeof Promise<"u"};r.dataURItoBlob=function(n){let e=atob(n.split(",")[1]),i=n.split(",")[0].split(":")[1].split(";")[0],t=new ArrayBuffer(e.length),s=new Uint8Array(t);for(let l=0,a=e.length,u=0<=a;u?l<=a:l>=a;u?l++:l--)s[l]=e.charCodeAt(l);return new Blob([t],{type:i})};const k=(n,e)=>n.filter(i=>i!==e).map(i=>i),z=n=>n.replace(/[\-_](\w)/g,e=>e.charAt(1).toUpperCase());r.createElement=function(n){let e=document.createElement("div");return e.innerHTML=n,e.childNodes[0]};r.elementInside=function(n,e){if(n===e)return!0;for(;n=n.parentNode;)if(n===e)return!0;return!1};r.getElement=function(n,e){let i;if(typeof n=="string"?i=document.querySelector(n):n.nodeType!=null&&(i=n),i==null)throw new Error(`Invalid \`${e}\` option provided. Please provide a CSS selector or a plain HTML element.`);return i};r.getElements=function(n,e){let i,t;if(n instanceof Array){t=[];try{for(i of n)t.push(this.getElement(i,e))}catch{t=null}}else if(typeof n=="string"){t=[];for(i of document.querySelectorAll(n))t.push(i)}else n.nodeType!=null&&(t=[n]);if(t==null||!t.length)throw new Error(`Invalid \`${e}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return t};r.confirm=function(n,e,i){if(window.confirm(n))return e();if(i!=null)return i()};r.isValidFile=function(n,e){if(!e)return!0;e=e.split(",");let i=n.type,t=i.replace(/\/.*$/,"");for(let s of e)if(s=s.trim(),s.charAt(0)==="."){if(n.name.toLowerCase().indexOf(s.toLowerCase(),n.name.length-s.length)!==-1)return!0}else if(/\/\*$/.test(s)){if(t===s.replace(/\/.*$/,""))return!0}else if(i===s)return!0;return!1};typeof jQuery<"u"&&jQuery!==null&&(jQuery.fn.dropzone=function(n){return this.each(function(){return new r(this,n)})});r.ADDED="added";r.QUEUED="queued";r.ACCEPTED=r.QUEUED;r.UPLOADING="uploading";r.PROCESSING=r.UPLOADING;r.CANCELED="canceled";r.ERROR="error";r.SUCCESS="success";let b=function(n){let e=n.naturalHeight,i=document.createElement("canvas");i.width=1,i.height=e;let t=i.getContext("2d");t.drawImage(n,0,0);let{data:s}=t.getImageData(1,0,1,e),l=0,a=e,u=e;for(;u>l;)s[(u-1)*4+3]===0?a=u:l=u,u=a+l>>1;let d=u/e;return d===0?1:d};var L=function(n,e,i,t,s,l,a,u,d,o){let h=b(e);return n.drawImage(e,i,t,s,l,a,u,d,o/h)};function U(n){var e="data:image/jpeg;base64,";if(!n.startsWith(e))return n;var i=window.atob(n.slice(e.length));if(!i.startsWith("ÿØÿ"))return n;for(var t=0,s="";t<i.length;)if(i.slice(t,t+2)=="ÿÚ"){s+=i.slice(t);break}else if(i.slice(t,t+2)=="ÿØ")s+=i.slice(t,t+2),t+=2;else{var l=i.charCodeAt(t+2)*256+i.charCodeAt(t+3),a=t+l+2,u=i.slice(t,a);u.startsWith("ÿá")||(s+=u),t=a}return e+window.btoa(s)}function A(n,e){var i="data:image/jpeg;base64,";if(!(n.startsWith(i)&&e.startsWith(i)))return e;var t=window.atob(n.slice(i.length));if(!t.startsWith("ÿØÿ"))return e;for(var s=0,l="";s<t.length&&t.slice(s,s+2)!="ÿÚ";)if(t.slice(s,s+2)=="ÿØ")s+=2;else{var a=t.charCodeAt(s+2)*256+t.charCodeAt(s+3),u=s+a+2,d=t.slice(s,u);d.startsWith("ÿá")&&(l+=d),s=u}if(l=="")return e;var o=window.atob(e.slice(i.length));if(!o.startsWith("ÿØÿ"))return e;var h=4+o.charCodeAt(4)*256+o.charCodeAt(5);return o=o.slice(0,h)+l+o.slice(h),i+window.btoa(o)}function S(n,e){return typeof n<"u"&&n!==null?e(n):void 0}function T(n,e,i){if(typeof n<"u"&&n!==null&&typeof n[e]=="function")return i(n,e)}export{r as Dropzone,r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exports as n}from"../../../../../../../../_virtual/fetch.js";import{__require as E}from"../../../../../../undici@5.
|
|
1
|
+
import{__exports as n}from"../../../../../../../../_virtual/fetch.js";import{__require as E}from"../../../../../../undici@5.29.0/node_modules/undici/index.js";var x;function g(){if(x)return n;x=1;var c={};Object.defineProperty(n,"__esModule",{value:!0}),n.request=n.isFetchError=void 0,n.getProxyUrl=f;const o=E();class u extends Error{constructor(t,r){super(),this.response=t,this.data=r}}const P=e=>e instanceof u;n.isFetchError=P;function f(){return c.HTTPS_PROXY||c.HTTP_PROXY||c.https_proxy||c.http_proxy}const h=f(),d=h?new o.ProxyAgent({uri:h}):void 0;d&&(0,o.setGlobalDispatcher)(d);async function i(e,t,r={},_){const p=new URL(e);r!=null&&r.query&&Object.entries(r.query).forEach(([a,l])=>{p.searchParams.append(a,l)}),e=p.toString(),_&&(r.body=JSON.stringify(_));const s=await fetch(e,{...r,method:t});if(!s.ok){let a;try{a=await s.json()}catch{a=void 0}throw new u(s,a)}const y=await s.text(),q=y?JSON.parse(y):{};return{response:s,data:q}}return n.request={get:(e,t={})=>i(e,"GET",t),post:(e,t,r={})=>i(e,"POST",r,t),put:(e,t,r={})=>i(e,"PUT",r,t),delete:(e,t,r={})=>i(e,"DELETE",r,t)},n}export{g as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="1.3.3",o={version:e};export{o as default,e as version};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getSideAxis as L,getAlignmentAxis as H,getSide as F,getAlignment as C,getAxisLength as J,evaluate as _,getOppositePlacement as K,getExpandedPlacements as N,getOppositeAxisPlacements as Q,getAlignmentSides as q,getPaddingObject as U,rectToClientRect as I,placements as X,getOppositeAlignmentPlacement as W}from"../../../../../@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.js";function Y(n,l,f){let{reference:t,floating:e}=n;const i=L(l),c=H(l),a=J(c),w=F(l),p=i==="y",g=t.x+t.width/2-e.width/2,r=t.y+t.height/2-e.height/2,d=t[a]/2-e[a]/2;let o;switch(w){case"top":o={x:g,y:t.y-e.height};break;case"bottom":o={x:g,y:t.y+t.height};break;case"right":o={x:t.x+t.width,y:r};break;case"left":o={x:t.x-e.width,y:r};break;default:o={x:t.x,y:t.y}}switch(C(l)){case"start":o[c]-=d*(f&&p?-1:1);break;case"end":o[c]+=d*(f&&p?-1:1);break}return o}const te=async(n,l,f)=>{const{placement:t="bottom",strategy:e="absolute",middleware:i=[],platform:c}=f,a=i.filter(Boolean),w=await(c.isRTL==null?void 0:c.isRTL(l));let p=await c.getElementRects({reference:n,floating:l,strategy:e}),{x:g,y:r}=Y(p,t,w),d=t,o={},x=0;for(let h=0;h<a.length;h++){const{name:y,fn:v}=a[h],{x:u,y:P,data:b,reset:s}=await v({x:g,y:r,initialPlacement:t,placement:d,strategy:e,middlewareData:o,rects:p,platform:c,elements:{reference:n,floating:l}});g=u??g,r=P??r,o={...o,[y]:{...o[y],...b}},s&&x<=50&&(x++,typeof s=="object"&&(s.placement&&(d=s.placement),s.rects&&(p=s.rects===!0?await c.getElementRects({reference:n,floating:l,strategy:e}):s.rects),{x:g,y:r}=Y(p,d,w)),h=-1)}return{x:g,y:r,placement:d,strategy:e,middlewareData:o}};async function z(n,l){var f;l===void 0&&(l={});const{x:t,y:e,platform:i,rects:c,elements:a,strategy:w}=n,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:r="floating",altBoundary:d=!1,padding:o=0}=_(l,n),x=U(o),y=a[d?r==="floating"?"reference":"floating":r],v=I(await i.getClippingRect({element:(f=await(i.isElement==null?void 0:i.isElement(y)))==null||f?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:p,rootBoundary:g,strategy:w})),u=r==="floating"?{x:t,y:e,width:c.floating.width,height:c.floating.height}:c.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(P))?await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1}:{x:1,y:1},s=I(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:u,offsetParent:P,strategy:w}):u);return{top:(v.top-s.top+x.top)/b.y,bottom:(s.bottom-v.bottom+x.bottom)/b.y,left:(v.left-s.left+x.left)/b.x,right:(s.right-v.right+x.right)/b.x}}function Z(n,l,f){return(n?[...f.filter(e=>C(e)===n),...f.filter(e=>C(e)!==n)]:f.filter(e=>F(e)===e)).filter(e=>n?C(e)===n||(l?W(e)!==e:!1):!0)}const ne=function(n){return n===void 0&&(n={}),{name:"autoPlacement",options:n,async fn(l){var f,t,e;const{rects:i,middlewareData:c,placement:a,platform:w,elements:p}=l,{crossAxis:g=!1,alignment:r,allowedPlacements:d=X,autoAlignment:o=!0,...x}=_(n,l),h=r!==void 0||d===X?Z(r||null,o,d):d,y=await z(l,x),v=((f=c.autoPlacement)==null?void 0:f.index)||0,u=h[v];if(u==null)return{};const P=q(u,i,await(w.isRTL==null?void 0:w.isRTL(p.floating)));if(a!==u)return{reset:{placement:h[0]}};const b=[y[F(u)],y[P[0]],y[P[1]]],s=[...((t=c.autoPlacement)==null?void 0:t.overflows)||[],{placement:u,overflows:b}],T=h[v+1];if(T)return{data:{index:v+1,overflows:s},reset:{placement:T}};const B=s.map(m=>{const O=C(m.placement);return[m.placement,O&&g?m.overflows.slice(0,2).reduce((j,M)=>j+M,0):m.overflows[0],m.overflows]}).sort((m,O)=>m[1]-O[1]),S=((e=B.filter(m=>m[2].slice(0,C(m[0])?2:3).every(O=>O<=0))[0])==null?void 0:e[0])||B[0][0];return S!==a?{data:{index:v+1,overflows:s},reset:{placement:S}}:{}}}},le=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(l){var f,t;const{placement:e,middlewareData:i,rects:c,initialPlacement:a,platform:w,elements:p}=l,{mainAxis:g=!0,crossAxis:r=!0,fallbackPlacements:d,fallbackStrategy:o="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...y}=_(n,l);if((f=i.arrow)!=null&&f.alignmentOffset)return{};const v=F(e),u=L(a),P=F(a)===a,b=await(w.isRTL==null?void 0:w.isRTL(p.floating)),s=d||(P||!h?[K(a)]:N(a)),T=x!=="none";!d&&T&&s.push(...Q(a,h,x,b));const B=[a,...s],$=await z(l,y),S=[];let m=((t=i.flip)==null?void 0:t.overflows)||[];if(g&&S.push($[v]),r){const k=q(e,c,b);S.push($[k[0]],$[k[1]])}if(m=[...m,{placement:e,overflows:S}],!S.every(k=>k<=0)){var O,j;const k=(((O=i.flip)==null?void 0:O.index)||0)+1,V=B[k];if(V&&(!(r==="alignment"?u!==L(V):!1)||m.every(A=>A.overflows[0]>0&&L(A.placement)===u)))return{data:{index:k,overflows:m},reset:{placement:V}};let D=(j=m.filter(E=>E.overflows[0]<=0).sort((E,A)=>E.overflows[1]-A.overflows[1])[0])==null?void 0:j.placement;if(!D)switch(o){case"bestFit":{var M;const E=(M=m.filter(A=>{if(T){const R=L(A.placement);return R===u||R==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(R=>R>0).reduce((R,G)=>R+G,0)]).sort((A,R)=>A[1]-R[1])[0])==null?void 0:M[0];E&&(D=E);break}case"initialPlacement":D=a;break}if(e!==D)return{reset:{placement:D}}}return{}}}};export{ne as autoPlacement,te as computePosition,z as detectOverflow,le as flip,I as rectToClientRect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{computePosition as ot,flip as st,autoPlacement as rt}from"../../../../../@floating-ui_core@1.7.
|
|
1
|
+
import{computePosition as ot,flip as st,autoPlacement as rt}from"../../../../../@floating-ui_core@1.7.1/node_modules/@floating-ui/core/dist/floating-ui.core.js";import{createCoords as w,rectToClientRect as J,floor as A,max as E,round as H,min as z}from"../../../../../@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.js";import{getOverflowAncestors as M,isElement as v,getDocumentElement as O,getWindow as L,getFrameElement as K,getComputedStyle as R,isHTMLElement as b,isWebKit as Q,isTopLayer as S,getParentNode as W,isLastTraversableNode as N,isTableElement as ct,isContainingBlock as Y,getContainingBlock as lt,getNodeName as _,isOverflowElement as P,getNodeScroll as I}from"../../../../../@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js";function Z(t){const e=R(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=b(t),r=o?t.offsetWidth:n,s=o?t.offsetHeight:i,c=H(n)!==r||H(i)!==s;return c&&(n=r,i=s),{width:n,height:i,$:c}}function $(t){return v(t)?t:t.contextElement}function F(t){const e=$(t);if(!b(e))return w(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:r}=Z(e);let s=(r?H(n.width):n.width)/i,c=(r?H(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const ft=w(0);function X(t){const e=L(t);return!Q()||!e.visualViewport?ft:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ut(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==L(t)?!1:e}function T(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=$(t);let s=w(1);e&&(i?v(i)&&(s=F(i)):s=F(t));const c=ut(r,n,i)?X(r):w(0);let l=(o.left+c.x)/s.x,f=(o.top+c.y)/s.y,u=o.width/s.x,h=o.height/s.y;if(r){const p=L(r),a=i&&v(i)?L(i):i;let y=p,g=K(y);for(;g&&i&&a!==y;){const m=F(g),d=g.getBoundingClientRect(),x=R(g),C=d.left+(g.clientLeft+parseFloat(x.paddingLeft))*m.x,B=d.top+(g.clientTop+parseFloat(x.paddingTop))*m.y;l*=m.x,f*=m.y,u*=m.x,h*=m.y,l+=C,f+=B,y=L(g),g=K(y)}}return J({width:u,height:h,x:l,y:f})}function q(t,e){const n=I(t).scrollLeft;return e?e.left+n:T(O(t)).left+n}function tt(t,e,n){n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=i.left+e.scrollLeft-(n?0:q(t,i)),r=i.top+e.scrollTop;return{x:o,y:r}}function ht(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const r=o==="fixed",s=O(i),c=e?S(e.floating):!1;if(i===s||c&&r)return n;let l={scrollLeft:0,scrollTop:0},f=w(1);const u=w(0),h=b(i);if((h||!h&&!r)&&((_(i)!=="body"||P(s))&&(l=I(i)),b(i))){const a=T(i);f=F(i),u.x=a.x+i.clientLeft,u.y=a.y+i.clientTop}const p=s&&!h&&!r?tt(s,l,!0):w(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+u.x+p.x,y:n.y*f.y-l.scrollTop*f.y+u.y+p.y}}function at(t){return Array.from(t.getClientRects())}function dt(t){const e=O(t),n=I(t),i=t.ownerDocument.body,o=E(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=E(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+q(t);const c=-n.scrollTop;return R(i).direction==="rtl"&&(s+=E(e.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:c}}function gt(t,e){const n=L(t),i=O(t),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,c=0,l=0;if(o){r=o.width,s=o.height;const f=Q();(!f||f&&e==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:c,y:l}}function pt(t,e){const n=T(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,r=b(t)?F(t):w(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=o*r.x,f=i*r.y;return{width:s,height:c,x:l,y:f}}function j(t,e,n){let i;if(e==="viewport")i=gt(t,n);else if(e==="document")i=dt(O(t));else if(v(e))i=pt(e,n);else{const o=X(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return J(i)}function et(t,e){const n=W(t);return n===e||!v(n)||N(n)?!1:R(n).position==="fixed"||et(n,e)}function mt(t,e){const n=e.get(t);if(n)return n;let i=M(t,[],!1).filter(c=>v(c)&&_(c)!=="body"),o=null;const r=R(t).position==="fixed";let s=r?W(t):t;for(;v(s)&&!N(s);){const c=R(s),l=Y(s);!l&&c.position==="fixed"&&(o=null),(r?!l&&!o:!l&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||P(s)&&!l&&et(t,s))?i=i.filter(u=>u!==s):o=c,s=W(s)}return e.set(t,i),i}function wt(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const s=[...n==="clippingAncestors"?S(e)?[]:mt(e,this._c):[].concat(n),i],c=s[0],l=s.reduce((f,u)=>{const h=j(e,u,o);return f.top=E(h.top,f.top),f.right=z(h.right,f.right),f.bottom=z(h.bottom,f.bottom),f.left=E(h.left,f.left),f},j(e,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function yt(t){const{width:e,height:n}=Z(t);return{width:e,height:n}}function xt(t,e,n){const i=b(e),o=O(e),r=n==="fixed",s=T(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const l=w(0);function f(){l.x=q(o)}if(i||!i&&!r)if((_(e)!=="body"||P(o))&&(c=I(e)),i){const a=T(e,!0,r,e);l.x=a.x+e.clientLeft,l.y=a.y+e.clientTop}else o&&f();r&&!i&&o&&f();const u=o&&!i&&!r?tt(o,c):w(0),h=s.left+c.scrollLeft-l.x-u.x,p=s.top+c.scrollTop-l.y-u.y;return{x:h,y:p,width:s.width,height:s.height}}function V(t){return R(t).position==="static"}function G(t,e){if(!b(t)||R(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return O(t)===n&&(n=n.ownerDocument.body),n}function nt(t,e){const n=L(t);if(S(t))return n;if(!b(t)){let o=W(t);for(;o&&!N(o);){if(v(o)&&!V(o))return o;o=W(o)}return n}let i=G(t,e);for(;i&&ct(i)&&V(i);)i=G(i,e);return i&&N(i)&&V(i)&&!Y(i)?n:i||lt(t)||n}const vt=async function(t){const e=this.getOffsetParent||nt,n=this.getDimensions,i=await n(t.floating);return{reference:xt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Rt(t){return R(t).direction==="rtl"}const Ot={convertOffsetParentRelativeRectToViewportRelativeRect:ht,getDocumentElement:O,getClippingRect:wt,getOffsetParent:nt,getElementRects:vt,getClientRects:at,getDimensions:yt,getScale:F,isElement:v,isRTL:Rt};function it(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function bt(t,e){let n=null,i;const o=O(t);function r(){var c;clearTimeout(i),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),r();const f=t.getBoundingClientRect(),{left:u,top:h,width:p,height:a}=f;if(c||e(),!p||!a)return;const y=A(h),g=A(o.clientWidth-(u+p)),m=A(o.clientHeight-(h+a)),d=A(u),C={rootMargin:-y+"px "+-g+"px "+-m+"px "+-d+"px",threshold:E(0,z(1,l))||1};let B=!0;function k(U){const D=U[0].intersectionRatio;if(D!==l){if(!B)return s();D?s(!1,D):i=setTimeout(()=>{s(!1,1e-7)},1e3)}D===1&&!it(f,t.getBoundingClientRect())&&s(),B=!1}try{n=new IntersectionObserver(k,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,C)}n.observe(t)}return s(!0),r}function Et(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,f=$(t),u=o||r?[...f?M(f):[],...M(e)]:[];u.forEach(d=>{o&&d.addEventListener("scroll",n,{passive:!0}),r&&d.addEventListener("resize",n)});const h=f&&c?bt(f,n):null;let p=-1,a=null;s&&(a=new ResizeObserver(d=>{let[x]=d;x&&x.target===f&&a&&(a.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=a)==null||C.observe(e)})),n()}),f&&!l&&a.observe(f),a.observe(e));let y,g=l?T(t):null;l&&m();function m(){const d=T(t);g&&!it(g,d)&&n(),g=d,y=requestAnimationFrame(m)}return n(),()=>{var d;u.forEach(x=>{o&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),h==null||h(),(d=a)==null||d.disconnect(),a=null,l&&cancelAnimationFrame(y)}}const Ft=rt,Wt=st,Bt=(t,e,n)=>{const i=new Map,o={platform:Ot,...n},r={...o.platform,_c:i};return ot(t,e,{...o,platform:r})};export{Ft as autoPlacement,Et as autoUpdate,Bt as computePosition,Wt as flip,M as getOverflowAncestors,Ot as platform};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
var xt=Object.defineProperty;var vt=(e,t,r)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var H=(e,t,r)=>vt(e,typeof t!="symbol"?t+"":t,r);import{diff as S,printDiffOrStringify as
|
|
1
|
+
var xt=Object.defineProperty;var vt=(e,t,r)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var H=(e,t,r)=>vt(e,typeof t!="symbol"?t+"":t,r);import{diff as S,printDiffOrStringify as Tt}from"../../../../../@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/diff.js";import E from"../../../../../tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.js";import{isMockFunction as V}from"../../../../../@vitest_spy@3.2.0/node_modules/@vitest/spy/dist/index.js";import{processError as Nt}from"../../../../../@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/error.js";import{use as Ot,util as R}from"../../../../../chai@5.2.0/node_modules/chai/chai.js";import{getType as ut,isObject as q,assertTypes as N}from"../../../../../@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/helpers.js";import{s as M}from"../../../../../@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js";const k=Symbol.for("matchers-object"),B=Symbol.for("$$jest-matchers-object"),ft=Symbol.for("expect-global"),ht=Symbol.for("asymmetric-matchers-object"),ce={toSatisfy(e,t,r){const{printReceived:c,printExpected:a,matcherHint:h}=this.utils,u=t(e);return{pass:u,message:()=>u?`${h(".not.toSatisfy","received","")}
|
|
2
2
|
|
|
3
3
|
Expected value to not satisfy:
|
|
4
|
-
${r||
|
|
4
|
+
${r||a(t)}
|
|
5
5
|
Received:
|
|
6
|
-
${
|
|
6
|
+
${c(e)}`:`${h(".toSatisfy","received","")}
|
|
7
7
|
|
|
8
8
|
Expected value to satisfy:
|
|
9
|
-
${r||
|
|
9
|
+
${r||a(t)}
|
|
10
10
|
|
|
11
11
|
Received:
|
|
12
|
-
${
|
|
12
|
+
${c(e)}`}},toBeOneOf(e,t){const{equals:r,customTesters:c}=this,{printReceived:a,printExpected:h,matcherHint:u}=this.utils;if(!Array.isArray(t))throw new TypeError(`You must provide an array to ${u(".toBeOneOf")}, not '${typeof t}'.`);const d=t.length===0||t.some(m=>r(m,e,c));return{pass:d,message:()=>d?`${u(".not.toBeOneOf","received","")}
|
|
13
13
|
|
|
14
14
|
Expected value to not be one of:
|
|
15
15
|
${h(t)}
|
|
16
16
|
Received:
|
|
17
|
-
${
|
|
17
|
+
${a(e)}`:`${u(".toBeOneOf","received","")}
|
|
18
18
|
|
|
19
19
|
Expected value to be one of:
|
|
20
20
|
${h(t)}
|
|
21
21
|
|
|
22
22
|
Received:
|
|
23
|
-
${
|
|
24
|
-
`:"",h=`${e} has value: ${r(t)}`;return
|
|
23
|
+
${a(e)}`}}},D=E.green,J=E.red,jt=E.inverse,Mt=E.bold,j=E.dim;function Ct(e,t="received",r="expected",c={}){const{comment:a="",isDirectExpectCall:h=!1,isNot:u=!1,promise:d="",secondArgument:m="",expectedColor:n=D,receivedColor:o=J,secondArgumentColor:s=D}=c;let i="",l="expect";return!h&&t!==""&&(i+=j(`${l}(`)+o(t),l=")"),d!==""&&(i+=j(`${l}.`)+d,l=""),u&&(i+=`${j(`${l}.`)}not`,l=""),e.includes(".")?l+=e:(i+=j(`${l}.`)+e,l=""),r===""?l+="()":(i+=j(`${l}(`)+n(r),m&&(i+=j(", ")+s(m)),l=")"),a!==""&&(l+=` // ${a}`),l!==""&&(i+=j(l)),i}const _t="·";function pt(e){return e.replace(/\s+$/gm,t=>_t.repeat(t.length))}function At(e){return J(pt(M(e)))}function It(e){return D(pt(M(e)))}function dt(){return{EXPECTED_COLOR:D,RECEIVED_COLOR:J,INVERTED_COLOR:jt,BOLD_WEIGHT:Mt,DIM_COLOR:j,diff:S,matcherHint:Ct,printReceived:At,printExpected:It,printDiffOrStringify:Tt,printWithType:St}}function St(e,t,r){const c=ut(t),a=c!=="null"&&c!=="undefined"?`${e} has type: ${c}
|
|
24
|
+
`:"",h=`${e} has value: ${r(t)}`;return a+h}function le(e){if(!Array.isArray(e))throw new TypeError(`expect.customEqualityTesters: Must be set to an array of Testers. Was given "${ut(e)}"`);globalThis[B].customEqualityTesters.push(...e)}function G(){return globalThis[B].customEqualityTesters}function g(e,t,r,c){return r=r||[],A(e,t,[],[],r,c?mt:Rt)}function K(e){return!!e&&typeof e=="object"&&"asymmetricMatch"in e&&v("Function",e.asymmetricMatch)}function Bt(e,t){const r=K(e),c=K(t);if(!(r&&c)){if(r)return e.asymmetricMatch(t);if(c)return t.asymmetricMatch(e)}}function A(e,t,r,c,a,h){let u=!0;const d=Bt(e,t);if(d!==void 0)return d;const m={equals:g};for(let f=0;f<a.length;f++){const p=a[f].call(m,e,t,a);if(p!==void 0)return p}if(typeof URL=="function"&&e instanceof URL&&t instanceof URL)return e.href===t.href;if(Object.is(e,t))return!0;if(e===null||t===null)return e===t;const n=Object.prototype.toString.call(e);if(n!==Object.prototype.toString.call(t))return!1;switch(n){case"[object Boolean]":case"[object String]":case"[object Number]":return typeof e!=typeof t?!1:typeof e!="object"&&typeof t!="object"?Object.is(e,t):Object.is(e.valueOf(),t.valueOf());case"[object Date]":{const f=+e,p=+t;return f===p||Number.isNaN(f)&&Number.isNaN(p)}case"[object RegExp]":return e.source===t.source&&e.flags===t.flags;case"[object Temporal.Instant]":case"[object Temporal.ZonedDateTime]":case"[object Temporal.PlainDateTime]":case"[object Temporal.PlainDate]":case"[object Temporal.PlainTime]":case"[object Temporal.PlainYearMonth]":case"[object Temporal.PlainMonthDay]":return e.equals(t);case"[object Temporal.Duration]":return e.toString()===t.toString()}if(typeof e!="object"||typeof t!="object")return!1;if(Z(e)&&Z(t))return e.isEqualNode(t);let o=r.length;for(;o--;){if(r[o]===e)return c[o]===t;if(c[o]===t)return!1}if(r.push(e),c.push(t),n==="[object Array]"&&e.length!==t.length)return!1;if(e instanceof Error&&t instanceof Error)try{return Pt(e,t,r,c,a,h)}finally{r.pop(),c.pop()}const s=X(e,h);let i,l=s.length;if(X(t,h).length!==l)return!1;for(;l--;)if(i=s[l],u=h(t,i)&&A(e[i],t[i],r,c,a,h),!u)return!1;return r.pop(),c.pop(),u}function Pt(e,t,r,c,a,h){let u=Object.getPrototypeOf(e)===Object.getPrototypeOf(t)&&e.name===t.name&&e.message===t.message;return typeof t.cause<"u"&&u&&(u=A(e.cause,t.cause,r,c,a,h)),e instanceof AggregateError&&t instanceof AggregateError&&u&&(u=A(e.errors,t.errors,r,c,a,h)),u&&(u=A({...e},{...t},r,c,a,h)),u}function X(e,t){const r=[];for(const c in e)t(e,c)&&r.push(c);return r.concat(Object.getOwnPropertySymbols(e).filter(c=>Object.getOwnPropertyDescriptor(e,c).enumerable))}function Rt(e,t){return mt(e,t)&&e[t]!==void 0}function mt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function v(e,t){return Object.prototype.toString.apply(t)===`[object ${e}]`}function Z(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"&&"nodeName"in e&&typeof e.nodeName=="string"&&"isEqualNode"in e&&typeof e.isEqualNode=="function"}const gt="@@__IMMUTABLE_KEYED__@@",yt="@@__IMMUTABLE_SET__@@",qt="@@__IMMUTABLE_LIST__@@",L="@@__IMMUTABLE_ORDERED__@@",kt="@@__IMMUTABLE_RECORD__@@";function Dt(e){return!!(e&&e[gt]&&!e[L])}function Lt(e){return!!(e&&e[yt]&&!e[L])}function W(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Wt(e){return!!(e&&W(e)&&e[qt])}function Ht(e){return!!(e&&W(e)&&e[gt]&&e[L])}function Vt(e){return!!(e&&W(e)&&e[yt]&&e[L])}function Ft(e){return!!(e&&W(e)&&e[kt])}const bt=Symbol.iterator;function Q(e){return!!(e!=null&&e[bt])}function w(e,t,r=[],c=[],a=[]){if(typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t)||!Q(e)||!Q(t))return;if(e.constructor!==t.constructor)return!1;let h=c.length;for(;h--;)if(c[h]===e)return a[h]===t;c.push(e),a.push(t);const u=[...r.filter(n=>n!==w),d];function d(n,o){return w(n,o,[...r],[...c],[...a])}if(e.size!==void 0){if(e.size!==t.size)return!1;if(v("Set",e)||Lt(e)){let n=!0;for(const o of e)if(!t.has(o)){let s=!1;for(const i of t)g(o,i,u)===!0&&(s=!0);if(s===!1){n=!1;break}}return c.pop(),a.pop(),n}else if(v("Map",e)||Dt(e)){let n=!0;for(const o of e)if(!t.has(o[0])||!g(o[1],t.get(o[0]),u)){let s=!1;for(const i of t){const l=g(o[0],i[0],u);let f=!1;l===!0&&(f=g(o[1],i[1],u)),f===!0&&(s=!0)}if(s===!1){n=!1;break}}return c.pop(),a.pop(),n}}const m=t[bt]();for(const n of e){const o=m.next();if(o.done||!g(n,o.value,u))return!1}if(!m.next().done)return!1;if(!Wt(e)&&!Ht(e)&&!Vt(e)&&!Ft(e)){const n=Object.entries(e),o=Object.entries(t);if(!g(n,o,u))return!1}return c.pop(),a.pop(),!0}function z(e,t){return!e||typeof e!="object"||e===Object.prototype?!1:Object.prototype.hasOwnProperty.call(e,t)||z(Object.getPrototypeOf(e),t)}function Yt(e){return q(e)&&!(e instanceof Error)&&!Array.isArray(e)&&!(e instanceof Date)}function P(e,t,r=[]){const c=r.filter(h=>h!==P),a=(h=new WeakMap)=>(u,d)=>{if(Yt(d))return Object.keys(d).every(m=>{if(d[m]!=null&&typeof d[m]=="object"){if(h.has(d[m]))return g(u[m],d[m],c);h.set(d[m],!0)}const n=u!=null&&z(u,m)&&g(u[m],d[m],[...c,a(h)]);return h.delete(d[m]),n})};return a()(e,t)}function tt(e,t){if(!(e==null||t==null||e.constructor===t.constructor))return!1}function et(e,t){let r=e,c=t;if(!(e instanceof DataView&&t instanceof DataView)){if(!(e instanceof ArrayBuffer)||!(t instanceof ArrayBuffer))return;try{r=new DataView(e),c=new DataView(t)}catch{return}}if(r.byteLength!==c.byteLength)return!1;for(let a=0;a<r.byteLength;a++)if(r.getUint8(a)!==c.getUint8(a))return!1;return!0}function U(e,t,r=[]){if(!Array.isArray(e)||!Array.isArray(t))return;const c=Object.keys(e),a=Object.keys(t),h=r.filter(u=>u!==U);return g(e,t,h,!0)&&g(c,a)}function Ut(e,t="#{this}",r="#{exp}"){const c=`expected ${t} to be ${r} // Object.is equality`;return["toStrictEqual","toEqual"].includes(e)?`${c}
|
|
25
25
|
|
|
26
26
|
If it should pass with deep equality, replace "toBe" with "${e}"
|
|
27
27
|
|
|
28
28
|
Expected: ${t}
|
|
29
29
|
Received: serializes to the same string
|
|
30
|
-
`:
|
|
31
|
-
`,m].join(""))}}),{then(u,d){return h=!0,t.then(u,d)},catch(u){return t.catch(u)},finally(u){return t.finally(u)},[Symbol.toStringTag]:"Promise"}}return t}function Et(e,t,r){return function(...
|
|
32
|
-
(${f} matching ${f===1?"property":"properties"} omitted from actual)`;throw new r(y,{showDiff:!0,expected:n,actual:l})}}),c("toMatch",function(n){const o=this._obj;if(typeof o!="string")throw new TypeError(`.toMatch() expects to receive a string, but got ${typeof o}`);return this.assert(typeof n=="string"?o.includes(n):o.match(n),"expected #{this} to match #{exp}","expected #{this} not to match #{exp}",n,o)}),c("toContain",function(n){const o=this._obj;if(typeof Node<"u"&&o instanceof Node){if(!(n instanceof Node))throw new TypeError(`toContain() expected a DOM node as the argument, but got ${typeof n}`);return this.assert(o.contains(n),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",n,o)}if(typeof DOMTokenList<"u"&&o instanceof DOMTokenList){O(n,"class name",["string"]);const i=t.flag(this,"negate")?o.value.replace(n,"").trim():`${o.value} ${n}`;return this.assert(o.contains(n),`expected "${o.value}" to contain "${n}"`,`expected "${o.value}" not to contain "${n}"`,i,o.value)}return typeof o=="string"&&typeof n=="string"?this.assert(o.includes(n),"expected #{this} to contain #{exp}","expected #{this} not to contain #{exp}",n,o):(o!=null&&typeof o!="string"&&t.flag(this,"object",Array.from(o)),this.contain(n))}),c("toContainEqual",function(n){const o=t.flag(this,"object"),s=Array.from(o).findIndex(i=>g(i,n,a));this.assert(s!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",n)}),c("toBeTruthy",function(){const n=t.flag(this,"object");this.assert(!!n,"expected #{this} to be truthy","expected #{this} to not be truthy",!0,n)}),c("toBeFalsy",function(){const n=t.flag(this,"object");this.assert(!n,"expected #{this} to be falsy","expected #{this} to not be falsy",!1,n)}),c("toBeGreaterThan",function(n){const o=this._obj;return O(o,"actual",["number","bigint"]),O(n,"expected",["number","bigint"]),this.assert(o>n,`expected ${o} to be greater than ${n}`,`expected ${o} to be not greater than ${n}`,n,o,!1)}),c("toBeGreaterThanOrEqual",function(n){const o=this._obj;return O(o,"actual",["number","bigint"]),O(n,"expected",["number","bigint"]),this.assert(o>=n,`expected ${o} to be greater than or equal to ${n}`,`expected ${o} to be not greater than or equal to ${n}`,n,o,!1)}),c("toBeLessThan",function(n){const o=this._obj;return O(o,"actual",["number","bigint"]),O(n,"expected",["number","bigint"]),this.assert(o<n,`expected ${o} to be less than ${n}`,`expected ${o} to be not less than ${n}`,n,o,!1)}),c("toBeLessThanOrEqual",function(n){const o=this._obj;return O(o,"actual",["number","bigint"]),O(n,"expected",["number","bigint"]),this.assert(o<=n,`expected ${o} to be less than or equal to ${n}`,`expected ${o} to be not less than or equal to ${n}`,n,o,!1)}),c("toBeNaN",function(){const n=t.flag(this,"object");this.assert(Number.isNaN(n),"expected #{this} to be NaN","expected #{this} not to be NaN",Number.NaN,n)}),c("toBeUndefined",function(){const n=t.flag(this,"object");this.assert(n===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined",void 0,n)}),c("toBeNull",function(){const n=t.flag(this,"object");this.assert(n===null,"expected #{this} to be null","expected #{this} not to be null",null,n)}),c("toBeDefined",function(){const n=t.flag(this,"object");this.assert(typeof n<"u","expected #{this} to be defined","expected #{this} to be undefined",n)}),c("toBeTypeOf",function(n){const o=typeof this._obj,s=n===o;return this.assert(s,"expected #{this} to be type of #{exp}","expected #{this} not to be type of #{exp}",n,o)}),c("toBeInstanceOf",function(n){return this.instanceOf(n)}),c("toHaveLength",function(n){return this.have.length(n)}),c("toHaveProperty",function(...n){Array.isArray(n[0])&&(n[0]=n[0].map($=>String($).replace(/([.[\]])/g,"\\$1")).join("."));const o=this._obj,[s,i]=n,l=()=>Object.prototype.hasOwnProperty.call(o,s)?{value:o[s],exists:!0}:t.getPathInfo(o,s),{value:f,exists:p}=l(),y=p&&(n.length===1||g(i,f,a)),b=n.length===1?"":` with value ${t.objDisplay(i)}`;return this.assert(y,`expected #{this} to have property "${s}"${b}`,`expected #{this} to not have property "${s}"${b}`,i,p?f:void 0)}),c("toBeCloseTo",function(n,o=2){const s=this._obj;let i=!1,l=0,f=0;return n===Number.POSITIVE_INFINITY&&s===Number.POSITIVE_INFINITY||n===Number.NEGATIVE_INFINITY&&s===Number.NEGATIVE_INFINITY?i=!0:(l=10**-o/2,f=Math.abs(s-n),i=f<l),this.assert(i,`expected #{this} to be close to #{exp}, received difference is ${f}, but expected ${l}`,`expected #{this} to not be close to #{exp}, received difference is ${f}, but expected ${l}`,n,s,!1)});function h(n){if(!V(n._obj))throw new TypeError(`${t.inspect(n._obj)} is not a spy or a call to a spy!`)}function u(n){return h(n),n._obj}c(["toHaveBeenCalledTimes","toBeCalledTimes"],function(n){const o=u(this),s=o.getMockName(),i=o.mock.calls.length;return this.assert(i===n,`expected "${s}" to be called #{exp} times, but got ${i} times`,`expected "${s}" to not be called #{exp} times`,n,i,!1)}),c("toHaveBeenCalledOnce",function(){const n=u(this),o=n.getMockName(),s=n.mock.calls.length;return this.assert(s===1,`expected "${o}" to be called once, but got ${s} times`,`expected "${o}" to not be called once`,1,s,!1)}),c(["toHaveBeenCalled","toBeCalled"],function(){const n=u(this),o=n.getMockName(),s=n.mock.calls.length,i=s>0,l=t.flag(this,"negate");let f=t.getMessage(this,[i,`expected "${o}" to be called at least once`,`expected "${o}" to not be called at all, but actually been called ${s} times`,!0,i]);if(i&&l&&(f=Y(n,f)),i&&l||!i&&!l)throw new r(f)});function d(n,o){return n.length===o.length&&n.every((s,i)=>g(s,o[i],[...a,w]))}c(["toHaveBeenCalledWith","toBeCalledWith"],function(...n){const o=u(this),s=o.getMockName(),i=o.mock.calls.some(p=>d(p,n)),l=t.flag(this,"negate"),f=t.getMessage(this,[i,`expected "${s}" to be called with arguments: #{exp}`,`expected "${s}" to not be called with arguments: #{exp}`,n]);if(i&&l||!i&&!l)throw new r(Y(o,f,n))}),c("toHaveBeenCalledExactlyOnceWith",function(...n){const o=u(this),s=o.getMockName(),i=o.mock.calls.length,f=o.mock.calls.some(b=>d(b,n))&&i===1,p=t.flag(this,"negate"),y=t.getMessage(this,[f,`expected "${s}" to be called once with arguments: #{exp}`,`expected "${s}" to not be called once with arguments: #{exp}`,n]);if(f&&p||!f&&!p)throw new r(Y(o,y,n))}),c(["toHaveBeenNthCalledWith","nthCalledWith"],function(n,...o){const s=u(this),i=s.getMockName(),l=s.mock.calls[n-1],f=s.mock.calls.length,p=n<=f;this.assert(l&&d(l,o),`expected ${I(n)} "${i}" call to have been called with #{exp}${p?"":`, but called only ${f} times`}`,`expected ${I(n)} "${i}" call to not have been called with #{exp}`,o,l,p)}),c(["toHaveBeenLastCalledWith","lastCalledWith"],function(...n){const o=u(this),s=o.getMockName(),i=o.mock.calls[o.mock.calls.length-1];this.assert(i&&d(i,n),`expected last "${s}" call to have been called with #{exp}`,`expected last "${s}" call to not have been called with #{exp}`,n,i)});function m(n,o,s){const i=n.mock.invocationCallOrder,l=o.mock.invocationCallOrder;return i.length===0?!s:l.length===0?!1:i[0]<l[0]}c(["toHaveBeenCalledBefore"],function(n,o=!0){const s=u(this);if(!V(n))throw new TypeError(`${t.inspect(n)} is not a spy or a call to a spy`);this.assert(m(s,n,o),`expected "${s.getMockName()}" to have been called before "${n.getMockName()}"`,`expected "${s.getMockName()}" to not have been called before "${n.getMockName()}"`,n,s)}),c(["toHaveBeenCalledAfter"],function(n,o=!0){const s=u(this);if(!V(n))throw new TypeError(`${t.inspect(n)} is not a spy or a call to a spy`);this.assert(m(n,s,o),`expected "${s.getMockName()}" to have been called after "${n.getMockName()}"`,`expected "${s.getMockName()}" to not have been called after "${n.getMockName()}"`,n,s)}),c(["toThrow","toThrowError"],function(n){if(typeof n=="string"||typeof n>"u"||n instanceof RegExp)return this.throws(n===""?/^$/:n);const o=this._obj,s=t.flag(this,"promise"),i=t.flag(this,"negate");let l=null;if(s==="rejects")l=o;else if(s==="resolves"&&typeof o!="function"){if(i)return;{const f=t.flag(this,"message")||"expected promise to throw an error, but it didn't",p={showDiff:!1};throw new r(f,p,t.flag(this,"ssfi"))}}else{let f=!1;try{o()}catch(p){f=!0,l=p}if(!f&&!i){const p=t.flag(this,"message")||"expected function to throw an error, but it didn't",y={showDiff:!1};throw new r(p,y,t.flag(this,"ssfi"))}}if(typeof n=="function"){const f=n.name||n.prototype.constructor.name;return this.assert(l&&l instanceof n,`expected error to be instance of ${f}`,`expected error not to be instance of ${f}`,n,l)}if(n instanceof Error){const f=g(l,n,[...a,w]);return this.assert(f,"expected a thrown error to be #{exp}","expected a thrown error not to be #{exp}",n,l)}if(typeof n=="object"&&"asymmetricMatch"in n&&typeof n.asymmetricMatch=="function"){const f=n;return this.assert(l&&f.asymmetricMatch(l),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",f,l)}throw new Error(`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "${typeof n}"`)}),[{name:"toHaveResolved",condition:n=>n.mock.settledResults.length>0&&n.mock.settledResults.some(({type:o})=>o==="fulfilled"),action:"resolved"},{name:["toHaveReturned","toReturn"],condition:n=>n.mock.calls.length>0&&n.mock.results.some(({type:o})=>o!=="throw"),action:"called"}].forEach(({name:n,condition:o,action:s})=>{c(n,function(){const i=u(this),l=i.getMockName(),f=o(i);this.assert(f,`expected "${l}" to be successfully ${s} at least once`,`expected "${l}" to not be successfully ${s}`,f,!f,!1)})}),[{name:"toHaveResolvedTimes",condition:(n,o)=>n.mock.settledResults.reduce((s,{type:i})=>i==="fulfilled"?++s:s,0)===o,action:"resolved"},{name:["toHaveReturnedTimes","toReturnTimes"],condition:(n,o)=>n.mock.results.reduce((s,{type:i})=>i==="throw"?s:++s,0)===o,action:"called"}].forEach(({name:n,condition:o,action:s})=>{c(n,function(i){const l=u(this),f=l.getMockName(),p=o(l,i);this.assert(p,`expected "${f}" to be successfully ${s} ${i} times`,`expected "${f}" to not be successfully ${s} ${i} times`,`expected resolved times: ${i}`,`received resolved times: ${p}`,!1)})}),[{name:"toHaveResolvedWith",condition:(n,o)=>n.mock.settledResults.some(({type:s,value:i})=>s==="fulfilled"&&g(o,i)),action:"resolve"},{name:["toHaveReturnedWith","toReturnWith"],condition:(n,o)=>n.mock.results.some(({type:s,value:i})=>s==="return"&&g(o,i)),action:"return"}].forEach(({name:n,condition:o,action:s})=>{c(n,function(i){const l=u(this),f=o(l,i),p=t.flag(this,"negate");if(f&&p||!f&&!p){const y=l.getMockName(),b=t.getMessage(this,[f,`expected "${y}" to ${s} with: #{exp} at least once`,`expected "${y}" to not ${s} with: #{exp}`,i]),$=s==="return"?l.mock.results:l.mock.settledResults;throw new r(Xt(l,$,b,i))}})}),[{name:"toHaveLastResolvedWith",condition:(n,o)=>{const s=n.mock.settledResults[n.mock.settledResults.length-1];return s&&s.type==="fulfilled"&&g(s.value,o)},action:"resolve"},{name:["toHaveLastReturnedWith","lastReturnedWith"],condition:(n,o)=>{const s=n.mock.results[n.mock.results.length-1];return s&&s.type==="return"&&g(s.value,o)},action:"return"}].forEach(({name:n,condition:o,action:s})=>{c(n,function(i){const l=u(this),f=s==="return"?l.mock.results:l.mock.settledResults,p=f[f.length-1],y=l.getMockName();this.assert(o(l,i),`expected last "${y}" call to ${s} #{exp}`,`expected last "${y}" call to not ${s} #{exp}`,i,p==null?void 0:p.value)})}),[{name:"toHaveNthResolvedWith",condition:(n,o,s)=>{const i=n.mock.settledResults[o-1];return i&&i.type==="fulfilled"&&g(i.value,s)},action:"resolve"},{name:["toHaveNthReturnedWith","nthReturnedWith"],condition:(n,o,s)=>{const i=n.mock.results[o-1];return i&&i.type==="return"&&g(i.value,s)},action:"return"}].forEach(({name:n,condition:o,action:s})=>{c(n,function(i,l){const f=u(this),p=f.getMockName(),b=(s==="return"?f.mock.results:f.mock.settledResults)[i-1],$=`${I(i)} call`;this.assert(o(f,i,l),`expected ${$} "${p}" call to ${s} #{exp}`,`expected ${$} "${p}" call to not ${s} #{exp}`,l,b==null?void 0:b.value)})}),c("withContext",function(n){for(const o in n)t.flag(this,o,n[o]);return this}),t.addProperty(e.Assertion.prototype,"resolves",function(){const o=new Error("resolves");t.flag(this,"promise","resolves"),t.flag(this,"error",o);const s=t.flag(this,"vitest-test"),i=t.flag(this,"object");if(t.flag(this,"poll"))throw new SyntaxError("expect.poll() is not supported in combination with .resolves");if(typeof(i==null?void 0:i.then)!="function")throw new TypeError(`You must provide a Promise to expect() when using .resolves, not '${typeof i}'.`);const l=new Proxy(this,{get:(f,p,y)=>{const b=Reflect.get(f,p,y);return typeof b!="function"?b instanceof e.Assertion?l:b:(...$)=>{t.flag(this,"_name",p);const C=i.then(N=>(t.flag(this,"object",N),b.call(this,...$)),N=>{const x=new r(`promise rejected "${t.inspect(N)}" instead of resolving`,{showDiff:!1});throw x.cause=N,x.stack=o.stack.replace(o.message,x.message),x});return at(s,C,ct(t,this,!!$.length),o)}}});return l}),t.addProperty(e.Assertion.prototype,"rejects",function(){const o=new Error("rejects");t.flag(this,"promise","rejects"),t.flag(this,"error",o);const s=t.flag(this,"vitest-test"),i=t.flag(this,"object"),l=typeof i=="function"?i():i;if(t.flag(this,"poll"))throw new SyntaxError("expect.poll() is not supported in combination with .rejects");if(typeof(l==null?void 0:l.then)!="function")throw new TypeError(`You must provide a Promise to expect() when using .rejects, not '${typeof l}'.`);const f=new Proxy(this,{get:(p,y,b)=>{const $=Reflect.get(p,y,b);return typeof $!="function"?$ instanceof e.Assertion?f:$:(...C)=>{t.flag(this,"_name",y);const N=l.then(x=>{const _=new r(`promise resolved "${t.inspect(x)}" instead of rejecting`,{showDiff:!0,expected:new Error("rejected promise"),actual:x});throw _.stack=o.stack.replace(o.message,_.message),_},x=>(t.flag(this,"object",x),$.call(this,...C)));return at(s,N,ct(t,this,!!C.length),o)}}});return f})};function I(e){const t=e%10,r=e%100;return t===1&&r!==11?`${e}st`:t===2&&r!==12?`${e}nd`:t===3&&r!==13?`${e}rd`:`${e}th`}function Y(e,t,r){return e.mock.calls.length&&(t+=E.gray(`
|
|
30
|
+
`:c}function Jt(e,t){return`${t} ${e}${t===1?"":"s"}`}function F(e){return[...Object.keys(e),...Object.getOwnPropertySymbols(e).filter(t=>{var r;return(r=Object.getOwnPropertyDescriptor(e,t))===null||r===void 0?void 0:r.enumerable})]}function Gt(e,t,r){let c=0;const a=(h=new WeakMap)=>(u,d)=>{if(Array.isArray(u)){if(Array.isArray(d)&&d.length===u.length)return d.map((m,n)=>a(h)(u[n],m))}else{if(u instanceof Date)return u;if(q(u)&&q(d)){if(g(u,d,[...r,w,P]))return d;const m={};h.set(u,m),typeof u.constructor=="function"&&typeof u.constructor.name=="string"&&Object.defineProperty(m,"constructor",{enumerable:!1,value:u.constructor});for(const n of F(u))z(d,n)?m[n]=h.has(u[n])?h.get(u[n]):a(h)(u[n],d[n]):h.has(u[n])||(c+=1,q(u[n])&&(c+=F(u[n]).length),a(h)(u[n],d[n]));if(F(m).length>0)return m}}return u};return{subset:a()(e,t),stripped:c}}if(!Object.prototype.hasOwnProperty.call(globalThis,k)){const e=new WeakMap,t=Object.create(null),r=[],c=Object.create(null);Object.defineProperty(globalThis,k,{get:()=>e}),Object.defineProperty(globalThis,B,{configurable:!0,get:()=>({state:e.get(globalThis[ft]),matchers:t,customEqualityTesters:r})}),Object.defineProperty(globalThis,ht,{get:()=>c})}function $t(e){return globalThis[k].get(e)}function ue(e,t){const r=globalThis[k],c=r.get(t)||{},a=Object.defineProperties(c,{...Object.getOwnPropertyDescriptors(c),...Object.getOwnPropertyDescriptors(e)});r.set(t,a)}class O{constructor(t,r=!1){H(this,"$$typeof",Symbol.for("jest.asymmetricMatcher"));this.sample=t,this.inverse=r}getMatcherContext(t){return{...$t(t||globalThis[ft]),equals:g,isNot:this.inverse,customTesters:G(),utils:{...dt(),diff:S,stringify:M,iterableEquality:w,subsetEquality:P}}}}O.prototype[Symbol.for("chai/inspect")]=function(e){const t=M(this,e.depth,{min:!0});return t.length<=e.truncate?t:`${this.toString()}{…}`};class nt extends O{constructor(t,r=!1){if(!v("String",t))throw new Error("Expected is not a string");super(t,r)}asymmetricMatch(t){const r=v("String",t)&&t.includes(this.sample);return this.inverse?!r:r}toString(){return`String${this.inverse?"Not":""}Containing`}getExpectedType(){return"string"}}class zt extends O{asymmetricMatch(t){return t!=null}toString(){return"Anything"}toAsymmetricMatcher(){return"Anything"}}class ot extends O{constructor(t,r=!1){super(t,r)}getPrototype(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.constructor.prototype===t?null:t.constructor.prototype}hasProperty(t,r){return t?Object.prototype.hasOwnProperty.call(t,r)?!0:this.hasProperty(this.getPrototype(t),r):!1}asymmetricMatch(t){if(typeof this.sample!="object")throw new TypeError(`You must provide an object to ${this.toString()}, not '${typeof this.sample}'.`);let r=!0;const c=this.getMatcherContext();for(const a in this.sample)if(!this.hasProperty(t,a)||!g(this.sample[a],t[a],c.customTesters)){r=!1;break}return this.inverse?!r:r}toString(){return`Object${this.inverse?"Not":""}Containing`}getExpectedType(){return"object"}}class rt extends O{constructor(t,r=!1){super(t,r)}asymmetricMatch(t){if(!Array.isArray(this.sample))throw new TypeError(`You must provide an array to ${this.toString()}, not '${typeof this.sample}'.`);const r=this.getMatcherContext(),c=this.sample.length===0||Array.isArray(t)&&this.sample.every(a=>t.some(h=>g(a,h,r.customTesters)));return this.inverse?!c:c}toString(){return`Array${this.inverse?"Not":""}Containing`}getExpectedType(){return"array"}}class Kt extends O{constructor(t){if(typeof t>"u")throw new TypeError("any() expects to be passed a constructor function. Please pass one or use anything() to match any object.");super(t)}fnNameFor(t){if(t.name)return t.name;const c=Function.prototype.toString.call(t).match(/^(?:async)?\s*function\s*(?:\*\s*)?([\w$]+)\s*\(/);return c?c[1]:"<anonymous>"}asymmetricMatch(t){return this.sample===String?typeof t=="string"||t instanceof String:this.sample===Number?typeof t=="number"||t instanceof Number:this.sample===Function?typeof t=="function"||typeof t=="function":this.sample===Boolean?typeof t=="boolean"||t instanceof Boolean:this.sample===BigInt?typeof t=="bigint"||t instanceof BigInt:this.sample===Symbol?typeof t=="symbol"||t instanceof Symbol:this.sample===Object?typeof t=="object":t instanceof this.sample}toString(){return"Any"}getExpectedType(){return this.sample===String?"string":this.sample===Number?"number":this.sample===Function?"function":this.sample===Object?"object":this.sample===Boolean?"boolean":this.fnNameFor(this.sample)}toAsymmetricMatcher(){return`Any<${this.fnNameFor(this.sample)}>`}}class st extends O{constructor(t,r=!1){if(!v("String",t)&&!v("RegExp",t))throw new Error("Expected is not a String or a RegExp");super(new RegExp(t),r)}asymmetricMatch(t){const r=v("String",t)&&this.sample.test(t);return this.inverse?!r:r}toString(){return`String${this.inverse?"Not":""}Matching`}getExpectedType(){return"string"}}class it extends O{constructor(r,c=2,a=!1){if(!v("Number",r))throw new Error("Expected is not a Number");if(!v("Number",c))throw new Error("Precision is not a Number");super(r);H(this,"precision");this.inverse=a,this.precision=c}asymmetricMatch(r){if(!v("Number",r))return!1;let c=!1;return r===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY?c=!0:c=Math.abs(this.sample-r)<10**-this.precision/2,this.inverse?!c:c}toString(){return`Number${this.inverse?"Not":""}CloseTo`}getExpectedType(){return"number"}toAsymmetricMatcher(){return[this.toString(),this.sample,`(${Jt("digit",this.precision)})`].join(" ")}}const fe=(e,t)=>{t.addMethod(e.expect,"anything",()=>new zt),t.addMethod(e.expect,"any",r=>new Kt(r)),t.addMethod(e.expect,"stringContaining",r=>new nt(r)),t.addMethod(e.expect,"objectContaining",r=>new ot(r)),t.addMethod(e.expect,"arrayContaining",r=>new rt(r)),t.addMethod(e.expect,"stringMatching",r=>new st(r)),t.addMethod(e.expect,"closeTo",(r,c)=>new it(r,c)),e.expect.not={stringContaining:r=>new nt(r,!0),objectContaining:r=>new ot(r,!0),arrayContaining:r=>new rt(r,!0),stringMatching:r=>new st(r,!0),closeTo:(r,c)=>new it(r,c,!0)}};function at(e,t,r){const c=e.flag(t,"negate")?"not.":"",a=`${e.flag(t,"_name")}(${r?"expected":""})`,h=e.flag(t,"promise");return`expect(actual)${h?`.${h}`:""}.${c}${a}`}function ct(e,t,r,c){const a=e;if(a&&t instanceof Promise){t=t.finally(()=>{if(!a.promises)return;const u=a.promises.indexOf(t);u!==-1&&a.promises.splice(u,1)}),a.promises||(a.promises=[]),a.promises.push(t);let h=!1;return a.onFinished??(a.onFinished=[]),a.onFinished.push(()=>{if(!h){var u;const m=(((u=globalThis.__vitest_worker__)===null||u===void 0?void 0:u.onFilterStackTrace)||(n=>n||""))(c.stack);console.warn([`Promise returned by \`${r}\` was not awaited. `,"Vitest currently auto-awaits hanging assertions at the end of the test, but this will cause the test to fail in Vitest 3. ",`Please remember to await the assertion.
|
|
31
|
+
`,m].join(""))}}),{then(u,d){return h=!0,t.then(u,d)},catch(u){return t.catch(u)},finally(u){return t.finally(u)},[Symbol.toStringTag]:"Promise"}}return t}function Et(e,t,r){return function(...c){if(t!=="withTest"&&e.flag(this,"_name",t),!e.flag(this,"soft"))return r.apply(this,c);const a=e.flag(this,"vitest-test");if(!a)throw new Error("expect.soft() can only be used inside a test");try{return r.apply(this,c)}catch(u){var h;a.result||(a.result={state:"fail"}),a.result.state="fail",(h=a.result).errors||(h.errors=[]),a.result.errors.push(Nt(u))}}}const he=(e,t)=>{const{AssertionError:r}=e,c=G();function a(n,o){const s=i=>{const l=Et(t,i,o);t.addMethod(e.Assertion.prototype,i,l),t.addMethod(globalThis[B].matchers,i,l)};Array.isArray(n)?n.forEach(i=>s(i)):s(n)}["throw","throws","Throw"].forEach(n=>{t.overwriteMethod(e.Assertion.prototype,n,o=>function(...s){const i=t.flag(this,"promise"),l=t.flag(this,"object"),f=t.flag(this,"negate");if(i==="rejects")t.flag(this,"object",()=>{throw l});else if(i==="resolves"&&typeof l!="function"){if(f)return;{const p=t.flag(this,"message")||"expected promise to throw an error, but it didn't",y={showDiff:!1};throw new r(p,y,t.flag(this,"ssfi"))}}o.apply(this,s)})}),a("withTest",function(n){return t.flag(this,"vitest-test",n),this}),a("toEqual",function(n){const o=t.flag(this,"object"),s=g(o,n,[...c,w]);return this.assert(s,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",n,o)}),a("toStrictEqual",function(n){const o=t.flag(this,"object"),s=g(o,n,[...c,w,tt,U,et],!0);return this.assert(s,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",n,o)}),a("toBe",function(n){const o=this._obj,s=Object.is(o,n);let i="";return s||(g(o,n,[...c,w,tt,U,et],!0)?i="toStrictEqual":g(o,n,[...c,w])&&(i="toEqual")),this.assert(s,Ut(i),"expected #{this} not to be #{exp} // Object.is equality",n,o)}),a("toMatchObject",function(n){const o=this._obj,s=g(o,n,[...c,w,P]),i=t.flag(this,"negate"),{subset:l,stripped:f}=Gt(o,n,c);if(s&&i||!s&&!i){const p=t.getMessage(this,[s,"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",n,l,!1]),y=f===0?p:`${p}
|
|
32
|
+
(${f} matching ${f===1?"property":"properties"} omitted from actual)`;throw new r(y,{showDiff:!0,expected:n,actual:l})}}),a("toMatch",function(n){const o=this._obj;if(typeof o!="string")throw new TypeError(`.toMatch() expects to receive a string, but got ${typeof o}`);return this.assert(typeof n=="string"?o.includes(n):o.match(n),"expected #{this} to match #{exp}","expected #{this} not to match #{exp}",n,o)}),a("toContain",function(n){const o=this._obj;if(typeof Node<"u"&&o instanceof Node){if(!(n instanceof Node))throw new TypeError(`toContain() expected a DOM node as the argument, but got ${typeof n}`);return this.assert(o.contains(n),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",n,o)}if(typeof DOMTokenList<"u"&&o instanceof DOMTokenList){N(n,"class name",["string"]);const i=t.flag(this,"negate")?o.value.replace(n,"").trim():`${o.value} ${n}`;return this.assert(o.contains(n),`expected "${o.value}" to contain "${n}"`,`expected "${o.value}" not to contain "${n}"`,i,o.value)}return typeof o=="string"&&typeof n=="string"?this.assert(o.includes(n),"expected #{this} to contain #{exp}","expected #{this} not to contain #{exp}",n,o):(o!=null&&typeof o!="string"&&t.flag(this,"object",Array.from(o)),this.contain(n))}),a("toContainEqual",function(n){const o=t.flag(this,"object"),s=Array.from(o).findIndex(i=>g(i,n,c));this.assert(s!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",n)}),a("toBeTruthy",function(){const n=t.flag(this,"object");this.assert(!!n,"expected #{this} to be truthy","expected #{this} to not be truthy",!0,n)}),a("toBeFalsy",function(){const n=t.flag(this,"object");this.assert(!n,"expected #{this} to be falsy","expected #{this} to not be falsy",!1,n)}),a("toBeGreaterThan",function(n){const o=this._obj;return N(o,"actual",["number","bigint"]),N(n,"expected",["number","bigint"]),this.assert(o>n,`expected ${o} to be greater than ${n}`,`expected ${o} to be not greater than ${n}`,n,o,!1)}),a("toBeGreaterThanOrEqual",function(n){const o=this._obj;return N(o,"actual",["number","bigint"]),N(n,"expected",["number","bigint"]),this.assert(o>=n,`expected ${o} to be greater than or equal to ${n}`,`expected ${o} to be not greater than or equal to ${n}`,n,o,!1)}),a("toBeLessThan",function(n){const o=this._obj;return N(o,"actual",["number","bigint"]),N(n,"expected",["number","bigint"]),this.assert(o<n,`expected ${o} to be less than ${n}`,`expected ${o} to be not less than ${n}`,n,o,!1)}),a("toBeLessThanOrEqual",function(n){const o=this._obj;return N(o,"actual",["number","bigint"]),N(n,"expected",["number","bigint"]),this.assert(o<=n,`expected ${o} to be less than or equal to ${n}`,`expected ${o} to be not less than or equal to ${n}`,n,o,!1)}),a("toBeNaN",function(){const n=t.flag(this,"object");this.assert(Number.isNaN(n),"expected #{this} to be NaN","expected #{this} not to be NaN",Number.NaN,n)}),a("toBeUndefined",function(){const n=t.flag(this,"object");this.assert(n===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined",void 0,n)}),a("toBeNull",function(){const n=t.flag(this,"object");this.assert(n===null,"expected #{this} to be null","expected #{this} not to be null",null,n)}),a("toBeDefined",function(){const n=t.flag(this,"object");this.assert(typeof n<"u","expected #{this} to be defined","expected #{this} to be undefined",n)}),a("toBeTypeOf",function(n){const o=typeof this._obj,s=n===o;return this.assert(s,"expected #{this} to be type of #{exp}","expected #{this} not to be type of #{exp}",n,o)}),a("toBeInstanceOf",function(n){return this.instanceOf(n)}),a("toHaveLength",function(n){return this.have.length(n)}),a("toHaveProperty",function(...n){Array.isArray(n[0])&&(n[0]=n[0].map($=>String($).replace(/([.[\]])/g,"\\$1")).join("."));const o=this._obj,[s,i]=n,l=()=>Object.prototype.hasOwnProperty.call(o,s)?{value:o[s],exists:!0}:t.getPathInfo(o,s),{value:f,exists:p}=l(),y=p&&(n.length===1||g(i,f,c)),b=n.length===1?"":` with value ${t.objDisplay(i)}`;return this.assert(y,`expected #{this} to have property "${s}"${b}`,`expected #{this} to not have property "${s}"${b}`,i,p?f:void 0)}),a("toBeCloseTo",function(n,o=2){const s=this._obj;let i=!1,l=0,f=0;return n===Number.POSITIVE_INFINITY&&s===Number.POSITIVE_INFINITY||n===Number.NEGATIVE_INFINITY&&s===Number.NEGATIVE_INFINITY?i=!0:(l=10**-o/2,f=Math.abs(s-n),i=f<l),this.assert(i,`expected #{this} to be close to #{exp}, received difference is ${f}, but expected ${l}`,`expected #{this} to not be close to #{exp}, received difference is ${f}, but expected ${l}`,n,s,!1)});function h(n){if(!V(n._obj))throw new TypeError(`${t.inspect(n._obj)} is not a spy or a call to a spy!`)}function u(n){return h(n),n._obj}a(["toHaveBeenCalledTimes","toBeCalledTimes"],function(n){const o=u(this),s=o.getMockName(),i=o.mock.calls.length;return this.assert(i===n,`expected "${s}" to be called #{exp} times, but got ${i} times`,`expected "${s}" to not be called #{exp} times`,n,i,!1)}),a("toHaveBeenCalledOnce",function(){const n=u(this),o=n.getMockName(),s=n.mock.calls.length;return this.assert(s===1,`expected "${o}" to be called once, but got ${s} times`,`expected "${o}" to not be called once`,1,s,!1)}),a(["toHaveBeenCalled","toBeCalled"],function(){const n=u(this),o=n.getMockName(),s=n.mock.calls.length,i=s>0,l=t.flag(this,"negate");let f=t.getMessage(this,[i,`expected "${o}" to be called at least once`,`expected "${o}" to not be called at all, but actually been called ${s} times`,!0,i]);if(i&&l&&(f=Y(n,f)),i&&l||!i&&!l)throw new r(f)});function d(n,o){return n.length===o.length&&n.every((s,i)=>g(s,o[i],[...c,w]))}a(["toHaveBeenCalledWith","toBeCalledWith"],function(...n){const o=u(this),s=o.getMockName(),i=o.mock.calls.some(p=>d(p,n)),l=t.flag(this,"negate"),f=t.getMessage(this,[i,`expected "${s}" to be called with arguments: #{exp}`,`expected "${s}" to not be called with arguments: #{exp}`,n]);if(i&&l||!i&&!l)throw new r(Y(o,f,n))}),a("toHaveBeenCalledExactlyOnceWith",function(...n){const o=u(this),s=o.getMockName(),i=o.mock.calls.length,f=o.mock.calls.some(b=>d(b,n))&&i===1,p=t.flag(this,"negate"),y=t.getMessage(this,[f,`expected "${s}" to be called once with arguments: #{exp}`,`expected "${s}" to not be called once with arguments: #{exp}`,n]);if(f&&p||!f&&!p)throw new r(Y(o,y,n))}),a(["toHaveBeenNthCalledWith","nthCalledWith"],function(n,...o){const s=u(this),i=s.getMockName(),l=s.mock.calls[n-1],f=s.mock.calls.length,p=n<=f;this.assert(l&&d(l,o),`expected ${I(n)} "${i}" call to have been called with #{exp}${p?"":`, but called only ${f} times`}`,`expected ${I(n)} "${i}" call to not have been called with #{exp}`,o,l,p)}),a(["toHaveBeenLastCalledWith","lastCalledWith"],function(...n){const o=u(this),s=o.getMockName(),i=o.mock.calls[o.mock.calls.length-1];this.assert(i&&d(i,n),`expected last "${s}" call to have been called with #{exp}`,`expected last "${s}" call to not have been called with #{exp}`,n,i)});function m(n,o,s){const i=n.mock.invocationCallOrder,l=o.mock.invocationCallOrder;return i.length===0?!s:l.length===0?!1:i[0]<l[0]}a(["toHaveBeenCalledBefore"],function(n,o=!0){const s=u(this);if(!V(n))throw new TypeError(`${t.inspect(n)} is not a spy or a call to a spy`);this.assert(m(s,n,o),`expected "${s.getMockName()}" to have been called before "${n.getMockName()}"`,`expected "${s.getMockName()}" to not have been called before "${n.getMockName()}"`,n,s)}),a(["toHaveBeenCalledAfter"],function(n,o=!0){const s=u(this);if(!V(n))throw new TypeError(`${t.inspect(n)} is not a spy or a call to a spy`);this.assert(m(n,s,o),`expected "${s.getMockName()}" to have been called after "${n.getMockName()}"`,`expected "${s.getMockName()}" to not have been called after "${n.getMockName()}"`,n,s)}),a(["toThrow","toThrowError"],function(n){if(typeof n=="string"||typeof n>"u"||n instanceof RegExp)return this.throws(n===""?/^$/:n);const o=this._obj,s=t.flag(this,"promise"),i=t.flag(this,"negate");let l=null;if(s==="rejects")l=o;else if(s==="resolves"&&typeof o!="function"){if(i)return;{const f=t.flag(this,"message")||"expected promise to throw an error, but it didn't",p={showDiff:!1};throw new r(f,p,t.flag(this,"ssfi"))}}else{let f=!1;try{o()}catch(p){f=!0,l=p}if(!f&&!i){const p=t.flag(this,"message")||"expected function to throw an error, but it didn't",y={showDiff:!1};throw new r(p,y,t.flag(this,"ssfi"))}}if(typeof n=="function"){const f=n.name||n.prototype.constructor.name;return this.assert(l&&l instanceof n,`expected error to be instance of ${f}`,`expected error not to be instance of ${f}`,n,l)}if(n instanceof Error){const f=g(l,n,[...c,w]);return this.assert(f,"expected a thrown error to be #{exp}","expected a thrown error not to be #{exp}",n,l)}if(typeof n=="object"&&"asymmetricMatch"in n&&typeof n.asymmetricMatch=="function"){const f=n;return this.assert(l&&f.asymmetricMatch(l),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",f,l)}throw new Error(`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "${typeof n}"`)}),[{name:"toHaveResolved",condition:n=>n.mock.settledResults.length>0&&n.mock.settledResults.some(({type:o})=>o==="fulfilled"),action:"resolved"},{name:["toHaveReturned","toReturn"],condition:n=>n.mock.calls.length>0&&n.mock.results.some(({type:o})=>o!=="throw"),action:"called"}].forEach(({name:n,condition:o,action:s})=>{a(n,function(){const i=u(this),l=i.getMockName(),f=o(i);this.assert(f,`expected "${l}" to be successfully ${s} at least once`,`expected "${l}" to not be successfully ${s}`,f,!f,!1)})}),[{name:"toHaveResolvedTimes",condition:(n,o)=>n.mock.settledResults.reduce((s,{type:i})=>i==="fulfilled"?++s:s,0)===o,action:"resolved"},{name:["toHaveReturnedTimes","toReturnTimes"],condition:(n,o)=>n.mock.results.reduce((s,{type:i})=>i==="throw"?s:++s,0)===o,action:"called"}].forEach(({name:n,condition:o,action:s})=>{a(n,function(i){const l=u(this),f=l.getMockName(),p=o(l,i);this.assert(p,`expected "${f}" to be successfully ${s} ${i} times`,`expected "${f}" to not be successfully ${s} ${i} times`,`expected resolved times: ${i}`,`received resolved times: ${p}`,!1)})}),[{name:"toHaveResolvedWith",condition:(n,o)=>n.mock.settledResults.some(({type:s,value:i})=>s==="fulfilled"&&g(o,i)),action:"resolve"},{name:["toHaveReturnedWith","toReturnWith"],condition:(n,o)=>n.mock.results.some(({type:s,value:i})=>s==="return"&&g(o,i)),action:"return"}].forEach(({name:n,condition:o,action:s})=>{a(n,function(i){const l=u(this),f=o(l,i),p=t.flag(this,"negate");if(f&&p||!f&&!p){const y=l.getMockName(),b=t.getMessage(this,[f,`expected "${y}" to ${s} with: #{exp} at least once`,`expected "${y}" to not ${s} with: #{exp}`,i]),$=s==="return"?l.mock.results:l.mock.settledResults;throw new r(Xt(l,$,b,i))}})}),[{name:"toHaveLastResolvedWith",condition:(n,o)=>{const s=n.mock.settledResults[n.mock.settledResults.length-1];return s&&s.type==="fulfilled"&&g(s.value,o)},action:"resolve"},{name:["toHaveLastReturnedWith","lastReturnedWith"],condition:(n,o)=>{const s=n.mock.results[n.mock.results.length-1];return s&&s.type==="return"&&g(s.value,o)},action:"return"}].forEach(({name:n,condition:o,action:s})=>{a(n,function(i){const l=u(this),f=s==="return"?l.mock.results:l.mock.settledResults,p=f[f.length-1],y=l.getMockName();this.assert(o(l,i),`expected last "${y}" call to ${s} #{exp}`,`expected last "${y}" call to not ${s} #{exp}`,i,p==null?void 0:p.value)})}),[{name:"toHaveNthResolvedWith",condition:(n,o,s)=>{const i=n.mock.settledResults[o-1];return i&&i.type==="fulfilled"&&g(i.value,s)},action:"resolve"},{name:["toHaveNthReturnedWith","nthReturnedWith"],condition:(n,o,s)=>{const i=n.mock.results[o-1];return i&&i.type==="return"&&g(i.value,s)},action:"return"}].forEach(({name:n,condition:o,action:s})=>{a(n,function(i,l){const f=u(this),p=f.getMockName(),b=(s==="return"?f.mock.results:f.mock.settledResults)[i-1],$=`${I(i)} call`;this.assert(o(f,i,l),`expected ${$} "${p}" call to ${s} #{exp}`,`expected ${$} "${p}" call to not ${s} #{exp}`,l,b==null?void 0:b.value)})}),a("withContext",function(n){for(const o in n)t.flag(this,o,n[o]);return this}),t.addProperty(e.Assertion.prototype,"resolves",function(){const o=new Error("resolves");t.flag(this,"promise","resolves"),t.flag(this,"error",o);const s=t.flag(this,"vitest-test"),i=t.flag(this,"object");if(t.flag(this,"poll"))throw new SyntaxError("expect.poll() is not supported in combination with .resolves");if(typeof(i==null?void 0:i.then)!="function")throw new TypeError(`You must provide a Promise to expect() when using .resolves, not '${typeof i}'.`);const l=new Proxy(this,{get:(f,p,y)=>{const b=Reflect.get(f,p,y);return typeof b!="function"?b instanceof e.Assertion?l:b:(...$)=>{t.flag(this,"_name",p);const C=i.then(T=>(t.flag(this,"object",T),b.call(this,...$)),T=>{const x=new r(`promise rejected "${t.inspect(T)}" instead of resolving`,{showDiff:!1});throw x.cause=T,x.stack=o.stack.replace(o.message,x.message),x});return ct(s,C,at(t,this,!!$.length),o)}}});return l}),t.addProperty(e.Assertion.prototype,"rejects",function(){const o=new Error("rejects");t.flag(this,"promise","rejects"),t.flag(this,"error",o);const s=t.flag(this,"vitest-test"),i=t.flag(this,"object"),l=typeof i=="function"?i():i;if(t.flag(this,"poll"))throw new SyntaxError("expect.poll() is not supported in combination with .rejects");if(typeof(l==null?void 0:l.then)!="function")throw new TypeError(`You must provide a Promise to expect() when using .rejects, not '${typeof l}'.`);const f=new Proxy(this,{get:(p,y,b)=>{const $=Reflect.get(p,y,b);return typeof $!="function"?$ instanceof e.Assertion?f:$:(...C)=>{t.flag(this,"_name",y);const T=l.then(x=>{const _=new r(`promise resolved "${t.inspect(x)}" instead of rejecting`,{showDiff:!0,expected:new Error("rejected promise"),actual:x});throw _.stack=o.stack.replace(o.message,_.message),_},x=>(t.flag(this,"object",x),$.call(this,...C)));return ct(s,T,at(t,this,!!C.length),o)}}});return f})};function I(e){const t=e%10,r=e%100;return t===1&&r!==11?`${e}st`:t===2&&r!==12?`${e}nd`:t===3&&r!==13?`${e}rd`:`${e}th`}function Y(e,t,r){return e.mock.calls.length&&(t+=E.gray(`
|
|
33
33
|
|
|
34
34
|
Received:
|
|
35
35
|
|
|
36
|
-
${e.mock.calls.map((a
|
|
36
|
+
${e.mock.calls.map((c,a)=>{let h=E.bold(` ${I(a+1)} ${e.getMockName()} call:
|
|
37
37
|
|
|
38
|
-
`);return r?h+=S(r,
|
|
38
|
+
`);return r?h+=S(r,c,{omitAnnotationLines:!0}):h+=M(c).split(`
|
|
39
39
|
`).map(u=>` ${u}`).join(`
|
|
40
40
|
`),h+=`
|
|
41
41
|
`,h}).join(`
|
|
42
42
|
`)}`)),t+=E.gray(`
|
|
43
43
|
|
|
44
44
|
Number of calls: ${E.bold(e.mock.calls.length)}
|
|
45
|
-
`),t}function Xt(e,t,r,
|
|
45
|
+
`),t}function Xt(e,t,r,c){return t.length&&(r+=E.gray(`
|
|
46
46
|
|
|
47
47
|
Received:
|
|
48
48
|
|
|
49
|
-
${t.map((
|
|
49
|
+
${t.map((a,h)=>{let u=E.bold(` ${I(h+1)} ${e.getMockName()} call return:
|
|
50
50
|
|
|
51
|
-
`);return
|
|
51
|
+
`);return c?u+=S(c,a.value,{omitAnnotationLines:!0}):u+=M(a).split(`
|
|
52
52
|
`).map(d=>` ${d}`).join(`
|
|
53
53
|
`),u+=`
|
|
54
54
|
`,u}).join(`
|
|
55
55
|
`)}`)),r+=E.gray(`
|
|
56
56
|
|
|
57
57
|
Number of calls: ${E.bold(e.mock.calls.length)}
|
|
58
|
-
`),r}function
|
|
58
|
+
`),r}function Zt(e,t){const r=e._obj,c=R.flag(e,"negate"),a=R.flag(e,"promise")||"",h={...dt(),diff:S,stringify:M,iterableEquality:w,subsetEquality:P};return{state:{...$t(t),customTesters:G(),isNot:c,utils:h,promise:a,equals:g,suppressedErrors:[],soft:R.flag(e,"soft"),poll:R.flag(e,"poll")},isNot:c,obj:r}}class lt extends Error{constructor(t,r,c){super(t),this.actual=r,this.expected=c}}function Qt(e,t,r){return(c,a)=>{Object.entries(r).forEach(([h,u])=>{function d(...s){const{state:i,isNot:l,obj:f}=Zt(this,t),p=u.call(i,f,...s);if(p&&typeof p=="object"&&p instanceof Promise)return p.then(({pass:T,message:x,actual:_,expected:wt})=>{if(T&&l||!T&&!l)throw new lt(x(),_,wt)});const{pass:y,message:b,actual:$,expected:C}=p;if(y&&l||!y&&!l)throw new lt(b(),$,C)}const m=Et(a,h,d);a.addMethod(globalThis[B].matchers,h,m),a.addMethod(e.Assertion.prototype,h,m);class n extends O{constructor(i=!1,...l){super(l,i)}asymmetricMatch(i){const{pass:l}=u.call(this.getMatcherContext(t),i,...this.sample);return this.inverse?!l:l}toString(){return`${this.inverse?"not.":""}${h}`}getExpectedType(){return"any"}toAsymmetricMatcher(){return`${this.toString()}<${this.sample.map(i=>M(i)).join(", ")}>`}}const o=(...s)=>new n(!1,...s);Object.defineProperty(t,h,{configurable:!0,enumerable:!0,value:o,writable:!0}),Object.defineProperty(t.not,h,{configurable:!0,enumerable:!0,value:(...s)=>new n(!0,...s),writable:!0}),Object.defineProperty(globalThis[ht],h,{configurable:!0,enumerable:!0,value:o,writable:!0})})}}const pe=(e,t)=>{t.addMethod(e.expect,"extend",(r,c)=>{Ot(Qt(e,r,c))})};export{ht as ASYMMETRIC_MATCHERS_OBJECT,Kt as Any,zt as Anything,rt as ArrayContaining,O as AsymmetricMatcher,ft as GLOBAL_EXPECT,B as JEST_MATCHERS_OBJECT,fe as JestAsymmetricMatchers,he as JestChaiExpect,pe as JestExtend,k as MATCHERS_OBJECT,ot as ObjectContaining,nt as StringContaining,st as StringMatching,le as addCustomEqualityTesters,et as arrayBufferEquality,ce as customMatchers,g as equals,Ut as generateToBeMessage,F as getObjectKeys,Gt as getObjectSubset,$t as getState,v as isA,K as isAsymmetric,Dt as isImmutableUnorderedKeyed,Lt as isImmutableUnorderedSet,w as iterableEquality,Jt as pluralize,ue as setState,U as sparseArrayEquality,P as subsetEquality,tt as typeEquality};
|
package/dist/node_modules/.pnpm/@vitest_runner@3.2.0/node_modules/@vitest/runner/dist/chunk-hooks.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var ue=Object.defineProperty;var le=(t,e,r)=>e in t?ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var q=(t,e,r)=>le(t,typeof e!="symbol"?e+"":e,r);import{getSafeTimers as fe}from"../../../../../@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/index.js";import{parseSingleStack as Q}from"../../../../../@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/source-map.js";import{isNegativeNaN as he,isObject as Z,objectAttr as X,toArray as O,createDefer as B}from"../../../../../@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/helpers.js";import{f as de,o as pe}from"../../../../../@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js";class ge extends Error{constructor(r,i,n){super(r);q(this,"code","VITEST_PENDING");q(this,"taskId");this.message=r,this.note=n,this.taskId=i.id}}const me=new WeakMap,ee=new WeakMap,te=new WeakMap;function ye(t,e){me.set(t,e)}function ve(t,e){ee.set(t,e)}function we(t){return ee.get(t)}function Te(t,e){te.set(t,e)}function ke(t){return te.get(t)}function be(t,e){const r=e.reduce((s,o)=>(s[o.prop]=o,s),{}),i={};t.forEach(s=>{const o=r[s.prop]||{...s};i[o.prop]=o});for(const s in i){var n;const o=i[s];o.deps=(n=o.deps)===null||n===void 0?void 0:n.map(c=>i[c.prop])}return Object.values(i)}function ne(t,e,r){const i=["auto","injected","scope"],n=Object.entries(t).map(([s,o])=>{const c={value:o};if(Array.isArray(o)&&o.length>=2&&Z(o[1])&&Object.keys(o[1]).some(a=>i.includes(a))){var u;Object.assign(c,o[1]);const a=o[0];c.value=c.injected?((u=r.injectValue)===null||u===void 0?void 0:u.call(r,s))??a:a}return c.scope=c.scope||"test",c.scope==="worker"&&!r.getWorkerContext&&(c.scope="file"),c.prop=s,c.isFn=typeof c.value=="function",c});return Array.isArray(e.fixtures)?e.fixtures=e.fixtures.concat(n):e.fixtures=n,n.forEach(s=>{if(s.isFn){const c=oe(s.value);if(c.length&&(s.deps=e.fixtures.filter(({prop:u})=>u!==s.prop&&c.includes(u))),s.scope!=="test"){var o;(o=s.deps)===null||o===void 0||o.forEach(u=>{if(u.isFn&&!(s.scope==="worker"&&u.scope==="worker")&&!(s.scope==="file"&&u.scope!=="test"))throw new SyntaxError(`cannot use the ${u.scope} fixture "${u.prop}" inside the ${s.scope} fixture "${s.prop}"`)})}}}),e}const M=new Map,A=new Map;function Ce(t,e,r){return i=>{const n=i||r;if(!n)return e({});const s=we(n);if(!(s!=null&&s.length))return e(n);const o=oe(e),c=s.some(({auto:h})=>h);if(!o.length&&!c)return e(n);M.get(n)||M.set(n,new Map);const u=M.get(n);A.has(n)||A.set(n,[]);const a=A.get(n),l=s.filter(({prop:h,auto:m})=>m||o.includes(h)),p=re(l);if(!p.length)return e(n);async function d(){for(const h of p){if(u.has(h))continue;const m=await _e(t,h,n,a);n[h.prop]=m,u.set(h,m),h.scope==="test"&&a.unshift(()=>{u.delete(h)})}}return d().then(()=>e(n))}}const R=new WeakMap;function _e(t,e,r,i){var n;const s=Le(r.task.file),o=(n=t.getWorkerContext)===null||n===void 0?void 0:n.call(t);if(!e.isFn){var c;if(s[c=e.prop]??(s[c]=e.value),o){var u;o[u=e.prop]??(o[u]=e.value)}return e.value}if(e.scope==="test")return H(e.value,r,i);if(R.has(e))return R.get(e);let a;if(e.scope==="worker"){if(!o)throw new TypeError("[@vitest/runner] The worker context is not available in the current test runner. Please, provide the `getWorkerContext` method when initiating the runner.");a=o}else a=s;if(e.prop in a)return a[e.prop];A.has(a)||A.set(a,[]);const l=A.get(a),p=H(e.value,a,l).then(d=>(a[e.prop]=d,R.delete(e),d));return R.set(e,p),p}async function H(t,e,r){const i=B();let n=!1;const s=t(e,async o=>{n=!0,i.resolve(o);const c=B();r.push(async()=>{c.resolve(),await s}),await c}).catch(o=>{if(!n){i.reject(o);return}throw o});return i}function re(t,e=new Set,r=[]){return t.forEach(i=>{if(!r.includes(i)){if(!i.isFn||!i.deps){r.push(i);return}if(e.has(i))throw new Error(`Circular fixture dependency detected: ${i.prop} <- ${[...e].reverse().map(n=>n.prop).join(" <- ")}`);e.add(i),re(i.deps,e,r),r.push(i),e.clear()}}),r}function oe(t){let e=t.toString();/__async\((?:this|null), (?:null|arguments|\[[_0-9, ]*\]), function\*/.test(e)&&(e=e.split(/__async\((?:this|null),/)[1]);const r=e.match(/[^(]*\(([^)]*)/);if(!r)return[];const i=z(r[1]);if(!i.length)return[];let n=i[0];if("__VITEST_FIXTURE_INDEX__"in t&&(n=i[t.__VITEST_FIXTURE_INDEX__],!n))return[];if(!(n.startsWith("{")&&n.endsWith("}")))throw new Error(`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "${n}".`);const s=n.slice(1,-1).replace(/\s/g,""),o=z(s).map(u=>u.replace(/:.*|=.*/g,"")),c=o.at(-1);if(c&&c.startsWith("..."))throw new Error(`Rest parameters are not supported in fixtures, received "${c}".`);return o}function z(t){const e=[],r=[];let i=0;for(let s=0;s<t.length;s++)if(t[s]==="{"||t[s]==="[")r.push(t[s]==="{"?"}":"]");else if(t[s]===r[r.length-1])r.pop();else if(!r.length&&t[s]===","){const o=t.substring(i,s).trim();o&&e.push(o),i=s+1}const n=t.substring(i).trim();return n&&e.push(n),e}function ie(t,e){function r(n){const s=function(...o){return e.apply(n,o)};Object.assign(s,e),s.withContext=()=>s.bind(n),s.setContext=(o,c)=>{n[o]=c},s.mergeContext=o=>{Object.assign(n,o)};for(const o of t)Object.defineProperty(s,o,{get(){return r({...n,[o]:!0})}});return s}const i=r({});return i.fn=e,i}const F=Ie();U(function(t,e,r){N().test.fn.call(this,_(t),e,r)});let b,se,Ee;function ce(t,e){if(!t)throw new Error(`Vitest failed to find ${e}. This is a bug in Vitest. Please, open an issue with reproduction.`)}function Ae(){return Ee}function Se(){return ce(b,"the runner"),b}function N(){const t=E.currentSuite||se;return ce(t,"the current suite"),t}function Fe(){return{beforeAll:[],afterAll:[],beforeEach:[],afterEach:[]}}function S(t,e){let r={},i=()=>{};if(typeof e=="object"){if(typeof t=="object")throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");console.warn("Using an object as a third argument is deprecated. Vitest 4 will throw an error if the third argument is not a timeout number. Please use the second argument for options. See more at https://vitest.dev/guide/migration"),r=e}else typeof e=="number"?r={timeout:e}:typeof t=="object"&&(r=t);if(typeof t=="function"){if(typeof e=="function")throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");i=t}else typeof e=="function"&&(i=e);return{options:r,handler:i}}function je(t,e=()=>{},r,i,n,s){const o=[];let c;h();const u=function(y="",f={}){var g;const w=(f==null?void 0:f.timeout)??b.config.testTimeout,T={id:"",name:y,suite:(g=E.currentSuite)===null||g===void 0?void 0:g.suite,each:f.each,fails:f.fails,context:void 0,type:"test",file:void 0,timeout:w,retry:f.retry??b.config.retry,repeats:f.repeats,mode:f.only?"only":f.skip?"skip":f.todo?"todo":"run",meta:f.meta??Object.create(null),annotations:[]},j=f.handler;(f.concurrent||!f.sequential&&b.config.sequence.concurrent)&&(T.concurrent=!0),T.shuffle=n==null?void 0:n.shuffle;const x=De(T,b);Object.defineProperty(T,"context",{value:x,enumerable:!1}),ve(x,f.fixtures);const ae=Error.stackTraceLimit;Error.stackTraceLimit=15;const K=new Error("STACK_TRACE_ERROR");if(Error.stackTraceLimit=ae,j&&ye(T,V(xe(Ce(b,j,x),T),w,!1,K,(L,I)=>Ne([x],I))),b.config.includeTaskLocation){const L=K.stack,I=$e(L,T.each??!1);I&&(T.location=I)}return o.push(T),T},a=U(function(y,f,g){let{options:w,handler:T}=S(f,g);typeof n=="object"&&(w=Object.assign({},n,w)),w.concurrent=this.concurrent||!this.sequential&&(w==null?void 0:w.concurrent),w.sequential=this.sequential||!this.concurrent&&(w==null?void 0:w.sequential);const j=u(_(y),{...this,...w,handler:T});j.type="test"});let l=s;const p={type:"collector",name:t,mode:r,suite:c,options:n,test:a,tasks:o,collect:v,task:u,clear:m,on:d,fixtures(){return l},scoped(y){const f=ne(y,{fixtures:l},b);f.fixtures&&(l=f.fixtures)}};function d(y,...f){ke(c)[y].push(...f)}function h(y){var f;typeof n=="number"&&(n={timeout:n}),c={id:"",type:"suite",name:t,suite:(f=E.currentSuite)===null||f===void 0?void 0:f.suite,mode:r,each:i,file:void 0,shuffle:n==null?void 0:n.shuffle,tasks:[],meta:Object.create(null),concurrent:n==null?void 0:n.concurrent},Te(c,Fe())}function m(){o.length=0,h()}async function v(y){if(!y)throw new TypeError("File is required to collect tasks.");e&&await We(p,()=>e(a));const f=[];for(const g of o)f.push(g.type==="collector"?await g.collect(y):g);return c.file=y,c.tasks=f,f.forEach(g=>{g.file=y}),c}return Me(p),p}function xe(t,e){return async(...r)=>{const i=await t(...r);if(e.promises){const s=(await Promise.allSettled(e.promises)).map(o=>o.status==="rejected"?o.reason:void 0).filter(Boolean);if(s.length)throw s}return i}}function Ie(){function t(e,r,i){var n;const s=this.only?"only":this.skip?"skip":this.todo?"todo":"run",o=E.currentSuite||se;let{options:c,handler:u}=S(r,i);const a=c.concurrent||this.concurrent||c.sequential===!1,l=c.sequential||this.sequential||c.concurrent===!1;c={...o==null?void 0:o.options,...c,shuffle:this.shuffle??c.shuffle??(o==null||(n=o.options)===null||n===void 0?void 0:n.shuffle)??void 0};const p=a||c.concurrent&&!l,d=l||c.sequential&&!a;return c.concurrent=p&&!d,c.sequential=d&&!p,je(_(e),u,s,this.each,c,o==null?void 0:o.fixtures())}return t.each=function(e,...r){const i=this.withContext();return this.setContext("each",!0),Array.isArray(e)&&r.length&&(e=P(e,r)),(n,s,o)=>{const c=_(n),u=e.every(Array.isArray),{options:a,handler:l}=S(s,o),p=typeof s=="function"&&typeof o=="object";e.forEach((d,h)=>{const m=Array.isArray(d)?d:[d];p?u?i(C(c,m,h),()=>l(...m),a):i(C(c,m,h),()=>l(d),a):u?i(C(c,m,h),a,()=>l(...m)):i(C(c,m,h),a,()=>l(d))}),this.setContext("each",void 0)}},t.for=function(e,...r){return Array.isArray(e)&&r.length&&(e=P(e,r)),(i,n,s)=>{const o=_(i),{options:c,handler:u}=S(n,s);e.forEach((a,l)=>{F(C(o,O(a),l),c,()=>u(a))})}},t.skipIf=e=>e?F.skip:F,t.runIf=e=>e?F:F.skip,ie(["concurrent","sequential","shuffle","skip","only","todo"],t)}function Re(t,e){const r=t;r.each=function(n,...s){const o=this.withContext();return this.setContext("each",!0),Array.isArray(n)&&s.length&&(n=P(n,s)),(c,u,a)=>{const l=_(c),p=n.every(Array.isArray),{options:d,handler:h}=S(u,a),m=typeof u=="function"&&typeof a=="object";n.forEach((v,y)=>{const f=Array.isArray(v)?v:[v];m?p?o(C(l,f,y),()=>h(...f),d):o(C(l,f,y),()=>h(v),d):p?o(C(l,f,y),d,()=>h(...f)):o(C(l,f,y),d,()=>h(v))}),this.setContext("each",void 0)}},r.for=function(n,...s){const o=this.withContext();return Array.isArray(n)&&s.length&&(n=P(n,s)),(c,u,a)=>{const l=_(c),{options:p,handler:d}=S(u,a);n.forEach((h,m)=>{const v=y=>d(h,y);v.__VITEST_FIXTURE_INDEX__=1,v.toString=()=>d.toString(),o(C(l,O(h),m),p,v)})}},r.skipIf=function(n){return n?this.skip:this},r.runIf=function(n){return n?this:this.skip},r.scoped=function(n){N().scoped(n)},r.extend=function(n){const s=ne(n,e||{},b);return U(function(c,u,a){const l=N(),p=l.fixtures(),d={...this};p&&(d.fixtures=be(d.fixtures||[],p)),l.test.fn.call(d,_(c),u,a)},s)};const i=ie(["concurrent","sequential","skip","only","todo","fails"],r);return e&&i.mergeContext(e),i}function U(t,e){return Re(t,e)}function _(t){return typeof t=="string"?t:typeof t=="function"?t.name||"<anonymous>":String(t)}function C(t,e,r){(t.includes("%#")||t.includes("%$"))&&(t=t.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,`${r}`).replace(/%\$/g,`${r+1}`).replace(/__vitest_escaped_%__/g,"%%"));const i=t.split("%").length-1;t.includes("%f")&&(t.match(/%f/g)||[]).forEach((c,u)=>{if(he(e[u])||Object.is(e[u],-0)){let a=0;t=t.replace(/%f/g,l=>(a++,a===u+1?"-%f":l))}});let n=de(t,...e.slice(0,i));const s=Z(e[0]);return n=n.replace(/\$([$\w.]+)/g,(o,c)=>{const u=/^\d+$/.test(c);if(!s&&!u)return`$${c}`;const a=u?X(e,c):void 0,l=s?X(e[0],c,a):a;return pe(l,{truncate:void 0})}),n}function P(t,e){const r=t.join("").trim().replace(/ /g,"").split(`
|
|
2
|
+
`).map(n=>n.split("|"))[0],i=[];for(let n=0;n<Math.floor(e.length/r.length);n++){const s={};for(let o=0;o<r.length;o++)s[r[o]]=e[n*r.length+o];i.push(s)}return i}function $e(t,e){const r=t.split(`
|
|
3
|
+
`).slice(1);for(const i of r){const n=Q(i);if(n&&n.file===Ae())return{line:n.line,column:e?n.column+1:n.column}}}globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;function Je(t){const e=[t.name];let r=t;for(;r!=null&&r.suite;)r=r.suite,r!=null&&r.name&&e.unshift(r.name);return r!==t.file&&e.unshift(t.file.name),e}globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;const W=new Map,G=[],$=[];function Pe(t){if(W.size){var e;const r=Array.from(W).map(([n,s])=>[n,s[0],s[1]]),i=(e=t.onTaskUpdate)===null||e===void 0?void 0:e.call(t,r,G);i&&($.push(i),i.then(()=>$.splice($.indexOf(i),1),()=>{})),G.length=0,W.clear()}}async function qe(t){Pe(t),await Promise.all($)}const Y=Date.now,E={currentSuite:null};function Me(t){var e;(e=E.currentSuite)===null||e===void 0||e.tasks.push(t)}async function We(t,e){const r=E.currentSuite;E.currentSuite=t,await e(),E.currentSuite=r}function V(t,e,r=!1,i,n){if(e<=0||e===Number.POSITIVE_INFINITY)return t;const{setTimeout:s,clearTimeout:o}=fe();return function(...u){const a=Y(),l=Se();return l._currentTaskStartTime=a,l._currentTaskTimeout=e,new Promise((p,d)=>{var h;const m=s(()=>{o(m),v()},e);(h=m.unref)===null||h===void 0||h.call(m);function v(){const g=Ue(r,e,i);n==null||n(u,g),d(g)}function y(g){if(l._currentTaskStartTime=void 0,l._currentTaskTimeout=void 0,o(m),Y()-a>=e){v();return}p(g)}function f(g){l._currentTaskStartTime=void 0,l._currentTaskTimeout=void 0,o(m),d(g)}try{const g=t(...u);typeof g=="object"&&g!=null&&typeof g.then=="function"?g.then(y,f):y(g)}catch(g){f(g)}})}}const D=new WeakMap;function Ne([t],e){t&&Ve(t,e)}function Ve(t,e){const r=D.get(t);r==null||r.abort(e)}function De(t,e){var r;const i=function(){throw new Error("done() callback is deprecated, use promise instead")};let n=D.get(i);n||(n=new AbortController,D.set(i,n)),i.signal=n.signal,i.task=t,i.skip=(o,c)=>{if(o!==!1)throw t.result??(t.result={state:"skip"}),t.result.pending=!0,new ge("test is skipped; abort execution",t,typeof o=="string"?o:c)};async function s(o,c,u,a){const l={message:o,type:u||"notice"};if(a){if(!a.body&&!a.path)throw new TypeError("Test attachment requires body or path to be set. Both are missing.");if(a.body&&a.path)throw new TypeError('Test attachment requires only one of "body" or "path" to be set. Both are specified.');l.attachment=a,a.body instanceof Uint8Array&&(a.body=Xe(a.body))}if(c&&(l.location=c),!e.onTestAnnotate)throw new Error("Test runner doesn't support test annotations.");await qe(e);const p=await e.onTestAnnotate(t,l);return t.annotations.push(p),p}return i.annotate=(o,c,u)=>{if(t.result&&t.result.state!=="run")throw new Error(`Cannot annotate tests outside of the test run. The test "${t.name}" finished running with the "${t.result.state}" state already.`);let a;const l=new Error("STACK_TRACE").stack,p=l.includes("STACK_TRACE")?2:1,d=l.split(`
|
|
4
|
+
`)[p],h=Q(d);return h&&(a={file:h.file,line:h.line,column:h.column}),typeof c=="object"?J(t,s(o,a,void 0,c)):J(t,s(o,a,c,u))},i.onTestFailed=(o,c)=>{t.onFailed||(t.onFailed=[]),t.onFailed.push(V(o,c??e.config.hookTimeout,!0,new Error("STACK_TRACE_ERROR"),(u,a)=>n.abort(a)))},i.onTestFinished=(o,c)=>{t.onFinished||(t.onFinished=[]),t.onFinished.push(V(o,c??e.config.hookTimeout,!0,new Error("STACK_TRACE_ERROR"),(u,a)=>n.abort(a)))},((r=e.extendTaskContext)===null||r===void 0?void 0:r.call(e,i))||i}function Ue(t,e,r){const i=`${t?"Hook":"Test"} timed out in ${e}ms.
|
|
5
|
+
If this is a long-running ${t?"hook":"test"}, pass a timeout value as the last argument or configure it globally with "${t?"hookTimeout":"testTimeout"}".`,n=new Error(i);return r!=null&&r.stack&&(n.stack=r.stack.replace(n.message,r.message)),n}const Ke=new WeakMap;function Le(t){const e=Ke.get(t);if(!e)throw new Error(`Cannot find file context for ${t.name}`);return e}const k=[];for(let t=65;t<91;t++)k.push(String.fromCharCode(t));for(let t=97;t<123;t++)k.push(String.fromCharCode(t));for(let t=0;t<10;t++)k.push(t.toString(10));function Xe(t){let e="";const r=t.byteLength;for(let i=0;i<r;i+=3)if(r===i+1){const n=(t[i]&252)>>2,s=(t[i]&3)<<4;e+=k[n],e+=k[s],e+="=="}else if(r===i+2){const n=(t[i]&252)>>2,s=(t[i]&3)<<4|(t[i+1]&240)>>4,o=(t[i+1]&15)<<2;e+=k[n],e+=k[s],e+=k[o],e+="="}else{const n=(t[i]&252)>>2,s=(t[i]&3)<<4|(t[i+1]&240)>>4,o=(t[i+1]&15)<<2|(t[i+2]&192)>>6,c=t[i+2]&63;e+=k[n],e+=k[s],e+=k[o],e+=k[c]}return e}function J(t,e){return e=e.finally(()=>{if(!t.promises)return;const r=t.promises.indexOf(e);r!==-1&&t.promises.splice(r,1)}),t.promises||(t.promises=[]),t.promises.push(e),e}export{Je as E,ke as f,Te as h,Re as j,N as l,F as n,ie as r,ye as s};
|