@nethesis/phone-island 1.0.5 → 1.0.6-dev.1
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 +35 -0
- package/dist/App.js +1 -1
- package/dist/App.js.map +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/_virtual/index9.js +1 -1
- package/dist/components/AudioPlayerView/Progress.js +1 -1
- package/dist/components/AudioPlayerView/Progress.js.map +1 -1
- package/dist/components/CallView/BackCall.js +1 -1
- package/dist/components/CallView/BackCall.js.map +1 -1
- package/dist/components/CallView/DisplayName.js +1 -1
- package/dist/components/CallView/DisplayName.js.map +1 -1
- package/dist/components/CallView/DisplayNameUtils.js +1 -1
- package/dist/components/CallView/DisplayNameUtils.js.map +1 -1
- package/dist/components/CallView/Number.js +1 -1
- package/dist/components/CallView/Number.js.map +1 -1
- package/dist/components/CallView/index.js +1 -1
- package/dist/components/CallView/index.js.map +1 -1
- package/dist/components/SideView/hooks/useSideViewLogic.js +1 -1
- package/dist/components/SideView/hooks/useSideViewLogic.js.map +1 -1
- package/dist/components/Socket.js +1 -1
- package/dist/components/Socket.js.map +1 -1
- package/dist/components/TextScroll.js +1 -1
- package/dist/components/TextScroll.js.map +1 -1
- package/dist/events/SocketEvents.js +1 -1
- package/dist/events/SocketEvents.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/lib/devices/devices.js +1 -1
- package/dist/lib/phone/queue.js +2 -0
- package/dist/lib/phone/queue.js.map +1 -0
- package/dist/models/currentCall.js +1 -1
- package/dist/models/currentCall.js.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/queue.js +2 -0
- package/dist/models/queue.js.map +1 -0
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js +1 -1
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/label/label.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/label/label.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/transition/transition.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/components/transition/transition.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-element-size.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-element-size.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-flags.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-flags.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-inert-others.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-inert-others.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-owner.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-owner.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-quick-release.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-quick-release.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-tree-walker.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-tree-walker.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/internal/floating.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/internal/floating.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/internal/open-closed.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/internal/open-closed.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/machine.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/machine.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/react-glue.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/react-glue.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/class-names.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/disposables.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/match.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/match.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/render.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/render.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/store.js +1 -1
- package/dist/node_modules/@headlessui/react/dist/utils/store.js.map +1 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.mjs.js +1 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.mjs.js.map +1 -1
- package/dist/node_modules/@react-aria/focus/dist/useFocusRing.mjs.js +1 -1
- package/dist/node_modules/@react-aria/focus/dist/useFocusRing.mjs.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.mjs.js +1 -1
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.mjs.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.mjs.js +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.mjs.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.mjs.js +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.mjs.js.map +1 -1
- package/dist/node_modules/engine.io-client/build/esm/socket.js +1 -1
- package/dist/node_modules/engine.io-client/build/esm/socket.js.map +1 -1
- package/dist/node_modules/engine.io-client/build/esm/transport.js +1 -1
- package/dist/node_modules/engine.io-client/build/esm/transport.js.map +1 -1
- package/dist/node_modules/engine.io-client/build/esm/transports/polling.js +1 -1
- package/dist/node_modules/engine.io-client/build/esm/transports/polling.js.map +1 -1
- package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js +1 -1
- package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js.map +1 -1
- package/dist/node_modules/engine.io-client/build/esm/util.js +1 -1
- package/dist/node_modules/engine.io-client/build/esm/util.js.map +1 -1
- package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +1 -1
- package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/events/add-dom-event.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/events/add-dom-event.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/VisualElement.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/VisualElement.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/create-factory.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/create-factory.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/render.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/render.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/animation-state.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/animation-state.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/delay.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/delay.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js.map +1 -1
- package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/js-base64/base64.mjs.js +1 -1
- package/dist/node_modules/js-base64/base64.mjs.js.map +1 -1
- package/dist/node_modules/mic-check/lib/index.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/driver-frameloop.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/driver-frameloop.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.js.map +1 -1
- package/dist/node_modules/motion-utils/dist/es/pipe.mjs.js +1 -1
- package/dist/node_modules/motion-utils/dist/es/pipe.mjs.js.map +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +1 -1
- package/dist/node_modules/react-moment/dist/index.js +1 -1
- package/dist/node_modules/react-redux/es/components/Provider.js +1 -1
- package/dist/node_modules/react-redux/es/components/Provider.js.map +1 -1
- package/dist/node_modules/react-redux/es/hooks/useDispatch.js +1 -1
- package/dist/node_modules/react-redux/es/hooks/useDispatch.js.map +1 -1
- package/dist/node_modules/react-redux/es/hooks/useSelector.js +1 -1
- package/dist/node_modules/react-redux/es/hooks/useSelector.js.map +1 -1
- package/dist/node_modules/react-redux/es/hooks/useStore.js +1 -1
- package/dist/node_modules/react-redux/es/hooks/useStore.js.map +1 -1
- package/dist/node_modules/react-redux/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-tooltip/dist/react-tooltip.min.mjs.js +1 -1
- package/dist/node_modules/react-tooltip/dist/react-tooltip.min.mjs.js.map +1 -1
- package/dist/node_modules/socket.io-client/build/esm/socket.js +1 -1
- package/dist/node_modules/socket.io-client/build/esm/socket.js.map +1 -1
- package/dist/node_modules/socket.io-client/build/esm/url.js +1 -1
- package/dist/node_modules/socket.io-client/build/esm/url.js.map +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js +1 -1
- package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js.map +1 -1
- package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js +1 -1
- package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js.map +1 -1
- package/dist/package.json.js +1 -1
- package/dist/public/locales/en/translation.json.js +1 -1
- package/dist/public/locales/it/translation.json.js +1 -1
- package/dist/styles/CustomRange.styles.js.map +1 -1
- package/dist/styles/Island.styles.js +1 -1
- package/dist/styles/Island.styles.js.map +1 -1
- package/package.json +1 -1
- package/dist/node_modules/react-tooltip/dist/react-tooltip.min.css.js +0 -2
- package/dist/node_modules/react-tooltip/dist/react-tooltip.min.css.js.map +0 -1
- package/dist/node_modules/style-inject/dist/style-inject.es.js +0 -2
- package/dist/node_modules/style-inject/dist/style-inject.es.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket.js","sources":["../../../../../node_modules/engine.io-client/build/esm/socket.js"],"sourcesContent":["import { transports } from \"./transports/index.js\";\nimport { installTimerFunctions, byteLength } from \"./util.js\";\nimport { decode } from \"./contrib/parseqs.js\";\nimport { parse } from \"./contrib/parseuri.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { protocol } from \"engine.io-parser\";\nimport { defaultBinaryType } from \"./transports/websocket-constructor.js\";\nexport class Socket extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri - uri or options\n * @param {Object} opts - options\n */\n constructor(uri, opts = {}) {\n super();\n this.binaryType = defaultBinaryType;\n this.writeBuffer = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n if (uri) {\n uri = parse(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === \"https\" || uri.protocol === \"wss\";\n opts.port = uri.port;\n if (uri.query)\n opts.query = uri.query;\n }\n else if (opts.host) {\n opts.hostname = parse(opts.host).host;\n }\n installTimerFunctions(this, opts);\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? \"443\"\n : \"80\");\n this.transports = opts.transports || [\n \"polling\",\n \"websocket\",\n \"webtransport\",\n ];\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n this.opts = Object.assign({\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n addTrailingSlash: true,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024,\n },\n transportOptions: {},\n closeOnBeforeunload: false,\n }, opts);\n this.opts.path =\n this.opts.path.replace(/\\/$/, \"\") +\n (this.opts.addTrailingSlash ? \"/\" : \"\");\n if (typeof this.opts.query === \"string\") {\n this.opts.query = decode(this.opts.query);\n }\n // set on handshake\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null;\n // set on heartbeat\n this.pingTimeoutTimer = null;\n if (typeof addEventListener === \"function\") {\n if (this.opts.closeOnBeforeunload) {\n // Firefox closes the connection when the \"beforeunload\" event is emitted but not Chrome. This event listener\n // ensures every browser behaves the same (no \"disconnect\" event at the Socket.IO level when the page is\n // closed/reloaded)\n this.beforeunloadEventListener = () => {\n if (this.transport) {\n // silently close the transport\n this.transport.removeAllListeners();\n this.transport.close();\n }\n };\n addEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n }\n if (this.hostname !== \"localhost\") {\n this.offlineEventListener = () => {\n this.onClose(\"transport close\", {\n description: \"network connection lost\",\n });\n };\n addEventListener(\"offline\", this.offlineEventListener, false);\n }\n }\n this.open();\n }\n /**\n * Creates transport of the given type.\n *\n * @param {String} name - transport name\n * @return {Transport}\n * @private\n */\n createTransport(name) {\n const query = Object.assign({}, this.opts.query);\n // append engine.io protocol identifier\n query.EIO = protocol;\n // transport name\n query.transport = name;\n // session id if we already have one\n if (this.id)\n query.sid = this.id;\n const opts = Object.assign({}, this.opts, {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port,\n }, this.opts.transportOptions[name]);\n return new transports[name](opts);\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @private\n */\n open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @private\n */\n setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", (reason) => this.onClose(\"transport close\", reason));\n }\n /**\n * Probes a transport.\n *\n * @param {String} name - transport name\n * @private\n */\n probe(name) {\n let transport = this.createTransport(name);\n let failed = false;\n Socket.priorWebsocketSuccess = false;\n const onTransportOpen = () => {\n if (failed)\n return;\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", (msg) => {\n if (failed)\n return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n this.upgrading = true;\n this.emitReserved(\"upgrading\", transport);\n if (!transport)\n return;\n Socket.priorWebsocketSuccess = \"websocket\" === transport.name;\n this.transport.pause(() => {\n if (failed)\n return;\n if (\"closed\" === this.readyState)\n return;\n cleanup();\n this.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n this.emitReserved(\"upgrade\", transport);\n transport = null;\n this.upgrading = false;\n this.flush();\n });\n }\n else {\n const err = new Error(\"probe error\");\n // @ts-ignore\n err.transport = transport.name;\n this.emitReserved(\"upgradeError\", err);\n }\n });\n };\n function freezeTransport() {\n if (failed)\n return;\n // Any callback called by transport should be ignored since now\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n }\n // Handle any error that happens while probing\n const onerror = (err) => {\n const error = new Error(\"probe error: \" + err);\n // @ts-ignore\n error.transport = transport.name;\n freezeTransport();\n this.emitReserved(\"upgradeError\", error);\n };\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }\n // Remove all listeners on the transport and on self\n const cleanup = () => {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n this.off(\"close\", onclose);\n this.off(\"upgrading\", onupgrade);\n };\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n if (this.upgrades.indexOf(\"webtransport\") !== -1 &&\n name !== \"webtransport\") {\n // favor WebTransport\n this.setTimeoutFn(() => {\n if (!failed) {\n transport.open();\n }\n }, 200);\n }\n else {\n transport.open();\n }\n }\n /**\n * Called when connection is deemed open.\n *\n * @private\n */\n onOpen() {\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState && this.opts.upgrade) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }\n /**\n * Handles a packet.\n *\n * @private\n */\n onPacket(packet) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n this.emitReserved(\"packet\", packet);\n // Socket is live - any packet counts\n this.emitReserved(\"heartbeat\");\n this.resetPingTimeout();\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n case \"ping\":\n this.sendPacket(\"pong\");\n this.emitReserved(\"ping\");\n this.emitReserved(\"pong\");\n break;\n case \"error\":\n const err = new Error(\"server error\");\n // @ts-ignore\n err.code = packet.data;\n this.onError(err);\n break;\n case \"message\":\n this.emitReserved(\"data\", packet.data);\n this.emitReserved(\"message\", packet.data);\n break;\n }\n }\n else {\n }\n }\n /**\n * Called upon handshake completion.\n *\n * @param {Object} data - handshake obj\n * @private\n */\n onHandshake(data) {\n this.emitReserved(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.maxPayload = data.maxPayload;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState)\n return;\n this.resetPingTimeout();\n }\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @private\n */\n resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }\n /**\n * Called on `drain` event\n *\n * @private\n */\n onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }\n /**\n * Flush write buffers.\n *\n * @private\n */\n flush() {\n if (\"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length) {\n const packets = this.getWritablePackets();\n this.transport.send(packets);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = packets.length;\n this.emitReserved(\"flush\");\n }\n }\n /**\n * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP\n * long-polling)\n *\n * @private\n */\n getWritablePackets() {\n const shouldCheckPayloadSize = this.maxPayload &&\n this.transport.name === \"polling\" &&\n this.writeBuffer.length > 1;\n if (!shouldCheckPayloadSize) {\n return this.writeBuffer;\n }\n let payloadSize = 1; // first packet type\n for (let i = 0; i < this.writeBuffer.length; i++) {\n const data = this.writeBuffer[i].data;\n if (data) {\n payloadSize += byteLength(data);\n }\n if (i > 0 && payloadSize > this.maxPayload) {\n return this.writeBuffer.slice(0, i);\n }\n payloadSize += 2; // separator + packet type\n }\n return this.writeBuffer;\n }\n /**\n * Sends a message.\n *\n * @param {String} msg - message.\n * @param {Object} options.\n * @param {Function} callback function.\n * @return {Socket} for chaining.\n */\n write(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n send(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param {String} type: packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @private\n */\n sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n options = options || {};\n options.compress = false !== options.compress;\n const packet = {\n type: type,\n data: data,\n options: options,\n };\n this.emitReserved(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn)\n this.once(\"flush\", fn);\n this.flush();\n }\n /**\n * Closes the connection.\n */\n close() {\n const close = () => {\n this.onClose(\"forced close\");\n this.transport.close();\n };\n const cleanupAndClose = () => {\n this.off(\"upgrade\", cleanupAndClose);\n this.off(\"upgradeError\", cleanupAndClose);\n close();\n };\n const waitForUpgrade = () => {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n this.once(\"upgrade\", cleanupAndClose);\n this.once(\"upgradeError\", cleanupAndClose);\n };\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n if (this.writeBuffer.length) {\n this.once(\"drain\", () => {\n if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n });\n }\n else if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n }\n return this;\n }\n /**\n * Called upon transport error\n *\n * @private\n */\n onError(err) {\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }\n /**\n * Called upon transport close.\n *\n * @private\n */\n onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} upgrades - server upgrades\n * @private\n */\n filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n let i = 0;\n const j = upgrades.length;\n for (; i < j; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\nSocket.protocol = protocol;\n"],"names":["Socket","Emitter","constructor","uri","opts","super","this","binaryType","defaultBinaryType","writeBuffer","parse","hostname","host","secure","protocol","port","query","installTimerFunctions","location","transports","prevBufferLen","Object","assign","path","agent","withCredentials","upgrade","timestampParam","rememberUpgrade","addTrailingSlash","rejectUnauthorized","perMessageDeflate","threshold","transportOptions","closeOnBeforeunload","replace","decode","id","upgrades","pingInterval","pingTimeout","pingTimeoutTimer","addEventListener","beforeunloadEventListener","transport","removeAllListeners","close","offlineEventListener","onClose","description","open","createTransport","name","EIO","sid","socket","priorWebsocketSuccess","indexOf","length","setTimeoutFn","emitReserved","readyState","e","shift","setTransport","on","onDrain","bind","onPacket","onError","reason","probe","failed","onTransportOpen","send","type","data","once","msg","upgrading","pause","cleanup","flush","err","Error","freezeTransport","onerror","error","onTransportClose","onclose","onupgrade","to","removeListener","off","onOpen","i","l","packet","resetPingTimeout","onHandshake","JSON","sendPacket","code","filterUpgrades","maxPayload","clearTimeoutFn","autoUnref","unref","splice","writable","packets","getWritablePackets","payloadSize","byteLength","slice","write","options","fn","undefined","compress","push","cleanupAndClose","waitForUpgrade","removeEventListener","filteredUpgrades","j"],"mappings":"gYAOO,MAAMA,UAAeC,EAAAA,QAOxBC,WAAAA,CAAYC,EAAKC,EAAO,IACpBC,QACAC,KAAKC,WAAaC,oBAClBF,KAAKG,YAAc,GACfN,GAAO,iBAAoBA,IAC3BC,EAAOD,EACPA,EAAM,MAENA,GACAA,EAAMO,EAAAA,MAAMP,GACZC,EAAKO,SAAWR,EAAIS,KACpBR,EAAKS,OAA0B,UAAjBV,EAAIW,UAAyC,QAAjBX,EAAIW,SAC9CV,EAAKW,KAAOZ,EAAIY,KACZZ,EAAIa,QACJZ,EAAKY,MAAQb,EAAIa,QAEhBZ,EAAKQ,OACVR,EAAKO,SAAWD,EAAKA,MAACN,EAAKQ,MAAMA,MAErCK,wBAAsBX,KAAMF,GAC5BE,KAAKO,OACD,MAAQT,EAAKS,OACPT,EAAKS,OACe,oBAAbK,UAA4B,WAAaA,SAASJ,SAC/DV,EAAKO,WAAaP,EAAKW,OAEvBX,EAAKW,KAAOT,KAAKO,OAAS,MAAQ,MAEtCP,KAAKK,SACDP,EAAKO,WACoB,oBAAbO,SAA2BA,SAASP,SAAW,aAC/DL,KAAKS,KACDX,EAAKW,OACoB,oBAAbG,UAA4BA,SAASH,KACvCG,SAASH,KACTT,KAAKO,OACD,MACA,MAClBP,KAAKa,WAAaf,EAAKe,YAAc,CACjC,UACA,YACA,gBAEJb,KAAKG,YAAc,GACnBH,KAAKc,cAAgB,EACrBd,KAAKF,KAAOiB,OAAOC,OAAO,CACtBC,KAAM,aACNC,OAAO,EACPC,iBAAiB,EACjBC,SAAS,EACTC,eAAgB,IAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,oBAAoB,EACpBC,kBAAmB,CACfC,UAAW,MAEfC,iBAAkB,CAAE,EACpBC,qBAAqB,GACtB9B,GACHE,KAAKF,KAAKmB,KACNjB,KAAKF,KAAKmB,KAAKY,QAAQ,MAAO,KACzB7B,KAAKF,KAA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QnB,EAASyD,KAClC6B,EAAiBJ,KAAKlF,EAASyD,IAEvC,OAAO6B,CACX,EAEJ5H,EAAOc,SAAWA,EAAQA"}
|
|
1
|
+
{"version":3,"file":"socket.js","sources":["../../../../../node_modules/engine.io-client/build/esm/socket.js"],"sourcesContent":["import { transports } from \"./transports/index.js\";\nimport { installTimerFunctions, byteLength } from \"./util.js\";\nimport { decode } from \"./contrib/parseqs.js\";\nimport { parse } from \"./contrib/parseuri.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { protocol } from \"engine.io-parser\";\nimport { defaultBinaryType } from \"./transports/websocket-constructor.js\";\nexport class Socket extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri - uri or options\n * @param {Object} opts - options\n */\n constructor(uri, opts = {}) {\n super();\n this.binaryType = defaultBinaryType;\n this.writeBuffer = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n if (uri) {\n uri = parse(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === \"https\" || uri.protocol === \"wss\";\n opts.port = uri.port;\n if (uri.query)\n opts.query = uri.query;\n }\n else if (opts.host) {\n opts.hostname = parse(opts.host).host;\n }\n installTimerFunctions(this, opts);\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? \"443\"\n : \"80\");\n this.transports = opts.transports || [\n \"polling\",\n \"websocket\",\n \"webtransport\",\n ];\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n this.opts = Object.assign({\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n addTrailingSlash: true,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024,\n },\n transportOptions: {},\n closeOnBeforeunload: false,\n }, opts);\n this.opts.path =\n this.opts.path.replace(/\\/$/, \"\") +\n (this.opts.addTrailingSlash ? \"/\" : \"\");\n if (typeof this.opts.query === \"string\") {\n this.opts.query = decode(this.opts.query);\n }\n // set on handshake\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null;\n // set on heartbeat\n this.pingTimeoutTimer = null;\n if (typeof addEventListener === \"function\") {\n if (this.opts.closeOnBeforeunload) {\n // Firefox closes the connection when the \"beforeunload\" event is emitted but not Chrome. This event listener\n // ensures every browser behaves the same (no \"disconnect\" event at the Socket.IO level when the page is\n // closed/reloaded)\n this.beforeunloadEventListener = () => {\n if (this.transport) {\n // silently close the transport\n this.transport.removeAllListeners();\n this.transport.close();\n }\n };\n addEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n }\n if (this.hostname !== \"localhost\") {\n this.offlineEventListener = () => {\n this.onClose(\"transport close\", {\n description: \"network connection lost\",\n });\n };\n addEventListener(\"offline\", this.offlineEventListener, false);\n }\n }\n this.open();\n }\n /**\n * Creates transport of the given type.\n *\n * @param {String} name - transport name\n * @return {Transport}\n * @private\n */\n createTransport(name) {\n const query = Object.assign({}, this.opts.query);\n // append engine.io protocol identifier\n query.EIO = protocol;\n // transport name\n query.transport = name;\n // session id if we already have one\n if (this.id)\n query.sid = this.id;\n const opts = Object.assign({}, this.opts, {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port,\n }, this.opts.transportOptions[name]);\n return new transports[name](opts);\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @private\n */\n open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @private\n */\n setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", (reason) => this.onClose(\"transport close\", reason));\n }\n /**\n * Probes a transport.\n *\n * @param {String} name - transport name\n * @private\n */\n probe(name) {\n let transport = this.createTransport(name);\n let failed = false;\n Socket.priorWebsocketSuccess = false;\n const onTransportOpen = () => {\n if (failed)\n return;\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", (msg) => {\n if (failed)\n return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n this.upgrading = true;\n this.emitReserved(\"upgrading\", transport);\n if (!transport)\n return;\n Socket.priorWebsocketSuccess = \"websocket\" === transport.name;\n this.transport.pause(() => {\n if (failed)\n return;\n if (\"closed\" === this.readyState)\n return;\n cleanup();\n this.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n this.emitReserved(\"upgrade\", transport);\n transport = null;\n this.upgrading = false;\n this.flush();\n });\n }\n else {\n const err = new Error(\"probe error\");\n // @ts-ignore\n err.transport = transport.name;\n this.emitReserved(\"upgradeError\", err);\n }\n });\n };\n function freezeTransport() {\n if (failed)\n return;\n // Any callback called by transport should be ignored since now\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n }\n // Handle any error that happens while probing\n const onerror = (err) => {\n const error = new Error(\"probe error: \" + err);\n // @ts-ignore\n error.transport = transport.name;\n freezeTransport();\n this.emitReserved(\"upgradeError\", error);\n };\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }\n // Remove all listeners on the transport and on self\n const cleanup = () => {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n this.off(\"close\", onclose);\n this.off(\"upgrading\", onupgrade);\n };\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n if (this.upgrades.indexOf(\"webtransport\") !== -1 &&\n name !== \"webtransport\") {\n // favor WebTransport\n this.setTimeoutFn(() => {\n if (!failed) {\n transport.open();\n }\n }, 200);\n }\n else {\n transport.open();\n }\n }\n /**\n * Called when connection is deemed open.\n *\n * @private\n */\n onOpen() {\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState && this.opts.upgrade) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }\n /**\n * Handles a packet.\n *\n * @private\n */\n onPacket(packet) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n this.emitReserved(\"packet\", packet);\n // Socket is live - any packet counts\n this.emitReserved(\"heartbeat\");\n this.resetPingTimeout();\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n case \"ping\":\n this.sendPacket(\"pong\");\n this.emitReserved(\"ping\");\n this.emitReserved(\"pong\");\n break;\n case \"error\":\n const err = new Error(\"server error\");\n // @ts-ignore\n err.code = packet.data;\n this.onError(err);\n break;\n case \"message\":\n this.emitReserved(\"data\", packet.data);\n this.emitReserved(\"message\", packet.data);\n break;\n }\n }\n else {\n }\n }\n /**\n * Called upon handshake completion.\n *\n * @param {Object} data - handshake obj\n * @private\n */\n onHandshake(data) {\n this.emitReserved(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.maxPayload = data.maxPayload;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState)\n return;\n this.resetPingTimeout();\n }\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @private\n */\n resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }\n /**\n * Called on `drain` event\n *\n * @private\n */\n onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }\n /**\n * Flush write buffers.\n *\n * @private\n */\n flush() {\n if (\"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length) {\n const packets = this.getWritablePackets();\n this.transport.send(packets);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = packets.length;\n this.emitReserved(\"flush\");\n }\n }\n /**\n * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP\n * long-polling)\n *\n * @private\n */\n getWritablePackets() {\n const shouldCheckPayloadSize = this.maxPayload &&\n this.transport.name === \"polling\" &&\n this.writeBuffer.length > 1;\n if (!shouldCheckPayloadSize) {\n return this.writeBuffer;\n }\n let payloadSize = 1; // first packet type\n for (let i = 0; i < this.writeBuffer.length; i++) {\n const data = this.writeBuffer[i].data;\n if (data) {\n payloadSize += byteLength(data);\n }\n if (i > 0 && payloadSize > this.maxPayload) {\n return this.writeBuffer.slice(0, i);\n }\n payloadSize += 2; // separator + packet type\n }\n return this.writeBuffer;\n }\n /**\n * Sends a message.\n *\n * @param {String} msg - message.\n * @param {Object} options.\n * @param {Function} callback function.\n * @return {Socket} for chaining.\n */\n write(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n send(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param {String} type: packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @private\n */\n sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n options = options || {};\n options.compress = false !== options.compress;\n const packet = {\n type: type,\n data: data,\n options: options,\n };\n this.emitReserved(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn)\n this.once(\"flush\", fn);\n this.flush();\n }\n /**\n * Closes the connection.\n */\n close() {\n const close = () => {\n this.onClose(\"forced close\");\n this.transport.close();\n };\n const cleanupAndClose = () => {\n this.off(\"upgrade\", cleanupAndClose);\n this.off(\"upgradeError\", cleanupAndClose);\n close();\n };\n const waitForUpgrade = () => {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n this.once(\"upgrade\", cleanupAndClose);\n this.once(\"upgradeError\", cleanupAndClose);\n };\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n if (this.writeBuffer.length) {\n this.once(\"drain\", () => {\n if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n });\n }\n else if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n }\n return this;\n }\n /**\n * Called upon transport error\n *\n * @private\n */\n onError(err) {\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }\n /**\n * Called upon transport close.\n *\n * @private\n */\n onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} upgrades - server upgrades\n * @private\n */\n filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n let i = 0;\n const j = upgrades.length;\n for (; i < j; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\nSocket.protocol = protocol;\n"],"names":["Socket","Emitter","constructor","uri","opts","arguments","length","undefined","super","this","binaryType","defaultBinaryType","writeBuffer","parse","hostname","host","secure","protocol","port","query","installTimerFunctions","location","transports","prevBufferLen","Object","assign","path","agent","withCredentials","upgrade","timestampParam","rememberUpgrade","addTrailingSlash","rejectUnauthorized","perMessageDeflate","threshold","transportOptions","closeOnBeforeunload","replace","decode","id","upgrades","pingInterval","pingTimeout","pingTimeoutTimer","addEventListener","beforeunloadEventListener","transport","removeAllListeners","close","offlineEventListener","onClose","description","open","createTransport","name","EIO","sid","socket","priorWebsocketSuccess","indexOf","setTimeoutFn","emitReserved","readyState","e","shift","setTransport","on","onDrain","bind","onPacket","onError","reason","probe","failed","onTransportOpen","send","type","data","once","msg","upgrading","pause","cleanup","flush","err","Error","freezeTransport","onerror","error","onTransportClose","onclose","onupgrade","to","removeListener","off","onOpen","i","l","packet","resetPingTimeout","onHandshake","JSON","sendPacket","code","filterUpgrades","maxPayload","clearTimeoutFn","autoUnref","unref","splice","writable","packets","getWritablePackets","payloadSize","byteLength","slice","write","options","fn","compress","push","cleanupAndClose","waitForUpgrade","removeEventListener","filteredUpgrades","j"],"mappings":"gYAOO,MAAMA,UAAeC,EAAAA,QAOxBC,WAAAA,CAAYC,GAAgB,IAAXC,EAAIC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAA,EACpBG,QACAC,KAAKC,WAAaC,oBAClBF,KAAKG,YAAc,GACfT,GAAO,iBAAoBA,IAC3BC,EAAOD,EACPA,EAAM,MAENA,GACAA,EAAMU,EAAAA,MAAMV,GACZC,EAAKU,SAAWX,EAAIY,KACpBX,EAAKY,OAA0B,UAAjBb,EAAIc,UAAyC,QAAjBd,EAAIc,SAC9Cb,EAAKc,KAAOf,EAAIe,KACZf,EAAIgB,QACJf,EAAKe,MAAQhB,EAAIgB,QAEhBf,EAAKW,OACVX,EAAKU,SAAWD,EAAKA,MAACT,EAAKW,MAAMA,MAErCK,wBAAsBX,KAAML,GAC5BK,KAAKO,OACD,MAAQZ,EAAKY,OACPZ,EAAKY,OACe,oBAAbK,UAA4B,WAAaA,SAASJ,SAC/Db,EAAKU,WAAaV,EAAKc,OAEvBd,EAAKc,KAAOT,KAAKO,OAAS,MAAQ,MAEtCP,KAAKK,SACDV,EAAKU,WACoB,oBAAbO,SAA2BA,SAASP,SAAW,aAC/DL,KAAKS,KACDd,EAAKc,OACoB,oBAAbG,UAA4BA,SAASH,KACvCG,SAASH,KACTT,KAAKO,OACD,MACA,MAClBP,KAAKa,WAAalB,EAAKkB,YAAc,CACjC,UACA,YACA,gBAEJ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8E,oBAAoB,UAAWnH,KAAKyC,sBAAsB,IAG9DzC,KAAKsD,WAAa,SAElBtD,KAAK+B,GAAK,KAEV/B,KAAKqD,aAAa,QAASU,EAAQpB,GAGnC3C,KAAKG,YAAc,GACnBH,KAAKc,cAAgB,EAE7B,CAOAkF,cAAAA,CAAehE,GACX,MAAMoF,EAAmB,GACzB,IAAI5B,EAAI,EACR,MAAM6B,EAAIrF,EAASnC,OACnB,KAAO2F,EAAI6B,EAAG7B,KACLxF,KAAKa,WAAWsC,QAAQnB,EAASwD,KAClC4B,EAAiBJ,KAAKhF,EAASwD,IAEvC,OAAO4B,CACX,EAEJ7H,EAAOiB,SAAWA,EAAQA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../engine.io-parser/build/esm/encodePacket.browser.js");var e=require("../../../engine.io-parser/build/esm/decodePacket.browser.js");require("../../../engine.io-parser/build/esm/commons.js");var t=require("../../../@socket.io/component-emitter/lib/esm/index.js"),s=require("./util.js"),r=require("./contrib/parseqs.js");class o extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class i extends t.Emitter{constructor(e){super(),this.writable=!1,s.installTimerFunctions(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,s){return super.emitReserved("error",new o(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const s=e.decodePacket(t,this.socket.binaryType);this.onPacket(s)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../engine.io-parser/build/esm/encodePacket.browser.js");var e=require("../../../engine.io-parser/build/esm/decodePacket.browser.js");require("../../../engine.io-parser/build/esm/commons.js");var t=require("../../../@socket.io/component-emitter/lib/esm/index.js"),s=require("./util.js"),r=require("./contrib/parseqs.js");class o extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class i extends t.Emitter{constructor(e){super(),this.writable=!1,s.installTimerFunctions(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,s){return super.emitReserved("error",new o(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const s=e.decodePacket(t,this.socket.binaryType);this.onPacket(s)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=r.encode(e);return t.length?"?"+t:""}}exports.Transport=i,exports.TransportError=o;
|
|
2
2
|
//# sourceMappingURL=transport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sources":["../../../../../node_modules/engine.io-client/build/esm/transport.js"],"sourcesContent":["import { decodePacket } from \"engine.io-parser\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions } from \"./util.js\";\nimport { encode } from \"./contrib/parseqs.js\";\nexport class TransportError extends Error {\n constructor(reason, description, context) {\n super(reason);\n this.description = description;\n this.context = context;\n this.type = \"TransportError\";\n }\n}\nexport class Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} opts - options\n * @protected\n */\n constructor(opts) {\n super();\n this.writable = false;\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.query = opts.query;\n this.socket = opts.socket;\n }\n /**\n * Emits an error.\n *\n * @param {String} reason\n * @param description\n * @param context - the error context\n * @return {Transport} for chaining\n * @protected\n */\n onError(reason, description, context) {\n super.emitReserved(\"error\", new TransportError(reason, description, context));\n return this;\n }\n /**\n * Opens the transport.\n */\n open() {\n this.readyState = \"opening\";\n this.doOpen();\n return this;\n }\n /**\n * Closes the transport.\n */\n close() {\n if (this.readyState === \"opening\" || this.readyState === \"open\") {\n this.doClose();\n this.onClose();\n }\n return this;\n }\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n */\n send(packets) {\n if (this.readyState === \"open\") {\n this.write(packets);\n }\n else {\n // this might happen if the transport was silently closed in the beforeunload event handler\n }\n }\n /**\n * Called upon open\n *\n * @protected\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n super.emitReserved(\"open\");\n }\n /**\n * Called with data.\n *\n * @param {String} data\n * @protected\n */\n onData(data) {\n const packet = decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n /**\n * Called with a decoded packet.\n *\n * @protected\n */\n onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }\n /**\n * Called upon close.\n *\n * @protected\n */\n onClose(details) {\n this.readyState = \"closed\";\n super.emitReserved(\"close\", details);\n }\n /**\n * Pauses the transport, in order not to lose packets during an upgrade.\n *\n * @param onPause\n */\n pause(onPause) { }\n createUri(schema, query = {}) {\n return (schema +\n \"://\" +\n this._hostname() +\n this._port() +\n this.opts.path +\n this._query(query));\n }\n _hostname() {\n const hostname = this.opts.hostname;\n return hostname.indexOf(\":\") === -1 ? hostname : \"[\" + hostname + \"]\";\n }\n _port() {\n if (this.opts.port &&\n ((this.opts.secure && Number(this.opts.port !== 443)) ||\n (!this.opts.secure && Number(this.opts.port) !== 80))) {\n return \":\" + this.opts.port;\n }\n else {\n return \"\";\n }\n }\n _query(query) {\n const encodedQuery = encode(query);\n return encodedQuery.length ? \"?\" + encodedQuery : \"\";\n }\n}\n"],"names":["TransportError","Error","constructor","reason","description","context","super","this","type","Transport","Emitter","opts","writable","installTimerFunctions","query","socket","onError","emitReserved","open","readyState","doOpen","close","doClose","onClose","send","packets","write","onOpen","onData","data","packet","decodePacket","binaryType","onPacket","details","pause","onPause","createUri","schema","_hostname","_port","path","_query","hostname","indexOf","port","secure","Number","encodedQuery","encode"
|
|
1
|
+
{"version":3,"file":"transport.js","sources":["../../../../../node_modules/engine.io-client/build/esm/transport.js"],"sourcesContent":["import { decodePacket } from \"engine.io-parser\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions } from \"./util.js\";\nimport { encode } from \"./contrib/parseqs.js\";\nexport class TransportError extends Error {\n constructor(reason, description, context) {\n super(reason);\n this.description = description;\n this.context = context;\n this.type = \"TransportError\";\n }\n}\nexport class Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} opts - options\n * @protected\n */\n constructor(opts) {\n super();\n this.writable = false;\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.query = opts.query;\n this.socket = opts.socket;\n }\n /**\n * Emits an error.\n *\n * @param {String} reason\n * @param description\n * @param context - the error context\n * @return {Transport} for chaining\n * @protected\n */\n onError(reason, description, context) {\n super.emitReserved(\"error\", new TransportError(reason, description, context));\n return this;\n }\n /**\n * Opens the transport.\n */\n open() {\n this.readyState = \"opening\";\n this.doOpen();\n return this;\n }\n /**\n * Closes the transport.\n */\n close() {\n if (this.readyState === \"opening\" || this.readyState === \"open\") {\n this.doClose();\n this.onClose();\n }\n return this;\n }\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n */\n send(packets) {\n if (this.readyState === \"open\") {\n this.write(packets);\n }\n else {\n // this might happen if the transport was silently closed in the beforeunload event handler\n }\n }\n /**\n * Called upon open\n *\n * @protected\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n super.emitReserved(\"open\");\n }\n /**\n * Called with data.\n *\n * @param {String} data\n * @protected\n */\n onData(data) {\n const packet = decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n /**\n * Called with a decoded packet.\n *\n * @protected\n */\n onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }\n /**\n * Called upon close.\n *\n * @protected\n */\n onClose(details) {\n this.readyState = \"closed\";\n super.emitReserved(\"close\", details);\n }\n /**\n * Pauses the transport, in order not to lose packets during an upgrade.\n *\n * @param onPause\n */\n pause(onPause) { }\n createUri(schema, query = {}) {\n return (schema +\n \"://\" +\n this._hostname() +\n this._port() +\n this.opts.path +\n this._query(query));\n }\n _hostname() {\n const hostname = this.opts.hostname;\n return hostname.indexOf(\":\") === -1 ? hostname : \"[\" + hostname + \"]\";\n }\n _port() {\n if (this.opts.port &&\n ((this.opts.secure && Number(this.opts.port !== 443)) ||\n (!this.opts.secure && Number(this.opts.port) !== 80))) {\n return \":\" + this.opts.port;\n }\n else {\n return \"\";\n }\n }\n _query(query) {\n const encodedQuery = encode(query);\n return encodedQuery.length ? \"?\" + encodedQuery : \"\";\n }\n}\n"],"names":["TransportError","Error","constructor","reason","description","context","super","this","type","Transport","Emitter","opts","writable","installTimerFunctions","query","socket","onError","emitReserved","open","readyState","doOpen","close","doClose","onClose","send","packets","write","onOpen","onData","data","packet","decodePacket","binaryType","onPacket","details","pause","onPause","createUri","schema","arguments","length","undefined","_hostname","_port","path","_query","hostname","indexOf","port","secure","Number","encodedQuery","encode"],"mappings":"mZAIO,MAAMA,UAAuBC,MAChCC,WAAAA,CAAYC,EAAQC,EAAaC,GAC7BC,MAAMH,GACNI,KAAKH,YAAcA,EACnBG,KAAKF,QAAUA,EACfE,KAAKC,KAAO,gBAChB,EAEG,MAAMC,UAAkBC,EAAAA,QAO3BR,WAAAA,CAAYS,GACRL,QACAC,KAAKK,UAAW,EAChBC,wBAAsBN,KAAMI,GAC5BJ,KAAKI,KAAOA,EACZJ,KAAKO,MAAQH,EAAKG,MAClBP,KAAKQ,OAASJ,EAAKI,MACvB,CAU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qC,KAGhB,EAEf,CACAH,MAAAA,CAAO/B,GACH,MAAMqC,EAAeC,SAAOtC,GAC5B,OAAOqC,EAAaX,OAAS,IAAMW,EAAe,EACtD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../transport.js"),e=require("../contrib/yeast.js"),s=require("../../../../engine.io-parser/build/esm/index.js"),i=require("./xmlhttprequest.browser.js"),o=require("../../../../@socket.io/component-emitter/lib/esm/index.js"),r=require("../util.js"),n=require("../globalThis.browser.js");function a(){}const h=null!=new i.XHR({xdomain:!1}).responseType;class d extends t.Transport{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){const e="https:"===location.protocol;let s=location.port;s||(s=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||s!==t.port}const e=t&&t.forceBase64;this.supportsBinary=h&&!e,this.opts.withCredentials&&(this.cookieJar=i.createCookieJar())}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",(function(){--t||e()}))),this.writable||(t++,this.once("drain",(function(){--t||e()})))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){s.decodePayload(t,this.socket.binaryType).forEach((t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,s.encodePayload(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const t=this.opts.secure?"https":"http",s=this.query||{};return!1!==this.opts.timestampRequests&&(s[this.opts.timestampParam]=e.yeast()),this.supportsBinary||s.sid||(s.b64=1),this.createUri(t,s)}request(t={}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../transport.js"),e=require("../contrib/yeast.js"),s=require("../../../../engine.io-parser/build/esm/index.js"),i=require("./xmlhttprequest.browser.js"),o=require("../../../../@socket.io/component-emitter/lib/esm/index.js"),r=require("../util.js"),n=require("../globalThis.browser.js");function a(){}const h=null!=new i.XHR({xdomain:!1}).responseType;class d extends t.Transport{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){const e="https:"===location.protocol;let s=location.port;s||(s=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||s!==t.port}const e=t&&t.forceBase64;this.supportsBinary=h&&!e,this.opts.withCredentials&&(this.cookieJar=i.createCookieJar())}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",(function(){--t||e()}))),this.writable||(t++,this.once("drain",(function(){--t||e()})))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){s.decodePayload(t,this.socket.binaryType).forEach((t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,s.encodePayload(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const t=this.opts.secure?"https":"http",s=this.query||{};return!1!==this.opts.timestampRequests&&(s[this.opts.timestampParam]=e.yeast()),this.supportsBinary||s.sid||(s.b64=1),this.createUri(t,s)}request(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new l(this.uri(),t)}doWrite(t,e){const s=this.request({method:"POST",data:t});s.on("success",e),s.on("error",((t,e)=>{this.onError("xhr post error",t,e)}))}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",((t,e)=>{this.onError("xhr poll error",t,e)})),this.pollXhr=t}}class l extends o.Emitter{constructor(t,e){super(),r.installTimerFunctions(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.data=void 0!==e.data?e.data:null,this.create()}create(){var t;const e=r.pick(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;const s=this.xhr=new i.XHR(e);try{s.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&s.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(t){}if("POST"===this.method)try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{s.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(s.timeout=this.opts.requestTimeout),s.onreadystatechange=()=>{var t;3===s.readyState&&(null===(t=this.opts.cookieJar)||void 0===t||t.parseCookies(s)),4===s.readyState&&(200===s.status||1223===s.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof s.status?s.status:0)}),0))},s.send(this.data)}catch(t){return void this.setTimeoutFn((()=>{this.onError(t)}),0)}"undefined"!=typeof document&&(this.index=l.requestsCount++,l.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=a,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete l.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(l.requestsCount=0,l.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",p);else if("function"==typeof addEventListener){const t="onpagehide"in n.globalThisShim?"pagehide":"unload";addEventListener(t,p,!1)}function p(){for(let t in l.requests)l.requests.hasOwnProperty(t)&&l.requests[t].abort()}exports.Polling=d,exports.Request=l;
|
|
2
2
|
//# sourceMappingURL=polling.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polling.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/polling.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { createCookieJar, XHR as XMLHttpRequest, } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false,\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @package\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n if (this.opts.withCredentials) {\n this.cookieJar = createCookieJar();\n }\n }\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @protected\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} onPause - callback upon buffers are flushed and transport is paused\n * @package\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @private\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @protected\n */\n onData(data) {\n const callback = (packet) => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @protected\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} packets - data packets\n * @protected\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, (data) => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"https\" : \"http\";\n const query = this.query || {};\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, cookieJar: this.cookieJar }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data,\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @package\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @private\n */\n create() {\n var _a;\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, true);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n var _a;\n if (xhr.readyState === 3) {\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(xhr);\n }\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @package\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n"],"names":["empty","hasXHR2","XMLHttpRequest","xdomain","responseType","Polling","Transport","constructor","opts","super","this","polling","location","isSSL","protocol","port","xd","hostname","forceBase64","supportsBinary","withCredentials","cookieJar","createCookieJar","name","doOpen","poll","pause","onPause","readyState","writable","total","once","doPoll","emitReserved","onData","data","decodePayload","socket","binaryType","forEach","packet","type","onOpen","onClose","description","onPacket","doClose","close","write","packets","encodePayload","doWrite","uri","schema","secure","query","timestampRequests","timestampParam","yeast","sid","b64","createUri","request","Object","assign","Request","fn","req","method","on","xhrStatus","context","onError","bind","pollXhr","Emitter","installTimerFunctions","undefined","create","_a","pick","xhr","XHR","open","extraHeaders","setDisableHeaderCheck","i","hasOwnProperty","setRequestHeader","e","addCookies","requestTimeout","timeout","onreadystatechange","parseCookies","status","onLoad","setTimeoutFn","send","document","index","requestsCount","requests","err","cleanup","fromError","abort","responseText","attachEvent","unloadHandler","addEventListener","terminationEvent","globalThis"],"mappings":"iXAOA,SAASA,IAAU,CACnB,MAAMC,EAIK,MAHK,IAAIC,MAAe,CAC3BC,SAAS,IAEMC,aAEhB,MAAMC,UAAgBC,EAAAA,UAOzBC,WAAAA,CAAYC,GAGR,GAFAC,MAAMD,GACNE,KAAKC,SAAU,EACS,oBAAbC,SAA0B,CACjC,MAAMC,EAAQ,WAAaD,SAASE,SAC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ine.io-client/build/esm/transports/polling.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { createCookieJar, XHR as XMLHttpRequest, } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false,\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @package\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n if (this.opts.withCredentials) {\n this.cookieJar = createCookieJar();\n }\n }\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @protected\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} onPause - callback upon buffers are flushed and transport is paused\n * @package\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @private\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @protected\n */\n onData(data) {\n const callback = (packet) => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @protected\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} packets - data packets\n * @protected\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, (data) => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"https\" : \"http\";\n const query = this.query || {};\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, cookieJar: this.cookieJar }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data,\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @package\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @private\n */\n create() {\n var _a;\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, true);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n var _a;\n if (xhr.readyState === 3) {\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(xhr);\n }\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @package\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n"],"names":["empty","hasXHR2","XMLHttpRequest","xdomain","responseType","Polling","Transport","constructor","opts","super","this","polling","location","isSSL","protocol","port","xd","hostname","forceBase64","supportsBinary","withCredentials","cookieJar","createCookieJar","name","doOpen","poll","pause","onPause","readyState","writable","total","once","doPoll","emitReserved","onData","data","decodePayload","socket","binaryType","forEach","packet","type","onOpen","onClose","description","onPacket","doClose","close","write","packets","encodePayload","doWrite","uri","schema","secure","query","timestampRequests","timestampParam","yeast","sid","b64","createUri","request","arguments","length","undefined","Object","assign","Request","fn","req","method","on","xhrStatus","context","onError","bind","pollXhr","Emitter","installTimerFunctions","create","_a","pick","xhr","XHR","open","extraHeaders","setDisableHeaderCheck","i","hasOwnProperty","setRequestHeader","e","addCookies","requestTimeout","timeout","onreadystatechange","parseCookies","status","onLoad","setTimeoutFn","send","document","index","requestsCount","requests","err","cleanup","fromError","abort","responseText","attachEvent","unloadHandler","addEventListener","terminationEvent","globalThis"],"mappings":"iXAOA,SAASA,IAAU,CACnB,MAAMC,EAIK,MAHK,IAAIC,MAAe,CAC3BC,SAAS,IAEMC,aAEhB,MAAMC,UAAgBC,EAAAA,UAOzBC,WAAAA,CAAYC,GAGR,GAFAC,MAAMD,GACNE,KAAKC,SAAU,EACS,oBAAbC,SAA0B,CACjC,MAAMC,EAAQ,WAAaD,SAASE,SACpC,IAAIC,EAAOH,SAASG,KAEfA,IACDA,EAAOF,EAAQ,MAAQ,MAE3BH,KAAKM,GACoB,oBAAbJ,UACJJ,EAAKS,WAAaL,SAASK,UAC3BF,IAASP,EAAKO,IAC1B,CAIA,MAAMG,EAAcV,GAAQA,EAAKU,YACjCR,KAAKS,eAAiBlB,IAAYiB,EAC9BR,KAAKF,KAAKY,kBACVV,KAAKW,UAAYC,EAAAA,kBAEzB,CACA,QAAIC,GACA,MAAO,SACX,CAOAC,MAAAA,GACId,KAAKe,MACT,CA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K4F,OAAS5F,KAEvC,CAMAiE,OAAAA,CAAQ8B,GACJ/F,KAAKuB,aAAa,QAASwE,EAAK/F,KAAKyE,KACrCzE,KAAKgG,SAAQ,EACjB,CAMAA,OAAAA,CAAQC,GACJ,QAAI,IAAuBjG,KAAKyE,KAAO,OAASzE,KAAKyE,IAArD,CAIA,GADAzE,KAAKyE,IAAIY,mBAAqB/F,EAC1B2G,EACA,IACIjG,KAAKyE,IAAIyB,OACb,CACA,MAAOjB,GAAK,CAEQ,oBAAbU,iBACAjC,EAAQoC,SAAS9F,KAAK4F,OAEjC5F,KAAKyE,IAAM,IAXX,CAYJ,CAMAe,MAAAA,GACI,MAAM/D,EAAOzB,KAAKyE,IAAI0B,aACT,OAAT1E,IACAzB,KAAKuB,aAAa,OAAQE,GAC1BzB,KAAKuB,aAAa,WAClBvB,KAAKgG,UAEb,CAMAE,KAAAA,GACIlG,KAAKgG,SACT,EASJ,GAPAtC,EAAQmC,cAAgB,EACxBnC,EAAQoC,SAAW,CAAA,EAMK,oBAAbH,SAEP,GAA2B,mBAAhBS,YAEPA,YAAY,WAAYC,QAEvB,GAAgC,mBAArBC,iBAAiC,CAC7C,MAAMC,EAAmB,eAAgBC,iBAAa,WAAa,SACnEF,iBAAiBC,EAAkBF,GAAe,EACtD,CAEJ,SAASA,IACL,IAAK,IAAIvB,KAAKpB,EAAQoC,SACdpC,EAAQoC,SAASf,eAAeD,IAChCpB,EAAQoC,SAAShB,GAAGoB,OAGhC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../transport.js"),t=require("./websocket-constructor.browser.js"),r=require("../../../../engine.io-parser/build/esm/index.js");class s extends e.Transport{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=r.createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=r.createPacketEncoderStream();i.readable.pipeTo(e.writable),this.writer=i.writable.getWriter();const n=()=>{s.read().then((
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../transport.js"),t=require("./websocket-constructor.browser.js"),r=require("../../../../engine.io-parser/build/esm/index.js");class s extends e.Transport{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=r.createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=r.createPacketEncoderStream();i.readable.pipeTo(e.writable),this.writer=i.writable.getWriter();const n=()=>{s.read().then((e=>{let{done:t,value:r}=e;t||(this.onPacket(r),n())})).catch((e=>{}))};n();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const s=e[r],i=r===e.length-1;this.writer.write(s).then((()=>{i&&t.nextTick((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}}exports.WT=s;
|
|
2
2
|
//# sourceMappingURL=webtransport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webtransport.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/webtransport.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { nextTick } from \"./websocket-constructor.js\";\nimport { createPacketDecoderStream, createPacketEncoderStream, } from \"engine.io-parser\";\nexport class WT extends Transport {\n get name() {\n return \"webtransport\";\n }\n doOpen() {\n // @ts-ignore\n if (typeof WebTransport !== \"function\") {\n return;\n }\n // @ts-ignore\n this.transport = new WebTransport(this.createUri(\"https\"), this.opts.transportOptions[this.name]);\n this.transport.closed\n .then(() => {\n this.onClose();\n })\n .catch((err) => {\n this.onError(\"webtransport error\", err);\n });\n // note: we could have used async/await, but that would require some additional polyfills\n this.transport.ready.then(() => {\n this.transport.createBidirectionalStream().then((stream) => {\n const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);\n const reader = stream.readable.pipeThrough(decoderStream).getReader();\n const encoderStream = createPacketEncoderStream();\n encoderStream.readable.pipeTo(stream.writable);\n this.writer = encoderStream.writable.getWriter();\n const read = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n return;\n }\n this.onPacket(value);\n read();\n })\n .catch((err) => {\n });\n };\n read();\n const packet = { type: \"open\" };\n if (this.query.sid) {\n packet.data = `{\"sid\":\"${this.query.sid}\"}`;\n }\n this.writer.write(packet).then(() => this.onOpen());\n });\n });\n }\n write(packets) {\n this.writable = false;\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n this.writer.write(packet).then(() => {\n if (lastPacket) {\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n var _a;\n (_a = this.transport) === null || _a === void 0 ? void 0 : _a.close();\n }\n}\n"],"names":["WT","Transport","name","doOpen","WebTransport","this","transport","createUri","opts","transportOptions","closed","then","onClose","catch","err","onError","ready","createBidirectionalStream","stream","decoderStream","createPacketDecoderStream","Number","MAX_SAFE_INTEGER","socket","binaryType","reader","readable","pipeThrough","getReader","encoderStream","createPacketEncoderStream","pipeTo","writable","writer","getWriter","read","done","value","onPacket","packet","type","query","sid","data","write","onOpen","packets","i","length","lastPacket","nextTick","emitReserved","setTimeoutFn","doClose","_a","close"],"mappings":"kNAGO,MAAMA,UAAWC,EAAAA,UACpB,QAAIC,GACA,MAAO,cACX,CACAC,MAAAA,GAEgC,mBAAjBC,eAIXC,KAAKC,UAAY,IAAIF,aAAaC,KAAKE,UAAU,SAAUF,KAAKG,KAAKC,iBAAiBJ,KAAKH,OAC3FG,KAAKC,UAAUI,OACVC,MAAK,KACNN,KAAKO,SAAS,IAEbC,OAAOC,IACRT,KAAKU,QAAQ,qBAAsBD,EAAI,IAG3CT,KAAKC,UAAUU,MAAML,MAAK,KACtBN,KAAKC,UAAUW,4BAA4BN,MAAMO,IAC7C,MAAMC,EAAgBC,EAAAA,0BAA0BC,OAAOC,iBAAkBjB,KAAKkB,OAAOC,YAC/EC,EAASP,EAAOQ,SAASC,YAAYR,GAAeS,YACpDC,EAAgBC,EAAAA,4BACtBD,EAAcH,SAASK,OAAOb,EAAOc,UACrC3B,KAAK4B,OAASJ,EAAcG,SAASE,YACrC,MAAMC,EAAOA,KACTV,EACKU,OACAxB,
|
|
1
|
+
{"version":3,"file":"webtransport.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/webtransport.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { nextTick } from \"./websocket-constructor.js\";\nimport { createPacketDecoderStream, createPacketEncoderStream, } from \"engine.io-parser\";\nexport class WT extends Transport {\n get name() {\n return \"webtransport\";\n }\n doOpen() {\n // @ts-ignore\n if (typeof WebTransport !== \"function\") {\n return;\n }\n // @ts-ignore\n this.transport = new WebTransport(this.createUri(\"https\"), this.opts.transportOptions[this.name]);\n this.transport.closed\n .then(() => {\n this.onClose();\n })\n .catch((err) => {\n this.onError(\"webtransport error\", err);\n });\n // note: we could have used async/await, but that would require some additional polyfills\n this.transport.ready.then(() => {\n this.transport.createBidirectionalStream().then((stream) => {\n const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);\n const reader = stream.readable.pipeThrough(decoderStream).getReader();\n const encoderStream = createPacketEncoderStream();\n encoderStream.readable.pipeTo(stream.writable);\n this.writer = encoderStream.writable.getWriter();\n const read = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n return;\n }\n this.onPacket(value);\n read();\n })\n .catch((err) => {\n });\n };\n read();\n const packet = { type: \"open\" };\n if (this.query.sid) {\n packet.data = `{\"sid\":\"${this.query.sid}\"}`;\n }\n this.writer.write(packet).then(() => this.onOpen());\n });\n });\n }\n write(packets) {\n this.writable = false;\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n this.writer.write(packet).then(() => {\n if (lastPacket) {\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n var _a;\n (_a = this.transport) === null || _a === void 0 ? void 0 : _a.close();\n }\n}\n"],"names":["WT","Transport","name","doOpen","WebTransport","this","transport","createUri","opts","transportOptions","closed","then","onClose","catch","err","onError","ready","createBidirectionalStream","stream","decoderStream","createPacketDecoderStream","Number","MAX_SAFE_INTEGER","socket","binaryType","reader","readable","pipeThrough","getReader","encoderStream","createPacketEncoderStream","pipeTo","writable","writer","getWriter","read","_ref","done","value","onPacket","packet","type","query","sid","data","write","onOpen","packets","i","length","lastPacket","nextTick","emitReserved","setTimeoutFn","doClose","_a","close"],"mappings":"kNAGO,MAAMA,UAAWC,EAAAA,UACpB,QAAIC,GACA,MAAO,cACX,CACAC,MAAAA,GAEgC,mBAAjBC,eAIXC,KAAKC,UAAY,IAAIF,aAAaC,KAAKE,UAAU,SAAUF,KAAKG,KAAKC,iBAAiBJ,KAAKH,OAC3FG,KAAKC,UAAUI,OACVC,MAAK,KACNN,KAAKO,SAAS,IAEbC,OAAOC,IACRT,KAAKU,QAAQ,qBAAsBD,EAAI,IAG3CT,KAAKC,UAAUU,MAAML,MAAK,KACtBN,KAAKC,UAAUW,4BAA4BN,MAAMO,IAC7C,MAAMC,EAAgBC,EAAAA,0BAA0BC,OAAOC,iBAAkBjB,KAAKkB,OAAOC,YAC/EC,EAASP,EAAOQ,SAASC,YAAYR,GAAeS,YACpDC,EAAgBC,EAAAA,4BACtBD,EAAcH,SAASK,OAAOb,EAAOc,UACrC3B,KAAK4B,OAASJ,EAAcG,SAASE,YACrC,MAAMC,EAAOA,KACTV,EACKU,OACAxB,MAAKyB,IAAqB,IAApBC,KAAEA,EAAIC,MAAEA,GAAOF,EAClBC,IAGJhC,KAAKkC,SAASD,GACdH,IAAM,IAELtB,OAAOC,OACV,EAENqB,IACA,MAAMK,EAAS,CAAEC,KAAM,QACnBpC,KAAKqC,MAAMC,MACXH,EAAOI,KAAO,WAAWvC,KAAKqC,MAAMC,SAExCtC,KAAK4B,OAAOY,MAAML,GAAQ7B,MAAK,IAAMN,KAAKyC,UAAS,GACrD,IAEV,CACAD,KAAAA,CAAME,GACF1C,KAAK2B,UAAW,EAChB,IAAK,IAAIgB,EAAI,EAAGA,EAAID,EAAQE,OAAQD,IAAK,CACrC,MAAMR,EAASO,EAAQC,GACjBE,EAAaF,IAAMD,EAAQE,OAAS,EAC1C5C,KAAK4B,OAAOY,MAAML,GAAQ7B,MAAK,KACvBuC,GACAC,EAAAA,UAAS,KACL9C,KAAK2B,UAAW,EAChB3B,KAAK+C,aAAa,QAAQ,GAC3B/C,KAAKgD,aACZ,GAER,CACJ,CACAC,OAAAA,GACI,IAAIC,EACsB,QAAzBA,EAAKlD,KAAKC,iBAA8B,IAAPiD,GAAyBA,EAAGC,OAClE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./globalThis.browser.js");const i=e.globalThisShim.setTimeout,t=e.globalThisShim.clearTimeout;exports.byteLength=function(e){return"string"==typeof e?function(e){let i=0,t=0;for(let o=0,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./globalThis.browser.js");const i=e.globalThisShim.setTimeout,t=e.globalThisShim.clearTimeout;exports.byteLength=function(e){return"string"==typeof e?function(e){let i=0,t=0;for(let o=0,r=e.length;o<r;o++)i=e.charCodeAt(o),i<128?t+=1:i<2048?t+=2:i<55296||i>=57344?t+=3:(o++,t+=4);return t}(e):Math.ceil(1.33*(e.byteLength||e.size))},exports.installTimerFunctions=function(o,r){r.useNativeTimers?(o.setTimeoutFn=i.bind(e.globalThisShim),o.clearTimeoutFn=t.bind(e.globalThisShim)):(o.setTimeoutFn=e.globalThisShim.setTimeout.bind(e.globalThisShim),o.clearTimeoutFn=e.globalThisShim.clearTimeout.bind(e.globalThisShim))},exports.pick=function(e){for(var i=arguments.length,t=new Array(i>1?i-1:0),o=1;o<i;o++)t[o-1]=arguments[o];return t.reduce(((i,t)=>(e.hasOwnProperty(t)&&(i[t]=e[t]),i)),{})};
|
|
2
2
|
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../node_modules/engine.io-client/build/esm/util.js"],"sourcesContent":["import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = globalThis.setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = globalThis.clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = globalThis.setTimeout.bind(globalThis);\n obj.clearTimeoutFn = globalThis.clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n"],"names":["NATIVE_SET_TIMEOUT","globalThis","globalThisShim","setTimeout","NATIVE_CLEAR_TIMEOUT","clearTimeout","obj","str","c","length","i","l","charCodeAt","utf8Length","Math","ceil","byteLength","size","opts","useNativeTimers","setTimeoutFn","bind","clearTimeoutFn","attr","reduce","acc","k","hasOwnProperty"],"mappings":"6GAUA,MAAMA,EAAqBC,EAAUC,eAACC,WAChCC,EAAuBH,EAAUC,eAACG,gCAcjC,SAAoBC,GACvB,MAAmB,iBAARA,EAMf,SAAoBC,GAChB,IAAIC,EAAI,EAAGC,EAAS,EACpB,IAAK,IAAIC,EAAI,EAAGC,EAAIJ,EAAIE,OAAQC,EAAIC,EAAGD,IACnCF,EAAID,EAAIK,WAAWF,GACfF,EAAI,IACJC,GAAU,EAELD,EAAI,KACTC,GAAU,EAELD,EAAI,OAAUA,GAAK,MACxBC,GAAU,GAGVC,IACAD,GAAU,GAGlB,OAAOA,CACX,CAxBeI,CAAWP,GAGfQ,KAAKC,KAPQ,MAOFT,EAAIU,YAAcV,EAAIW,MAC5C,gCAnBO,SAA+BX,EAAKY,GACnCA,EAAKC,iBACLb,EAAIc,aAAepB,EAAmBqB,KAAKpB,EAAUC,gBACrDI,EAAIgB,eAAiBlB,EAAqBiB,KAAKpB,EAAUC,kBAGzDI,EAAIc,aAAenB,EAAUC,eAACC,WAAWkB,KAAKpB,EAAUC,gBACxDI,EAAIgB,eAAiBrB,EAAUC,eAACG,aAAagB,KAAKpB,EAAUC,gBAEpE,eApBO,SAAcI,
|
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../node_modules/engine.io-client/build/esm/util.js"],"sourcesContent":["import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = globalThis.setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = globalThis.clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = globalThis.setTimeout.bind(globalThis);\n obj.clearTimeoutFn = globalThis.clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n"],"names":["NATIVE_SET_TIMEOUT","globalThis","globalThisShim","setTimeout","NATIVE_CLEAR_TIMEOUT","clearTimeout","obj","str","c","length","i","l","charCodeAt","utf8Length","Math","ceil","byteLength","size","opts","useNativeTimers","setTimeoutFn","bind","clearTimeoutFn","_len","arguments","attr","Array","_key","reduce","acc","k","hasOwnProperty"],"mappings":"6GAUA,MAAMA,EAAqBC,EAAUC,eAACC,WAChCC,EAAuBH,EAAUC,eAACG,gCAcjC,SAAoBC,GACvB,MAAmB,iBAARA,EAMf,SAAoBC,GAChB,IAAIC,EAAI,EAAGC,EAAS,EACpB,IAAK,IAAIC,EAAI,EAAGC,EAAIJ,EAAIE,OAAQC,EAAIC,EAAGD,IACnCF,EAAID,EAAIK,WAAWF,GACfF,EAAI,IACJC,GAAU,EAELD,EAAI,KACTC,GAAU,EAELD,EAAI,OAAUA,GAAK,MACxBC,GAAU,GAGVC,IACAD,GAAU,GAGlB,OAAOA,CACX,CAxBeI,CAAWP,GAGfQ,KAAKC,KAPQ,MAOFT,EAAIU,YAAcV,EAAIW,MAC5C,gCAnBO,SAA+BX,EAAKY,GACnCA,EAAKC,iBACLb,EAAIc,aAAepB,EAAmBqB,KAAKpB,EAAUC,gBACrDI,EAAIgB,eAAiBlB,EAAqBiB,KAAKpB,EAAUC,kBAGzDI,EAAIc,aAAenB,EAAUC,eAACC,WAAWkB,KAAKpB,EAAUC,gBACxDI,EAAIgB,eAAiBrB,EAAUC,eAACG,aAAagB,KAAKpB,EAAUC,gBAEpE,eApBO,SAAcI,GAAc,IAAAiB,IAAAA,EAAAC,UAAAf,OAANgB,MAAIC,MAAAH,EAAAA,EAAAA,OAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAJF,EAAIE,EAAAH,GAAAA,UAAAG,GAC7B,OAAOF,EAAKG,QAAO,CAACC,EAAKC,KACjBxB,EAAIyB,eAAeD,KACnBD,EAAIC,GAAKxB,EAAIwB,IAEVD,IACR,CAAE,EACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./commons.js");const t="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),r="function"==typeof ArrayBuffer,n=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,o=({type:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./commons.js");const t="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),r="function"==typeof ArrayBuffer,n=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,o=(o,f,c)=>{let{type:i,data:u}=o;return t&&u instanceof Blob?f?c(u):a(u,c):r&&(u instanceof ArrayBuffer||n(u))?f?c(u):a(new Blob([u]),c):c(e.PACKET_TYPES[i]+(u||""))},a=(e,t)=>{const r=new FileReader;return r.onload=function(){const e=r.result.split(",")[1];t("b"+(e||""))},r.readAsDataURL(e)};function f(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let c;exports.encodePacket=o,exports.encodePacketToBinary=function(e,a){return t&&e.data instanceof Blob?e.data.arrayBuffer().then(f).then(a):r&&(e.data instanceof ArrayBuffer||n(e.data))?a(f(e.data)):void o(e,!1,(e=>{c||(c=new TextEncoder),a(c.encode(e))}))};
|
|
2
2
|
//# sourceMappingURL=encodePacket.browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encodePacket.browser.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/encodePacket.browser.js"],"sourcesContent":["import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + (content || \"\"));\n };\n return fileReader.readAsDataURL(data);\n};\nfunction toArray(data) {\n if (data instanceof Uint8Array) {\n return data;\n }\n else if (data instanceof ArrayBuffer) {\n return new Uint8Array(data);\n }\n else {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n}\nlet TEXT_ENCODER;\nexport function encodePacketToBinary(packet, callback) {\n if (withNativeBlob && packet.data instanceof Blob) {\n return packet.data.arrayBuffer().then(toArray).then(callback);\n }\n else if (withNativeArrayBuffer &&\n (packet.data instanceof ArrayBuffer || isView(packet.data))) {\n return callback(toArray(packet.data));\n }\n encodePacket(packet, false, (encoded) => {\n if (!TEXT_ENCODER) {\n TEXT_ENCODER = new TextEncoder();\n }\n callback(TEXT_ENCODER.encode(encoded));\n });\n}\nexport { encodePacket };\n"],"names":["withNativeBlob","Blob","Object","prototype","toString","call","withNativeArrayBuffer","ArrayBuffer","isView","obj","buffer","encodePacket","
|
|
1
|
+
{"version":3,"file":"encodePacket.browser.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/encodePacket.browser.js"],"sourcesContent":["import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + (content || \"\"));\n };\n return fileReader.readAsDataURL(data);\n};\nfunction toArray(data) {\n if (data instanceof Uint8Array) {\n return data;\n }\n else if (data instanceof ArrayBuffer) {\n return new Uint8Array(data);\n }\n else {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n}\nlet TEXT_ENCODER;\nexport function encodePacketToBinary(packet, callback) {\n if (withNativeBlob && packet.data instanceof Blob) {\n return packet.data.arrayBuffer().then(toArray).then(callback);\n }\n else if (withNativeArrayBuffer &&\n (packet.data instanceof ArrayBuffer || isView(packet.data))) {\n return callback(toArray(packet.data));\n }\n encodePacket(packet, false, (encoded) => {\n if (!TEXT_ENCODER) {\n TEXT_ENCODER = new TextEncoder();\n }\n callback(TEXT_ENCODER.encode(encoded));\n });\n}\nexport { encodePacket };\n"],"names":["withNativeBlob","Blob","Object","prototype","toString","call","withNativeArrayBuffer","ArrayBuffer","isView","obj","buffer","encodePacket","_ref","supportsBinary","callback","type","data","encodeBlobAsBase64","PACKET_TYPES","fileReader","FileReader","onload","content","result","split","readAsDataURL","toArray","Uint8Array","byteOffset","byteLength","TEXT_ENCODER","packet","arrayBuffer","then","encoded","TextEncoder","encode"],"mappings":"kGACA,MAAMA,EAAiC,mBAATC,MACT,oBAATA,MACqC,6BAAzCC,OAAOC,UAAUC,SAASC,KAAKJ,MACjCK,EAA+C,mBAAhBC,YAE/BC,EAAUC,GACyB,mBAAvBF,YAAYC,OACpBD,YAAYC,OAAOC,GACnBA,GAAOA,EAAIC,kBAAkBH,YAEjCI,EAAeA,CAAAC,EAAiBC,EAAgBC,KAAa,IAA7CC,KAAEA,EAAIC,KAAEA,GAAMJ,EAChC,OAAIZ,GAAkBgB,aAAgBf,KAC9BY,EACOC,EAASE,GAGTC,EAAmBD,EAAMF,GAG/BR,IACJU,aAAgBT,aAAeC,EAAOQ,IACnCH,EACOC,EAASE,GAGTC,EAAmB,IAAIhB,KAAK,CAACe,IAAQF,GAI7CA,EAASI,EAAAA,aAAaH,IAASC,GAAQ,IAAI,EAEhDC,EAAqBA,CAACD,EAAMF,KAC9B,MAAMK,EAAa,IAAIC,WAKvB,OAJAD,EAAWE,OAAS,WAChB,MAAMC,EAAUH,EAAWI,OAAOC,MAAM,KAAK,GAC7CV,EAAS,KAAOQ,GAAW,MAExBH,EAAWM,cAAcT,EAAK,EAEzC,SAASU,EAAQV,GACb,OAAIA,aAAgBW,WACTX,EAEFA,aAAgBT,YACd,IAAIoB,WAAWX,GAGf,IAAIW,WAAWX,EAAKN,OAAQM,EAAKY,WAAYZ,EAAKa,WAEjE,CACA,IAAIC,sDACG,SAA8BC,EAAQjB,GACzC,OAAId,GAAkB+B,EAAOf,gBAAgBf,KAClC8B,EAAOf,KAAKgB,cAAcC,KAAKP,GAASO,KAAKnB,GAE/CR,IACJyB,EAAOf,gBAAgBT,aAAeC,EAAOuB,EAAOf,OAC9CF,EAASY,EAAQK,EAAOf,YAEnCL,EAAaoB,GAAQ,GAAQG,IACpBJ,IACDA,EAAe,IAAIK,aAEvBrB,EAASgB,EAAaM,OAAOF,GAAS,GAE9C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=e=>null!==e;exports.getFinalKeyframe=function(t,{repeat:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=e=>null!==e;exports.getFinalKeyframe=function(t,o,r){let{repeat:l,repeatType:n="loop"}=o;const p=t.filter(e),s=l&&"loop"!==n&&l%2==1?0:p.length-1;return s&&void 0!==r?r:p[s]};
|
|
2
2
|
//# sourceMappingURL=get-final-keyframe.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-final-keyframe.mjs.js","sources":["../../../../../../../../../node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs"],"sourcesContent":["const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n"],"names":["isNotNull","value","keyframes","
|
|
1
|
+
{"version":3,"file":"get-final-keyframe.mjs.js","sources":["../../../../../../../../../node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs"],"sourcesContent":["const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n"],"names":["isNotNull","value","keyframes","_ref","finalKeyframe","repeat","repeatType","resolvedKeyframes","filter","index","length","undefined"],"mappings":"oEAAA,MAAMA,EAAaC,GAAoB,OAAVA,2BAC7B,SAA0BC,EAASC,EAAmCC,GAAe,IAAhDC,OAAEA,EAAMC,WAAEA,EAAa,QAAQH,EAChE,MAAMI,EAAoBL,EAAUM,OAAOR,GACrCS,EAAQJ,GAAyB,SAAfC,GAAyBD,EAAS,GAAM,EAC1D,EACAE,EAAkBG,OAAS,EACjC,OAAQD,QAA2BE,IAAlBP,EAEXA,EADAG,EAAkBE,EAE5B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../animators/waapi/utils/get-final-keyframe.mjs.js"),i=require("../utils/default-transitions.mjs.js"),t=require("../utils/is-transition-defined.mjs.js"),o=require("../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs.js"),n=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js"),s=require("../../../../../motion-utils/dist/es/global-config.mjs.js"),a=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),r=require("../../../../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js");exports.animateMotionValue=(l,d,m
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../animators/waapi/utils/get-final-keyframe.mjs.js"),i=require("../utils/default-transitions.mjs.js"),t=require("../utils/is-transition-defined.mjs.js"),o=require("../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs.js"),n=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js"),s=require("../../../../../motion-utils/dist/es/global-config.mjs.js"),a=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),r=require("../../../../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js");exports.animateMotionValue=function(l,d,m){let u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},y=arguments.length>4?arguments[4]:void 0,f=arguments.length>5?arguments[5]:void 0;return p=>{const c=o.getValueTransition(u,l)||{},j=c.delay||u.delay||0;let{elapsed:g=0}=u;g-=n.secondsToMilliseconds(j);const v={keyframes:Array.isArray(m)?m:[null,m],ease:"easeOut",velocity:d.getVelocity(),...c,delay:-g,onUpdate:e=>{d.set(e),c.onUpdate&&c.onUpdate(e)},onComplete:()=>{p(),c.onComplete&&c.onComplete()},name:l,motionValue:d,element:f?void 0:y};t.isTransitionDefined(c)||Object.assign(v,i.getDefaultTransition(l,v)),v.duration&&(v.duration=n.secondsToMilliseconds(v.duration)),v.repeatDelay&&(v.repeatDelay=n.secondsToMilliseconds(v.repeatDelay)),void 0!==v.from&&(v.keyframes[0]=v.from);let M=!1;if((!1===v.type||0===v.duration&&!v.repeatDelay)&&(v.duration=0,0===v.delay&&(M=!0)),(s.MotionGlobalConfig.instantAnimations||s.MotionGlobalConfig.skipAnimations)&&(M=!0,v.duration=0,v.delay=0),v.allowFlatten=!c.type&&!c.ease,M&&!f&&void 0!==d.get()){const i=e.getFinalKeyframe(v.keyframes,c);if(void 0!==i)return void a.frame.update((()=>{v.onUpdate(i),v.onComplete()}))}return new r.AsyncMotionValueAnimation(v)}};
|
|
2
2
|
//# sourceMappingURL=motion-value.mjs.js.map
|
package/dist/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motion-value.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs"],"sourcesContent":["import { getValueTransition, frame, AsyncMotionValueAnimation } from 'motion-dom';\nimport { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { getFinalKeyframe } from '../animators/waapi/utils/get-final-keyframe.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n options.duration = 0;\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n options.duration = 0;\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n"],"names":["
|
|
1
|
+
{"version":3,"file":"motion-value.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs"],"sourcesContent":["import { getValueTransition, frame, AsyncMotionValueAnimation } from 'motion-dom';\nimport { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { getFinalKeyframe } from '../animators/waapi/utils/get-final-keyframe.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n options.duration = 0;\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n options.duration = 0;\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n"],"names":["name","value","target","transition","arguments","length","undefined","element","isHandoff","onComplete","valueTransition","getValueTransition","delay","elapsed","secondsToMilliseconds","options","keyframes","Array","isArray","ease","velocity","getVelocity","onUpdate","v","set","motionValue","isTransitionDefined","Object","assign","getDefaultTransition","duration","repeatDelay","from","shouldSkip","type","MotionGlobalConfig","instantAnimations","skipAnimations","allowFlatten","get","finalKeyframe","getFinalKeyframe","frame","update","AsyncMotionValueAnimation"],"mappings":"gpBAM2B,SAACA,EAAMC,EAAOC,GAAM,IAAEC,EAAUC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAA,EAAIG,EAAOH,UAAAC,OAAAD,EAAAA,kBAAAE,EAAEE,EAASJ,UAAAC,OAAAD,EAAAA,kBAAAE,EAAA,OAAMG,IACtF,MAAMC,EAAkBC,EAAkBA,mBAACR,EAAYH,IAAS,CAAA,EAM1DY,EAAQF,EAAgBE,OAAST,EAAWS,OAAS,EAK3D,IAAIC,QAAEA,EAAU,GAAMV,EACtBU,GAAoBC,wBAAsBF,GAC1C,MAAMG,EAAU,CACZC,UAAWC,MAAMC,QAAQhB,GAAUA,EAAS,CAAC,KAAMA,GACnDiB,KAAM,UACNC,SAAUnB,EAAMoB,iBACbX,EACHE,OAAQC,EACRS,SAAWC,IACPtB,EAAMuB,IAAID,GACVb,EAAgBY,UAAYZ,EAAgBY,SAASC,EAAE,EAE3Dd,WAAYA,KACRA,IACAC,EAAgBD,YAAcC,EAAgBD,YAAY,EAE9DT,OACAyB,YAAaxB,EACbM,QAASC,OAAYF,EAAYC,GAMhCmB,EAAAA,oBAAoBhB,IACrBiB,OAAOC,OAAOb,EAASc,EAAoBA,qBAAC7B,EAAMe,IAOtDA,EAAQe,WAAaf,EAAQe,SAAWhB,EAAAA,sBAAsBC,EAAQe,WACtEf,EAAQgB,cAAgBhB,EAAQgB,YAAcjB,EAAAA,sBAAsBC,EAAQgB,mBAIvDzB,IAAjBS,EAAQiB,OACRjB,EAAQC,UAAU,GAAKD,EAAQiB,MAEnC,IAAIC,GAAa,EAwBjB,KAvBqB,IAAjBlB,EAAQmB,MACc,IAArBnB,EAAQe,WAAmBf,EAAQgB,eACpChB,EAAQe,SAAW,EACG,IAAlBf,EAAQH,QACRqB,GAAa,KAGjBE,qBAAmBC,mBACnBD,EAAkBA,mBAACE,kBACnBJ,GAAa,EACblB,EAAQe,SAAW,EACnBf,EAAQH,MAAQ,GAMpBG,EAAQuB,cAAgB5B,EAAgBwB,OAASxB,EAAgBS,KAM7Dc,IAAezB,QAA6BF,IAAhBL,EAAMsC,MAAqB,CACvD,MAAMC,EAAgBC,EAAgBA,iBAAC1B,EAAQC,UAAWN,GAC1D,QAAsBJ,IAAlBkC,EAKA,YAJAE,EAAKA,MAACC,QAAO,KACT5B,EAAQO,SAASkB,GACjBzB,EAAQN,YAAY,GAIhC,CACA,OAAO,IAAImC,EAAAA,0BAA0B7B,EAAQ,CAChD"}
|
package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../render/utils/setters.mjs.js"),t=require("../../value/use-will-change/add-will-change.mjs.js"),i=require("../optimized-appear/get-appear-id.mjs.js"),n=require("./motion-value.mjs.js"),o=require("../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs.js"),a=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),s=require("../../../../../motion-dom/dist/es/render/utils/keys-position.mjs.js");function r({protectedKeys:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../render/utils/setters.mjs.js"),t=require("../../value/use-will-change/add-will-change.mjs.js"),i=require("../optimized-appear/get-appear-id.mjs.js"),n=require("./motion-value.mjs.js"),o=require("../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs.js"),a=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),s=require("../../../../../motion-dom/dist/es/render/utils/keys-position.mjs.js");function r(e,t){let{protectedKeys:i,needsAnimating:n}=e;const o=i.hasOwnProperty(t)&&!0!==n[t];return n[t]=!1,o}exports.animateTarget=function(l,u){let{delay:d=0,transitionOverride:m,type:p}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{transition:c=l.getDefaultTransition(),transitionEnd:f,...g}=u;m&&(c=m);const j=[],y=p&&l.animationState&&l.animationState.getState()[p];for(const e in g){const u=l.getValue(e,l.latestValues[e]??null),m=g[e];if(void 0===m||y&&r(y,e))continue;const p={delay:d,...o.getValueTransition(c||{},e)},f=u.get();if(void 0!==f&&!u.isAnimating&&!Array.isArray(m)&&m===f&&!p.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const t=i.getOptimisedAppearId(l);if(t){const i=window.MotionHandoffAnimation(t,e,a.frame);null!==i&&(p.startTime=i,v=!0)}}t.addValueToWillChange(l,e),u.start(n.animateMotionValue(e,u,m,l.shouldReduceMotion&&s.positionalKeys.has(e)?{type:!1}:p,l,v));const h=u.animation;h&&j.push(h)}return f&&Promise.all(j).then((()=>{a.frame.update((()=>{f&&e.setTarget(l,f)}))})),j};
|
|
2
2
|
//# sourceMappingURL=visual-element-target.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual-element-target.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs"],"sourcesContent":["import { getValueTransition, frame, positionalKeys } from 'motion-dom';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n\nexport { animateTarget };\n"],"names":["shouldBlockAnimation","
|
|
1
|
+
{"version":3,"file":"visual-element-target.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs"],"sourcesContent":["import { getValueTransition, frame, positionalKeys } from 'motion-dom';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n\nexport { animateTarget };\n"],"names":["shouldBlockAnimation","_ref","key","protectedKeys","needsAnimating","shouldBlock","hasOwnProperty","visualElement","targetAndTransition","delay","transitionOverride","type","arguments","length","undefined","transition","getDefaultTransition","transitionEnd","target","animations","animationTypeState","animationState","getState","value","getValue","latestValues","valueTarget","valueTransition","getValueTransition","currentValue","get","isAnimating","Array","isArray","velocity","isHandoff","window","MotionHandoffAnimation","appearId","getOptimisedAppearId","startTime","frame","addValueToWillChange","start","animateMotionValue","shouldReduceMotion","positionalKeys","has","animation","push","Promise","all","then","update","setTarget"],"mappings":"kgBAYA,SAASA,EAAoBC,EAAoCC,GAAK,IAAxCC,cAAEA,EAAaC,eAAEA,GAAgBH,EAC3D,MAAMI,EAAcF,EAAcG,eAAeJ,KAAgC,IAAxBE,EAAeF,GAExE,OADAE,EAAeF,IAAO,EACfG,CACX,uBACA,SAAuBE,EAAeC,GAAmE,IAA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C1D,IAGHE,CACX"}
|
package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../render/utils/resolve-dynamic-variants.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../render/utils/resolve-dynamic-variants.mjs.js"),t=require("./visual-element-target.mjs.js");function r(i,o){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=e.resolveVariant(i,o,"exit"===a.type?i.presenceContext?.custom:void 0);let{transition:l=i.getDefaultTransition()||{}}=s||{};a.transitionOverride&&(l=a.transitionOverride);const d=s?()=>Promise.all(t.animateTarget(i,s,a)):()=>Promise.resolve(),u=i.variantChildren&&i.variantChildren.size?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{delayChildren:t=0,staggerChildren:s,staggerDirection:d}=l;return function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5?arguments[5]:void 0;const l=[],d=(e.variantChildren.size-1)*o,u=1===a?function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)*o}:function(){return d-(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)*o};return Array.from(e.variantChildren).sort(n).forEach(((e,n)=>{e.notify("AnimationStart",t),l.push(r(e,t,{...s,delay:i+u(n)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(l)}(i,o,t+e,s,d,a)}:()=>Promise.resolve(),{when:v}=l;if(v){const[e,t]="beforeChildren"===v?[d,u]:[u,d];return e().then((()=>t()))}return Promise.all([d(),u(a.delay)])}function n(e,t){return e.sortNodePosition(t)}exports.animateVariant=r,exports.sortByTreeOrder=n;
|
|
2
2
|
//# sourceMappingURL=visual-element-variant.mjs.js.map
|