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A,EAAWI,QAAQ,OAAQ,IAAI,gDAECJ,OADLA,EAAKC,QAAQ,wDAK/CD,OAJuCA,EAAKE,KAAOF,EAAKE,KAAO,GAAG,sEAWlEF,OAPAA,EAAKK,WACU,sBAC4CL,OAAhDA,EAAKM,KAAK,wCAAsD,OAAhBN,EAAKK,WAAW,gBAEvE,GACL,YAOA,OALCL,EAAKO,iBACU,sBACiDP,OAArDA,EAAKQ,WAAW,uCAA2D,OAAtBR,EAAKO,iBAAiB,gBAElF,GACL,uB,yICvDP,C,QAAA,EAAe,Y,IACbE,EAAAA,EAAAA,sBACAC,EAAAA,EAAAA,iBACAC,EAAAA,EAAAA,eAEA,SAAUF,IAA0BC,IAAoBC,EAC1D,C","sources":["webpack://webstaurantstore/./__alias__/utilities/formatAsCurrency.ts","webpack://webstaurantstore/./common/Buttons/index.tsx","webpack://webstaurantstore/./common/ModalReact/index.tsx","webpack://webstaurantstore/./common/Notification/index.ts","webpack://webstaurantstore/./common/Notification/notification.html.ts","webpack://webstaurantstore/./common/Product/shouldDisplayRequiredCustomization.ts"],"sourcesContent":["/**\n * Used for a function to convert numbers into currency.\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat NumberFormat Documentation}\n *\n * @example\n * const numberToFormat = 12345.67\n * new Intl.NumberFormat(\"en-US\", {style: \"currency\"}).format(numberToFormat);\n */\n\n/**\n * This should be the one we mainly use. It handle all cases when using the currency formatter.\n *\n * @example\n * import formatAsCurrency from \"@wss/utilities/formatAsCurrency\"\n *\n * const priceToFormat = 12345.67\n * const formatWithAllTheChecks = formatAsCurrency.formatIfUndefined(priceToFormat)\n *\n * return formatWithAllTheChecks;\n */\nconst formatAsCurrencyWrapper = (\n value: number | string | undefined,\n showCentsIfUndefined = true,\n showEmptyStringIfUndefined = false,\n numberFormatOptions: Intl.NumberFormatOptions = {}\n) => {\n const formattedCents = showCentsIfUndefined ? \"$0.00\" : \"$0\";\n const undefinedFormatted = showEmptyStringIfUndefined ? \"\" : formattedCents;\n const parsedValue = Number(value);\n\n return parsedValue\n ? formatAsCurrencyPure(parsedValue, numberFormatOptions)\n : undefinedFormatted;\n};\n\n/**\n * If you want to just use a pure version of the currency formatter and handle the checks in the consumer then you can use this version.\n *\n * @example\n * import formatAsCurrency from \"@wss/utilities/formatAsCurrency\"\n *\n * const priceToFormat = 12345.67\n * const formatCurrencyNoChecks = formatAsCurrency.formatAsCurrencyPure(priceToFormat)\n *\n * return formatCurrencyNoChecks;\n */\nconst formatAsCurrencyPure = (\n value: number,\n numberFormatOptions: Intl.NumberFormatOptions = {}\n) => {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n ...numberFormatOptions,\n }).format(value);\n};\n\nconst formatAsCurrency = {\n formatIfUndefined: formatAsCurrencyWrapper,\n format: formatAsCurrencyPure,\n};\n\nexport default formatAsCurrency;\n","import React, { HTMLAttributes } from \"react\";\nimport { cls } from \"cls\";\n\nexport const colors = {\n base: cls(\n \"bg-gray-50\",\n \"hover:bg-gray-100\",\n \"active:bg-gray-100\",\n \"disabled:bg-gray-100\",\n \"text-gray-800\",\n \"border-black-20\",\n \"shadow-inset-white-25\"\n ),\n light: cls(\n \"bg-white\",\n \"border-gray-600\",\n \"text-gray-800\",\n \"hover:bg-gray-primary\",\n \"focus-visible:outline-gray-800\",\n \"btn\"\n ),\n green: cls(\n \"hover:bg-green-800\",\n \"text-white\",\n \"bg-green-500\",\n \"border-black-10\",\n \"focus-visible:outline-green-800\",\n \"btn\"\n ),\n blue: cls(\"text-white\", \"border-black-10\", \"btn\", \"btn-info\"),\n purple: cls(\"text-white\", \"border-black-10\", \"btn\", \"btn-custom\"),\n glass: cls(\n \"bg-white\",\n \"hover:bg-white\",\n \"px-2\",\n \"text-gray-800\",\n \"capitalize\",\n \"border-gray-glass\"\n ),\n inverse: cls(\n \"text-white\",\n \"bg-gray-inverse\",\n \"border-black-10\",\n \"hover:bg-gray-inverse-dark\"\n ),\n custom: \"\",\n red: cls(\"text-white\", \"border-black-10\", \"btn\", \"btn-cart\"),\n \"red-outline\": cls(\n \"bg-transparent\",\n \"hover:bg-red-800\",\n \"border-red-800\",\n \"text-red-700\",\n \"hover:text-white\"\n ),\n \"green-solid\": cls(\"text-white\", \"hover:text-white\", \"btn\", \"btn-primary\"),\n \"green-outline\": cls(\n \"bg-transparent\",\n \"hover:bg-green-500\",\n \"border-green-500\",\n \"text-green-500\",\n \"hover:text-white\"\n ),\n \"glass-outline\": cls(\n \"bg-transparent\",\n \"hover:bg-gray-50\",\n \"border-gray-600\",\n \"text-gray-800\",\n \"btn-glass-shadow\"\n ),\n ui: cls(\n \"text-shadow-white-75\",\n \"hover:bg-gray-50\",\n \"border-gray-400\",\n \"text-gray-800\",\n \"focus-visible:outline-gray-800\",\n \"active:shadow-inset-black-15\"\n ),\n orange: cls(\"text-white\", \"border-black-20\", \"btn\", \"btn-checkout\"),\n};\n\nexport const sizes = {\n small: cls(\n \"rounded-sm-1/2\",\n \"text-sm-1/2\",\n \"leading-3\",\n \"px-3\",\n \"pb-1-1/2\",\n \"pt-1-3/4\"\n ),\n standard: cls(\n \"rounded-normal\",\n \"text-base\",\n \"leading-normal\",\n \"px-7\",\n \"py-2-1/2\"\n ),\n mini: cls(\"rounded\", \"text-xs\", \"leading-3\", \"py-1\", \"px-2\"),\n large: cls(\"rounded\", \"text-xl\", \"py-4\", \"px-10\"),\n toolbar: cls(\"rounded\", \"text-xs\", \"leading-3\", \"px-3\", \"py-1-1/2\"),\n custom: \"\",\n};\n\ntype BaseProps = {\n className?: string;\n children: React.ReactNode;\n color: keyof typeof colors;\n size?: keyof typeof sizes;\n alignment?: string;\n weight?: string;\n focusClasses?: string;\n};\n\ntype AnchorProps = BaseProps &\n Omit, \"type\"> & {\n href: Exclude<\n React.AnchorHTMLAttributes[\"href\"],\n undefined\n >;\n };\n\ntype ButtonProps = BaseProps &\n React.DetailedHTMLProps<\n React.ButtonHTMLAttributes,\n HTMLButtonElement\n > & {\n type: Exclude<\n React.ButtonHTMLAttributes[\"type\"],\n undefined\n >;\n };\n\ntype ElementProps = BaseProps & {\n element: React.ElementType;\n} & HTMLAttributes;\n\nfunction Buttons(\n props: ButtonProps,\n ref?: React.RefObject\n): JSX.Element;\nfunction Buttons(props: AnchorProps): JSX.Element;\nfunction Buttons(props: ElementProps): JSX.Element;\n\nfunction Buttons(\n props: ButtonProps | AnchorProps | ElementProps,\n ref?: React.RefObject\n) {\n const {\n children,\n className = \"\",\n size = \"standard\",\n color,\n alignment = \"align-middle\",\n weight = \"font-semibold\",\n focusClasses = cls(\n \"focus-visible:outline\",\n \"focus-visible:outline-offset-2\",\n \"focus-visible:outline-2\"\n ),\n ...rest\n } = props;\n\n const baseClasses = cls(\n \"border-solid\",\n \"border\",\n \"box-border\",\n \"cursor-pointer\",\n \"inline-block\",\n \"text-center\",\n \"no-underline\",\n \"antialiased\",\n focusClasses\n );\n const colorClass = colors[color];\n\n const sizeClass = sizes[size];\n\n const classes = `${baseClasses} ${className} ${sizeClass} ${colorClass} ${alignment} ${weight}`;\n\n if (\"element\" in rest) {\n const { element, ...forwardedProps } = rest;\n // eslint-disable-next-line react/destructuring-assignment\n return React.createElement(\n element,\n {\n ...forwardedProps,\n className: classes,\n },\n children\n );\n }\n\n if (\"href\" in rest) {\n return (\n \n {children}\n \n );\n }\n\n if (\"type\" in rest) {\n return (\n // eslint-disable-next-line react/button-has-type\n \n );\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\nexport default (React.forwardRef(Buttons) as unknown) as typeof Buttons;\n","import React, { useEffect } from \"react\";\nimport ReactModal from \"react-modal\";\nimport { cls } from \"@wss/cls\";\n\ntype HeaderProps = {\n children: React.ReactNode;\n closeModal: () => void;\n className?: string;\n style?: React.CSSProperties;\n};\n\ntype FooterProps = {\n children: React.ReactNode;\n className?: string;\n};\n\ntype BodyProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport const Header = ({\n children,\n closeModal,\n className = \"\",\n style = {},\n}: HeaderProps) => (\n \n {children}\n \n ⨯\n \n \n);\n\nexport const Body = ({ children, className = \"\" }: BodyProps) => (\n
\n {children}\n
\n);\n\nexport const Footer = ({ children, className = \"\" }: FooterProps) => (\n \n {children}\n \n);\n\ntype ModalProps = {\n isOpen: boolean;\n onRequestClose?: (\n event: React.MouseEvent | React.KeyboardEvent\n ) => void;\n onAfterOpen?: ReactModal.OnAfterOpenCallback;\n children: React.ReactNode;\n className: string;\n role?: string;\n contentStyle?: React.CSSProperties;\n overlayStyle?: React.CSSProperties;\n preventScroll?: boolean;\n closeTimeoutMS?: number;\n overFlowY?: string;\n};\n\nexport default ({\n isOpen,\n onRequestClose,\n onAfterOpen,\n children,\n className,\n role,\n contentStyle,\n overlayStyle,\n preventScroll,\n closeTimeoutMS,\n overFlowY,\n}: ModalProps) => {\n useEffect(() => {\n ReactModal.setAppElement(\"body\");\n }, []);\n\n return (\n \n {children}\n \n );\n};\n","import React from \"react\";\nimport Notif from \"watnotif/dist/js/watnotif\";\nimport notificationTemplate, {\n NotificationObject,\n errorTemplate,\n} from \"./notification.html\";\n\nimport(\n /* webpackChunkName: \"notifications-standalone\" */ \"~/less/notifications-standalone.less\"\n);\n\n/** Wrapper for watnotif. Adds a custom notification template and a fader. */\nexport default class Notification {\n private static get notificationFader() {\n const element = document.querySelector(\".notification-fader\");\n if (!element)\n throw new Error(\n \"An element with the class name .notification-fader is required!\"\n );\n return element;\n }\n\n private static getBase = Notif.prototype.getBase;\n\n private static getWrapper = Notif.prototype.getWrapper;\n\n private static setup = false;\n\n /**\n * Create a notification.\n * @param options Object properties are interpolated into the error template.\n * @param options.heading Text for the header.\n * @param options.href Where the primary button links to. The image will also be linked\n * to this href if an image is included.\n * @param options.imageUrl Optional image url.\n * @param options.body Optional text for the body.\n * @param options.buttonText Text of the primary button.\n * @param options.secondButtonText Text of the secondary button.\n * @param options.secondHref Href of secondary button.\n * @param type Add error styling by passing 'Error' for this parameter.\n */\n public constructor(\n options: NotificationObject,\n type = \"default\",\n eventInfo?: React.SyntheticEvent,\n display = 10000\n ) {\n if (!Notification.setup) {\n Notification.setupNotif(eventInfo);\n Notification.setup = true;\n }\n\n return Notification.create(options, type, display);\n }\n\n public static create(\n options: NotificationObject,\n type: string,\n display: number\n ) {\n if (type === \"error\") {\n const errorHtml = errorTemplate(options);\n return new Notif(errorHtml, type).display(display);\n }\n const html = notificationTemplate(options);\n return new Notif(html, type).display(display);\n }\n\n public static setupNotif(eventInfo?: React.SyntheticEvent) {\n Notification.notificationFader.addEventListener(\"click\", () =>\n Notification.closeAll(eventInfo)\n );\n\n document.addEventListener(\"keydown\", (evt) => {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n const notificationItems = [\n ...Notification.getWrapper().children,\n ] as HTMLElement[];\n if (notificationItems.length !== 0) {\n const firstNotification = notificationItems[0];\n if (evt.key === \"Escape\") {\n firstNotification?.remove();\n // remove the darkened background provided for notifications, if none are left\n if (notificationItems.length - 1 === 0) {\n Notification.closeFader(eventInfo);\n }\n }\n }\n });\n\n const { insertBefore, removeChild } = Object.getPrototypeOf(\n Notification.getWrapper()\n );\n\n Notif.prototype.getBase = function getBasePatched(\n classes: string,\n msg: string\n ) {\n const notificationElement = Notification.getBase(\n `notification notification--${classes}`,\n msg\n );\n\n const close = notificationElement.querySelector(\".close-notif\");\n if (close) close.remove();\n\n return notificationElement;\n };\n\n Notification.getWrapper().insertBefore = (...insertBeforeArgs) => {\n Notification.activateFade();\n return insertBefore.apply(Notification.getWrapper(), insertBeforeArgs);\n };\n\n Notification.getWrapper().removeChild = (...removeChildArgs) => {\n if (Notification.getWrapper().children.length < 2)\n Notification.closeFader(eventInfo);\n return removeChild.apply(Notification.getWrapper(), removeChildArgs);\n };\n }\n\n private static activateFade() {\n Notification.notificationFader.classList.add(\"open\");\n }\n\n private static closeFader(eventInfo?: React.SyntheticEvent) {\n Notification.notificationFader.classList.remove(\"open\");\n if (eventInfo) {\n const lastFocusedElement = eventInfo.target;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n (lastFocusedElement as HTMLElement).focus();\n }\n }\n\n public static closeAll(eventInfo?: React.SyntheticEvent) {\n Notification.closeFader(eventInfo);\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n ([\n ...Notification.getWrapper().children,\n ] as HTMLElement[]).forEach((element) => element.click());\n }\n}\n","export interface NotificationObject {\n imageUrl?: string;\n href?: string;\n heading: string;\n body: string;\n buttonText?: string;\n secondButtonText?: string;\n secondHref?: string;\n eventInfo?: React.SyntheticEvent;\n}\n\nexport const errorTemplate = (data: NotificationObject) => /* html */ `\n\n\n
\n \n \n \n
\n

${data.heading}

\n

${data.body}

\n
\n
`;\n\nexport default (data: NotificationObject) => /* html */ `\n\n${\n data.imageUrl\n ? /* html */ `\n
\n \"\"\n
`\n : \"\"\n}\n
\n
\n

${data.heading}

\n
${data.body ? data.body : \"\"}
\n
\n
\n ${\n data.buttonText\n ? /* html */ `\n ${data.buttonText}\n `\n : \"\"\n }\n ${\n data.secondButtonText\n ? /* html */ `\n ${data.secondButtonText}\n `\n : \"\"\n }\n
\n
`;\n","interface Product {\n customizationRequired: boolean;\n customizationUrl: string;\n isCustomizable: boolean;\n}\n\nexport default ({\n customizationRequired,\n customizationUrl,\n isCustomizable,\n}: Product): boolean => {\n return !!(customizationRequired && (customizationUrl || isCustomizable));\n};\n"],"names":["formatAsCurrencyPure","value","numberFormatOptions","Intl","NumberFormat","style","currency","format","formatIfUndefined","showCentsIfUndefined","showEmptyStringIfUndefined","formattedCents","undefinedFormatted","parsedValue","Number","colors","sizes","base","cls","light","green","blue","purple","glass","inverse","custom","red","ui","orange","small","standard","mini","large","toolbar","Buttons","props","ref","children","className","size","color","alignment","weight","focusClasses","rest","baseClasses","colorClass","sizeClass","classes","element","forwardedProps","React","createElement","a","button","forwardRef","Header","Body","Footer","closeModal","header","data-testid","type","aria-label","onClick","textShadow","main","footer","isOpen","onRequestClose","onAfterOpen","role","contentStyle","overlayStyle","preventScroll","closeTimeoutMS","overFlowY","useEffect","ReactModal","setAppElement","overlayClassName","overlay","backgroundColor","zIndex","overflowY","content","bodyOpenClassName","Notification","options","eventInfo","display","setup","setupNotif","create","errorHtml","errorTemplate","Notif","html","notificationTemplate","notificationFader","addEventListener","closeAll","document","evt","notificationItems","getWrapper","length","firstNotification","key","remove","closeFader","Object","getPrototypeOf","insertBefore","removeChild","prototype","getBase","msg","notificationElement","close","querySelector","insertBeforeArgs","activateFade","apply","removeChildArgs","classList","add","target","focus","forEach","click","Error","data","heading","body","imageUrl","replace","buttonText","href","secondButtonText","secondHref","customizationRequired","customizationUrl","isCustomizable"],"sourceRoot":""}