{"version":3,"sources":["webpack:///./node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js","webpack:///./app/assets/javascripts/reactjs/components/CouponBanner/style.module.scss","webpack:///./app/assets/javascripts/reactjs/components/CouponBanner/index.jsx"],"names":["hasOwn","hasOwnProperty","classNames","classes","i","arguments","length","arg","argType","push","Array","isArray","inner","apply","toString","Object","prototype","includes","key","call","join","module","exports","default","CouponBanner","coupon","isHybrid","useState","isFixed","setIsFixed","useEffect","OFFSET","document","querySelector","offsetHeight","offsetTop","callback","windowScroll","documentElement","scrollTop","body","window","addEventListener","removeEventListener","className","styles","couponBanner","couponBannerFixed","couponBannerIcon","description","couponBannerEmptyHolder"],"mappings":";8EAAA,OAOC,WACA,aAEA,IAAIA,EAAS,GAAGC,eAGhB,SAASC,IAGR,IAFA,IAAIC,EAAU,GAELC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAC1C,IAAIG,EAAMF,UAAUD,GACpB,GAAKG,EAAL,CAEA,IAAIC,SAAiBD,EAErB,GAAgB,WAAZC,GAAoC,WAAZA,EAC3BL,EAAQM,KAAKF,QACP,GAAIG,MAAMC,QAAQJ,IACxB,GAAIA,EAAID,OAAQ,CACf,IAAIM,EAAQV,EAAWW,MAAM,KAAMN,GAC/BK,GACHT,EAAQM,KAAKG,SAGT,GAAgB,WAAZJ,EAAsB,CAChC,GAAID,EAAIO,WAAaC,OAAOC,UAAUF,WAAaP,EAAIO,SAASA,WAAWG,SAAS,iBAAkB,CACrGd,EAAQM,KAAKF,EAAIO,YACjB,SAGD,IAAK,IAAII,KAAOX,EACXP,EAAOmB,KAAKZ,EAAKW,IAAQX,EAAIW,IAChCf,EAAQM,KAAKS,KAMjB,OAAOf,EAAQiB,KAAK,KAGgBC,EAAOC,SAC3CpB,EAAWqB,QAAUrB,EACrBmB,EAAOC,QAAUpB,QAKhB,KAFwB,EAAF,WACtB,OAAOA,GACP,QAFoB,OAEpB,aAhDH,I,oBCNAmB,EAAOC,QAAU,CAAC,aAAe,qCAAqC,kBAAoB,0CAA0C,iBAAmB,yCAAyC,wBAA0B,kD,kjCCiD3ME,UA7CM,SAAC,GAA0B,I,MAAxBC,EAAuB,EAAvBA,OAAQC,EAAe,EAAfA,SAC9B,IAA8BC,oBAAS,GAAvC,GAAOC,EAAP,KAAgBC,EAAhB,KAsBA,OArBAC,qBAAU,WACR,IAAIC,EAAS,EACb,IAAKL,EAAU,CACb,MAAoCM,SAASC,cAC3C,mFADMC,EAAR,EAAQA,aAAcC,EAAtB,EAAsBA,UAGtBJ,EAASG,EAAeC,EAE1B,IAAMC,EAAW,WACf,IAAMC,EACHL,SAASM,iBAAmBN,SAASM,gBAAgBC,WACtDP,SAASQ,KAAKD,UAChBV,EAAWQ,GAAgBN,IAI7B,OADAU,OAAOC,iBAAiB,SAAUN,GAC3B,WACLK,OAAOE,oBAAoB,SAAUP,MAEtC,CAACV,IAGF,eAAC,WAAD,WACE,0BACEkB,UAAW1C,IAAW2C,IAAOC,c,EAAR,G,EAClBD,IAAOE,kB,EAAoBnB,E,iGAFhC,UAKE,mBAAGgB,UAAS,8BAAyBC,IAAOG,oBAC5C,+BAAOvB,EAAOwB,iBAEfrB,GAAW,qBAAKgB,UAAWC,IAAOK","file":"js/CouponBanner-7678601da44fc21bdbd4.chunk.js","sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"couponBanner\":\"style-module__couponBanner___3lton\",\"couponBannerFixed\":\"style-module__couponBannerFixed___2H5yd\",\"couponBannerIcon\":\"style-module__couponBannerIcon___3a7aF\",\"couponBannerEmptyHolder\":\"style-module__couponBannerEmptyHolder___2pYSj\"};","import { Fragment, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport styles from './style.module.scss';\n\nconst CouponBanner = ({ coupon, isHybrid }) => {\n const [isFixed, setIsFixed] = useState(false);\n useEffect(() => {\n let OFFSET = 0;\n if (!isHybrid) {\n const { offsetHeight, offsetTop } = document.querySelector(\n '.categories-nav-wrapper-placeholder, .cool3c-categories-nav-wrapper-placeholder'\n );\n OFFSET = offsetHeight + offsetTop;\n }\n const callback = () => {\n const windowScroll =\n (document.documentElement && document.documentElement.scrollTop) ||\n document.body.scrollTop;\n setIsFixed(windowScroll >= OFFSET);\n };\n\n window.addEventListener('scroll', callback);\n return () => {\n window.removeEventListener('scroll', callback);\n };\n }, [isHybrid]);\n\n return (\n \n \n \n {coupon.description}\n \n {isFixed &&
}\n \n );\n};\n\nCouponBanner.propTypes = {\n coupon: PropTypes.shape({\n description: PropTypes.string\n }).isRequired,\n isHybrid: PropTypes.bool.isRequired\n};\n\nexport default CouponBanner;\n"],"sourceRoot":""}