@ncino/web-components 5.0.0-preview.2 → 5.0.0-preview.3
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/_commonjsHelpers.js +1 -1
- package/dist/_virtual/index_html.js +1 -1
- package/dist/_virtual/index_react.js +1 -1
- package/dist/_virtual/preload-helper.js +1 -1
- package/dist/assets/node_modules/.pnpm/ckeditor5@45.2.1/node_modules/ckeditor5/dist/ckeditor5.css +1 -1
- package/dist/components/accordion/gator/base/accordion.gator.js +6 -6
- package/dist/components/avatar/gator/avatar.gator.js +2 -2
- package/dist/components/badge/gator/badge.gator.js +2 -2
- package/dist/components/boolean/boolean.gator.js +6 -6
- package/dist/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.js +2 -2
- package/dist/components/button/gator/button.gator.js +4 -4
- package/dist/components/button-group/gator/button-group.gator.js +2 -2
- package/dist/components/checkbox/checkbox.gator.js +5 -5
- package/dist/components/checkbox-group/checkbox-group.gator.js +8 -8
- package/dist/components/combobox/base/combobox.js +1 -1
- package/dist/components/combobox/base/combobox.slds.js +13 -13
- package/dist/components/date-picker/base/gator/datepicker.gator.js +18 -18
- package/dist/components/date-picker/year-month-selector/year-month-selector.gator.js +2 -2
- package/dist/components/headline-card/gator/headline-card.gator.js +2 -2
- package/dist/components/icon/gator/icon.gator.js +2 -2
- package/dist/components/illustration/gator/illustration.gator.js +2 -2
- package/dist/components/input/base/input-base.gator.js +1 -1
- package/dist/components/input/gator/dropdown/input-dropdown.gator.js +11 -11
- package/dist/components/input/gator/input-currency/input-currency.gator.js +2 -2
- package/dist/components/input/gator/input-date/input-date.gator.js +15 -15
- package/dist/components/input/gator/input-file/input-file.gator.js +3 -3
- package/dist/components/input/gator/input-masked/input-masked.gator.js +1 -1
- package/dist/components/input/gator/input-phone/input-phone.gator.js +2 -2
- package/dist/components/input/gator/input-search/input-search.gator.js +2 -2
- package/dist/components/input/gator/input-text/input-text.gator.js +1 -1
- package/dist/components/input/gator/input-time/input-time.gator.js +2 -2
- package/dist/components/list/gator/list/list.gator.js +2 -2
- package/dist/components/list/gator/list-item/list-item.gator.js +6 -6
- package/dist/components/menu/base/gator/menu.gator.js +3 -3
- package/dist/components/menu/base/slds/menu.slds.js +2 -2
- package/dist/components/menu/menu-item/gator/menu-item.gator.js +2 -2
- package/dist/components/menu/menu-submenu/menu-submenu.js +1 -1
- package/dist/components/modal/gator/modal.gator.js +38 -39
- package/dist/components/page-header/gator/page-header.gator.js +2 -2
- package/dist/components/panel/gator/panel.gator.js +13 -13
- package/dist/components/panel/gator/panel.storybook-test.js +1 -1
- package/dist/components/pill/pill.slds.js +3 -3
- package/dist/components/popover/gator/popover.gator.js +10 -10
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/radio/radio.gator.js +2 -2
- package/dist/components/radio-group/radio-group.gator.js +2 -2
- package/dist/components/selection-box-group/selection-box-group.gator.js +5 -5
- package/dist/components/selector/gator/selector.gator.js +2 -2
- package/dist/components/switch/gator/switch.gator.js +2 -2
- package/dist/components/tabs/gator/tabset/tabset.gator.js +3 -3
- package/dist/components/text-detail/gator/text-detail.gator.js +17 -18
- package/dist/components/time-picker/gator/time-picker.gator.js +19 -19
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-autosave@45.2.1/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-basic-styles@45.2.1/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@45.2.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +10 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-cloud-services@45.2.1/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-code-block@45.2.1/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +5 -5
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-editor-classic@45.2.1/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +12 -12
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-find-and-replace@45.2.1/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-font@45.2.1/node_modules/@ckeditor/ckeditor5-font/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-heading@45.2.1/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@45.2.1/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@45.2.1/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +6 -6
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@45.2.1/node_modules/@ckeditor/ckeditor5-image/dist/index.js +4 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@45.2.1/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +4 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@45.2.1/node_modules/@ckeditor/ckeditor5-link/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@45.2.1/node_modules/@ckeditor/ckeditor5-list/dist/index.js +5 -5
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-markdown-gfm@45.2.1/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +4 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@45.2.1/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paragraph@45.2.1/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@45.2.1/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +9 -9
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@45.2.1/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@45.2.1/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-style@45.2.1/node_modules/@ckeditor/ckeditor5-style/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@45.2.1/node_modules/@ckeditor/ckeditor5-table/dist/index.js +6 -6
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +4 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +10 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-undo@45.2.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-upload@45.2.1/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +38 -38
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-watchdog@45.2.1/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@45.2.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@deltablot_dropzone@7.3.1/node_modules/@deltablot/dropzone/dist/dropzone.js +1 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/main.js +1 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.4/node_modules/@figma/code-connect/dist/common/fetch.js +1 -0
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.4/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +1 -0
- package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/connect/helpers.js +1 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.4/node_modules/@figma/code-connect/package.json.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/reactive-element.js +2 -2
- package/dist/node_modules/.pnpm/@storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/core/dist/channels/index.js +9 -9
- package/dist/node_modules/.pnpm/@storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/core/dist/csf/index.js +1 -1
- package/dist/node_modules/.pnpm/@storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/core/dist/preview-api/index.js +22 -22
- package/dist/node_modules/.pnpm/@storybook_instrumenter@8.6.14_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/instrumenter/dist/index.js +36 -36
- package/dist/node_modules/.pnpm/@storybook_test@8.6.14_storybook@8.6.14_prettier@3.6.2_/node_modules/@storybook/test/dist/index.js +111 -111
- package/dist/node_modules/.pnpm/@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.0.10_typescript@5.8.3__playwright@1.53.2_77c47ac19cbe97978028e1e5ac862536/node_modules/@vitest/browser/context.js +1 -0
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +8 -8
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +5 -5
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +11 -11
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +21 -21
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +2 -2
- package/dist/node_modules/.pnpm/axe-core@4.10.3/node_modules/axe-core/axe.js +4 -4
- package/dist/node_modules/.pnpm/chai@5.2.0/node_modules/chai/chai.js +3 -3
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/get.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/unset.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/debounce.js +1 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/object/cloneDeepWith.js +1 -1
- package/dist/node_modules/.pnpm/lit-element@4.2.0/node_modules/lit-element/lit-element.js +2 -2
- package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/async-directive.js +1 -1
- package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/class-map.js +2 -2
- package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/ref.js +2 -2
- package/dist/node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/lit-html.js +3 -3
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cache.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cachestorage.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/parse.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/constants.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/headers.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/index.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/request.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/response.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/util.js +2 -2
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/webidl.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/connection.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/events.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/frame.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/receiver.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/util.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/websocket.js +1 -1
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.10_@vitest_browser@3.2.4_@vitest_ui@3_8c34ee540b1f52c214debce201d1e515/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +1 -1
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.10_@vitest_browser@3.2.4_@vitest_ui@3_8c34ee540b1f52c214debce201d1e515/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +8 -8
- package/dist/packages/web-components/src/components/button/gator/button.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/modal/gator/modal.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/switch/gator/switch.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/text-detail/gator/text-detail.gator.scss.js +1 -1
- package/dist/packages/web-components/src/index.slds.scss.js +1 -1
- package/dist/types/components/modal/gator/modal.gator.d.ts +1 -1
- package/dist/types/components/text-detail/gator/text-detail.gator.d.ts +4 -2
- package/dist/utils/accessibility-utils.js +1 -1
- package/dist/utils/datatestid-utils.js +1 -1
- package/dist/utils/lightdom-utils.js +1 -1
- package/dist/utils/vitest-a11y-utils.js +1 -1
- package/dist/utils/vitest-utils.js +1 -1
- package/package.json +10 -10
- package/web-types.json +2 -3
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/common/fetch.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/package.json.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.0.10_typescript@5.8.3__playwright@1.53.1_5fd2997ee9a97429a51e07bc2023c338/node_modules/@vitest/browser/context.js +0 -1
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/client/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/client/figma_client.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/common/logging.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/common/updates.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/connect/external_types.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/connect/index_common.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/html/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/html/index_html.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/html/template_literal.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/react/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.3 → @figma_code-connect@1.3.4}/node_modules/@figma/code-connect/dist/react/index_react.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=null,e=globalThis.__vitest_worker__?.ctx?.pool;throw new Error("@vitest/browser/context can be imported only inside the Browser Mode. "+(e?`Your test is running in ${e} pool. Make sure your regular tests are excluded from the "test.include" glob pattern.`:"Instead, it was imported outside of Vitest."));export{t as page};
|
package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import{diff as S,printDiffOrStringify as vt}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js";import E from"../../../../../tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.js";import{isMockFunction as H}from"../../../../../@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js";import{processError as Tt}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js";import{use as Nt,util as R}from"../../../../../chai@5.2.0/node_modules/chai/chai.js";import{getType as ut,noop as Ot,isObject as q,assertTypes as T}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js";import{s as j}from"../../../../../@vitest_utils@3.2.4/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"),ae={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
4
|
${r||a(t)}
|
|
@@ -20,16 +20,16 @@ Expected value to be one of:
|
|
|
20
20
|
${h(t)}
|
|
21
21
|
|
|
22
22
|
Received:
|
|
23
|
-
${a(e)}`}}},D=E.green,
|
|
24
|
-
`:"",h=`${e} has value: ${r(t)}`;return a+h}function
|
|
23
|
+
${a(e)}`}}},D=E.green,U=E.red,jt=E.inverse,Mt=E.bold,O=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=U,secondArgumentColor:s=D}=c;let i="",l="expect";return!h&&t!==""&&(i+=O(`${l}(`)+o(t),l=")"),d!==""&&(i+=O(`${l}.`)+d,l=""),u&&(i+=`${O(`${l}.`)}not`,l=""),e.includes(".")?l+=e:(i+=O(`${l}.`)+e,l=""),r===""?l+="()":(i+=O(`${l}(`)+n(r),m&&(i+=O(", ")+s(m)),l=")"),a!==""&&(l+=` // ${a}`),l!==""&&(i+=O(l)),i}const _t="·";function pt(e){return e.replace(/\s+$/gm,t=>_t.repeat(t.length))}function At(e){return U(pt(j(e)))}function It(e){return D(pt(j(e)))}function dt(){return{EXPECTED_COLOR:D,RECEIVED_COLOR:U,INVERTED_COLOR:jt,BOLD_WEIGHT:Mt,DIM_COLOR:O,diff:S,matcherHint:Ct,printReceived:At,printExpected:It,printDiffOrStringify:vt,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 ce(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 J(){return globalThis[B].customEqualityTesters}function g(e,t,r,c){return r=r||[],A(e,t,[],[],r,c?mt:Rt)}function z(e){return!!e&&typeof e=="object"&&"asymmetricMatch"in e&&v("Function",e.asymmetricMatch)}function Bt(e,t){const r=z(e),c=z(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(X(e)&&X(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=K(e,h);let i,l=s.length;if(K(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 K(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 X(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 Z(e){return!!(e!=null&&e[bt])}function x(e,t,r=[],c=[],a=[]){if(typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t)||!Z(e)||!Z(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!==x),d];function d(n,o){return x(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 G(e,t){return!e||typeof e!="object"||e===Object.prototype?!1:Object.prototype.hasOwnProperty.call(e,t)||G(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&&G(u,m)&&g(u[m],d[m],[...c,a(h)]);return h.delete(d[m]),n})};return a()(e,t)}function Q(e,t){if(!(e==null||t==null||e.constructor===t.constructor))return!1}function tt(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 Y(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!==Y);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
|
-
`:c}function
|
|
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
|
|
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){T(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 T(o,"actual",["number","bigint"]),T(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 T(o,"actual",["number","bigint"]),T(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 T(o,"actual",["number","bigint"]),T(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 T(o,"actual",["number","bigint"]),T(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,x]))}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,x]);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(te(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(M=>(t.flag(this,"object",M),b.call(this,...$)),M=>{const w=new r(`promise rejected "${t.inspect(M)}" instead of resolving`,{showDiff:!1});throw w.cause=M,w.stack=o.stack.replace(o.message,w.message),w});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 M=l.then(w=>{const _=new r(`promise resolved "${t.inspect(w)}" instead of rejecting`,{showDiff:!0,expected:new Error("rejected promise"),actual:w});throw _.stack=o.stack.replace(o.message,_.message),_},w=>(t.flag(this,"object",w),$.call(this,...C)));return ct(s,M,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(`
|
|
30
|
+
`:c}function Jt(e,t){return`${t} ${e}${t===1?"":"s"}`}function V(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,x,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 V(u))G(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+=V(u[n]).length),a(h)(u[n],d[n]));if(V(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 le(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 N{$$typeof=Symbol.for("jest.asymmetricMatcher");constructor(t,r=!1){this.sample=t,this.inverse=r}getMatcherContext(t){return{...$t(t||globalThis[ft]),equals:g,isNot:this.inverse,customTesters:J(),utils:{...dt(),diff:S,stringify:j,iterableEquality:x,subsetEquality:P}}}}N.prototype[Symbol.for("chai/inspect")]=function(e){const t=j(this,e.depth,{min:!0});return t.length<=e.truncate?t:`${this.toString()}{…}`};class et extends N{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 N{asymmetricMatch(t){return t!=null}toString(){return"Anything"}toAsymmetricMatcher(){return"Anything"}}class nt extends N{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 ot extends N{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 N{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 rt extends N{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 st extends N{precision;constructor(t,r=2,c=!1){if(!v("Number",t))throw new Error("Expected is not a Number");if(!v("Number",r))throw new Error("Precision is not a Number");super(t),this.inverse=c,this.precision=r}asymmetricMatch(t){if(!v("Number",t))return!1;let r=!1;return t===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY?r=!0:r=Math.abs(this.sample-t)<10**-this.precision/2,this.inverse?!r:r}toString(){return`Number${this.inverse?"Not":""}CloseTo`}getExpectedType(){return"number"}toAsymmetricMatcher(){return[this.toString(),this.sample,`(${Jt("digit",this.precision)})`].join(" ")}}const ue=(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 et(r)),t.addMethod(e.expect,"objectContaining",r=>new nt(r)),t.addMethod(e.expect,"arrayContaining",r=>new ot(r)),t.addMethod(e.expect,"stringMatching",r=>new rt(r)),t.addMethod(e.expect,"closeTo",(r,c)=>new st(r,c)),e.expect.not={stringContaining:r=>new et(r,!0),objectContaining:r=>new nt(r,!0),arrayContaining:r=>new ot(r,!0),stringMatching:r=>new rt(r,!0),closeTo:(r,c)=>new st(r,c,!0)}};function it(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 at(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 ct(e,t){var r;e.result||(e.result={state:"fail"}),e.result.state="fail",(r=e.result).errors||(r.errors=[]),e.result.errors.push(Tt(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{const h=r.apply(this,c);return h&&typeof h=="object"&&typeof h.then=="function"?h.then(Ot,u=>{ct(a,u)}):h}catch(h){ct(a,h)}}}const fe=(e,t)=>{const{AssertionError:r}=e,c=J();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,x]);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,x,Q,Y,tt],!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,x,Q,Y,tt],!0)?i="toStrictEqual":g(o,n,[...c,x])&&(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,x,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){T(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 T(o,"actual",["number","bigint"]),T(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 T(o,"actual",["number","bigint"]),T(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 T(o,"actual",["number","bigint"]),T(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 T(o,"actual",["number","bigint"]),T(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(!H(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=F(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,x]))}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(F(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(F(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(!H(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(!H(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,x]);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?.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?.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?.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(M=>(t.flag(this,"object",M),b.call(this,...$)),M=>{const w=new r(`promise rejected "${t.inspect(M)}" instead of resolving`,{showDiff:!1});throw w.cause=M,w.stack=o.stack.replace(o.message,w.message),w});return at(s,C,it(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?.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 M=l.then(w=>{const _=new r(`promise resolved "${t.inspect(w)}" instead of rejecting`,{showDiff:!0,expected:new Error("rejected promise"),actual:w});throw _.stack=o.stack.replace(o.message,_.message),_},w=>(t.flag(this,"object",w),$.call(this,...C)));return at(s,M,it(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 F(e,t,r){return e.mock.calls.length&&(t+=E.gray(`
|
|
33
33
|
|
|
34
34
|
Received:
|
|
35
35
|
|
|
@@ -42,7 +42,7 @@ ${e.mock.calls.map((c,a)=>{let h=E.bold(` ${I(a+1)} ${e.getMockName()} call:
|
|
|
42
42
|
`)}`)),t+=E.gray(`
|
|
43
43
|
|
|
44
44
|
Number of calls: ${E.bold(e.mock.calls.length)}
|
|
45
|
-
`),t}function
|
|
45
|
+
`),t}function Xt(e,t,r,c){return t.length&&(r+=E.gray(`
|
|
46
46
|
|
|
47
47
|
Received:
|
|
48
48
|
|
|
@@ -55,4 +55,4 @@ ${t.map((a,h)=>{let u=E.bold(` ${I(h+1)} ${e.getMockName()} call return:
|
|
|
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:j,iterableEquality:x,subsetEquality:P};return{state:{...$t(t),customTesters:J(),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"&&typeof p.then=="function")return p.then(({pass:w,message:_,actual:wt,expected:xt})=>{if(w&&l||!w&&!l)throw new lt(_(),wt,xt)});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 N{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=>j(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 he=(e,t)=>{t.addMethod(e.expect,"extend",(r,c)=>{Nt(Qt(e,r,c))})};export{ht as ASYMMETRIC_MATCHERS_OBJECT,Kt as Any,zt as Anything,ot as ArrayContaining,N as AsymmetricMatcher,ft as GLOBAL_EXPECT,B as JEST_MATCHERS_OBJECT,ue as JestAsymmetricMatchers,fe as JestChaiExpect,he as JestExtend,k as MATCHERS_OBJECT,nt as ObjectContaining,et as StringContaining,rt as StringMatching,ce as addCustomEqualityTesters,tt as arrayBufferEquality,ae as customMatchers,g as equals,Ut as generateToBeMessage,V as getObjectKeys,Gt as getObjectSubset,$t as getState,v as isA,z as isAsymmetric,Dt as isImmutableUnorderedKeyed,Lt as isImmutableUnorderedSet,x as iterableEquality,Jt as pluralize,le as setState,Y as sparseArrayEquality,P as subsetEquality,Q as typeEquality};
|
|
@@ -16,6 +16,6 @@ import be from"../../../../../tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/br
|
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/var W;function it(){if(W)return f;W=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),u=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),_;_=Symbol.for("react.module.reference");function c(i){if(typeof i=="object"&&i!==null){var x=i.$$typeof;switch(x){case e:switch(i=i.type,i){case r:case o:case n:case m:case p:return i;default:switch(i=i&&i.$$typeof,i){case a:case u:case l:case S:case E:case s:return i;default:return x}}case t:return x}}}return f.ContextConsumer=u,f.ContextProvider=s,f.Element=e,f.ForwardRef=l,f.Fragment=r,f.Lazy=S,f.Memo=E,f.Portal=t,f.Profiler=o,f.StrictMode=n,f.Suspense=m,f.SuspenseList=p,f.isAsyncMode=function(){return!1},f.isConcurrentMode=function(){return!1},f.isContextConsumer=function(i){return c(i)===u},f.isContextProvider=function(i){return c(i)===s},f.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===e},f.isForwardRef=function(i){return c(i)===l},f.isFragment=function(i){return c(i)===r},f.isLazy=function(i){return c(i)===S},f.isMemo=function(i){return c(i)===E},f.isPortal=function(i){return c(i)===t},f.isProfiler=function(i){return c(i)===o},f.isStrictMode=function(i){return c(i)===n},f.isSuspense=function(i){return c(i)===m},f.isSuspenseList=function(i){return c(i)===p},f.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===r||i===o||i===n||i===m||i===p||i===C||typeof i=="object"&&i!==null&&(i.$$typeof===S||i.$$typeof===E||i.$$typeof===s||i.$$typeof===u||i.$$typeof===l||i.$$typeof===_||i.getModuleId!==void 0)},f.typeOf=c,f}var q;function at(){return q||(q=1,w.exports=it()),w.exports}var ie=at(),lt=se(ie),mt=v({__proto__:null,default:lt},[ie]);const ft=["isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isPortal","isProfiler","isStrictMode","isSuspense","isSuspenseList","isValidElementType"],b=Object.fromEntries(ft.map(e=>[e,t=>mt[e](t)||ct[e](t)]));function ae(e,t=[]){if(Array.isArray(e))for(const r of e)ae(r,t);else e!=null&&e!==!1&&e!==""&&t.push(e);return t}function J(e){const t=e.type;if(typeof t=="string")return t;if(typeof t=="function")return t.displayName||t.name||"Unknown";if(b.isFragment(e))return"React.Fragment";if(b.isSuspense(e))return"React.Suspense";if(typeof t=="object"&&t!==null){if(b.isContextProvider(e))return"Context.Provider";if(b.isContextConsumer(e))return"Context.Consumer";if(b.isForwardRef(e)){if(t.displayName)return t.displayName;const r=t.render.displayName||t.render.name||"";return r===""?"ForwardRef":`ForwardRef(${r})`}if(b.isMemo(e)){const r=t.displayName||t.type.displayName||t.type.name||"";return r===""?"Memo":`Memo(${r})`}}return"UNDEFINED"}function pt(e){const{props:t}=e;return Object.keys(t).filter(r=>r!=="children"&&t[r]!==void 0).sort()}const yt=(e,t,r,n,o,s)=>++n>t.maxDepth?B(J(e),t):z(J(e),F(pt(e),e.props,t,r+t.indent,n,o,s),j(ae(e.props.children),t,r+t.indent,n,o,s),t,r),Et=e=>e!=null&&b.isElement(e),_t={serialize:yt,test:Et},$t=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.test.json"):245830487;function St(e){const{props:t}=e;return t?Object.keys(t).filter(r=>t[r]!==void 0).sort():[]}const dt=(e,t,r,n,o,s)=>++n>t.maxDepth?B(e.type,t):z(e.type,e.props?F(St(e),e.props,t,r+t.indent,n,o,s):"",e.children?j(e.children,t,r+t.indent,n,o,s):"",t,r),bt=e=>e&&e.$$typeof===$t,Tt={serialize:dt,test:bt},le=Object.prototype.toString,Nt=Date.prototype.toISOString,It=Error.prototype.toString,G=RegExp.prototype.toString;function A(e){return typeof e.constructor=="function"&&e.constructor.name||"Object"}function Ot(e){return typeof window<"u"&&e===window}const At=/^Symbol\((.*)\)(.*)$/,Mt=/\n/g;class me extends Error{constructor(t,r){super(t),this.stack=r,this.name=this.constructor.name}}function Rt(e){return e==="[object Array]"||e==="[object ArrayBuffer]"||e==="[object DataView]"||e==="[object Float32Array]"||e==="[object Float64Array]"||e==="[object Int8Array]"||e==="[object Int16Array]"||e==="[object Int32Array]"||e==="[object Uint8Array]"||e==="[object Uint8ClampedArray]"||e==="[object Uint16Array]"||e==="[object Uint32Array]"}function Ct(e){return Object.is(e,-0)?"-0":String(e)}function xt(e){return`${e}n`}function H(e,t){return t?`[Function ${e.name||"anonymous"}]`:"[Function]"}function X(e){return String(e).replace(At,"Symbol($1)")}function Q(e){return`[${It.call(e)}]`}function fe(e,t,r,n){if(e===!0||e===!1)return`${e}`;if(e===void 0)return"undefined";if(e===null)return"null";const o=typeof e;if(o==="number")return Ct(e);if(o==="bigint")return xt(e);if(o==="string")return n?`"${e.replaceAll(/"|\\/g,"\\$&")}"`:`"${e}"`;if(o==="function")return H(e,t);if(o==="symbol")return X(e);const s=le.call(e);return s==="[object WeakMap]"?"WeakMap {}":s==="[object WeakSet]"?"WeakSet {}":s==="[object Function]"||s==="[object GeneratorFunction]"?H(e,t):s==="[object Symbol]"?X(e):s==="[object Date]"?Number.isNaN(+e)?"Date { NaN }":Nt.call(e):s==="[object Error]"?Q(e):s==="[object RegExp]"?r?G.call(e).replaceAll(/[$()*+.?[\\\]^{|}]/g,"\\$&"):G.call(e):e instanceof Error?Q(e):null}function pe(e,t,r,n,o,s){if(o.includes(e))return"[Circular]";o=[...o],o.push(e);const u=++n>t.maxDepth,a=t.min;if(t.callToJSON&&!u&&e.toJSON&&typeof e.toJSON=="function"&&!s)return d(e.toJSON(),t,r,n,o,!0);const l=le.call(e);return l==="[object Arguments]"?u?"[Arguments]":`${a?"":"Arguments "}[${M(e,t,r,n,o,d)}]`:Rt(l)?u?`[${e.constructor.name}]`:`${a||!t.printBasicPrototype&&e.constructor.name==="Array"?"":`${e.constructor.name} `}[${M(e,t,r,n,o,d)}]`:l==="[object Map]"?u?"[Map]":`Map {${I(e.entries(),t,r,n,o,d," => ")}}`:l==="[object Set]"?u?"[Set]":`Set {${L(e.values(),t,r,n,o,d)}}`:u||Ot(e)?`[${A(e)}]`:`${a||!t.printBasicPrototype&&A(e)==="Object"?"":`${A(e)} `}{${D(e,t,r,n,o,d)}}`}const gt={test:e=>e&&e instanceof Error,serialize(e,t,r,n,o,s){if(o.includes(e))return"[Circular]";o=[...o,e];const u=++n>t.maxDepth,{message:a,cause:l,...m}=e,p={message:a,...typeof l<"u"?{cause:l}:{},...e instanceof AggregateError?{errors:e.errors}:{},...m},E=e.name!=="Error"?e.name:A(e);return u?`[${E}]`:`${E} {${I(Object.entries(p).values(),t,r,n,o,s)}}`}};function Pt(e){return e.serialize!=null}function ye(e,t,r,n,o,s){let u;try{u=Pt(e)?e.serialize(t,r,n,o,s,d):e.print(t,a=>d(a,r,n,o,s),a=>{const l=n+r.indent;return l+a.replaceAll(Mt,`
|
|
19
|
-
${l}`)},{edgeSpacing:r.spacingOuter,min:r.min,spacing:r.spacingInner},r.colors)}catch(a){throw new me(a.message,a.stack)}if(typeof u!="string")throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof u}".`);return u}function Ee(e,t){for(const r of e)try{if(r.test(t))return r}catch(n){throw new me(n.message,n.stack)}return null}function d(e,t,r,n,o,s){const u=Ee(t.plugins,e);if(u!==null)return ye(u,e,t,r,n,o);const a=fe(e,t.printFunctionName,t.escapeRegex,t.escapeString);return a!==null?a:pe(e,t,r,n,o,s)}const U={comment:"gray",content:"reset",prop:"yellow",tag:"cyan",value:"green"},_e=Object.keys(U),$={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:Number.POSITIVE_INFINITY,maxWidth:Number.POSITIVE_INFINITY,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,theme:U};function ht(e){for(const t of Object.keys(e))if(!Object.prototype.hasOwnProperty.call($,t))throw new Error(`pretty-format: Unknown option "${t}".`);if(e.min&&e.indent!==void 0&&e.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.')}function wt(){return _e.reduce((e,t)=>{const r=U[t],n=r&&be[r];if(n&&typeof n.close=="string"&&typeof n.open=="string")e[t]=n;else throw new Error(`pretty-format: Option "theme" has a key "${t}" whose value "${r}" is undefined in ansi-styles.`);return e},Object.create(null))}function Lt(){return _e.reduce((e,t)=>(e[t]={close:"",open:""},e),Object.create(null))}function $e(e){return
|
|
20
|
-
`,spacingOuter:e
|
|
19
|
+
${l}`)},{edgeSpacing:r.spacingOuter,min:r.min,spacing:r.spacingInner},r.colors)}catch(a){throw new me(a.message,a.stack)}if(typeof u!="string")throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof u}".`);return u}function Ee(e,t){for(const r of e)try{if(r.test(t))return r}catch(n){throw new me(n.message,n.stack)}return null}function d(e,t,r,n,o,s){const u=Ee(t.plugins,e);if(u!==null)return ye(u,e,t,r,n,o);const a=fe(e,t.printFunctionName,t.escapeRegex,t.escapeString);return a!==null?a:pe(e,t,r,n,o,s)}const U={comment:"gray",content:"reset",prop:"yellow",tag:"cyan",value:"green"},_e=Object.keys(U),$={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:Number.POSITIVE_INFINITY,maxWidth:Number.POSITIVE_INFINITY,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,theme:U};function ht(e){for(const t of Object.keys(e))if(!Object.prototype.hasOwnProperty.call($,t))throw new Error(`pretty-format: Unknown option "${t}".`);if(e.min&&e.indent!==void 0&&e.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.')}function wt(){return _e.reduce((e,t)=>{const r=U[t],n=r&&be[r];if(n&&typeof n.close=="string"&&typeof n.open=="string")e[t]=n;else throw new Error(`pretty-format: Option "theme" has a key "${t}" whose value "${r}" is undefined in ansi-styles.`);return e},Object.create(null))}function Lt(){return _e.reduce((e,t)=>(e[t]={close:"",open:""},e),Object.create(null))}function $e(e){return e?.printFunctionName??$.printFunctionName}function Se(e){return e?.escapeRegex??$.escapeRegex}function de(e){return e?.escapeString??$.escapeString}function Z(e){return{callToJSON:e?.callToJSON??$.callToJSON,colors:e?.highlight?wt():Lt(),compareKeys:typeof e?.compareKeys=="function"||e?.compareKeys===null?e.compareKeys:$.compareKeys,escapeRegex:Se(e),escapeString:de(e),indent:e?.min?"":Dt(e?.indent??$.indent),maxDepth:e?.maxDepth??$.maxDepth,maxWidth:e?.maxWidth??$.maxWidth,min:e?.min??$.min,plugins:e?.plugins??$.plugins,printBasicPrototype:e?.printBasicPrototype??!0,printFunctionName:$e(e),spacingInner:e?.min?" ":`
|
|
20
|
+
`,spacingOuter:e?.min?"":`
|
|
21
21
|
`}}function Dt(e){return Array.from({length:e+1}).join(" ")}function jt(e,t){if(t&&(ht(t),t.plugins)){const n=Ee(t.plugins,e);if(n!==null)return ye(n,e,Z(t),"",0,[])}const r=fe(e,$e(t),Se(t),de(t));return r!==null?r:pe(e,Z(t),"",0,[])}const zt={AsymmetricMatcher:Ae,DOMCollection:he,DOMElement:ke,Immutable:nt,ReactElement:_t,ReactTestComponent:Tt,Error:gt};export{$ as DEFAULT_OPTIONS,jt as format,zt as plugins};
|
package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var le=Object.defineProperty;var fe=(t,e,r)=>e in t?le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var q=(t,e,r)=>fe(t,typeof e!="symbol"?e+"":e,r);import{getSafeTimers as Q}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js";import{parseSingleStack as Z}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js";import{stripLiteral as he}from"../../../../../strip-literal@3.0.0/node_modules/strip-literal/dist/index.js";import{isNegativeNaN as de,isObject as O,objectAttr as X,toArray as ee,createDefer as B}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js";import{f as pe,o as ge}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js";class me 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 ve=new WeakMap,te=new WeakMap,ne=new WeakMap;function ye(t,e){ve.set(t,e)}function we(t,e){te.set(t,e)}function Te(t){return te.get(t)}function ke(t,e){ne.set(t,e)}function be(t){return ne.get(t)}function Ce(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 re(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&&O(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=ie(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,S=new Map;function _e(t,e,r){return i=>{const n=i||r;if(!n)return e({});const s=Te(n);if(!(s!=null&&s.length))return e(n);const o=ie(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);S.has(n)||S.set(n,[]);const a=S.get(n),l=s.filter(({prop:h,auto:m})=>m||o.includes(h)),p=oe(l);if(!p.length)return e(n);async function d(){for(const h of p){if(u.has(h))continue;const m=await Ee(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 Ee(t,e,r,i){var n;const s=Xe(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];S.has(a)||S.set(a,[]);const l=S.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 oe(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),oe(i.deps,e,r),r.push(i),e.clear()}}),r}function ie(t){let e=he(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 se(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=Re();U(function(t,e,r){N().test.fn.call(this,_(t),e,r)});let b,ce,Ae;function ae(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 Se(){return Ae}function Fe(){return ae(b,"the runner"),b}function N(){const t=E.currentSuite||ce;return ae(t,"the current suite"),t}function je(){return{beforeAll:[],afterAll:[],beforeEach:[],afterEach:[]}}function A(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 xe(t,e=()=>{},r,i,n,s){const o=[];let c;h();const u=function(v="",f={}){var g;const w=(f==null?void 0:f.timeout)??b.config.testTimeout,k={id:"",name:v,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)&&(k.concurrent=!0),k.shuffle=n==null?void 0:n.shuffle;const x=Ue(k,b);Object.defineProperty(k,"context",{value:x,enumerable:!1}),we(x,f.fixtures);const ue=Error.stackTraceLimit;Error.stackTraceLimit=15;const K=new Error("STACK_TRACE_ERROR");if(Error.stackTraceLimit=ue,j&&ye(k,V(Ie(_e(b,j,x),k),w,!1,K,(L,I)=>Ve([x],I))),b.config.includeTaskLocation){const L=K.stack,I=$e(L);I&&(k.location=I)}return o.push(k),k},a=U(function(v,f,g){let{options:w,handler:k}=A(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(_(v),{...this,...w,handler:k});j.type="test"});let l=s;const p={type:"collector",name:t,mode:r,suite:c,options:n,test:a,tasks:o,collect:y,task:u,clear:m,on:d,fixtures(){return l},scoped(v){const f=re(v,{fixtures:l},b);f.fixtures&&(l=f.fixtures)}};function d(v,...f){be(c)[v].push(...f)}function h(v){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},ke(c,je())}function m(){o.length=0,h()}async function y(v){if(!v)throw new TypeError("File is required to collect tasks.");e&&await Ne(p,()=>e(a));const f=[];for(const g of o)f.push(g.type==="collector"?await g.collect(v):g);return c.file=v,c.tasks=f,f.forEach(g=>{g.file=v}),c}return We(p),p}function Ie(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 Re(){function t(e,r,i){var n;const s=this.only?"only":this.skip?"skip":this.todo?"todo":"run",o=E.currentSuite||ce;let{options:c,handler:u}=A(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,xe(_(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=$(e,r)),(n,s,o)=>{const c=_(n),u=e.every(Array.isArray),{options:a,handler:l}=A(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=$(e,r)),(i,n,s)=>{const o=_(i),{options:c,handler:u}=A(n,s);e.forEach((a,l)=>{F(C(o,ee(a),l),c,()=>u(a))})}},t.skipIf=e=>e?F.skip:F,t.runIf=e=>e?F:F.skip,se(["concurrent","sequential","shuffle","skip","only","todo"],t)}function Pe(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=$(n,s)),(c,u,a)=>{const l=_(c),p=n.every(Array.isArray),{options:d,handler:h}=A(u,a),m=typeof u=="function"&&typeof a=="object";n.forEach((y,v)=>{const f=Array.isArray(y)?y:[y];m?p?o(C(l,f,v),()=>h(...f),d):o(C(l,f,v),()=>h(y),d):p?o(C(l,f,v),d,()=>h(...f)):o(C(l,f,v),d,()=>h(y))}),this.setContext("each",void 0)}},r.for=function(n,...s){const o=this.withContext();return Array.isArray(n)&&s.length&&(n=$(n,s)),(c,u,a)=>{const l=_(c),{options:p,handler:d}=A(u,a);n.forEach((h,m)=>{const y=v=>d(h,v);y.__VITEST_FIXTURE_INDEX__=1,y.toString=()=>d.toString(),o(C(l,ee(h),m),p,y)})}},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=re(n,e||{},b),o=t;return U(function(c,u,a){const p=N().fixtures(),d={...this};p&&(d.fixtures=Ce(d.fixtures||[],p));const{handler:h,options:m}=A(u,a),y=m.timeout??void 0;o.call(d,_(c),h,y)},s)};const i=se(["concurrent","sequential","skip","only","todo","fails"],r);return e&&i.mergeContext(e),i}function U(t,e){return Pe(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(de(e[u])||Object.is(e[u],-0)){let a=0;t=t.replace(/%f/g,l=>(a++,a===u+1?"-%f":l))}});let n=pe(t,...e.slice(0,i));const s=O(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 ge(l,{truncate:void 0})}),n}function $(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/
|
|
3
|
-
`).slice(1);for(const i of
|
|
4
|
-
`)[p],h=
|
|
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
|
|
1
|
+
import{getSafeTimers as J}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js";import{parseSingleStack as Q}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js";import{stripLiteral as ue}from"../../../../../strip-literal@3.0.0/node_modules/strip-literal/dist/index.js";import{isNegativeNaN as le,isObject as Z,objectAttr as L,toArray as O,createDefer as X}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js";import{f as fe,o as he}from"../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js";class de extends Error{code="VITEST_PENDING";taskId;constructor(e,o,i){super(e),this.message=e,this.note=i,this.taskId=o.id}}const pe=new WeakMap,ee=new WeakMap,te=new WeakMap;function ge(t,e){pe.set(t,e)}function me(t,e){ee.set(t,e)}function ve(t){return ee.get(t)}function ye(t,e){te.set(t,e)}function we(t){return te.get(t)}function Te(t,e){const o=e.reduce((s,r)=>(s[r.prop]=r,s),{}),i={};t.forEach(s=>{const r=o[s.prop]||{...s};i[r.prop]=r});for(const s in i){var n;const r=i[s];r.deps=(n=r.deps)===null||n===void 0?void 0:n.map(c=>i[c.prop])}return Object.values(i)}function ne(t,e,o){const i=["auto","injected","scope"],n=Object.entries(t).map(([s,r])=>{const c={value:r};if(Array.isArray(r)&&r.length>=2&&Z(r[1])&&Object.keys(r[1]).some(a=>i.includes(a))){var u;Object.assign(c,r[1]);const a=r[0];c.value=c.injected?((u=o.injectValue)===null||u===void 0?void 0:u.call(o,s))??a:a}return c.scope=c.scope||"test",c.scope==="worker"&&!o.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 r;(r=s.deps)===null||r===void 0||r.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 q=new Map,S=new Map;function ke(t,e,o){return i=>{const n=i||o;if(!n)return e({});const s=ve(n);if(!s?.length)return e(n);const r=oe(e),c=s.some(({auto:h})=>h);if(!r.length&&!c)return e(n);q.get(n)||q.set(n,new Map);const u=q.get(n);S.has(n)||S.set(n,[]);const a=S.get(n),l=s.filter(({prop:h,auto:m})=>m||r.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 be(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 be(t,e,o,i){var n;const s=Ue(o.task.file),r=(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),r){var u;r[u=e.prop]??(r[u]=e.value)}return e.value}if(e.scope==="test")return B(e.value,o,i);if(R.has(e))return R.get(e);let a;if(e.scope==="worker"){if(!r)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=r}else a=s;if(e.prop in a)return a[e.prop];S.has(a)||S.set(a,[]);const l=S.get(a),p=B(e.value,a,l).then(d=>(a[e.prop]=d,R.delete(e),d));return R.set(e,p),p}async function B(t,e,o){const i=X();let n=!1;const s=t(e,async r=>{n=!0,i.resolve(r);const c=X();o.push(async()=>{c.resolve(),await s}),await c}).catch(r=>{if(!n){i.reject(r);return}throw r});return i}function re(t,e=new Set,o=[]){return t.forEach(i=>{if(!o.includes(i)){if(!i.isFn||!i.deps){o.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,o),o.push(i),e.clear()}}),o}function oe(t){let e=ue(t.toString());/__async\((?:this|null), (?:null|arguments|\[[_0-9, ]*\]), function\*/.test(e)&&(e=e.split(/__async\((?:this|null),/)[1]);const o=e.match(/[^(]*\(([^)]*)/);if(!o)return[];const i=H(o[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,""),r=H(s).map(u=>u.replace(/:.*|=.*/g,"")),c=r.at(-1);if(c&&c.startsWith("..."))throw new Error(`Rest parameters are not supported in fixtures, received "${c}".`);return r}function H(t){const e=[],o=[];let i=0;for(let s=0;s<t.length;s++)if(t[s]==="{"||t[s]==="[")o.push(t[s]==="{"?"}":"]");else if(t[s]===o[o.length-1])o.pop();else if(!o.length&&t[s]===","){const r=t.substring(i,s).trim();r&&e.push(r),i=s+1}const n=t.substring(i).trim();return n&&e.push(n),e}function ie(t,e){function o(n){const s=function(...r){return e.apply(n,r)};Object.assign(s,e),s.withContext=()=>s.bind(n),s.setContext=(r,c)=>{n[r]=c},s.mergeContext=r=>{Object.assign(n,r)};for(const r of t)Object.defineProperty(s,r,{get(){return o({...n,[r]:!0})}});return s}const i=o({});return i.fn=e,i}const F=je();D(function(t,e,o){W().test.fn.call(this,_(t),e,o)});let b,se,Ce;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 _e(){return Ce}function Ee(){return ce(b,"the runner"),b}function W(){const t=E.currentSuite||se;return ce(t,"the current suite"),t}function Ae(){return{beforeAll:[],afterAll:[],beforeEach:[],afterEach:[]}}function A(t,e){let o={},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"),o=e}else typeof e=="number"?o={timeout:e}:typeof t=="object"&&(o=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:o,handler:i}}function Se(t,e=()=>{},o,i,n,s){const r=[];let c;h();const u=function(v="",f={}){var g;const w=f?.timeout??b.config.testTimeout,k={id:"",name:v,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)&&(k.concurrent=!0),k.shuffle=n?.shuffle;const x=Ne(k,b);Object.defineProperty(k,"context",{value:x,enumerable:!1}),me(x,f.fixtures);const ae=Error.stackTraceLimit;Error.stackTraceLimit=15;const U=new Error("STACK_TRACE_ERROR");if(Error.stackTraceLimit=ae,j&&ge(k,N(Fe(ke(b,j,x),k),w,!1,U,(K,I)=>Me([x],I))),b.config.includeTaskLocation){const K=U.stack,I=Ie(K);I&&(k.location=I)}return r.push(k),k},a=D(function(v,f,g){let{options:w,handler:k}=A(f,g);typeof n=="object"&&(w=Object.assign({},n,w)),w.concurrent=this.concurrent||!this.sequential&&w?.concurrent,w.sequential=this.sequential||!this.concurrent&&w?.sequential;const j=u(_(v),{...this,...w,handler:k});j.type="test"});let l=s;const p={type:"collector",name:t,mode:o,suite:c,options:n,test:a,tasks:r,collect:y,task:u,clear:m,on:d,fixtures(){return l},scoped(v){const f=ne(v,{fixtures:l},b);f.fixtures&&(l=f.fixtures)}};function d(v,...f){we(c)[v].push(...f)}function h(v){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:o,each:i,file:void 0,shuffle:n?.shuffle,tasks:[],meta:Object.create(null),concurrent:n?.concurrent},ye(c,Ae())}function m(){r.length=0,h()}async function y(v){if(!v)throw new TypeError("File is required to collect tasks.");e&&await qe(p,()=>e(a));const f=[];for(const g of r)f.push(g.type==="collector"?await g.collect(v):g);return c.file=v,c.tasks=f,f.forEach(g=>{g.file=v}),c}return $e(p),p}function Fe(t,e){return async(...o)=>{const i=await t(...o);if(e.promises){const s=(await Promise.allSettled(e.promises)).map(r=>r.status==="rejected"?r.reason:void 0).filter(Boolean);if(s.length)throw s}return i}}function je(){function t(e,o,i){var n;const s=this.only?"only":this.skip?"skip":this.todo?"todo":"run",r=E.currentSuite||se;let{options:c,handler:u}=A(o,i);const a=c.concurrent||this.concurrent||c.sequential===!1,l=c.sequential||this.sequential||c.concurrent===!1;c={...r?.options,...c,shuffle:this.shuffle??c.shuffle??(r==null||(n=r.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,Se(_(e),u,s,this.each,c,r?.fixtures())}return t.each=function(e,...o){const i=this.withContext();return this.setContext("each",!0),Array.isArray(e)&&o.length&&(e=$(e,o)),(n,s,r)=>{const c=_(n),u=e.every(Array.isArray),{options:a,handler:l}=A(s,r),p=typeof s=="function"&&typeof r=="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,...o){return Array.isArray(e)&&o.length&&(e=$(e,o)),(i,n,s)=>{const r=_(i),{options:c,handler:u}=A(n,s);e.forEach((a,l)=>{F(C(r,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 xe(t,e){const o=t;o.each=function(n,...s){const r=this.withContext();return this.setContext("each",!0),Array.isArray(n)&&s.length&&(n=$(n,s)),(c,u,a)=>{const l=_(c),p=n.every(Array.isArray),{options:d,handler:h}=A(u,a),m=typeof u=="function"&&typeof a=="object";n.forEach((y,v)=>{const f=Array.isArray(y)?y:[y];m?p?r(C(l,f,v),()=>h(...f),d):r(C(l,f,v),()=>h(y),d):p?r(C(l,f,v),d,()=>h(...f)):r(C(l,f,v),d,()=>h(y))}),this.setContext("each",void 0)}},o.for=function(n,...s){const r=this.withContext();return Array.isArray(n)&&s.length&&(n=$(n,s)),(c,u,a)=>{const l=_(c),{options:p,handler:d}=A(u,a);n.forEach((h,m)=>{const y=v=>d(h,v);y.__VITEST_FIXTURE_INDEX__=1,y.toString=()=>d.toString(),r(C(l,O(h),m),p,y)})}},o.skipIf=function(n){return n?this.skip:this},o.runIf=function(n){return n?this:this.skip},o.scoped=function(n){W().scoped(n)},o.extend=function(n){const s=ne(n,e||{},b),r=t;return D(function(c,u,a){const p=W().fixtures(),d={...this};p&&(d.fixtures=Te(d.fixtures||[],p));const{handler:h,options:m}=A(u,a),y=m.timeout??void 0;r.call(d,_(c),h,y)},s)};const i=ie(["concurrent","sequential","skip","only","todo","fails"],o);return e&&i.mergeContext(e),i}function D(t,e){return xe(t,e)}function _(t){return typeof t=="string"?t:typeof t=="function"?t.name||"<anonymous>":String(t)}function C(t,e,o){(t.includes("%#")||t.includes("%$"))&&(t=t.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,`${o}`).replace(/%\$/g,`${o+1}`).replace(/__vitest_escaped_%__/g,"%%"));const i=t.split("%").length-1;t.includes("%f")&&(t.match(/%f/g)||[]).forEach((c,u)=>{if(le(e[u])||Object.is(e[u],-0)){let a=0;t=t.replace(/%f/g,l=>(a++,a===u+1?"-%f":l))}});let n=fe(t,...e.slice(0,i));const s=Z(e[0]);return n=n.replace(/\$([$\w.]+)/g,(r,c)=>{const u=/^\d+$/.test(c);if(!s&&!u)return`$${c}`;const a=u?L(e,c):void 0,l=s?L(e[0],c,a):a;return he(l,{truncate:void 0})}),n}function $(t,e){const o=t.join("").trim().replace(/ /g,"").split(`
|
|
2
|
+
`).map(n=>n.split("|"))[0],i=[];for(let n=0;n<Math.floor(e.length/o.length);n++){const s={};for(let r=0;r<o.length;r++)s[o[r]]=e[n*o.length+r];i.push(s)}return i}function Ie(t){const e=_e(),o=t.split(`
|
|
3
|
+
`).slice(1);for(const i of o){const n=Q(i);if(n&&n.file===e)return{line:n.line,column:n.column}}}globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;function Ge(t){const e=[t.name];let o=t;for(;o?.suite;)o=o.suite,o?.name&&e.unshift(o.name);return o!==t.file&&e.unshift(t.file.name),e}globalThis.performance?globalThis.performance.now.bind(globalThis.performance):Date.now;J();const M=new Map,z=[],P=[];function Re(t){if(M.size){var e;const o=Array.from(M).map(([n,s])=>[n,s[0],s[1]]),i=(e=t.onTaskUpdate)===null||e===void 0?void 0:e.call(t,o,z);i&&(P.push(i),i.then(()=>P.splice(P.indexOf(i),1),()=>{})),z.length=0,M.clear()}}async function Pe(t){Re(t),await Promise.all(P)}const G=Date.now,E={currentSuite:null};function $e(t){var e;(e=E.currentSuite)===null||e===void 0||e.tasks.push(t)}async function qe(t,e){const o=E.currentSuite;E.currentSuite=t,await e(),E.currentSuite=o}function N(t,e,o=!1,i,n){if(e<=0||e===Number.POSITIVE_INFINITY)return t;const{setTimeout:s,clearTimeout:r}=J();return function(...u){const a=G(),l=Ee();return l._currentTaskStartTime=a,l._currentTaskTimeout=e,new Promise((p,d)=>{var h;const m=s(()=>{r(m),y()},e);(h=m.unref)===null||h===void 0||h.call(m);function y(){const g=Ve(o,e,i);n?.(u,g),d(g)}function v(g){if(l._currentTaskStartTime=void 0,l._currentTaskTimeout=void 0,r(m),G()-a>=e){y();return}p(g)}function f(g){l._currentTaskStartTime=void 0,l._currentTaskTimeout=void 0,r(m),d(g)}try{const g=t(...u);typeof g=="object"&&g!=null&&typeof g.then=="function"?g.then(v,f):v(g)}catch(g){f(g)}})}}const V=new WeakMap;function Me([t],e){t&&We(t,e)}function We(t,e){const o=V.get(t);o?.abort(e)}function Ne(t,e){var o;const i=function(){throw new Error("done() callback is deprecated, use promise instead")};let n=V.get(i);n||(n=new AbortController,V.set(i,n)),i.signal=n.signal,i.task=t,i.skip=(r,c)=>{if(r!==!1)throw t.result??(t.result={state:"skip"}),t.result.pending=!0,new de("test is skipped; abort execution",t,typeof r=="string"?r:c)};async function s(r,c,u,a){const l={message:r,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=Ke(a.body))}if(c&&(l.location=c),!e.onTestAnnotate)throw new Error("Test runner doesn't support test annotations.");await Pe(e);const p=await e.onTestAnnotate(t,l);return t.annotations.push(p),p}return i.annotate=(r,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"?Y(t,s(r,a,void 0,c)):Y(t,s(r,a,c,u))},i.onTestFailed=(r,c)=>{t.onFailed||(t.onFailed=[]),t.onFailed.push(N(r,c??e.config.hookTimeout,!0,new Error("STACK_TRACE_ERROR"),(u,a)=>n.abort(a)))},i.onTestFinished=(r,c)=>{t.onFinished||(t.onFinished=[]),t.onFinished.push(N(r,c??e.config.hookTimeout,!0,new Error("STACK_TRACE_ERROR"),(u,a)=>n.abort(a)))},((o=e.extendTaskContext)===null||o===void 0?void 0:o.call(e,i))||i}function Ve(t,e,o){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 o?.stack&&(n.stack=o.stack.replace(n.message,o.message)),n}const De=new WeakMap;function Ue(t){const e=De.get(t);if(!e)throw new Error(`Cannot find file context for ${t.name}`);return e}const T=[];for(let t=65;t<91;t++)T.push(String.fromCharCode(t));for(let t=97;t<123;t++)T.push(String.fromCharCode(t));for(let t=0;t<10;t++)T.push(t.toString(10));function Ke(t){let e="";const o=t.byteLength;for(let i=0;i<o;i+=3)if(o===i+1){const n=(t[i]&252)>>2,s=(t[i]&3)<<4;e+=T[n],e+=T[s],e+="=="}else if(o===i+2){const n=(t[i]&252)>>2,s=(t[i]&3)<<4|(t[i+1]&240)>>4,r=(t[i+1]&15)<<2;e+=T[n],e+=T[s],e+=T[r],e+="="}else{const n=(t[i]&252)>>2,s=(t[i]&3)<<4|(t[i+1]&240)>>4,r=(t[i+1]&15)<<2|(t[i+2]&192)>>6,c=t[i+2]&63;e+=T[n],e+=T[s],e+=T[r],e+=T[c]}return e}function Y(t,e){return e=e.finally(()=>{if(!t.promises)return;const o=t.promises.indexOf(e);o!==-1&&t.promises.splice(o,1)}),t.promises||(t.promises=[]),t.promises.push(e),e}export{Ge as E,we as f,ye as h,xe as j,W as l,F as n,ie as r,ge as s};
|