@assistant-ui/react 0.11.52 → 0.11.54
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/README.md +6 -3
- package/dist/augmentations.js +1 -0
- package/dist/augmentations.js.map +1 -1
- package/dist/client/AssistantClient.d.ts +4 -4
- package/dist/client/AssistantClient.d.ts.map +1 -1
- package/dist/client/AssistantClient.js +78 -104
- package/dist/client/AssistantClient.js.map +1 -1
- package/dist/client/EventContext.d.ts +1 -1
- package/dist/client/EventContext.d.ts.map +1 -1
- package/dist/client/EventContext.js +9 -17
- package/dist/client/EventContext.js.map +1 -1
- package/dist/client/ModelContext.d.ts +2 -2
- package/dist/client/ModelContext.d.ts.map +1 -1
- package/dist/client/ModelContext.js +9 -18
- package/dist/client/ModelContext.js.map +1 -1
- package/dist/client/ModelContextClient.d.ts +1 -1
- package/dist/client/ModelContextClient.d.ts.map +1 -1
- package/dist/client/ModelContextClient.js +9 -13
- package/dist/client/ModelContextClient.js.map +1 -1
- package/dist/client/NoOpComposerClient.d.ts +1 -1
- package/dist/client/NoOpComposerClient.d.ts.map +1 -1
- package/dist/client/NoOpComposerClient.js +51 -51
- package/dist/client/NoOpComposerClient.js.map +1 -1
- package/dist/client/ThreadMessageClient.d.ts +2 -2
- package/dist/client/ThreadMessageClient.d.ts.map +1 -1
- package/dist/client/ThreadMessageClient.js +95 -121
- package/dist/client/ThreadMessageClient.js.map +1 -1
- package/dist/client/Tools.d.ts +2 -2
- package/dist/client/Tools.d.ts.map +1 -1
- package/dist/client/Tools.js +54 -58
- package/dist/client/Tools.js.map +1 -1
- package/dist/client/types/Attachment.d.ts +1 -1
- package/dist/client/types/Attachment.d.ts.map +1 -1
- package/dist/client/types/Attachment.js +1 -0
- package/dist/client/types/Attachment.js.map +1 -1
- package/dist/client/types/Composer.d.ts +18 -3
- package/dist/client/types/Composer.d.ts.map +1 -1
- package/dist/client/types/Composer.js +1 -0
- package/dist/client/types/Composer.js.map +1 -1
- package/dist/client/types/Message.d.ts +23 -9
- package/dist/client/types/Message.d.ts.map +1 -1
- package/dist/client/types/Message.js +1 -0
- package/dist/client/types/Message.js.map +1 -1
- package/dist/client/types/ModelContext.d.ts +2 -2
- package/dist/client/types/ModelContext.d.ts.map +1 -1
- package/dist/client/types/ModelContext.js +1 -0
- package/dist/client/types/ModelContext.js.map +1 -1
- package/dist/client/types/Part.d.ts +1 -1
- package/dist/client/types/Part.d.ts.map +1 -1
- package/dist/client/types/Part.js +1 -0
- package/dist/client/types/Part.js.map +1 -1
- package/dist/client/types/Thread.d.ts +7 -7
- package/dist/client/types/Thread.d.ts.map +1 -1
- package/dist/client/types/Thread.js +1 -0
- package/dist/client/types/Thread.js.map +1 -1
- package/dist/client/types/ThreadList.d.ts +2 -2
- package/dist/client/types/ThreadList.d.ts.map +1 -1
- package/dist/client/types/ThreadList.js +1 -0
- package/dist/client/types/ThreadList.js.map +1 -1
- package/dist/client/types/ThreadListItem.d.ts +1 -1
- package/dist/client/types/ThreadListItem.d.ts.map +1 -1
- package/dist/client/types/ThreadListItem.js +1 -0
- package/dist/client/types/ThreadListItem.js.map +1 -1
- package/dist/client/types/Tools.d.ts +1 -1
- package/dist/client/types/Tools.d.ts.map +1 -1
- package/dist/client/types/Tools.js +1 -0
- package/dist/client/types/Tools.js.map +1 -1
- package/dist/client/util-hooks/tapLookupResources.d.ts +1 -1
- package/dist/client/util-hooks/tapLookupResources.d.ts.map +1 -1
- package/dist/client/util-hooks/tapLookupResources.js +23 -27
- package/dist/client/util-hooks/tapLookupResources.js.map +1 -1
- package/dist/context/ReadonlyStore.js +2 -6
- package/dist/context/ReadonlyStore.js.map +1 -1
- package/dist/context/index.d.ts +3 -3
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +0 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/providers/AttachmentByIndexProvider.js +22 -32
- package/dist/context/providers/AttachmentByIndexProvider.js.map +1 -1
- package/dist/context/providers/MessageByIndexProvider.js +30 -41
- package/dist/context/providers/MessageByIndexProvider.js.map +1 -1
- package/dist/context/providers/MessageProvider.d.ts +1 -1
- package/dist/context/providers/MessageProvider.d.ts.map +1 -1
- package/dist/context/providers/MessageProvider.js +14 -24
- package/dist/context/providers/MessageProvider.js.map +1 -1
- package/dist/context/providers/PartByIndexProvider.js +12 -21
- package/dist/context/providers/PartByIndexProvider.js.map +1 -1
- package/dist/context/providers/TextMessagePartProvider.js +25 -40
- package/dist/context/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/context/providers/ThreadListItemProvider.js +45 -57
- package/dist/context/providers/ThreadListItemProvider.js.map +1 -1
- package/dist/context/providers/ThreadViewportProvider.d.ts +1 -1
- package/dist/context/providers/ThreadViewportProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadViewportProvider.js +40 -47
- package/dist/context/providers/ThreadViewportProvider.js.map +1 -1
- package/dist/context/providers/index.d.ts +7 -7
- package/dist/context/providers/index.d.ts.map +1 -1
- package/dist/context/providers/index.js +7 -25
- package/dist/context/providers/index.js.map +1 -1
- package/dist/context/react/AssistantApiContext.d.ts +13 -13
- package/dist/context/react/AssistantApiContext.d.ts.map +1 -1
- package/dist/context/react/AssistantApiContext.js +144 -154
- package/dist/context/react/AssistantApiContext.js.map +1 -1
- package/dist/context/react/ThreadViewportContext.d.ts +2 -2
- package/dist/context/react/ThreadViewportContext.d.ts.map +1 -1
- package/dist/context/react/ThreadViewportContext.js +3 -13
- package/dist/context/react/ThreadViewportContext.js.map +1 -1
- package/dist/context/react/hooks/useAssistantEvent.d.ts +1 -1
- package/dist/context/react/hooks/useAssistantEvent.d.ts.map +1 -1
- package/dist/context/react/hooks/useAssistantEvent.js +9 -18
- package/dist/context/react/hooks/useAssistantEvent.js.map +1 -1
- package/dist/context/react/hooks/useAssistantState.d.ts +1 -1
- package/dist/context/react/hooks/useAssistantState.d.ts.map +1 -1
- package/dist/context/react/hooks/useAssistantState.js +39 -51
- package/dist/context/react/hooks/useAssistantState.js.map +1 -1
- package/dist/context/react/index.d.ts +12 -12
- package/dist/context/react/index.d.ts.map +1 -1
- package/dist/context/react/index.js +14 -82
- package/dist/context/react/index.js.map +1 -1
- package/dist/context/react/utils/createContextHook.js +14 -13
- package/dist/context/react/utils/createContextHook.js.map +1 -1
- package/dist/context/react/utils/createContextStoreHook.d.ts +1 -1
- package/dist/context/react/utils/createContextStoreHook.d.ts.map +1 -1
- package/dist/context/react/utils/createContextStoreHook.js +34 -28
- package/dist/context/react/utils/createContextStoreHook.js.map +1 -1
- package/dist/context/react/utils/createStateHookForRuntime.d.ts +1 -1
- package/dist/context/react/utils/createStateHookForRuntime.d.ts.map +1 -1
- package/dist/context/react/utils/createStateHookForRuntime.js +18 -21
- package/dist/context/react/utils/createStateHookForRuntime.js.map +1 -1
- package/dist/context/react/utils/ensureBinding.d.ts.map +1 -1
- package/dist/context/react/utils/ensureBinding.js +28 -8
- package/dist/context/react/utils/ensureBinding.js.map +1 -1
- package/dist/context/react/utils/useRuntimeState.d.ts +1 -1
- package/dist/context/react/utils/useRuntimeState.d.ts.map +1 -1
- package/dist/context/react/utils/useRuntimeState.js +11 -17
- package/dist/context/react/utils/useRuntimeState.js.map +1 -1
- package/dist/context/stores/ThreadViewport.d.ts +1 -1
- package/dist/context/stores/ThreadViewport.d.ts.map +1 -1
- package/dist/context/stores/ThreadViewport.js +73 -78
- package/dist/context/stores/ThreadViewport.js.map +1 -1
- package/dist/context/stores/index.d.ts +1 -1
- package/dist/context/stores/index.d.ts.map +1 -1
- package/dist/context/stores/index.js +1 -0
- package/dist/context/stores/index.js.map +1 -1
- package/dist/devtools/DevToolsHooks.d.ts +2 -2
- package/dist/devtools/DevToolsHooks.d.ts.map +1 -1
- package/dist/devtools/DevToolsHooks.js +93 -98
- package/dist/devtools/DevToolsHooks.js.map +1 -1
- package/dist/devtools/index.d.ts +1 -1
- package/dist/devtools/index.d.ts.map +1 -1
- package/dist/devtools/index.js +1 -5
- package/dist/devtools/index.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +14 -14
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +11 -29
- package/dist/internal.js.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.js +11 -23
- package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.d.ts +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.js +9 -15
- package/dist/legacy-runtime/RuntimeAdapter.js.map +1 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts +2 -2
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js +7 -16
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts +2 -2
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js +68 -84
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.d.ts +2 -2
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.js +40 -40
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts +2 -2
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js +9 -13
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts +2 -2
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.js +55 -89
- package/dist/legacy-runtime/client/MessageRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts +2 -2
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js +26 -32
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts +3 -3
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js +45 -63
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts +2 -2
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js +78 -103
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js +110 -114
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.d.ts +3 -3
- package/dist/legacy-runtime/cloud/auiV0.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.js +80 -83
- package/dist/legacy-runtime/cloud/auiV0.js.map +1 -1
- package/dist/legacy-runtime/cloud/index.d.ts +1 -1
- package/dist/legacy-runtime/cloud/index.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/index.js +2 -7
- package/dist/legacy-runtime/cloud/index.js.map +1 -1
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.d.ts +1 -1
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js +8 -16
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js.map +1 -1
- package/dist/legacy-runtime/hooks/AssistantContext.d.ts +3 -3
- package/dist/legacy-runtime/hooks/AssistantContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/AssistantContext.js +12 -15
- package/dist/legacy-runtime/hooks/AssistantContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/AttachmentContext.d.ts +3 -3
- package/dist/legacy-runtime/hooks/AttachmentContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/AttachmentContext.js +37 -55
- package/dist/legacy-runtime/hooks/AttachmentContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/ComposerContext.d.ts +3 -3
- package/dist/legacy-runtime/hooks/ComposerContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/ComposerContext.js +52 -16
- package/dist/legacy-runtime/hooks/ComposerContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/MessageContext.d.ts +4 -4
- package/dist/legacy-runtime/hooks/MessageContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/MessageContext.js +53 -21
- package/dist/legacy-runtime/hooks/MessageContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/MessagePartContext.d.ts +3 -3
- package/dist/legacy-runtime/hooks/MessagePartContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/MessagePartContext.js +11 -16
- package/dist/legacy-runtime/hooks/MessagePartContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadContext.d.ts +6 -6
- package/dist/legacy-runtime/hooks/ThreadContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadContext.js +49 -33
- package/dist/legacy-runtime/hooks/ThreadContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadListItemContext.d.ts +3 -3
- package/dist/legacy-runtime/hooks/ThreadListItemContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadListItemContext.js +13 -18
- package/dist/legacy-runtime/hooks/ThreadListItemContext.js.map +1 -1
- package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts +6 -6
- package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/AssistantRuntime.js +43 -44
- package/dist/legacy-runtime/runtime/AssistantRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts +4 -4
- package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/AttachmentRuntime.js +55 -59
- package/dist/legacy-runtime/runtime/AttachmentRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts +23 -7
- package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ComposerRuntime.js +232 -219
- package/dist/legacy-runtime/runtime/ComposerRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/MessagePartRuntime.d.ts +6 -6
- package/dist/legacy-runtime/runtime/MessagePartRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/MessagePartRuntime.js +65 -63
- package/dist/legacy-runtime/runtime/MessagePartRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/MessageRuntime.d.ts +10 -10
- package/dist/legacy-runtime/runtime/MessageRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/MessageRuntime.js +191 -203
- package/dist/legacy-runtime/runtime/MessageRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts +7 -7
- package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/RuntimeBindings.js +1 -0
- package/dist/legacy-runtime/runtime/RuntimeBindings.js.map +1 -1
- package/dist/legacy-runtime/runtime/RuntimePathTypes.js +1 -0
- package/dist/legacy-runtime/runtime/RuntimePathTypes.js.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts +5 -5
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js +87 -84
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListRuntime.d.ts +4 -4
- package/dist/legacy-runtime/runtime/ThreadListRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListRuntime.js +133 -161
- package/dist/legacy-runtime/runtime/ThreadListRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts +15 -12
- package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadRuntime.js +221 -236
- package/dist/legacy-runtime/runtime/ThreadRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/index.d.ts +8 -8
- package/dist/legacy-runtime/runtime/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/index.js +1 -0
- package/dist/legacy-runtime/runtime/index.js.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.d.ts +1 -1
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.js +29 -30
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.js.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.d.ts +3 -3
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.js +35 -35
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.js.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.d.ts +3 -3
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.js +29 -32
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.js.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.d.ts +3 -3
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.js +37 -39
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.js.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.js +1 -5
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.js.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.d.ts +3 -3
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.js +36 -36
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.js.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.d.ts +1 -1
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.js +1 -0
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.js.map +1 -1
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.js +14 -14
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.js +11 -26
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.js +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.js +78 -78
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.js +69 -69
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.js +33 -36
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.js +33 -38
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.d.ts +5 -5
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.js +4 -11
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.js +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/index.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/index.js +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/index.d.ts +6 -6
- package/dist/legacy-runtime/runtime-cores/adapters/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/index.js +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.d.ts +26 -4
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.js +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.d.ts +61 -0
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.js +152 -0
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.js.map +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.js +41 -42
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.d.ts +3 -2
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.js +2 -5
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.js +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/index.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/index.js +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.js +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.js +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.js +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.js +42 -46
- package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/index.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/assistant-transport/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/index.js +1 -11
- package/dist/legacy-runtime/runtime-cores/assistant-transport/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.js +55 -54
- package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts +4 -4
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.js +2 -0
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +218 -230
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.js +2 -9
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useLatestRef.js +6 -10
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useLatestRef.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js +191 -214
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.js +20 -27
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts +21 -6
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js +309 -159
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts +7 -4
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.js +46 -44
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts +8 -5
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.js +39 -39
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.js +1 -0
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts +5 -5
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.js +9 -13
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts +10 -10
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js +154 -158
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts +36 -2
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.js +1 -0
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.js +1 -0
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts +10 -9
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.js +1 -0
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/index.d.ts +2 -1
- package/dist/legacy-runtime/runtime-cores/core/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/index.js +1 -0
- package/dist/legacy-runtime/runtime-cores/core/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts +8 -7
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.js +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.js +14 -20
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts +4 -4
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.js +171 -171
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts +9 -8
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js +242 -243
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.js +11 -15
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js +120 -130
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.js +30 -49
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js +45 -57
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js +216 -251
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.js +20 -21
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/index.d.ts +6 -6
- package/dist/legacy-runtime/runtime-cores/external-store/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/index.js +4 -19
- package/dist/legacy-runtime/runtime-cores/external-store/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.js +13 -19
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/index.d.ts +7 -7
- package/dist/legacy-runtime/runtime-cores/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/index.js +1 -5
- package/dist/legacy-runtime/runtime-cores/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.js +1 -0
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts +4 -4
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.js +16 -18
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts +10 -8
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.js +12 -23
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.js +84 -88
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts +8 -6
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js +365 -333
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/index.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/local/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/index.js +1 -5
- package/dist/legacy-runtime/runtime-cores/local/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.js +12 -11
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js +35 -42
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.js +32 -34
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.js +130 -129
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.js +53 -56
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js +92 -102
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +4 -4
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js +467 -452
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js +82 -98
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.js +28 -32
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.d.ts +4 -4
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.js +3 -9
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.js +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js +29 -36
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.js +369 -369
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.js.map +1 -1
- package/dist/legacy-runtime/util-hooks/tapSubscribable.d.ts +1 -1
- package/dist/legacy-runtime/util-hooks/tapSubscribable.d.ts.map +1 -1
- package/dist/legacy-runtime/util-hooks/tapSubscribable.js +9 -13
- package/dist/legacy-runtime/util-hooks/tapSubscribable.js.map +1 -1
- package/dist/model-context/ModelContextTypes.d.ts +1 -1
- package/dist/model-context/ModelContextTypes.d.ts.map +1 -1
- package/dist/model-context/ModelContextTypes.js +38 -41
- package/dist/model-context/ModelContextTypes.js.map +1 -1
- package/dist/model-context/frame/AssistantFrameHost.d.ts +2 -2
- package/dist/model-context/frame/AssistantFrameHost.d.ts.map +1 -1
- package/dist/model-context/frame/AssistantFrameHost.js +156 -146
- package/dist/model-context/frame/AssistantFrameHost.js.map +1 -1
- package/dist/model-context/frame/AssistantFrameProvider.d.ts +2 -2
- package/dist/model-context/frame/AssistantFrameProvider.d.ts.map +1 -1
- package/dist/model-context/frame/AssistantFrameProvider.js +155 -135
- package/dist/model-context/frame/AssistantFrameProvider.js.map +1 -1
- package/dist/model-context/frame/AssistantFrameTypes.js +1 -5
- package/dist/model-context/frame/AssistantFrameTypes.js.map +1 -1
- package/dist/model-context/frame/index.d.ts +4 -4
- package/dist/model-context/frame/index.d.ts.map +1 -1
- package/dist/model-context/frame/index.js +0 -1
- package/dist/model-context/frame/index.js.map +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.d.ts +2 -2
- package/dist/model-context/frame/useAssistantFrameHost.d.ts.map +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.js +29 -20
- package/dist/model-context/frame/useAssistantFrameHost.js.map +1 -1
- package/dist/model-context/index.d.ts +13 -13
- package/dist/model-context/index.d.ts.map +1 -1
- package/dist/model-context/index.js +9 -25
- package/dist/model-context/index.js.map +1 -1
- package/dist/model-context/makeAssistantTool.d.ts +1 -1
- package/dist/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/model-context/makeAssistantTool.js +7 -12
- package/dist/model-context/makeAssistantTool.js.map +1 -1
- package/dist/model-context/makeAssistantToolUI.d.ts +1 -1
- package/dist/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/model-context/makeAssistantToolUI.js +8 -15
- package/dist/model-context/makeAssistantToolUI.js.map +1 -1
- package/dist/model-context/makeAssistantVisible.js +80 -97
- package/dist/model-context/makeAssistantVisible.js.map +1 -1
- package/dist/model-context/registry/ModelContextRegistry.d.ts +5 -5
- package/dist/model-context/registry/ModelContextRegistry.d.ts.map +1 -1
- package/dist/model-context/registry/ModelContextRegistry.js +106 -109
- package/dist/model-context/registry/ModelContextRegistry.js.map +1 -1
- package/dist/model-context/registry/ModelContextRegistryHandles.d.ts +2 -2
- package/dist/model-context/registry/ModelContextRegistryHandles.d.ts.map +1 -1
- package/dist/model-context/registry/ModelContextRegistryHandles.js +1 -0
- package/dist/model-context/registry/ModelContextRegistryHandles.js.map +1 -1
- package/dist/model-context/registry/index.d.ts +2 -2
- package/dist/model-context/registry/index.d.ts.map +1 -1
- package/dist/model-context/registry/index.js +0 -1
- package/dist/model-context/registry/index.js.map +1 -1
- package/dist/model-context/tool.js +3 -6
- package/dist/model-context/tool.js.map +1 -1
- package/dist/model-context/toolbox.d.ts +1 -1
- package/dist/model-context/toolbox.d.ts.map +1 -1
- package/dist/model-context/toolbox.js +1 -0
- package/dist/model-context/toolbox.js.map +1 -1
- package/dist/model-context/useAssistantInstructions.js +17 -20
- package/dist/model-context/useAssistantInstructions.js.map +1 -1
- package/dist/model-context/useAssistantTool.d.ts +1 -1
- package/dist/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/model-context/useAssistantTool.js +18 -22
- package/dist/model-context/useAssistantTool.js.map +1 -1
- package/dist/model-context/useAssistantToolUI.d.ts +1 -1
- package/dist/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/model-context/useAssistantToolUI.js +7 -11
- package/dist/model-context/useAssistantToolUI.js.map +1 -1
- package/dist/model-context/useInlineRender.d.ts +1 -1
- package/dist/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/model-context/useInlineRender.js +11 -21
- package/dist/model-context/useInlineRender.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.d.ts +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js +64 -40
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.d.ts +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js +45 -20
- package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.d.ts +1 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js +33 -46
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +15 -31
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +15 -31
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.d.ts +1 -1
- package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js +48 -22
- package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarRoot.js +33 -25
- package/dist/primitives/actionBar/ActionBarRoot.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.js +14 -22
- package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js +22 -34
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
- package/dist/primitives/actionBar/index.d.ts +9 -9
- package/dist/primitives/actionBar/index.d.ts.map +1 -1
- package/dist/primitives/actionBar/index.js +9 -21
- package/dist/primitives/actionBar/index.js.map +1 -1
- package/dist/primitives/actionBar/useActionBarFloatStatus.js +23 -26
- package/dist/primitives/actionBar/useActionBarFloatStatus.js.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreContent.d.ts +12 -0
- package/dist/primitives/actionBarMore/ActionBarMoreContent.d.ts.map +1 -0
- package/dist/primitives/actionBarMore/ActionBarMoreContent.js +11 -0
- package/dist/primitives/actionBarMore/ActionBarMoreContent.js.map +1 -0
- package/dist/primitives/actionBarMore/ActionBarMoreItem.d.ts +8 -0
- package/dist/primitives/actionBarMore/ActionBarMoreItem.d.ts.map +1 -0
- package/dist/primitives/actionBarMore/ActionBarMoreItem.js +11 -0
- package/dist/primitives/actionBarMore/ActionBarMoreItem.js.map +1 -0
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.d.ts +7 -0
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.d.ts.map +1 -0
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.js +10 -0
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.js.map +1 -0
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.d.ts +8 -0
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.d.ts.map +1 -0
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.js +12 -0
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.js.map +1 -0
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.d.ts +8 -0
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.d.ts.map +1 -0
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.js +11 -0
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.js.map +1 -0
- package/dist/primitives/actionBarMore/index.d.ts +6 -0
- package/dist/primitives/actionBarMore/index.d.ts.map +1 -0
- package/dist/primitives/actionBarMore/index.js +6 -0
- package/dist/primitives/actionBarMore/index.js.map +1 -0
- package/dist/primitives/actionBarMore/scope.d.ts +7 -0
- package/dist/primitives/actionBarMore/scope.d.ts.map +1 -0
- package/dist/primitives/actionBarMore/scope.js +3 -0
- package/dist/primitives/actionBarMore/scope.js.map +1 -0
- package/dist/primitives/assistant/AssistantIf.d.ts +1 -1
- package/dist/primitives/assistant/AssistantIf.d.ts.map +1 -1
- package/dist/primitives/assistant/AssistantIf.js +5 -10
- package/dist/primitives/assistant/AssistantIf.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalAnchor.js +4 -14
- package/dist/primitives/assistantModal/AssistantModalAnchor.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.js +4 -32
- package/dist/primitives/assistantModal/AssistantModalContent.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.js +24 -46
- package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.js +4 -13
- package/dist/primitives/assistantModal/AssistantModalTrigger.js.map +1 -1
- package/dist/primitives/assistantModal/index.d.ts +4 -4
- package/dist/primitives/assistantModal/index.d.ts.map +1 -1
- package/dist/primitives/assistantModal/index.js +4 -11
- package/dist/primitives/assistantModal/index.js.map +1 -1
- package/dist/primitives/assistantModal/scope.js +1 -5
- package/dist/primitives/assistantModal/scope.js.map +1 -1
- package/dist/primitives/attachment/AttachmentName.js +4 -9
- package/dist/primitives/attachment/AttachmentName.js.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.d.ts +1 -1
- package/dist/primitives/attachment/AttachmentRemove.d.ts.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.js +8 -18
- package/dist/primitives/attachment/AttachmentRemove.js.map +1 -1
- package/dist/primitives/attachment/AttachmentRoot.js +17 -8
- package/dist/primitives/attachment/AttachmentRoot.js.map +1 -1
- package/dist/primitives/attachment/AttachmentThumb.js +7 -15
- package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
- package/dist/primitives/attachment/index.d.ts +4 -4
- package/dist/primitives/attachment/index.d.ts.map +1 -1
- package/dist/primitives/attachment/index.js +4 -11
- package/dist/primitives/attachment/index.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.js +20 -12
- package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.js +33 -26
- package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.js +7 -12
- package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.js +54 -26
- package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerRoot.js +20 -8
- package/dist/primitives/branchPicker/BranchPickerRoot.js.map +1 -1
- package/dist/primitives/branchPicker/index.d.ts +5 -5
- package/dist/primitives/branchPicker/index.d.ts.map +1 -1
- package/dist/primitives/branchPicker/index.js +5 -13
- package/dist/primitives/branchPicker/index.js.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +34 -45
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachmentDropzone.js +50 -69
- package/dist/primitives/composer/ComposerAttachmentDropzone.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.js +55 -52
- package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/primitives/composer/ComposerCancel.d.ts +1 -1
- package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerCancel.js +24 -20
- package/dist/primitives/composer/ComposerCancel.js.map +1 -1
- package/dist/primitives/composer/ComposerDictate.d.ts +23 -0
- package/dist/primitives/composer/ComposerDictate.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerDictate.js +30 -0
- package/dist/primitives/composer/ComposerDictate.js.map +1 -0
- package/dist/primitives/composer/ComposerDictationTranscript.d.ts +25 -0
- package/dist/primitives/composer/ComposerDictationTranscript.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerDictationTranscript.js +29 -0
- package/dist/primitives/composer/ComposerDictationTranscript.js.map +1 -0
- package/dist/primitives/composer/ComposerIf.d.ts +4 -1
- package/dist/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerIf.js +19 -17
- package/dist/primitives/composer/ComposerIf.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerInput.js +81 -91
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/ComposerRoot.js +26 -24
- package/dist/primitives/composer/ComposerRoot.js.map +1 -1
- package/dist/primitives/composer/ComposerSend.d.ts +1 -1
- package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerSend.js +25 -23
- package/dist/primitives/composer/ComposerSend.js.map +1 -1
- package/dist/primitives/composer/ComposerStopDictation.d.ts +23 -0
- package/dist/primitives/composer/ComposerStopDictation.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerStopDictation.js +28 -0
- package/dist/primitives/composer/ComposerStopDictation.js.map +1 -0
- package/dist/primitives/composer/index.d.ts +12 -9
- package/dist/primitives/composer/index.d.ts.map +1 -1
- package/dist/primitives/composer/index.js +12 -21
- package/dist/primitives/composer/index.js.map +1 -1
- package/dist/primitives/error/ErrorMessage.js +11 -12
- package/dist/primitives/error/ErrorMessage.js.map +1 -1
- package/dist/primitives/error/ErrorRoot.js +3 -8
- package/dist/primitives/error/ErrorRoot.js.map +1 -1
- package/dist/primitives/error/index.d.ts +2 -2
- package/dist/primitives/error/index.d.ts.map +1 -1
- package/dist/primitives/error/index.js +2 -7
- package/dist/primitives/error/index.js.map +1 -1
- package/dist/primitives/index.d.ts +22 -20
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +22 -43
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/message/MessageAttachments.js +59 -53
- package/dist/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/primitives/message/MessageError.js +4 -10
- package/dist/primitives/message/MessageError.js.map +1 -1
- package/dist/primitives/message/MessageIf.d.ts +1 -1
- package/dist/primitives/message/MessageIf.d.ts.map +1 -1
- package/dist/primitives/message/MessageIf.js +46 -43
- package/dist/primitives/message/MessageIf.js.map +1 -1
- package/dist/primitives/message/MessageParts.d.ts +1 -1
- package/dist/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/primitives/message/MessageParts.js +208 -242
- package/dist/primitives/message/MessageParts.js.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.d.ts +1 -1
- package/dist/primitives/message/MessagePartsGrouped.d.ts.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.js +184 -181
- package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
- package/dist/primitives/message/MessageRoot.js +66 -57
- package/dist/primitives/message/MessageRoot.js.map +1 -1
- package/dist/primitives/message/index.d.ts +9 -9
- package/dist/primitives/message/index.d.ts.map +1 -1
- package/dist/primitives/message/index.js +9 -25
- package/dist/primitives/message/index.js.map +1 -1
- package/dist/primitives/messagePart/MessagePartImage.js +19 -9
- package/dist/primitives/messagePart/MessagePartImage.js.map +1 -1
- package/dist/primitives/messagePart/MessagePartInProgress.js +4 -10
- package/dist/primitives/messagePart/MessagePartInProgress.js.map +1 -1
- package/dist/primitives/messagePart/MessagePartText.js +21 -12
- package/dist/primitives/messagePart/MessagePartText.js.map +1 -1
- package/dist/primitives/messagePart/index.d.ts +3 -3
- package/dist/primitives/messagePart/index.d.ts.map +1 -1
- package/dist/primitives/messagePart/index.js +3 -9
- package/dist/primitives/messagePart/index.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartData.d.ts +1 -1
- package/dist/primitives/messagePart/useMessagePartData.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartData.js +13 -18
- package/dist/primitives/messagePart/useMessagePartData.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.d.ts +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.js +7 -14
- package/dist/primitives/messagePart/useMessagePartFile.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.d.ts +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.js +7 -14
- package/dist/primitives/messagePart/useMessagePartImage.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.d.ts +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.js +7 -14
- package/dist/primitives/messagePart/useMessagePartReasoning.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.d.ts +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.js +7 -14
- package/dist/primitives/messagePart/useMessagePartSource.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartText.d.ts +1 -1
- package/dist/primitives/messagePart/useMessagePartText.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartText.js +7 -14
- package/dist/primitives/messagePart/useMessagePartText.js.map +1 -1
- package/dist/primitives/reasoning/index.d.ts +1 -1
- package/dist/primitives/reasoning/index.d.ts.map +1 -1
- package/dist/primitives/reasoning/index.js +1 -5
- package/dist/primitives/reasoning/index.js.map +1 -1
- package/dist/primitives/reasoning/useScrollLock.js +69 -46
- package/dist/primitives/reasoning/useScrollLock.js.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.js +3 -12
- package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadIf.js +22 -21
- package/dist/primitives/thread/ThreadIf.js.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js +100 -72
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread/ThreadRoot.js +18 -8
- package/dist/primitives/thread/ThreadRoot.js.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.js +12 -27
- package/dist/primitives/thread/ThreadScrollToBottom.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.js +31 -41
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
- package/dist/primitives/thread/ThreadViewport.js +31 -33
- package/dist/primitives/thread/ThreadViewport.js.map +1 -1
- package/dist/primitives/thread/ThreadViewportFooter.js +32 -19
- package/dist/primitives/thread/ThreadViewportFooter.js.map +1 -1
- package/dist/primitives/thread/ThreadViewportSlack.js +67 -70
- package/dist/primitives/thread/ThreadViewportSlack.js.map +1 -1
- package/dist/primitives/thread/index.d.ts +11 -11
- package/dist/primitives/thread/index.d.ts.map +1 -1
- package/dist/primitives/thread/index.js +11 -25
- package/dist/primitives/thread/index.js.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js +84 -79
- package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.js +29 -36
- package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.d.ts +1 -1
- package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.js +7 -24
- package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
- package/dist/primitives/threadList/ThreadListRoot.js +3 -8
- package/dist/primitives/threadList/ThreadListRoot.js.map +1 -1
- package/dist/primitives/threadList/index.d.ts +4 -4
- package/dist/primitives/threadList/index.d.ts.map +1 -1
- package/dist/primitives/threadList/index.js +4 -11
- package/dist/primitives/threadList/index.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.js +7 -17
- package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.js +7 -17
- package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +4 -18
- package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTitle.js +4 -9
- package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js +7 -17
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +7 -17
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -1
- package/dist/primitives/threadListItem/index.d.ts +6 -6
- package/dist/primitives/threadListItem/index.d.ts.map +1 -1
- package/dist/primitives/threadListItem/index.js +6 -15
- package/dist/primitives/threadListItem/index.js.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.d.ts +12 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.d.ts.map +1 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js +12 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js.map +1 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.d.ts +8 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.d.ts.map +1 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.js +12 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.js.map +1 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts +7 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts.map +1 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js +11 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js.map +1 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.d.ts +8 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.d.ts.map +1 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.js +12 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.js.map +1 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.d.ts +8 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.d.ts.map +1 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js +12 -0
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js.map +1 -0
- package/dist/primitives/threadListItemMore/index.d.ts +6 -0
- package/dist/primitives/threadListItemMore/index.d.ts.map +1 -0
- package/dist/primitives/threadListItemMore/index.js +6 -0
- package/dist/primitives/threadListItemMore/index.js.map +1 -0
- package/dist/primitives/threadListItemMore/scope.d.ts +7 -0
- package/dist/primitives/threadListItemMore/scope.d.ts.map +1 -0
- package/dist/primitives/threadListItemMore/scope.js +3 -0
- package/dist/primitives/threadListItemMore/scope.js.map +1 -0
- package/dist/tests/setup.js +4 -2717
- package/dist/tests/setup.js.map +1 -1
- package/dist/types/AssistantTypes.d.ts +2 -2
- package/dist/types/AssistantTypes.d.ts.map +1 -1
- package/dist/types/AssistantTypes.js +1 -0
- package/dist/types/AssistantTypes.js.map +1 -1
- package/dist/types/AttachmentTypes.d.ts +1 -1
- package/dist/types/AttachmentTypes.d.ts.map +1 -1
- package/dist/types/AttachmentTypes.js +1 -0
- package/dist/types/AttachmentTypes.js.map +1 -1
- package/dist/types/EventTypes.js +12 -17
- package/dist/types/EventTypes.js.map +1 -1
- package/dist/types/MessagePartComponentTypes.d.ts +2 -2
- package/dist/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/types/MessagePartComponentTypes.js +1 -0
- package/dist/types/MessagePartComponentTypes.js.map +1 -1
- package/dist/types/MessagePartTypes.d.ts +1 -1
- package/dist/types/MessagePartTypes.d.ts.map +1 -1
- package/dist/types/MessagePartTypes.js +1 -0
- package/dist/types/MessagePartTypes.js.map +1 -1
- package/dist/types/Unsubscribe.js +1 -0
- package/dist/types/Unsubscribe.js.map +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/CompositeContextProvider.d.ts +1 -1
- package/dist/utils/CompositeContextProvider.d.ts.map +1 -1
- package/dist/utils/CompositeContextProvider.js +28 -33
- package/dist/utils/CompositeContextProvider.js.map +1 -1
- package/dist/utils/RequireAtLeastOne.js +1 -0
- package/dist/utils/RequireAtLeastOne.js.map +1 -1
- package/dist/utils/createActionButton.js +18 -32
- package/dist/utils/createActionButton.js.map +1 -1
- package/dist/utils/getThreadMessageText.d.ts +1 -1
- package/dist/utils/getThreadMessageText.d.ts.map +1 -1
- package/dist/utils/getThreadMessageText.js +3 -9
- package/dist/utils/getThreadMessageText.js.map +1 -1
- package/dist/utils/hooks/useManagedRef.js +13 -18
- package/dist/utils/hooks/useManagedRef.js.map +1 -1
- package/dist/utils/hooks/useOnResizeContent.js +22 -29
- package/dist/utils/hooks/useOnResizeContent.js.map +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.js +6 -11
- package/dist/utils/hooks/useOnScrollToBottom.js.map +1 -1
- package/dist/utils/hooks/useSizeHandle.d.ts +1 -1
- package/dist/utils/hooks/useSizeHandle.d.ts.map +1 -1
- package/dist/utils/hooks/useSizeHandle.js +26 -25
- package/dist/utils/hooks/useSizeHandle.js.map +1 -1
- package/dist/utils/idUtils.js +4 -13
- package/dist/utils/idUtils.js.map +1 -1
- package/dist/utils/json/is-json.js +26 -30
- package/dist/utils/json/is-json.js.map +1 -1
- package/dist/utils/smooth/SmoothContext.d.ts +1 -1
- package/dist/utils/smooth/SmoothContext.d.ts.map +1 -1
- package/dist/utils/smooth/SmoothContext.js +25 -43
- package/dist/utils/smooth/SmoothContext.js.map +1 -1
- package/dist/utils/smooth/index.d.ts +2 -2
- package/dist/utils/smooth/index.d.ts.map +1 -1
- package/dist/utils/smooth/index.js +4 -9
- package/dist/utils/smooth/index.js.map +1 -1
- package/dist/utils/smooth/useSmooth.d.ts +2 -2
- package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
- package/dist/utils/smooth/useSmooth.js +98 -99
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/dist/utils/tap-store/derived-scopes.d.ts +3 -3
- package/dist/utils/tap-store/derived-scopes.d.ts.map +1 -1
- package/dist/utils/tap-store/derived-scopes.js +39 -44
- package/dist/utils/tap-store/derived-scopes.js.map +1 -1
- package/dist/utils/tap-store/index.d.ts +3 -3
- package/dist/utils/tap-store/index.d.ts.map +1 -1
- package/dist/utils/tap-store/index.js +3 -11
- package/dist/utils/tap-store/index.js.map +1 -1
- package/dist/utils/tap-store/store.d.ts +1 -1
- package/dist/utils/tap-store/store.d.ts.map +1 -1
- package/dist/utils/tap-store/store.js +6 -20
- package/dist/utils/tap-store/store.js.map +1 -1
- package/dist/utils/tap-store/tap-api.js +46 -55
- package/dist/utils/tap-store/tap-api.js.map +1 -1
- package/dist/utils/useToolArgsFieldStatus.js +10 -16
- package/dist/utils/useToolArgsFieldStatus.js.map +1 -1
- package/package.json +21 -19
- package/src/client/NoOpComposerClient.tsx +8 -1
- package/src/client/types/Composer.ts +21 -4
- package/src/client/types/Message.ts +17 -3
- package/src/context/react/utils/ensureBinding.ts +3 -2
- package/src/legacy-runtime/client/ComposerRuntimeClient.ts +4 -0
- package/src/legacy-runtime/hooks/AssistantContext.ts +2 -2
- package/src/legacy-runtime/hooks/AttachmentContext.ts +2 -2
- package/src/legacy-runtime/hooks/ComposerContext.ts +2 -2
- package/src/legacy-runtime/hooks/MessageContext.ts +3 -3
- package/src/legacy-runtime/hooks/MessagePartContext.ts +2 -2
- package/src/legacy-runtime/hooks/ThreadContext.ts +4 -4
- package/src/legacy-runtime/hooks/ThreadListItemContext.ts +2 -2
- package/src/legacy-runtime/runtime/ComposerRuntime.ts +51 -14
- package/src/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.ts +26 -3
- package/src/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.ts +255 -0
- package/src/legacy-runtime/runtime-cores/adapters/speech/index.ts +5 -1
- package/src/legacy-runtime/runtime-cores/assistant-transport/types.ts +1 -1
- package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.tsx +5 -1
- package/src/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.tsx +171 -5
- package/src/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.tsx +14 -4
- package/src/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.tsx +15 -5
- package/src/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.tsx +39 -1
- package/src/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.tsx +1 -0
- package/src/legacy-runtime/runtime-cores/core/index.ts +2 -0
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.tsx +11 -7
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.tsx +12 -7
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.tsx +12 -8
- package/src/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.tsx +11 -4
- package/src/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.tsx +12 -1
- package/src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.tsx +0 -1
- package/src/primitives/actionBarMore/ActionBarMoreContent.tsx +46 -0
- package/src/primitives/actionBarMore/ActionBarMoreItem.tsx +31 -0
- package/src/primitives/actionBarMore/ActionBarMoreRoot.tsx +22 -0
- package/src/primitives/actionBarMore/ActionBarMoreSeparator.tsx +32 -0
- package/src/primitives/actionBarMore/ActionBarMoreTrigger.tsx +31 -0
- package/src/primitives/actionBarMore/index.ts +5 -0
- package/src/primitives/actionBarMore/scope.tsx +8 -0
- package/src/primitives/composer/ComposerDictate.tsx +48 -0
- package/src/primitives/composer/ComposerDictationTranscript.tsx +45 -0
- package/src/primitives/composer/ComposerIf.tsx +7 -0
- package/src/primitives/composer/ComposerInput.tsx +4 -1
- package/src/primitives/composer/ComposerStopDictation.tsx +45 -0
- package/src/primitives/composer/index.ts +3 -0
- package/src/primitives/index.ts +2 -0
- package/src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx +47 -0
- package/src/primitives/threadListItemMore/ThreadListItemMoreItem.tsx +32 -0
- package/src/primitives/threadListItemMore/ThreadListItemMoreRoot.tsx +23 -0
- package/src/primitives/threadListItemMore/ThreadListItemMoreSeparator.tsx +32 -0
- package/src/primitives/threadListItemMore/ThreadListItemMoreTrigger.tsx +32 -0
- package/src/primitives/threadListItemMore/index.ts +5 -0
- package/src/primitives/threadListItemMore/scope.tsx +8 -0
package/dist/tests/setup.js
CHANGED
|
@@ -1,2718 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// ../../node_modules/.pnpm/vitest@4.0.15_@opentelemetry+api@1.9.0_@types+node@25.0.0_@vitest+ui@4.0.15_jiti@2.6.1__a905abac14c7ecb2319509a42a33135d/node_modules/vitest/dist/chunks/utils.DvEY5TfP.js
|
|
6
|
-
import { getSafeTimers } from "@vitest/utils/timers.js";
|
|
7
|
-
var NAME_WORKER_STATE = "__vitest_worker__";
|
|
8
|
-
function getWorkerState() {
|
|
9
|
-
const workerState = globalThis[NAME_WORKER_STATE];
|
|
10
|
-
if (!workerState) throw new Error('Vitest failed to access its internal state.\n\nOne of the following is possible:\n- "vitest" is imported directly without running "vitest" command\n- "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)\n- "vitest" is imported inside Vite / Vitest config file\n- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues\n');
|
|
11
|
-
return workerState;
|
|
12
|
-
}
|
|
13
|
-
function isChildProcess() {
|
|
14
|
-
return typeof process !== "undefined" && !!process.send;
|
|
15
|
-
}
|
|
16
|
-
function resetModules(modules, resetMocks = false) {
|
|
17
|
-
const skipPaths = [
|
|
18
|
-
/\/vitest\/dist\//,
|
|
19
|
-
/vitest-virtual-\w+\/dist/,
|
|
20
|
-
/@vitest\/dist/,
|
|
21
|
-
...!resetMocks ? [/^mock:/] : []
|
|
22
|
-
];
|
|
23
|
-
modules.idToModuleMap.forEach((node, path) => {
|
|
24
|
-
if (skipPaths.some((re) => re.test(path))) return;
|
|
25
|
-
node.promise = void 0;
|
|
26
|
-
node.exports = void 0;
|
|
27
|
-
node.evaluated = false;
|
|
28
|
-
node.importers.clear();
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function waitNextTick() {
|
|
32
|
-
const { setTimeout } = getSafeTimers();
|
|
33
|
-
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
34
|
-
}
|
|
35
|
-
async function waitForImportsToResolve() {
|
|
36
|
-
await waitNextTick();
|
|
37
|
-
const state = getWorkerState();
|
|
38
|
-
const promises = [];
|
|
39
|
-
const resolvingCount = state.resolvingModules.size;
|
|
40
|
-
for (const [_, mod] of state.evaluatedModules.idToModuleMap) if (mod.promise && !mod.evaluated) promises.push(mod.promise);
|
|
41
|
-
if (!promises.length && !resolvingCount) return;
|
|
42
|
-
await Promise.allSettled(promises);
|
|
43
|
-
await waitForImportsToResolve();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// ../../node_modules/.pnpm/vitest@4.0.15_@opentelemetry+api@1.9.0_@types+node@25.0.0_@vitest+ui@4.0.15_jiti@2.6.1__a905abac14c7ecb2319509a42a33135d/node_modules/vitest/dist/chunks/vi.2VT5v0um.js
|
|
47
|
-
import { getSafeTimers as getSafeTimers2, delay } from "@vitest/utils/timers.js";
|
|
48
|
-
import { getNames } from "@vitest/runner/utils.js";
|
|
49
|
-
import { stripSnapshotIndentation, addSerializer, SnapshotClient } from "@vitest/snapshot.js";
|
|
50
|
-
import "@vitest/utils/error.js";
|
|
51
|
-
import { assertTypes, createSimpleStackTrace } from "@vitest/utils/helpers.js";
|
|
52
|
-
import { fn, spyOn, restoreAllMocks, resetAllMocks, clearAllMocks, isMockFunction } from "@vitest/spy.js";
|
|
53
|
-
import "@vitest/utils/offset.js";
|
|
54
|
-
import { parseSingleStack } from "@vitest/utils/source-map.js";
|
|
55
|
-
|
|
56
|
-
// ../../node_modules/.pnpm/vitest@4.0.15_@opentelemetry+api@1.9.0_@types+node@25.0.0_@vitest+ui@4.0.15_jiti@2.6.1__a905abac14c7ecb2319509a42a33135d/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js
|
|
57
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
58
|
-
|
|
59
|
-
// ../../node_modules/.pnpm/vitest@4.0.15_@opentelemetry+api@1.9.0_@types+node@25.0.0_@vitest+ui@4.0.15_jiti@2.6.1__a905abac14c7ecb2319509a42a33135d/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js
|
|
60
|
-
var RealDate = Date;
|
|
61
|
-
var now = null;
|
|
62
|
-
var MockDate = class _MockDate extends RealDate {
|
|
63
|
-
constructor(y, m, d, h, M, s, ms) {
|
|
64
|
-
super();
|
|
65
|
-
let date;
|
|
66
|
-
switch (arguments.length) {
|
|
67
|
-
case 0:
|
|
68
|
-
if (now !== null) date = new RealDate(now.valueOf());
|
|
69
|
-
else date = new RealDate();
|
|
70
|
-
break;
|
|
71
|
-
case 1:
|
|
72
|
-
date = new RealDate(y);
|
|
73
|
-
break;
|
|
74
|
-
default:
|
|
75
|
-
d = typeof d === "undefined" ? 1 : d;
|
|
76
|
-
h = h || 0;
|
|
77
|
-
M = M || 0;
|
|
78
|
-
s = s || 0;
|
|
79
|
-
ms = ms || 0;
|
|
80
|
-
date = new RealDate(y, m, d, h, M, s, ms);
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
Object.setPrototypeOf(date, _MockDate.prototype);
|
|
84
|
-
return date;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
MockDate.UTC = RealDate.UTC;
|
|
88
|
-
MockDate.now = function() {
|
|
89
|
-
return new MockDate().valueOf();
|
|
90
|
-
};
|
|
91
|
-
MockDate.parse = function(dateString) {
|
|
92
|
-
return RealDate.parse(dateString);
|
|
93
|
-
};
|
|
94
|
-
MockDate.toString = function() {
|
|
95
|
-
return RealDate.toString();
|
|
96
|
-
};
|
|
97
|
-
function mockDate(date) {
|
|
98
|
-
const dateObj = new RealDate(date.valueOf());
|
|
99
|
-
if (Number.isNaN(dateObj.getTime())) throw new TypeError(`mockdate: The time set is an invalid date: ${date}`);
|
|
100
|
-
globalThis.Date = MockDate;
|
|
101
|
-
now = dateObj.valueOf();
|
|
102
|
-
}
|
|
103
|
-
function resetDate() {
|
|
104
|
-
globalThis.Date = RealDate;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// ../../node_modules/.pnpm/vitest@4.0.15_@opentelemetry+api@1.9.0_@types+node@25.0.0_@vitest+ui@4.0.15_jiti@2.6.1__a905abac14c7ecb2319509a42a33135d/node_modules/vitest/dist/chunks/vi.2VT5v0um.js
|
|
108
|
-
var unsupported = [
|
|
109
|
-
"matchSnapshot",
|
|
110
|
-
"toMatchSnapshot",
|
|
111
|
-
"toMatchInlineSnapshot",
|
|
112
|
-
"toThrowErrorMatchingSnapshot",
|
|
113
|
-
"toThrowErrorMatchingInlineSnapshot",
|
|
114
|
-
"throws",
|
|
115
|
-
"Throw",
|
|
116
|
-
"throw",
|
|
117
|
-
"toThrow",
|
|
118
|
-
"toThrowError"
|
|
119
|
-
];
|
|
120
|
-
function throwWithCause(error, source) {
|
|
121
|
-
if (error.cause == null) error.cause = /* @__PURE__ */ new Error("Matcher did not succeed in time.");
|
|
122
|
-
throw copyStackTrace$1(error, source);
|
|
123
|
-
}
|
|
124
|
-
function createExpectPoll(expect) {
|
|
125
|
-
return function poll(fn2, options = {}) {
|
|
126
|
-
const defaults = getWorkerState().config.expect?.poll ?? {};
|
|
127
|
-
const { interval = defaults.interval ?? 50, timeout = defaults.timeout ?? 1e3, message } = options;
|
|
128
|
-
const assertion = expect(null, message).withContext({ poll: true });
|
|
129
|
-
fn2 = fn2.bind(assertion);
|
|
130
|
-
const test2 = chai.util.flag(assertion, "vitest-test");
|
|
131
|
-
if (!test2) throw new Error("expect.poll() must be called inside a test");
|
|
132
|
-
const proxy = new Proxy(assertion, { get(target, key, receiver) {
|
|
133
|
-
const assertionFunction = Reflect.get(target, key, receiver);
|
|
134
|
-
if (typeof assertionFunction !== "function") return assertionFunction instanceof chai.Assertion ? proxy : assertionFunction;
|
|
135
|
-
if (key === "assert") return assertionFunction;
|
|
136
|
-
if (typeof key === "string" && unsupported.includes(key)) throw new SyntaxError(`expect.poll() is not supported in combination with .${key}(). Use vi.waitFor() if your assertion condition is unstable.`);
|
|
137
|
-
return function(...args) {
|
|
138
|
-
const STACK_TRACE_ERROR = /* @__PURE__ */ new Error("STACK_TRACE_ERROR");
|
|
139
|
-
const promise = async () => {
|
|
140
|
-
const { setTimeout, clearTimeout } = getSafeTimers2();
|
|
141
|
-
let executionPhase = "fn";
|
|
142
|
-
let hasTimedOut = false;
|
|
143
|
-
const timerId = setTimeout(() => {
|
|
144
|
-
hasTimedOut = true;
|
|
145
|
-
}, timeout);
|
|
146
|
-
chai.util.flag(assertion, "_name", key);
|
|
147
|
-
try {
|
|
148
|
-
while (true) {
|
|
149
|
-
const isLastAttempt = hasTimedOut;
|
|
150
|
-
if (isLastAttempt) chai.util.flag(assertion, "_isLastPollAttempt", true);
|
|
151
|
-
try {
|
|
152
|
-
executionPhase = "fn";
|
|
153
|
-
const obj = await fn2();
|
|
154
|
-
chai.util.flag(assertion, "object", obj);
|
|
155
|
-
executionPhase = "assertion";
|
|
156
|
-
return await assertionFunction.call(assertion, ...args);
|
|
157
|
-
} catch (err) {
|
|
158
|
-
if (isLastAttempt || executionPhase === "assertion" && chai.util.flag(assertion, "_poll.assert_once")) throwWithCause(err, STACK_TRACE_ERROR);
|
|
159
|
-
await delay(interval, setTimeout);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
} finally {
|
|
163
|
-
clearTimeout(timerId);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
let awaited = false;
|
|
167
|
-
test2.onFinished ??= [];
|
|
168
|
-
test2.onFinished.push(() => {
|
|
169
|
-
if (!awaited) {
|
|
170
|
-
const negated = chai.util.flag(assertion, "negate") ? "not." : "";
|
|
171
|
-
const assertionString = `expect.${chai.util.flag(assertion, "_poll.element") ? "element(locator)" : "poll(assertion)"}.${negated}${String(key)}()`;
|
|
172
|
-
throw copyStackTrace$1(/* @__PURE__ */ new Error(`${assertionString} was not awaited. This assertion is asynchronous and must be awaited; otherwise, it is not executed to avoid unhandled rejections:
|
|
173
|
-
|
|
174
|
-
await ${assertionString}
|
|
175
|
-
`), STACK_TRACE_ERROR);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
let resultPromise;
|
|
179
|
-
return {
|
|
180
|
-
then(onFulfilled, onRejected) {
|
|
181
|
-
awaited = true;
|
|
182
|
-
return (resultPromise ||= promise()).then(onFulfilled, onRejected);
|
|
183
|
-
},
|
|
184
|
-
catch(onRejected) {
|
|
185
|
-
return (resultPromise ||= promise()).catch(onRejected);
|
|
186
|
-
},
|
|
187
|
-
finally(onFinally) {
|
|
188
|
-
return (resultPromise ||= promise()).finally(onFinally);
|
|
189
|
-
},
|
|
190
|
-
[Symbol.toStringTag]: "Promise"
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
} });
|
|
194
|
-
return proxy;
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
function copyStackTrace$1(target, source) {
|
|
198
|
-
if (source.stack !== void 0) target.stack = source.stack.replace(source.message, target.message);
|
|
199
|
-
return target;
|
|
200
|
-
}
|
|
201
|
-
function createAssertionMessage(util, assertion, hasArgs) {
|
|
202
|
-
const not = util.flag(assertion, "negate") ? "not." : "";
|
|
203
|
-
const name = `${util.flag(assertion, "_name")}(${"expected"})`;
|
|
204
|
-
const promiseName = util.flag(assertion, "promise");
|
|
205
|
-
return `expect(actual)${promiseName ? `.${promiseName}` : ""}.${not}${name}`;
|
|
206
|
-
}
|
|
207
|
-
function recordAsyncExpect(_test, promise, assertion, error) {
|
|
208
|
-
const test2 = _test;
|
|
209
|
-
if (test2 && promise instanceof Promise) {
|
|
210
|
-
promise = promise.finally(() => {
|
|
211
|
-
if (!test2.promises) return;
|
|
212
|
-
const index = test2.promises.indexOf(promise);
|
|
213
|
-
if (index !== -1) test2.promises.splice(index, 1);
|
|
214
|
-
});
|
|
215
|
-
if (!test2.promises) test2.promises = [];
|
|
216
|
-
test2.promises.push(promise);
|
|
217
|
-
let resolved = false;
|
|
218
|
-
test2.onFinished ??= [];
|
|
219
|
-
test2.onFinished.push(() => {
|
|
220
|
-
if (!resolved) {
|
|
221
|
-
const stack = (globalThis.__vitest_worker__?.onFilterStackTrace || ((s) => s || ""))(error.stack);
|
|
222
|
-
console.warn([
|
|
223
|
-
`Promise returned by \`${assertion}\` was not awaited. `,
|
|
224
|
-
"Vitest currently auto-awaits hanging assertions at the end of the test, but this will cause the test to fail in Vitest 3. ",
|
|
225
|
-
"Please remember to await the assertion.\n",
|
|
226
|
-
stack
|
|
227
|
-
].join(""));
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
return {
|
|
231
|
-
then(onFulfilled, onRejected) {
|
|
232
|
-
resolved = true;
|
|
233
|
-
return promise.then(onFulfilled, onRejected);
|
|
234
|
-
},
|
|
235
|
-
catch(onRejected) {
|
|
236
|
-
return promise.catch(onRejected);
|
|
237
|
-
},
|
|
238
|
-
finally(onFinally) {
|
|
239
|
-
return promise.finally(onFinally);
|
|
240
|
-
},
|
|
241
|
-
[Symbol.toStringTag]: "Promise"
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
return promise;
|
|
245
|
-
}
|
|
246
|
-
var _client;
|
|
247
|
-
function getSnapshotClient() {
|
|
248
|
-
if (!_client) _client = new SnapshotClient({ isEqual: (received, expected) => {
|
|
249
|
-
return equals(received, expected, [iterableEquality, subsetEquality]);
|
|
250
|
-
} });
|
|
251
|
-
return _client;
|
|
252
|
-
}
|
|
253
|
-
function getError(expected, promise) {
|
|
254
|
-
if (typeof expected !== "function") {
|
|
255
|
-
if (!promise) throw new Error(`expected must be a function, received ${typeof expected}`);
|
|
256
|
-
return expected;
|
|
257
|
-
}
|
|
258
|
-
try {
|
|
259
|
-
expected();
|
|
260
|
-
} catch (e) {
|
|
261
|
-
return e;
|
|
262
|
-
}
|
|
263
|
-
throw new Error("snapshot function didn't throw");
|
|
264
|
-
}
|
|
265
|
-
function getTestNames(test2) {
|
|
266
|
-
return {
|
|
267
|
-
filepath: test2.file.filepath,
|
|
268
|
-
name: getNames(test2).slice(1).join(" > "),
|
|
269
|
-
testId: test2.id
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
var SnapshotPlugin = (chai3, utils) => {
|
|
273
|
-
function getTest(assertionName, obj) {
|
|
274
|
-
const test2 = utils.flag(obj, "vitest-test");
|
|
275
|
-
if (!test2) throw new Error(`'${assertionName}' cannot be used without test context`);
|
|
276
|
-
return test2;
|
|
277
|
-
}
|
|
278
|
-
for (const key of ["matchSnapshot", "toMatchSnapshot"]) utils.addMethod(chai3.Assertion.prototype, key, function(properties, message) {
|
|
279
|
-
utils.flag(this, "_name", key);
|
|
280
|
-
if (utils.flag(this, "negate")) throw new Error(`${key} cannot be used with "not"`);
|
|
281
|
-
const expected = utils.flag(this, "object");
|
|
282
|
-
const test2 = getTest(key, this);
|
|
283
|
-
if (typeof properties === "string" && typeof message === "undefined") {
|
|
284
|
-
message = properties;
|
|
285
|
-
properties = void 0;
|
|
286
|
-
}
|
|
287
|
-
const errorMessage = utils.flag(this, "message");
|
|
288
|
-
getSnapshotClient().assert({
|
|
289
|
-
received: expected,
|
|
290
|
-
message,
|
|
291
|
-
isInline: false,
|
|
292
|
-
properties,
|
|
293
|
-
errorMessage,
|
|
294
|
-
...getTestNames(test2)
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
utils.addMethod(chai3.Assertion.prototype, "toMatchFileSnapshot", function(file, message) {
|
|
298
|
-
utils.flag(this, "_name", "toMatchFileSnapshot");
|
|
299
|
-
if (utils.flag(this, "negate")) throw new Error('toMatchFileSnapshot cannot be used with "not"');
|
|
300
|
-
const error = /* @__PURE__ */ new Error("resolves");
|
|
301
|
-
const expected = utils.flag(this, "object");
|
|
302
|
-
const test2 = getTest("toMatchFileSnapshot", this);
|
|
303
|
-
const errorMessage = utils.flag(this, "message");
|
|
304
|
-
return recordAsyncExpect(test2, getSnapshotClient().assertRaw({
|
|
305
|
-
received: expected,
|
|
306
|
-
message,
|
|
307
|
-
isInline: false,
|
|
308
|
-
rawSnapshot: { file },
|
|
309
|
-
errorMessage,
|
|
310
|
-
...getTestNames(test2)
|
|
311
|
-
}), createAssertionMessage(utils, this), error);
|
|
312
|
-
});
|
|
313
|
-
utils.addMethod(chai3.Assertion.prototype, "toMatchInlineSnapshot", function __INLINE_SNAPSHOT__(properties, inlineSnapshot, message) {
|
|
314
|
-
utils.flag(this, "_name", "toMatchInlineSnapshot");
|
|
315
|
-
if (utils.flag(this, "negate")) throw new Error('toMatchInlineSnapshot cannot be used with "not"');
|
|
316
|
-
const test2 = getTest("toMatchInlineSnapshot", this);
|
|
317
|
-
if (test2.each || test2.suite?.each) throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");
|
|
318
|
-
const expected = utils.flag(this, "object");
|
|
319
|
-
const error = utils.flag(this, "error");
|
|
320
|
-
if (typeof properties === "string") {
|
|
321
|
-
message = inlineSnapshot;
|
|
322
|
-
inlineSnapshot = properties;
|
|
323
|
-
properties = void 0;
|
|
324
|
-
}
|
|
325
|
-
if (inlineSnapshot) inlineSnapshot = stripSnapshotIndentation(inlineSnapshot);
|
|
326
|
-
const errorMessage = utils.flag(this, "message");
|
|
327
|
-
getSnapshotClient().assert({
|
|
328
|
-
received: expected,
|
|
329
|
-
message,
|
|
330
|
-
isInline: true,
|
|
331
|
-
properties,
|
|
332
|
-
inlineSnapshot,
|
|
333
|
-
error,
|
|
334
|
-
errorMessage,
|
|
335
|
-
...getTestNames(test2)
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
utils.addMethod(chai3.Assertion.prototype, "toThrowErrorMatchingSnapshot", function(message) {
|
|
339
|
-
utils.flag(this, "_name", "toThrowErrorMatchingSnapshot");
|
|
340
|
-
if (utils.flag(this, "negate")) throw new Error('toThrowErrorMatchingSnapshot cannot be used with "not"');
|
|
341
|
-
const expected = utils.flag(this, "object");
|
|
342
|
-
const test2 = getTest("toThrowErrorMatchingSnapshot", this);
|
|
343
|
-
const promise = utils.flag(this, "promise");
|
|
344
|
-
const errorMessage = utils.flag(this, "message");
|
|
345
|
-
getSnapshotClient().assert({
|
|
346
|
-
received: getError(expected, promise),
|
|
347
|
-
message,
|
|
348
|
-
errorMessage,
|
|
349
|
-
...getTestNames(test2)
|
|
350
|
-
});
|
|
351
|
-
});
|
|
352
|
-
utils.addMethod(chai3.Assertion.prototype, "toThrowErrorMatchingInlineSnapshot", function __INLINE_SNAPSHOT__(inlineSnapshot, message) {
|
|
353
|
-
if (utils.flag(this, "negate")) throw new Error('toThrowErrorMatchingInlineSnapshot cannot be used with "not"');
|
|
354
|
-
const test2 = getTest("toThrowErrorMatchingInlineSnapshot", this);
|
|
355
|
-
if (test2.each || test2.suite?.each) throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");
|
|
356
|
-
const expected = utils.flag(this, "object");
|
|
357
|
-
const error = utils.flag(this, "error");
|
|
358
|
-
const promise = utils.flag(this, "promise");
|
|
359
|
-
const errorMessage = utils.flag(this, "message");
|
|
360
|
-
if (inlineSnapshot) inlineSnapshot = stripSnapshotIndentation(inlineSnapshot);
|
|
361
|
-
getSnapshotClient().assert({
|
|
362
|
-
received: getError(expected, promise),
|
|
363
|
-
message,
|
|
364
|
-
inlineSnapshot,
|
|
365
|
-
isInline: true,
|
|
366
|
-
error,
|
|
367
|
-
errorMessage,
|
|
368
|
-
...getTestNames(test2)
|
|
369
|
-
});
|
|
370
|
-
});
|
|
371
|
-
utils.addMethod(chai3.expect, "addSnapshotSerializer", addSerializer);
|
|
372
|
-
};
|
|
373
|
-
chai.use(JestExtend);
|
|
374
|
-
chai.use(JestChaiExpect);
|
|
375
|
-
chai.use(SnapshotPlugin);
|
|
376
|
-
chai.use(JestAsymmetricMatchers);
|
|
377
|
-
function createExpect(test2) {
|
|
378
|
-
const expect = ((value, message) => {
|
|
379
|
-
const { assertionCalls } = getState(expect);
|
|
380
|
-
setState({ assertionCalls: assertionCalls + 1 }, expect);
|
|
381
|
-
const assert2 = chai.expect(value, message);
|
|
382
|
-
const _test = test2 || getCurrentTest();
|
|
383
|
-
if (_test)
|
|
384
|
-
return assert2.withTest(_test);
|
|
385
|
-
else return assert2;
|
|
386
|
-
});
|
|
387
|
-
Object.assign(expect, chai.expect);
|
|
388
|
-
Object.assign(expect, globalThis[ASYMMETRIC_MATCHERS_OBJECT]);
|
|
389
|
-
expect.getState = () => getState(expect);
|
|
390
|
-
expect.setState = (state) => setState(state, expect);
|
|
391
|
-
const globalState = getState(globalThis[GLOBAL_EXPECT]) || {};
|
|
392
|
-
setState({
|
|
393
|
-
...globalState,
|
|
394
|
-
assertionCalls: 0,
|
|
395
|
-
isExpectingAssertions: false,
|
|
396
|
-
isExpectingAssertionsError: null,
|
|
397
|
-
expectedAssertionsNumber: null,
|
|
398
|
-
expectedAssertionsNumberErrorGen: null,
|
|
399
|
-
get testPath() {
|
|
400
|
-
return getWorkerState().filepath;
|
|
401
|
-
},
|
|
402
|
-
currentTestName: test2 ? test2.fullTestName ?? "" : globalState.currentTestName
|
|
403
|
-
}, expect);
|
|
404
|
-
expect.assert = chai.assert;
|
|
405
|
-
expect.extend = (matchers) => chai.expect.extend(expect, matchers);
|
|
406
|
-
expect.addEqualityTesters = (customTesters) => addCustomEqualityTesters(customTesters);
|
|
407
|
-
expect.soft = (...args) => {
|
|
408
|
-
return expect(...args).withContext({ soft: true });
|
|
409
|
-
};
|
|
410
|
-
expect.poll = createExpectPoll(expect);
|
|
411
|
-
expect.unreachable = (message) => {
|
|
412
|
-
chai.assert.fail(`expected${message ? ` "${message}" ` : " "}not to be reached`);
|
|
413
|
-
};
|
|
414
|
-
function assertions(expected) {
|
|
415
|
-
const errorGen = () => /* @__PURE__ */ new Error(`expected number of assertions to be ${expected}, but got ${expect.getState().assertionCalls}`);
|
|
416
|
-
if (Error.captureStackTrace) Error.captureStackTrace(errorGen(), assertions);
|
|
417
|
-
expect.setState({
|
|
418
|
-
expectedAssertionsNumber: expected,
|
|
419
|
-
expectedAssertionsNumberErrorGen: errorGen
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
function hasAssertions() {
|
|
423
|
-
const error = /* @__PURE__ */ new Error("expected any number of assertion, but got none");
|
|
424
|
-
if (Error.captureStackTrace) Error.captureStackTrace(error, hasAssertions);
|
|
425
|
-
expect.setState({
|
|
426
|
-
isExpectingAssertions: true,
|
|
427
|
-
isExpectingAssertionsError: error
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
chai.util.addMethod(expect, "assertions", assertions);
|
|
431
|
-
chai.util.addMethod(expect, "hasAssertions", hasAssertions);
|
|
432
|
-
expect.extend(customMatchers);
|
|
433
|
-
return expect;
|
|
434
|
-
}
|
|
435
|
-
var globalExpect = createExpect();
|
|
436
|
-
Object.defineProperty(globalThis, GLOBAL_EXPECT, {
|
|
437
|
-
value: globalExpect,
|
|
438
|
-
writable: true,
|
|
439
|
-
configurable: true
|
|
440
|
-
});
|
|
441
|
-
var assert = chai.assert;
|
|
442
|
-
var should = chai.should;
|
|
443
|
-
var fakeTimersSrc = {};
|
|
444
|
-
var global2;
|
|
445
|
-
var hasRequiredGlobal;
|
|
446
|
-
function requireGlobal() {
|
|
447
|
-
if (hasRequiredGlobal) return global2;
|
|
448
|
-
hasRequiredGlobal = 1;
|
|
449
|
-
var globalObject;
|
|
450
|
-
if (typeof commonjsGlobal !== "undefined") {
|
|
451
|
-
globalObject = commonjsGlobal;
|
|
452
|
-
} else if (typeof window !== "undefined") {
|
|
453
|
-
globalObject = window;
|
|
454
|
-
} else {
|
|
455
|
-
globalObject = self;
|
|
456
|
-
}
|
|
457
|
-
global2 = globalObject;
|
|
458
|
-
return global2;
|
|
459
|
-
}
|
|
460
|
-
var throwsOnProto_1;
|
|
461
|
-
var hasRequiredThrowsOnProto;
|
|
462
|
-
function requireThrowsOnProto() {
|
|
463
|
-
if (hasRequiredThrowsOnProto) return throwsOnProto_1;
|
|
464
|
-
hasRequiredThrowsOnProto = 1;
|
|
465
|
-
let throwsOnProto;
|
|
466
|
-
try {
|
|
467
|
-
const object2 = {};
|
|
468
|
-
object2.__proto__;
|
|
469
|
-
throwsOnProto = false;
|
|
470
|
-
} catch (_) {
|
|
471
|
-
throwsOnProto = true;
|
|
472
|
-
}
|
|
473
|
-
throwsOnProto_1 = throwsOnProto;
|
|
474
|
-
return throwsOnProto_1;
|
|
475
|
-
}
|
|
476
|
-
var copyPrototypeMethods;
|
|
477
|
-
var hasRequiredCopyPrototypeMethods;
|
|
478
|
-
function requireCopyPrototypeMethods() {
|
|
479
|
-
if (hasRequiredCopyPrototypeMethods) return copyPrototypeMethods;
|
|
480
|
-
hasRequiredCopyPrototypeMethods = 1;
|
|
481
|
-
var call = Function.call;
|
|
482
|
-
var throwsOnProto = requireThrowsOnProto();
|
|
483
|
-
var disallowedProperties = [
|
|
484
|
-
// ignore size because it throws from Map
|
|
485
|
-
"size",
|
|
486
|
-
"caller",
|
|
487
|
-
"callee",
|
|
488
|
-
"arguments"
|
|
489
|
-
];
|
|
490
|
-
if (throwsOnProto) {
|
|
491
|
-
disallowedProperties.push("__proto__");
|
|
492
|
-
}
|
|
493
|
-
copyPrototypeMethods = function copyPrototypeMethods2(prototype) {
|
|
494
|
-
return Object.getOwnPropertyNames(prototype).reduce(
|
|
495
|
-
function(result, name) {
|
|
496
|
-
if (disallowedProperties.includes(name)) {
|
|
497
|
-
return result;
|
|
498
|
-
}
|
|
499
|
-
if (typeof prototype[name] !== "function") {
|
|
500
|
-
return result;
|
|
501
|
-
}
|
|
502
|
-
result[name] = call.bind(prototype[name]);
|
|
503
|
-
return result;
|
|
504
|
-
},
|
|
505
|
-
/* @__PURE__ */ Object.create(null)
|
|
506
|
-
);
|
|
507
|
-
};
|
|
508
|
-
return copyPrototypeMethods;
|
|
509
|
-
}
|
|
510
|
-
var array;
|
|
511
|
-
var hasRequiredArray;
|
|
512
|
-
function requireArray() {
|
|
513
|
-
if (hasRequiredArray) return array;
|
|
514
|
-
hasRequiredArray = 1;
|
|
515
|
-
var copyPrototype = requireCopyPrototypeMethods();
|
|
516
|
-
array = copyPrototype(Array.prototype);
|
|
517
|
-
return array;
|
|
518
|
-
}
|
|
519
|
-
var calledInOrder_1;
|
|
520
|
-
var hasRequiredCalledInOrder;
|
|
521
|
-
function requireCalledInOrder() {
|
|
522
|
-
if (hasRequiredCalledInOrder) return calledInOrder_1;
|
|
523
|
-
hasRequiredCalledInOrder = 1;
|
|
524
|
-
var every2 = requireArray().every;
|
|
525
|
-
function hasCallsLeft(callMap, spy) {
|
|
526
|
-
if (callMap[spy.id] === void 0) {
|
|
527
|
-
callMap[spy.id] = 0;
|
|
528
|
-
}
|
|
529
|
-
return callMap[spy.id] < spy.callCount;
|
|
530
|
-
}
|
|
531
|
-
function checkAdjacentCalls(callMap, spy, index, spies) {
|
|
532
|
-
var calledBeforeNext = true;
|
|
533
|
-
if (index !== spies.length - 1) {
|
|
534
|
-
calledBeforeNext = spy.calledBefore(spies[index + 1]);
|
|
535
|
-
}
|
|
536
|
-
if (hasCallsLeft(callMap, spy) && calledBeforeNext) {
|
|
537
|
-
callMap[spy.id] += 1;
|
|
538
|
-
return true;
|
|
539
|
-
}
|
|
540
|
-
return false;
|
|
541
|
-
}
|
|
542
|
-
function calledInOrder(spies) {
|
|
543
|
-
var callMap = {};
|
|
544
|
-
var _spies = arguments.length > 1 ? arguments : spies;
|
|
545
|
-
return every2(_spies, checkAdjacentCalls.bind(null, callMap));
|
|
546
|
-
}
|
|
547
|
-
calledInOrder_1 = calledInOrder;
|
|
548
|
-
return calledInOrder_1;
|
|
549
|
-
}
|
|
550
|
-
var className_1;
|
|
551
|
-
var hasRequiredClassName;
|
|
552
|
-
function requireClassName() {
|
|
553
|
-
if (hasRequiredClassName) return className_1;
|
|
554
|
-
hasRequiredClassName = 1;
|
|
555
|
-
function className(value) {
|
|
556
|
-
const name = value.constructor && value.constructor.name;
|
|
557
|
-
return name || null;
|
|
558
|
-
}
|
|
559
|
-
className_1 = className;
|
|
560
|
-
return className_1;
|
|
561
|
-
}
|
|
562
|
-
var deprecated = {};
|
|
563
|
-
var hasRequiredDeprecated;
|
|
564
|
-
function requireDeprecated() {
|
|
565
|
-
if (hasRequiredDeprecated) return deprecated;
|
|
566
|
-
hasRequiredDeprecated = 1;
|
|
567
|
-
(function(exports$1) {
|
|
568
|
-
exports$1.wrap = function(func, msg) {
|
|
569
|
-
var wrapped = function() {
|
|
570
|
-
exports$1.printWarning(msg);
|
|
571
|
-
return func.apply(this, arguments);
|
|
572
|
-
};
|
|
573
|
-
if (func.prototype) {
|
|
574
|
-
wrapped.prototype = func.prototype;
|
|
575
|
-
}
|
|
576
|
-
return wrapped;
|
|
577
|
-
};
|
|
578
|
-
exports$1.defaultMsg = function(packageName, funcName) {
|
|
579
|
-
return `${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`;
|
|
580
|
-
};
|
|
581
|
-
exports$1.printWarning = function(msg) {
|
|
582
|
-
if (typeof process === "object" && process.emitWarning) {
|
|
583
|
-
process.emitWarning(msg);
|
|
584
|
-
} else if (console.info) {
|
|
585
|
-
console.info(msg);
|
|
586
|
-
} else {
|
|
587
|
-
console.log(msg);
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
})(deprecated);
|
|
591
|
-
return deprecated;
|
|
592
|
-
}
|
|
593
|
-
var every;
|
|
594
|
-
var hasRequiredEvery;
|
|
595
|
-
function requireEvery() {
|
|
596
|
-
if (hasRequiredEvery) return every;
|
|
597
|
-
hasRequiredEvery = 1;
|
|
598
|
-
every = function every2(obj, fn2) {
|
|
599
|
-
var pass = true;
|
|
600
|
-
try {
|
|
601
|
-
obj.forEach(function() {
|
|
602
|
-
if (!fn2.apply(this, arguments)) {
|
|
603
|
-
throw new Error();
|
|
604
|
-
}
|
|
605
|
-
});
|
|
606
|
-
} catch (e) {
|
|
607
|
-
pass = false;
|
|
608
|
-
}
|
|
609
|
-
return pass;
|
|
610
|
-
};
|
|
611
|
-
return every;
|
|
612
|
-
}
|
|
613
|
-
var functionName;
|
|
614
|
-
var hasRequiredFunctionName;
|
|
615
|
-
function requireFunctionName() {
|
|
616
|
-
if (hasRequiredFunctionName) return functionName;
|
|
617
|
-
hasRequiredFunctionName = 1;
|
|
618
|
-
functionName = function functionName2(func) {
|
|
619
|
-
if (!func) {
|
|
620
|
-
return "";
|
|
621
|
-
}
|
|
622
|
-
try {
|
|
623
|
-
return func.displayName || func.name || // Use function decomposition as a last resort to get function
|
|
624
|
-
// name. Does not rely on function decomposition to work - if it
|
|
625
|
-
// doesn't debugging will be slightly less informative
|
|
626
|
-
// (i.e. toString will say 'spy' rather than 'myFunc').
|
|
627
|
-
(String(func).match(/function ([^\s(]+)/) || [])[1];
|
|
628
|
-
} catch (e) {
|
|
629
|
-
return "";
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
|
-
return functionName;
|
|
633
|
-
}
|
|
634
|
-
var orderByFirstCall_1;
|
|
635
|
-
var hasRequiredOrderByFirstCall;
|
|
636
|
-
function requireOrderByFirstCall() {
|
|
637
|
-
if (hasRequiredOrderByFirstCall) return orderByFirstCall_1;
|
|
638
|
-
hasRequiredOrderByFirstCall = 1;
|
|
639
|
-
var sort = requireArray().sort;
|
|
640
|
-
var slice = requireArray().slice;
|
|
641
|
-
function comparator(a, b) {
|
|
642
|
-
var aCall = a.getCall(0);
|
|
643
|
-
var bCall = b.getCall(0);
|
|
644
|
-
var aId = aCall && aCall.callId || -1;
|
|
645
|
-
var bId = bCall && bCall.callId || -1;
|
|
646
|
-
return aId < bId ? -1 : 1;
|
|
647
|
-
}
|
|
648
|
-
function orderByFirstCall(spies) {
|
|
649
|
-
return sort(slice(spies), comparator);
|
|
650
|
-
}
|
|
651
|
-
orderByFirstCall_1 = orderByFirstCall;
|
|
652
|
-
return orderByFirstCall_1;
|
|
653
|
-
}
|
|
654
|
-
var _function;
|
|
655
|
-
var hasRequired_function;
|
|
656
|
-
function require_function() {
|
|
657
|
-
if (hasRequired_function) return _function;
|
|
658
|
-
hasRequired_function = 1;
|
|
659
|
-
var copyPrototype = requireCopyPrototypeMethods();
|
|
660
|
-
_function = copyPrototype(Function.prototype);
|
|
661
|
-
return _function;
|
|
662
|
-
}
|
|
663
|
-
var map;
|
|
664
|
-
var hasRequiredMap;
|
|
665
|
-
function requireMap() {
|
|
666
|
-
if (hasRequiredMap) return map;
|
|
667
|
-
hasRequiredMap = 1;
|
|
668
|
-
var copyPrototype = requireCopyPrototypeMethods();
|
|
669
|
-
map = copyPrototype(Map.prototype);
|
|
670
|
-
return map;
|
|
671
|
-
}
|
|
672
|
-
var object;
|
|
673
|
-
var hasRequiredObject;
|
|
674
|
-
function requireObject() {
|
|
675
|
-
if (hasRequiredObject) return object;
|
|
676
|
-
hasRequiredObject = 1;
|
|
677
|
-
var copyPrototype = requireCopyPrototypeMethods();
|
|
678
|
-
object = copyPrototype(Object.prototype);
|
|
679
|
-
return object;
|
|
680
|
-
}
|
|
681
|
-
var set;
|
|
682
|
-
var hasRequiredSet;
|
|
683
|
-
function requireSet() {
|
|
684
|
-
if (hasRequiredSet) return set;
|
|
685
|
-
hasRequiredSet = 1;
|
|
686
|
-
var copyPrototype = requireCopyPrototypeMethods();
|
|
687
|
-
set = copyPrototype(Set.prototype);
|
|
688
|
-
return set;
|
|
689
|
-
}
|
|
690
|
-
var string;
|
|
691
|
-
var hasRequiredString;
|
|
692
|
-
function requireString() {
|
|
693
|
-
if (hasRequiredString) return string;
|
|
694
|
-
hasRequiredString = 1;
|
|
695
|
-
var copyPrototype = requireCopyPrototypeMethods();
|
|
696
|
-
string = copyPrototype(String.prototype);
|
|
697
|
-
return string;
|
|
698
|
-
}
|
|
699
|
-
var prototypes;
|
|
700
|
-
var hasRequiredPrototypes;
|
|
701
|
-
function requirePrototypes() {
|
|
702
|
-
if (hasRequiredPrototypes) return prototypes;
|
|
703
|
-
hasRequiredPrototypes = 1;
|
|
704
|
-
prototypes = {
|
|
705
|
-
array: requireArray(),
|
|
706
|
-
function: require_function(),
|
|
707
|
-
map: requireMap(),
|
|
708
|
-
object: requireObject(),
|
|
709
|
-
set: requireSet(),
|
|
710
|
-
string: requireString()
|
|
711
|
-
};
|
|
712
|
-
return prototypes;
|
|
713
|
-
}
|
|
714
|
-
var typeDetect$1 = { exports: {} };
|
|
715
|
-
var typeDetect = typeDetect$1.exports;
|
|
716
|
-
var hasRequiredTypeDetect;
|
|
717
|
-
function requireTypeDetect() {
|
|
718
|
-
if (hasRequiredTypeDetect) return typeDetect$1.exports;
|
|
719
|
-
hasRequiredTypeDetect = 1;
|
|
720
|
-
(function(module, exports$1) {
|
|
721
|
-
(function(global3, factory) {
|
|
722
|
-
module.exports = factory();
|
|
723
|
-
})(typeDetect, (function() {
|
|
724
|
-
var promiseExists = typeof Promise === "function";
|
|
725
|
-
var globalObject = typeof self === "object" ? self : commonjsGlobal;
|
|
726
|
-
var symbolExists = typeof Symbol !== "undefined";
|
|
727
|
-
var mapExists = typeof Map !== "undefined";
|
|
728
|
-
var setExists = typeof Set !== "undefined";
|
|
729
|
-
var weakMapExists = typeof WeakMap !== "undefined";
|
|
730
|
-
var weakSetExists = typeof WeakSet !== "undefined";
|
|
731
|
-
var dataViewExists = typeof DataView !== "undefined";
|
|
732
|
-
var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== "undefined";
|
|
733
|
-
var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== "undefined";
|
|
734
|
-
var setEntriesExists = setExists && typeof Set.prototype.entries === "function";
|
|
735
|
-
var mapEntriesExists = mapExists && typeof Map.prototype.entries === "function";
|
|
736
|
-
var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries());
|
|
737
|
-
var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries());
|
|
738
|
-
var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === "function";
|
|
739
|
-
var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]());
|
|
740
|
-
var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === "function";
|
|
741
|
-
var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(""[Symbol.iterator]());
|
|
742
|
-
var toStringLeftSliceLength = 8;
|
|
743
|
-
var toStringRightSliceLength = -1;
|
|
744
|
-
function typeDetect2(obj) {
|
|
745
|
-
var typeofObj = typeof obj;
|
|
746
|
-
if (typeofObj !== "object") {
|
|
747
|
-
return typeofObj;
|
|
748
|
-
}
|
|
749
|
-
if (obj === null) {
|
|
750
|
-
return "null";
|
|
751
|
-
}
|
|
752
|
-
if (obj === globalObject) {
|
|
753
|
-
return "global";
|
|
754
|
-
}
|
|
755
|
-
if (Array.isArray(obj) && (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))) {
|
|
756
|
-
return "Array";
|
|
757
|
-
}
|
|
758
|
-
if (typeof window === "object" && window !== null) {
|
|
759
|
-
if (typeof window.location === "object" && obj === window.location) {
|
|
760
|
-
return "Location";
|
|
761
|
-
}
|
|
762
|
-
if (typeof window.document === "object" && obj === window.document) {
|
|
763
|
-
return "Document";
|
|
764
|
-
}
|
|
765
|
-
if (typeof window.navigator === "object") {
|
|
766
|
-
if (typeof window.navigator.mimeTypes === "object" && obj === window.navigator.mimeTypes) {
|
|
767
|
-
return "MimeTypeArray";
|
|
768
|
-
}
|
|
769
|
-
if (typeof window.navigator.plugins === "object" && obj === window.navigator.plugins) {
|
|
770
|
-
return "PluginArray";
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
if ((typeof window.HTMLElement === "function" || typeof window.HTMLElement === "object") && obj instanceof window.HTMLElement) {
|
|
774
|
-
if (obj.tagName === "BLOCKQUOTE") {
|
|
775
|
-
return "HTMLQuoteElement";
|
|
776
|
-
}
|
|
777
|
-
if (obj.tagName === "TD") {
|
|
778
|
-
return "HTMLTableDataCellElement";
|
|
779
|
-
}
|
|
780
|
-
if (obj.tagName === "TH") {
|
|
781
|
-
return "HTMLTableHeaderCellElement";
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
var stringTag = symbolToStringTagExists && obj[Symbol.toStringTag];
|
|
786
|
-
if (typeof stringTag === "string") {
|
|
787
|
-
return stringTag;
|
|
788
|
-
}
|
|
789
|
-
var objPrototype = Object.getPrototypeOf(obj);
|
|
790
|
-
if (objPrototype === RegExp.prototype) {
|
|
791
|
-
return "RegExp";
|
|
792
|
-
}
|
|
793
|
-
if (objPrototype === Date.prototype) {
|
|
794
|
-
return "Date";
|
|
795
|
-
}
|
|
796
|
-
if (promiseExists && objPrototype === Promise.prototype) {
|
|
797
|
-
return "Promise";
|
|
798
|
-
}
|
|
799
|
-
if (setExists && objPrototype === Set.prototype) {
|
|
800
|
-
return "Set";
|
|
801
|
-
}
|
|
802
|
-
if (mapExists && objPrototype === Map.prototype) {
|
|
803
|
-
return "Map";
|
|
804
|
-
}
|
|
805
|
-
if (weakSetExists && objPrototype === WeakSet.prototype) {
|
|
806
|
-
return "WeakSet";
|
|
807
|
-
}
|
|
808
|
-
if (weakMapExists && objPrototype === WeakMap.prototype) {
|
|
809
|
-
return "WeakMap";
|
|
810
|
-
}
|
|
811
|
-
if (dataViewExists && objPrototype === DataView.prototype) {
|
|
812
|
-
return "DataView";
|
|
813
|
-
}
|
|
814
|
-
if (mapExists && objPrototype === mapIteratorPrototype) {
|
|
815
|
-
return "Map Iterator";
|
|
816
|
-
}
|
|
817
|
-
if (setExists && objPrototype === setIteratorPrototype) {
|
|
818
|
-
return "Set Iterator";
|
|
819
|
-
}
|
|
820
|
-
if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) {
|
|
821
|
-
return "Array Iterator";
|
|
822
|
-
}
|
|
823
|
-
if (stringIteratorExists && objPrototype === stringIteratorPrototype) {
|
|
824
|
-
return "String Iterator";
|
|
825
|
-
}
|
|
826
|
-
if (objPrototype === null) {
|
|
827
|
-
return "Object";
|
|
828
|
-
}
|
|
829
|
-
return Object.prototype.toString.call(obj).slice(toStringLeftSliceLength, toStringRightSliceLength);
|
|
830
|
-
}
|
|
831
|
-
return typeDetect2;
|
|
832
|
-
}));
|
|
833
|
-
})(typeDetect$1);
|
|
834
|
-
return typeDetect$1.exports;
|
|
835
|
-
}
|
|
836
|
-
var typeOf;
|
|
837
|
-
var hasRequiredTypeOf;
|
|
838
|
-
function requireTypeOf() {
|
|
839
|
-
if (hasRequiredTypeOf) return typeOf;
|
|
840
|
-
hasRequiredTypeOf = 1;
|
|
841
|
-
var type = requireTypeDetect();
|
|
842
|
-
typeOf = function typeOf2(value) {
|
|
843
|
-
return type(value).toLowerCase();
|
|
844
|
-
};
|
|
845
|
-
return typeOf;
|
|
846
|
-
}
|
|
847
|
-
var valueToString_1;
|
|
848
|
-
var hasRequiredValueToString;
|
|
849
|
-
function requireValueToString() {
|
|
850
|
-
if (hasRequiredValueToString) return valueToString_1;
|
|
851
|
-
hasRequiredValueToString = 1;
|
|
852
|
-
function valueToString(value) {
|
|
853
|
-
if (value && value.toString) {
|
|
854
|
-
return value.toString();
|
|
855
|
-
}
|
|
856
|
-
return String(value);
|
|
857
|
-
}
|
|
858
|
-
valueToString_1 = valueToString;
|
|
859
|
-
return valueToString_1;
|
|
860
|
-
}
|
|
861
|
-
var lib;
|
|
862
|
-
var hasRequiredLib;
|
|
863
|
-
function requireLib() {
|
|
864
|
-
if (hasRequiredLib) return lib;
|
|
865
|
-
hasRequiredLib = 1;
|
|
866
|
-
lib = {
|
|
867
|
-
global: requireGlobal(),
|
|
868
|
-
calledInOrder: requireCalledInOrder(),
|
|
869
|
-
className: requireClassName(),
|
|
870
|
-
deprecated: requireDeprecated(),
|
|
871
|
-
every: requireEvery(),
|
|
872
|
-
functionName: requireFunctionName(),
|
|
873
|
-
orderByFirstCall: requireOrderByFirstCall(),
|
|
874
|
-
prototypes: requirePrototypes(),
|
|
875
|
-
typeOf: requireTypeOf(),
|
|
876
|
-
valueToString: requireValueToString()
|
|
877
|
-
};
|
|
878
|
-
return lib;
|
|
879
|
-
}
|
|
880
|
-
var hasRequiredFakeTimersSrc;
|
|
881
|
-
function requireFakeTimersSrc() {
|
|
882
|
-
if (hasRequiredFakeTimersSrc) return fakeTimersSrc;
|
|
883
|
-
hasRequiredFakeTimersSrc = 1;
|
|
884
|
-
const globalObject = requireLib().global;
|
|
885
|
-
let timersModule, timersPromisesModule;
|
|
886
|
-
if (typeof __vitest_required__ !== "undefined") {
|
|
887
|
-
try {
|
|
888
|
-
timersModule = __vitest_required__.timers;
|
|
889
|
-
} catch (e) {
|
|
890
|
-
}
|
|
891
|
-
try {
|
|
892
|
-
timersPromisesModule = __vitest_required__.timersPromises;
|
|
893
|
-
} catch (e) {
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
function withGlobal(_global) {
|
|
897
|
-
const maxTimeout = Math.pow(2, 31) - 1;
|
|
898
|
-
const idCounterStart = 1e12;
|
|
899
|
-
const NOOP = function() {
|
|
900
|
-
return void 0;
|
|
901
|
-
};
|
|
902
|
-
const NOOP_ARRAY = function() {
|
|
903
|
-
return [];
|
|
904
|
-
};
|
|
905
|
-
const isPresent = {};
|
|
906
|
-
let timeoutResult, addTimerReturnsObject = false;
|
|
907
|
-
if (_global.setTimeout) {
|
|
908
|
-
isPresent.setTimeout = true;
|
|
909
|
-
timeoutResult = _global.setTimeout(NOOP, 0);
|
|
910
|
-
addTimerReturnsObject = typeof timeoutResult === "object";
|
|
911
|
-
}
|
|
912
|
-
isPresent.clearTimeout = Boolean(_global.clearTimeout);
|
|
913
|
-
isPresent.setInterval = Boolean(_global.setInterval);
|
|
914
|
-
isPresent.clearInterval = Boolean(_global.clearInterval);
|
|
915
|
-
isPresent.hrtime = _global.process && typeof _global.process.hrtime === "function";
|
|
916
|
-
isPresent.hrtimeBigint = isPresent.hrtime && typeof _global.process.hrtime.bigint === "function";
|
|
917
|
-
isPresent.nextTick = _global.process && typeof _global.process.nextTick === "function";
|
|
918
|
-
const utilPromisify = _global.process && _global.__vitest_required__ && _global.__vitest_required__.util.promisify;
|
|
919
|
-
isPresent.performance = _global.performance && typeof _global.performance.now === "function";
|
|
920
|
-
const hasPerformancePrototype = _global.Performance && (typeof _global.Performance).match(/^(function|object)$/);
|
|
921
|
-
const hasPerformanceConstructorPrototype = _global.performance && _global.performance.constructor && _global.performance.constructor.prototype;
|
|
922
|
-
isPresent.queueMicrotask = _global.hasOwnProperty("queueMicrotask");
|
|
923
|
-
isPresent.requestAnimationFrame = _global.requestAnimationFrame && typeof _global.requestAnimationFrame === "function";
|
|
924
|
-
isPresent.cancelAnimationFrame = _global.cancelAnimationFrame && typeof _global.cancelAnimationFrame === "function";
|
|
925
|
-
isPresent.requestIdleCallback = _global.requestIdleCallback && typeof _global.requestIdleCallback === "function";
|
|
926
|
-
isPresent.cancelIdleCallbackPresent = _global.cancelIdleCallback && typeof _global.cancelIdleCallback === "function";
|
|
927
|
-
isPresent.setImmediate = _global.setImmediate && typeof _global.setImmediate === "function";
|
|
928
|
-
isPresent.clearImmediate = _global.clearImmediate && typeof _global.clearImmediate === "function";
|
|
929
|
-
isPresent.Intl = _global.Intl && typeof _global.Intl === "object";
|
|
930
|
-
if (_global.clearTimeout) {
|
|
931
|
-
_global.clearTimeout(timeoutResult);
|
|
932
|
-
}
|
|
933
|
-
const NativeDate = _global.Date;
|
|
934
|
-
const NativeIntl = isPresent.Intl ? Object.defineProperties(
|
|
935
|
-
/* @__PURE__ */ Object.create(null),
|
|
936
|
-
Object.getOwnPropertyDescriptors(_global.Intl)
|
|
937
|
-
) : void 0;
|
|
938
|
-
let uniqueTimerId = idCounterStart;
|
|
939
|
-
if (NativeDate === void 0) {
|
|
940
|
-
throw new Error(
|
|
941
|
-
"The global scope doesn't have a `Date` object (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)"
|
|
942
|
-
);
|
|
943
|
-
}
|
|
944
|
-
isPresent.Date = true;
|
|
945
|
-
class FakePerformanceEntry {
|
|
946
|
-
constructor(name, entryType, startTime, duration) {
|
|
947
|
-
this.name = name;
|
|
948
|
-
this.entryType = entryType;
|
|
949
|
-
this.startTime = startTime;
|
|
950
|
-
this.duration = duration;
|
|
951
|
-
}
|
|
952
|
-
toJSON() {
|
|
953
|
-
return JSON.stringify({ ...this });
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
function isNumberFinite(num) {
|
|
957
|
-
if (Number.isFinite) {
|
|
958
|
-
return Number.isFinite(num);
|
|
959
|
-
}
|
|
960
|
-
return isFinite(num);
|
|
961
|
-
}
|
|
962
|
-
let isNearInfiniteLimit = false;
|
|
963
|
-
function checkIsNearInfiniteLimit(clock, i) {
|
|
964
|
-
if (clock.loopLimit && i === clock.loopLimit - 1) {
|
|
965
|
-
isNearInfiniteLimit = true;
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
function resetIsNearInfiniteLimit() {
|
|
969
|
-
isNearInfiniteLimit = false;
|
|
970
|
-
}
|
|
971
|
-
function parseTime(str) {
|
|
972
|
-
if (!str) {
|
|
973
|
-
return 0;
|
|
974
|
-
}
|
|
975
|
-
const strings = str.split(":");
|
|
976
|
-
const l = strings.length;
|
|
977
|
-
let i = l;
|
|
978
|
-
let ms = 0;
|
|
979
|
-
let parsed;
|
|
980
|
-
if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) {
|
|
981
|
-
throw new Error(
|
|
982
|
-
"tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits"
|
|
983
|
-
);
|
|
984
|
-
}
|
|
985
|
-
while (i--) {
|
|
986
|
-
parsed = parseInt(strings[i], 10);
|
|
987
|
-
if (parsed >= 60) {
|
|
988
|
-
throw new Error(`Invalid time ${str}`);
|
|
989
|
-
}
|
|
990
|
-
ms += parsed * Math.pow(60, l - i - 1);
|
|
991
|
-
}
|
|
992
|
-
return ms * 1e3;
|
|
993
|
-
}
|
|
994
|
-
function nanoRemainder(msFloat) {
|
|
995
|
-
const modulo = 1e6;
|
|
996
|
-
const remainder = msFloat * 1e6 % modulo;
|
|
997
|
-
const positiveRemainder = remainder < 0 ? remainder + modulo : remainder;
|
|
998
|
-
return Math.floor(positiveRemainder);
|
|
999
|
-
}
|
|
1000
|
-
function getEpoch(epoch) {
|
|
1001
|
-
if (!epoch) {
|
|
1002
|
-
return 0;
|
|
1003
|
-
}
|
|
1004
|
-
if (typeof epoch.getTime === "function") {
|
|
1005
|
-
return epoch.getTime();
|
|
1006
|
-
}
|
|
1007
|
-
if (typeof epoch === "number") {
|
|
1008
|
-
return epoch;
|
|
1009
|
-
}
|
|
1010
|
-
throw new TypeError("now should be milliseconds since UNIX epoch");
|
|
1011
|
-
}
|
|
1012
|
-
function inRange(from, to, timer) {
|
|
1013
|
-
return timer && timer.callAt >= from && timer.callAt <= to;
|
|
1014
|
-
}
|
|
1015
|
-
function getInfiniteLoopError(clock, job) {
|
|
1016
|
-
const infiniteLoopError = new Error(
|
|
1017
|
-
`Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!`
|
|
1018
|
-
);
|
|
1019
|
-
if (!job.error) {
|
|
1020
|
-
return infiniteLoopError;
|
|
1021
|
-
}
|
|
1022
|
-
const computedTargetPattern = /target\.*[<|(|[].*?[>|\]|)]\s*/;
|
|
1023
|
-
let clockMethodPattern = new RegExp(
|
|
1024
|
-
String(Object.keys(clock).join("|"))
|
|
1025
|
-
);
|
|
1026
|
-
if (addTimerReturnsObject) {
|
|
1027
|
-
clockMethodPattern = new RegExp(
|
|
1028
|
-
`\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+`
|
|
1029
|
-
);
|
|
1030
|
-
}
|
|
1031
|
-
let matchedLineIndex = -1;
|
|
1032
|
-
job.error.stack.split("\n").some(function(line, i) {
|
|
1033
|
-
const matchedComputedTarget = line.match(computedTargetPattern);
|
|
1034
|
-
if (matchedComputedTarget) {
|
|
1035
|
-
matchedLineIndex = i;
|
|
1036
|
-
return true;
|
|
1037
|
-
}
|
|
1038
|
-
const matchedClockMethod = line.match(clockMethodPattern);
|
|
1039
|
-
if (matchedClockMethod) {
|
|
1040
|
-
matchedLineIndex = i;
|
|
1041
|
-
return false;
|
|
1042
|
-
}
|
|
1043
|
-
return matchedLineIndex >= 0;
|
|
1044
|
-
});
|
|
1045
|
-
const stack = `${infiniteLoopError}
|
|
1046
|
-
${job.type || "Microtask"} - ${job.func.name || "anonymous"}
|
|
1047
|
-
${job.error.stack.split("\n").slice(matchedLineIndex + 1).join("\n")}`;
|
|
1048
|
-
try {
|
|
1049
|
-
Object.defineProperty(infiniteLoopError, "stack", {
|
|
1050
|
-
value: stack
|
|
1051
|
-
});
|
|
1052
|
-
} catch (e) {
|
|
1053
|
-
}
|
|
1054
|
-
return infiniteLoopError;
|
|
1055
|
-
}
|
|
1056
|
-
function createDate() {
|
|
1057
|
-
class ClockDate extends NativeDate {
|
|
1058
|
-
/**
|
|
1059
|
-
* @param {number} year
|
|
1060
|
-
* @param {number} month
|
|
1061
|
-
* @param {number} date
|
|
1062
|
-
* @param {number} hour
|
|
1063
|
-
* @param {number} minute
|
|
1064
|
-
* @param {number} second
|
|
1065
|
-
* @param {number} ms
|
|
1066
|
-
* @returns void
|
|
1067
|
-
*/
|
|
1068
|
-
// eslint-disable-next-line no-unused-vars
|
|
1069
|
-
constructor(year, month, date, hour, minute, second, ms) {
|
|
1070
|
-
if (arguments.length === 0) {
|
|
1071
|
-
super(ClockDate.clock.now);
|
|
1072
|
-
} else {
|
|
1073
|
-
super(...arguments);
|
|
1074
|
-
}
|
|
1075
|
-
Object.defineProperty(this, "constructor", {
|
|
1076
|
-
value: NativeDate,
|
|
1077
|
-
enumerable: false
|
|
1078
|
-
});
|
|
1079
|
-
}
|
|
1080
|
-
static [Symbol.hasInstance](instance) {
|
|
1081
|
-
return instance instanceof NativeDate;
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
ClockDate.isFake = true;
|
|
1085
|
-
if (NativeDate.now) {
|
|
1086
|
-
ClockDate.now = function now2() {
|
|
1087
|
-
return ClockDate.clock.now;
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
if (NativeDate.toSource) {
|
|
1091
|
-
ClockDate.toSource = function toSource() {
|
|
1092
|
-
return NativeDate.toSource();
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
ClockDate.toString = function toString() {
|
|
1096
|
-
return NativeDate.toString();
|
|
1097
|
-
};
|
|
1098
|
-
const ClockDateProxy = new Proxy(ClockDate, {
|
|
1099
|
-
// handler for [[Call]] invocations (i.e. not using `new`)
|
|
1100
|
-
apply() {
|
|
1101
|
-
if (this instanceof ClockDate) {
|
|
1102
|
-
throw new TypeError(
|
|
1103
|
-
"A Proxy should only capture `new` calls with the `construct` handler. This is not supposed to be possible, so check the logic."
|
|
1104
|
-
);
|
|
1105
|
-
}
|
|
1106
|
-
return new NativeDate(ClockDate.clock.now).toString();
|
|
1107
|
-
}
|
|
1108
|
-
});
|
|
1109
|
-
return ClockDateProxy;
|
|
1110
|
-
}
|
|
1111
|
-
function createIntl() {
|
|
1112
|
-
const ClockIntl = {};
|
|
1113
|
-
Object.getOwnPropertyNames(NativeIntl).forEach(
|
|
1114
|
-
(property) => ClockIntl[property] = NativeIntl[property]
|
|
1115
|
-
);
|
|
1116
|
-
ClockIntl.DateTimeFormat = function(...args) {
|
|
1117
|
-
const realFormatter = new NativeIntl.DateTimeFormat(...args);
|
|
1118
|
-
const formatter = {};
|
|
1119
|
-
["formatRange", "formatRangeToParts", "resolvedOptions"].forEach(
|
|
1120
|
-
(method) => {
|
|
1121
|
-
formatter[method] = realFormatter[method].bind(realFormatter);
|
|
1122
|
-
}
|
|
1123
|
-
);
|
|
1124
|
-
["format", "formatToParts"].forEach((method) => {
|
|
1125
|
-
formatter[method] = function(date) {
|
|
1126
|
-
return realFormatter[method](date || ClockIntl.clock.now);
|
|
1127
|
-
};
|
|
1128
|
-
});
|
|
1129
|
-
return formatter;
|
|
1130
|
-
};
|
|
1131
|
-
ClockIntl.DateTimeFormat.prototype = Object.create(
|
|
1132
|
-
NativeIntl.DateTimeFormat.prototype
|
|
1133
|
-
);
|
|
1134
|
-
ClockIntl.DateTimeFormat.supportedLocalesOf = NativeIntl.DateTimeFormat.supportedLocalesOf;
|
|
1135
|
-
return ClockIntl;
|
|
1136
|
-
}
|
|
1137
|
-
function enqueueJob(clock, job) {
|
|
1138
|
-
if (!clock.jobs) {
|
|
1139
|
-
clock.jobs = [];
|
|
1140
|
-
}
|
|
1141
|
-
clock.jobs.push(job);
|
|
1142
|
-
}
|
|
1143
|
-
function runJobs(clock) {
|
|
1144
|
-
if (!clock.jobs) {
|
|
1145
|
-
return;
|
|
1146
|
-
}
|
|
1147
|
-
for (let i = 0; i < clock.jobs.length; i++) {
|
|
1148
|
-
const job = clock.jobs[i];
|
|
1149
|
-
job.func.apply(null, job.args);
|
|
1150
|
-
checkIsNearInfiniteLimit(clock, i);
|
|
1151
|
-
if (clock.loopLimit && i > clock.loopLimit) {
|
|
1152
|
-
throw getInfiniteLoopError(clock, job);
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
resetIsNearInfiniteLimit();
|
|
1156
|
-
clock.jobs = [];
|
|
1157
|
-
}
|
|
1158
|
-
function addTimer(clock, timer) {
|
|
1159
|
-
if (timer.func === void 0) {
|
|
1160
|
-
throw new Error("Callback must be provided to timer calls");
|
|
1161
|
-
}
|
|
1162
|
-
if (addTimerReturnsObject) {
|
|
1163
|
-
if (typeof timer.func !== "function") {
|
|
1164
|
-
throw new TypeError(
|
|
1165
|
-
`[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${timer.func} of type ${typeof timer.func}`
|
|
1166
|
-
);
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
if (isNearInfiniteLimit) {
|
|
1170
|
-
timer.error = new Error();
|
|
1171
|
-
}
|
|
1172
|
-
timer.type = timer.immediate ? "Immediate" : "Timeout";
|
|
1173
|
-
if (timer.hasOwnProperty("delay")) {
|
|
1174
|
-
if (typeof timer.delay !== "number") {
|
|
1175
|
-
timer.delay = parseInt(timer.delay, 10);
|
|
1176
|
-
}
|
|
1177
|
-
if (!isNumberFinite(timer.delay)) {
|
|
1178
|
-
timer.delay = 0;
|
|
1179
|
-
}
|
|
1180
|
-
timer.delay = timer.delay > maxTimeout ? 1 : timer.delay;
|
|
1181
|
-
timer.delay = Math.max(0, timer.delay);
|
|
1182
|
-
}
|
|
1183
|
-
if (timer.hasOwnProperty("interval")) {
|
|
1184
|
-
timer.type = "Interval";
|
|
1185
|
-
timer.interval = timer.interval > maxTimeout ? 1 : timer.interval;
|
|
1186
|
-
}
|
|
1187
|
-
if (timer.hasOwnProperty("animation")) {
|
|
1188
|
-
timer.type = "AnimationFrame";
|
|
1189
|
-
timer.animation = true;
|
|
1190
|
-
}
|
|
1191
|
-
if (timer.hasOwnProperty("idleCallback")) {
|
|
1192
|
-
timer.type = "IdleCallback";
|
|
1193
|
-
timer.idleCallback = true;
|
|
1194
|
-
}
|
|
1195
|
-
if (!clock.timers) {
|
|
1196
|
-
clock.timers = {};
|
|
1197
|
-
}
|
|
1198
|
-
timer.id = uniqueTimerId++;
|
|
1199
|
-
timer.createdAt = clock.now;
|
|
1200
|
-
timer.callAt = clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0));
|
|
1201
|
-
clock.timers[timer.id] = timer;
|
|
1202
|
-
if (addTimerReturnsObject) {
|
|
1203
|
-
const res = {
|
|
1204
|
-
refed: true,
|
|
1205
|
-
ref: function() {
|
|
1206
|
-
this.refed = true;
|
|
1207
|
-
return res;
|
|
1208
|
-
},
|
|
1209
|
-
unref: function() {
|
|
1210
|
-
this.refed = false;
|
|
1211
|
-
return res;
|
|
1212
|
-
},
|
|
1213
|
-
hasRef: function() {
|
|
1214
|
-
return this.refed;
|
|
1215
|
-
},
|
|
1216
|
-
refresh: function() {
|
|
1217
|
-
timer.callAt = clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0));
|
|
1218
|
-
clock.timers[timer.id] = timer;
|
|
1219
|
-
return res;
|
|
1220
|
-
},
|
|
1221
|
-
[Symbol.toPrimitive]: function() {
|
|
1222
|
-
return timer.id;
|
|
1223
|
-
}
|
|
1224
|
-
};
|
|
1225
|
-
return res;
|
|
1226
|
-
}
|
|
1227
|
-
return timer.id;
|
|
1228
|
-
}
|
|
1229
|
-
function compareTimers(a, b) {
|
|
1230
|
-
if (a.callAt < b.callAt) {
|
|
1231
|
-
return -1;
|
|
1232
|
-
}
|
|
1233
|
-
if (a.callAt > b.callAt) {
|
|
1234
|
-
return 1;
|
|
1235
|
-
}
|
|
1236
|
-
if (a.immediate && !b.immediate) {
|
|
1237
|
-
return -1;
|
|
1238
|
-
}
|
|
1239
|
-
if (!a.immediate && b.immediate) {
|
|
1240
|
-
return 1;
|
|
1241
|
-
}
|
|
1242
|
-
if (a.createdAt < b.createdAt) {
|
|
1243
|
-
return -1;
|
|
1244
|
-
}
|
|
1245
|
-
if (a.createdAt > b.createdAt) {
|
|
1246
|
-
return 1;
|
|
1247
|
-
}
|
|
1248
|
-
if (a.id < b.id) {
|
|
1249
|
-
return -1;
|
|
1250
|
-
}
|
|
1251
|
-
if (a.id > b.id) {
|
|
1252
|
-
return 1;
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
function firstTimerInRange(clock, from, to) {
|
|
1256
|
-
const timers2 = clock.timers;
|
|
1257
|
-
let timer = null;
|
|
1258
|
-
let id, isInRange;
|
|
1259
|
-
for (id in timers2) {
|
|
1260
|
-
if (timers2.hasOwnProperty(id)) {
|
|
1261
|
-
isInRange = inRange(from, to, timers2[id]);
|
|
1262
|
-
if (isInRange && (!timer || compareTimers(timer, timers2[id]) === 1)) {
|
|
1263
|
-
timer = timers2[id];
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
return timer;
|
|
1268
|
-
}
|
|
1269
|
-
function firstTimer(clock) {
|
|
1270
|
-
const timers2 = clock.timers;
|
|
1271
|
-
let timer = null;
|
|
1272
|
-
let id;
|
|
1273
|
-
for (id in timers2) {
|
|
1274
|
-
if (timers2.hasOwnProperty(id)) {
|
|
1275
|
-
if (!timer || compareTimers(timer, timers2[id]) === 1) {
|
|
1276
|
-
timer = timers2[id];
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
return timer;
|
|
1281
|
-
}
|
|
1282
|
-
function lastTimer(clock) {
|
|
1283
|
-
const timers2 = clock.timers;
|
|
1284
|
-
let timer = null;
|
|
1285
|
-
let id;
|
|
1286
|
-
for (id in timers2) {
|
|
1287
|
-
if (timers2.hasOwnProperty(id)) {
|
|
1288
|
-
if (!timer || compareTimers(timer, timers2[id]) === -1) {
|
|
1289
|
-
timer = timers2[id];
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
return timer;
|
|
1294
|
-
}
|
|
1295
|
-
function callTimer(clock, timer) {
|
|
1296
|
-
if (typeof timer.interval === "number") {
|
|
1297
|
-
clock.timers[timer.id].callAt += timer.interval;
|
|
1298
|
-
} else {
|
|
1299
|
-
delete clock.timers[timer.id];
|
|
1300
|
-
}
|
|
1301
|
-
if (typeof timer.func === "function") {
|
|
1302
|
-
timer.func.apply(null, timer.args);
|
|
1303
|
-
} else {
|
|
1304
|
-
const eval2 = eval;
|
|
1305
|
-
(function() {
|
|
1306
|
-
eval2(timer.func);
|
|
1307
|
-
})();
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
function getClearHandler(ttype) {
|
|
1311
|
-
if (ttype === "IdleCallback" || ttype === "AnimationFrame") {
|
|
1312
|
-
return `cancel${ttype}`;
|
|
1313
|
-
}
|
|
1314
|
-
return `clear${ttype}`;
|
|
1315
|
-
}
|
|
1316
|
-
function getScheduleHandler(ttype) {
|
|
1317
|
-
if (ttype === "IdleCallback" || ttype === "AnimationFrame") {
|
|
1318
|
-
return `request${ttype}`;
|
|
1319
|
-
}
|
|
1320
|
-
return `set${ttype}`;
|
|
1321
|
-
}
|
|
1322
|
-
function createWarnOnce() {
|
|
1323
|
-
let calls = 0;
|
|
1324
|
-
return function(msg) {
|
|
1325
|
-
!calls++ && console.warn(msg);
|
|
1326
|
-
};
|
|
1327
|
-
}
|
|
1328
|
-
const warnOnce = createWarnOnce();
|
|
1329
|
-
function clearTimer(clock, timerId, ttype) {
|
|
1330
|
-
if (!timerId) {
|
|
1331
|
-
return;
|
|
1332
|
-
}
|
|
1333
|
-
if (!clock.timers) {
|
|
1334
|
-
clock.timers = {};
|
|
1335
|
-
}
|
|
1336
|
-
const id = Number(timerId);
|
|
1337
|
-
if (Number.isNaN(id) || id < idCounterStart) {
|
|
1338
|
-
const handlerName = getClearHandler(ttype);
|
|
1339
|
-
if (clock.shouldClearNativeTimers === true) {
|
|
1340
|
-
const nativeHandler = clock[`_${handlerName}`];
|
|
1341
|
-
return typeof nativeHandler === "function" ? nativeHandler(timerId) : void 0;
|
|
1342
|
-
}
|
|
1343
|
-
warnOnce(
|
|
1344
|
-
`FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.
|
|
1345
|
-
To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`
|
|
1346
|
-
);
|
|
1347
|
-
}
|
|
1348
|
-
if (clock.timers.hasOwnProperty(id)) {
|
|
1349
|
-
const timer = clock.timers[id];
|
|
1350
|
-
if (timer.type === ttype || timer.type === "Timeout" && ttype === "Interval" || timer.type === "Interval" && ttype === "Timeout") {
|
|
1351
|
-
delete clock.timers[id];
|
|
1352
|
-
} else {
|
|
1353
|
-
const clear = getClearHandler(ttype);
|
|
1354
|
-
const schedule = getScheduleHandler(timer.type);
|
|
1355
|
-
throw new Error(
|
|
1356
|
-
`Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`
|
|
1357
|
-
);
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
function uninstall(clock, config) {
|
|
1362
|
-
let method, i, l;
|
|
1363
|
-
const installedHrTime = "_hrtime";
|
|
1364
|
-
const installedNextTick = "_nextTick";
|
|
1365
|
-
for (i = 0, l = clock.methods.length; i < l; i++) {
|
|
1366
|
-
method = clock.methods[i];
|
|
1367
|
-
if (method === "hrtime" && _global.process) {
|
|
1368
|
-
_global.process.hrtime = clock[installedHrTime];
|
|
1369
|
-
} else if (method === "nextTick" && _global.process) {
|
|
1370
|
-
_global.process.nextTick = clock[installedNextTick];
|
|
1371
|
-
} else if (method === "performance") {
|
|
1372
|
-
const originalPerfDescriptor = Object.getOwnPropertyDescriptor(
|
|
1373
|
-
clock,
|
|
1374
|
-
`_${method}`
|
|
1375
|
-
);
|
|
1376
|
-
if (originalPerfDescriptor && originalPerfDescriptor.get && !originalPerfDescriptor.set) {
|
|
1377
|
-
Object.defineProperty(
|
|
1378
|
-
_global,
|
|
1379
|
-
method,
|
|
1380
|
-
originalPerfDescriptor
|
|
1381
|
-
);
|
|
1382
|
-
} else if (originalPerfDescriptor.configurable) {
|
|
1383
|
-
_global[method] = clock[`_${method}`];
|
|
1384
|
-
}
|
|
1385
|
-
} else {
|
|
1386
|
-
if (_global[method] && _global[method].hadOwnProperty) {
|
|
1387
|
-
_global[method] = clock[`_${method}`];
|
|
1388
|
-
} else {
|
|
1389
|
-
try {
|
|
1390
|
-
delete _global[method];
|
|
1391
|
-
} catch (ignore) {
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
if (clock.timersModuleMethods !== void 0) {
|
|
1396
|
-
for (let j = 0; j < clock.timersModuleMethods.length; j++) {
|
|
1397
|
-
const entry = clock.timersModuleMethods[j];
|
|
1398
|
-
timersModule[entry.methodName] = entry.original;
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
if (clock.timersPromisesModuleMethods !== void 0) {
|
|
1402
|
-
for (let j = 0; j < clock.timersPromisesModuleMethods.length; j++) {
|
|
1403
|
-
const entry = clock.timersPromisesModuleMethods[j];
|
|
1404
|
-
timersPromisesModule[entry.methodName] = entry.original;
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
if (config.shouldAdvanceTime === true) {
|
|
1409
|
-
_global.clearInterval(clock.attachedInterval);
|
|
1410
|
-
}
|
|
1411
|
-
clock.methods = [];
|
|
1412
|
-
for (const [listener, signal] of clock.abortListenerMap.entries()) {
|
|
1413
|
-
signal.removeEventListener("abort", listener);
|
|
1414
|
-
clock.abortListenerMap.delete(listener);
|
|
1415
|
-
}
|
|
1416
|
-
if (!clock.timers) {
|
|
1417
|
-
return [];
|
|
1418
|
-
}
|
|
1419
|
-
return Object.keys(clock.timers).map(function mapper(key) {
|
|
1420
|
-
return clock.timers[key];
|
|
1421
|
-
});
|
|
1422
|
-
}
|
|
1423
|
-
function hijackMethod(target, method, clock) {
|
|
1424
|
-
clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call(
|
|
1425
|
-
target,
|
|
1426
|
-
method
|
|
1427
|
-
);
|
|
1428
|
-
clock[`_${method}`] = target[method];
|
|
1429
|
-
if (method === "Date") {
|
|
1430
|
-
target[method] = clock[method];
|
|
1431
|
-
} else if (method === "Intl") {
|
|
1432
|
-
target[method] = clock[method];
|
|
1433
|
-
} else if (method === "performance") {
|
|
1434
|
-
const originalPerfDescriptor = Object.getOwnPropertyDescriptor(
|
|
1435
|
-
target,
|
|
1436
|
-
method
|
|
1437
|
-
);
|
|
1438
|
-
if (originalPerfDescriptor && originalPerfDescriptor.get && !originalPerfDescriptor.set) {
|
|
1439
|
-
Object.defineProperty(
|
|
1440
|
-
clock,
|
|
1441
|
-
`_${method}`,
|
|
1442
|
-
originalPerfDescriptor
|
|
1443
|
-
);
|
|
1444
|
-
const perfDescriptor = Object.getOwnPropertyDescriptor(
|
|
1445
|
-
clock,
|
|
1446
|
-
method
|
|
1447
|
-
);
|
|
1448
|
-
Object.defineProperty(target, method, perfDescriptor);
|
|
1449
|
-
} else {
|
|
1450
|
-
target[method] = clock[method];
|
|
1451
|
-
}
|
|
1452
|
-
} else {
|
|
1453
|
-
target[method] = function() {
|
|
1454
|
-
return clock[method].apply(clock, arguments);
|
|
1455
|
-
};
|
|
1456
|
-
Object.defineProperties(
|
|
1457
|
-
target[method],
|
|
1458
|
-
Object.getOwnPropertyDescriptors(clock[method])
|
|
1459
|
-
);
|
|
1460
|
-
}
|
|
1461
|
-
target[method].clock = clock;
|
|
1462
|
-
}
|
|
1463
|
-
function doIntervalTick(clock, advanceTimeDelta) {
|
|
1464
|
-
clock.tick(advanceTimeDelta);
|
|
1465
|
-
}
|
|
1466
|
-
const timers = {
|
|
1467
|
-
setTimeout: _global.setTimeout,
|
|
1468
|
-
clearTimeout: _global.clearTimeout,
|
|
1469
|
-
setInterval: _global.setInterval,
|
|
1470
|
-
clearInterval: _global.clearInterval,
|
|
1471
|
-
Date: _global.Date
|
|
1472
|
-
};
|
|
1473
|
-
if (isPresent.setImmediate) {
|
|
1474
|
-
timers.setImmediate = _global.setImmediate;
|
|
1475
|
-
}
|
|
1476
|
-
if (isPresent.clearImmediate) {
|
|
1477
|
-
timers.clearImmediate = _global.clearImmediate;
|
|
1478
|
-
}
|
|
1479
|
-
if (isPresent.hrtime) {
|
|
1480
|
-
timers.hrtime = _global.process.hrtime;
|
|
1481
|
-
}
|
|
1482
|
-
if (isPresent.nextTick) {
|
|
1483
|
-
timers.nextTick = _global.process.nextTick;
|
|
1484
|
-
}
|
|
1485
|
-
if (isPresent.performance) {
|
|
1486
|
-
timers.performance = _global.performance;
|
|
1487
|
-
}
|
|
1488
|
-
if (isPresent.requestAnimationFrame) {
|
|
1489
|
-
timers.requestAnimationFrame = _global.requestAnimationFrame;
|
|
1490
|
-
}
|
|
1491
|
-
if (isPresent.queueMicrotask) {
|
|
1492
|
-
timers.queueMicrotask = _global.queueMicrotask;
|
|
1493
|
-
}
|
|
1494
|
-
if (isPresent.cancelAnimationFrame) {
|
|
1495
|
-
timers.cancelAnimationFrame = _global.cancelAnimationFrame;
|
|
1496
|
-
}
|
|
1497
|
-
if (isPresent.requestIdleCallback) {
|
|
1498
|
-
timers.requestIdleCallback = _global.requestIdleCallback;
|
|
1499
|
-
}
|
|
1500
|
-
if (isPresent.cancelIdleCallback) {
|
|
1501
|
-
timers.cancelIdleCallback = _global.cancelIdleCallback;
|
|
1502
|
-
}
|
|
1503
|
-
if (isPresent.Intl) {
|
|
1504
|
-
timers.Intl = NativeIntl;
|
|
1505
|
-
}
|
|
1506
|
-
const originalSetTimeout = _global.setImmediate || _global.setTimeout;
|
|
1507
|
-
function createClock(start, loopLimit) {
|
|
1508
|
-
start = Math.floor(getEpoch(start));
|
|
1509
|
-
loopLimit = loopLimit || 1e3;
|
|
1510
|
-
let nanos = 0;
|
|
1511
|
-
const adjustedSystemTime = [0, 0];
|
|
1512
|
-
const clock = {
|
|
1513
|
-
now: start,
|
|
1514
|
-
Date: createDate(),
|
|
1515
|
-
loopLimit
|
|
1516
|
-
};
|
|
1517
|
-
clock.Date.clock = clock;
|
|
1518
|
-
function getTimeToNextFrame() {
|
|
1519
|
-
return 16 - (clock.now - start) % 16;
|
|
1520
|
-
}
|
|
1521
|
-
function hrtime(prev) {
|
|
1522
|
-
const millisSinceStart = clock.now - adjustedSystemTime[0] - start;
|
|
1523
|
-
const secsSinceStart = Math.floor(millisSinceStart / 1e3);
|
|
1524
|
-
const remainderInNanos = (millisSinceStart - secsSinceStart * 1e3) * 1e6 + nanos - adjustedSystemTime[1];
|
|
1525
|
-
if (Array.isArray(prev)) {
|
|
1526
|
-
if (prev[1] > 1e9) {
|
|
1527
|
-
throw new TypeError(
|
|
1528
|
-
"Number of nanoseconds can't exceed a billion"
|
|
1529
|
-
);
|
|
1530
|
-
}
|
|
1531
|
-
const oldSecs = prev[0];
|
|
1532
|
-
let nanoDiff = remainderInNanos - prev[1];
|
|
1533
|
-
let secDiff = secsSinceStart - oldSecs;
|
|
1534
|
-
if (nanoDiff < 0) {
|
|
1535
|
-
nanoDiff += 1e9;
|
|
1536
|
-
secDiff -= 1;
|
|
1537
|
-
}
|
|
1538
|
-
return [secDiff, nanoDiff];
|
|
1539
|
-
}
|
|
1540
|
-
return [secsSinceStart, remainderInNanos];
|
|
1541
|
-
}
|
|
1542
|
-
function fakePerformanceNow() {
|
|
1543
|
-
const hrt = hrtime();
|
|
1544
|
-
const millis = hrt[0] * 1e3 + hrt[1] / 1e6;
|
|
1545
|
-
return millis;
|
|
1546
|
-
}
|
|
1547
|
-
if (isPresent.hrtimeBigint) {
|
|
1548
|
-
hrtime.bigint = function() {
|
|
1549
|
-
const parts = hrtime();
|
|
1550
|
-
return BigInt(parts[0]) * BigInt(1e9) + BigInt(parts[1]);
|
|
1551
|
-
};
|
|
1552
|
-
}
|
|
1553
|
-
if (isPresent.Intl) {
|
|
1554
|
-
clock.Intl = createIntl();
|
|
1555
|
-
clock.Intl.clock = clock;
|
|
1556
|
-
}
|
|
1557
|
-
clock.requestIdleCallback = function requestIdleCallback(func, timeout) {
|
|
1558
|
-
let timeToNextIdlePeriod = 0;
|
|
1559
|
-
if (clock.countTimers() > 0) {
|
|
1560
|
-
timeToNextIdlePeriod = 50;
|
|
1561
|
-
}
|
|
1562
|
-
const result = addTimer(clock, {
|
|
1563
|
-
func,
|
|
1564
|
-
args: Array.prototype.slice.call(arguments, 2),
|
|
1565
|
-
delay: typeof timeout === "undefined" ? timeToNextIdlePeriod : Math.min(timeout, timeToNextIdlePeriod),
|
|
1566
|
-
idleCallback: true
|
|
1567
|
-
});
|
|
1568
|
-
return Number(result);
|
|
1569
|
-
};
|
|
1570
|
-
clock.cancelIdleCallback = function cancelIdleCallback(timerId) {
|
|
1571
|
-
return clearTimer(clock, timerId, "IdleCallback");
|
|
1572
|
-
};
|
|
1573
|
-
clock.setTimeout = function setTimeout(func, timeout) {
|
|
1574
|
-
return addTimer(clock, {
|
|
1575
|
-
func,
|
|
1576
|
-
args: Array.prototype.slice.call(arguments, 2),
|
|
1577
|
-
delay: timeout
|
|
1578
|
-
});
|
|
1579
|
-
};
|
|
1580
|
-
if (typeof _global.Promise !== "undefined" && utilPromisify) {
|
|
1581
|
-
clock.setTimeout[utilPromisify.custom] = function promisifiedSetTimeout(timeout, arg) {
|
|
1582
|
-
return new _global.Promise(function setTimeoutExecutor(resolve) {
|
|
1583
|
-
addTimer(clock, {
|
|
1584
|
-
func: resolve,
|
|
1585
|
-
args: [arg],
|
|
1586
|
-
delay: timeout
|
|
1587
|
-
});
|
|
1588
|
-
});
|
|
1589
|
-
};
|
|
1590
|
-
}
|
|
1591
|
-
clock.clearTimeout = function clearTimeout(timerId) {
|
|
1592
|
-
return clearTimer(clock, timerId, "Timeout");
|
|
1593
|
-
};
|
|
1594
|
-
clock.nextTick = function nextTick(func) {
|
|
1595
|
-
return enqueueJob(clock, {
|
|
1596
|
-
func,
|
|
1597
|
-
args: Array.prototype.slice.call(arguments, 1),
|
|
1598
|
-
error: isNearInfiniteLimit ? new Error() : null
|
|
1599
|
-
});
|
|
1600
|
-
};
|
|
1601
|
-
clock.queueMicrotask = function queueMicrotask(func) {
|
|
1602
|
-
return clock.nextTick(func);
|
|
1603
|
-
};
|
|
1604
|
-
clock.setInterval = function setInterval(func, timeout) {
|
|
1605
|
-
timeout = parseInt(timeout, 10);
|
|
1606
|
-
return addTimer(clock, {
|
|
1607
|
-
func,
|
|
1608
|
-
args: Array.prototype.slice.call(arguments, 2),
|
|
1609
|
-
delay: timeout,
|
|
1610
|
-
interval: timeout
|
|
1611
|
-
});
|
|
1612
|
-
};
|
|
1613
|
-
clock.clearInterval = function clearInterval(timerId) {
|
|
1614
|
-
return clearTimer(clock, timerId, "Interval");
|
|
1615
|
-
};
|
|
1616
|
-
if (isPresent.setImmediate) {
|
|
1617
|
-
clock.setImmediate = function setImmediate(func) {
|
|
1618
|
-
return addTimer(clock, {
|
|
1619
|
-
func,
|
|
1620
|
-
args: Array.prototype.slice.call(arguments, 1),
|
|
1621
|
-
immediate: true
|
|
1622
|
-
});
|
|
1623
|
-
};
|
|
1624
|
-
if (typeof _global.Promise !== "undefined" && utilPromisify) {
|
|
1625
|
-
clock.setImmediate[utilPromisify.custom] = function promisifiedSetImmediate(arg) {
|
|
1626
|
-
return new _global.Promise(
|
|
1627
|
-
function setImmediateExecutor(resolve) {
|
|
1628
|
-
addTimer(clock, {
|
|
1629
|
-
func: resolve,
|
|
1630
|
-
args: [arg],
|
|
1631
|
-
immediate: true
|
|
1632
|
-
});
|
|
1633
|
-
}
|
|
1634
|
-
);
|
|
1635
|
-
};
|
|
1636
|
-
}
|
|
1637
|
-
clock.clearImmediate = function clearImmediate(timerId) {
|
|
1638
|
-
return clearTimer(clock, timerId, "Immediate");
|
|
1639
|
-
};
|
|
1640
|
-
}
|
|
1641
|
-
clock.countTimers = function countTimers() {
|
|
1642
|
-
return Object.keys(clock.timers || {}).length + (clock.jobs || []).length;
|
|
1643
|
-
};
|
|
1644
|
-
clock.requestAnimationFrame = function requestAnimationFrame(func) {
|
|
1645
|
-
const result = addTimer(clock, {
|
|
1646
|
-
func,
|
|
1647
|
-
delay: getTimeToNextFrame(),
|
|
1648
|
-
get args() {
|
|
1649
|
-
return [fakePerformanceNow()];
|
|
1650
|
-
},
|
|
1651
|
-
animation: true
|
|
1652
|
-
});
|
|
1653
|
-
return Number(result);
|
|
1654
|
-
};
|
|
1655
|
-
clock.cancelAnimationFrame = function cancelAnimationFrame(timerId) {
|
|
1656
|
-
return clearTimer(clock, timerId, "AnimationFrame");
|
|
1657
|
-
};
|
|
1658
|
-
clock.runMicrotasks = function runMicrotasks() {
|
|
1659
|
-
runJobs(clock);
|
|
1660
|
-
};
|
|
1661
|
-
function doTick(tickValue, isAsync, resolve, reject) {
|
|
1662
|
-
const msFloat = typeof tickValue === "number" ? tickValue : parseTime(tickValue);
|
|
1663
|
-
const ms = Math.floor(msFloat);
|
|
1664
|
-
const remainder = nanoRemainder(msFloat);
|
|
1665
|
-
let nanosTotal = nanos + remainder;
|
|
1666
|
-
let tickTo = clock.now + ms;
|
|
1667
|
-
if (msFloat < 0) {
|
|
1668
|
-
throw new TypeError("Negative ticks are not supported");
|
|
1669
|
-
}
|
|
1670
|
-
if (nanosTotal >= 1e6) {
|
|
1671
|
-
tickTo += 1;
|
|
1672
|
-
nanosTotal -= 1e6;
|
|
1673
|
-
}
|
|
1674
|
-
nanos = nanosTotal;
|
|
1675
|
-
let tickFrom = clock.now;
|
|
1676
|
-
let previous = clock.now;
|
|
1677
|
-
let timer, firstException, oldNow, nextPromiseTick, compensationCheck, postTimerCall;
|
|
1678
|
-
clock.duringTick = true;
|
|
1679
|
-
oldNow = clock.now;
|
|
1680
|
-
runJobs(clock);
|
|
1681
|
-
if (oldNow !== clock.now) {
|
|
1682
|
-
tickFrom += clock.now - oldNow;
|
|
1683
|
-
tickTo += clock.now - oldNow;
|
|
1684
|
-
}
|
|
1685
|
-
function doTickInner() {
|
|
1686
|
-
timer = firstTimerInRange(clock, tickFrom, tickTo);
|
|
1687
|
-
while (timer && tickFrom <= tickTo) {
|
|
1688
|
-
if (clock.timers[timer.id]) {
|
|
1689
|
-
tickFrom = timer.callAt;
|
|
1690
|
-
clock.now = timer.callAt;
|
|
1691
|
-
oldNow = clock.now;
|
|
1692
|
-
try {
|
|
1693
|
-
runJobs(clock);
|
|
1694
|
-
callTimer(clock, timer);
|
|
1695
|
-
} catch (e) {
|
|
1696
|
-
firstException = firstException || e;
|
|
1697
|
-
}
|
|
1698
|
-
if (isAsync) {
|
|
1699
|
-
originalSetTimeout(nextPromiseTick);
|
|
1700
|
-
return;
|
|
1701
|
-
}
|
|
1702
|
-
compensationCheck();
|
|
1703
|
-
}
|
|
1704
|
-
postTimerCall();
|
|
1705
|
-
}
|
|
1706
|
-
oldNow = clock.now;
|
|
1707
|
-
runJobs(clock);
|
|
1708
|
-
if (oldNow !== clock.now) {
|
|
1709
|
-
tickFrom += clock.now - oldNow;
|
|
1710
|
-
tickTo += clock.now - oldNow;
|
|
1711
|
-
}
|
|
1712
|
-
clock.duringTick = false;
|
|
1713
|
-
timer = firstTimerInRange(clock, tickFrom, tickTo);
|
|
1714
|
-
if (timer) {
|
|
1715
|
-
try {
|
|
1716
|
-
clock.tick(tickTo - clock.now);
|
|
1717
|
-
} catch (e) {
|
|
1718
|
-
firstException = firstException || e;
|
|
1719
|
-
}
|
|
1720
|
-
} else {
|
|
1721
|
-
clock.now = tickTo;
|
|
1722
|
-
nanos = nanosTotal;
|
|
1723
|
-
}
|
|
1724
|
-
if (firstException) {
|
|
1725
|
-
throw firstException;
|
|
1726
|
-
}
|
|
1727
|
-
if (isAsync) {
|
|
1728
|
-
resolve(clock.now);
|
|
1729
|
-
} else {
|
|
1730
|
-
return clock.now;
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
|
-
nextPromiseTick = isAsync && function() {
|
|
1734
|
-
try {
|
|
1735
|
-
compensationCheck();
|
|
1736
|
-
postTimerCall();
|
|
1737
|
-
doTickInner();
|
|
1738
|
-
} catch (e) {
|
|
1739
|
-
reject(e);
|
|
1740
|
-
}
|
|
1741
|
-
};
|
|
1742
|
-
compensationCheck = function() {
|
|
1743
|
-
if (oldNow !== clock.now) {
|
|
1744
|
-
tickFrom += clock.now - oldNow;
|
|
1745
|
-
tickTo += clock.now - oldNow;
|
|
1746
|
-
previous += clock.now - oldNow;
|
|
1747
|
-
}
|
|
1748
|
-
};
|
|
1749
|
-
postTimerCall = function() {
|
|
1750
|
-
timer = firstTimerInRange(clock, previous, tickTo);
|
|
1751
|
-
previous = tickFrom;
|
|
1752
|
-
};
|
|
1753
|
-
return doTickInner();
|
|
1754
|
-
}
|
|
1755
|
-
clock.tick = function tick(tickValue) {
|
|
1756
|
-
return doTick(tickValue, false);
|
|
1757
|
-
};
|
|
1758
|
-
if (typeof _global.Promise !== "undefined") {
|
|
1759
|
-
clock.tickAsync = function tickAsync(tickValue) {
|
|
1760
|
-
return new _global.Promise(function(resolve, reject) {
|
|
1761
|
-
originalSetTimeout(function() {
|
|
1762
|
-
try {
|
|
1763
|
-
doTick(tickValue, true, resolve, reject);
|
|
1764
|
-
} catch (e) {
|
|
1765
|
-
reject(e);
|
|
1766
|
-
}
|
|
1767
|
-
});
|
|
1768
|
-
});
|
|
1769
|
-
};
|
|
1770
|
-
}
|
|
1771
|
-
clock.next = function next() {
|
|
1772
|
-
runJobs(clock);
|
|
1773
|
-
const timer = firstTimer(clock);
|
|
1774
|
-
if (!timer) {
|
|
1775
|
-
return clock.now;
|
|
1776
|
-
}
|
|
1777
|
-
clock.duringTick = true;
|
|
1778
|
-
try {
|
|
1779
|
-
clock.now = timer.callAt;
|
|
1780
|
-
callTimer(clock, timer);
|
|
1781
|
-
runJobs(clock);
|
|
1782
|
-
return clock.now;
|
|
1783
|
-
} finally {
|
|
1784
|
-
clock.duringTick = false;
|
|
1785
|
-
}
|
|
1786
|
-
};
|
|
1787
|
-
if (typeof _global.Promise !== "undefined") {
|
|
1788
|
-
clock.nextAsync = function nextAsync() {
|
|
1789
|
-
return new _global.Promise(function(resolve, reject) {
|
|
1790
|
-
originalSetTimeout(function() {
|
|
1791
|
-
try {
|
|
1792
|
-
const timer = firstTimer(clock);
|
|
1793
|
-
if (!timer) {
|
|
1794
|
-
resolve(clock.now);
|
|
1795
|
-
return;
|
|
1796
|
-
}
|
|
1797
|
-
let err;
|
|
1798
|
-
clock.duringTick = true;
|
|
1799
|
-
clock.now = timer.callAt;
|
|
1800
|
-
try {
|
|
1801
|
-
callTimer(clock, timer);
|
|
1802
|
-
} catch (e) {
|
|
1803
|
-
err = e;
|
|
1804
|
-
}
|
|
1805
|
-
clock.duringTick = false;
|
|
1806
|
-
originalSetTimeout(function() {
|
|
1807
|
-
if (err) {
|
|
1808
|
-
reject(err);
|
|
1809
|
-
} else {
|
|
1810
|
-
resolve(clock.now);
|
|
1811
|
-
}
|
|
1812
|
-
});
|
|
1813
|
-
} catch (e) {
|
|
1814
|
-
reject(e);
|
|
1815
|
-
}
|
|
1816
|
-
});
|
|
1817
|
-
});
|
|
1818
|
-
};
|
|
1819
|
-
}
|
|
1820
|
-
clock.runAll = function runAll() {
|
|
1821
|
-
let numTimers, i;
|
|
1822
|
-
runJobs(clock);
|
|
1823
|
-
for (i = 0; i < clock.loopLimit; i++) {
|
|
1824
|
-
if (!clock.timers) {
|
|
1825
|
-
resetIsNearInfiniteLimit();
|
|
1826
|
-
return clock.now;
|
|
1827
|
-
}
|
|
1828
|
-
numTimers = Object.keys(clock.timers).length;
|
|
1829
|
-
if (numTimers === 0) {
|
|
1830
|
-
resetIsNearInfiniteLimit();
|
|
1831
|
-
return clock.now;
|
|
1832
|
-
}
|
|
1833
|
-
clock.next();
|
|
1834
|
-
checkIsNearInfiniteLimit(clock, i);
|
|
1835
|
-
}
|
|
1836
|
-
const excessJob = firstTimer(clock);
|
|
1837
|
-
throw getInfiniteLoopError(clock, excessJob);
|
|
1838
|
-
};
|
|
1839
|
-
clock.runToFrame = function runToFrame() {
|
|
1840
|
-
return clock.tick(getTimeToNextFrame());
|
|
1841
|
-
};
|
|
1842
|
-
if (typeof _global.Promise !== "undefined") {
|
|
1843
|
-
clock.runAllAsync = function runAllAsync() {
|
|
1844
|
-
return new _global.Promise(function(resolve, reject) {
|
|
1845
|
-
let i = 0;
|
|
1846
|
-
function doRun() {
|
|
1847
|
-
originalSetTimeout(function() {
|
|
1848
|
-
try {
|
|
1849
|
-
runJobs(clock);
|
|
1850
|
-
let numTimers;
|
|
1851
|
-
if (i < clock.loopLimit) {
|
|
1852
|
-
if (!clock.timers) {
|
|
1853
|
-
resetIsNearInfiniteLimit();
|
|
1854
|
-
resolve(clock.now);
|
|
1855
|
-
return;
|
|
1856
|
-
}
|
|
1857
|
-
numTimers = Object.keys(
|
|
1858
|
-
clock.timers
|
|
1859
|
-
).length;
|
|
1860
|
-
if (numTimers === 0) {
|
|
1861
|
-
resetIsNearInfiniteLimit();
|
|
1862
|
-
resolve(clock.now);
|
|
1863
|
-
return;
|
|
1864
|
-
}
|
|
1865
|
-
clock.next();
|
|
1866
|
-
i++;
|
|
1867
|
-
doRun();
|
|
1868
|
-
checkIsNearInfiniteLimit(clock, i);
|
|
1869
|
-
return;
|
|
1870
|
-
}
|
|
1871
|
-
const excessJob = firstTimer(clock);
|
|
1872
|
-
reject(getInfiniteLoopError(clock, excessJob));
|
|
1873
|
-
} catch (e) {
|
|
1874
|
-
reject(e);
|
|
1875
|
-
}
|
|
1876
|
-
});
|
|
1877
|
-
}
|
|
1878
|
-
doRun();
|
|
1879
|
-
});
|
|
1880
|
-
};
|
|
1881
|
-
}
|
|
1882
|
-
clock.runToLast = function runToLast() {
|
|
1883
|
-
const timer = lastTimer(clock);
|
|
1884
|
-
if (!timer) {
|
|
1885
|
-
runJobs(clock);
|
|
1886
|
-
return clock.now;
|
|
1887
|
-
}
|
|
1888
|
-
return clock.tick(timer.callAt - clock.now);
|
|
1889
|
-
};
|
|
1890
|
-
if (typeof _global.Promise !== "undefined") {
|
|
1891
|
-
clock.runToLastAsync = function runToLastAsync() {
|
|
1892
|
-
return new _global.Promise(function(resolve, reject) {
|
|
1893
|
-
originalSetTimeout(function() {
|
|
1894
|
-
try {
|
|
1895
|
-
const timer = lastTimer(clock);
|
|
1896
|
-
if (!timer) {
|
|
1897
|
-
runJobs(clock);
|
|
1898
|
-
resolve(clock.now);
|
|
1899
|
-
}
|
|
1900
|
-
resolve(clock.tickAsync(timer.callAt - clock.now));
|
|
1901
|
-
} catch (e) {
|
|
1902
|
-
reject(e);
|
|
1903
|
-
}
|
|
1904
|
-
});
|
|
1905
|
-
});
|
|
1906
|
-
};
|
|
1907
|
-
}
|
|
1908
|
-
clock.reset = function reset() {
|
|
1909
|
-
nanos = 0;
|
|
1910
|
-
clock.timers = {};
|
|
1911
|
-
clock.jobs = [];
|
|
1912
|
-
clock.now = start;
|
|
1913
|
-
};
|
|
1914
|
-
clock.setSystemTime = function setSystemTime(systemTime) {
|
|
1915
|
-
const newNow = getEpoch(systemTime);
|
|
1916
|
-
const difference = newNow - clock.now;
|
|
1917
|
-
let id, timer;
|
|
1918
|
-
adjustedSystemTime[0] = adjustedSystemTime[0] + difference;
|
|
1919
|
-
adjustedSystemTime[1] = adjustedSystemTime[1] + nanos;
|
|
1920
|
-
clock.now = newNow;
|
|
1921
|
-
nanos = 0;
|
|
1922
|
-
for (id in clock.timers) {
|
|
1923
|
-
if (clock.timers.hasOwnProperty(id)) {
|
|
1924
|
-
timer = clock.timers[id];
|
|
1925
|
-
timer.createdAt += difference;
|
|
1926
|
-
timer.callAt += difference;
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
};
|
|
1930
|
-
clock.jump = function jump(tickValue) {
|
|
1931
|
-
const msFloat = typeof tickValue === "number" ? tickValue : parseTime(tickValue);
|
|
1932
|
-
const ms = Math.floor(msFloat);
|
|
1933
|
-
for (const timer of Object.values(clock.timers)) {
|
|
1934
|
-
if (clock.now + ms > timer.callAt) {
|
|
1935
|
-
timer.callAt = clock.now + ms;
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
clock.tick(ms);
|
|
1939
|
-
};
|
|
1940
|
-
if (isPresent.performance) {
|
|
1941
|
-
clock.performance = /* @__PURE__ */ Object.create(null);
|
|
1942
|
-
clock.performance.now = fakePerformanceNow;
|
|
1943
|
-
}
|
|
1944
|
-
if (isPresent.hrtime) {
|
|
1945
|
-
clock.hrtime = hrtime;
|
|
1946
|
-
}
|
|
1947
|
-
return clock;
|
|
1948
|
-
}
|
|
1949
|
-
function install(config) {
|
|
1950
|
-
if (arguments.length > 1 || config instanceof Date || Array.isArray(config) || typeof config === "number") {
|
|
1951
|
-
throw new TypeError(
|
|
1952
|
-
`FakeTimers.install called with ${String(
|
|
1953
|
-
config
|
|
1954
|
-
)} install requires an object parameter`
|
|
1955
|
-
);
|
|
1956
|
-
}
|
|
1957
|
-
if (_global.Date.isFake === true) {
|
|
1958
|
-
throw new TypeError(
|
|
1959
|
-
"Can't install fake timers twice on the same global object."
|
|
1960
|
-
);
|
|
1961
|
-
}
|
|
1962
|
-
config = typeof config !== "undefined" ? config : {};
|
|
1963
|
-
config.shouldAdvanceTime = config.shouldAdvanceTime || false;
|
|
1964
|
-
config.advanceTimeDelta = config.advanceTimeDelta || 20;
|
|
1965
|
-
config.shouldClearNativeTimers = config.shouldClearNativeTimers || false;
|
|
1966
|
-
if (config.target) {
|
|
1967
|
-
throw new TypeError(
|
|
1968
|
-
"config.target is no longer supported. Use `withGlobal(target)` instead."
|
|
1969
|
-
);
|
|
1970
|
-
}
|
|
1971
|
-
function handleMissingTimer(timer) {
|
|
1972
|
-
if (config.ignoreMissingTimers) {
|
|
1973
|
-
return;
|
|
1974
|
-
}
|
|
1975
|
-
throw new ReferenceError(
|
|
1976
|
-
`non-existent timers and/or objects cannot be faked: '${timer}'`
|
|
1977
|
-
);
|
|
1978
|
-
}
|
|
1979
|
-
let i, l;
|
|
1980
|
-
const clock = createClock(config.now, config.loopLimit);
|
|
1981
|
-
clock.shouldClearNativeTimers = config.shouldClearNativeTimers;
|
|
1982
|
-
clock.uninstall = function() {
|
|
1983
|
-
return uninstall(clock, config);
|
|
1984
|
-
};
|
|
1985
|
-
clock.abortListenerMap = /* @__PURE__ */ new Map();
|
|
1986
|
-
clock.methods = config.toFake || [];
|
|
1987
|
-
if (clock.methods.length === 0) {
|
|
1988
|
-
clock.methods = Object.keys(timers);
|
|
1989
|
-
}
|
|
1990
|
-
if (config.shouldAdvanceTime === true) {
|
|
1991
|
-
const intervalTick = doIntervalTick.bind(
|
|
1992
|
-
null,
|
|
1993
|
-
clock,
|
|
1994
|
-
config.advanceTimeDelta
|
|
1995
|
-
);
|
|
1996
|
-
const intervalId = _global.setInterval(
|
|
1997
|
-
intervalTick,
|
|
1998
|
-
config.advanceTimeDelta
|
|
1999
|
-
);
|
|
2000
|
-
clock.attachedInterval = intervalId;
|
|
2001
|
-
}
|
|
2002
|
-
if (clock.methods.includes("performance")) {
|
|
2003
|
-
const proto = (() => {
|
|
2004
|
-
if (hasPerformanceConstructorPrototype) {
|
|
2005
|
-
return _global.performance.constructor.prototype;
|
|
2006
|
-
}
|
|
2007
|
-
if (hasPerformancePrototype) {
|
|
2008
|
-
return _global.Performance.prototype;
|
|
2009
|
-
}
|
|
2010
|
-
})();
|
|
2011
|
-
if (proto) {
|
|
2012
|
-
Object.getOwnPropertyNames(proto).forEach(function(name) {
|
|
2013
|
-
if (name !== "now") {
|
|
2014
|
-
clock.performance[name] = name.indexOf("getEntries") === 0 ? NOOP_ARRAY : NOOP;
|
|
2015
|
-
}
|
|
2016
|
-
});
|
|
2017
|
-
clock.performance.mark = (name) => new FakePerformanceEntry(name, "mark", 0, 0);
|
|
2018
|
-
clock.performance.measure = (name) => new FakePerformanceEntry(name, "measure", 0, 100);
|
|
2019
|
-
clock.performance.timeOrigin = getEpoch(config.now);
|
|
2020
|
-
} else if ((config.toFake || []).includes("performance")) {
|
|
2021
|
-
return handleMissingTimer("performance");
|
|
2022
|
-
}
|
|
2023
|
-
}
|
|
2024
|
-
if (_global === globalObject && timersModule) {
|
|
2025
|
-
clock.timersModuleMethods = [];
|
|
2026
|
-
}
|
|
2027
|
-
if (_global === globalObject && timersPromisesModule) {
|
|
2028
|
-
clock.timersPromisesModuleMethods = [];
|
|
2029
|
-
}
|
|
2030
|
-
for (i = 0, l = clock.methods.length; i < l; i++) {
|
|
2031
|
-
const nameOfMethodToReplace = clock.methods[i];
|
|
2032
|
-
if (!isPresent[nameOfMethodToReplace]) {
|
|
2033
|
-
handleMissingTimer(nameOfMethodToReplace);
|
|
2034
|
-
continue;
|
|
2035
|
-
}
|
|
2036
|
-
if (nameOfMethodToReplace === "hrtime") {
|
|
2037
|
-
if (_global.process && typeof _global.process.hrtime === "function") {
|
|
2038
|
-
hijackMethod(_global.process, nameOfMethodToReplace, clock);
|
|
2039
|
-
}
|
|
2040
|
-
} else if (nameOfMethodToReplace === "nextTick") {
|
|
2041
|
-
if (_global.process && typeof _global.process.nextTick === "function") {
|
|
2042
|
-
hijackMethod(_global.process, nameOfMethodToReplace, clock);
|
|
2043
|
-
}
|
|
2044
|
-
} else {
|
|
2045
|
-
hijackMethod(_global, nameOfMethodToReplace, clock);
|
|
2046
|
-
}
|
|
2047
|
-
if (clock.timersModuleMethods !== void 0 && timersModule[nameOfMethodToReplace]) {
|
|
2048
|
-
const original = timersModule[nameOfMethodToReplace];
|
|
2049
|
-
clock.timersModuleMethods.push({
|
|
2050
|
-
methodName: nameOfMethodToReplace,
|
|
2051
|
-
original
|
|
2052
|
-
});
|
|
2053
|
-
timersModule[nameOfMethodToReplace] = _global[nameOfMethodToReplace];
|
|
2054
|
-
}
|
|
2055
|
-
if (clock.timersPromisesModuleMethods !== void 0) {
|
|
2056
|
-
if (nameOfMethodToReplace === "setTimeout") {
|
|
2057
|
-
clock.timersPromisesModuleMethods.push({
|
|
2058
|
-
methodName: "setTimeout",
|
|
2059
|
-
original: timersPromisesModule.setTimeout
|
|
2060
|
-
});
|
|
2061
|
-
timersPromisesModule.setTimeout = (delay2, value, options = {}) => new Promise((resolve, reject) => {
|
|
2062
|
-
const abort = () => {
|
|
2063
|
-
options.signal.removeEventListener(
|
|
2064
|
-
"abort",
|
|
2065
|
-
abort
|
|
2066
|
-
);
|
|
2067
|
-
clock.abortListenerMap.delete(abort);
|
|
2068
|
-
clock.clearTimeout(handle);
|
|
2069
|
-
reject(options.signal.reason);
|
|
2070
|
-
};
|
|
2071
|
-
const handle = clock.setTimeout(() => {
|
|
2072
|
-
if (options.signal) {
|
|
2073
|
-
options.signal.removeEventListener(
|
|
2074
|
-
"abort",
|
|
2075
|
-
abort
|
|
2076
|
-
);
|
|
2077
|
-
clock.abortListenerMap.delete(abort);
|
|
2078
|
-
}
|
|
2079
|
-
resolve(value);
|
|
2080
|
-
}, delay2);
|
|
2081
|
-
if (options.signal) {
|
|
2082
|
-
if (options.signal.aborted) {
|
|
2083
|
-
abort();
|
|
2084
|
-
} else {
|
|
2085
|
-
options.signal.addEventListener(
|
|
2086
|
-
"abort",
|
|
2087
|
-
abort
|
|
2088
|
-
);
|
|
2089
|
-
clock.abortListenerMap.set(
|
|
2090
|
-
abort,
|
|
2091
|
-
options.signal
|
|
2092
|
-
);
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2095
|
-
});
|
|
2096
|
-
} else if (nameOfMethodToReplace === "setImmediate") {
|
|
2097
|
-
clock.timersPromisesModuleMethods.push({
|
|
2098
|
-
methodName: "setImmediate",
|
|
2099
|
-
original: timersPromisesModule.setImmediate
|
|
2100
|
-
});
|
|
2101
|
-
timersPromisesModule.setImmediate = (value, options = {}) => new Promise((resolve, reject) => {
|
|
2102
|
-
const abort = () => {
|
|
2103
|
-
options.signal.removeEventListener(
|
|
2104
|
-
"abort",
|
|
2105
|
-
abort
|
|
2106
|
-
);
|
|
2107
|
-
clock.abortListenerMap.delete(abort);
|
|
2108
|
-
clock.clearImmediate(handle);
|
|
2109
|
-
reject(options.signal.reason);
|
|
2110
|
-
};
|
|
2111
|
-
const handle = clock.setImmediate(() => {
|
|
2112
|
-
if (options.signal) {
|
|
2113
|
-
options.signal.removeEventListener(
|
|
2114
|
-
"abort",
|
|
2115
|
-
abort
|
|
2116
|
-
);
|
|
2117
|
-
clock.abortListenerMap.delete(abort);
|
|
2118
|
-
}
|
|
2119
|
-
resolve(value);
|
|
2120
|
-
});
|
|
2121
|
-
if (options.signal) {
|
|
2122
|
-
if (options.signal.aborted) {
|
|
2123
|
-
abort();
|
|
2124
|
-
} else {
|
|
2125
|
-
options.signal.addEventListener(
|
|
2126
|
-
"abort",
|
|
2127
|
-
abort
|
|
2128
|
-
);
|
|
2129
|
-
clock.abortListenerMap.set(
|
|
2130
|
-
abort,
|
|
2131
|
-
options.signal
|
|
2132
|
-
);
|
|
2133
|
-
}
|
|
2134
|
-
}
|
|
2135
|
-
});
|
|
2136
|
-
} else if (nameOfMethodToReplace === "setInterval") {
|
|
2137
|
-
clock.timersPromisesModuleMethods.push({
|
|
2138
|
-
methodName: "setInterval",
|
|
2139
|
-
original: timersPromisesModule.setInterval
|
|
2140
|
-
});
|
|
2141
|
-
timersPromisesModule.setInterval = (delay2, value, options = {}) => ({
|
|
2142
|
-
[Symbol.asyncIterator]: () => {
|
|
2143
|
-
const createResolvable = () => {
|
|
2144
|
-
let resolve, reject;
|
|
2145
|
-
const promise = new Promise((res, rej) => {
|
|
2146
|
-
resolve = res;
|
|
2147
|
-
reject = rej;
|
|
2148
|
-
});
|
|
2149
|
-
promise.resolve = resolve;
|
|
2150
|
-
promise.reject = reject;
|
|
2151
|
-
return promise;
|
|
2152
|
-
};
|
|
2153
|
-
let done = false;
|
|
2154
|
-
let hasThrown = false;
|
|
2155
|
-
let returnCall;
|
|
2156
|
-
let nextAvailable = 0;
|
|
2157
|
-
const nextQueue = [];
|
|
2158
|
-
const handle = clock.setInterval(() => {
|
|
2159
|
-
if (nextQueue.length > 0) {
|
|
2160
|
-
nextQueue.shift().resolve();
|
|
2161
|
-
} else {
|
|
2162
|
-
nextAvailable++;
|
|
2163
|
-
}
|
|
2164
|
-
}, delay2);
|
|
2165
|
-
const abort = () => {
|
|
2166
|
-
options.signal.removeEventListener(
|
|
2167
|
-
"abort",
|
|
2168
|
-
abort
|
|
2169
|
-
);
|
|
2170
|
-
clock.abortListenerMap.delete(abort);
|
|
2171
|
-
clock.clearInterval(handle);
|
|
2172
|
-
done = true;
|
|
2173
|
-
for (const resolvable of nextQueue) {
|
|
2174
|
-
resolvable.resolve();
|
|
2175
|
-
}
|
|
2176
|
-
};
|
|
2177
|
-
if (options.signal) {
|
|
2178
|
-
if (options.signal.aborted) {
|
|
2179
|
-
done = true;
|
|
2180
|
-
} else {
|
|
2181
|
-
options.signal.addEventListener(
|
|
2182
|
-
"abort",
|
|
2183
|
-
abort
|
|
2184
|
-
);
|
|
2185
|
-
clock.abortListenerMap.set(
|
|
2186
|
-
abort,
|
|
2187
|
-
options.signal
|
|
2188
|
-
);
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
return {
|
|
2192
|
-
next: async () => {
|
|
2193
|
-
if (options.signal?.aborted && !hasThrown) {
|
|
2194
|
-
hasThrown = true;
|
|
2195
|
-
throw options.signal.reason;
|
|
2196
|
-
}
|
|
2197
|
-
if (done) {
|
|
2198
|
-
return { done: true, value: void 0 };
|
|
2199
|
-
}
|
|
2200
|
-
if (nextAvailable > 0) {
|
|
2201
|
-
nextAvailable--;
|
|
2202
|
-
return { done: false, value };
|
|
2203
|
-
}
|
|
2204
|
-
const resolvable = createResolvable();
|
|
2205
|
-
nextQueue.push(resolvable);
|
|
2206
|
-
await resolvable;
|
|
2207
|
-
if (returnCall && nextQueue.length === 0) {
|
|
2208
|
-
returnCall.resolve();
|
|
2209
|
-
}
|
|
2210
|
-
if (options.signal?.aborted && !hasThrown) {
|
|
2211
|
-
hasThrown = true;
|
|
2212
|
-
throw options.signal.reason;
|
|
2213
|
-
}
|
|
2214
|
-
if (done) {
|
|
2215
|
-
return { done: true, value: void 0 };
|
|
2216
|
-
}
|
|
2217
|
-
return { done: false, value };
|
|
2218
|
-
},
|
|
2219
|
-
return: async () => {
|
|
2220
|
-
if (done) {
|
|
2221
|
-
return { done: true, value: void 0 };
|
|
2222
|
-
}
|
|
2223
|
-
if (nextQueue.length > 0) {
|
|
2224
|
-
returnCall = createResolvable();
|
|
2225
|
-
await returnCall;
|
|
2226
|
-
}
|
|
2227
|
-
clock.clearInterval(handle);
|
|
2228
|
-
done = true;
|
|
2229
|
-
if (options.signal) {
|
|
2230
|
-
options.signal.removeEventListener(
|
|
2231
|
-
"abort",
|
|
2232
|
-
abort
|
|
2233
|
-
);
|
|
2234
|
-
clock.abortListenerMap.delete(abort);
|
|
2235
|
-
}
|
|
2236
|
-
return { done: true, value: void 0 };
|
|
2237
|
-
}
|
|
2238
|
-
};
|
|
2239
|
-
}
|
|
2240
|
-
});
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
}
|
|
2244
|
-
return clock;
|
|
2245
|
-
}
|
|
2246
|
-
return {
|
|
2247
|
-
timers,
|
|
2248
|
-
createClock,
|
|
2249
|
-
install,
|
|
2250
|
-
withGlobal
|
|
2251
|
-
};
|
|
2252
|
-
}
|
|
2253
|
-
const defaultImplementation = withGlobal(globalObject);
|
|
2254
|
-
fakeTimersSrc.timers = defaultImplementation.timers;
|
|
2255
|
-
fakeTimersSrc.createClock = defaultImplementation.createClock;
|
|
2256
|
-
fakeTimersSrc.install = defaultImplementation.install;
|
|
2257
|
-
fakeTimersSrc.withGlobal = withGlobal;
|
|
2258
|
-
return fakeTimersSrc;
|
|
2259
|
-
}
|
|
2260
|
-
var fakeTimersSrcExports = requireFakeTimersSrc();
|
|
2261
|
-
var FakeTimers = class {
|
|
2262
|
-
_global;
|
|
2263
|
-
_clock;
|
|
2264
|
-
// | _fakingTime | _fakingDate |
|
|
2265
|
-
// +-------------+-------------+
|
|
2266
|
-
// | false | falsy | initial
|
|
2267
|
-
// | false | truthy | vi.setSystemTime called first (for mocking only Date without fake timers)
|
|
2268
|
-
// | true | falsy | vi.useFakeTimers called first
|
|
2269
|
-
// | true | truthy | unreachable
|
|
2270
|
-
_fakingTime;
|
|
2271
|
-
_fakingDate;
|
|
2272
|
-
_fakeTimers;
|
|
2273
|
-
_userConfig;
|
|
2274
|
-
_now = RealDate.now;
|
|
2275
|
-
constructor({ global: global3, config }) {
|
|
2276
|
-
this._userConfig = config;
|
|
2277
|
-
this._fakingDate = null;
|
|
2278
|
-
this._fakingTime = false;
|
|
2279
|
-
this._fakeTimers = fakeTimersSrcExports.withGlobal(global3);
|
|
2280
|
-
this._global = global3;
|
|
2281
|
-
}
|
|
2282
|
-
clearAllTimers() {
|
|
2283
|
-
if (this._fakingTime) this._clock.reset();
|
|
2284
|
-
}
|
|
2285
|
-
dispose() {
|
|
2286
|
-
this.useRealTimers();
|
|
2287
|
-
}
|
|
2288
|
-
runAllTimers() {
|
|
2289
|
-
if (this._checkFakeTimers()) this._clock.runAll();
|
|
2290
|
-
}
|
|
2291
|
-
async runAllTimersAsync() {
|
|
2292
|
-
if (this._checkFakeTimers()) await this._clock.runAllAsync();
|
|
2293
|
-
}
|
|
2294
|
-
runOnlyPendingTimers() {
|
|
2295
|
-
if (this._checkFakeTimers()) this._clock.runToLast();
|
|
2296
|
-
}
|
|
2297
|
-
async runOnlyPendingTimersAsync() {
|
|
2298
|
-
if (this._checkFakeTimers()) await this._clock.runToLastAsync();
|
|
2299
|
-
}
|
|
2300
|
-
advanceTimersToNextTimer(steps = 1) {
|
|
2301
|
-
if (this._checkFakeTimers()) for (let i = steps; i > 0; i--) {
|
|
2302
|
-
this._clock.next();
|
|
2303
|
-
this._clock.tick(0);
|
|
2304
|
-
if (this._clock.countTimers() === 0) break;
|
|
2305
|
-
}
|
|
2306
|
-
}
|
|
2307
|
-
async advanceTimersToNextTimerAsync(steps = 1) {
|
|
2308
|
-
if (this._checkFakeTimers()) for (let i = steps; i > 0; i--) {
|
|
2309
|
-
await this._clock.nextAsync();
|
|
2310
|
-
this._clock.tick(0);
|
|
2311
|
-
if (this._clock.countTimers() === 0) break;
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
advanceTimersByTime(msToRun) {
|
|
2315
|
-
if (this._checkFakeTimers()) this._clock.tick(msToRun);
|
|
2316
|
-
}
|
|
2317
|
-
async advanceTimersByTimeAsync(msToRun) {
|
|
2318
|
-
if (this._checkFakeTimers()) await this._clock.tickAsync(msToRun);
|
|
2319
|
-
}
|
|
2320
|
-
advanceTimersToNextFrame() {
|
|
2321
|
-
if (this._checkFakeTimers()) this._clock.runToFrame();
|
|
2322
|
-
}
|
|
2323
|
-
runAllTicks() {
|
|
2324
|
-
if (this._checkFakeTimers())
|
|
2325
|
-
this._clock.runMicrotasks();
|
|
2326
|
-
}
|
|
2327
|
-
useRealTimers() {
|
|
2328
|
-
if (this._fakingDate) {
|
|
2329
|
-
resetDate();
|
|
2330
|
-
this._fakingDate = null;
|
|
2331
|
-
}
|
|
2332
|
-
if (this._fakingTime) {
|
|
2333
|
-
this._clock.uninstall();
|
|
2334
|
-
this._fakingTime = false;
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
|
-
useFakeTimers() {
|
|
2338
|
-
const fakeDate = this._fakingDate || Date.now();
|
|
2339
|
-
if (this._fakingDate) {
|
|
2340
|
-
resetDate();
|
|
2341
|
-
this._fakingDate = null;
|
|
2342
|
-
}
|
|
2343
|
-
if (this._fakingTime) this._clock.uninstall();
|
|
2344
|
-
const toFake = Object.keys(this._fakeTimers.timers).filter((timer) => timer !== "nextTick" && timer !== "queueMicrotask");
|
|
2345
|
-
if (this._userConfig?.toFake?.includes("nextTick") && isChildProcess()) throw new Error("process.nextTick cannot be mocked inside child_process");
|
|
2346
|
-
this._clock = this._fakeTimers.install({
|
|
2347
|
-
now: fakeDate,
|
|
2348
|
-
...this._userConfig,
|
|
2349
|
-
toFake: this._userConfig?.toFake || toFake,
|
|
2350
|
-
ignoreMissingTimers: true
|
|
2351
|
-
});
|
|
2352
|
-
this._fakingTime = true;
|
|
2353
|
-
}
|
|
2354
|
-
reset() {
|
|
2355
|
-
if (this._checkFakeTimers()) {
|
|
2356
|
-
const { now: now2 } = this._clock;
|
|
2357
|
-
this._clock.reset();
|
|
2358
|
-
this._clock.setSystemTime(now2);
|
|
2359
|
-
}
|
|
2360
|
-
}
|
|
2361
|
-
setSystemTime(now2) {
|
|
2362
|
-
const date = typeof now2 === "undefined" || now2 instanceof Date ? now2 : new Date(now2);
|
|
2363
|
-
if (this._fakingTime) this._clock.setSystemTime(date);
|
|
2364
|
-
else {
|
|
2365
|
-
this._fakingDate = date ?? new Date(this.getRealSystemTime());
|
|
2366
|
-
mockDate(this._fakingDate);
|
|
2367
|
-
}
|
|
2368
|
-
}
|
|
2369
|
-
getMockedSystemTime() {
|
|
2370
|
-
return this._fakingTime ? new Date(this._clock.now) : this._fakingDate;
|
|
2371
|
-
}
|
|
2372
|
-
getRealSystemTime() {
|
|
2373
|
-
return this._now();
|
|
2374
|
-
}
|
|
2375
|
-
getTimerCount() {
|
|
2376
|
-
if (this._checkFakeTimers()) return this._clock.countTimers();
|
|
2377
|
-
return 0;
|
|
2378
|
-
}
|
|
2379
|
-
configure(config) {
|
|
2380
|
-
this._userConfig = config;
|
|
2381
|
-
}
|
|
2382
|
-
isFakeTimers() {
|
|
2383
|
-
return this._fakingTime;
|
|
2384
|
-
}
|
|
2385
|
-
_checkFakeTimers() {
|
|
2386
|
-
if (!this._fakingTime) throw new Error("A function to advance timers was called but the timers APIs are not mocked. Call `vi.useFakeTimers()` in the test file first.");
|
|
2387
|
-
return this._fakingTime;
|
|
2388
|
-
}
|
|
2389
|
-
};
|
|
2390
|
-
function copyStackTrace(target, source) {
|
|
2391
|
-
if (source.stack !== void 0) target.stack = source.stack.replace(source.message, target.message);
|
|
2392
|
-
return target;
|
|
2393
|
-
}
|
|
2394
|
-
function waitFor(callback, options = {}) {
|
|
2395
|
-
const { setTimeout, setInterval, clearTimeout, clearInterval } = getSafeTimers2();
|
|
2396
|
-
const { interval = 50, timeout = 1e3 } = typeof options === "number" ? { timeout: options } : options;
|
|
2397
|
-
const STACK_TRACE_ERROR = /* @__PURE__ */ new Error("STACK_TRACE_ERROR");
|
|
2398
|
-
return new Promise((resolve, reject) => {
|
|
2399
|
-
let lastError;
|
|
2400
|
-
let promiseStatus = "idle";
|
|
2401
|
-
let timeoutId;
|
|
2402
|
-
let intervalId;
|
|
2403
|
-
const onResolve = (result) => {
|
|
2404
|
-
if (timeoutId) clearTimeout(timeoutId);
|
|
2405
|
-
if (intervalId) clearInterval(intervalId);
|
|
2406
|
-
resolve(result);
|
|
2407
|
-
};
|
|
2408
|
-
const handleTimeout = () => {
|
|
2409
|
-
if (intervalId) clearInterval(intervalId);
|
|
2410
|
-
let error = lastError;
|
|
2411
|
-
if (!error) error = copyStackTrace(/* @__PURE__ */ new Error("Timed out in waitFor!"), STACK_TRACE_ERROR);
|
|
2412
|
-
reject(error);
|
|
2413
|
-
};
|
|
2414
|
-
const checkCallback = () => {
|
|
2415
|
-
if (vi.isFakeTimers()) vi.advanceTimersByTime(interval);
|
|
2416
|
-
if (promiseStatus === "pending") return;
|
|
2417
|
-
try {
|
|
2418
|
-
const result = callback();
|
|
2419
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
2420
|
-
const thenable = result;
|
|
2421
|
-
promiseStatus = "pending";
|
|
2422
|
-
thenable.then((resolvedValue) => {
|
|
2423
|
-
promiseStatus = "resolved";
|
|
2424
|
-
onResolve(resolvedValue);
|
|
2425
|
-
}, (rejectedValue) => {
|
|
2426
|
-
promiseStatus = "rejected";
|
|
2427
|
-
lastError = rejectedValue;
|
|
2428
|
-
});
|
|
2429
|
-
} else {
|
|
2430
|
-
onResolve(result);
|
|
2431
|
-
return true;
|
|
2432
|
-
}
|
|
2433
|
-
} catch (error) {
|
|
2434
|
-
lastError = error;
|
|
2435
|
-
}
|
|
2436
|
-
};
|
|
2437
|
-
if (checkCallback() === true) return;
|
|
2438
|
-
timeoutId = setTimeout(handleTimeout, timeout);
|
|
2439
|
-
intervalId = setInterval(checkCallback, interval);
|
|
2440
|
-
});
|
|
2441
|
-
}
|
|
2442
|
-
function waitUntil(callback, options = {}) {
|
|
2443
|
-
const { setTimeout, setInterval, clearTimeout, clearInterval } = getSafeTimers2();
|
|
2444
|
-
const { interval = 50, timeout = 1e3 } = typeof options === "number" ? { timeout: options } : options;
|
|
2445
|
-
const STACK_TRACE_ERROR = /* @__PURE__ */ new Error("STACK_TRACE_ERROR");
|
|
2446
|
-
return new Promise((resolve, reject) => {
|
|
2447
|
-
let promiseStatus = "idle";
|
|
2448
|
-
let timeoutId;
|
|
2449
|
-
let intervalId;
|
|
2450
|
-
const onReject = (error) => {
|
|
2451
|
-
if (intervalId) clearInterval(intervalId);
|
|
2452
|
-
if (!error) error = copyStackTrace(/* @__PURE__ */ new Error("Timed out in waitUntil!"), STACK_TRACE_ERROR);
|
|
2453
|
-
reject(error);
|
|
2454
|
-
};
|
|
2455
|
-
const onResolve = (result) => {
|
|
2456
|
-
if (!result) return;
|
|
2457
|
-
if (timeoutId) clearTimeout(timeoutId);
|
|
2458
|
-
if (intervalId) clearInterval(intervalId);
|
|
2459
|
-
resolve(result);
|
|
2460
|
-
return true;
|
|
2461
|
-
};
|
|
2462
|
-
const checkCallback = () => {
|
|
2463
|
-
if (vi.isFakeTimers()) vi.advanceTimersByTime(interval);
|
|
2464
|
-
if (promiseStatus === "pending") return;
|
|
2465
|
-
try {
|
|
2466
|
-
const result = callback();
|
|
2467
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
2468
|
-
const thenable = result;
|
|
2469
|
-
promiseStatus = "pending";
|
|
2470
|
-
thenable.then((resolvedValue) => {
|
|
2471
|
-
promiseStatus = "resolved";
|
|
2472
|
-
onResolve(resolvedValue);
|
|
2473
|
-
}, (rejectedValue) => {
|
|
2474
|
-
promiseStatus = "rejected";
|
|
2475
|
-
onReject(rejectedValue);
|
|
2476
|
-
});
|
|
2477
|
-
} else return onResolve(result);
|
|
2478
|
-
} catch (error) {
|
|
2479
|
-
onReject(error);
|
|
2480
|
-
}
|
|
2481
|
-
};
|
|
2482
|
-
if (checkCallback() === true) return;
|
|
2483
|
-
timeoutId = setTimeout(onReject, timeout);
|
|
2484
|
-
intervalId = setInterval(checkCallback, interval);
|
|
2485
|
-
});
|
|
2486
|
-
}
|
|
2487
|
-
function createVitest() {
|
|
2488
|
-
let _config = null;
|
|
2489
|
-
const state = () => getWorkerState();
|
|
2490
|
-
let _timers;
|
|
2491
|
-
const timers = () => _timers ||= new FakeTimers({
|
|
2492
|
-
global: globalThis,
|
|
2493
|
-
config: state().config.fakeTimers
|
|
2494
|
-
});
|
|
2495
|
-
const _stubsGlobal = /* @__PURE__ */ new Map();
|
|
2496
|
-
const _stubsEnv = /* @__PURE__ */ new Map();
|
|
2497
|
-
const _envBooleans = [
|
|
2498
|
-
"PROD",
|
|
2499
|
-
"DEV",
|
|
2500
|
-
"SSR"
|
|
2501
|
-
];
|
|
2502
|
-
const utils = {
|
|
2503
|
-
useFakeTimers(config) {
|
|
2504
|
-
if (isChildProcess()) {
|
|
2505
|
-
if (config?.toFake?.includes("nextTick") || state().config?.fakeTimers?.toFake?.includes("nextTick")) throw new Error('vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.');
|
|
2506
|
-
}
|
|
2507
|
-
if (config) timers().configure({
|
|
2508
|
-
...state().config.fakeTimers,
|
|
2509
|
-
...config
|
|
2510
|
-
});
|
|
2511
|
-
else timers().configure(state().config.fakeTimers);
|
|
2512
|
-
timers().useFakeTimers();
|
|
2513
|
-
return utils;
|
|
2514
|
-
},
|
|
2515
|
-
isFakeTimers() {
|
|
2516
|
-
return timers().isFakeTimers();
|
|
2517
|
-
},
|
|
2518
|
-
useRealTimers() {
|
|
2519
|
-
timers().useRealTimers();
|
|
2520
|
-
return utils;
|
|
2521
|
-
},
|
|
2522
|
-
runOnlyPendingTimers() {
|
|
2523
|
-
timers().runOnlyPendingTimers();
|
|
2524
|
-
return utils;
|
|
2525
|
-
},
|
|
2526
|
-
async runOnlyPendingTimersAsync() {
|
|
2527
|
-
await timers().runOnlyPendingTimersAsync();
|
|
2528
|
-
return utils;
|
|
2529
|
-
},
|
|
2530
|
-
runAllTimers() {
|
|
2531
|
-
timers().runAllTimers();
|
|
2532
|
-
return utils;
|
|
2533
|
-
},
|
|
2534
|
-
async runAllTimersAsync() {
|
|
2535
|
-
await timers().runAllTimersAsync();
|
|
2536
|
-
return utils;
|
|
2537
|
-
},
|
|
2538
|
-
runAllTicks() {
|
|
2539
|
-
timers().runAllTicks();
|
|
2540
|
-
return utils;
|
|
2541
|
-
},
|
|
2542
|
-
advanceTimersByTime(ms) {
|
|
2543
|
-
timers().advanceTimersByTime(ms);
|
|
2544
|
-
return utils;
|
|
2545
|
-
},
|
|
2546
|
-
async advanceTimersByTimeAsync(ms) {
|
|
2547
|
-
await timers().advanceTimersByTimeAsync(ms);
|
|
2548
|
-
return utils;
|
|
2549
|
-
},
|
|
2550
|
-
advanceTimersToNextTimer() {
|
|
2551
|
-
timers().advanceTimersToNextTimer();
|
|
2552
|
-
return utils;
|
|
2553
|
-
},
|
|
2554
|
-
async advanceTimersToNextTimerAsync() {
|
|
2555
|
-
await timers().advanceTimersToNextTimerAsync();
|
|
2556
|
-
return utils;
|
|
2557
|
-
},
|
|
2558
|
-
advanceTimersToNextFrame() {
|
|
2559
|
-
timers().advanceTimersToNextFrame();
|
|
2560
|
-
return utils;
|
|
2561
|
-
},
|
|
2562
|
-
getTimerCount() {
|
|
2563
|
-
return timers().getTimerCount();
|
|
2564
|
-
},
|
|
2565
|
-
setSystemTime(time) {
|
|
2566
|
-
timers().setSystemTime(time);
|
|
2567
|
-
return utils;
|
|
2568
|
-
},
|
|
2569
|
-
getMockedSystemTime() {
|
|
2570
|
-
return timers().getMockedSystemTime();
|
|
2571
|
-
},
|
|
2572
|
-
getRealSystemTime() {
|
|
2573
|
-
return timers().getRealSystemTime();
|
|
2574
|
-
},
|
|
2575
|
-
clearAllTimers() {
|
|
2576
|
-
timers().clearAllTimers();
|
|
2577
|
-
return utils;
|
|
2578
|
-
},
|
|
2579
|
-
spyOn,
|
|
2580
|
-
fn,
|
|
2581
|
-
waitFor,
|
|
2582
|
-
waitUntil,
|
|
2583
|
-
hoisted(factory) {
|
|
2584
|
-
assertTypes(factory, '"vi.hoisted" factory', ["function"]);
|
|
2585
|
-
return factory();
|
|
2586
|
-
},
|
|
2587
|
-
mock(path, factory) {
|
|
2588
|
-
if (typeof path !== "string") throw new TypeError(`vi.mock() expects a string path, but received a ${typeof path}`);
|
|
2589
|
-
const importer = getImporter("mock");
|
|
2590
|
-
_mocker().queueMock(path, importer, typeof factory === "function" ? () => factory(() => _mocker().importActual(path, importer, _mocker().getMockContext().callstack)) : factory);
|
|
2591
|
-
},
|
|
2592
|
-
unmock(path) {
|
|
2593
|
-
if (typeof path !== "string") throw new TypeError(`vi.unmock() expects a string path, but received a ${typeof path}`);
|
|
2594
|
-
_mocker().queueUnmock(path, getImporter("unmock"));
|
|
2595
|
-
},
|
|
2596
|
-
doMock(path, factory) {
|
|
2597
|
-
if (typeof path !== "string") throw new TypeError(`vi.doMock() expects a string path, but received a ${typeof path}`);
|
|
2598
|
-
const importer = getImporter("doMock");
|
|
2599
|
-
_mocker().queueMock(path, importer, typeof factory === "function" ? () => factory(() => _mocker().importActual(path, importer, _mocker().getMockContext().callstack)) : factory);
|
|
2600
|
-
},
|
|
2601
|
-
doUnmock(path) {
|
|
2602
|
-
if (typeof path !== "string") throw new TypeError(`vi.doUnmock() expects a string path, but received a ${typeof path}`);
|
|
2603
|
-
const importer = getImporter("doUnmock");
|
|
2604
|
-
_mocker().queueUnmock(path, importer);
|
|
2605
|
-
},
|
|
2606
|
-
async importActual(path) {
|
|
2607
|
-
const importer = getImporter("importActual");
|
|
2608
|
-
return _mocker().importActual(path, importer, _mocker().getMockContext().callstack);
|
|
2609
|
-
},
|
|
2610
|
-
async importMock(path) {
|
|
2611
|
-
const importer = getImporter("importMock");
|
|
2612
|
-
return _mocker().importMock(path, importer);
|
|
2613
|
-
},
|
|
2614
|
-
mockObject(value, options) {
|
|
2615
|
-
return _mocker().mockObject({ value }, void 0, options?.spy ? "autospy" : "automock").value;
|
|
2616
|
-
},
|
|
2617
|
-
mocked(item, _options = {}) {
|
|
2618
|
-
return item;
|
|
2619
|
-
},
|
|
2620
|
-
isMockFunction(fn2) {
|
|
2621
|
-
return isMockFunction(fn2);
|
|
2622
|
-
},
|
|
2623
|
-
clearAllMocks() {
|
|
2624
|
-
clearAllMocks();
|
|
2625
|
-
return utils;
|
|
2626
|
-
},
|
|
2627
|
-
resetAllMocks() {
|
|
2628
|
-
resetAllMocks();
|
|
2629
|
-
return utils;
|
|
2630
|
-
},
|
|
2631
|
-
restoreAllMocks() {
|
|
2632
|
-
restoreAllMocks();
|
|
2633
|
-
return utils;
|
|
2634
|
-
},
|
|
2635
|
-
stubGlobal(name, value) {
|
|
2636
|
-
if (!_stubsGlobal.has(name)) _stubsGlobal.set(name, Object.getOwnPropertyDescriptor(globalThis, name));
|
|
2637
|
-
Object.defineProperty(globalThis, name, {
|
|
2638
|
-
value,
|
|
2639
|
-
writable: true,
|
|
2640
|
-
configurable: true,
|
|
2641
|
-
enumerable: true
|
|
2642
|
-
});
|
|
2643
|
-
return utils;
|
|
2644
|
-
},
|
|
2645
|
-
stubEnv(name, value) {
|
|
2646
|
-
const env = state().metaEnv;
|
|
2647
|
-
if (!_stubsEnv.has(name)) _stubsEnv.set(name, env[name]);
|
|
2648
|
-
if (_envBooleans.includes(name)) env[name] = value ? "1" : "";
|
|
2649
|
-
else if (value === void 0) delete env[name];
|
|
2650
|
-
else env[name] = String(value);
|
|
2651
|
-
return utils;
|
|
2652
|
-
},
|
|
2653
|
-
unstubAllGlobals() {
|
|
2654
|
-
_stubsGlobal.forEach((original, name) => {
|
|
2655
|
-
if (!original) Reflect.deleteProperty(globalThis, name);
|
|
2656
|
-
else Object.defineProperty(globalThis, name, original);
|
|
2657
|
-
});
|
|
2658
|
-
_stubsGlobal.clear();
|
|
2659
|
-
return utils;
|
|
2660
|
-
},
|
|
2661
|
-
unstubAllEnvs() {
|
|
2662
|
-
const env = state().metaEnv;
|
|
2663
|
-
_stubsEnv.forEach((original, name) => {
|
|
2664
|
-
if (original === void 0) delete env[name];
|
|
2665
|
-
else env[name] = original;
|
|
2666
|
-
});
|
|
2667
|
-
_stubsEnv.clear();
|
|
2668
|
-
return utils;
|
|
2669
|
-
},
|
|
2670
|
-
resetModules() {
|
|
2671
|
-
resetModules(state().evaluatedModules);
|
|
2672
|
-
return utils;
|
|
2673
|
-
},
|
|
2674
|
-
async dynamicImportSettled() {
|
|
2675
|
-
return waitForImportsToResolve();
|
|
2676
|
-
},
|
|
2677
|
-
setConfig(config) {
|
|
2678
|
-
if (!_config) _config = { ...state().config };
|
|
2679
|
-
Object.assign(state().config, config);
|
|
2680
|
-
},
|
|
2681
|
-
resetConfig() {
|
|
2682
|
-
if (_config) Object.assign(state().config, _config);
|
|
2683
|
-
}
|
|
2684
|
-
};
|
|
2685
|
-
return utils;
|
|
2686
|
-
}
|
|
2687
|
-
var vitest = createVitest();
|
|
2688
|
-
var vi = vitest;
|
|
2689
|
-
function _mocker() {
|
|
2690
|
-
return typeof __vitest_mocker__ !== "undefined" ? __vitest_mocker__ : new Proxy({}, { get(_, name) {
|
|
2691
|
-
throw new Error(`Vitest mocker was not initialized in this environment. vi.${String(name)}() is forbidden.`);
|
|
2692
|
-
} });
|
|
2693
|
-
}
|
|
2694
|
-
function getImporter(name) {
|
|
2695
|
-
const stackArray = createSimpleStackTrace({ stackTraceLimit: 5 }).split("\n");
|
|
2696
|
-
return parseSingleStack(stackArray[stackArray.findLastIndex((stack) => {
|
|
2697
|
-
return stack.includes(` at Object.${name}`) || stack.includes(`${name}@`) || stack.includes(` at ${name} (`);
|
|
2698
|
-
}) + 1])?.file || "";
|
|
2699
|
-
}
|
|
2700
|
-
|
|
2701
|
-
// ../../node_modules/.pnpm/vitest@4.0.15_@opentelemetry+api@1.9.0_@types+node@25.0.0_@vitest+ui@4.0.15_jiti@2.6.1__a905abac14c7ecb2319509a42a33135d/node_modules/vitest/dist/index.js
|
|
2702
|
-
import { expectTypeOf } from "expect-type.js";
|
|
2703
|
-
import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from "@vitest/runner.js";
|
|
2704
|
-
import { chai as chai2 } from "@vitest/expect.js";
|
|
2705
|
-
import "@vitest/utils/timers.js";
|
|
2706
|
-
import "@vitest/runner/utils.js";
|
|
2707
|
-
import "@vitest/snapshot.js";
|
|
2708
|
-
import "@vitest/utils/error.js";
|
|
2709
|
-
import "@vitest/utils/helpers.js";
|
|
2710
|
-
import "@vitest/spy.js";
|
|
2711
|
-
import "@vitest/utils/offset.js";
|
|
2712
|
-
import "@vitest/utils/source-map.js";
|
|
2713
|
-
import "pathe.js";
|
|
2714
|
-
import "vite/module-runner.js";
|
|
2715
|
-
|
|
2716
|
-
// src/tests/setup.ts
|
|
2717
|
-
vi.setSystemTime(/* @__PURE__ */ new Date("2023-01-01"));
|
|
1
|
+
// This file contains setup code for tests
|
|
2
|
+
import { vi } from "vitest";
|
|
3
|
+
// Use Vitest's built-in to mock Date
|
|
4
|
+
vi.setSystemTime(new Date("2023-01-01"));
|
|
2718
5
|
//# sourceMappingURL=setup.js.map
|