@swan-admin/swan-web-component 1.0.73 → 1.0.74

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.
@@ -1 +1 @@
1
- {"version":3,"file":"bodyScan.js","sources":["../../node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js","../../node_modules/@mui/material/esm/Box/boxClasses.js","../../node_modules/@mui/material/esm/Box/Box.js","../../node_modules/@mui/system/esm/createBox/createBox.js","../../node_modules/@mui/material/esm/Dialog/dialogClasses.js","../../node_modules/@mui/material/esm/Dialog/DialogContext.js","../../node_modules/@mui/material/esm/Dialog/Dialog.js","../src/Icons/SwitchIcon.tsx","../src/components/bodyScan/LevelScreen.tsx","../../node_modules/react-webcam/dist/react-webcam.js","../../node_modules/@mui/icons-material/esm/Close.js","../src/utils/context/mediaContext.tsx","../src/utils/context/languageContext.tsx","../src/components/bodyScan/CameraScanChild.tsx","../src/customHooks/useTensorFlow.ts","../src/utils/context/paramsContext.tsx","../src/components/bodyScan/ScanningComponent.tsx","../src/components/bodyScan/AngleDetector.tsx","../src/components/Modal.tsx","../src/components/bodyScan/CameraPermission.tsx","../src/components/bodyScan/VideoPlayer.tsx","../src/components/bodyScan/ScanErrorMessage.tsx","../src/components/Signup.tsx","../src/components/bodyScan/BodyScan.tsx","../src/customHooks/useGyroSensor.ts"],"sourcesContent":["import { isPlainObject } from '@mui/utils/deepmerge';\nimport defaultSxConfig from \"./defaultSxConfig.js\";\nconst splitProps = props => {\n const result = {\n systemProps: {},\n otherProps: {}\n };\n const config = props?.theme?.unstable_sxConfig ?? defaultSxConfig;\n Object.keys(props).forEach(prop => {\n if (config[prop]) {\n result.systemProps[prop] = props[prop];\n } else {\n result.otherProps[prop] = props[prop];\n }\n });\n return result;\n};\nexport default function extendSxProp(props) {\n const {\n sx: inSx,\n ...other\n } = props;\n const {\n systemProps,\n otherProps\n } = splitProps(other);\n let finalSx;\n if (Array.isArray(inSx)) {\n finalSx = [systemProps, ...inSx];\n } else if (typeof inSx === 'function') {\n finalSx = (...args) => {\n const result = inSx(...args);\n if (!isPlainObject(result)) {\n return systemProps;\n }\n return {\n ...systemProps,\n ...result\n };\n };\n } else {\n finalSx = {\n ...systemProps,\n ...inSx\n };\n }\n return {\n ...otherProps,\n sx: finalSx\n };\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nconst boxClasses = generateUtilityClasses('MuiBox', ['root']);\nexport default boxClasses;","'use client';\n\nimport { createBox } from '@mui/system';\nimport PropTypes from 'prop-types';\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from \"../className/index.js\";\nimport { createTheme } from \"../styles/index.js\";\nimport THEME_ID from \"../styles/identifier.js\";\nimport boxClasses from \"./boxClasses.js\";\nconst defaultTheme = createTheme();\nconst Box = createBox({\n themeId: THEME_ID,\n defaultTheme,\n defaultClassName: boxClasses.root,\n generateClassName: ClassNameGenerator.generate\n});\nprocess.env.NODE_ENV !== \"production\" ? Box.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default Box;","'use client';\n\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport styled from '@mui/styled-engine';\nimport styleFunctionSx, { extendSxProp } from \"../styleFunctionSx/index.js\";\nimport useTheme from \"../useTheme/index.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function createBox(options = {}) {\n const {\n themeId,\n defaultTheme,\n defaultClassName = 'MuiBox-root',\n generateClassName\n } = options;\n const BoxRoot = styled('div', {\n shouldForwardProp: prop => prop !== 'theme' && prop !== 'sx' && prop !== 'as'\n })(styleFunctionSx);\n const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {\n const theme = useTheme(defaultTheme);\n const {\n className,\n component = 'div',\n ...other\n } = extendSxProp(inProps);\n return /*#__PURE__*/_jsx(BoxRoot, {\n as: component,\n ref: ref,\n className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),\n theme: themeId ? theme[themeId] || theme : theme,\n ...other\n });\n });\n return Box;\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getDialogUtilityClass(slot) {\n return generateUtilityClass('MuiDialog', slot);\n}\nconst dialogClasses = generateUtilityClasses('MuiDialog', ['root', 'scrollPaper', 'scrollBody', 'container', 'paper', 'paperScrollPaper', 'paperScrollBody', 'paperWidthFalse', 'paperWidthXs', 'paperWidthSm', 'paperWidthMd', 'paperWidthLg', 'paperWidthXl', 'paperFullWidth', 'paperFullScreen']);\nexport default dialogClasses;","'use client';\n\nimport * as React from 'react';\nconst DialogContext = /*#__PURE__*/React.createContext({});\nif (process.env.NODE_ENV !== 'production') {\n DialogContext.displayName = 'DialogContext';\n}\nexport default DialogContext;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport useId from '@mui/utils/useId';\nimport capitalize from \"../utils/capitalize.js\";\nimport Modal from \"../Modal/index.js\";\nimport Fade from \"../Fade/index.js\";\nimport Paper from \"../Paper/index.js\";\nimport dialogClasses, { getDialogUtilityClass } from \"./dialogClasses.js\";\nimport DialogContext from \"./DialogContext.js\";\nimport Backdrop from \"../Backdrop/index.js\";\nimport { styled, useTheme } from \"../zero-styled/index.js\";\nimport memoTheme from \"../utils/memoTheme.js\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.js\";\nimport useSlot from \"../utils/useSlot.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DialogBackdrop = styled(Backdrop, {\n name: 'MuiDialog',\n slot: 'Backdrop',\n overrides: (props, styles) => styles.backdrop\n})({\n // Improve scrollable dialog support.\n zIndex: -1\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n scroll,\n maxWidth,\n fullWidth,\n fullScreen\n } = ownerState;\n const slots = {\n root: ['root'],\n container: ['container', `scroll${capitalize(scroll)}`],\n paper: ['paper', `paperScroll${capitalize(scroll)}`, `paperWidth${capitalize(String(maxWidth))}`, fullWidth && 'paperFullWidth', fullScreen && 'paperFullScreen']\n };\n return composeClasses(slots, getDialogUtilityClass, classes);\n};\nconst DialogRoot = styled(Modal, {\n name: 'MuiDialog',\n slot: 'Root'\n})({\n '@media print': {\n // Use !important to override the Modal inline-style.\n position: 'absolute !important'\n }\n});\nconst DialogContainer = styled('div', {\n name: 'MuiDialog',\n slot: 'Container',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.container, styles[`scroll${capitalize(ownerState.scroll)}`]];\n }\n})({\n height: '100%',\n '@media print': {\n height: 'auto'\n },\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n variants: [{\n props: {\n scroll: 'paper'\n },\n style: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center'\n }\n }, {\n props: {\n scroll: 'body'\n },\n style: {\n overflowY: 'auto',\n overflowX: 'hidden',\n textAlign: 'center',\n '&::after': {\n content: '\"\"',\n display: 'inline-block',\n verticalAlign: 'middle',\n height: '100%',\n width: '0'\n }\n }\n }]\n});\nconst DialogPaper = styled(Paper, {\n name: 'MuiDialog',\n slot: 'Paper',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.paper, styles[`scrollPaper${capitalize(ownerState.scroll)}`], styles[`paperWidth${capitalize(String(ownerState.maxWidth))}`], ownerState.fullWidth && styles.paperFullWidth, ownerState.fullScreen && styles.paperFullScreen];\n }\n})(memoTheme(({\n theme\n}) => ({\n margin: 32,\n position: 'relative',\n overflowY: 'auto',\n '@media print': {\n overflowY: 'visible',\n boxShadow: 'none'\n },\n variants: [{\n props: {\n scroll: 'paper'\n },\n style: {\n display: 'flex',\n flexDirection: 'column',\n maxHeight: 'calc(100% - 64px)'\n }\n }, {\n props: {\n scroll: 'body'\n },\n style: {\n display: 'inline-block',\n verticalAlign: 'middle',\n textAlign: 'initial'\n }\n }, {\n props: ({\n ownerState\n }) => !ownerState.maxWidth,\n style: {\n maxWidth: 'calc(100% - 64px)'\n }\n }, {\n props: {\n maxWidth: 'xs'\n },\n style: {\n maxWidth: theme.breakpoints.unit === 'px' ? Math.max(theme.breakpoints.values.xs, 444) : `max(${theme.breakpoints.values.xs}${theme.breakpoints.unit}, 444px)`,\n [`&.${dialogClasses.paperScrollBody}`]: {\n [theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 444) + 32 * 2)]: {\n maxWidth: 'calc(100% - 64px)'\n }\n }\n }\n }, ...Object.keys(theme.breakpoints.values).filter(maxWidth => maxWidth !== 'xs').map(maxWidth => ({\n props: {\n maxWidth\n },\n style: {\n maxWidth: `${theme.breakpoints.values[maxWidth]}${theme.breakpoints.unit}`,\n [`&.${dialogClasses.paperScrollBody}`]: {\n [theme.breakpoints.down(theme.breakpoints.values[maxWidth] + 32 * 2)]: {\n maxWidth: 'calc(100% - 64px)'\n }\n }\n }\n })), {\n props: ({\n ownerState\n }) => ownerState.fullWidth,\n style: {\n width: 'calc(100% - 64px)'\n }\n }, {\n props: ({\n ownerState\n }) => ownerState.fullScreen,\n style: {\n margin: 0,\n width: '100%',\n maxWidth: '100%',\n height: '100%',\n maxHeight: 'none',\n borderRadius: 0,\n [`&.${dialogClasses.paperScrollBody}`]: {\n margin: 0,\n maxWidth: '100%'\n }\n }\n }]\n})));\n\n/**\n * Dialogs are overlaid modal paper based components with a backdrop.\n */\nconst Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiDialog'\n });\n const theme = useTheme();\n const defaultTransitionDuration = {\n enter: theme.transitions.duration.enteringScreen,\n exit: theme.transitions.duration.leavingScreen\n };\n const {\n 'aria-describedby': ariaDescribedby,\n 'aria-labelledby': ariaLabelledbyProp,\n 'aria-modal': ariaModal = true,\n BackdropComponent,\n BackdropProps,\n children,\n className,\n disableEscapeKeyDown = false,\n fullScreen = false,\n fullWidth = false,\n maxWidth = 'sm',\n onClick,\n onClose,\n open,\n PaperComponent = Paper,\n PaperProps = {},\n scroll = 'paper',\n slots = {},\n slotProps = {},\n TransitionComponent = Fade,\n transitionDuration = defaultTransitionDuration,\n TransitionProps,\n ...other\n } = props;\n const ownerState = {\n ...props,\n disableEscapeKeyDown,\n fullScreen,\n fullWidth,\n maxWidth,\n scroll\n };\n const classes = useUtilityClasses(ownerState);\n const backdropClick = React.useRef();\n const handleMouseDown = event => {\n // We don't want to close the dialog when clicking the dialog content.\n // Make sure the event starts and ends on the same DOM element.\n backdropClick.current = event.target === event.currentTarget;\n };\n const handleBackdropClick = event => {\n if (onClick) {\n onClick(event);\n }\n\n // Ignore the events not coming from the \"backdrop\".\n if (!backdropClick.current) {\n return;\n }\n backdropClick.current = null;\n if (onClose) {\n onClose(event, 'backdropClick');\n }\n };\n const ariaLabelledby = useId(ariaLabelledbyProp);\n const dialogContextValue = React.useMemo(() => {\n return {\n titleId: ariaLabelledby\n };\n }, [ariaLabelledby]);\n const backwardCompatibleSlots = {\n transition: TransitionComponent,\n ...slots\n };\n const backwardCompatibleSlotProps = {\n transition: TransitionProps,\n paper: PaperProps,\n backdrop: BackdropProps,\n ...slotProps\n };\n const externalForwardedProps = {\n slots: backwardCompatibleSlots,\n slotProps: backwardCompatibleSlotProps\n };\n const [RootSlot, rootSlotProps] = useSlot('root', {\n elementType: DialogRoot,\n shouldForwardComponentProp: true,\n externalForwardedProps,\n ownerState,\n className: clsx(classes.root, className),\n ref\n });\n const [BackdropSlot, backdropSlotProps] = useSlot('backdrop', {\n elementType: DialogBackdrop,\n shouldForwardComponentProp: true,\n externalForwardedProps,\n ownerState\n });\n const [PaperSlot, paperSlotProps] = useSlot('paper', {\n elementType: DialogPaper,\n shouldForwardComponentProp: true,\n externalForwardedProps,\n ownerState,\n className: clsx(classes.paper, PaperProps.className)\n });\n const [ContainerSlot, containerSlotProps] = useSlot('container', {\n elementType: DialogContainer,\n externalForwardedProps,\n ownerState,\n className: classes.container\n });\n const [TransitionSlot, transitionSlotProps] = useSlot('transition', {\n elementType: Fade,\n externalForwardedProps,\n ownerState,\n additionalProps: {\n appear: true,\n in: open,\n timeout: transitionDuration,\n role: 'presentation'\n }\n });\n return /*#__PURE__*/_jsx(RootSlot, {\n closeAfterTransition: true,\n slots: {\n backdrop: BackdropSlot\n },\n slotProps: {\n backdrop: {\n transitionDuration,\n as: BackdropComponent,\n ...backdropSlotProps\n }\n },\n disableEscapeKeyDown: disableEscapeKeyDown,\n onClose: onClose,\n open: open,\n onClick: handleBackdropClick,\n ...rootSlotProps,\n ...other,\n children: /*#__PURE__*/_jsx(TransitionSlot, {\n ...transitionSlotProps,\n children: /*#__PURE__*/_jsx(ContainerSlot, {\n onMouseDown: handleMouseDown,\n ...containerSlotProps,\n children: /*#__PURE__*/_jsx(PaperSlot, {\n as: PaperComponent,\n elevation: 24,\n role: \"dialog\",\n \"aria-describedby\": ariaDescribedby,\n \"aria-labelledby\": ariaLabelledby,\n \"aria-modal\": ariaModal,\n ...paperSlotProps,\n children: /*#__PURE__*/_jsx(DialogContext.Provider, {\n value: dialogContextValue,\n children: children\n })\n })\n })\n })\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Dialog.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The id(s) of the element(s) that describe the dialog.\n */\n 'aria-describedby': PropTypes.string,\n /**\n * The id(s) of the element(s) that label the dialog.\n */\n 'aria-labelledby': PropTypes.string,\n /**\n * Informs assistive technologies that the element is modal.\n * It's added on the element with role=\"dialog\".\n * @default true\n */\n 'aria-modal': PropTypes.oneOfType([PropTypes.oneOf(['false', 'true']), PropTypes.bool]),\n /**\n * A backdrop component. This prop enables custom backdrop rendering.\n * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.\n * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.\n * @default styled(Backdrop, {\n * name: 'MuiModal',\n * slot: 'Backdrop',\n * })({\n * zIndex: -1,\n * })\n */\n BackdropComponent: PropTypes.elementType,\n /**\n * @ignore\n */\n BackdropProps: PropTypes.object,\n /**\n * Dialog children, usually the included sub-components.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * If `true`, hitting escape will not fire the `onClose` callback.\n * @default false\n */\n disableEscapeKeyDown: PropTypes.bool,\n /**\n * If `true`, the dialog is full-screen.\n * @default false\n */\n fullScreen: PropTypes.bool,\n /**\n * If `true`, the dialog stretches to `maxWidth`.\n *\n * Notice that the dialog width grow is limited by the default margin.\n * @default false\n */\n fullWidth: PropTypes.bool,\n /**\n * Determine the max-width of the dialog.\n * The dialog width grows with the size of the screen.\n * Set to `false` to disable `maxWidth`.\n * @default 'sm'\n */\n maxWidth: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), PropTypes.string]),\n /**\n * @ignore\n */\n onClick: PropTypes.func,\n /**\n * Callback fired when the component requests to be closed.\n *\n * @param {object} event The event source of the callback.\n * @param {string} reason Can be: `\"escapeKeyDown\"`, `\"backdropClick\"`.\n */\n onClose: PropTypes.func,\n /**\n * If `true`, the component is shown.\n */\n open: PropTypes.bool.isRequired,\n /**\n * The component used to render the body of the dialog.\n * @default Paper\n */\n PaperComponent: PropTypes.elementType,\n /**\n * Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.\n * @default {}\n * @deprecated Use `slotProps.paper` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.\n */\n PaperProps: PropTypes.object,\n /**\n * Determine the container for scrolling the dialog.\n * @default 'paper'\n */\n scroll: PropTypes.oneOf(['body', 'paper']),\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.shape({\n backdrop: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n container: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n }),\n /**\n * The components used for each slot inside.\n * @default {}\n */\n slots: PropTypes.shape({\n backdrop: PropTypes.elementType,\n container: PropTypes.elementType,\n paper: PropTypes.elementType,\n root: PropTypes.elementType,\n transition: PropTypes.elementType\n }),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The component used for the transition.\n * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.\n * @default Fade\n * @deprecated Use `slots.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.\n */\n TransitionComponent: PropTypes.elementType,\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n * @default {\n * enter: theme.transitions.duration.enteringScreen,\n * exit: theme.transitions.duration.leavingScreen,\n * }\n */\n transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })]),\n /**\n * Props applied to the transition element.\n * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.\n * @deprecated Use `slotProps.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.\n */\n TransitionProps: PropTypes.object\n} : void 0;\nexport default Dialog;","import React from \"react\";\n\nfunction SwitchIcon({ size = 16 }: { size?: number }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 25 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M22.6968 14.6968C22.6968 16.8185 21.8539 18.8533 20.3536 20.3536C18.8533 21.8539 16.8185 22.6968 14.6968 22.6968\"\n stroke=\"white\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M18.6968 11.6968V10.6968C18.6968 10.1663 18.4861 9.65764 18.111 9.28256C17.7359 8.90749 17.2272 8.69678 16.6968 8.69678C16.1663 8.69678 15.6576 8.90749 15.2826 9.28256C14.9075 9.65764 14.6968 10.1663 14.6968 10.6968\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M14.6968 10.6968V9.69678C14.6968 9.16634 14.4861 8.65764 14.111 8.28256C13.7359 7.90749 13.2272 7.69678 12.6968 7.69678C12.1663 7.69678 11.6576 7.90749 11.2826 8.28256C10.9075 8.65764 10.6968 9.16634 10.6968 9.69678V10.6968\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M10.6968 10.1968V4.69678C10.6968 4.16634 10.4861 3.65764 10.111 3.28256C9.73592 2.90749 9.22721 2.69678 8.69678 2.69678C8.16634 2.69678 7.65764 2.90749 7.28256 3.28256C6.90749 3.65764 6.69678 4.16634 6.69678 4.69678V14.6968\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M18.6969 11.6968C18.6969 11.1663 18.9076 10.6576 19.2827 10.2826C19.6577 9.90749 20.1664 9.69678 20.6969 9.69678C21.2273 9.69678 21.736 9.90749 22.1111 10.2826C22.4862 10.6576 22.6969 11.1663 22.6969 11.6968V14.6968C22.6969 16.8185 21.854 18.8533 20.3537 20.3536C18.8534 21.8539 16.8186 22.6968 14.6969 22.6968H12.6969C9.89688 22.6968 8.19688 21.8368 6.70688 20.3568L3.10688 16.7568C2.76282 16.3757 2.57847 15.8769 2.592 15.3637C2.60554 14.8505 2.81593 14.3621 3.1796 13.9997C3.54327 13.6373 4.03238 13.4287 4.54565 13.417C5.05892 13.4053 5.55704 13.5914 5.93688 13.9368L7.69688 15.6968\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport default React.memo(SwitchIcon);\n","/* eslint-disable no-nested-ternary */\n\nimport React, { useCallback, useMemo } from \"react\";\nimport Header from \"../Header\";\nimport cn from \"clsx\";\nimport { LevelScreenProps } from \"../../types/interfaces\";\nimport SwitchIcon from \"../../Icons/SwitchIcon\";\n\n\n\nfunction LevelScreen({ angle, countdown, isScanning, isInTargetRange, stabilityScore, children, config }: LevelScreenProps) {\n\tconst getProximityToTarget = useCallback(() => {\n\t\tif (angle < 80) return Math.max(0, Math.min(100, (angle - 60) * 10));\n\t\tif (angle > 95) return Math.max(0, Math.min(100, (105 - angle) * 10));\n\t\treturn 100;\n\t}, [angle]);\n\n\tconst backgroundColor = useMemo(() => {\n\t\tif (isScanning) return config?.style?.base?.brandColor || \"#4f46e5\";\n\n\t\tconst proximity = getProximityToTarget();\n\t\tif (proximity === 0) return \"#ffffff\";\n\t\tif (proximity === 100) return config?.style?.base?.brandColor || \"#8b5cf6\";\n\n\t\tconst r = Math.round(255 - (255 - 139) * (proximity / 100));\n\t\tconst g = Math.round(255 - (255 - 92) * (proximity / 100));\n\t\tconst b = Math.round(255 - (255 - 246) * (proximity / 100));\n\t\treturn `rgb(${r}, ${g}, ${b})`;\n\t}, [isScanning, getProximityToTarget]);\n\n\tconst handelTextColour = useCallback((isLight: boolean, proximity: number) => {\n\t\tif (proximity > 70) {\n\t\t\treturn isLight ? \"text-[#fff]/70\" : \"text-[#fff]\";\n\t\t}\n\t\treturn isLight ? \"text-[#fff]/40\" : \"text-[#000]/70\";\n\t}, []);\n\n\tconst getTextColor = useCallback(\n\t\t(isLight = false) => {\n\t\t\tconst proximity = getProximityToTarget();\n\t\t\tif (isScanning) return \"text-[#fff]\";\n\t\t\treturn handelTextColour(isLight, proximity);\n\t\t},\n\t\t[isScanning, getProximityToTarget],\n\t);\n\tconst cd = countdown;\n\tfunction fixVh() {\n\t\tdocument.documentElement.style.setProperty(\"--real-vh\", window.innerHeight + \"px\");\n\t}\n\tfixVh();\n\twindow.addEventListener(\"resize\", fixVh);\n\treturn (\n\t\t<div\n\t\t\tclassName=\"flex w-screen flex-col items-center h-[var(--real-vh)] overflow-hidden touch-none justify-center transition-all duration-300 max-w-[28rem] mx-auto\"\n\t\t\tstyle={{ backgroundColor }}\n\t\t\t// onDoubleClick={onDoubleClick}\n\t\t>\n\t\t\t<div className=\"flex justify-start fixed top-[.5rem] max-w-[28rem] mx-auto w-full px-[1rem]\">\n\t\t\t\t<div className=\"flex justify-start \">\n\t\t\t\t\t<Header noTitle resolvedConfig={config} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{cd !== null ? (\n\t\t\t\t<div className=\"relative flex h-[6rem] w-[6rem] items-center justify-center rounded-[9999px] border-2 border-[#fff] bg-[#fff]/20 transition-all duration-300\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"text-[3rem] font-bold text-[#fff]\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{cd}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : isScanning ? (\n\t\t\t\t<div className=\"relative flex flex-col items-center justify-center\">\n\t\t\t\t\t<div className=\"relative flex h-16 w-16 items-center justify-center rounded-[9999px] border-2 bg-[#fff]/30 border-[#fff]\">\n\t\t\t\t\t\t<div className=\"h-4 w-4 rounded-[9999px] animate-pulse bg-[#fff]/80\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\"relative flex h-[4rem] w-[4rem] items-center justify-center rounded-[9999px] border-2 \", isInTargetRange ? \"bg-[#fff]/20 border-[#fff]\" : \"bg-[#fff]/10 border-[#fff]\")}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\ttransform: `translateY(${(90 - angle) * 3}px)`,\n\t\t\t\t\t\ttransition: \"transform 0.2s ease-out\",\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"h-[1rem] w-[1rem] rounded-[9999px] bg-[#fff]/80\" />\n\t\t\t\t\t<div className=\"mt-[.5rem] w-[180px] flex-col flex items-center absolute top-[60px] text-[#fff]\">\n\t\t\t\t\t\t<SwitchIcon size={30} />\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\" \"}\n\t\t\t\t\t\t\tTap to start level check\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{cd !== null && (\n\t\t\t\t<div className=\"absolute bottom-[8rem] text-center\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"text-[#fff] text-sm font-medium px-4 py-1.5 bg-black/20 rounded-[9999px] mt-8\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tLeave your phone as is\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{isInTargetRange && cd === null && !isScanning && (\n\t\t\t\t<div className=\"absolute bottom-[8rem] w-[12rem]\">\n\t\t\t\t\t<div className=\"h-[.375rem] w-full bg-[#fff]/20 rounded-[9999px] overflow-hidden\">\n\t\t\t\t\t\t<div className=\"h-full bg-[#fff]/70 transition-all duration-300 rounded-[9999px]\" style={{ width: `${stabilityScore}%` }} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{cd === null && !isScanning && (\n\t\t\t\t<div className=\"absolute bottom-[5rem] text-center\">\n\t\t\t\t\t<div className={cn(\"text-[1.5rem] font-light\", getTextColor())}>{Math.round(angle)}°</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{cd === null && !isScanning && (\n\t\t\t\t<div className=\"absolute bottom-[2rem] text-center max-w-[20rem] mx-auto\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\"text-[.75rem] opacity-50\", getTextColor(true))}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tPlace your phone upright against an object. Once stable and within the 80-95° range a countdown will start to move to the scan.\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\nexport default React.memo(LevelScreen);\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Webcam\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"Webcam\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_react__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/react-webcam.tsx\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./src/react-webcam.tsx\":\n/*!******************************!*\\\n !*** ./src/react-webcam.tsx ***!\n \\******************************/\n/*! exports provided: default */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n// polyfill based on https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\n(function polyfillGetUserMedia() {\n if (typeof window === 'undefined') {\n return;\n }\n // Older browsers might not implement mediaDevices at all, so we set an empty object first\n if (navigator.mediaDevices === undefined) {\n navigator.mediaDevices = {};\n }\n // Some browsers partially implement mediaDevices. We can't just assign an object\n // with getUserMedia as it would overwrite existing properties.\n // Here, we will just add the getUserMedia property if it's missing.\n if (navigator.mediaDevices.getUserMedia === undefined) {\n navigator.mediaDevices.getUserMedia = function (constraints) {\n // First get ahold of the legacy getUserMedia, if present\n var getUserMedia = navigator.getUserMedia ||\n navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia ||\n navigator.msGetUserMedia;\n // Some browsers just don't implement it - return a rejected promise with an error\n // to keep a consistent interface\n if (!getUserMedia) {\n return Promise.reject(new Error(\"getUserMedia is not implemented in this browser\"));\n }\n // Otherwise, wrap the call to the old navigator.getUserMedia with a Promise\n return new Promise(function (resolve, reject) {\n getUserMedia.call(navigator, constraints, resolve, reject);\n });\n };\n }\n})();\nfunction hasGetUserMedia() {\n return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia);\n}\nvar Webcam = /** @class */ (function (_super) {\n __extends(Webcam, _super);\n function Webcam(props) {\n var _this = _super.call(this, props) || this;\n _this.canvas = null;\n _this.ctx = null;\n _this.requestUserMediaId = 0;\n _this.unmounted = false;\n _this.state = {\n hasUserMedia: false\n };\n return _this;\n }\n Webcam.prototype.componentDidMount = function () {\n var _a = this, state = _a.state, props = _a.props;\n this.unmounted = false;\n if (!hasGetUserMedia()) {\n props.onUserMediaError(\"getUserMedia not supported\");\n return;\n }\n if (!state.hasUserMedia) {\n this.requestUserMedia();\n }\n if (props.children && typeof props.children != 'function') {\n console.warn(\"children must be a function\");\n }\n };\n Webcam.prototype.componentDidUpdate = function (nextProps) {\n var props = this.props;\n if (!hasGetUserMedia()) {\n props.onUserMediaError(\"getUserMedia not supported\");\n return;\n }\n var audioConstraintsChanged = JSON.stringify(nextProps.audioConstraints) !==\n JSON.stringify(props.audioConstraints);\n var videoConstraintsChanged = JSON.stringify(nextProps.videoConstraints) !==\n JSON.stringify(props.videoConstraints);\n var minScreenshotWidthChanged = nextProps.minScreenshotWidth !== props.minScreenshotWidth;\n var minScreenshotHeightChanged = nextProps.minScreenshotHeight !== props.minScreenshotHeight;\n if (videoConstraintsChanged ||\n minScreenshotWidthChanged ||\n minScreenshotHeightChanged) {\n this.canvas = null;\n this.ctx = null;\n }\n if (audioConstraintsChanged || videoConstraintsChanged) {\n this.stopAndCleanup();\n this.requestUserMedia();\n }\n };\n Webcam.prototype.componentWillUnmount = function () {\n this.unmounted = true;\n this.stopAndCleanup();\n };\n Webcam.stopMediaStream = function (stream) {\n if (stream) {\n if (stream.getVideoTracks && stream.getAudioTracks) {\n stream.getVideoTracks().map(function (track) {\n stream.removeTrack(track);\n track.stop();\n });\n stream.getAudioTracks().map(function (track) {\n stream.removeTrack(track);\n track.stop();\n });\n }\n else {\n stream.stop();\n }\n }\n };\n Webcam.prototype.stopAndCleanup = function () {\n var state = this.state;\n if (state.hasUserMedia) {\n Webcam.stopMediaStream(this.stream);\n if (state.src) {\n window.URL.revokeObjectURL(state.src);\n }\n }\n };\n Webcam.prototype.getScreenshot = function (screenshotDimensions) {\n var _a = this, state = _a.state, props = _a.props;\n if (!state.hasUserMedia)\n return null;\n var canvas = this.getCanvas(screenshotDimensions);\n return (canvas &&\n canvas.toDataURL(props.screenshotFormat, props.screenshotQuality));\n };\n Webcam.prototype.getCanvas = function (screenshotDimensions) {\n var _a = this, state = _a.state, props = _a.props;\n if (!this.video) {\n return null;\n }\n if (!state.hasUserMedia || !this.video.videoHeight)\n return null;\n if (!this.ctx) {\n var canvasWidth = this.video.videoWidth;\n var canvasHeight = this.video.videoHeight;\n if (!this.props.forceScreenshotSourceSize) {\n var aspectRatio = canvasWidth / canvasHeight;\n canvasWidth = props.minScreenshotWidth || this.video.clientWidth;\n canvasHeight = canvasWidth / aspectRatio;\n if (props.minScreenshotHeight &&\n canvasHeight < props.minScreenshotHeight) {\n canvasHeight = props.minScreenshotHeight;\n canvasWidth = canvasHeight * aspectRatio;\n }\n }\n this.canvas = document.createElement(\"canvas\");\n this.canvas.width = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.width) || canvasWidth;\n this.canvas.height = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.height) || canvasHeight;\n this.ctx = this.canvas.getContext(\"2d\");\n }\n var _b = this, ctx = _b.ctx, canvas = _b.canvas;\n if (ctx && canvas) {\n // adjust the height and width of the canvas to the given dimensions\n canvas.width = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.width) || canvas.width;\n canvas.height = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.height) || canvas.height;\n // mirror the screenshot\n if (props.mirrored) {\n ctx.translate(canvas.width, 0);\n ctx.scale(-1, 1);\n }\n ctx.imageSmoothingEnabled = props.imageSmoothing;\n ctx.drawImage(this.video, 0, 0, (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.width) || canvas.width, (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.height) || canvas.height);\n // invert mirroring\n if (props.mirrored) {\n ctx.scale(-1, 1);\n ctx.translate(-canvas.width, 0);\n }\n }\n return canvas;\n };\n Webcam.prototype.requestUserMedia = function () {\n var _this = this;\n var props = this.props;\n var sourceSelected = function (audioConstraints, videoConstraints) {\n var constraints = {\n video: typeof videoConstraints !== \"undefined\" ? videoConstraints : true\n };\n if (props.audio) {\n constraints.audio =\n typeof audioConstraints !== \"undefined\" ? audioConstraints : true;\n }\n _this.requestUserMediaId++;\n var myRequestUserMediaId = _this.requestUserMediaId;\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function (stream) {\n if (_this.unmounted || myRequestUserMediaId !== _this.requestUserMediaId) {\n Webcam.stopMediaStream(stream);\n }\n else {\n _this.handleUserMedia(null, stream);\n }\n })\n .catch(function (e) {\n _this.handleUserMedia(e);\n });\n };\n if (\"mediaDevices\" in navigator) {\n sourceSelected(props.audioConstraints, props.videoConstraints);\n }\n else {\n var optionalSource_1 = function (id) { return ({ optional: [{ sourceId: id }] }); };\n var constraintToSourceId_1 = function (constraint) {\n var deviceId = constraint.deviceId;\n if (typeof deviceId === \"string\") {\n return deviceId;\n }\n if (Array.isArray(deviceId) && deviceId.length > 0) {\n return deviceId[0];\n }\n if (typeof deviceId === \"object\" && deviceId.ideal) {\n return deviceId.ideal;\n }\n return null;\n };\n // @ts-ignore: deprecated api\n MediaStreamTrack.getSources(function (sources) {\n var audioSource = null;\n var videoSource = null;\n sources.forEach(function (source) {\n if (source.kind === \"audio\") {\n audioSource = source.id;\n }\n else if (source.kind === \"video\") {\n videoSource = source.id;\n }\n });\n var audioSourceId = constraintToSourceId_1(props.audioConstraints);\n if (audioSourceId) {\n audioSource = audioSourceId;\n }\n var videoSourceId = constraintToSourceId_1(props.videoConstraints);\n if (videoSourceId) {\n videoSource = videoSourceId;\n }\n sourceSelected(optionalSource_1(audioSource), optionalSource_1(videoSource));\n });\n }\n };\n Webcam.prototype.handleUserMedia = function (err, stream) {\n var props = this.props;\n if (err || !stream) {\n this.setState({ hasUserMedia: false });\n props.onUserMediaError(err);\n return;\n }\n this.stream = stream;\n try {\n if (this.video) {\n this.video.srcObject = stream;\n }\n this.setState({ hasUserMedia: true });\n }\n catch (error) {\n this.setState({\n hasUserMedia: true,\n src: window.URL.createObjectURL(stream)\n });\n }\n props.onUserMedia(stream);\n };\n Webcam.prototype.render = function () {\n var _this = this;\n var _a = this, state = _a.state, props = _a.props;\n var audio = props.audio, forceScreenshotSourceSize = props.forceScreenshotSourceSize, disablePictureInPicture = props.disablePictureInPicture, onUserMedia = props.onUserMedia, onUserMediaError = props.onUserMediaError, screenshotFormat = props.screenshotFormat, screenshotQuality = props.screenshotQuality, minScreenshotWidth = props.minScreenshotWidth, minScreenshotHeight = props.minScreenshotHeight, audioConstraints = props.audioConstraints, videoConstraints = props.videoConstraints, imageSmoothing = props.imageSmoothing, mirrored = props.mirrored, _b = props.style, style = _b === void 0 ? {} : _b, children = props.children, rest = __rest(props, [\"audio\", \"forceScreenshotSourceSize\", \"disablePictureInPicture\", \"onUserMedia\", \"onUserMediaError\", \"screenshotFormat\", \"screenshotQuality\", \"minScreenshotWidth\", \"minScreenshotHeight\", \"audioConstraints\", \"videoConstraints\", \"imageSmoothing\", \"mirrored\", \"style\", \"children\"]);\n var videoStyle = mirrored ? __assign(__assign({}, style), { transform: (style.transform || \"\") + \" scaleX(-1)\" }) : style;\n var childrenProps = {\n getScreenshot: this.getScreenshot.bind(this),\n };\n return (react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null,\n react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"video\", __assign({ autoPlay: true, disablePictureInPicture: disablePictureInPicture, src: state.src, muted: !audio, playsInline: true, ref: function (ref) {\n _this.video = ref;\n }, style: videoStyle }, rest)),\n children && children(childrenProps)));\n };\n Webcam.defaultProps = {\n audio: false,\n disablePictureInPicture: false,\n forceScreenshotSourceSize: false,\n imageSmoothing: true,\n mirrored: false,\n onUserMedia: function () { return undefined; },\n onUserMediaError: function () { return undefined; },\n screenshotFormat: \"image/webp\",\n screenshotQuality: 0.92,\n };\n return Webcam;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Webcam);\n\n\n/***/ }),\n\n/***/ \"react\":\n/*!**************************************************************************************!*\\\n !*** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"} ***!\n \\**************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_react__;\n\n/***/ })\n\n/******/ })[\"default\"];\n});\n//# sourceMappingURL=react-webcam.js.map","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');","import React, {\n createContext,\n Dispatch,\n ReactNode,\n SetStateAction,\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n} from \"react\";\n\nexport const MEDIA_TYPES = {\n DESKTOP: \"DESKTOP\",\n TAB: \"TAB\",\n MOBILE: \"MOBILE\",\n};\n\ninterface MediaContextType {\n size: number[];\n setSize: Dispatch<SetStateAction<number[]>>;\n clearInputs: boolean;\n setClearInputs: Dispatch<SetStateAction<boolean>>;\n media: string;\n}\n\nexport const MediaContext = createContext<MediaContextType | undefined>(\n undefined\n);\n\nfunction MediaContextProvider({ children }: { children: ReactNode }) {\n const [size, setSize] = useState([window?.innerWidth, window?.innerHeight]);\n const [clearInputs, setClearInputs] = useState(false);\n\n const updateSize = () => {\n setSize([window?.innerWidth, window?.innerHeight]);\n };\n useEffect(() => {\n updateSize();\n }, []);\n useLayoutEffect(() => {\n window.addEventListener(\"resize\", updateSize);\n return () => window.removeEventListener(\"resize\", updateSize);\n }, [updateSize]);\n let media = MEDIA_TYPES.DESKTOP;\n if (size[0] > 768 && size[0] < 1024) {\n media = MEDIA_TYPES.TAB;\n }\n if (size[0] < 768) {\n media = MEDIA_TYPES.MOBILE;\n }\n\n const mediaDetails = useMemo(\n () => ({\n size,\n setSize,\n clearInputs,\n setClearInputs,\n media,\n }),\n [size, clearInputs, media]\n );\n\n return (\n <MediaContext.Provider value={mediaDetails}>\n {children}\n </MediaContext.Provider>\n );\n}\n\nexport default MediaContextProvider;\n","import {\n createContext,\n Dispatch,\n ReactNode,\n SetStateAction,\n useMemo,\n useState,\n} from \"react\";\nimport { PreferredLanguage } from \"../enums\";\nimport English from \"../dictionary/EnglishLanguage.json\";\nimport Hindi from \"../dictionary/HindiLanguage.json\";\nimport French from \"../dictionary/FrenchLanguage.json\";\nimport German from \"../dictionary/GermanLanguage.json\";\nimport Spanish from \"../dictionary/SpanishLanguage.json\";\nimport Arabic from \"../dictionary/ArabicLanguage.json\";\nimport Italian from \"../dictionary/ItalianLanguage.json\";\n// import { PreferredLanguageType } from \"swan-web-components/src/types/interfaces\";\n\ntype Dictionary = Record<string, string>;\n\nconst dictionaries: Record<PreferredLanguage, Dictionary> = {\n [PreferredLanguage.English]: English as Dictionary,\n [PreferredLanguage.Hindi]: Hindi as Dictionary,\n [PreferredLanguage.French]: French as Dictionary,\n [PreferredLanguage.German]: German as Dictionary,\n [PreferredLanguage.Spanish]: Spanish as Dictionary,\n [PreferredLanguage.Arabic]: Arabic as Dictionary,\n [PreferredLanguage.Italian]: Italian as Dictionary,\n};\n\ninterface ILanguageContext {\n preferredLanguage: PreferredLanguage;\n setPreferredLanguage: Dispatch<SetStateAction<PreferredLanguage>>;\n translate: (text: string) => string;\n}\n\nexport const LanguageContext = createContext<ILanguageContext | undefined>(\n undefined\n);\n\nexport default function LanguageContextProvider({\n children,\n}: {\n children: ReactNode;\n}) {\n const [preferredLanguage, setPreferredLanguage] = useState<PreferredLanguage>(\n PreferredLanguage.English\n );\n\n const translate = (text: string): string => {\n return dictionaries[preferredLanguage][text] ?? text;\n };\n\n const value = useMemo(\n () => ({\n preferredLanguage,\n setPreferredLanguage,\n translate,\n }),\n [preferredLanguage]\n );\n\n return (\n <LanguageContext.Provider value={value}>\n {children}\n </LanguageContext.Provider>\n );\n}\n","import { useContext } from \"react\";\nimport Webcam from \"react-webcam\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { CameraScanChildProps } from \"../../types/interfaces\";\nimport { MEDIA_TYPES, MediaContext } from \"../../utils/context/mediaContext\";\nimport { LanguageContext } from \"../../utils/context/languageContext\";\nimport { LanguageKeys, pauseIcon, videoConstraints, voiceOverAssetsPath } from \"../../utils/constants\";\nimport SpecificButton from \"../../atoms/specificButton/SpecificButton\";\n\n\n\nfunction CameraScanChild({\n\thandleShowStreamCamera,\n\tloadingCam,\n\thandleUserMedia,\n\thandlePause,\n\tpause,\n\trecordingStarted,\n\tstartSendingVideoFrames,\n\tshowPause,\n\twebcamRef,\n\tresetDetector,\n\tconfig,\n}: CameraScanChildProps) {\n\tconst { media } = useContext(MediaContext) || {};\n\tconst { translate } = useContext(LanguageContext) || {};\n\n\treturn (\n\t\t<div className=\"App w-screen h-[100vh] relative \">\n\t\t\t<span\n\t\t\t\tonClick={() => {\n\t\t\t\t\thandleShowStreamCamera();\n\t\t\t\t\tresetDetector();\n\t\t\t\t}}\n\t\t\t\tclassName=\"fixed right-[20px] top-[20px] z-[999]\"\n\t\t\t>\n\t\t\t\t<CloseIcon className=\"text-[#fff]\" />\n\t\t\t</span>\n\n\t\t\t<div className=\"w-full h-full overflow-hidden \">\n\t\t\t\t{media === MEDIA_TYPES.MOBILE && (\n\t\t\t\t\t<Webcam\n\t\t\t\t\t\taudio={false}\n\t\t\t\t\t\tref={webcamRef}\n\t\t\t\t\t\tscreenshotQuality={1}\n\t\t\t\t\t\tvideoConstraints={videoConstraints}\n\t\t\t\t\t\tmirrored\n\t\t\t\t\t\tscreenshotFormat=\"image/jpeg\"\n\t\t\t\t\t\tonUserMedia={handleUserMedia}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tposition: \"fixed\",\n\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\t\tzIndex: 0,\n\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\theight: \"100%\",\n\t\t\t\t\t\t\tobjectFit: \"cover\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t<div className=\"fixed bottom-[30px] w-full z-[999] flex flex-col gap-4 items-center justify-center\">\n\t\t\t\t{showPause && <SpecificButton className=\"!w-[180px] !h-[40px] !py-[0] mx-auto \" prefix={pauseIcon} buttonText=\"Pause\" buttonFunc={handlePause} resolvedConfig={config} btnSecondary />}\n\n\t\t\t\t{pause ? (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<SpecificButton className=\"!w-[180px] !h-[40px] !py-[0] mx-auto\" buttonText=\"Restart\" buttonFunc={handleShowStreamCamera} resolvedConfig={config} btnSecondary />\n\t\t\t\t\t</div>\n\t\t\t\t) : !recordingStarted ? (\n\t\t\t\t\t<SpecificButton\n\t\t\t\t\t\tclassName={`!w-[180px] !h-[40px] !py-[0] mx-auto !bg-[#ffffff] !text-[#000000] ${loadingCam ? \"!opacity-50\" : \"\"}`}\n\t\t\t\t\t\tbuttonText={translate?.(LanguageKeys.Start_Scan)}\n\t\t\t\t\t\tbuttonFunc={startSendingVideoFrames}\n\t\t\t\t\t\tdisabled={loadingCam}\n\t\t\t\t\t\tresolvedConfig={config}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t</div>\n\n\t\t\t<audio\n\t\t\t\tid=\"audioElement\"\n\t\t\t\tcrossOrigin=\"anonymous\"\n\t\t\t\tpreload=\"auto\"\n\t\t\t\tstyle={{\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\tzIndex: -99999,\n\t\t\t\t}}\n\t\t\t\tsrc={`${voiceOverAssetsPath}scanAudioInstructions/silence.mp3`}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default CameraScanChild;\n","import { useState, useRef, useEffect } from \"react\";\nimport { TENSORFLOW_SOLUTION_PATH } from \"../utils/constants\";\n\ntype KeypointTuple = [number, number, number];\n\nexport default function useTensorFlow() {\n const [consecutiveFronts, setConsecutiveFronts] = useState(0);\n const [spinPhase, setSpinPhase] = useState(0);\n\n const spinPhaseRef = useRef(0);\n const consecutiveFrontsRef = useRef(0);\n const detectorRef = useRef<any>(null);\n const mounted = useRef(true);\n\n /** Safe dynamic imports (SSR-proof) */\n let poseDetectionLib: any = null;\n let tfjsLoaded = false;\n\n async function loadPoseLib() {\n if (!poseDetectionLib) {\n const lib = await import(\"@tensorflow-models/pose-detection\");\n await import(\"@tensorflow/tfjs\");\n poseDetectionLib = lib;\n tfjsLoaded = true;\n }\n }\n\n function isFrontFrame(body: KeypointTuple[]) {\n return body.filter((p) => p[2] > 0.7).length === 22;\n }\n\n /** Detector */\n const poseDetector = async (callback: () => void, webcamRef: any) => {\n if (!detectorRef.current || !mounted.current) return;\n\n try {\n const poses = await detectorRef.current.estimatePoses(\n webcamRef.current.video,\n { flipHorizontal: false }\n );\n\n if (!poses.length) return;\n\n const body: KeypointTuple[] = poses[0].keypoints\n .slice(11)\n .map((kp: any) => [\n kp.x > 0 && kp.x < 720 ? kp.x : -1,\n kp.y > 0 && kp.y < 1280 ? kp.y : -1,\n kp.score ?? 0,\n ]);\n\n if (spinPhaseRef.current === 0 && !isFrontFrame(body)) {\n setConsecutiveFronts((prev) => prev + 1);\n }\n\n if (spinPhaseRef.current === 1 && isFrontFrame(body)) {\n setConsecutiveFronts((prev) => prev + 1);\n }\n\n if (spinPhaseRef.current === 2) callback();\n } catch (err) {\n console.error(\"Pose detection error:\", err);\n }\n };\n\n const loadPoseDetector = async () => {\n if (typeof window === \"undefined\") return;\n\n await loadPoseLib();\n\n detectorRef.current = await poseDetectionLib.createDetector(\n poseDetectionLib.SupportedModels.BlazePose,\n {\n runtime: \"mediapipe\",\n modelType: \"full\",\n solutionPath: TENSORFLOW_SOLUTION_PATH,\n }\n );\n };\n\n const disposeModelAndTf = async () => {\n try {\n await detectorRef.current?.dispose();\n } catch {}\n detectorRef.current = null;\n\n spinPhaseRef.current = 0;\n consecutiveFrontsRef.current = 0;\n };\n\n useEffect(() => {\n mounted.current = true;\n\n loadPoseDetector();\n\n return () => {\n mounted.current = false;\n disposeModelAndTf();\n };\n }, []);\n\n useEffect(() => {\n consecutiveFrontsRef.current = consecutiveFronts;\n\n if (consecutiveFronts > 6 && spinPhaseRef.current < 2) {\n setSpinPhase((s) => s + 1);\n setConsecutiveFronts(0);\n }\n }, [consecutiveFronts]);\n\n useEffect(() => {\n spinPhaseRef.current = spinPhase;\n }, [spinPhase]);\n\n return { poseDetector };\n}\n","import { createContext } from \"react\";\n\nconst ParamsContext = createContext<any>(null);\n\nexport default ParamsContext;\n","/* eslint-disable no-use-before-define */\nimport React, { useCallback, useContext, useEffect, useRef, useState } from \"react\";\nimport CameraScanChild from \"./CameraScanChild\";\nimport posthog from \"posthog-js\";\nimport Webcam from \"react-webcam\";\nimport { ScanningComponentProps } from \"../../types/interfaces\";\nimport useTensorFlow from \"../../customHooks/useTensorFlow\";\nimport ParamsContext from \"../../utils/context/paramsContext\";\nimport { generateUuid, getCurrentTimeInSeconds, handleScanTimeCapture, rescanSupportCaptureEvent } from \"../../utils/utils\";\nimport speechService from \"../../utils/service/speechService\";\nimport swan from \"../../utils/service/swanService\";\nimport { videoTypes, voiceOverAssetsPath } from \"../../utils/constants\";\n\n\nlet id: string | null = null;\nlet audioTimeoutId: number | undefined| NodeJS.Timeout;\nlet lastVideoPlayed: {\n\tskipCount: number;\n\tno_of_times_skipped: number;\n\taudioName: string;\n} | null = null;\n\nfunction ScanningComponent({ setIsScanLocked, resetDetector, scanID, setIsVideoUploaded, setScanFailsError, setScanStartTime, setScanUniqueKey, userDetails, config }: ScanningComponentProps) {\n\tconst { gender, heightInCm, email, shopDomain } = userDetails;\n\tconst webcamRef = useRef<Webcam | null>(null);\n\tconst mediaRecorderRef = useRef<MediaRecorder | null>(null);\n\tconst [recordedChunks, setRecordedChunks] = useState<Blob[]>([]);\n\tconst [loadingCam, setLoadingCam] = useState(true);\n\tconst [recordingStarted, setRecordingStarted] = useState(false);\n\tconst [faceDone, setFaceDone] = useState(false);\n\tconst [mediaRecorderStopped, setMediaRecorderStopped] = useState(true);\n\tconst [isScanning, setIsScanning] = useState(false);\n\tconst captureVideoTimeOutHandle = useRef<number | null|NodeJS.Timeout>(null);\n\tconst [audioSource, setAudioSource] = useState(\"\");\n\tconst [audioSourceList, setAudioSourceList] = useState<string[]>([]);\n\tconst [emptyAudioSource, setEmptyAudioSource] = useState(\"\");\n\tconst [startAgain, setStartAgain] = useState(false);\n\tconst [showRestart, setRestart] = useState(false);\n\tconst [pause, setPause] = useState(false);\n\tconst [events, setEvents] = useState<any>([]);\n\tconst [showPause, setShowPause] = useState(false);\n\tconst allowAudioToPlay = useRef(true);\n\tconst { poseDetector } = useTensorFlow();\n\tconst firstScan = useRef(true);\n\tconst poseStoppedRef = useRef(false);\n\tlet counter = 0;\n\n\tconst { setStartGyro, handleFileUpload, setUploadLoading } = useContext(ParamsContext);\n\n\tconst handleShowStreamCamera = () => {\n\t\tposeStoppedRef.current = false;\n\t\tclearTimeout(audioTimeoutId);\n\t\tif (captureVideoTimeOutHandle.current) clearTimeout(captureVideoTimeOutHandle.current);\n\t\tsetScanUniqueKey(generateUuid());\n\t\tsetScanFailsError(\"\");\n\t\tsetUploadLoading?.(false);\n\t\tsetRecordedChunks([]);\n\t\tsetLoadingCam(true);\n\t\tsetRecordingStarted(false);\n\t\tsetFaceDone(false);\n\t\tsetMediaRecorderStopped(true);\n\t\tsetIsScanning(false);\n\t\tcaptureVideoTimeOutHandle.current = null;\n\t\tsetAudioSource(\"\");\n\t\tsetAudioSourceList([]);\n\t\tsetEmptyAudioSource(\"\");\n\t\tsetStartAgain(!startAgain);\n\t\tsetLoadingCam(false);\n\t\tsetStartGyro(false);\n\t\tspeechService.stopAudio();\n\t\tsetRestart(false);\n\t\tsetPause(false);\n\t\tcounter = 0;\n\t\tif (mediaRecorderRef.current !== null) {\n\t\t\tmediaRecorderRef.current.stop();\n\t\t}\n\n\t\tevents.forEach((el: any) => {\n\t\t\tif (mediaRecorderRef.current) mediaRecorderRef.current.removeEventListener(\"dataavailable\", el);\n\t\t});\n\n\t\tsetEvents([]);\n\t\tallowAudioToPlay.current = true;\n\t\tsetShowPause(false);\n\t\tsetIsVideoUploaded(false);\n\t};\n\n\tconst handleUserMedia = useCallback(() => {\n\t\tsetTimeout(() => {\n\t\t\tsetLoadingCam(false);\n\t\t}, 1000);\n\t}, []);\n\n\tconst handleReScan = useCallback(() => {\n\t\trescanSupportCaptureEvent({\n\t\t\teventName: `${shopDomain}/rescan`,\n\t\t\temail,\n\t\t\tscanID: scanID,\n\t\t\theight: heightInCm,\n\t\t\tgender,\n\t\t\tstatus: false,\n\t\t});\n\t\tallowAudioToPlay.current = false;\n\t\thandleShowStreamCamera();\n\t\tstartSendingVideoFrames();\n\t}, [handleShowStreamCamera, scanID, email]);\n\n\tconst handlePause = useCallback(() => {\n\t\tallowAudioToPlay.current = false;\n\t\tsetPause(true);\n\t\tsetShowPause(false);\n\t\tif (captureVideoTimeOutHandle.current) clearTimeout(captureVideoTimeOutHandle.current);\n\t\tif (mediaRecorderRef.current) {\n\t\t\tmediaRecorderRef.current.pause();\n\t\t}\n\t\tspeechService.stopAudio();\n\t\tswan.poseDetection.disconnect();\n\t\tcounter = 0;\n\t\tif (mediaRecorderRef.current) {\n\t\t\tmediaRecorderRef.current.stop();\n\t\t}\n\t\tevents.forEach((el: any) => {\n\t\t\tif (mediaRecorderRef.current) mediaRecorderRef.current.removeEventListener(\"dataavailable\", el);\n\t\t});\n\t\tsetEvents([]);\n\t\tclearTimeout(audioTimeoutId);\n\t}, [mediaRecorderRef, events, speechService, allowAudioToPlay]);\n\n\tconst supportedTypes = videoTypes.filter((type) => MediaRecorder.isTypeSupported(type));\n\n\tconst stopRecording = useCallback(async () => {\n\t\tallowAudioToPlay.current = true;\n\t\tawait speechService.playAudio(`${voiceOverAssetsPath}SpotOn.mp3`);\n\t\tsetPause(false);\n\t\tsetShowPause(false);\n\t\tif (captureVideoTimeOutHandle.current) clearTimeout(captureVideoTimeOutHandle.current);\n\t\tsetRecordingStarted(false);\n\t}, [captureVideoTimeOutHandle, speechService]);\n\n\tconst handleSocket = useCallback(async () => {\n\t\ttry {\n\t\t\tid = await swan.poseDetection.connect();\n\n\t\t\tposthog.capture(`${shopDomain}/pose_detection_connected`, {\n\t\t\t\tscanID: scanID,\n\t\t\t\temail,\n\t\t\t\tid,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.log(error, \"while connecting websocket\");\n\t\t}\n\t}, [scanID, shopDomain, email]);\n\n\tconst handleSpinDataAvailable = useCallback(\n\t\t({ data }: BlobEvent) => {\n\t\t\tif (data && data.size > 0 && allowAudioToPlay.current) {\n\t\t\t\tsetRecordedChunks((prev) => prev.concat(data));\n\t\t\t\tif (!poseStoppedRef.current && webcamRef.current) {\n\t\t\t\t\tposeStoppedRef.current = true;\n\t\t\t\t\tposeDetector(() => {\n\t\t\t\t\t\tstopRecording();\n\t\t\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\t\t\teventName: `${shopDomain}/tensorFlow`,\n\t\t\t\t\t\t\tscanID: scanID,\n\t\t\t\t\t\t\temail,\n\t\t\t\t\t\t\tmessage: \"recording stopped by tensorflow \",\n\t\t\t\t\t\t});\n\t\t\t\t\t}, webcamRef);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[stopRecording, handleScanTimeCapture, shopDomain, scanID, email, poseDetector, webcamRef],\n\t);\n\n\tconst playAudio = useCallback(async () => {\n\t\tif (audioSourceList.length > 0 && allowAudioToPlay.current) {\n\t\t\tawait speechService.playAudio(voiceOverAssetsPath + audioSourceList[audioSourceList.length - 1]);\n\t\t\tif (allowAudioToPlay.current) {\n\t\t\t\taudioTimeoutId = setTimeout(playAudio, 2000);\n\t\t\t}\n\t\t}\n\t}, [audioSourceList, allowAudioToPlay]);\n\n\tconst handleStartCaptureClick = useCallback(() => {\n\t\tif (mediaRecorderRef && mediaRecorderRef.current) {\n\t\t\tmediaRecorderRef.current.stop();\n\t\t}\n\t\tsetRecordingStarted(true);\n\t\ttry {\n\t\t\tif (webcamRef && webcamRef.current && webcamRef.current.stream) {\n\t\t\t\tconst mediaRecorderOptions = {\n\t\t\t\t\tmimeType: supportedTypes[0],\n\t\t\t\t};\n\t\t\t\tmediaRecorderRef.current = new MediaRecorder(webcamRef.current.stream, mediaRecorderOptions);\n\t\t\t\tmediaRecorderRef.current.addEventListener(\"dataavailable\", handleSpinDataAvailable);\n\n\t\t\t\tsetEvents([...events, handleSpinDataAvailable]);\n\t\t\t\tmediaRecorderRef.current.start(1000);\n\t\t\t\tsetMediaRecorderStopped(false);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"error while using media recorder\", e);\n\t\t}\n\t}, [webcamRef, supportedTypes, handleSpinDataAvailable, events]);\n\n\tconst postPoseProcess = useCallback(async () => {\n\t\tif (captureVideoTimeOutHandle.current) {\n\t\t\tclearTimeout(captureVideoTimeOutHandle.current);\n\t\t}\n\t\thandleStartCaptureClick();\n\t\tif (allowAudioToPlay.current) {\n\t\t\tcaptureVideoTimeOutHandle.current = setTimeout(async () => {\n\t\t\t\tif (allowAudioToPlay.current) {\n\t\t\t\t\tawait speechService.playAudio(`${voiceOverAssetsPath}SpotOn.mp3`);\n\t\t\t\t\tsetRecordingStarted(false);\n\t\t\t\t}\n\t\t\t}, 15000);\n\t\t}\n\t\tsetFaceDone(true);\n\t\tif (allowAudioToPlay.current) {\n\t\t\tawait speechService.playAudio(`${voiceOverAssetsPath}Spin.mp3`);\n\t\t}\n\t}, [handleStartCaptureClick, allowAudioToPlay, speechService]);\n\n\tconst handleDataAvailable = useCallback(\n\t\t({ data }: BlobEvent) => {\n\t\t\tif (data.size > 0 && swan.poseDetection.connected()) {\n\t\t\t\tswan.poseDetection.poseStatus(async (data) => {\n\t\t\t\t\tif (data && data.audio && data.audio.length > 0) {\n\t\t\t\t\t\tconst audio = document.querySelector(\"#audioElement\") as HTMLAudioElement | null;\n\t\t\t\t\t\tif (data.status === true && data.sid === id) {\n\t\t\t\t\t\t\tif (counter < 2) {\n\t\t\t\t\t\t\t\tif (counter === 0 && audio?.paused) {\n\t\t\t\t\t\t\t\t\tawait speechService.playAudio(voiceOverAssetsPath + data.audio);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcounter += 1;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetEmptyAudioSource(data.audio);\n\t\t\t\t\t\t\t\tclearTimeout(audioTimeoutId);\n\t\t\t\t\t\t\t\tswan.poseDetection.disconnect();\n\t\t\t\t\t\t\t\tsetTimeout(postPoseProcess, 1000);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcounter = 0;\n\t\t\t\t\t\t\tif (audio?.paused && (!lastVideoPlayed || lastVideoPlayed?.audioName !== data.audio)) {\n\t\t\t\t\t\t\t\tlastVideoPlayed = {\n\t\t\t\t\t\t\t\t\tskipCount: 2,\n\t\t\t\t\t\t\t\t\tno_of_times_skipped: 0,\n\t\t\t\t\t\t\t\t\taudioName: data.audio,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tspeechService.playAudio(voiceOverAssetsPath + data.audio);\n\t\t\t\t\t\t\t} else if (lastVideoPlayed?.audioName === data.audio && audio?.paused) {\n\t\t\t\t\t\t\t\tif (lastVideoPlayed && lastVideoPlayed.no_of_times_skipped >= lastVideoPlayed.skipCount) {\n\t\t\t\t\t\t\t\t\tlastVideoPlayed.no_of_times_skipped = 0;\n\t\t\t\t\t\t\t\t\tspeechService.playAudio(voiceOverAssetsPath + data.audio);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (lastVideoPlayed) lastVideoPlayed.no_of_times_skipped += 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (webcamRef?.current && webcamRef.current.getScreenshot() !== null) {\n\t\t\t\t\tswan.poseDetection.videoEmit({\n\t\t\t\t\t\timage: webcamRef.current.getScreenshot() || \"\",\n\t\t\t\t\t\tscanId: scanID,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[webcamRef, scanID, swan, id, counter, postPoseProcess, speechService],\n\t);\n\n\tconst startSendingVideoFrames = useCallback(async () => {\n\t\tsetIsScanning(true);\n\t\tsetStartGyro(true);\n\t\tif (firstScan.current) {\n\t\t\tfirstScan.current = false;\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: \"scan started\",\n\t\t\t\tscanID: scanID,\n\t\t\t\tstatus: \"success\",\n\t\t\t\temail,\n\t\t\t});\n\t\t}\n\t\tsetScanStartTime(getCurrentTimeInSeconds());\n\t\tsetLoadingCam(true);\n\t\tif (allowAudioToPlay.current) {\n\t\t\tawait speechService.playAudio(`${voiceOverAssetsPath}StartScan.mp3`);\n\t\t}\n\t\tif (allowAudioToPlay.current) {\n\t\t\tawait speechService.playAudio(`${voiceOverAssetsPath}LiftArmsAndHoldAtHip.mp3`);\n\t\t}\n\t\tif (allowAudioToPlay.current) {\n\t\t\tsetIsScanning(false);\n\t\t\tsetRecordingStarted(true);\n\t\t\tsetRestart(true);\n\t\t\tsetShowPause(true);\n\t\t\thandleUserMedia();\n\t\t}\n\t\ttry {\n\t\t\tif (webcamRef && webcamRef.current && webcamRef.current.stream && allowAudioToPlay.current) {\n\t\t\t\tconst mediaRecorderOptions = {\n\t\t\t\t\tmimeType: supportedTypes[0],\n\t\t\t\t};\n\t\t\t\tif (allowAudioToPlay.current) {\n\t\t\t\t\tmediaRecorderRef.current = new MediaRecorder(webcamRef.current.stream, mediaRecorderOptions);\n\t\t\t\t}\n\t\t\t\tif (allowAudioToPlay.current && mediaRecorderRef.current) {\n\t\t\t\t\tmediaRecorderRef.current.addEventListener(\"dataavailable\", handleDataAvailable);\n\t\t\t\t}\n\n\t\t\t\tsetEvents([...events, handleDataAvailable]);\n\t\t\t\tif (mediaRecorderRef.current) mediaRecorderRef.current.start(1000);\n\t\t\t\tsetMediaRecorderStopped(false);\n\t\t\t\tif (allowAudioToPlay.current) {\n\t\t\t\t\taudioTimeoutId = setTimeout(playAudio, 2000);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.log(\"error ----------\", err);\n\t\t}\n\t}, [webcamRef, supportedTypes, handleDataAvailable, events, playAudio, allowAudioToPlay]);\n\n\tuseEffect(() => {\n\t\tif (shopDomain) {\n\t\t\tsetIsScanLocked(true);\n\t\t\thandleSocket();\n\t\t}\n\t\treturn () => {\n\t\t\tif (id) {\n\t\t\t\tswan.poseDetection.disconnect();\n\t\t\t\tposthog.capture(`${shopDomain}/pose_detection_disconnected`, {\n\t\t\t\t\tscanID: scanID,\n\t\t\t\t\temail,\n\t\t\t\t\tid,\n\t\t\t\t});\n\t\t\t}\n\t\t\tevents.forEach((el: any) => {\n\t\t\t\tmediaRecorderRef?.current?.removeEventListener(\"dataavailable\", el);\n\t\t\t});\n\t\t};\n\t}, [startAgain, shopDomain]);\n\tuseEffect(() => {\n\t\taudioSourceList.push(audioSource);\n\t}, [audioSource]);\n\n\tuseEffect(() => {\n\t\tsetAudioSourceList([]);\n\t}, [emptyAudioSource]);\n\tuseEffect(() => {\n\t\tconst bypassChecksToBackup = recordedChunks.length && recordedChunks.length > 0;\n\t\tif (!mediaRecorderStopped && bypassChecksToBackup && !recordingStarted && allowAudioToPlay.current && !pause) {\n\t\t\tif (mediaRecorderRef && mediaRecorderRef.current) {\n\t\t\t\tif (!recordingStarted) {\n\t\t\t\t\tmediaRecorderRef.current.stop();\n\t\t\t\t\tsetMediaRecorderStopped(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [mediaRecorderStopped, recordingStarted, recordedChunks, pause]);\n\n\tuseEffect(() => {\n\t\tconst bypassChecksToBackup = recordedChunks.length && recordedChunks.length > 0;\n\t\tif (!mediaRecorderStopped && bypassChecksToBackup && !recordingStarted) {\n\t\t\tif (mediaRecorderRef && mediaRecorderRef.current && allowAudioToPlay.current && !pause) {\n\t\t\t\tif (!recordingStarted) {\n\t\t\t\t\tconst videoFile = new File(recordedChunks, `${scanID}.webm`, {\n\t\t\t\t\t\ttype: \"video/webm\",\n\t\t\t\t\t});\n\t\t\t\t\tsetUploadLoading?.(true);\n\t\t\t\t\tsetScanFailsError(\"\");\n\t\t\t\t\thandleFileUpload?.(videoFile);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"No video found to upload\");\n\t\t}\n\t}, [mediaRecorderStopped, recordingStarted, recordedChunks, pause, mediaRecorderRef, allowAudioToPlay]);\n\n\tuseEffect(() => {\n\t\thandleShowStreamCamera();\n\t}, []);\n\n\treturn (\n\t\t<CameraScanChild\n\t\t\tresetDetector={resetDetector}\n\t\t\thandleShowStreamCamera={handleShowStreamCamera}\n\t\t\tloadingCam={loadingCam}\n\t\t\thandlePause={handlePause}\n\t\t\tshowRestart={showRestart}\n\t\t\tpause={pause}\n\t\t\thandleReScan={handleReScan}\n\t\t\trecordingStarted={recordingStarted}\n\t\t\tisScanning={isScanning}\n\t\t\tstartSendingVideoFrames={startSendingVideoFrames}\n\t\t\tfaceDone={faceDone}\n\t\t\tstopRecording={stopRecording}\n\t\t\tshowPause={showPause}\n\t\t\twebcamRef={webcamRef}\n\t\t\thandleUserMedia={handleUserMedia}\n\t\t\tconfig={config}\n\t\t/>\n\t);\n}\n\nexport default React.memo(ScanningComponent);\n","/* eslint-disable no-use-before-define */\n\nimport { useEffect, useState, useRef } from \"react\";\nimport LevelScreen from \"./LevelScreen\";\nimport ScanningComponent from \"./ScanningComponent\";\nimport { AngleDetectorProps } from \"../../types/interfaces\";\nimport { IOSDeviceOrientationEvent } from \"../../customHooks/useGyroSensor\";\n\n\n\nexport default function AngleDetector({ scanID, userDetails, setIsVideoUploaded, setScanFailsError, setScanStartTime, setScanUniqueKey, config }: AngleDetectorProps) {\n\tconst [angle, setAngle] = useState(90);\n\tconst [calibrationOffset, setCalibrationOffset] = useState(0);\n\tconst [countdown, setCountdown] = useState<number | null>(null);\n\tconst [isScanning, setIsScanning] = useState(false);\n\tconst [stabilityScore, setStabilityScore] = useState(0);\n\tconst lastAnglesRef = useRef<number[]>([]);\n\tconst [isScanLocked, setIsScanLocked] = useState(false);\n\tconst calibratedAngle = angle - calibrationOffset;\n\tconst isInTargetRange = calibratedAngle >= 80 && calibratedAngle <= 95;\n\n\tconst resetDetector = () => {\n\t\tsetAngle(90);\n\t\tsetCalibrationOffset(0);\n\t\tsetCountdown(null);\n\t\tsetIsScanning(false);\n\t\tsetStabilityScore(0);\n\t\tsetIsScanLocked(false);\n\t\tlastAnglesRef.current = [];\n\t};\n\n\tuseEffect(() => {\n\t\tif (typeof window !== \"undefined\" && window.DeviceOrientationEvent) {\n\t\t\tconst handleOrientation = (event: DeviceOrientationEvent) => {\n\t\t\t\tif (event.beta !== null) {\n\t\t\t\t\tlet newAngle = Math.abs(event.beta);\n\t\t\t\t\tif (event.gamma !== null) {\n\t\t\t\t\t\tnewAngle *= Math.cos((event.gamma * Math.PI) / 180);\n\t\t\t\t\t}\n\t\t\t\t\tnewAngle = Math.max(0, Math.min(180, newAngle));\n\t\t\t\t\tsetAngle(newAngle);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst requestPermission = async () => {\n\t\t\t\tconst DeviceOrientation = DeviceOrientationEvent as unknown as IOSDeviceOrientationEvent;\n\n\t\t\t\tif (DeviceOrientation && typeof DeviceOrientation.requestPermission === \"function\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst permission = await DeviceOrientation.requestPermission();\n\t\t\t\t\t\tif (permission === \"granted\") {\n\t\t\t\t\t\t\t// wrappedHandler = timeout(handleOrientation, 2000);\n\t\t\t\t\t\t\twindow.addEventListener(\"deviceorientation\", handleOrientation);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(\"Permission error\", e);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// wrappedHandler = handleOrientation;\n\t\t\t\t\twindow.addEventListener(\"deviceorientation\", handleOrientation);\n\t\t\t\t}\n\n\t\t\t\treturn () => {\n\t\t\t\t\tif (handleOrientation) {\n\t\t\t\t\t\twindow.removeEventListener(\"deviceorientation\", handleOrientation);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t\tdocument.addEventListener(\"click\", requestPermission, { once: true });\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tlastAnglesRef.current = [...lastAnglesRef.current.slice(-4), calibratedAngle];\n\n\t\tif (lastAnglesRef.current.length >= 5) {\n\t\t\tconst variation = Math.max(...lastAnglesRef.current) - Math.min(...lastAnglesRef.current);\n\t\t\tif (isInTargetRange && variation < 2) {\n\t\t\t\tsetStabilityScore((prev) => Math.min(100, prev + 10));\n\t\t\t} else {\n\t\t\t\tsetStabilityScore((prev) => Math.max(0, prev - 20));\n\t\t\t}\n\t\t}\n\n\t\tif (!isInTargetRange && (countdown !== null || isScanning)) {\n\t\t\tresetCountdown();\n\t\t}\n\t}, [calibratedAngle, isInTargetRange, countdown, isScanning]);\n\n\tuseEffect(() => {\n\t\tif (stabilityScore >= 100 && countdown === null && !isScanning) {\n\t\t\tstartCountdown();\n\t\t}\n\t\tif (stabilityScore < 50 && countdown !== null) {\n\t\t\tresetCountdown();\n\t\t}\n\t}, [stabilityScore, countdown, isScanning]);\n\n\tconst startCountdown = () => {\n\t\tsetCountdown(3);\n\t\tconst timer = setInterval(() => {\n\t\t\tsetCountdown((prev) => {\n\t\t\t\tif (prev === null || prev <= 1) {\n\t\t\t\t\tclearInterval(timer);\n\t\t\t\t\tsetIsScanning(true);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn prev - 1;\n\t\t\t});\n\t\t}, 1000);\n\t};\n\n\tconst resetCountdown = () => {\n\t\tsetCountdown(null);\n\t\tif (!isScanLocked) {\n\t\t\tsetIsScanning(false);\n\t\t}\n\t};\n\n\treturn (\n\t\t<LevelScreen angle={calibratedAngle} countdown={countdown} isScanning={isScanning} isInTargetRange={isInTargetRange} stabilityScore={stabilityScore} config={config}>\n\t\t\t{isScanning && (\n\t\t\t\t<ScanningComponent\n\t\t\t\t\tsetIsScanLocked={setIsScanLocked}\n\t\t\t\t\tresetDetector={resetDetector}\n\t\t\t\t\tscanID={scanID}\n\t\t\t\t\tuserDetails={userDetails}\n\t\t\t\t\tsetIsVideoUploaded={setIsVideoUploaded}\n\t\t\t\t\tsetScanFailsError={setScanFailsError}\n\t\t\t\t\tsetScanStartTime={setScanStartTime}\n\t\t\t\t\tsetScanUniqueKey={setScanUniqueKey}\n\t\t\t\t\tconfig={config}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</LevelScreen>\n\t);\n}\n","import React, { useContext } from \"react\";\nimport Dialog from \"@mui/material/Dialog\";\nimport { getBrowserName } from \"../utils/utils\";\nimport { LanguageContext } from \"../utils/context/languageContext\";\nimport { LanguageKeys } from \"../utils/constants\";\n\nfunction Modal({ message, config }: { message?: string; config?: any }) {\n\tconst [open] = React.useState(true);\n\tconst { translate } = useContext(LanguageContext) || {};\n\treturn (\n\t\t<Dialog\n\t\t\topen={open}\n\t\t\tclassName=\"confirm-modal\"\n\t\t>\n\t\t\t<div className=\"modal-main\">\n\t\t\t\t<div className=\"text-center\">\n\t\t\t\t\t{message ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: config?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\t\t\t\tfontSize: config?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\t\t\t\tcolor: config?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\t\t\t\tfontWeight: config?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tSeems camera already in use\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tclassName=\"mt-[0.5rem] text-sm\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t\tfontSize: config?.style?.base?.baseFontSize || \"16px\",\n\t\t\t\t\t\t\t\t\tcolor: config?.style?.base?.baseTextColor || \"#000\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tCan you try closing the browser/app that is using the camera and try again here.{\" \"}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: config?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\t\t\t\tfontSize: config?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\t\t\t\tcolor: config?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\t\t\t\tfontWeight: config?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{translate?.(LanguageKeys.Please_check_your_setting_for_camera_permission)}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tclassName=\"mt-[0.5rem] text-sm\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t\tfontSize: config?.style?.base?.baseFontSize || \"16px\",\n\t\t\t\t\t\t\t\t\tcolor: config?.style?.base?.baseTextColor || \"#000\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>{`${translate?.(LanguageKeys.Settings)} > ${getBrowserName()} > ${translate?.(LanguageKeys.Enable_the_camera_permissions)}`}</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Dialog>\n\t);\n}\n\nexport default Modal;\n","import { useEffect, useState, useRef, useCallback, Dispatch, SetStateAction } from \"react\";\nimport Webcam from \"react-webcam\";\nimport Modal from \"../Modal\";\nimport LoadingScreen from \"../LoadingScreen\";\nimport { checkCameraPermission } from \"../../utils/utils\";\nimport { videoConstraints } from \"../../utils/constants\";\n\n\nfunction CameraPermission({ setShowDrawer, config,loader }: { setShowDrawer?: Dispatch<SetStateAction<boolean>>; config?: any,loader?:string }) {\n\tconst [showDeniedModal, setShowDeniedModal] = useState({\n\t\tdisabled: false,\n\t\tmessage: \"\",\n\t});\n\tconst [loading, setLoading] = useState(true);\n\tconst webcamRef = useRef(null);\n\n\tconst handleCameraPermission = useCallback(async () => {\n\t\tconst permission = await checkCameraPermission();\n\t\tsetShowDeniedModal(permission);\n\t\tsetLoading(false);\n\t}, []);\n\n\tuseEffect(() => {\n\t\thandleCameraPermission();\n\t}, []);\n\n\tif (loading) {\n\t\treturn <LoadingScreen url={loader} />\n\t}\n\n\tif (showDeniedModal?.disabled) {\n\t\treturn <Modal config={config} message={showDeniedModal?.message} />;\n\t}\n\treturn (\n\t\t<Webcam\n\t\t\taudio={false}\n\t\t\tref={webcamRef}\n\t\t\tscreenshotQuality={1}\n\t\t\tvideoConstraints={videoConstraints}\n\t\t\tmirrored\n\t\t\tonUserMedia={() => setShowDrawer?.(true)}\n\t\t\tscreenshotFormat=\"image/jpeg\"\n\t\t\tstyle={{\n\t\t\t\tposition: \"relative\",\n\t\t\t\ttop: 0,\n\t\t\t\tbottom: 0,\n\t\t\t\tzIndex: 0,\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100%\",\n\t\t\t\tobjectFit: \"cover\",\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport default CameraPermission;\n","\nimport React, { useEffect, useRef } from \"react\";\nimport videojs from \"video.js\";\nimport type Player from \"video.js/dist/types/player\";\n// import \"video.js/dist/video-js.css\";\nimport { videoPoster } from \"../../utils/constants\";\n\nfunction VideoPlayer({ link, onReady, wrapperClassName = \"[&_video]:rounded-t-[20px] w-full h-full\" }: { link?: string; wrapperClassName?: string; onReady?: (args: Player) => void }) {\n\tconst videoReference = useRef<HTMLVideoElement | null>(null);\n\tconst playerReference = useRef<Player | null>(null);\n\n\tlet videoJsOptions: any = {\n\t\tautoplay: true,\n\t\tcontrols: false,\n\t\tresponsive: true,\n\t\tfluid: true,\n\t\tmuted: true,\n\t\tnavigationUI: \"hide\",\n\t\tpreload: \"metadata\",\n\t\tposter: videoPoster,\n\t};\n\n\tuseEffect(() => {\n\t\tif (!playerReference.current && link && videoReference?.current) {\n\t\t\tconst player = videojs(videoReference.current, {\n\t\t\t\t...videoJsOptions,\n\t\t\t});\n\t\t\tplayer.ready(() => {\n\t\t\t\tplayerReference.current = player;\n\n\t\t\t\tconst updatedOptions = {\n\t\t\t\t\t...videoJsOptions,\n\t\t\t\t\tsources: [{ src: link, type: \"application/x-mpegURL\" }],\n\t\t\t\t};\n\n\t\t\t\tplayer.autoplay(updatedOptions.autoplay);\n\t\t\t\tplayer.src(updatedOptions.sources);\n\n\t\t\t\tonReady?.(player);\n\t\t\t});\n\t\t}\n\t}, [link, videoReference]);\n\n\tuseEffect(() => {\n\t\tconst player = playerReference.current;\n\t\treturn () => {\n\t\t\tif (player && !player.isDisposed()) {\n\t\t\t\tplayer.dispose();\n\t\t\t\tplayerReference.current = null;\n\t\t\t}\n\t\t};\n\t}, [playerReference]);\n\n\treturn (\n\t\t<div className={wrapperClassName}>\n\t\t\t<video ref={videoReference} muted className=\"video-js\" playsInline onDrag={(e) => e.preventDefault()} />\n\t\t</div>\n\t);\n}\nexport default VideoPlayer;\n","import { useContext, useState } from \"react\";\nimport Dialog from \"@mui/material/Dialog\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport Header from \"../Header\";\nimport VideoPlayer from \"./VideoPlayer\";\nimport { LanguageContext } from \"../../utils/context/languageContext\";\nimport { ScanErrorMessageProps } from \"../../types/interfaces\";\nimport { generateUuid, handleErrorMessage } from \"../../utils/utils\";\nimport { GENDER, LanguageKeys, VIDEO_POSTER_GENDER_BASED } from \"../../utils/constants\";\nimport SpecificButton from \"../../atoms/specificButton/SpecificButton\";\n\n\nfunction ScanErrorMessage({ scanFailsError, serverAtCapacity = false, onNext, gender, setScanUniqueKey, resolvedConfig, setIsVideoUploaded }: ScanErrorMessageProps) {\n\tconst { translate } = useContext(LanguageContext) || {};\n\tconst [showModal, setShowModal] = useState(false);\n\n\tconst handleBtnClick = () => {\n\t\tif (onNext) {\n\t\t\tonNext?.();\n\t\t} else {\n\t\t\tsetScanUniqueKey(generateUuid());\n\t\t}\n\t\tsetIsVideoUploaded(false);\n\t};\n\n\tconst handleShowModal = () => {\n\t\tsetShowModal(!showModal);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"flex flex-col h-full max-w-[28rem] mx-auto w-full rounded-t-[20px] overflow-y-auto\" style={{ background: resolvedConfig?.style?.base?.backgroundColor }}>\n\t\t\t\t<div className=\"w-full max-w-[28rem] mx-auto pt-[1rem] px-[1rem]\">\n\t\t\t\t\t<Header noTitle resolvedConfig={resolvedConfig} />\n\t\t\t\t</div>\n\t\t\t\t<div className=\"flex-1\">\n\t\t\t\t\t{/* <VideoPlayer link={gender ? GENDER[gender].PRE_LINK : GENDER.male.PRE_LINK} /> */}\n\t\t\t\t\t{scanFailsError && (\n\t\t\t\t\t\t<div className=\"px-[1rem]\">\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tclassName=\"text-center\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\t\t\t\tfontSize: resolvedConfig?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\t\t\t\tcolor: resolvedConfig?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\t\t\t\tfontWeight: resolvedConfig?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tThere was an issue with your scan\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tReason:\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{handleErrorMessage(scanFailsError)}\n\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t<img className=\"my-[0.5rem] aspect-[2/1.4] w-full object-cover\" onClick={handleShowModal} src={VIDEO_POSTER_GENDER_BASED[gender]} alt=\"icon\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t{serverAtCapacity && (\n\t\t\t\t\t\t<div className=\"p-[1rem] text-center\">\n\t\t\t\t\t\t\t<h3\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\t\t\t\tfontSize: resolvedConfig?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\t\t\t\tcolor: resolvedConfig?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\t\t\t\tfontWeight: resolvedConfig?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{translate?.(LanguageKeys.Scan_s)} <span>{translate?.(LanguageKeys.vision_model)}</span> {translate?.(LanguageKeys.is_at_capacity)}\n\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tclassName=\"text-base mt-[0.5rem]\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{translate?.(LanguageKeys.We_are_sorry_about_this_We_are_working_hard_to_add_capacity_Please_try_again_soon)}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t{scanFailsError && (\n\t\t\t\t\t<div className=\"p-[1rem] flex gap-[0.5rem]\">\n\t\t\t\t\t\t<SpecificButton disabled={false} buttonText=\"Scan again\" className=\"!shadow-none\" buttonFunc={handleBtnClick} resolvedConfig={resolvedConfig} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{showModal && (\n\t\t\t\t<Dialog className=\"w-screen h-screen video-modal\" onClose={handleShowModal} open={showModal}>\n\t\t\t\t\t<div className=\"flex justifyEnd \">\n\t\t\t\t\t\t<span className=\"closeBtn\" onClick={handleShowModal}>\n\t\t\t\t\t\t\t<CloseIcon className=\"absolute right-[8px] top-[8px] text-white z-[9]\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"aspect-video object-cover rounded-[20px] \">\n\t\t\t\t\t\t<VideoPlayer link={gender ? GENDER[gender].PRE_LINK : GENDER.male.PRE_LINK} wrapperClassName=\"w-screen h-screen fixed top-[0] left-[0]\" />\n\t\t\t\t\t</div>\n\t\t\t\t</Dialog>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default ScanErrorMessage;\n","import { useCallback, useEffect, useState } from \"react\";\nimport Box from \"@mui/material/Box\";\nimport { posthog } from \"posthog-js\";\nimport Header from \"./Header\";\nimport { Drawer } from \"@mui/material\";\nimport CameraPermission from \"./bodyScan/CameraPermission\";\nimport { UserDetails } from \"../types/interfaces\";\nimport { CLOTHING_BANNER_SCAN, CLOTHING_CUSTOM_FIT_SCAN, CLOTHING_CUSTOM_SCAN, maleMeasurementProgress, measurementProgress } from \"../utils/constants\";\nimport swan from \"../utils/service/swanService\";\nimport { GenderType } from \"../utils/enums\";\nimport SpecificButton from \"../atoms/specificButton/SpecificButton\";\n\nfunction SignUp({\n\tscanId,\n\tuserDetails,\n\tconfig,\n\tisFaceScan,\n\tisVideoUploadedCorrect,\n\tisMeasurementAvailable,\n\tonComplete,\n\tisSuccess,\n}: {\n\tconfig?: any;\n\tisFaceScan: boolean;\n\tscanId: string;\n\tisVideoUploadedCorrect?: boolean;\n\tisMeasurementAvailable?: boolean;\n\tuserDetails: UserDetails;\n\tonComplete?: () => void;\n\tisSuccess?: boolean;\n}) {\n\tconst { gender, shopDomain, heightInCm, deviceFocalLength, userName, email, scanType } = userDetails;\n\tconst isCustom = [CLOTHING_CUSTOM_SCAN, CLOTHING_BANNER_SCAN, CLOTHING_CUSTOM_FIT_SCAN].includes(scanType);\n\tconst [showDrawer, setShowDrawer] = useState(true);\n\tconst handlePostHogEvent = () => {\n\t\tposthog.capture(shopDomain, {\n\t\t\tscanID: scanId,\n\t\t\temail: email,\n\t\t\theight: heightInCm,\n\t\t\tfocalLength: deviceFocalLength,\n\t\t\tclothesFit: \"0\",\n\t\t\tgender: gender,\n\t\t});\n\t};\n\n\tconst handleSignUp = useCallback(async () => {\n\t\ttry {\n\t\t\tif (isCustom) {\n\t\t\t\tawait swan.auth.addUser({\n\t\t\t\t\tscanId,\n\t\t\t\t\temail,\n\t\t\t\t\tname: userName,\n\t\t\t\t\tgender,\n\t\t\t\t\theight: heightInCm,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlePostHogEvent();\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}, [isCustom]);\n\n\tuseEffect(() => {\n\t\tif (isVideoUploadedCorrect) {\n\t\t\thandleSignUp();\n\t\t}\n\t}, [isVideoUploadedCorrect]);\n\n\tconst showNextButton = isSuccess || (isFaceScan ? isMeasurementAvailable && isVideoUploadedCorrect : isVideoUploadedCorrect || isMeasurementAvailable);\n\n\treturn (\n\t\t<Box className=\"flex h-full w-full flex-col \">\n\t\t\t<div className=\"h-full w-full flex-col items-center justify-center flex\">\n\t\t\t\t<CameraPermission loader={config?.loader} setShowDrawer={setShowDrawer} />\n\t\t\t\t<Drawer\n\t\t\t\t\topen={showDrawer}\n\t\t\t\t\tonClose={(_, reason) => {\n\t\t\t\t\t\tif (reason === \"backdropClick\") {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tclassName=\"camera-drawer\"\n\t\t\t\t\tanchor=\"bottom\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"max-w-[28rem] mx-auto w-full h-full flex text-center flex-col justify-between items-center bg-primary rounded-t-[30px] p-[1rem]\"\n\t\t\t\t\t\tstyle={{ background: config?.style?.base?.backgroundColor }}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"w-full h-full flex flex-col\">\n\t\t\t\t\t\t\t<Header title=\"Your measurements are being taken\" resolvedConfig={config} />\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-center flex-1\">\n\t\t\t\t\t\t\t\t<video className=\"max-h-[calc(100vh-450px)] mx-auto w-full object-contain border-none\" muted loop autoPlay playsInline>\n\t\t\t\t\t\t\t\t\t<source src={gender === GenderType.Male ? maleMeasurementProgress : measurementProgress} type=\"video/mp4\" />\n\t\t\t\t\t\t\t\t</video>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{showNextButton && <SpecificButton resolvedConfig={config} className=\"!w-[180px] mx-auto\" buttonText=\"Next\" buttonFunc={onComplete && onComplete} />}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</Drawer>\n\t\t\t</div>\n\t\t</Box>\n\t);\n}\nexport default SignUp;\n","\"use client\"\nimport { useCallback, useContext, useEffect, useState } from \"react\";\nimport AngleDetector from \"./AngleDetector\";\nimport CameraPermission from \"./CameraPermission\";\nimport Modal from \"../Modal\";\nimport { Drawer } from \"@mui/material\";\nimport ScanErrorMessage from \"./ScanErrorMessage\";\nimport LoadingScreen from \"../LoadingScreen\";\nimport SignUp from \"../Signup\";\nimport posthog from \"posthog-js\";\nimport { BodyScanProps } from \"../../bodyScan\";\nimport { PreferredLanguage } from \"../../utils/enums\";\nimport useGyroSensor from \"../../customHooks/useGyroSensor\";\nimport { checkCameraPermission, createObjectMetadataArray, generateUuid, getCurrentTimeInSeconds, handleErrorMessage, handleScanTimeCapture, handleWebSocketCapture } from \"../../utils/utils\";\nimport LanguageContextProvider, { LanguageContext } from \"../../utils/context/languageContext\";\nimport { useLocalConfig } from \"../../config/useLocalConfig\";\nimport swan from \"../../utils/service/swanService\";\nimport { posthogPublicHost, posthogPublicKey } from \"../../utils/constants\";\nimport ParamsContext from \"../../utils/context/paramsContext\";\nimport MediaContextProvider from \"../../utils/context/mediaContext\";\n\n\nconst clothesFit = \"0\";\n\nexport const BodyScan: React.FC<BodyScanProps> = ({ userDetails, language=PreferredLanguage.English, config, onRetry, onScanSuccess, onComplete, onScanError,isError,isSuccess }) => {\n\t\n\tconst { gender, scanType, shopDomain, heightInCm, email, deviceFocalLength, deviceModelName, callbackUrl } = userDetails;\n\tconst [uploadLoading, setUploadLoading] = useState(false);\n\tconst [isVideoUploadedCorrect, setIsVideoUploadedCorrect] = useState(false);\n\tconst [isMeasurementAvailable, setIsMeasurementAvailable] = useState(false);\n\tconst [showDeniedModal, setShowDeniedModal] = useState({\n\t\tdisabled: false,\n\t\tmessage: \"\",\n\t});\n\tconst [scanFailsError, setScanFailsError] = useState(\"\");\n\tconst [isVideoUploaded, setIsVideoUploaded] = useState(false);\n\tconst [loading, setLoading] = useState(true);\n\tconst [startGyro, setStartGyro] = useState(false);\n\tconst [scanUniqueKey, setScanUniqueKey] = useState(\"\");\n\tconst [scanStartTime, setScanStartTime] = useState<number | null>(getCurrentTimeInSeconds());\n\tconst { gyroData } = useGyroSensor(startGyro);\n\tconst { setPreferredLanguage } = useContext(LanguageContext) || {};\n\tconst resolvedConfig = useLocalConfig(config);\n\n\tconst handleShowStreamCamera = useCallback(() => {\n\t\tsetScanUniqueKey(generateUuid());\n\t\tsetScanFailsError(\"\");\n\t\tsetUploadLoading(false);\n\t\tsetIsVideoUploaded(false);\n\t}, []);\n\n\tconst onError = (data: any) => {\n\t\tonScanError({ ...data, message: handleErrorMessage(data) });\n\t\tclearScanStartTimeAndScanId();\n\t\tsetIsMeasurementAvailable(false);\n\t\tsetScanFailsError(data);\n\t\tsetIsVideoUploadedCorrect(false);\n\t\thandleScanTimeCapture({\n\t\t\teventName: `${shopDomain}/measurement_failed/fit-view`,\n\t\t\tscanID: scanUniqueKey,\n\t\t\tstatus: \"failed\",\n\t\t\temail,\n\t\t\tmessage: handleErrorMessage(data),\n\t\t});\n\t\tif (scanStartTime)\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/scan_completion_time`,\n\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\tcompletionTime: getCurrentTimeInSeconds() - scanStartTime,\n\t\t\t\temail,\n\t\t\t});\n\t};\n\n\tconst clearScanStartTimeAndScanId = () => {\n\t\tsetScanStartTime(null);\n\t\tsetScanUniqueKey(\"\");\n\t};\n\n\tconst onSuccess = useCallback(\n\t\tasync (data: any) => {\n\t\t\tif (data && data?.scanStatus === \"success\" && data?.resultType === \"intermediate\" && data?.code === 200) {\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: `${shopDomain}/measurement_success/intermediate`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t\tonScanSuccess?.(data);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tclearScanStartTimeAndScanId();\n\t\t\tconst scanIdToSet = scanUniqueKey;\n\t\t\tsetIsMeasurementAvailable(true);\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/measurement_success/fit-view`,\n\t\t\t\tscanID: scanIdToSet,\n\t\t\t\tstatus: \"success\",\n\t\t\t\temail,\n\t\t\t});\n\t\t\tif (scanStartTime)\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: `${shopDomain}/scan_completion_time`,\n\t\t\t\t\tscanID: scanIdToSet,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\tcompletionTime: getCurrentTimeInSeconds() - scanStartTime,\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t},\n\t\t[scanType, shopDomain, scanUniqueKey],\n\t);\n\n\tconst handleMeasurementRecommendation = (scanId?: string) => {\n\t\tsetIsMeasurementAvailable(false);\n\t\tsetScanFailsError(\"\");\n\t\tsetIsVideoUploadedCorrect(false);\n\t\tswan.measurement.handleMeasurementSocket({\n\t\t\tscanId: scanId || scanUniqueKey,\n\t\t\tonOpen: () => {\n\t\t\t\thandleWebSocketCapture({\n\t\t\t\t\teventName: `${shopDomain}/webSocket`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tconnection: \"open\",\n\t\t\t\t\ttype: \"measurement_recommendation\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t},\n\t\t\tonClose: () =>\n\t\t\t\thandleWebSocketCapture({\n\t\t\t\t\teventName: `${shopDomain}/webSocket`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tconnection: \"close\",\n\t\t\t\t\ttype: \"measurement_recommendation\",\n\t\t\t\t\temail,\n\t\t\t\t}),\n\t\t\tonError: (err) => {\n\t\t\t\tonError(err);\n\t\t\t\thandleWebSocketCapture({\n\t\t\t\t\teventName: `${shopDomain}/webSocket`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tconnection: \"error\",\n\t\t\t\t\ttype: \"measurement_recommendation\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t},\n\t\t\tonSuccess: (data) => {\n\t\t\t\thandleWebSocketCapture({\n\t\t\t\t\teventName: `${shopDomain}/webSocket`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tconnection: \"success\",\n\t\t\t\t\ttype: \"measurement_recommendation\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t\tonSuccess(data);\n\t\t\t},\n\t\t});\n\t};\n\n\tconst handleFileUpload = useCallback(\n\t\tasync (file: File) => {\n\t\t\tconst arrayMetaData = createObjectMetadataArray({\n\t\t\t\tgender,\n\t\t\t\tfocal_length: `${deviceFocalLength}`,\n\t\t\t\theight: `${heightInCm}`,\n\t\t\t\tcustomer_store_url: shopDomain,\n\t\t\t\tclothes_fit: clothesFit,\n\t\t\t\tscan_type: scanType,\n\t\t\t\tcallback_url: callbackUrl || \"https://example.com/webhook\",\n\t\t\t});\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/body_scan_meta_data`,\n\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\temail,\n\t\t\t\tdata: JSON.stringify(arrayMetaData),\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tawait swan.fileUpload.uploadFileFrontend({\n\t\t\t\t\tfile,\n\t\t\t\t\tarrayMetaData,\n\t\t\t\t\tscanId: scanUniqueKey,\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t\tawait swan.fileUpload.setDeviceInfo({\n\t\t\t\t\tmodel: deviceModelName,\n\t\t\t\t\tdetection: \"manual\",\n\t\t\t\t\tgyro: gyroData,\n\t\t\t\t\tscanId: scanUniqueKey,\n\t\t\t\t});\n\t\t\t\tconsole.log(\"video successfully uploaded\");\n\t\t\t\tsetIsVideoUploaded(false);\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: `${shopDomain}/scan_success`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\temail,\n\t\t\t\t\tdata: JSON.stringify(arrayMetaData),\n\t\t\t\t});\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: \"scan finished\",\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t\tsetScanStartTime(getCurrentTimeInSeconds());\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsVideoUploaded(true);\n\t\t\t\t}, 3000);\n\t\t\t} catch (error) {\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: \"scan finished\",\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\temail,\n\t\t\t\t\tmessage: handleErrorMessage(error),\n\t\t\t\t});\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: `${shopDomain}/scan_failed`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\temail,\n\t\t\t\t\tmessage: handleErrorMessage(error),\n\t\t\t\t\tdata: JSON.stringify(arrayMetaData),\n\t\t\t\t});\n\t\t\t\tsetScanFailsError(handleErrorMessage(error));\n\t\t\t\tsetIsVideoUploaded(false);\n\t\t\t\tconsole.log(error, \"video upload failed\");\n\t\t\t} finally {\n\t\t\t\tsetStartGyro(false);\n\t\t\t}\n\t\t},\n\t\t[scanUniqueKey, gyroData],\n\t);\n\tconst checkMeasurementStatus = useCallback(\n\t\tasync (scanId: string) => {\n\t\t\ttry {\n\t\t\t\tconst res = await swan.measurement.getMeasurementResult(scanId);\n\t\t\t\tconst isMeasured = res?.data?.isMeasured;\n\t\t\t\tconst tempScanStartTime = scanStartTime || getCurrentTimeInSeconds();\n\t\t\t\tconst currentTimeInSeconds = getCurrentTimeInSeconds();\n\t\t\t\tconst fiveMinutesInSeconds = 5 * 60;\n\t\t\t\tsetLoading(false);\n\t\t\t\tif (isMeasured === false) {\n\t\t\t\t\tclearScanStartTimeAndScanId();\n\t\t\t\t\tsetScanUniqueKey(generateUuid());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsetUploadLoading(true);\n\t\t\t\tif (isMeasured === true) {\n\t\t\t\t\tawait onSuccess(null);\n\t\t\t\t} else if (isMeasured === null && tempScanStartTime > currentTimeInSeconds + fiveMinutesInSeconds) {\n\t\t\t\t\tonError(res?.data?.error);\n\t\t\t\t} else {\n\t\t\t\t\thandleMeasurementRecommendation(scanId);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t\tclearScanStartTimeAndScanId();\n\t\t\t\tsetScanUniqueKey(generateUuid());\n\t\t\t\tsetUploadLoading(false);\n\t\t\t}\n\t\t},\n\t\t[onError, onSuccess, setScanUniqueKey],\n\t);\n\n\tconst handleCameraPermission = useCallback(async () => {\n\t\tif (+heightInCm < 152.4 || +heightInCm > 213.36) {\n\t\t\tonScanError({ message: \"Height must be between 152.4cm (5ft) and 213.36cm (7ft)\" });\n\t\t\treturn;\n\t\t}\n\n\t\tconst permission = await checkCameraPermission();\n\t\tif (permission.disabled) {\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/camera_activation`,\n\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\temail,\n\t\t\t});\n\t\t\tsetLoading(false);\n\t\t} else {\n\t\t\tconst scanId = scanUniqueKey;\n\t\t\tif (scanId) {\n\t\t\t\tcheckMeasurementStatus(scanId);\n\t\t\t} else {\n\t\t\t\tsetLoading(false);\n\t\t\t}\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/camera_activation`,\n\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\tstatus: \"success\",\n\t\t\t\temail,\n\t\t\t});\n\t\t}\n\t\tsetShowDeniedModal(permission);\n\t\tsetScanFailsError(\"\");\n\t\tsetIsVideoUploaded(false);\n\t}, [checkMeasurementStatus, email, scanUniqueKey, setScanUniqueKey, shopDomain]);\n\n\tuseEffect(() => {\n\t\tsetPreferredLanguage?.(language);\n\t\tposthog.init(posthogPublicKey, { api_host: posthogPublicHost });\n\t\tposthog.capture(\"$pageview\");\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (isError || isSuccess) return;\n\t\tif (shopDomain) {\n\t\t\thandleCameraPermission();\n\t\t}\n\t}, [shopDomain, heightInCm, isError, isSuccess]);\n\n\tuseEffect(() => {\n\t\tif (isError || isSuccess) return;\n\t\tif (isVideoUploaded && shopDomain && scanUniqueKey) {\n\t\t\thandleMeasurementRecommendation();\n\t\t}\n\t}, [isVideoUploaded, shopDomain, scanUniqueKey, isError, isSuccess]);\n\n\tif (isError) {\n\t\treturn (\n\t\t\t<LanguageContextProvider>\n\t\t\t\t<CameraPermission />\n\t\t\t\t<Drawer\n\t\t\t\t\tanchor=\"bottom\"\n\t\t\t\t\topen={true}\n\t\t\t\t\tclassName=\"camera-drawer\"\n\t\t\t\t\tonClose={(event, reason) => {\n\t\t\t\t\t\tif (reason === \"backdropClick\") {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<ScanErrorMessage\n\t\t\t\t\t\tscanFailsError={scanFailsError}\n\t\t\t\t\t\tonNext={() => {\n\t\t\t\t\t\t\t// onRetry?.();\n\t\t\t\t\t\t\t// handleShowStreamCamera();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsetScanUniqueKey={setScanUniqueKey}\n\t\t\t\t\t\tgender={gender}\n\t\t\t\t\t\tresolvedConfig={resolvedConfig}\n\t\t\t\t\t\tsetIsVideoUploaded={setIsVideoUploaded}\n\t\t\t\t\t/>\n\t\t\t\t</Drawer>\n\t\t\t</LanguageContextProvider>\n\t\t);\n\t}\n\n\tif (isSuccess) {\n\t\treturn (\n\t\t\t<SignUp\n\t\t\t\tisFaceScan={false}\n\t\t\t\tscanId={scanUniqueKey}\n\t\t\t\tisMeasurementAvailable={isMeasurementAvailable}\n\t\t\t\tuserDetails={userDetails}\n\t\t\t\t// onComplete={onComplete}\n\t\t\t\tisVideoUploadedCorrect={isVideoUploadedCorrect}\n\t\t\t\tconfig={resolvedConfig}\n\t\t\t\tisSuccess={isSuccess}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div className=\"flex top-0 !mt-0 left-0 z-[999] bg-opacity-80 bg-[#1b1b1b] absolute justify-center items-center w-full h-full\">\n\t\t\t\t<LoadingScreen url={resolvedConfig?.loader} />\n\t\t\t</div>\n\t\t);\n\t}\n\tif (showDeniedModal.disabled) {\n\t\treturn (\n\t\t\t<LanguageContextProvider>\n\t\t\t\t<Modal />\n\t\t\t</LanguageContextProvider>\n\t\t);\n\t}\n\n\tif (!uploadLoading && !scanFailsError) {\n\t\treturn (\n\t\t\t<ParamsContext.Provider value={{ setStartGyro, handleFileUpload, setUploadLoading }}>\n\t\t\t\t<MediaContextProvider>\n\t\t\t\t\t<LanguageContextProvider>\n\t\t\t\t\t\t<AngleDetector\n\t\t\t\t\t\t\tconfig={resolvedConfig}\n\t\t\t\t\t\t\tscanID={scanUniqueKey}\n\t\t\t\t\t\t\tuserDetails={userDetails}\n\t\t\t\t\t\t\tsetIsVideoUploaded={setIsVideoUploaded}\n\t\t\t\t\t\t\tsetScanFailsError={setScanFailsError}\n\t\t\t\t\t\t\tsetScanStartTime={setScanStartTime}\n\t\t\t\t\t\t\tsetScanUniqueKey={setScanUniqueKey}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</LanguageContextProvider>\n\t\t\t\t</MediaContextProvider>\n\t\t\t</ParamsContext.Provider>\n\t\t);\n\t}\n\tif ((uploadLoading || isMeasurementAvailable) && !scanFailsError) {\n\t\treturn (\n\t\t\t<SignUp\n\t\t\t\tisFaceScan={false}\n\t\t\t\tscanId={scanUniqueKey}\n\t\t\t\tisMeasurementAvailable={isMeasurementAvailable}\n\t\t\t\tuserDetails={userDetails}\n\t\t\t\tonComplete={onComplete}\n\t\t\t\tisVideoUploadedCorrect={isVideoUploadedCorrect}\n\t\t\t\tconfig={resolvedConfig}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<LanguageContextProvider>\n\t\t\t<CameraPermission />\n\t\t\t<Drawer\n\t\t\t\tanchor=\"bottom\"\n\t\t\t\topen={true}\n\t\t\t\tclassName=\"camera-drawer\"\n\t\t\t\tonClose={(event, reason) => {\n\t\t\t\t\tif (reason === \"backdropClick\") {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<ScanErrorMessage\n\t\t\t\t\tscanFailsError={scanFailsError}\n\t\t\t\t\tonNext={() => {\n\t\t\t\t\t\tonRetry?.();\n\t\t\t\t\t\thandleShowStreamCamera();\n\t\t\t\t\t}}\n\t\t\t\t\tsetScanUniqueKey={setScanUniqueKey}\n\t\t\t\t\tgender={gender}\n\t\t\t\t\tresolvedConfig={resolvedConfig}\n\t\t\t\t\tsetIsVideoUploaded={setIsVideoUploaded}\n\t\t\t\t/>\n\t\t\t</Drawer>\n\t\t</LanguageContextProvider>\n\t);\n};\n","import { useCallback, useEffect, useState } from \"react\";\n\ninterface GyroDataItem {\n alpha?: string;\n beta?: string;\n gamma?: string;\n timestamp?: string;\n}\n\nexport interface IOSDeviceOrientationEvent extends DeviceOrientationEvent {\n requestPermission?: () => Promise<PermissionState>;\n}\n\nfunction useGyroSensor(startGyro: boolean) {\n const [gyroData, setGyroData] = useState<GyroDataItem[]>([]);\n const [permissionGranted, setPermissionGranted] = useState(false);\n\n const handleOrientation = useCallback((event: DeviceOrientationEvent) => {\n try {\n const { alpha, beta, gamma } = event;\n setGyroData((prev: GyroDataItem[]) => [\n ...prev,\n {\n alpha: alpha?.toString() || undefined,\n beta: beta?.toString() || undefined,\n gamma: gamma?.toString() || undefined,\n timestamp: new Date().toISOString(),\n },\n ]);\n } catch (error) {\n console.log(error);\n }\n }, []);\n\n const requestPermission = useCallback(async () => {\n const DeviceOrientation =\n DeviceOrientationEvent as unknown as IOSDeviceOrientationEvent;\n\n if (\n typeof DeviceOrientation !== \"undefined\" &&\n typeof DeviceOrientation.requestPermission === \"function\"\n ) {\n try {\n const response = await DeviceOrientation.requestPermission();\n if (response === \"granted\") {\n setPermissionGranted(true);\n } else {\n console.warn(\"Device orientation permission denied.\");\n }\n } catch (error) {\n console.error(\"Error requesting device orientation permission:\", error);\n }\n } else {\n // Permission not required on non-iOS devices\n setPermissionGranted(true);\n }\n }, []);\n\n useEffect(() => {\n if (startGyro && permissionGranted) {\n window.addEventListener(\"deviceorientation\", handleOrientation);\n } else {\n setGyroData([]);\n }\n return () => {\n window.removeEventListener(\"deviceorientation\", handleOrientation);\n };\n }, [startGyro, permissionGranted, handleOrientation]);\n\n useEffect(() => {\n if (startGyro) {\n requestPermission();\n }\n }, [startGyro, requestPermission]);\n\n return { gyroData };\n}\n\nexport default useGyroSensor;\n"],"names":["extendSxProp","props","sx","inSx","other","systemProps","otherProps","result","config","theme","unstable_sxConfig","defaultSxConfig","Object","keys","forEach","prop","splitProps","finalSx","Array","isArray","args","isPlainObject","boxClasses","generateUtilityClasses","defaultTheme","createTheme","Box","options","themeId","defaultClassName","generateClassName","BoxRoot","styled","shouldForwardProp","styleFunctionSx","React","forwardRef","inProps","ref","useTheme","className","component","_jsx","as","clsx","createBox","THEME_ID","root","ClassNameGenerator","generate","getDialogUtilityClass","slot","generateUtilityClass","process","env","NODE_ENV","propTypes","children","PropTypes","node","elementType","oneOfType","arrayOf","func","object","bool","dialogClasses","DialogContext","createContext","displayName","DialogBackdrop","Backdrop","name","overrides","styles","backdrop","zIndex","DialogRoot","Modal","position","DialogContainer","overridesResolver","ownerState","container","capitalize","scroll","height","outline","variants","style","display","justifyContent","alignItems","overflowY","overflowX","textAlign","content","verticalAlign","width","DialogPaper","Paper","paper","String","maxWidth","fullWidth","paperFullWidth","fullScreen","paperFullScreen","memoTheme","margin","boxShadow","flexDirection","maxHeight","breakpoints","unit","Math","max","values","xs","paperScrollBody","down","filter","map","borderRadius","Dialog","useDefaultProps","defaultTransitionDuration","enter","transitions","duration","enteringScreen","exit","leavingScreen","ariaDescribedby","ariaLabelledbyProp","ariaModal","BackdropComponent","BackdropProps","disableEscapeKeyDown","onClick","onClose","open","PaperComponent","PaperProps","slots","slotProps","TransitionComponent","Fade","transitionDuration","TransitionProps","classes","composeClasses","useUtilityClasses","backdropClick","useRef","ariaLabelledby","useId","dialogContextValue","useMemo","titleId","externalForwardedProps","transition","RootSlot","rootSlotProps","useSlot","shouldForwardComponentProp","BackdropSlot","backdropSlotProps","PaperSlot","paperSlotProps","ContainerSlot","containerSlotProps","TransitionSlot","transitionSlotProps","additionalProps","appear","in","timeout","role","closeAfterTransition","event","current","onMouseDown","target","currentTarget","elevation","Provider","value","string","oneOf","isRequired","shape","number","SwitchIcon$1","memo","size","_jsxs","viewBox","fill","xmlns","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","LevelScreen$1","angle","countdown","isScanning","isInTargetRange","stabilityScore","getProximityToTarget","useCallback","min","backgroundColor","base","brandColor","proximity","round","handelTextColour","isLight","getTextColor","cd","fixVh","document","documentElement","setProperty","window","innerHeight","addEventListener","Header","noTitle","resolvedConfig","fontFamily","baseFontFamily","cn","transform","SwitchIcon","factory","__WEBPACK_EXTERNAL_MODULE_react__","modules","installedModules","__webpack_require__","moduleId","exports","module","i","l","call","m","c","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","t","mode","__esModule","ns","create","key","bind","n","property","prototype","hasOwnProperty","p","s","__webpack_exports__","extendStatics","react__WEBPACK_IMPORTED_MODULE_0__","__extends","b","setPrototypeOf","__proto__","__","this","constructor","__assign","assign","arguments","length","apply","hasGetUserMedia","navigator","mediaDevices","getUserMedia","undefined","constraints","webkitGetUserMedia","mozGetUserMedia","msGetUserMedia","Promise","resolve","reject","Error","Webcam","_super","_this","canvas","ctx","requestUserMediaId","unmounted","state","hasUserMedia","componentDidMount","requestUserMedia","console","warn","onUserMediaError","componentDidUpdate","nextProps","audioConstraintsChanged","JSON","stringify","audioConstraints","videoConstraintsChanged","videoConstraints","minScreenshotWidthChanged","minScreenshotWidth","minScreenshotHeightChanged","minScreenshotHeight","stopAndCleanup","componentWillUnmount","stopMediaStream","stream","getVideoTracks","getAudioTracks","track","removeTrack","stop","src","URL","revokeObjectURL","getScreenshot","screenshotDimensions","getCanvas","toDataURL","screenshotFormat","screenshotQuality","video","videoHeight","canvasWidth","videoWidth","canvasHeight","forceScreenshotSourceSize","aspectRatio","clientWidth","createElement","getContext","mirrored","translate","scale","imageSmoothingEnabled","imageSmoothing","drawImage","sourceSelected","audio","myRequestUserMediaId","then","handleUserMedia","catch","e","optionalSource_1","id","optional","sourceId","constraintToSourceId_1","constraint","deviceId","ideal","MediaStreamTrack","getSources","sources","audioSource","videoSource","source","kind","audioSourceId","videoSourceId","err","setState","srcObject","error","createObjectURL","onUserMedia","render","disablePictureInPicture","_b","rest","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__rest","videoStyle","childrenProps","autoPlay","muted","playsInline","defaultProps","react","require$$0","CloseIcon","createSvgIcon","MEDIA_TYPES","MediaContext","MediaContextProvider","setSize","useState","innerWidth","clearInputs","setClearInputs","updateSize","useEffect","useLayoutEffect","removeEventListener","media","mediaDetails","dictionaries","PreferredLanguage","English","Hindi","French","German","Spanish","Arabic","Italian","LanguageContext","LanguageContextProvider","preferredLanguage","setPreferredLanguage","text","CameraScanChild","handleShowStreamCamera","loadingCam","handlePause","pause","recordingStarted","startSendingVideoFrames","showPause","webcamRef","resetDetector","useContext","top","bottom","objectFit","SpecificButton","prefix","pauseIcon","buttonText","buttonFunc","btnSecondary","LanguageKeys","Start_Scan","disabled","crossOrigin","preload","voiceOverAssetsPath","useTensorFlow","consecutiveFronts","setConsecutiveFronts","spinPhase","setSpinPhase","spinPhaseRef","consecutiveFrontsRef","detectorRef","mounted","poseDetectionLib","isFrontFrame","body","loadPoseDetector","async","lib","import","loadPoseLib","createDetector","SupportedModels","BlazePose","runtime","modelType","solutionPath","TENSORFLOW_SOLUTION_PATH","dispose","disposeModelAndTf","poseDetector","callback","poses","estimatePoses","flipHorizontal","keypoints","slice","kp","x","y","score","prev","ParamsContext","audioTimeoutId","lastVideoPlayed","ScanningComponent$1","setIsScanLocked","scanID","setIsVideoUploaded","setScanFailsError","setScanStartTime","setScanUniqueKey","userDetails","gender","heightInCm","email","shopDomain","mediaRecorderRef","recordedChunks","setRecordedChunks","setLoadingCam","setRecordingStarted","faceDone","setFaceDone","mediaRecorderStopped","setMediaRecorderStopped","setIsScanning","captureVideoTimeOutHandle","setAudioSource","audioSourceList","setAudioSourceList","emptyAudioSource","setEmptyAudioSource","startAgain","setStartAgain","showRestart","setRestart","setPause","events","setEvents","setShowPause","allowAudioToPlay","firstScan","poseStoppedRef","counter","setStartGyro","handleFileUpload","setUploadLoading","clearTimeout","generateUuid","speechService","stopAudio","el","setTimeout","handleReScan","rescanSupportCaptureEvent","eventName","status","swan","poseDetection","disconnect","supportedTypes","videoTypes","type","MediaRecorder","isTypeSupported","stopRecording","playAudio","handleSocket","connect","posthog","capture","log","handleSpinDataAvailable","data","concat","handleScanTimeCapture","message","handleStartCaptureClick","mediaRecorderOptions","mimeType","start","postPoseProcess","handleDataAvailable","connected","poseStatus","querySelector","sid","paused","audioName","no_of_times_skipped","skipCount","videoEmit","image","scanId","getCurrentTimeInSeconds","push","bypassChecksToBackup","videoFile","File","AngleDetector","setAngle","calibrationOffset","setCalibrationOffset","setCountdown","setStabilityScore","lastAnglesRef","isScanLocked","calibratedAngle","DeviceOrientationEvent","handleOrientation","beta","newAngle","abs","gamma","cos","PI","requestPermission","DeviceOrientation","once","variation","resetCountdown","startCountdown","timer","setInterval","clearInterval","LevelScreen","ScanningComponent","_Fragment","heading","headingFontFamily","fontSize","headingFontSize","color","headingColor","fontWeight","headingFontWeight","baseFontSize","baseTextColor","Please_check_your_setting_for_camera_permission","Settings","getBrowserName","Enable_the_camera_permissions","CameraPermission","setShowDrawer","loader","showDeniedModal","setShowDeniedModal","loading","setLoading","handleCameraPermission","permission","checkCameraPermission","LoadingScreen","url","VideoPlayer","link","onReady","wrapperClassName","videoReference","playerReference","videoJsOptions","autoplay","controls","responsive","fluid","navigationUI","poster","videoPoster","player","videojs","ready","updatedOptions","isDisposed","onDrag","preventDefault","ScanErrorMessage","scanFailsError","serverAtCapacity","onNext","showModal","setShowModal","handleShowModal","background","handleErrorMessage","VIDEO_POSTER_GENDER_BASED","alt","Scan_s","vision_model","is_at_capacity","We_are_sorry_about_this_We_are_working_hard_to_add_capacity_Please_try_again_soon","GENDER","PRE_LINK","male","SignUp","isFaceScan","isVideoUploadedCorrect","isMeasurementAvailable","onComplete","isSuccess","deviceFocalLength","userName","scanType","isCustom","CLOTHING_CUSTOM_SCAN","CLOTHING_BANNER_SCAN","CLOTHING_CUSTOM_FIT_SCAN","includes","showDrawer","handleSignUp","auth","addUser","focalLength","clothesFit","showNextButton","Drawer","_","reason","anchor","title","loop","GenderType","Male","maleMeasurementProgress","measurementProgress","language","onRetry","onScanSuccess","onScanError","isError","deviceModelName","callbackUrl","uploadLoading","setIsVideoUploadedCorrect","setIsMeasurementAvailable","isVideoUploaded","startGyro","scanUniqueKey","scanStartTime","gyroData","setGyroData","permissionGranted","setPermissionGranted","alpha","toString","timestamp","Date","toISOString","useGyroSensor","useLocalConfig","onError","clearScanStartTimeAndScanId","completionTime","onSuccess","scanStatus","resultType","code","scanIdToSet","handleMeasurementRecommendation","measurement","handleMeasurementSocket","onOpen","handleWebSocketCapture","connection","file","arrayMetaData","createObjectMetadataArray","focal_length","customer_store_url","clothes_fit","scan_type","callback_url","fileUpload","uploadFileFrontend","setDeviceInfo","model","detection","gyro","checkMeasurementStatus","res","getMeasurementResult","isMeasured","tempScanStartTime","currentTimeInSeconds","fiveMinutesInSeconds","init","posthogPublicKey","api_host","posthogPublicHost"],"mappings":"8eAiBe,SAASA,EAAaC,GACnC,MACEC,GAAIC,KACDC,GACDH,GACEI,YACJA,EAAWC,WACXA,GAtBeL,KACjB,MAAMM,EAAS,CACbF,YAAa,CAAA,EACbC,WAAY,CAAA,GAERE,EAASP,GAAOQ,OAAOC,mBAAqBC,EAAAA,gBAQlD,OAPAC,OAAOC,KAAKZ,GAAOa,QAAQC,IACrBP,EAAOO,GACTR,EAAOF,YAAYU,GAAQd,EAAMc,GAEjCR,EAAOD,WAAWS,GAAQd,EAAMc,KAG7BR,GAUHS,CAAWZ,GACf,IAAIa,EAoBJ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lpB,SAEDf,MAACwnB,GAAgB,CAChBC,eAAgBA,EAChBE,OAAQ,KACP+C,MACA/R,KAEDwE,iBAAkBA,EAClBE,OAAQA,EACRvR,eAAgBA,EAChBkR,mBAAoBA,SAjCtBhd,EAAAA,IAAC0oB,GAAM,CACNC,YAAY,EACZrG,OAAQ+I,EACRxC,uBAAwBA,EACxBzL,YAAaA,EACb0L,WAAYA,EACZF,uBAAwBA,EACxB9qB,OAAQgO,IA1BT9L,EAAAA,IAAC0c,EAAc1T,SAAQ,CAACC,MAAO,CAAEoW,eAAcC,oBAAkBC,oBAAkBxe,SAClFf,EAAAA,IAACgX,EAAoB,CAAAjW,SACpBf,EAAAA,IAACsY,EAAuB,CAAAvX,SACvBf,EAAAA,IAAC4iB,EAAa,CACb9kB,OAAQgO,EACRiR,OAAQsO,EACRjO,YAAaA,EACbJ,mBAAoBA,EACpBC,kBAAmBA,EACnBC,iBAAkBA,EAClBC,iBAAkBA","x_google_ignoreList":[0,1,2,3,4,5,6,9,10]}
1
+ {"version":3,"file":"bodyScan.js","sources":["../../node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js","../../node_modules/@mui/material/esm/Box/boxClasses.js","../../node_modules/@mui/material/esm/Box/Box.js","../../node_modules/@mui/system/esm/createBox/createBox.js","../../node_modules/@mui/material/esm/Dialog/dialogClasses.js","../../node_modules/@mui/material/esm/Dialog/DialogContext.js","../../node_modules/@mui/material/esm/Dialog/Dialog.js","../src/Icons/SwitchIcon.tsx","../src/components/bodyScan/LevelScreen.tsx","../../node_modules/react-webcam/dist/react-webcam.js","../../node_modules/@mui/icons-material/esm/Close.js","../src/utils/context/mediaContext.tsx","../src/utils/context/languageContext.tsx","../src/components/bodyScan/CameraScanChild.tsx","../src/customHooks/useTensorFlow.ts","../src/utils/context/paramsContext.tsx","../src/components/bodyScan/ScanningComponent.tsx","../src/components/bodyScan/AngleDetector.tsx","../src/components/Modal.tsx","../src/components/bodyScan/CameraPermission.tsx","../src/components/bodyScan/VideoPlayer.tsx","../src/components/bodyScan/ScanErrorMessage.tsx","../src/components/Signup.tsx","../src/components/bodyScan/BodyScan.tsx","../src/customHooks/useGyroSensor.ts"],"sourcesContent":["import { isPlainObject } from '@mui/utils/deepmerge';\nimport defaultSxConfig from \"./defaultSxConfig.js\";\nconst splitProps = props => {\n const result = {\n systemProps: {},\n otherProps: {}\n };\n const config = props?.theme?.unstable_sxConfig ?? defaultSxConfig;\n Object.keys(props).forEach(prop => {\n if (config[prop]) {\n result.systemProps[prop] = props[prop];\n } else {\n result.otherProps[prop] = props[prop];\n }\n });\n return result;\n};\nexport default function extendSxProp(props) {\n const {\n sx: inSx,\n ...other\n } = props;\n const {\n systemProps,\n otherProps\n } = splitProps(other);\n let finalSx;\n if (Array.isArray(inSx)) {\n finalSx = [systemProps, ...inSx];\n } else if (typeof inSx === 'function') {\n finalSx = (...args) => {\n const result = inSx(...args);\n if (!isPlainObject(result)) {\n return systemProps;\n }\n return {\n ...systemProps,\n ...result\n };\n };\n } else {\n finalSx = {\n ...systemProps,\n ...inSx\n };\n }\n return {\n ...otherProps,\n sx: finalSx\n };\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nconst boxClasses = generateUtilityClasses('MuiBox', ['root']);\nexport default boxClasses;","'use client';\n\nimport { createBox } from '@mui/system';\nimport PropTypes from 'prop-types';\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from \"../className/index.js\";\nimport { createTheme } from \"../styles/index.js\";\nimport THEME_ID from \"../styles/identifier.js\";\nimport boxClasses from \"./boxClasses.js\";\nconst defaultTheme = createTheme();\nconst Box = createBox({\n themeId: THEME_ID,\n defaultTheme,\n defaultClassName: boxClasses.root,\n generateClassName: ClassNameGenerator.generate\n});\nprocess.env.NODE_ENV !== \"production\" ? Box.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default Box;","'use client';\n\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport styled from '@mui/styled-engine';\nimport styleFunctionSx, { extendSxProp } from \"../styleFunctionSx/index.js\";\nimport useTheme from \"../useTheme/index.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function createBox(options = {}) {\n const {\n themeId,\n defaultTheme,\n defaultClassName = 'MuiBox-root',\n generateClassName\n } = options;\n const BoxRoot = styled('div', {\n shouldForwardProp: prop => prop !== 'theme' && prop !== 'sx' && prop !== 'as'\n })(styleFunctionSx);\n const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {\n const theme = useTheme(defaultTheme);\n const {\n className,\n component = 'div',\n ...other\n } = extendSxProp(inProps);\n return /*#__PURE__*/_jsx(BoxRoot, {\n as: component,\n ref: ref,\n className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),\n theme: themeId ? theme[themeId] || theme : theme,\n ...other\n });\n });\n return Box;\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getDialogUtilityClass(slot) {\n return generateUtilityClass('MuiDialog', slot);\n}\nconst dialogClasses = generateUtilityClasses('MuiDialog', ['root', 'scrollPaper', 'scrollBody', 'container', 'paper', 'paperScrollPaper', 'paperScrollBody', 'paperWidthFalse', 'paperWidthXs', 'paperWidthSm', 'paperWidthMd', 'paperWidthLg', 'paperWidthXl', 'paperFullWidth', 'paperFullScreen']);\nexport default dialogClasses;","'use client';\n\nimport * as React from 'react';\nconst DialogContext = /*#__PURE__*/React.createContext({});\nif (process.env.NODE_ENV !== 'production') {\n DialogContext.displayName = 'DialogContext';\n}\nexport default DialogContext;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport useId from '@mui/utils/useId';\nimport capitalize from \"../utils/capitalize.js\";\nimport Modal from \"../Modal/index.js\";\nimport Fade from \"../Fade/index.js\";\nimport Paper from \"../Paper/index.js\";\nimport dialogClasses, { getDialogUtilityClass } from \"./dialogClasses.js\";\nimport DialogContext from \"./DialogContext.js\";\nimport Backdrop from \"../Backdrop/index.js\";\nimport { styled, useTheme } from \"../zero-styled/index.js\";\nimport memoTheme from \"../utils/memoTheme.js\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.js\";\nimport useSlot from \"../utils/useSlot.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DialogBackdrop = styled(Backdrop, {\n name: 'MuiDialog',\n slot: 'Backdrop',\n overrides: (props, styles) => styles.backdrop\n})({\n // Improve scrollable dialog support.\n zIndex: -1\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n scroll,\n maxWidth,\n fullWidth,\n fullScreen\n } = ownerState;\n const slots = {\n root: ['root'],\n container: ['container', `scroll${capitalize(scroll)}`],\n paper: ['paper', `paperScroll${capitalize(scroll)}`, `paperWidth${capitalize(String(maxWidth))}`, fullWidth && 'paperFullWidth', fullScreen && 'paperFullScreen']\n };\n return composeClasses(slots, getDialogUtilityClass, classes);\n};\nconst DialogRoot = styled(Modal, {\n name: 'MuiDialog',\n slot: 'Root'\n})({\n '@media print': {\n // Use !important to override the Modal inline-style.\n position: 'absolute !important'\n }\n});\nconst DialogContainer = styled('div', {\n name: 'MuiDialog',\n slot: 'Container',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.container, styles[`scroll${capitalize(ownerState.scroll)}`]];\n }\n})({\n height: '100%',\n '@media print': {\n height: 'auto'\n },\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n variants: [{\n props: {\n scroll: 'paper'\n },\n style: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center'\n }\n }, {\n props: {\n scroll: 'body'\n },\n style: {\n overflowY: 'auto',\n overflowX: 'hidden',\n textAlign: 'center',\n '&::after': {\n content: '\"\"',\n display: 'inline-block',\n verticalAlign: 'middle',\n height: '100%',\n width: '0'\n }\n }\n }]\n});\nconst DialogPaper = styled(Paper, {\n name: 'MuiDialog',\n slot: 'Paper',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.paper, styles[`scrollPaper${capitalize(ownerState.scroll)}`], styles[`paperWidth${capitalize(String(ownerState.maxWidth))}`], ownerState.fullWidth && styles.paperFullWidth, ownerState.fullScreen && styles.paperFullScreen];\n }\n})(memoTheme(({\n theme\n}) => ({\n margin: 32,\n position: 'relative',\n overflowY: 'auto',\n '@media print': {\n overflowY: 'visible',\n boxShadow: 'none'\n },\n variants: [{\n props: {\n scroll: 'paper'\n },\n style: {\n display: 'flex',\n flexDirection: 'column',\n maxHeight: 'calc(100% - 64px)'\n }\n }, {\n props: {\n scroll: 'body'\n },\n style: {\n display: 'inline-block',\n verticalAlign: 'middle',\n textAlign: 'initial'\n }\n }, {\n props: ({\n ownerState\n }) => !ownerState.maxWidth,\n style: {\n maxWidth: 'calc(100% - 64px)'\n }\n }, {\n props: {\n maxWidth: 'xs'\n },\n style: {\n maxWidth: theme.breakpoints.unit === 'px' ? Math.max(theme.breakpoints.values.xs, 444) : `max(${theme.breakpoints.values.xs}${theme.breakpoints.unit}, 444px)`,\n [`&.${dialogClasses.paperScrollBody}`]: {\n [theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 444) + 32 * 2)]: {\n maxWidth: 'calc(100% - 64px)'\n }\n }\n }\n }, ...Object.keys(theme.breakpoints.values).filter(maxWidth => maxWidth !== 'xs').map(maxWidth => ({\n props: {\n maxWidth\n },\n style: {\n maxWidth: `${theme.breakpoints.values[maxWidth]}${theme.breakpoints.unit}`,\n [`&.${dialogClasses.paperScrollBody}`]: {\n [theme.breakpoints.down(theme.breakpoints.values[maxWidth] + 32 * 2)]: {\n maxWidth: 'calc(100% - 64px)'\n }\n }\n }\n })), {\n props: ({\n ownerState\n }) => ownerState.fullWidth,\n style: {\n width: 'calc(100% - 64px)'\n }\n }, {\n props: ({\n ownerState\n }) => ownerState.fullScreen,\n style: {\n margin: 0,\n width: '100%',\n maxWidth: '100%',\n height: '100%',\n maxHeight: 'none',\n borderRadius: 0,\n [`&.${dialogClasses.paperScrollBody}`]: {\n margin: 0,\n maxWidth: '100%'\n }\n }\n }]\n})));\n\n/**\n * Dialogs are overlaid modal paper based components with a backdrop.\n */\nconst Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiDialog'\n });\n const theme = useTheme();\n const defaultTransitionDuration = {\n enter: theme.transitions.duration.enteringScreen,\n exit: theme.transitions.duration.leavingScreen\n };\n const {\n 'aria-describedby': ariaDescribedby,\n 'aria-labelledby': ariaLabelledbyProp,\n 'aria-modal': ariaModal = true,\n BackdropComponent,\n BackdropProps,\n children,\n className,\n disableEscapeKeyDown = false,\n fullScreen = false,\n fullWidth = false,\n maxWidth = 'sm',\n onClick,\n onClose,\n open,\n PaperComponent = Paper,\n PaperProps = {},\n scroll = 'paper',\n slots = {},\n slotProps = {},\n TransitionComponent = Fade,\n transitionDuration = defaultTransitionDuration,\n TransitionProps,\n ...other\n } = props;\n const ownerState = {\n ...props,\n disableEscapeKeyDown,\n fullScreen,\n fullWidth,\n maxWidth,\n scroll\n };\n const classes = useUtilityClasses(ownerState);\n const backdropClick = React.useRef();\n const handleMouseDown = event => {\n // We don't want to close the dialog when clicking the dialog content.\n // Make sure the event starts and ends on the same DOM element.\n backdropClick.current = event.target === event.currentTarget;\n };\n const handleBackdropClick = event => {\n if (onClick) {\n onClick(event);\n }\n\n // Ignore the events not coming from the \"backdrop\".\n if (!backdropClick.current) {\n return;\n }\n backdropClick.current = null;\n if (onClose) {\n onClose(event, 'backdropClick');\n }\n };\n const ariaLabelledby = useId(ariaLabelledbyProp);\n const dialogContextValue = React.useMemo(() => {\n return {\n titleId: ariaLabelledby\n };\n }, [ariaLabelledby]);\n const backwardCompatibleSlots = {\n transition: TransitionComponent,\n ...slots\n };\n const backwardCompatibleSlotProps = {\n transition: TransitionProps,\n paper: PaperProps,\n backdrop: BackdropProps,\n ...slotProps\n };\n const externalForwardedProps = {\n slots: backwardCompatibleSlots,\n slotProps: backwardCompatibleSlotProps\n };\n const [RootSlot, rootSlotProps] = useSlot('root', {\n elementType: DialogRoot,\n shouldForwardComponentProp: true,\n externalForwardedProps,\n ownerState,\n className: clsx(classes.root, className),\n ref\n });\n const [BackdropSlot, backdropSlotProps] = useSlot('backdrop', {\n elementType: DialogBackdrop,\n shouldForwardComponentProp: true,\n externalForwardedProps,\n ownerState\n });\n const [PaperSlot, paperSlotProps] = useSlot('paper', {\n elementType: DialogPaper,\n shouldForwardComponentProp: true,\n externalForwardedProps,\n ownerState,\n className: clsx(classes.paper, PaperProps.className)\n });\n const [ContainerSlot, containerSlotProps] = useSlot('container', {\n elementType: DialogContainer,\n externalForwardedProps,\n ownerState,\n className: classes.container\n });\n const [TransitionSlot, transitionSlotProps] = useSlot('transition', {\n elementType: Fade,\n externalForwardedProps,\n ownerState,\n additionalProps: {\n appear: true,\n in: open,\n timeout: transitionDuration,\n role: 'presentation'\n }\n });\n return /*#__PURE__*/_jsx(RootSlot, {\n closeAfterTransition: true,\n slots: {\n backdrop: BackdropSlot\n },\n slotProps: {\n backdrop: {\n transitionDuration,\n as: BackdropComponent,\n ...backdropSlotProps\n }\n },\n disableEscapeKeyDown: disableEscapeKeyDown,\n onClose: onClose,\n open: open,\n onClick: handleBackdropClick,\n ...rootSlotProps,\n ...other,\n children: /*#__PURE__*/_jsx(TransitionSlot, {\n ...transitionSlotProps,\n children: /*#__PURE__*/_jsx(ContainerSlot, {\n onMouseDown: handleMouseDown,\n ...containerSlotProps,\n children: /*#__PURE__*/_jsx(PaperSlot, {\n as: PaperComponent,\n elevation: 24,\n role: \"dialog\",\n \"aria-describedby\": ariaDescribedby,\n \"aria-labelledby\": ariaLabelledby,\n \"aria-modal\": ariaModal,\n ...paperSlotProps,\n children: /*#__PURE__*/_jsx(DialogContext.Provider, {\n value: dialogContextValue,\n children: children\n })\n })\n })\n })\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Dialog.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The id(s) of the element(s) that describe the dialog.\n */\n 'aria-describedby': PropTypes.string,\n /**\n * The id(s) of the element(s) that label the dialog.\n */\n 'aria-labelledby': PropTypes.string,\n /**\n * Informs assistive technologies that the element is modal.\n * It's added on the element with role=\"dialog\".\n * @default true\n */\n 'aria-modal': PropTypes.oneOfType([PropTypes.oneOf(['false', 'true']), PropTypes.bool]),\n /**\n * A backdrop component. This prop enables custom backdrop rendering.\n * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.\n * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.\n * @default styled(Backdrop, {\n * name: 'MuiModal',\n * slot: 'Backdrop',\n * })({\n * zIndex: -1,\n * })\n */\n BackdropComponent: PropTypes.elementType,\n /**\n * @ignore\n */\n BackdropProps: PropTypes.object,\n /**\n * Dialog children, usually the included sub-components.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * If `true`, hitting escape will not fire the `onClose` callback.\n * @default false\n */\n disableEscapeKeyDown: PropTypes.bool,\n /**\n * If `true`, the dialog is full-screen.\n * @default false\n */\n fullScreen: PropTypes.bool,\n /**\n * If `true`, the dialog stretches to `maxWidth`.\n *\n * Notice that the dialog width grow is limited by the default margin.\n * @default false\n */\n fullWidth: PropTypes.bool,\n /**\n * Determine the max-width of the dialog.\n * The dialog width grows with the size of the screen.\n * Set to `false` to disable `maxWidth`.\n * @default 'sm'\n */\n maxWidth: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), PropTypes.string]),\n /**\n * @ignore\n */\n onClick: PropTypes.func,\n /**\n * Callback fired when the component requests to be closed.\n *\n * @param {object} event The event source of the callback.\n * @param {string} reason Can be: `\"escapeKeyDown\"`, `\"backdropClick\"`.\n */\n onClose: PropTypes.func,\n /**\n * If `true`, the component is shown.\n */\n open: PropTypes.bool.isRequired,\n /**\n * The component used to render the body of the dialog.\n * @default Paper\n */\n PaperComponent: PropTypes.elementType,\n /**\n * Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.\n * @default {}\n * @deprecated Use `slotProps.paper` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.\n */\n PaperProps: PropTypes.object,\n /**\n * Determine the container for scrolling the dialog.\n * @default 'paper'\n */\n scroll: PropTypes.oneOf(['body', 'paper']),\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.shape({\n backdrop: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n container: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n }),\n /**\n * The components used for each slot inside.\n * @default {}\n */\n slots: PropTypes.shape({\n backdrop: PropTypes.elementType,\n container: PropTypes.elementType,\n paper: PropTypes.elementType,\n root: PropTypes.elementType,\n transition: PropTypes.elementType\n }),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The component used for the transition.\n * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.\n * @default Fade\n * @deprecated Use `slots.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.\n */\n TransitionComponent: PropTypes.elementType,\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n * @default {\n * enter: theme.transitions.duration.enteringScreen,\n * exit: theme.transitions.duration.leavingScreen,\n * }\n */\n transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })]),\n /**\n * Props applied to the transition element.\n * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.\n * @deprecated Use `slotProps.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.\n */\n TransitionProps: PropTypes.object\n} : void 0;\nexport default Dialog;","import React from \"react\";\n\nfunction SwitchIcon({ size = 16 }: { size?: number }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 25 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M22.6968 14.6968C22.6968 16.8185 21.8539 18.8533 20.3536 20.3536C18.8533 21.8539 16.8185 22.6968 14.6968 22.6968\"\n stroke=\"white\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M18.6968 11.6968V10.6968C18.6968 10.1663 18.4861 9.65764 18.111 9.28256C17.7359 8.90749 17.2272 8.69678 16.6968 8.69678C16.1663 8.69678 15.6576 8.90749 15.2826 9.28256C14.9075 9.65764 14.6968 10.1663 14.6968 10.6968\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M14.6968 10.6968V9.69678C14.6968 9.16634 14.4861 8.65764 14.111 8.28256C13.7359 7.90749 13.2272 7.69678 12.6968 7.69678C12.1663 7.69678 11.6576 7.90749 11.2826 8.28256C10.9075 8.65764 10.6968 9.16634 10.6968 9.69678V10.6968\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M10.6968 10.1968V4.69678C10.6968 4.16634 10.4861 3.65764 10.111 3.28256C9.73592 2.90749 9.22721 2.69678 8.69678 2.69678C8.16634 2.69678 7.65764 2.90749 7.28256 3.28256C6.90749 3.65764 6.69678 4.16634 6.69678 4.69678V14.6968\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M18.6969 11.6968C18.6969 11.1663 18.9076 10.6576 19.2827 10.2826C19.6577 9.90749 20.1664 9.69678 20.6969 9.69678C21.2273 9.69678 21.736 9.90749 22.1111 10.2826C22.4862 10.6576 22.6969 11.1663 22.6969 11.6968V14.6968C22.6969 16.8185 21.854 18.8533 20.3537 20.3536C18.8534 21.8539 16.8186 22.6968 14.6969 22.6968H12.6969C9.89688 22.6968 8.19688 21.8368 6.70688 20.3568L3.10688 16.7568C2.76282 16.3757 2.57847 15.8769 2.592 15.3637C2.60554 14.8505 2.81593 14.3621 3.1796 13.9997C3.54327 13.6373 4.03238 13.4287 4.54565 13.417C5.05892 13.4053 5.55704 13.5914 5.93688 13.9368L7.69688 15.6968\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport default React.memo(SwitchIcon);\n","/* eslint-disable no-nested-ternary */\n\nimport React, { useCallback, useMemo } from \"react\";\nimport Header from \"../Header\";\nimport cn from \"clsx\";\nimport { LevelScreenProps } from \"../../types/interfaces\";\nimport SwitchIcon from \"../../Icons/SwitchIcon\";\n\n\n\nfunction LevelScreen({ angle, countdown, isScanning, isInTargetRange, stabilityScore, children, config }: LevelScreenProps) {\n\tconst getProximityToTarget = useCallback(() => {\n\t\tif (angle < 80) return Math.max(0, Math.min(100, (angle - 60) * 10));\n\t\tif (angle > 95) return Math.max(0, Math.min(100, (105 - angle) * 10));\n\t\treturn 100;\n\t}, [angle]);\n\n\tconst backgroundColor = useMemo(() => {\n\t\tif (isScanning) return config?.style?.base?.brandColor || \"#4f46e5\";\n\n\t\tconst proximity = getProximityToTarget();\n\t\tif (proximity === 0) return \"#ffffff\";\n\t\tif (proximity === 100) return config?.style?.base?.brandColor || \"#8b5cf6\";\n\n\t\tconst r = Math.round(255 - (255 - 139) * (proximity / 100));\n\t\tconst g = Math.round(255 - (255 - 92) * (proximity / 100));\n\t\tconst b = Math.round(255 - (255 - 246) * (proximity / 100));\n\t\treturn `rgb(${r}, ${g}, ${b})`;\n\t}, [isScanning, getProximityToTarget]);\n\n\tconst handelTextColour = useCallback((isLight: boolean, proximity: number) => {\n\t\tif (proximity > 70) {\n\t\t\treturn isLight ? \"text-[#fff]/70\" : \"text-[#fff]\";\n\t\t}\n\t\treturn isLight ? \"text-[#fff]/40\" : \"text-[#000]/70\";\n\t}, []);\n\n\tconst getTextColor = useCallback(\n\t\t(isLight = false) => {\n\t\t\tconst proximity = getProximityToTarget();\n\t\t\tif (isScanning) return \"text-[#fff]\";\n\t\t\treturn handelTextColour(isLight, proximity);\n\t\t},\n\t\t[isScanning, getProximityToTarget],\n\t);\n\tconst cd = countdown;\n\tfunction fixVh() {\n\t\tdocument.documentElement.style.setProperty(\"--real-vh\", window.innerHeight + \"px\");\n\t}\n\tfixVh();\n\twindow.addEventListener(\"resize\", fixVh);\n\treturn (\n\t\t<div\n\t\t\tclassName=\"flex w-screen flex-col items-center h-[var(--real-vh)] overflow-hidden touch-none justify-center transition-all duration-300 max-w-[28rem] mx-auto\"\n\t\t\tstyle={{ backgroundColor }}\n\t\t\t// onDoubleClick={onDoubleClick}\n\t\t>\n\t\t\t<div className=\"flex justify-start fixed top-[.5rem] max-w-[28rem] mx-auto w-full px-[1rem]\">\n\t\t\t\t<div className=\"flex justify-start \">\n\t\t\t\t\t<Header noTitle resolvedConfig={config} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{cd !== null ? (\n\t\t\t\t<div className=\"relative flex h-[6rem] w-[6rem] items-center justify-center rounded-[9999px] border-2 border-[#fff] bg-[#fff]/20 transition-all duration-300\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"text-[3rem] font-bold text-[#fff]\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{cd}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : isScanning ? (\n\t\t\t\t<div className=\"relative flex flex-col items-center justify-center\">\n\t\t\t\t\t<div className=\"relative flex h-16 w-16 items-center justify-center rounded-[9999px] border-2 bg-[#fff]/30 border-[#fff]\">\n\t\t\t\t\t\t<div className=\"h-4 w-4 rounded-[9999px] animate-pulse bg-[#fff]/80\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\"relative flex h-[4rem] w-[4rem] items-center justify-center rounded-[9999px] border-2 \", isInTargetRange ? \"bg-[#fff]/20 border-[#fff]\" : \"bg-[#fff]/10 border-[#fff]\")}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\ttransform: `translateY(${(90 - angle) * 3}px)`,\n\t\t\t\t\t\ttransition: \"transform 0.2s ease-out\",\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"h-[1rem] w-[1rem] rounded-[9999px] bg-[#fff]/80\" />\n\t\t\t\t\t<div className=\"mt-[.5rem] w-[180px] flex-col flex items-center absolute top-[60px] text-[#fff]\">\n\t\t\t\t\t\t<SwitchIcon size={30} />\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\" \"}\n\t\t\t\t\t\t\tTap to start level check\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{cd !== null && (\n\t\t\t\t<div className=\"absolute bottom-[8rem] text-center\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"text-[#fff] text-sm font-medium px-4 py-1.5 bg-black/20 rounded-[9999px] mt-8\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tLeave your phone as is\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{isInTargetRange && cd === null && !isScanning && (\n\t\t\t\t<div className=\"absolute bottom-[8rem] w-[12rem]\">\n\t\t\t\t\t<div className=\"h-[.375rem] w-full bg-[#fff]/20 rounded-[9999px] overflow-hidden\">\n\t\t\t\t\t\t<div className=\"h-full bg-[#fff]/70 transition-all duration-300 rounded-[9999px]\" style={{ width: `${stabilityScore}%` }} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{cd === null && !isScanning && (\n\t\t\t\t<div className=\"absolute bottom-[5rem] text-center\">\n\t\t\t\t\t<div className={cn(\"text-[1.5rem] font-light\", getTextColor())}>{Math.round(angle)}°</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{cd === null && !isScanning && (\n\t\t\t\t<div className=\"absolute bottom-[2rem] text-center max-w-[20rem] mx-auto\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\"text-[.75rem] opacity-50\", getTextColor(true))}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tPlace your phone upright against an object. Once stable and within the 80-95° range a countdown will start to move to the scan.\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\nexport default React.memo(LevelScreen);\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Webcam\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"Webcam\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_react__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/react-webcam.tsx\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./src/react-webcam.tsx\":\n/*!******************************!*\\\n !*** ./src/react-webcam.tsx ***!\n \\******************************/\n/*! exports provided: default */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n// polyfill based on https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\n(function polyfillGetUserMedia() {\n if (typeof window === 'undefined') {\n return;\n }\n // Older browsers might not implement mediaDevices at all, so we set an empty object first\n if (navigator.mediaDevices === undefined) {\n navigator.mediaDevices = {};\n }\n // Some browsers partially implement mediaDevices. We can't just assign an object\n // with getUserMedia as it would overwrite existing properties.\n // Here, we will just add the getUserMedia property if it's missing.\n if (navigator.mediaDevices.getUserMedia === undefined) {\n navigator.mediaDevices.getUserMedia = function (constraints) {\n // First get ahold of the legacy getUserMedia, if present\n var getUserMedia = navigator.getUserMedia ||\n navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia ||\n navigator.msGetUserMedia;\n // Some browsers just don't implement it - return a rejected promise with an error\n // to keep a consistent interface\n if (!getUserMedia) {\n return Promise.reject(new Error(\"getUserMedia is not implemented in this browser\"));\n }\n // Otherwise, wrap the call to the old navigator.getUserMedia with a Promise\n return new Promise(function (resolve, reject) {\n getUserMedia.call(navigator, constraints, resolve, reject);\n });\n };\n }\n})();\nfunction hasGetUserMedia() {\n return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia);\n}\nvar Webcam = /** @class */ (function (_super) {\n __extends(Webcam, _super);\n function Webcam(props) {\n var _this = _super.call(this, props) || this;\n _this.canvas = null;\n _this.ctx = null;\n _this.requestUserMediaId = 0;\n _this.unmounted = false;\n _this.state = {\n hasUserMedia: false\n };\n return _this;\n }\n Webcam.prototype.componentDidMount = function () {\n var _a = this, state = _a.state, props = _a.props;\n this.unmounted = false;\n if (!hasGetUserMedia()) {\n props.onUserMediaError(\"getUserMedia not supported\");\n return;\n }\n if (!state.hasUserMedia) {\n this.requestUserMedia();\n }\n if (props.children && typeof props.children != 'function') {\n console.warn(\"children must be a function\");\n }\n };\n Webcam.prototype.componentDidUpdate = function (nextProps) {\n var props = this.props;\n if (!hasGetUserMedia()) {\n props.onUserMediaError(\"getUserMedia not supported\");\n return;\n }\n var audioConstraintsChanged = JSON.stringify(nextProps.audioConstraints) !==\n JSON.stringify(props.audioConstraints);\n var videoConstraintsChanged = JSON.stringify(nextProps.videoConstraints) !==\n JSON.stringify(props.videoConstraints);\n var minScreenshotWidthChanged = nextProps.minScreenshotWidth !== props.minScreenshotWidth;\n var minScreenshotHeightChanged = nextProps.minScreenshotHeight !== props.minScreenshotHeight;\n if (videoConstraintsChanged ||\n minScreenshotWidthChanged ||\n minScreenshotHeightChanged) {\n this.canvas = null;\n this.ctx = null;\n }\n if (audioConstraintsChanged || videoConstraintsChanged) {\n this.stopAndCleanup();\n this.requestUserMedia();\n }\n };\n Webcam.prototype.componentWillUnmount = function () {\n this.unmounted = true;\n this.stopAndCleanup();\n };\n Webcam.stopMediaStream = function (stream) {\n if (stream) {\n if (stream.getVideoTracks && stream.getAudioTracks) {\n stream.getVideoTracks().map(function (track) {\n stream.removeTrack(track);\n track.stop();\n });\n stream.getAudioTracks().map(function (track) {\n stream.removeTrack(track);\n track.stop();\n });\n }\n else {\n stream.stop();\n }\n }\n };\n Webcam.prototype.stopAndCleanup = function () {\n var state = this.state;\n if (state.hasUserMedia) {\n Webcam.stopMediaStream(this.stream);\n if (state.src) {\n window.URL.revokeObjectURL(state.src);\n }\n }\n };\n Webcam.prototype.getScreenshot = function (screenshotDimensions) {\n var _a = this, state = _a.state, props = _a.props;\n if (!state.hasUserMedia)\n return null;\n var canvas = this.getCanvas(screenshotDimensions);\n return (canvas &&\n canvas.toDataURL(props.screenshotFormat, props.screenshotQuality));\n };\n Webcam.prototype.getCanvas = function (screenshotDimensions) {\n var _a = this, state = _a.state, props = _a.props;\n if (!this.video) {\n return null;\n }\n if (!state.hasUserMedia || !this.video.videoHeight)\n return null;\n if (!this.ctx) {\n var canvasWidth = this.video.videoWidth;\n var canvasHeight = this.video.videoHeight;\n if (!this.props.forceScreenshotSourceSize) {\n var aspectRatio = canvasWidth / canvasHeight;\n canvasWidth = props.minScreenshotWidth || this.video.clientWidth;\n canvasHeight = canvasWidth / aspectRatio;\n if (props.minScreenshotHeight &&\n canvasHeight < props.minScreenshotHeight) {\n canvasHeight = props.minScreenshotHeight;\n canvasWidth = canvasHeight * aspectRatio;\n }\n }\n this.canvas = document.createElement(\"canvas\");\n this.canvas.width = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.width) || canvasWidth;\n this.canvas.height = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.height) || canvasHeight;\n this.ctx = this.canvas.getContext(\"2d\");\n }\n var _b = this, ctx = _b.ctx, canvas = _b.canvas;\n if (ctx && canvas) {\n // adjust the height and width of the canvas to the given dimensions\n canvas.width = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.width) || canvas.width;\n canvas.height = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.height) || canvas.height;\n // mirror the screenshot\n if (props.mirrored) {\n ctx.translate(canvas.width, 0);\n ctx.scale(-1, 1);\n }\n ctx.imageSmoothingEnabled = props.imageSmoothing;\n ctx.drawImage(this.video, 0, 0, (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.width) || canvas.width, (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.height) || canvas.height);\n // invert mirroring\n if (props.mirrored) {\n ctx.scale(-1, 1);\n ctx.translate(-canvas.width, 0);\n }\n }\n return canvas;\n };\n Webcam.prototype.requestUserMedia = function () {\n var _this = this;\n var props = this.props;\n var sourceSelected = function (audioConstraints, videoConstraints) {\n var constraints = {\n video: typeof videoConstraints !== \"undefined\" ? videoConstraints : true\n };\n if (props.audio) {\n constraints.audio =\n typeof audioConstraints !== \"undefined\" ? audioConstraints : true;\n }\n _this.requestUserMediaId++;\n var myRequestUserMediaId = _this.requestUserMediaId;\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function (stream) {\n if (_this.unmounted || myRequestUserMediaId !== _this.requestUserMediaId) {\n Webcam.stopMediaStream(stream);\n }\n else {\n _this.handleUserMedia(null, stream);\n }\n })\n .catch(function (e) {\n _this.handleUserMedia(e);\n });\n };\n if (\"mediaDevices\" in navigator) {\n sourceSelected(props.audioConstraints, props.videoConstraints);\n }\n else {\n var optionalSource_1 = function (id) { return ({ optional: [{ sourceId: id }] }); };\n var constraintToSourceId_1 = function (constraint) {\n var deviceId = constraint.deviceId;\n if (typeof deviceId === \"string\") {\n return deviceId;\n }\n if (Array.isArray(deviceId) && deviceId.length > 0) {\n return deviceId[0];\n }\n if (typeof deviceId === \"object\" && deviceId.ideal) {\n return deviceId.ideal;\n }\n return null;\n };\n // @ts-ignore: deprecated api\n MediaStreamTrack.getSources(function (sources) {\n var audioSource = null;\n var videoSource = null;\n sources.forEach(function (source) {\n if (source.kind === \"audio\") {\n audioSource = source.id;\n }\n else if (source.kind === \"video\") {\n videoSource = source.id;\n }\n });\n var audioSourceId = constraintToSourceId_1(props.audioConstraints);\n if (audioSourceId) {\n audioSource = audioSourceId;\n }\n var videoSourceId = constraintToSourceId_1(props.videoConstraints);\n if (videoSourceId) {\n videoSource = videoSourceId;\n }\n sourceSelected(optionalSource_1(audioSource), optionalSource_1(videoSource));\n });\n }\n };\n Webcam.prototype.handleUserMedia = function (err, stream) {\n var props = this.props;\n if (err || !stream) {\n this.setState({ hasUserMedia: false });\n props.onUserMediaError(err);\n return;\n }\n this.stream = stream;\n try {\n if (this.video) {\n this.video.srcObject = stream;\n }\n this.setState({ hasUserMedia: true });\n }\n catch (error) {\n this.setState({\n hasUserMedia: true,\n src: window.URL.createObjectURL(stream)\n });\n }\n props.onUserMedia(stream);\n };\n Webcam.prototype.render = function () {\n var _this = this;\n var _a = this, state = _a.state, props = _a.props;\n var audio = props.audio, forceScreenshotSourceSize = props.forceScreenshotSourceSize, disablePictureInPicture = props.disablePictureInPicture, onUserMedia = props.onUserMedia, onUserMediaError = props.onUserMediaError, screenshotFormat = props.screenshotFormat, screenshotQuality = props.screenshotQuality, minScreenshotWidth = props.minScreenshotWidth, minScreenshotHeight = props.minScreenshotHeight, audioConstraints = props.audioConstraints, videoConstraints = props.videoConstraints, imageSmoothing = props.imageSmoothing, mirrored = props.mirrored, _b = props.style, style = _b === void 0 ? {} : _b, children = props.children, rest = __rest(props, [\"audio\", \"forceScreenshotSourceSize\", \"disablePictureInPicture\", \"onUserMedia\", \"onUserMediaError\", \"screenshotFormat\", \"screenshotQuality\", \"minScreenshotWidth\", \"minScreenshotHeight\", \"audioConstraints\", \"videoConstraints\", \"imageSmoothing\", \"mirrored\", \"style\", \"children\"]);\n var videoStyle = mirrored ? __assign(__assign({}, style), { transform: (style.transform || \"\") + \" scaleX(-1)\" }) : style;\n var childrenProps = {\n getScreenshot: this.getScreenshot.bind(this),\n };\n return (react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null,\n react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"video\", __assign({ autoPlay: true, disablePictureInPicture: disablePictureInPicture, src: state.src, muted: !audio, playsInline: true, ref: function (ref) {\n _this.video = ref;\n }, style: videoStyle }, rest)),\n children && children(childrenProps)));\n };\n Webcam.defaultProps = {\n audio: false,\n disablePictureInPicture: false,\n forceScreenshotSourceSize: false,\n imageSmoothing: true,\n mirrored: false,\n onUserMedia: function () { return undefined; },\n onUserMediaError: function () { return undefined; },\n screenshotFormat: \"image/webp\",\n screenshotQuality: 0.92,\n };\n return Webcam;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Webcam);\n\n\n/***/ }),\n\n/***/ \"react\":\n/*!**************************************************************************************!*\\\n !*** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"} ***!\n \\**************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_react__;\n\n/***/ })\n\n/******/ })[\"default\"];\n});\n//# sourceMappingURL=react-webcam.js.map","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');","import React, {\n createContext,\n Dispatch,\n ReactNode,\n SetStateAction,\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n} from \"react\";\n\nexport const MEDIA_TYPES = {\n DESKTOP: \"DESKTOP\",\n TAB: \"TAB\",\n MOBILE: \"MOBILE\",\n};\n\ninterface MediaContextType {\n size: number[];\n setSize: Dispatch<SetStateAction<number[]>>;\n clearInputs: boolean;\n setClearInputs: Dispatch<SetStateAction<boolean>>;\n media: string;\n}\n\nexport const MediaContext = createContext<MediaContextType | undefined>(\n undefined\n);\n\nfunction MediaContextProvider({ children }: { children: ReactNode }) {\n const [size, setSize] = useState([window?.innerWidth, window?.innerHeight]);\n const [clearInputs, setClearInputs] = useState(false);\n\n const updateSize = () => {\n setSize([window?.innerWidth, window?.innerHeight]);\n };\n useEffect(() => {\n updateSize();\n }, []);\n useLayoutEffect(() => {\n window.addEventListener(\"resize\", updateSize);\n return () => window.removeEventListener(\"resize\", updateSize);\n }, [updateSize]);\n let media = MEDIA_TYPES.DESKTOP;\n if (size[0] > 768 && size[0] < 1024) {\n media = MEDIA_TYPES.TAB;\n }\n if (size[0] < 768) {\n media = MEDIA_TYPES.MOBILE;\n }\n\n const mediaDetails = useMemo(\n () => ({\n size,\n setSize,\n clearInputs,\n setClearInputs,\n media,\n }),\n [size, clearInputs, media]\n );\n\n return (\n <MediaContext.Provider value={mediaDetails}>\n {children}\n </MediaContext.Provider>\n );\n}\n\nexport default MediaContextProvider;\n","import {\n createContext,\n Dispatch,\n ReactNode,\n SetStateAction,\n useMemo,\n useState,\n} from \"react\";\nimport { PreferredLanguage } from \"../enums\";\nimport English from \"../dictionary/EnglishLanguage.json\";\nimport Hindi from \"../dictionary/HindiLanguage.json\";\nimport French from \"../dictionary/FrenchLanguage.json\";\nimport German from \"../dictionary/GermanLanguage.json\";\nimport Spanish from \"../dictionary/SpanishLanguage.json\";\nimport Arabic from \"../dictionary/ArabicLanguage.json\";\nimport Italian from \"../dictionary/ItalianLanguage.json\";\n// import { PreferredLanguageType } from \"swan-web-components/src/types/interfaces\";\n\ntype Dictionary = Record<string, string>;\n\nconst dictionaries: Record<PreferredLanguage, Dictionary> = {\n [PreferredLanguage.English]: English as Dictionary,\n [PreferredLanguage.Hindi]: Hindi as Dictionary,\n [PreferredLanguage.French]: French as Dictionary,\n [PreferredLanguage.German]: German as Dictionary,\n [PreferredLanguage.Spanish]: Spanish as Dictionary,\n [PreferredLanguage.Arabic]: Arabic as Dictionary,\n [PreferredLanguage.Italian]: Italian as Dictionary,\n};\n\ninterface ILanguageContext {\n preferredLanguage: PreferredLanguage;\n setPreferredLanguage: Dispatch<SetStateAction<PreferredLanguage>>;\n translate: (text: string) => string;\n}\n\nexport const LanguageContext = createContext<ILanguageContext | undefined>(\n undefined\n);\n\nexport default function LanguageContextProvider({\n children,\n}: {\n children: ReactNode;\n}) {\n const [preferredLanguage, setPreferredLanguage] = useState<PreferredLanguage>(\n PreferredLanguage.English\n );\n\n const translate = (text: string): string => {\n return dictionaries[preferredLanguage][text] ?? text;\n };\n\n const value = useMemo(\n () => ({\n preferredLanguage,\n setPreferredLanguage,\n translate,\n }),\n [preferredLanguage]\n );\n\n return (\n <LanguageContext.Provider value={value}>\n {children}\n </LanguageContext.Provider>\n );\n}\n","import { useContext } from \"react\";\nimport Webcam from \"react-webcam\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { CameraScanChildProps } from \"../../types/interfaces\";\nimport { MEDIA_TYPES, MediaContext } from \"../../utils/context/mediaContext\";\nimport { LanguageContext } from \"../../utils/context/languageContext\";\nimport { LanguageKeys, pauseIcon, videoConstraints, voiceOverAssetsPath } from \"../../utils/constants\";\nimport SpecificButton from \"../../atoms/specificButton/SpecificButton\";\n\n\n\nfunction CameraScanChild({\n\thandleShowStreamCamera,\n\tloadingCam,\n\thandleUserMedia,\n\thandlePause,\n\tpause,\n\trecordingStarted,\n\tstartSendingVideoFrames,\n\tshowPause,\n\twebcamRef,\n\tresetDetector,\n\tconfig,\n}: CameraScanChildProps) {\n\tconst { media } = useContext(MediaContext) || {};\n\tconst { translate } = useContext(LanguageContext) || {};\n\n\treturn (\n\t\t<div className=\"App w-screen h-[100vh] relative \">\n\t\t\t<span\n\t\t\t\tonClick={() => {\n\t\t\t\t\thandleShowStreamCamera();\n\t\t\t\t\tresetDetector();\n\t\t\t\t}}\n\t\t\t\tclassName=\"fixed right-[20px] top-[20px] z-[999]\"\n\t\t\t>\n\t\t\t\t<CloseIcon className=\"text-[#fff]\" />\n\t\t\t</span>\n\n\t\t\t<div className=\"w-full h-full overflow-hidden \">\n\t\t\t\t{media === MEDIA_TYPES.MOBILE && (\n\t\t\t\t\t<Webcam\n\t\t\t\t\t\taudio={false}\n\t\t\t\t\t\tref={webcamRef}\n\t\t\t\t\t\tscreenshotQuality={1}\n\t\t\t\t\t\tvideoConstraints={videoConstraints}\n\t\t\t\t\t\tmirrored\n\t\t\t\t\t\tscreenshotFormat=\"image/jpeg\"\n\t\t\t\t\t\tonUserMedia={handleUserMedia}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tposition: \"fixed\",\n\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\t\tzIndex: 0,\n\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\theight: \"100%\",\n\t\t\t\t\t\t\tobjectFit: \"cover\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t<div className=\"fixed bottom-[30px] w-full z-[999] flex flex-col gap-4 items-center justify-center\">\n\t\t\t\t{showPause && <SpecificButton className=\"!w-[180px] !h-[40px] !py-[0] mx-auto \" prefix={pauseIcon} buttonText=\"Pause\" buttonFunc={handlePause} resolvedConfig={config} btnSecondary />}\n\n\t\t\t\t{pause ? (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<SpecificButton className=\"!w-[180px] !h-[40px] !py-[0] mx-auto\" buttonText=\"Restart\" buttonFunc={handleShowStreamCamera} resolvedConfig={config} btnSecondary />\n\t\t\t\t\t</div>\n\t\t\t\t) : !recordingStarted ? (\n\t\t\t\t\t<SpecificButton\n\t\t\t\t\t\tclassName={`!w-[180px] !h-[40px] !py-[0] mx-auto !bg-[#ffffff] !text-[#000000] ${loadingCam ? \"!opacity-50\" : \"\"}`}\n\t\t\t\t\t\tbuttonText={translate?.(LanguageKeys.Start_Scan)}\n\t\t\t\t\t\tbuttonFunc={startSendingVideoFrames}\n\t\t\t\t\t\tdisabled={loadingCam}\n\t\t\t\t\t\tresolvedConfig={config}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t</div>\n\n\t\t\t<audio\n\t\t\t\tid=\"audioElement\"\n\t\t\t\tcrossOrigin=\"anonymous\"\n\t\t\t\tpreload=\"auto\"\n\t\t\t\tstyle={{\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\tzIndex: -99999,\n\t\t\t\t}}\n\t\t\t\tsrc={`${voiceOverAssetsPath}scanAudioInstructions/silence.mp3`}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default CameraScanChild;\n","import { useState, useRef, useEffect } from \"react\";\nimport { TENSORFLOW_SOLUTION_PATH } from \"../utils/constants\";\n\ntype KeypointTuple = [number, number, number];\n\n// Singleton pattern to share loading state across multiple hook instances\nlet globalLoadingPromise: Promise<boolean> | null = null;\nlet globalDetector: any = null;\nlet globalPoseLib: any = null;\nlet globalTfjs: any = null;\n\nexport default function useTensorFlow() {\n const [consecutiveFronts, setConsecutiveFronts] = useState(0);\n const [spinPhase, setSpinPhase] = useState(0);\n const [isLoaded, setIsLoaded] = useState(false);\n\n const spinPhaseRef = useRef(0);\n const consecutiveFrontsRef = useRef(0);\n const mounted = useRef(true);\n\n // Start loading immediately if not already loading\n useEffect(() => {\n // If already loaded globally, use that\n if (globalDetector) {\n setIsLoaded(true);\n return;\n }\n\n // If not loading yet, start loading\n if (!globalLoadingPromise) {\n globalLoadingPromise = loadDependenciesGlobal();\n }\n\n // Wait for loading to complete\n globalLoadingPromise.then((success) => {\n if (success && mounted.current) {\n setIsLoaded(true);\n }\n });\n\n return () => {\n mounted.current = false;\n };\n }, []);\n\n async function loadDependenciesGlobal(): Promise<boolean> {\n // Only load on client side\n if (typeof window === 'undefined') return false;\n \n try {\n console.log(\"Starting TensorFlow preload...\");\n \n // Dynamic imports that won't be processed during SSR\n const [poseLib, tfjsCore, tfjsBackend] = await Promise.all([\n import(\"@tensorflow-models/pose-detection\"),\n import(\"@tensorflow/tfjs-core\"),\n import(\"@tensorflow/tfjs-backend-webgl\")\n ]);\n \n globalPoseLib = poseLib;\n globalTfjs = tfjsCore;\n \n // Wait for backend to be ready\n await tfjsCore.ready();\n console.log(\"TensorFlow backend ready\");\n\n // Try MediaPipe first\n try {\n globalDetector = await globalPoseLib.createDetector(\n globalPoseLib.SupportedModels.BlazePose,\n {\n runtime: \"mediapipe\",\n modelType: \"full\",\n solutionPath: TENSORFLOW_SOLUTION_PATH,\n }\n );\n console.log(\"MediaPipe detector created successfully\");\n } catch (mediapipeError) {\n console.warn(\"MediaPipe failed, falling back to TFJS:\", mediapipeError);\n \n // Fallback to TFJS runtime\n globalDetector = await globalPoseLib.createDetector(\n globalPoseLib.SupportedModels.BlazePose,\n {\n runtime: \"tfjs\",\n modelType: \"full\",\n }\n );\n console.log(\"TFJS detector created successfully\");\n }\n \n console.log(\"TensorFlow fully loaded and ready\");\n return true;\n } catch (error) {\n console.error(\"Failed to load TensorFlow dependencies:\", error);\n globalLoadingPromise = null; // Reset so it can retry\n return false;\n }\n }\n\n function isFrontFrame(body: KeypointTuple[]) {\n return body.filter((p) => p[2] > 0.7).length === 22;\n }\n\n const poseDetector = async (callback: () => void, webcamRef: any) => {\n if (!globalDetector || !mounted.current || !webcamRef?.current?.video) {\n console.log(\"Pose detector not ready:\", {\n detector: !!globalDetector,\n mounted: mounted.current,\n webcam: !!webcamRef?.current?.video\n });\n return;\n }\n\n try {\n const poses = await globalDetector.estimatePoses(\n webcamRef.current.video,\n { flipHorizontal: false }\n );\n\n if (!poses.length) return;\n\n const body: KeypointTuple[] = poses[0].keypoints\n .slice(11)\n .map((kp: any) => [\n kp.x > 0 && kp.x < 720 ? kp.x : -1,\n kp.y > 0 && kp.y < 1280 ? kp.y : -1,\n kp.score ?? 0,\n ]);\n\n if (spinPhaseRef.current === 0 && !isFrontFrame(body)) {\n setConsecutiveFronts((prev) => prev + 1);\n }\n\n if (spinPhaseRef.current === 1 && isFrontFrame(body)) {\n setConsecutiveFronts((prev) => prev + 1);\n }\n\n if (spinPhaseRef.current === 2) callback();\n } catch (err) {\n console.error(\"Pose detection error:\", err);\n }\n };\n\n useEffect(() => {\n consecutiveFrontsRef.current = consecutiveFronts;\n\n if (consecutiveFronts > 6 && spinPhaseRef.current < 2) {\n setSpinPhase((s) => s + 1);\n setConsecutiveFronts(0);\n }\n }, [consecutiveFronts]);\n\n useEffect(() => {\n spinPhaseRef.current = spinPhase;\n }, [spinPhase]);\n\n // Reset function if needed\n const resetDetector = () => {\n spinPhaseRef.current = 0;\n consecutiveFrontsRef.current = 0;\n setConsecutiveFronts(0);\n setSpinPhase(0);\n };\n\n // Retry loading if failed\n const retryLoading = async () => {\n if (!globalDetector && !globalLoadingPromise) {\n globalLoadingPromise = loadDependenciesGlobal();\n const success = await globalLoadingPromise;\n if (success && mounted.current) {\n setIsLoaded(true);\n }\n }\n };\n\n return { \n poseDetector, \n isLoaded,\n spinPhase,\n resetDetector,\n retryLoading\n };\n}","import { createContext } from \"react\";\n\nconst ParamsContext = createContext<any>(null);\n\nexport default ParamsContext;\n","/* eslint-disable no-use-before-define */\nimport React, { useCallback, useContext, useEffect, useRef, useState } from \"react\";\nimport CameraScanChild from \"./CameraScanChild\";\nimport posthog from \"posthog-js\";\nimport Webcam from \"react-webcam\";\nimport { ScanningComponentProps } from \"../../types/interfaces\";\nimport useTensorFlow from \"../../customHooks/useTensorFlow\";\nimport ParamsContext from \"../../utils/context/paramsContext\";\nimport { generateUuid, getCurrentTimeInSeconds, handleScanTimeCapture, rescanSupportCaptureEvent } from \"../../utils/utils\";\nimport speechService from \"../../utils/service/speechService\";\nimport swan from \"../../utils/service/swanService\";\nimport { videoTypes, voiceOverAssetsPath } from \"../../utils/constants\";\n\n\nlet id: string | null = null;\nlet audioTimeoutId: number | undefined| NodeJS.Timeout;\nlet lastVideoPlayed: {\n\tskipCount: number;\n\tno_of_times_skipped: number;\n\taudioName: string;\n} | null = null;\n\nfunction ScanningComponent({ setIsScanLocked, resetDetector, scanID, setIsVideoUploaded, setScanFailsError, setScanStartTime, setScanUniqueKey, userDetails, config }: ScanningComponentProps) {\n\tconst { gender, heightInCm, email, shopDomain } = userDetails;\n\tconst webcamRef = useRef<Webcam | null>(null);\n\tconst mediaRecorderRef = useRef<MediaRecorder | null>(null);\n\tconst [recordedChunks, setRecordedChunks] = useState<Blob[]>([]);\n\tconst [loadingCam, setLoadingCam] = useState(true);\n\tconst [recordingStarted, setRecordingStarted] = useState(false);\n\tconst [faceDone, setFaceDone] = useState(false);\n\tconst [mediaRecorderStopped, setMediaRecorderStopped] = useState(true);\n\tconst [isScanning, setIsScanning] = useState(false);\n\tconst captureVideoTimeOutHandle = useRef<number | null|NodeJS.Timeout>(null);\n\tconst [audioSource, setAudioSource] = useState(\"\");\n\tconst [audioSourceList, setAudioSourceList] = useState<string[]>([]);\n\tconst [emptyAudioSource, setEmptyAudioSource] = useState(\"\");\n\tconst [startAgain, setStartAgain] = useState(false);\n\tconst [showRestart, setRestart] = useState(false);\n\tconst [pause, setPause] = useState(false);\n\tconst [events, setEvents] = useState<any>([]);\n\tconst [showPause, setShowPause] = useState(false);\n\tconst allowAudioToPlay = useRef(true);\n\tconst { poseDetector } = useTensorFlow();\n\tconst firstScan = useRef(true);\n\tconst poseStoppedRef = useRef(false);\n\tlet counter = 0;\n\n\tconst { setStartGyro, handleFileUpload, setUploadLoading } = useContext(ParamsContext);\n\n\tconst handleShowStreamCamera = () => {\n\t\tposeStoppedRef.current = false;\n\t\tclearTimeout(audioTimeoutId);\n\t\tif (captureVideoTimeOutHandle.current) clearTimeout(captureVideoTimeOutHandle.current);\n\t\tsetScanUniqueKey(generateUuid());\n\t\tsetScanFailsError(\"\");\n\t\tsetUploadLoading?.(false);\n\t\tsetRecordedChunks([]);\n\t\tsetLoadingCam(true);\n\t\tsetRecordingStarted(false);\n\t\tsetFaceDone(false);\n\t\tsetMediaRecorderStopped(true);\n\t\tsetIsScanning(false);\n\t\tcaptureVideoTimeOutHandle.current = null;\n\t\tsetAudioSource(\"\");\n\t\tsetAudioSourceList([]);\n\t\tsetEmptyAudioSource(\"\");\n\t\tsetStartAgain(!startAgain);\n\t\tsetStartGyro(false);\n\t\tspeechService.stopAudio();\n\t\tsetRestart(false);\n\t\tsetPause(false);\n\t\tcounter = 0;\n\t\tif (mediaRecorderRef.current !== null) {\n\t\t\tmediaRecorderRef.current.stop();\n\t\t}\n\n\t\tevents.forEach((el: any) => {\n\t\t\tif (mediaRecorderRef.current) mediaRecorderRef.current.removeEventListener(\"dataavailable\", el);\n\t\t});\n\n\t\tsetEvents([]);\n\t\tallowAudioToPlay.current = true;\n\t\tsetShowPause(false);\n\t\tsetIsVideoUploaded(false);\n\t};\n\n\tconst handleUserMedia = useCallback(() => {\n\t\tsetTimeout(() => {\n\t\t\tsetLoadingCam(false);\n\t\t}, 1000);\n\t}, []);\n\n\tconst handleReScan = useCallback(() => {\n\t\trescanSupportCaptureEvent({\n\t\t\teventName: `${shopDomain}/rescan`,\n\t\t\temail,\n\t\t\tscanID: scanID,\n\t\t\theight: heightInCm,\n\t\t\tgender,\n\t\t\tstatus: false,\n\t\t});\n\t\tallowAudioToPlay.current = false;\n\t\thandleShowStreamCamera();\n\t\tstartSendingVideoFrames();\n\t}, [handleShowStreamCamera, scanID, email]);\n\n\tconst handlePause = useCallback(() => {\n\t\tallowAudioToPlay.current = false;\n\t\tsetPause(true);\n\t\tsetShowPause(false);\n\t\tif (captureVideoTimeOutHandle.current) clearTimeout(captureVideoTimeOutHandle.current);\n\t\tif (mediaRecorderRef.current) {\n\t\t\tmediaRecorderRef.current.pause();\n\t\t}\n\t\tspeechService.stopAudio();\n\t\tswan.poseDetection.disconnect();\n\t\tcounter = 0;\n\t\tif (mediaRecorderRef.current) {\n\t\t\tmediaRecorderRef.current.stop();\n\t\t}\n\t\tevents.forEach((el: any) => {\n\t\t\tif (mediaRecorderRef.current) mediaRecorderRef.current.removeEventListener(\"dataavailable\", el);\n\t\t});\n\t\tsetEvents([]);\n\t\tclearTimeout(audioTimeoutId);\n\t}, [mediaRecorderRef, events, speechService, allowAudioToPlay]);\n\n\tconst supportedTypes = videoTypes.filter((type) => MediaRecorder.isTypeSupported(type));\n\n\tconst stopRecording = useCallback(async () => {\n\t\tallowAudioToPlay.current = true;\n\t\tawait speechService.playAudio(`${voiceOverAssetsPath}SpotOn.mp3`);\n\t\tsetPause(false);\n\t\tsetShowPause(false);\n\t\tif (captureVideoTimeOutHandle.current) clearTimeout(captureVideoTimeOutHandle.current);\n\t\tsetRecordingStarted(false);\n\t}, [captureVideoTimeOutHandle, speechService]);\n\n\tconst handleSocket = useCallback(async () => {\n\t\ttry {\n\t\t\tid = await swan.poseDetection.connect();\n\n\t\t\tposthog.capture(`${shopDomain}/pose_detection_connected`, {\n\t\t\t\tscanID: scanID,\n\t\t\t\temail,\n\t\t\t\tid,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.log(error, \"while connecting websocket\");\n\t\t}\n\t}, [scanID, shopDomain, email]);\n\n\tconst handleSpinDataAvailable = useCallback(\n\t\t({ data }: BlobEvent) => {\n\t\t\tif (data && data.size > 0 && allowAudioToPlay.current) {\n\t\t\t\tsetRecordedChunks((prev) => prev.concat(data));\n\t\t\t\tif (!poseStoppedRef.current && webcamRef.current) {\n\t\t\t\t\tposeStoppedRef.current = true;\n\t\t\t\t\tposeDetector(() => {\n\t\t\t\t\t\tstopRecording();\n\t\t\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\t\t\teventName: `${shopDomain}/tensorFlow`,\n\t\t\t\t\t\t\tscanID: scanID,\n\t\t\t\t\t\t\temail,\n\t\t\t\t\t\t\tmessage: \"recording stopped by tensorflow \",\n\t\t\t\t\t\t});\n\t\t\t\t\t}, webcamRef);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[stopRecording, handleScanTimeCapture, shopDomain, scanID, email, poseDetector, webcamRef],\n\t);\n\n\tconst playAudio = useCallback(async () => {\n\t\tif (audioSourceList.length > 0 && allowAudioToPlay.current) {\n\t\t\tawait speechService.playAudio(voiceOverAssetsPath + audioSourceList[audioSourceList.length - 1]);\n\t\t\tif (allowAudioToPlay.current) {\n\t\t\t\taudioTimeoutId = setTimeout(playAudio, 2000);\n\t\t\t}\n\t\t}\n\t}, [audioSourceList, allowAudioToPlay]);\n\n\tconst handleStartCaptureClick = useCallback(() => {\n\t\tif (mediaRecorderRef && mediaRecorderRef.current) {\n\t\t\tmediaRecorderRef.current.stop();\n\t\t}\n\t\tsetRecordingStarted(true);\n\t\ttry {\n\t\t\tif (webcamRef && webcamRef.current && webcamRef.current.stream) {\n\t\t\t\tconst mediaRecorderOptions = {\n\t\t\t\t\tmimeType: supportedTypes[0],\n\t\t\t\t};\n\t\t\t\tmediaRecorderRef.current = new MediaRecorder(webcamRef.current.stream, mediaRecorderOptions);\n\t\t\t\tmediaRecorderRef.current.addEventListener(\"dataavailable\", handleSpinDataAvailable);\n\n\t\t\t\tsetEvents([...events, handleSpinDataAvailable]);\n\t\t\t\tmediaRecorderRef.current.start(1000);\n\t\t\t\tsetMediaRecorderStopped(false);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"error while using media recorder\", e);\n\t\t}\n\t}, [webcamRef, supportedTypes, handleSpinDataAvailable, events]);\n\n\tconst postPoseProcess = useCallback(async () => {\n\t\tif (captureVideoTimeOutHandle.current) {\n\t\t\tclearTimeout(captureVideoTimeOutHandle.current);\n\t\t}\n\t\thandleStartCaptureClick();\n\t\tif (allowAudioToPlay.current) {\n\t\t\tcaptureVideoTimeOutHandle.current = setTimeout(async () => {\n\t\t\t\tif (allowAudioToPlay.current) {\n\t\t\t\t\tawait speechService.playAudio(`${voiceOverAssetsPath}SpotOn.mp3`);\n\t\t\t\t\tsetRecordingStarted(false);\n\t\t\t\t}\n\t\t\t}, 15000);\n\t\t}\n\t\tsetFaceDone(true);\n\t\tif (allowAudioToPlay.current) {\n\t\t\tawait speechService.playAudio(`${voiceOverAssetsPath}Spin.mp3`);\n\t\t}\n\t}, [handleStartCaptureClick, allowAudioToPlay, speechService]);\n\n\tconst handleDataAvailable = useCallback(\n\t\t({ data }: BlobEvent) => {\n\t\t\tif (data.size > 0 && swan.poseDetection.connected()) {\n\t\t\t\tswan.poseDetection.poseStatus(async (data) => {\n\t\t\t\t\tif (data && data.audio && data.audio.length > 0) {\n\t\t\t\t\t\tconst audio = document.querySelector(\"#audioElement\") as HTMLAudioElement | null;\n\t\t\t\t\t\tif (data.status === true && data.sid === id) {\n\t\t\t\t\t\t\tif (counter < 2) {\n\t\t\t\t\t\t\t\tif (counter === 0 && audio?.paused) {\n\t\t\t\t\t\t\t\t\tawait speechService.playAudio(voiceOverAssetsPath + data.audio);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcounter += 1;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetEmptyAudioSource(data.audio);\n\t\t\t\t\t\t\t\tclearTimeout(audioTimeoutId);\n\t\t\t\t\t\t\t\tswan.poseDetection.disconnect();\n\t\t\t\t\t\t\t\tsetTimeout(postPoseProcess, 1000);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcounter = 0;\n\t\t\t\t\t\t\tif (audio?.paused && (!lastVideoPlayed || lastVideoPlayed?.audioName !== data.audio)) {\n\t\t\t\t\t\t\t\tlastVideoPlayed = {\n\t\t\t\t\t\t\t\t\tskipCount: 2,\n\t\t\t\t\t\t\t\t\tno_of_times_skipped: 0,\n\t\t\t\t\t\t\t\t\taudioName: data.audio,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tspeechService.playAudio(voiceOverAssetsPath + data.audio);\n\t\t\t\t\t\t\t} else if (lastVideoPlayed?.audioName === data.audio && audio?.paused) {\n\t\t\t\t\t\t\t\tif (lastVideoPlayed && lastVideoPlayed.no_of_times_skipped >= lastVideoPlayed.skipCount) {\n\t\t\t\t\t\t\t\t\tlastVideoPlayed.no_of_times_skipped = 0;\n\t\t\t\t\t\t\t\t\tspeechService.playAudio(voiceOverAssetsPath + data.audio);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (lastVideoPlayed) lastVideoPlayed.no_of_times_skipped += 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (webcamRef?.current && webcamRef.current.getScreenshot() !== null) {\n\t\t\t\t\tswan.poseDetection.videoEmit({\n\t\t\t\t\t\timage: webcamRef.current.getScreenshot() || \"\",\n\t\t\t\t\t\tscanId: scanID,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[webcamRef, scanID, swan, id, counter, postPoseProcess, speechService],\n\t);\n\n\tconst startSendingVideoFrames = useCallback(async () => {\n\t\tsetIsScanning(true);\n\t\tsetStartGyro(true);\n\t\tif (firstScan.current) {\n\t\t\tfirstScan.current = false;\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: \"scan started\",\n\t\t\t\tscanID: scanID,\n\t\t\t\tstatus: \"success\",\n\t\t\t\temail,\n\t\t\t});\n\t\t}\n\t\tsetScanStartTime(getCurrentTimeInSeconds());\n\t\tsetLoadingCam(true);\n\t\tif (allowAudioToPlay.current) {\n\t\t\tawait speechService.playAudio(`${voiceOverAssetsPath}StartScan.mp3`);\n\t\t}\n\t\tif (allowAudioToPlay.current) {\n\t\t\tawait speechService.playAudio(`${voiceOverAssetsPath}LiftArmsAndHoldAtHip.mp3`);\n\t\t}\n\t\tif (allowAudioToPlay.current) {\n\t\t\tsetIsScanning(false);\n\t\t\tsetRecordingStarted(true);\n\t\t\tsetRestart(true);\n\t\t\tsetShowPause(true);\n\t\t\thandleUserMedia();\n\t\t}\n\t\ttry {\n\t\t\tif (webcamRef && webcamRef.current && webcamRef.current.stream && allowAudioToPlay.current) {\n\t\t\t\tconst mediaRecorderOptions = {\n\t\t\t\t\tmimeType: supportedTypes[0],\n\t\t\t\t};\n\t\t\t\tif (allowAudioToPlay.current) {\n\t\t\t\t\tmediaRecorderRef.current = new MediaRecorder(webcamRef.current.stream, mediaRecorderOptions);\n\t\t\t\t}\n\t\t\t\tif (allowAudioToPlay.current && mediaRecorderRef.current) {\n\t\t\t\t\tmediaRecorderRef.current.addEventListener(\"dataavailable\", handleDataAvailable);\n\t\t\t\t}\n\n\t\t\t\tsetEvents([...events, handleDataAvailable]);\n\t\t\t\tif (mediaRecorderRef.current) mediaRecorderRef.current.start(1000);\n\t\t\t\tsetMediaRecorderStopped(false);\n\t\t\t\tif (allowAudioToPlay.current) {\n\t\t\t\t\taudioTimeoutId = setTimeout(playAudio, 2000);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.log(\"error ----------\", err);\n\t\t}\n\t}, [webcamRef, supportedTypes, handleDataAvailable, events, playAudio, allowAudioToPlay]);\n\n\tuseEffect(() => {\n\t\tif (shopDomain) {\n\t\t\tsetIsScanLocked(true);\n\t\t\thandleSocket();\n\t\t}\n\t\treturn () => {\n\t\t\tif (id) {\n\t\t\t\tswan.poseDetection.disconnect();\n\t\t\t\tposthog.capture(`${shopDomain}/pose_detection_disconnected`, {\n\t\t\t\t\tscanID: scanID,\n\t\t\t\t\temail,\n\t\t\t\t\tid,\n\t\t\t\t});\n\t\t\t}\n\t\t\tevents.forEach((el: any) => {\n\t\t\t\tmediaRecorderRef?.current?.removeEventListener(\"dataavailable\", el);\n\t\t\t});\n\t\t};\n\t}, [startAgain, shopDomain]);\n\tuseEffect(() => {\n\t\taudioSourceList.push(audioSource);\n\t}, [audioSource]);\n\n\tuseEffect(() => {\n\t\tsetAudioSourceList([]);\n\t}, [emptyAudioSource]);\n\tuseEffect(() => {\n\t\tconst bypassChecksToBackup = recordedChunks.length && recordedChunks.length > 0;\n\t\tif (!mediaRecorderStopped && bypassChecksToBackup && !recordingStarted && allowAudioToPlay.current && !pause) {\n\t\t\tif (mediaRecorderRef && mediaRecorderRef.current) {\n\t\t\t\tif (!recordingStarted) {\n\t\t\t\t\tmediaRecorderRef.current.stop();\n\t\t\t\t\tsetMediaRecorderStopped(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [mediaRecorderStopped, recordingStarted, recordedChunks, pause]);\n\n\tuseEffect(() => {\n\t\tconst bypassChecksToBackup = recordedChunks.length && recordedChunks.length > 0;\n\t\tif (!mediaRecorderStopped && bypassChecksToBackup && !recordingStarted) {\n\t\t\tif (mediaRecorderRef && mediaRecorderRef.current && allowAudioToPlay.current && !pause) {\n\t\t\t\tif (!recordingStarted) {\n\t\t\t\t\tconst videoFile = new File(recordedChunks, `${scanID}.webm`, {\n\t\t\t\t\t\ttype: \"video/webm\",\n\t\t\t\t\t});\n\t\t\t\t\tsetUploadLoading?.(true);\n\t\t\t\t\tsetScanFailsError(\"\");\n\t\t\t\t\thandleFileUpload?.(videoFile);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"No video found to upload\");\n\t\t}\n\t}, [mediaRecorderStopped, recordingStarted, recordedChunks, pause, mediaRecorderRef, allowAudioToPlay]);\n\n\tuseEffect(() => {\n\t\thandleShowStreamCamera();\n\t}, []);\n\n\treturn (\n\t\t<CameraScanChild\n\t\t\tresetDetector={resetDetector}\n\t\t\thandleShowStreamCamera={handleShowStreamCamera}\n\t\t\tloadingCam={loadingCam}\n\t\t\thandlePause={handlePause}\n\t\t\tshowRestart={showRestart}\n\t\t\tpause={pause}\n\t\t\thandleReScan={handleReScan}\n\t\t\trecordingStarted={recordingStarted}\n\t\t\tisScanning={isScanning}\n\t\t\tstartSendingVideoFrames={startSendingVideoFrames}\n\t\t\tfaceDone={faceDone}\n\t\t\tstopRecording={stopRecording}\n\t\t\tshowPause={showPause}\n\t\t\twebcamRef={webcamRef}\n\t\t\thandleUserMedia={handleUserMedia}\n\t\t\tconfig={config}\n\t\t/>\n\t);\n}\n\nexport default React.memo(ScanningComponent);\n","/* eslint-disable no-use-before-define */\n\nimport { useEffect, useState, useRef } from \"react\";\nimport LevelScreen from \"./LevelScreen\";\nimport ScanningComponent from \"./ScanningComponent\";\nimport { AngleDetectorProps } from \"../../types/interfaces\";\nimport { IOSDeviceOrientationEvent } from \"../../customHooks/useGyroSensor\";\nimport useTensorFlow from \"src/customHooks/useTensorFlow\";\n\n\n\nexport default function AngleDetector({ scanID, userDetails, setIsVideoUploaded, setScanFailsError, setScanStartTime, setScanUniqueKey, config }: AngleDetectorProps) {\n\tconst [angle, setAngle] = useState(90);\n\tconst [calibrationOffset, setCalibrationOffset] = useState(0);\n\tconst [countdown, setCountdown] = useState<number | null>(null);\n\tconst [isScanning, setIsScanning] = useState(false);\n\tconst [stabilityScore, setStabilityScore] = useState(0);\n\tconst lastAnglesRef = useRef<number[]>([]);\n\tconst [isScanLocked, setIsScanLocked] = useState(false);\n\tconst calibratedAngle = angle - calibrationOffset;\n\tconst isInTargetRange = calibratedAngle >= 80 && calibratedAngle <= 95;\n const { isLoaded: tensorFlowReady } = useTensorFlow();\n\n\tconst resetDetector = () => {\n\t\tsetAngle(90);\n\t\tsetCalibrationOffset(0);\n\t\tsetCountdown(null);\n\t\tsetIsScanning(false);\n\t\tsetStabilityScore(0);\n\t\tsetIsScanLocked(false);\n\t\tlastAnglesRef.current = [];\n\t};\n\n\tuseEffect(() => {\n\t\tif (typeof window !== \"undefined\" && window.DeviceOrientationEvent) {\n\t\t\tconst handleOrientation = (event: DeviceOrientationEvent) => {\n\t\t\t\tif (event.beta !== null) {\n\t\t\t\t\tlet newAngle = Math.abs(event.beta);\n\t\t\t\t\tif (event.gamma !== null) {\n\t\t\t\t\t\tnewAngle *= Math.cos((event.gamma * Math.PI) / 180);\n\t\t\t\t\t}\n\t\t\t\t\tnewAngle = Math.max(0, Math.min(180, newAngle));\n\t\t\t\t\tsetAngle(newAngle);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst requestPermission = async () => {\n\t\t\t\tconst DeviceOrientation = DeviceOrientationEvent as unknown as IOSDeviceOrientationEvent;\n\n\t\t\t\tif (DeviceOrientation && typeof DeviceOrientation.requestPermission === \"function\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst permission = await DeviceOrientation.requestPermission();\n\t\t\t\t\t\tif (permission === \"granted\") {\n\t\t\t\t\t\t\t// wrappedHandler = timeout(handleOrientation, 2000);\n\t\t\t\t\t\t\twindow.addEventListener(\"deviceorientation\", handleOrientation);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(\"Permission error\", e);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// wrappedHandler = handleOrientation;\n\t\t\t\t\twindow.addEventListener(\"deviceorientation\", handleOrientation);\n\t\t\t\t}\n\n\t\t\t\treturn () => {\n\t\t\t\t\tif (handleOrientation) {\n\t\t\t\t\t\twindow.removeEventListener(\"deviceorientation\", handleOrientation);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t\tdocument.addEventListener(\"click\", requestPermission, { once: true });\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tlastAnglesRef.current = [...lastAnglesRef.current.slice(-4), calibratedAngle];\n\n\t\tif (lastAnglesRef.current.length >= 5) {\n\t\t\tconst variation = Math.max(...lastAnglesRef.current) - Math.min(...lastAnglesRef.current);\n\t\t\tif (isInTargetRange && variation < 2) {\n\t\t\t\tsetStabilityScore((prev) => Math.min(100, prev + 10));\n\t\t\t} else {\n\t\t\t\tsetStabilityScore((prev) => Math.max(0, prev - 20));\n\t\t\t}\n\t\t}\n\n\t\tif (!isInTargetRange && (countdown !== null || isScanning)) {\n\t\t\tresetCountdown();\n\t\t}\n\t}, [calibratedAngle, isInTargetRange, countdown, isScanning]);\n\n\tuseEffect(() => {\n\t\tif (stabilityScore >= 100 && countdown === null && !isScanning && tensorFlowReady) {\n\t\t\tstartCountdown();\n\t\t}\n\t\tif (stabilityScore < 50 && countdown !== null) {\n\t\t\tresetCountdown();\n\t\t}\n\t}, [stabilityScore, countdown, isScanning]);\n\n\tconst startCountdown = () => {\n\t\tsetCountdown(3);\n\t\tconst timer = setInterval(() => {\n\t\t\tsetCountdown((prev) => {\n\t\t\t\tif (prev === null || prev <= 1) {\n\t\t\t\t\tclearInterval(timer);\n\t\t\t\t\tsetIsScanning(true);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn prev - 1;\n\t\t\t});\n\t\t}, 1000);\n\t};\n\n\tconst resetCountdown = () => {\n\t\tsetCountdown(null);\n\t\tif (!isScanLocked) {\n\t\t\tsetIsScanning(false);\n\t\t}\n\t};\n\n\treturn (\n\t\t<LevelScreen angle={calibratedAngle} countdown={countdown} isScanning={isScanning} isInTargetRange={isInTargetRange} stabilityScore={stabilityScore} config={config}>\n\t\t\t{isScanning && (\n\t\t\t\t<ScanningComponent\n\t\t\t\t\tsetIsScanLocked={setIsScanLocked}\n\t\t\t\t\tresetDetector={resetDetector}\n\t\t\t\t\tscanID={scanID}\n\t\t\t\t\tuserDetails={userDetails}\n\t\t\t\t\tsetIsVideoUploaded={setIsVideoUploaded}\n\t\t\t\t\tsetScanFailsError={setScanFailsError}\n\t\t\t\t\tsetScanStartTime={setScanStartTime}\n\t\t\t\t\tsetScanUniqueKey={setScanUniqueKey}\n\t\t\t\t\tconfig={config}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</LevelScreen>\n\t);\n}\n","import React, { useContext } from \"react\";\nimport Dialog from \"@mui/material/Dialog\";\nimport { getBrowserName } from \"../utils/utils\";\nimport { LanguageContext } from \"../utils/context/languageContext\";\nimport { LanguageKeys } from \"../utils/constants\";\n\nfunction Modal({ message, config }: { message?: string; config?: any }) {\n\tconst [open] = React.useState(true);\n\tconst { translate } = useContext(LanguageContext) || {};\n\treturn (\n\t\t<Dialog\n\t\t\topen={open}\n\t\t\tclassName=\"confirm-modal\"\n\t\t>\n\t\t\t<div className=\"modal-main\">\n\t\t\t\t<div className=\"text-center\">\n\t\t\t\t\t{message ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: config?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\t\t\t\tfontSize: config?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\t\t\t\tcolor: config?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\t\t\t\tfontWeight: config?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tSeems camera already in use\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tclassName=\"mt-[0.5rem] text-sm\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t\tfontSize: config?.style?.base?.baseFontSize || \"16px\",\n\t\t\t\t\t\t\t\t\tcolor: config?.style?.base?.baseTextColor || \"#000\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tCan you try closing the browser/app that is using the camera and try again here.{\" \"}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: config?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\t\t\t\tfontSize: config?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\t\t\t\tcolor: config?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\t\t\t\tfontWeight: config?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{translate?.(LanguageKeys.Please_check_your_setting_for_camera_permission)}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tclassName=\"mt-[0.5rem] text-sm\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: config?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t\tfontSize: config?.style?.base?.baseFontSize || \"16px\",\n\t\t\t\t\t\t\t\t\tcolor: config?.style?.base?.baseTextColor || \"#000\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>{`${translate?.(LanguageKeys.Settings)} > ${getBrowserName()} > ${translate?.(LanguageKeys.Enable_the_camera_permissions)}`}</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Dialog>\n\t);\n}\n\nexport default Modal;\n","import { useEffect, useState, useRef, useCallback, Dispatch, SetStateAction } from \"react\";\nimport Webcam from \"react-webcam\";\nimport Modal from \"../Modal\";\nimport LoadingScreen from \"../LoadingScreen\";\nimport { checkCameraPermission } from \"../../utils/utils\";\nimport { videoConstraints } from \"../../utils/constants\";\n\n\nfunction CameraPermission({ setShowDrawer, config,loader }: { setShowDrawer?: Dispatch<SetStateAction<boolean>>; config?: any,loader?:string }) {\n\tconst [showDeniedModal, setShowDeniedModal] = useState({\n\t\tdisabled: false,\n\t\tmessage: \"\",\n\t});\n\tconst [loading, setLoading] = useState(true);\n\tconst webcamRef = useRef(null);\n\n\tconst handleCameraPermission = useCallback(async () => {\n\t\tconst permission = await checkCameraPermission();\n\t\tsetShowDeniedModal(permission);\n\t\tsetLoading(false);\n\t}, []);\n\n\tuseEffect(() => {\n\t\thandleCameraPermission();\n\t}, []);\n\n\tif (loading) {\n\t\treturn <LoadingScreen url={loader} />\n\t}\n\n\tif (showDeniedModal?.disabled) {\n\t\treturn <Modal config={config} message={showDeniedModal?.message} />;\n\t}\n\treturn (\n\t\t<Webcam\n\t\t\taudio={false}\n\t\t\tref={webcamRef}\n\t\t\tscreenshotQuality={1}\n\t\t\tvideoConstraints={videoConstraints}\n\t\t\tmirrored\n\t\t\tonUserMedia={() => setShowDrawer?.(true)}\n\t\t\tscreenshotFormat=\"image/jpeg\"\n\t\t\tstyle={{\n\t\t\t\tposition: \"relative\",\n\t\t\t\ttop: 0,\n\t\t\t\tbottom: 0,\n\t\t\t\tzIndex: 0,\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100%\",\n\t\t\t\tobjectFit: \"cover\",\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport default CameraPermission;\n","\nimport React, { useEffect, useRef } from \"react\";\nimport videojs from \"video.js\";\nimport type Player from \"video.js/dist/types/player\";\n// import \"video.js/dist/video-js.css\";\nimport { videoPoster } from \"../../utils/constants\";\n\nfunction VideoPlayer({ link, onReady, wrapperClassName = \"[&_video]:rounded-t-[20px] w-full h-full\" }: { link?: string; wrapperClassName?: string; onReady?: (args: Player) => void }) {\n\tconst videoReference = useRef<HTMLVideoElement | null>(null);\n\tconst playerReference = useRef<Player | null>(null);\n\n\tlet videoJsOptions: any = {\n\t\tautoplay: true,\n\t\tcontrols: false,\n\t\tresponsive: true,\n\t\tfluid: true,\n\t\tmuted: true,\n\t\tnavigationUI: \"hide\",\n\t\tpreload: \"metadata\",\n\t\tposter: videoPoster,\n\t};\n\n\tuseEffect(() => {\n\t\tif (!playerReference.current && link && videoReference?.current) {\n\t\t\tconst player = videojs(videoReference.current, {\n\t\t\t\t...videoJsOptions,\n\t\t\t});\n\t\t\tplayer.ready(() => {\n\t\t\t\tplayerReference.current = player;\n\n\t\t\t\tconst updatedOptions = {\n\t\t\t\t\t...videoJsOptions,\n\t\t\t\t\tsources: [{ src: link, type: \"application/x-mpegURL\" }],\n\t\t\t\t};\n\n\t\t\t\tplayer.autoplay(updatedOptions.autoplay);\n\t\t\t\tplayer.src(updatedOptions.sources);\n\n\t\t\t\tonReady?.(player);\n\t\t\t});\n\t\t}\n\t}, [link, videoReference]);\n\n\tuseEffect(() => {\n\t\tconst player = playerReference.current;\n\t\treturn () => {\n\t\t\tif (player && !player.isDisposed()) {\n\t\t\t\tplayer.dispose();\n\t\t\t\tplayerReference.current = null;\n\t\t\t}\n\t\t};\n\t}, [playerReference]);\n\n\treturn (\n\t\t<div className={wrapperClassName}>\n\t\t\t<video ref={videoReference} muted className=\"video-js\" playsInline onDrag={(e) => e.preventDefault()} />\n\t\t</div>\n\t);\n}\nexport default VideoPlayer;\n","import { useContext, useState } from \"react\";\nimport Dialog from \"@mui/material/Dialog\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport Header from \"../Header\";\nimport VideoPlayer from \"./VideoPlayer\";\nimport { LanguageContext } from \"../../utils/context/languageContext\";\nimport { ScanErrorMessageProps } from \"../../types/interfaces\";\nimport { generateUuid, handleErrorMessage } from \"../../utils/utils\";\nimport { GENDER, LanguageKeys, VIDEO_POSTER_GENDER_BASED } from \"../../utils/constants\";\nimport SpecificButton from \"../../atoms/specificButton/SpecificButton\";\n\n\nfunction ScanErrorMessage({ scanFailsError, serverAtCapacity = false, onNext, gender, setScanUniqueKey, resolvedConfig, setIsVideoUploaded }: ScanErrorMessageProps) {\n\tconst { translate } = useContext(LanguageContext) || {};\n\tconst [showModal, setShowModal] = useState(false);\n\n\tconst handleBtnClick = () => {\n\t\tif (onNext) {\n\t\t\tonNext?.();\n\t\t} else {\n\t\t\tsetScanUniqueKey(generateUuid());\n\t\t}\n\t\tsetIsVideoUploaded(false);\n\t};\n\n\tconst handleShowModal = () => {\n\t\tsetShowModal(!showModal);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"flex flex-col h-full max-w-[28rem] mx-auto w-full rounded-t-[20px] overflow-y-auto\" style={{ background: resolvedConfig?.style?.base?.backgroundColor }}>\n\t\t\t\t<div className=\"w-full max-w-[28rem] mx-auto pt-[1rem] px-[1rem]\">\n\t\t\t\t\t<Header noTitle resolvedConfig={resolvedConfig} />\n\t\t\t\t</div>\n\t\t\t\t<div className=\"flex-1\">\n\t\t\t\t\t{/* <VideoPlayer link={gender ? GENDER[gender].PRE_LINK : GENDER.male.PRE_LINK} /> */}\n\t\t\t\t\t{scanFailsError && (\n\t\t\t\t\t\t<div className=\"px-[1rem]\">\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tclassName=\"text-center\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\t\t\t\tfontSize: resolvedConfig?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\t\t\t\tcolor: resolvedConfig?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\t\t\t\tfontWeight: resolvedConfig?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tThere was an issue with your scan\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tReason:\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{handleErrorMessage(scanFailsError)}\n\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t<img className=\"my-[0.5rem] aspect-[2/1.4] w-full object-cover\" onClick={handleShowModal} src={VIDEO_POSTER_GENDER_BASED[gender]} alt=\"icon\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t{serverAtCapacity && (\n\t\t\t\t\t\t<div className=\"p-[1rem] text-center\">\n\t\t\t\t\t\t\t<h3\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.heading?.headingFontFamily || \"SeriouslyNostalgic Fn\",\n\t\t\t\t\t\t\t\t\tfontSize: resolvedConfig?.style?.heading?.headingFontSize || \"32px\",\n\t\t\t\t\t\t\t\t\tcolor: resolvedConfig?.style?.heading?.headingColor || \"#000\",\n\t\t\t\t\t\t\t\t\tfontWeight: resolvedConfig?.style?.heading?.headingFontWeight || \"normal\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{translate?.(LanguageKeys.Scan_s)} <span>{translate?.(LanguageKeys.vision_model)}</span> {translate?.(LanguageKeys.is_at_capacity)}\n\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tclassName=\"text-base mt-[0.5rem]\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tfontFamily: resolvedConfig?.style?.base?.baseFontFamily || \"Inter, sans-serif\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{translate?.(LanguageKeys.We_are_sorry_about_this_We_are_working_hard_to_add_capacity_Please_try_again_soon)}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t{scanFailsError && (\n\t\t\t\t\t<div className=\"p-[1rem] flex gap-[0.5rem]\">\n\t\t\t\t\t\t<SpecificButton disabled={false} buttonText=\"Scan again\" className=\"!shadow-none\" buttonFunc={handleBtnClick} resolvedConfig={resolvedConfig} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{showModal && (\n\t\t\t\t<Dialog className=\"w-screen h-screen video-modal\" onClose={handleShowModal} open={showModal}>\n\t\t\t\t\t<div className=\"flex justifyEnd \">\n\t\t\t\t\t\t<span className=\"closeBtn\" onClick={handleShowModal}>\n\t\t\t\t\t\t\t<CloseIcon className=\"absolute right-[8px] top-[8px] text-white z-[9]\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"aspect-video object-cover rounded-[20px] \">\n\t\t\t\t\t\t<VideoPlayer link={gender ? GENDER[gender].PRE_LINK : GENDER.male.PRE_LINK} wrapperClassName=\"w-screen h-screen fixed top-[0] left-[0]\" />\n\t\t\t\t\t</div>\n\t\t\t\t</Dialog>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default ScanErrorMessage;\n","import { useCallback, useEffect, useState } from \"react\";\nimport Box from \"@mui/material/Box\";\nimport { posthog } from \"posthog-js\";\nimport Header from \"./Header\";\nimport { Drawer } from \"@mui/material\";\nimport CameraPermission from \"./bodyScan/CameraPermission\";\nimport { UserDetails } from \"../types/interfaces\";\nimport { CLOTHING_BANNER_SCAN, CLOTHING_CUSTOM_FIT_SCAN, CLOTHING_CUSTOM_SCAN, maleMeasurementProgress, measurementProgress } from \"../utils/constants\";\nimport swan from \"../utils/service/swanService\";\nimport { GenderType } from \"../utils/enums\";\nimport SpecificButton from \"../atoms/specificButton/SpecificButton\";\n\nfunction SignUp({\n\tscanId,\n\tuserDetails,\n\tconfig,\n\tisFaceScan,\n\tisVideoUploadedCorrect,\n\tisMeasurementAvailable,\n\tonComplete,\n\tisSuccess,\n}: {\n\tconfig?: any;\n\tisFaceScan: boolean;\n\tscanId: string;\n\tisVideoUploadedCorrect?: boolean;\n\tisMeasurementAvailable?: boolean;\n\tuserDetails: UserDetails;\n\tonComplete?: () => void;\n\tisSuccess?: boolean;\n}) {\n\tconst { gender, shopDomain, heightInCm, deviceFocalLength, userName, email, scanType } = userDetails;\n\tconst isCustom = [CLOTHING_CUSTOM_SCAN, CLOTHING_BANNER_SCAN, CLOTHING_CUSTOM_FIT_SCAN].includes(scanType);\n\tconst [showDrawer, setShowDrawer] = useState(true);\n\tconst handlePostHogEvent = () => {\n\t\tposthog.capture(shopDomain, {\n\t\t\tscanID: scanId,\n\t\t\temail: email,\n\t\t\theight: heightInCm,\n\t\t\tfocalLength: deviceFocalLength,\n\t\t\tclothesFit: \"0\",\n\t\t\tgender: gender,\n\t\t});\n\t};\n\n\tconst handleSignUp = useCallback(async () => {\n\t\ttry {\n\t\t\tif (isCustom) {\n\t\t\t\tawait swan.auth.addUser({\n\t\t\t\t\tscanId,\n\t\t\t\t\temail,\n\t\t\t\t\tname: userName,\n\t\t\t\t\tgender,\n\t\t\t\t\theight: heightInCm,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlePostHogEvent();\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}, [isCustom]);\n\n\tuseEffect(() => {\n\t\tif (isVideoUploadedCorrect) {\n\t\t\thandleSignUp();\n\t\t}\n\t}, [isVideoUploadedCorrect]);\n\n\tconst showNextButton = isSuccess || (isFaceScan ? isMeasurementAvailable && isVideoUploadedCorrect : isVideoUploadedCorrect || isMeasurementAvailable);\n\n\treturn (\n\t\t<Box className=\"flex h-full w-full flex-col \">\n\t\t\t<div className=\"h-full w-full flex-col items-center justify-center flex\">\n\t\t\t\t<CameraPermission loader={config?.loader} setShowDrawer={setShowDrawer} />\n\t\t\t\t<Drawer\n\t\t\t\t\topen={showDrawer}\n\t\t\t\t\tonClose={(_, reason) => {\n\t\t\t\t\t\tif (reason === \"backdropClick\") {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tclassName=\"camera-drawer\"\n\t\t\t\t\tanchor=\"bottom\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"max-w-[28rem] mx-auto w-full h-full flex text-center flex-col justify-between items-center bg-primary rounded-t-[30px] p-[1rem]\"\n\t\t\t\t\t\tstyle={{ background: config?.style?.base?.backgroundColor }}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"w-full h-full flex flex-col\">\n\t\t\t\t\t\t\t<Header title=\"Your measurements are being taken\" resolvedConfig={config} />\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-center flex-1\">\n\t\t\t\t\t\t\t\t<video className=\"max-h-[calc(100vh-450px)] mx-auto w-full object-contain border-none\" muted loop autoPlay playsInline>\n\t\t\t\t\t\t\t\t\t<source src={gender === GenderType.Male ? maleMeasurementProgress : measurementProgress} type=\"video/mp4\" />\n\t\t\t\t\t\t\t\t</video>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{showNextButton && <SpecificButton resolvedConfig={config} className=\"!w-[180px] mx-auto\" buttonText=\"Next\" buttonFunc={onComplete && onComplete} />}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</Drawer>\n\t\t\t</div>\n\t\t</Box>\n\t);\n}\nexport default SignUp;\n","\"use client\"\nimport { useCallback, useContext, useEffect, useState } from \"react\";\nimport AngleDetector from \"./AngleDetector\";\nimport CameraPermission from \"./CameraPermission\";\nimport Modal from \"../Modal\";\nimport { Drawer } from \"@mui/material\";\nimport ScanErrorMessage from \"./ScanErrorMessage\";\nimport LoadingScreen from \"../LoadingScreen\";\nimport SignUp from \"../Signup\";\nimport posthog from \"posthog-js\";\nimport { BodyScanProps } from \"../../bodyScan\";\nimport { PreferredLanguage } from \"../../utils/enums\";\nimport useGyroSensor from \"../../customHooks/useGyroSensor\";\nimport { checkCameraPermission, createObjectMetadataArray, generateUuid, getCurrentTimeInSeconds, handleErrorMessage, handleScanTimeCapture, handleWebSocketCapture } from \"../../utils/utils\";\nimport LanguageContextProvider, { LanguageContext } from \"../../utils/context/languageContext\";\nimport { useLocalConfig } from \"../../config/useLocalConfig\";\nimport swan from \"../../utils/service/swanService\";\nimport { posthogPublicHost, posthogPublicKey } from \"../../utils/constants\";\nimport ParamsContext from \"../../utils/context/paramsContext\";\nimport MediaContextProvider from \"../../utils/context/mediaContext\";\n\n\nconst clothesFit = \"0\";\n\nexport const BodyScan: React.FC<BodyScanProps> = ({ userDetails, language=PreferredLanguage.English, config, onRetry, onScanSuccess, onComplete, onScanError,isError,isSuccess }) => {\n\t\n\tconst { gender, scanType, shopDomain, heightInCm, email, deviceFocalLength, deviceModelName, callbackUrl } = userDetails;\n\tconst [uploadLoading, setUploadLoading] = useState(false);\n\tconst [isVideoUploadedCorrect, setIsVideoUploadedCorrect] = useState(false);\n\tconst [isMeasurementAvailable, setIsMeasurementAvailable] = useState(false);\n\tconst [showDeniedModal, setShowDeniedModal] = useState({\n\t\tdisabled: false,\n\t\tmessage: \"\",\n\t});\n\tconst [scanFailsError, setScanFailsError] = useState(\"\");\n\tconst [isVideoUploaded, setIsVideoUploaded] = useState(false);\n\tconst [loading, setLoading] = useState(true);\n\tconst [startGyro, setStartGyro] = useState(false);\n\tconst [scanUniqueKey, setScanUniqueKey] = useState(\"\");\n\tconst [scanStartTime, setScanStartTime] = useState<number | null>(getCurrentTimeInSeconds());\n\tconst { gyroData } = useGyroSensor(startGyro);\n\tconst { setPreferredLanguage } = useContext(LanguageContext) || {};\n\tconst resolvedConfig = useLocalConfig(config);\n\n\tconst handleShowStreamCamera = useCallback(() => {\n\t\tsetScanUniqueKey(generateUuid());\n\t\tsetScanFailsError(\"\");\n\t\tsetUploadLoading(false);\n\t\tsetIsVideoUploaded(false);\n\t}, []);\n\n\tconst onError = (data: any) => {\n\t\tonScanError({ ...data, message: handleErrorMessage(data) });\n\t\tclearScanStartTimeAndScanId();\n\t\tsetIsMeasurementAvailable(false);\n\t\tsetScanFailsError(data);\n\t\tsetIsVideoUploadedCorrect(false);\n\t\thandleScanTimeCapture({\n\t\t\teventName: `${shopDomain}/measurement_failed/fit-view`,\n\t\t\tscanID: scanUniqueKey,\n\t\t\tstatus: \"failed\",\n\t\t\temail,\n\t\t\tmessage: handleErrorMessage(data),\n\t\t});\n\t\tif (scanStartTime)\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/scan_completion_time`,\n\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\tcompletionTime: getCurrentTimeInSeconds() - scanStartTime,\n\t\t\t\temail,\n\t\t\t});\n\t};\n\n\tconst clearScanStartTimeAndScanId = () => {\n\t\tsetScanStartTime(null);\n\t\tsetScanUniqueKey(\"\");\n\t};\n\n\tconst onSuccess = useCallback(\n\t\tasync (data: any) => {\n\t\t\tif (data && data?.scanStatus === \"success\" && data?.resultType === \"intermediate\" && data?.code === 200) {\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: `${shopDomain}/measurement_success/intermediate`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t\tonScanSuccess?.(data);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tclearScanStartTimeAndScanId();\n\t\t\tconst scanIdToSet = scanUniqueKey;\n\t\t\tsetIsMeasurementAvailable(true);\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/measurement_success/fit-view`,\n\t\t\t\tscanID: scanIdToSet,\n\t\t\t\tstatus: \"success\",\n\t\t\t\temail,\n\t\t\t});\n\t\t\tif (scanStartTime)\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: `${shopDomain}/scan_completion_time`,\n\t\t\t\t\tscanID: scanIdToSet,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\tcompletionTime: getCurrentTimeInSeconds() - scanStartTime,\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t},\n\t\t[scanType, shopDomain, scanUniqueKey],\n\t);\n\n\tconst handleMeasurementRecommendation = (scanId?: string) => {\n\t\tsetIsMeasurementAvailable(false);\n\t\tsetScanFailsError(\"\");\n\t\tsetIsVideoUploadedCorrect(false);\n\t\tswan.measurement.handleMeasurementSocket({\n\t\t\tscanId: scanId || scanUniqueKey,\n\t\t\tonOpen: () => {\n\t\t\t\thandleWebSocketCapture({\n\t\t\t\t\teventName: `${shopDomain}/webSocket`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tconnection: \"open\",\n\t\t\t\t\ttype: \"measurement_recommendation\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t},\n\t\t\tonClose: () =>\n\t\t\t\thandleWebSocketCapture({\n\t\t\t\t\teventName: `${shopDomain}/webSocket`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tconnection: \"close\",\n\t\t\t\t\ttype: \"measurement_recommendation\",\n\t\t\t\t\temail,\n\t\t\t\t}),\n\t\t\tonError: (err) => {\n\t\t\t\tonError(err);\n\t\t\t\thandleWebSocketCapture({\n\t\t\t\t\teventName: `${shopDomain}/webSocket`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tconnection: \"error\",\n\t\t\t\t\ttype: \"measurement_recommendation\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t},\n\t\t\tonSuccess: (data) => {\n\t\t\t\thandleWebSocketCapture({\n\t\t\t\t\teventName: `${shopDomain}/webSocket`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tconnection: \"success\",\n\t\t\t\t\ttype: \"measurement_recommendation\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t\tonSuccess(data);\n\t\t\t},\n\t\t});\n\t};\n\n\tconst handleFileUpload = useCallback(\n\t\tasync (file: File) => {\n\t\t\tconst arrayMetaData = createObjectMetadataArray({\n\t\t\t\tgender,\n\t\t\t\tfocal_length: `${deviceFocalLength}`,\n\t\t\t\theight: `${heightInCm}`,\n\t\t\t\tcustomer_store_url: shopDomain,\n\t\t\t\tclothes_fit: clothesFit,\n\t\t\t\tscan_type: scanType,\n\t\t\t\tcallback_url: callbackUrl || \"https://example.com/webhook\",\n\t\t\t});\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/body_scan_meta_data`,\n\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\temail,\n\t\t\t\tdata: JSON.stringify(arrayMetaData),\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tawait swan.fileUpload.uploadFileFrontend({\n\t\t\t\t\tfile,\n\t\t\t\t\tarrayMetaData,\n\t\t\t\t\tscanId: scanUniqueKey,\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t\tawait swan.fileUpload.setDeviceInfo({\n\t\t\t\t\tmodel: deviceModelName,\n\t\t\t\t\tdetection: \"manual\",\n\t\t\t\t\tgyro: gyroData,\n\t\t\t\t\tscanId: scanUniqueKey,\n\t\t\t\t});\n\t\t\t\tconsole.log(\"video successfully uploaded\");\n\t\t\t\tsetIsVideoUploaded(false);\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: `${shopDomain}/scan_success`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\temail,\n\t\t\t\t\tdata: JSON.stringify(arrayMetaData),\n\t\t\t\t});\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: \"scan finished\",\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\temail,\n\t\t\t\t});\n\t\t\t\tsetScanStartTime(getCurrentTimeInSeconds());\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsVideoUploaded(true);\n\t\t\t\t}, 3000);\n\t\t\t} catch (error) {\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: \"scan finished\",\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\temail,\n\t\t\t\t\tmessage: handleErrorMessage(error),\n\t\t\t\t});\n\t\t\t\thandleScanTimeCapture({\n\t\t\t\t\teventName: `${shopDomain}/scan_failed`,\n\t\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\temail,\n\t\t\t\t\tmessage: handleErrorMessage(error),\n\t\t\t\t\tdata: JSON.stringify(arrayMetaData),\n\t\t\t\t});\n\t\t\t\tsetScanFailsError(handleErrorMessage(error));\n\t\t\t\tsetIsVideoUploaded(false);\n\t\t\t\tconsole.log(error, \"video upload failed\");\n\t\t\t} finally {\n\t\t\t\tsetStartGyro(false);\n\t\t\t}\n\t\t},\n\t\t[scanUniqueKey, gyroData],\n\t);\n\tconst checkMeasurementStatus = useCallback(\n\t\tasync (scanId: string) => {\n\t\t\ttry {\n\t\t\t\tconst res = await swan.measurement.getMeasurementResult(scanId);\n\t\t\t\tconst isMeasured = res?.data?.isMeasured;\n\t\t\t\tconst tempScanStartTime = scanStartTime || getCurrentTimeInSeconds();\n\t\t\t\tconst currentTimeInSeconds = getCurrentTimeInSeconds();\n\t\t\t\tconst fiveMinutesInSeconds = 5 * 60;\n\t\t\t\tsetLoading(false);\n\t\t\t\tif (isMeasured === false) {\n\t\t\t\t\tclearScanStartTimeAndScanId();\n\t\t\t\t\tsetScanUniqueKey(generateUuid());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsetUploadLoading(true);\n\t\t\t\tif (isMeasured === true) {\n\t\t\t\t\tawait onSuccess(null);\n\t\t\t\t} else if (isMeasured === null && tempScanStartTime > currentTimeInSeconds + fiveMinutesInSeconds) {\n\t\t\t\t\tonError(res?.data?.error);\n\t\t\t\t} else {\n\t\t\t\t\thandleMeasurementRecommendation(scanId);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t\tclearScanStartTimeAndScanId();\n\t\t\t\tsetScanUniqueKey(generateUuid());\n\t\t\t\tsetUploadLoading(false);\n\t\t\t}\n\t\t},\n\t\t[onError, onSuccess, setScanUniqueKey],\n\t);\n\n\tconst handleCameraPermission = useCallback(async () => {\n\t\tif (+heightInCm < 152.4 || +heightInCm > 213.36) {\n\t\t\tonScanError({ message: \"Height must be between 152.4cm (5ft) and 213.36cm (7ft)\" });\n\t\t\treturn;\n\t\t}\n\n\t\tconst permission = await checkCameraPermission();\n\t\tif (permission.disabled) {\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/camera_activation`,\n\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\temail,\n\t\t\t});\n\t\t\tsetLoading(false);\n\t\t} else {\n\t\t\tconst scanId = scanUniqueKey;\n\t\t\tif (scanId) {\n\t\t\t\tcheckMeasurementStatus(scanId);\n\t\t\t} else {\n\t\t\t\tsetLoading(false);\n\t\t\t}\n\t\t\thandleScanTimeCapture({\n\t\t\t\teventName: `${shopDomain}/camera_activation`,\n\t\t\t\tscanID: scanUniqueKey,\n\t\t\t\tstatus: \"success\",\n\t\t\t\temail,\n\t\t\t});\n\t\t}\n\t\tsetShowDeniedModal(permission);\n\t\tsetScanFailsError(\"\");\n\t\tsetIsVideoUploaded(false);\n\t}, [checkMeasurementStatus, email, scanUniqueKey, setScanUniqueKey, shopDomain]);\n\n\tuseEffect(() => {\n\t\tsetPreferredLanguage?.(language);\n\t\tposthog.init(posthogPublicKey, { api_host: posthogPublicHost });\n\t\tposthog.capture(\"$pageview\");\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (isError || isSuccess) return;\n\t\tif (shopDomain) {\n\t\t\thandleCameraPermission();\n\t\t}\n\t}, [shopDomain, heightInCm, isError, isSuccess]);\n\n\tuseEffect(() => {\n\t\tif (isError || isSuccess) return;\n\t\tif (isVideoUploaded && shopDomain && scanUniqueKey) {\n\t\t\thandleMeasurementRecommendation();\n\t\t}\n\t}, [isVideoUploaded, shopDomain, scanUniqueKey, isError, isSuccess]);\n\n\tif (isError) {\n\t\treturn (\n\t\t\t<LanguageContextProvider>\n\t\t\t\t<CameraPermission />\n\t\t\t\t<Drawer\n\t\t\t\t\tanchor=\"bottom\"\n\t\t\t\t\topen={true}\n\t\t\t\t\tclassName=\"camera-drawer\"\n\t\t\t\t\tonClose={(event, reason) => {\n\t\t\t\t\t\tif (reason === \"backdropClick\") {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<ScanErrorMessage\n\t\t\t\t\t\tscanFailsError={scanFailsError}\n\t\t\t\t\t\tonNext={() => {\n\t\t\t\t\t\t\t// onRetry?.();\n\t\t\t\t\t\t\t// handleShowStreamCamera();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsetScanUniqueKey={setScanUniqueKey}\n\t\t\t\t\t\tgender={gender}\n\t\t\t\t\t\tresolvedConfig={resolvedConfig}\n\t\t\t\t\t\tsetIsVideoUploaded={setIsVideoUploaded}\n\t\t\t\t\t/>\n\t\t\t\t</Drawer>\n\t\t\t</LanguageContextProvider>\n\t\t);\n\t}\n\n\tif (isSuccess) {\n\t\treturn (\n\t\t\t<SignUp\n\t\t\t\tisFaceScan={false}\n\t\t\t\tscanId={scanUniqueKey}\n\t\t\t\tisMeasurementAvailable={isMeasurementAvailable}\n\t\t\t\tuserDetails={userDetails}\n\t\t\t\t// onComplete={onComplete}\n\t\t\t\tisVideoUploadedCorrect={isVideoUploadedCorrect}\n\t\t\t\tconfig={resolvedConfig}\n\t\t\t\tisSuccess={isSuccess}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div className=\"flex top-0 !mt-0 left-0 z-[999] bg-opacity-80 bg-[#1b1b1b] absolute justify-center items-center w-full h-full\">\n\t\t\t\t<LoadingScreen url={resolvedConfig?.loader} />\n\t\t\t</div>\n\t\t);\n\t}\n\tif (showDeniedModal.disabled) {\n\t\treturn (\n\t\t\t<LanguageContextProvider>\n\t\t\t\t<Modal />\n\t\t\t</LanguageContextProvider>\n\t\t);\n\t}\n\n\tif (!uploadLoading && !scanFailsError) {\n\t\treturn (\n\t\t\t<ParamsContext.Provider value={{ setStartGyro, handleFileUpload, setUploadLoading }}>\n\t\t\t\t<MediaContextProvider>\n\t\t\t\t\t<LanguageContextProvider>\n\t\t\t\t\t\t<AngleDetector\n\t\t\t\t\t\t\tconfig={resolvedConfig}\n\t\t\t\t\t\t\tscanID={scanUniqueKey}\n\t\t\t\t\t\t\tuserDetails={userDetails}\n\t\t\t\t\t\t\tsetIsVideoUploaded={setIsVideoUploaded}\n\t\t\t\t\t\t\tsetScanFailsError={setScanFailsError}\n\t\t\t\t\t\t\tsetScanStartTime={setScanStartTime}\n\t\t\t\t\t\t\tsetScanUniqueKey={setScanUniqueKey}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</LanguageContextProvider>\n\t\t\t\t</MediaContextProvider>\n\t\t\t</ParamsContext.Provider>\n\t\t);\n\t}\n\tif ((uploadLoading || isMeasurementAvailable) && !scanFailsError) {\n\t\treturn (\n\t\t\t<SignUp\n\t\t\t\tisFaceScan={false}\n\t\t\t\tscanId={scanUniqueKey}\n\t\t\t\tisMeasurementAvailable={isMeasurementAvailable}\n\t\t\t\tuserDetails={userDetails}\n\t\t\t\tonComplete={onComplete}\n\t\t\t\tisVideoUploadedCorrect={isVideoUploadedCorrect}\n\t\t\t\tconfig={resolvedConfig}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<LanguageContextProvider>\n\t\t\t<CameraPermission />\n\t\t\t<Drawer\n\t\t\t\tanchor=\"bottom\"\n\t\t\t\topen={true}\n\t\t\t\tclassName=\"camera-drawer\"\n\t\t\t\tonClose={(event, reason) => {\n\t\t\t\t\tif (reason === \"backdropClick\") {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<ScanErrorMessage\n\t\t\t\t\tscanFailsError={scanFailsError}\n\t\t\t\t\tonNext={() => {\n\t\t\t\t\t\tonRetry?.();\n\t\t\t\t\t\thandleShowStreamCamera();\n\t\t\t\t\t}}\n\t\t\t\t\tsetScanUniqueKey={setScanUniqueKey}\n\t\t\t\t\tgender={gender}\n\t\t\t\t\tresolvedConfig={resolvedConfig}\n\t\t\t\t\tsetIsVideoUploaded={setIsVideoUploaded}\n\t\t\t\t/>\n\t\t\t</Drawer>\n\t\t</LanguageContextProvider>\n\t);\n};\n","import { useCallback, useEffect, useState } from \"react\";\n\ninterface GyroDataItem {\n alpha?: string;\n beta?: string;\n gamma?: string;\n timestamp?: string;\n}\n\nexport interface IOSDeviceOrientationEvent extends DeviceOrientationEvent {\n requestPermission?: () => Promise<PermissionState>;\n}\n\nfunction useGyroSensor(startGyro: boolean) {\n const [gyroData, setGyroData] = useState<GyroDataItem[]>([]);\n const [permissionGranted, setPermissionGranted] = useState(false);\n\n const handleOrientation = useCallback((event: DeviceOrientationEvent) => {\n try {\n const { alpha, beta, gamma } = event;\n setGyroData((prev: GyroDataItem[]) => [\n ...prev,\n {\n alpha: alpha?.toString() || undefined,\n beta: beta?.toString() || undefined,\n gamma: gamma?.toString() || undefined,\n timestamp: new Date().toISOString(),\n },\n ]);\n } catch (error) {\n console.log(error);\n }\n }, []);\n\n const requestPermission = useCallback(async () => {\n const DeviceOrientation =\n DeviceOrientationEvent as unknown as IOSDeviceOrientationEvent;\n\n if (\n typeof DeviceOrientation !== \"undefined\" &&\n typeof DeviceOrientation.requestPermission === \"function\"\n ) {\n try {\n const response = await DeviceOrientation.requestPermission();\n if (response === \"granted\") {\n setPermissionGranted(true);\n } else {\n console.warn(\"Device orientation permission denied.\");\n }\n } catch (error) {\n console.error(\"Error requesting device orientation permission:\", error);\n }\n } else {\n // Permission not required on non-iOS devices\n setPermissionGranted(true);\n }\n }, []);\n\n useEffect(() => {\n if (startGyro && permissionGranted) {\n window.addEventListener(\"deviceorientation\", handleOrientation);\n } else {\n setGyroData([]);\n }\n return () => {\n window.removeEventListener(\"deviceorientation\", handleOrientation);\n };\n }, [startGyro, permissionGranted, handleOrientation]);\n\n useEffect(() => {\n if (startGyro) {\n requestPermission();\n }\n }, [startGyro, requestPermission]);\n\n return { gyroData };\n}\n\nexport default useGyroSensor;\n"],"names":["extendSxProp","props","sx","inSx","other","systemProps","otherProps","result","config","theme","unstable_sxConfig","defaultSxConfig","Object","keys","forEach","prop","splitProps","finalSx","Array","isArray","args","isPlainObject","boxClasses","generateUtilityClasses","defaultTheme","createTheme","Box","options","themeId","defaultClassName","generateClassName","BoxRoot","styled","shouldForwardProp","styleFunctionSx","React","forwardRef","inProps","ref","useTheme","className","component","_jsx","as","clsx","createBox","THEME_ID","root","ClassNameGenerator","generate","getDialogUtilityClass","slot","generateUtilityClass","process","env","NODE_ENV","propTypes","children","PropTypes","node","elementType","oneOfType","arrayOf","func","object","bool","dialogClasses","DialogContext","createContext","displayName","DialogBackdrop","Backdrop","name","overrides","styles","backdrop","zIndex","DialogRoot","Modal","position","DialogContainer","overridesResolver","ownerState","container","capitalize","scroll","height","outline","variants","style","display","justifyContent","alignItems","overflowY","overflowX","textAlign","content","verticalAlign","width","DialogPaper","Paper","paper","String","maxWidth","fullWidth","paperFullWidth","fullScreen","paperFullScreen","memoTheme","margin","boxShadow","flexDirection","maxHeight","breakpoints","unit","Math","max","values","xs","paperScrollBody","down","filter","map","borderRadius","Dialog","useDefaultProps","defaultTransitionDuration","enter","transitions","duration","enteringScreen","exit","leavingScreen","ariaDescribedby","ariaLabelledbyProp","ariaModal","BackdropComponent","BackdropProps","disableEscapeKeyDown","onClick","onClose","open","PaperComponent","PaperProps","slots","slotProps","TransitionComponent","Fade","transitionDuration","TransitionProps","classes","composeClasses","useUtilityClasses","backdropClick","useRef","ariaLabelledby","useId","dialogContextValue","useMemo","titleId","externalForwardedProps","transition","RootSlot","rootSlotProps","useSlot","shouldForwardComponentProp","BackdropSlot","backdropSlotProps","PaperSlot","paperSlotProps","ContainerSlot","containerSlotProps","TransitionSlot","transitionSlotProps","additionalProps","appear","in","timeout","role","closeAfterTransition","event","current","onMouseDown","target","currentTarget","elevation","Provider","value","string","oneOf","isRequired","shape","number","SwitchIcon$1","memo","size","_jsxs","viewBox","fill","xmlns","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","LevelScreen$1","angle","countdown","isScanning","isInTargetRange","stabilityScore","getProximityToTarget","useCallback","min","backgroundColor","base","brandColor","proximity","round","handelTextColour","isLight","getTextColor","cd","fixVh","document","documentElement","setProperty","window","innerHeight","addEventListener","Header","noTitle","resolvedConfig","fontFamily","baseFontFamily","cn","transform","SwitchIcon","factory","__WEBPACK_EXTERNAL_MODULE_react__","modules","installedModules","__webpack_require__","moduleId","exports","module","i","l","call","m","c","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","t","mode","__esModule","ns","create","key","bind","n","property","prototype","hasOwnProperty","p","s","__webpack_exports__","extendStatics","react__WEBPACK_IMPORTED_MODULE_0__","__extends","b","setPrototypeOf","__proto__","__","this","constructor","__assign","assign","arguments","length","apply","hasGetUserMedia","navigator","mediaDevices","getUserMedia","undefined","constraints","webkitGetUserMedia","mozGetUserMedia","msGetUserMedia","Promise","resolve","reject","Error","Webcam","_super","_this","canvas","ctx","requestUserMediaId","unmounted","state","hasUserMedia","componentDidMount","requestUserMedia","console","warn","onUserMediaError","componentDidUpdate","nextProps","audioConstraintsChanged","JSON","stringify","audioConstraints","videoConstraintsChanged","videoConstraints","minScreenshotWidthChanged","minScreenshotWidth","minScreenshotHeightChanged","minScreenshotHeight","stopAndCleanup","componentWillUnmount","stopMediaStream","stream","getVideoTracks","getAudioTracks","track","removeTrack","stop","src","URL","revokeObjectURL","getScreenshot","screenshotDimensions","getCanvas","toDataURL","screenshotFormat","screenshotQuality","video","videoHeight","canvasWidth","videoWidth","canvasHeight","forceScreenshotSourceSize","aspectRatio","clientWidth","createElement","getContext","mirrored","translate","scale","imageSmoothingEnabled","imageSmoothing","drawImage","sourceSelected","audio","myRequestUserMediaId","then","handleUserMedia","catch","e","optionalSource_1","id","optional","sourceId","constraintToSourceId_1","constraint","deviceId","ideal","MediaStreamTrack","getSources","sources","audioSource","videoSource","source","kind","audioSourceId","videoSourceId","err","setState","srcObject","error","createObjectURL","onUserMedia","render","disablePictureInPicture","_b","rest","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__rest","videoStyle","childrenProps","autoPlay","muted","playsInline","defaultProps","react","require$$0","CloseIcon","createSvgIcon","MEDIA_TYPES","MediaContext","MediaContextProvider","setSize","useState","innerWidth","clearInputs","setClearInputs","updateSize","useEffect","useLayoutEffect","removeEventListener","media","mediaDetails","dictionaries","PreferredLanguage","English","Hindi","French","German","Spanish","Arabic","Italian","LanguageContext","LanguageContextProvider","preferredLanguage","setPreferredLanguage","text","CameraScanChild","handleShowStreamCamera","loadingCam","handlePause","pause","recordingStarted","startSendingVideoFrames","showPause","webcamRef","resetDetector","useContext","top","bottom","objectFit","SpecificButton","prefix","pauseIcon","buttonText","buttonFunc","btnSecondary","LanguageKeys","Start_Scan","disabled","crossOrigin","preload","voiceOverAssetsPath","globalLoadingPromise","globalDetector","globalPoseLib","globalTfjs","useTensorFlow","consecutiveFronts","setConsecutiveFronts","spinPhase","setSpinPhase","isLoaded","setIsLoaded","spinPhaseRef","consecutiveFrontsRef","mounted","async","loadDependenciesGlobal","log","poseLib","tfjsCore","tfjsBackend","all","import","require","index","ready","createDetector","SupportedModels","BlazePose","runtime","modelType","solutionPath","TENSORFLOW_SOLUTION_PATH","mediapipeError","isFrontFrame","body","success","poseDetector","callback","poses","estimatePoses","flipHorizontal","keypoints","slice","kp","x","y","score","prev","detector","webcam","retryLoading","ParamsContext","audioTimeoutId","lastVideoPlayed","ScanningComponent$1","setIsScanLocked","scanID","setIsVideoUploaded","setScanFailsError","setScanStartTime","setScanUniqueKey","userDetails","gender","heightInCm","email","shopDomain","mediaRecorderRef","recordedChunks","setRecordedChunks","setLoadingCam","setRecordingStarted","faceDone","setFaceDone","mediaRecorderStopped","setMediaRecorderStopped","setIsScanning","captureVideoTimeOutHandle","setAudioSource","audioSourceList","setAudioSourceList","emptyAudioSource","setEmptyAudioSource","startAgain","setStartAgain","showRestart","setRestart","setPause","events","setEvents","setShowPause","allowAudioToPlay","firstScan","poseStoppedRef","counter","setStartGyro","handleFileUpload","setUploadLoading","clearTimeout","generateUuid","speechService","stopAudio","el","setTimeout","handleReScan","rescanSupportCaptureEvent","eventName","status","swan","poseDetection","disconnect","supportedTypes","videoTypes","type","MediaRecorder","isTypeSupported","stopRecording","playAudio","handleSocket","connect","posthog","capture","handleSpinDataAvailable","data","concat","handleScanTimeCapture","message","handleStartCaptureClick","mediaRecorderOptions","mimeType","start","postPoseProcess","handleDataAvailable","connected","poseStatus","querySelector","sid","paused","audioName","no_of_times_skipped","skipCount","videoEmit","image","scanId","getCurrentTimeInSeconds","push","bypassChecksToBackup","videoFile","File","AngleDetector","setAngle","calibrationOffset","setCalibrationOffset","setCountdown","setStabilityScore","lastAnglesRef","isScanLocked","calibratedAngle","tensorFlowReady","DeviceOrientationEvent","handleOrientation","beta","newAngle","abs","gamma","cos","PI","requestPermission","DeviceOrientation","once","variation","resetCountdown","startCountdown","timer","setInterval","clearInterval","LevelScreen","ScanningComponent","_Fragment","heading","headingFontFamily","fontSize","headingFontSize","color","headingColor","fontWeight","headingFontWeight","baseFontSize","baseTextColor","Please_check_your_setting_for_camera_permission","Settings","getBrowserName","Enable_the_camera_permissions","CameraPermission","setShowDrawer","loader","showDeniedModal","setShowDeniedModal","loading","setLoading","handleCameraPermission","permission","checkCameraPermission","LoadingScreen","url","VideoPlayer","link","onReady","wrapperClassName","videoReference","playerReference","videoJsOptions","autoplay","controls","responsive","fluid","navigationUI","poster","videoPoster","player","videojs","updatedOptions","isDisposed","dispose","onDrag","preventDefault","ScanErrorMessage","scanFailsError","serverAtCapacity","onNext","showModal","setShowModal","handleShowModal","background","handleErrorMessage","VIDEO_POSTER_GENDER_BASED","alt","Scan_s","vision_model","is_at_capacity","We_are_sorry_about_this_We_are_working_hard_to_add_capacity_Please_try_again_soon","GENDER","PRE_LINK","male","SignUp","isFaceScan","isVideoUploadedCorrect","isMeasurementAvailable","onComplete","isSuccess","deviceFocalLength","userName","scanType","isCustom","CLOTHING_CUSTOM_SCAN","CLOTHING_BANNER_SCAN","CLOTHING_CUSTOM_FIT_SCAN","includes","showDrawer","handleSignUp","auth","addUser","focalLength","clothesFit","showNextButton","Drawer","_","reason","anchor","title","loop","GenderType","Male","maleMeasurementProgress","measurementProgress","language","onRetry","onScanSuccess","onScanError","isError","deviceModelName","callbackUrl","uploadLoading","setIsVideoUploadedCorrect","setIsMeasurementAvailable","isVideoUploaded","startGyro","scanUniqueKey","scanStartTime","gyroData","setGyroData","permissionGranted","setPermissionGranted","alpha","toString","timestamp","Date","toISOString","useGyroSensor","useLocalConfig","onError","clearScanStartTimeAndScanId","completionTime","onSuccess","scanStatus","resultType","code","scanIdToSet","handleMeasurementRecommendation","measurement","handleMeasurementSocket","onOpen","handleWebSocketCapture","connection","file","arrayMetaData","createObjectMetadataArray","focal_length","customer_store_url","clothes_fit","scan_type","callback_url","fileUpload","uploadFileFrontend","setDeviceInfo","model","detection","gyro","checkMeasurementStatus","res","getMeasurementResult","isMeasured","tempScanStartTime","currentTimeInSeconds","fiveMinutesInSeconds","init","posthogPublicKey","api_host","posthogPublicHost"],"mappings":"8eAiBe,SAASA,EAAaC,GACnC,MACEC,GAAIC,KACDC,GACDH,GACEI,YACJA,EAAWC,WACXA,GAtBeL,KACjB,MAAMM,EAAS,CACbF,YAAa,CAAA,EACbC,WAAY,CAAA,GAERE,EAASP,GAAOQ,OAAOC,mBAAqBC,EAAAA,gBAQlD,OAPAC,OAAOC,KAAKZ,GAAOa,QAAQC,IACrBP,EAAOO,GACTR,EAAOF,YAAYU,GAAQd,EAAMc,GAEjCR,EAAOD,WAAWS,GAAQd,EAAMc,KAG7BR,GAUHS,CAAWZ,GACf,IAAIa,EAoBJ,OAlBEA,EADEC,MAAMC,QAAQhB,GACN,CAACE,KAAgBF,GACF,mBAATA,EACN,IAAIiB,KACZ,MAAMb,EAASJ,KAAQiB,GACvB,OAAKC,EAAAA,cAAcd,GAGZ,IACFF,KACAE,GAJIF,GAQD,IACLA,KACAF,GAGA,IACFG,EACHJ,GAAIe,EAER,CCjDA,MAAMK,EAAaC,EAAAA,uBAAuB,SAAU,CAAC,SCO/CC,EAAeC,EAAAA,cACfC,ECDS,SAAmBC,EAAU,IAC1C,MAAMC,QACJA,EAAOJ,aACPA,EAAYK,iBACZA,EAAmB,cAAaC,kBAChCA,GACEH,EACEI,EAAUC,EAAAA,SAAO,MAAO,CAC5BC,kBAAmBlB,GAAiB,UAATA,GAA6B,OAATA,GAA0B,OAATA,GADlDiB,CAEbE,EAAAA,iBAgBH,OAfyBC,EAAMC,WAAW,SAAaC,EAASC,GAC9D,MAAM7B,EAAQ8B,EAAAA,SAASf,IACjBgB,UACJA,EAASC,UACTA,EAAY,SACTrC,GACDJ,EAAaqC,GACjB,OAAoBK,EAAAA,IAAKX,EAAS,CAChCY,GAAIF,EACJH,IAAKA,EACLE,UAAWI,EAAAA,KAAKJ,EAAWV,EAAoBA,EAAkBD,GAAoBA,GACrFpB,MAAOmB,GAAUnB,EAAMmB,IAAoBn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