-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-pages-account-manage-product-js-4c15d58bc7107d6fe706.js.map
1 lines (1 loc) · 34.2 KB
/
component---src-pages-account-manage-product-js-4c15d58bc7107d6fe706.js.map
1
{"version":3,"sources":["webpack:///./src/components/DataGrid/index.js","webpack:///./src/components/Forms/Product.js","webpack:///./src/pages/account/manageProduct.js","webpack:///./node_modules/grommet/es6/components/CheckBox/StyledCheckBox.js","webpack:///./node_modules/grommet/es6/components/CheckBox/CheckBox.js"],"names":["Component","data","onConfigure","onDelete","DataTable","columns","property","header","Text","primary","render","datum","Configure","onClick","style","cursor","Close","formModal","onModal","mode","onUpdate","useState","modal","setModal","React","checked","setChecked","setProductImage","textInputProps","key","modalObject","value","onChange","event","target","onDrop","useCallback","acceptedFiles","file","Parse","File","name","save","then","parseFile","url","photo","available","uploadFile","useDropzone","getRootProps","getInputProps","isDragActive","Box","Heading","level","height","width","Image","fit","src","Button","label","includes","TextInput","placeholder","direction","CheckBox","App","id","Store","Object","extend","setformModal","activeStore","editModal","setEditModal","showModal","setShowModal","store","setStore","myProducts","setMyProducts","productFormMode","setProductFormMode","useEffect","a","findMyStore","stores","find","e","run","get","findProduct","loadProduct","fill","justify","align","alignContent","gap","plain","objectId","Anchor","map","toJSON","Modal","onClose","Product","action","keyToSend","storeId","cloneJSONKey","createOneProduct","updateOneProduct","productId","deleteOneProduct","setTimeout","r","hoverStyle","props","theme","checkBox","hover","border","color","StyledCheckBoxIcon","svg","withConfig","displayName","componentId","check","thickness","icon","size","defaultProps","setPrototypeOf","StyledCheckBoxContainer","disabled","StyledCheckBoxInput","input","toggle","StyledCheckBoxBox","div","focus","StyledCheckBoxToggle","span","radius","background","StyledCheckBoxKnob","dark","knob","StyledCheckBox","_extends","assign","i","arguments","length","source","prototype","hasOwnProperty","call","apply","this","stopLabelClick","type","stopPropagation","_ref","ref","_ref2","a11yTitle","checkedProp","focusProp","_onBlur","onBlur","_onChange","_onFocus","onFocus","reverse","indeterminate","rest","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","_formContext$useFormI","FormContext","useFormInput","_useState","setFocus","console","warn","hidden","themeableProps","createElement","_theme$checkBox$icons","icons","CheckedIcon","IndeterminateIcon","borderColor","visual","as","round","viewBox","preserveAspectRatio","d","side","checkBoxNode","margin","normalizedLabel","first","second","htmlFor","CheckBoxWrapper"],"mappings":"6PAwDeA,EArDG,SAAC,GAAqC,IAAnCC,EAAkC,EAAlCA,KAAMC,EAA4B,EAA5BA,YAAaC,EAAe,EAAfA,SACtC,OACE,oCACE,kBAACC,EAAA,EAAD,CACEC,QAAS,CACP,CACEC,SAAU,OACVC,OAAQ,kBAACC,EAAA,EAAD,aACRC,SAAS,GAEX,CACEH,SAAU,cACVC,OAAQ,kBAACC,EAAA,EAAD,qBAEV,CACEF,SAAU,WACVC,OAAQ,kBAACC,EAAA,EAAD,mBAEV,CACEF,SAAU,oBACVC,OAAQ,kBAACC,EAAA,EAAD,6BAEV,CACEF,SAAU,SACVC,OAAQ,kBAACC,EAAA,EAAD,gBAEV,CACEF,SAAU,YACVC,OAAQ,kBAACC,EAAA,EAAD,iBAEV,CACEF,SAAU,GACVC,OAAQ,kBAACC,EAAA,EAAD,eACRE,OAAQ,SAACC,GAAD,OACN,oCACE,kBAACC,EAAA,EAAD,CACEC,QAAS,kBAAMX,GAAeA,EAAYS,IAC1CG,MAAO,CAAEC,OAAQ,aAEnB,kBAACC,EAAA,EAAD,CACEH,QAAS,kBAAMV,GAAYA,EAASQ,IACpCG,MAAO,CAAEC,OAAQ,iBAM3Bd,KAAMA,M,wECqECD,EAnHG,SAAC,GAMZ,IALLiB,EAKI,EALJA,UACAC,EAII,EAJJA,QAII,IAHJC,YAGI,MAHG,SAGH,OAFJhB,SAEI,EADJiB,SAE0BC,mBAASJ,IAA5BK,EADH,KACUC,EADV,OAE0BC,IAAMH,UAAS,GAAtCI,EAFH,KAEYC,EAFZ,KAGKC,EAAmBN,mBAAS,MAHjC,G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GAAIA,EAAMsC,GAAQtF,EAAMC,SAAStB,KAAO,QAASqE,IAC1EyB,GAA8B,IAAMC,cAAcxD,EAAqBc,EAAS,GAAI2B,EAAM,CAC3FZ,IAAKA,EACLH,KAAM,YACL,YAAgB,CACjB/F,GAAIA,EACJ5B,KAAMA,EACNhB,QAASA,EACTgH,SAAUA,IACRwD,EAAgB,CAClBjB,QAAS,SAAiB/I,GACxB4J,GAAS,GACLd,GAAUA,EAAS9I,IAEzB4I,OAAQ,SAAgB5I,GACtB4J,GAAS,GACLjB,GAASA,EAAQ3I,IAEvBD,SAAU,SAAkBC,GAC1BP,EAAWO,EAAMC,OAAOT,SACpBqJ,GAAWA,EAAU7I,OAExBuK,EAAQR,GACTiB,EAAmC,iBAAVnJ,EAAkC,IAAMoI,cAAc,OAAQ,KAAMpI,GAASA,EACtGoJ,EAAQjC,EAAUgC,EAAkBF,EACpCI,EAASlC,EAAU8B,EAAeE,EACtC,OAAoB,IAAMf,cAAc1D,EAAyBgB,EAAS,CACxE,aAAciB,EACdQ,QAASA,GACR,YAAgB,CACjBmC,QAAS/I,EACToE,SAAUA,IACR,CACFhH,QAASA,EACTZ,QAASsJ,GACR8B,GAAiBiB,EAAOC,MAE7BhJ,EAAS6D,YAAc,WAQvB,IAAIqF,EAAiClJ","file":"component---src-pages-account-manage-product-js-4c15d58bc7107d6fe706.js","sourcesContent":["import React from \"react\";\nimport { DataTable, Text } from \"grommet\";\nimport { Close, Configure } from \"grommet-icons\";\nconst Component = ({ data, onConfigure, onDelete }) => {\n return (\n <>\n <DataTable\n columns={[\n {\n property: \"name\",\n header: <Text>Name</Text>,\n primary: true,\n },\n {\n property: \"description\",\n header: <Text>Description</Text>,\n },\n {\n property: \"startBid\",\n header: <Text>Start Bid</Text>,\n },\n {\n property: \"instantClosePrice\",\n header: <Text>Instant Close Price</Text>,\n },\n {\n property: \"Status\",\n header: <Text>Status</Text>,\n },\n {\n property: \"available\",\n header: <Text>Display</Text>,\n },\n {\n property: \"\",\n header: <Text>Action</Text>,\n render: (datum) => (\n <>\n <Configure\n onClick={() => onConfigure && onConfigure(datum)}\n style={{ cursor: \"pointer\" }}\n />\n <Close\n onClick={() => onDelete && onDelete(datum)}\n style={{ cursor: \"pointer\" }}\n />\n </>\n ),\n },\n ]}\n data={data}\n />\n </>\n );\n};\n\nexport default Component;\n","import React, { useState, useCallback } from \"react\";\nimport { Box, Button, TextInput, Heading, Image, CheckBox } from \"grommet\";\nimport { useDropzone } from \"react-dropzone\";\nimport Parse from \"../../library/parse\";\nconst Component = ({\n formModal,\n onModal,\n mode = \"create\",\n onDelete,\n onUpdate,\n}) => {\n const [modal, setModal] = useState(formModal);\n const [checked, setChecked] = React.useState(true);\n const [, setProductImage] = useState(null);\n\n const textInputProps = (key, modalObject) => ({\n value: modalObject[key],\n onChange: (event) =>\n setModal({\n ...modalObject,\n [key]: event.target.value,\n }),\n });\n\n const onDrop = useCallback(\n (acceptedFiles) => {\n const uploadFile = (file) => {\n var parseFile = new Parse.File(file.name, file);\n parseFile.save().then(function (parseFile) {\n setProductImage(parseFile.url());\n setModal({\n ...modal,\n photo: parseFile,\n available: !!checked,\n });\n });\n };\n const file = acceptedFiles && acceptedFiles[0];\n uploadFile(file);\n },\n [modal, checked]\n );\n const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop });\n\n return (\n <Box>\n {mode === \"delete\" && (\n <>\n <Heading level={2}>Are you sure?</Heading>\n {modal && modal.photo && modal.photo.url && (\n <Box height=\"small\" width=\"small\">\n <Image fit=\"cover\" src={modal.photo.url} />\n </Box>\n )}\n <Button\n label=\"delete\"\n onClick={() => {\n onModal &&\n onModal(mode, {\n ...modal,\n available: !!checked,\n });\n }}\n />\n </>\n )}\n {[\"create\", \"update\"].includes(mode) && (\n <>\n <Heading level={3}>Upload Product</Heading>\n <TextInput\n placeholder=\"Product Name\"\n {...textInputProps(\"name\", modal)}\n />\n <Box direction=\"row\">\n <div {...getRootProps()}>\n <input {...getInputProps()} />\n {modal && modal.photo && modal.photo.url && (\n <Box height=\"small\" width=\"small\">\n <Image fit=\"cover\" src={modal.photo.url} />\n </Box>\n )}\n {isDragActive ? (\n <p>Drop the files here ...</p>\n ) : (\n <p>Drag 'n' drop some files here, or click to select files</p>\n )}\n </div>\n </Box>\n <TextInput\n {...textInputProps(\"startBid\", modal)}\n placeholder=\"Start Bid\"\n />\n <TextInput\n {...textInputProps(\"instantClosePrice\", modal)}\n placeholder=\"Instant Close\"\n />\n <CheckBox\n checked={checked}\n label=\"Display On Store\"\n onChange={(event) => {\n setChecked(event.target.checked);\n }}\n />\n <Button\n label={mode}\n onClick={() =>\n onModal &&\n onModal(mode, {\n ...modal,\n available: !!checked,\n })\n }\n />\n </>\n )}\n </Box>\n );\n};\n\nexport default Component;\n","import React, { useEffect, useState } from \"react\";\nimport { Box, TextInput, Anchor } from \"grommet\";\nimport ProductGrid from \"../../components/DataGrid\";\nimport ProductForm from \"../../components/Forms/Product\";\nimport Modal from \"../../components/Modal\";\nimport {\n findMyStore,\n findProduct,\n deleteOneProduct,\n updateOneProduct,\n createOneProduct,\n} from \"../../library/parse\";\nimport { cloneJSONKey } from \"../../helpers\";\nimport Parse from \"../../library/parse\";\n\nconst App = ({ id }) => {\n const Store = Parse && Parse.Object && Parse.Object.extend(\"Store\");\n const [formModal, setformModal] = useState({});\n const [activeStore] = useState(Store && new Store());\n const [editModal, setEditModal] = useState({});\n const [showModal, setShowModal] = useState(false);\n const [store, setStore] = useState(null);\n const [myProducts, setMyProducts] = useState([]);\n const [productFormMode, setProductFormMode] = useState(\"create\");\n\n useEffect(() => {\n const run = async () => {\n const stores = await findMyStore();\n setStore(stores.find((e) => e.id === id));\n };\n run();\n }, [id]);\n\n useEffect(() => {\n if (store) {\n setEditModal({\n name: store.get(\"name\"),\n });\n const loadProduct = async () => {\n setMyProducts(await findProduct(store));\n };\n loadProduct();\n }\n }, [store]);\n return (\n <>\n <Box fill={true} justify=\"center\" align=\"center\" alignContent=\"center\">\n {\n <>\n <Box fill={true} gap=\"small\" direction=\"row\">\n <TextInput\n plain={false}\n placeholder=\"choose a store name\"\n value={editModal.name}\n onChange={(event) => {\n setEditModal({\n ...editModal,\n objectId: activeStore && activeStore.id,\n name: event.target.value,\n });\n }}\n />\n <Anchor onClick={() => setShowModal(true)}>\n Change Store Name\n </Anchor>\n <Anchor\n onClick={() => {\n setProductFormMode(\"create\");\n setformModal({});\n setShowModal(true);\n }}\n >\n Add Product\n </Anchor>\n </Box>\n <Box fill={true}>\n <ProductGrid\n data={myProducts ? myProducts.map((e) => e.toJSON()) : []}\n onConfigure={(modal) => {\n setProductFormMode(\"update\");\n setformModal(modal);\n setShowModal(true);\n }}\n onDelete={(modal) => {\n setProductFormMode(\"delete\");\n setformModal(modal);\n setShowModal(true);\n }}\n />\n </Box>\n </>\n }\n </Box>\n {showModal && (\n <Modal onClose={() => setShowModal(false)}>\n <ProductForm\n mode={productFormMode}\n formModal={formModal}\n onModal={async (action, modal) => {\n const keyToSend = [\n \"name\",\n \"photo\",\n \"startBid\",\n \"instantClosePrice\",\n \"objectId\",\n \"available\",\n ];\n const storeId = store.id;\n modal = cloneJSONKey(modal, keyToSend);\n\n if (action === \"create\") {\n await createOneProduct(modal, store.id);\n }\n if (action === \"update\") {\n await updateOneProduct({\n ...modal,\n productId: modal.objectId,\n storeId,\n });\n }\n if (action === \"delete\") {\n await deleteOneProduct({\n productId: modal.objectId,\n storeId,\n });\n }\n setTimeout(\n () =>\n findProduct(store).then((r) => {\n setMyProducts(r);\n setShowModal(false);\n }),\n 1000\n );\n }}\n onClose={() => setShowModal(false)}\n />\n </Modal>\n )}\n </>\n );\n};\nexport default App;\n","import styled, { css } from 'styled-components';\nimport { focusStyle, normalizeColor } from '../../utils';\nimport { defaultProps } from '../../default-props';\nvar disabledStyle = \"\\n opacity: 0.5;\\n cursor: default;\\n\";\nvar hoverStyle = css([\":hover input:not([disabled]) + div,:hover input:not([disabled]) + span{border-color:\", \";}\"], function (props) {\n return normalizeColor(props.theme.checkBox.hover.border.color, props.theme);\n});\nvar StyledCheckBoxIcon = styled.svg.withConfig({\n displayName: \"StyledCheckBox__StyledCheckBoxIcon\",\n componentId: \"sc-1dbk5ju-0\"\n})([\"box-sizing:border-box;stroke-width:\", \";stroke:\", \";width:\", \";height:\", \";\", \";\"], function (props) {\n return props.theme.checkBox.check.thickness;\n}, function (props) {\n return normalizeColor(props.theme.checkBox.color || 'control', props.theme);\n}, function (props) {\n return props.theme.checkBox.icon.size || props.theme.checkBox.size;\n}, function (props) {\n return props.theme.checkBox.icon.size || props.theme.checkBox.size;\n}, function (props) {\n return props.theme.checkBox.icon.extend;\n});\nStyledCheckBoxIcon.defaultProps = {};\nObject.setPrototypeOf(StyledCheckBoxIcon.defaultProps, defaultProps);\nvar StyledCheckBoxContainer = styled.label.withConfig({\n displayName: \"StyledCheckBox__StyledCheckBoxContainer\",\n componentId: \"sc-1dbk5ju-1\"\n})([\"display:flex;flex-direction:row;align-items:center;user-select:none;width:fit-content;\", \" \", \" \", \" \", \"\"], function (props) {\n return props.disabled && disabledStyle;\n}, function (props) {\n return !props.disabled && 'cursor: pointer;';\n}, function (props) {\n return props.theme.checkBox.hover.border.color && hoverStyle;\n}, function (props) {\n return props.theme.checkBox.extend;\n});\nStyledCheckBoxContainer.defaultProps = {};\nObject.setPrototypeOf(StyledCheckBoxContainer.defaultProps, defaultProps);\nvar StyledCheckBoxInput = styled.input.withConfig({\n displayName: \"StyledCheckBox__StyledCheckBoxInput\",\n componentId: \"sc-1dbk5ju-2\"\n})([\"opacity:0;-moz-appearance:none;width:0;height:0;margin:0;\", \":checked + span > span{left:calc( \", \" - \", \" );background:\", \";}\"], function (props) {\n return !props.disabled && 'cursor: pointer;';\n}, function (props) {\n return props.theme.checkBox.toggle.size;\n}, function (props) {\n return props.theme.checkBox.size;\n}, function (props) {\n return normalizeColor(props.theme.checkBox.color || 'control', props.theme);\n});\nStyledCheckBoxInput.defaultProps = {};\nObject.setPrototypeOf(StyledCheckBoxInput.defaultProps, defaultProps);\nvar StyledCheckBoxBox = styled.div.withConfig({\n displayName: \"StyledCheckBox__StyledCheckBoxBox\",\n componentId: \"sc-1dbk5ju-3\"\n})([\"\", \";\", \";\"], function (props) {\n return props.focus && focusStyle();\n}, function (props) {\n return props.theme.checkBox.check.extend;\n});\nStyledCheckBoxBox.defaultProps = {};\nObject.setPrototypeOf(StyledCheckBoxBox.defaultProps, defaultProps);\nvar StyledCheckBoxToggle = styled.span.withConfig({\n displayName: \"StyledCheckBox__StyledCheckBoxToggle\",\n componentId: \"sc-1dbk5ju-4\"\n})([\"box-sizing:border-box;vertical-align:middle;display:inline-block;width:\", \";height:\", \";border:\", \" solid;border-color:\", \";border-radius:\", \";background-color:\", \";\", \";\", \";\"], function (props) {\n return props.theme.checkBox.toggle.size;\n}, function (props) {\n return props.theme.checkBox.size;\n}, function (props) {\n return props.theme.checkBox.border.width;\n}, function (props) {\n return normalizeColor(props.theme.checkBox.border.color, props.theme);\n}, function (props) {\n return props.theme.checkBox.toggle.radius;\n}, function (props) {\n return props.theme.checkBox.toggle.background ? normalizeColor(props.theme.checkBox.toggle.background, props.theme) : 'transparent';\n}, function (props) {\n return props.focus && focusStyle();\n}, function (props) {\n return props.theme.checkBox.toggle.extend;\n});\nStyledCheckBoxToggle.defaultProps = {};\nObject.setPrototypeOf(StyledCheckBoxToggle.defaultProps, defaultProps);\nvar StyledCheckBoxKnob = styled.span.withConfig({\n displayName: \"StyledCheckBox__StyledCheckBoxKnob\",\n componentId: \"sc-1dbk5ju-5\"\n})([\"box-sizing:border-box;position:relative;display:inherit;top:-\", \";left:-\", \";transition:all 0.3s;width:\", \";height:\", \";background:\", \";border-radius:\", \";\", \";\"], function (props) {\n return props.theme.checkBox.border.width;\n}, function (props) {\n return props.theme.checkBox.border.width;\n}, function (props) {\n return props.theme.checkBox.size;\n}, function (props) {\n return props.theme.checkBox.size;\n}, function (props) {\n return normalizeColor(props.theme.checkBox.toggle.color[props.theme.dark ? 'dark' : 'light'], props.theme);\n}, function (props) {\n return props.theme.checkBox.toggle.radius;\n}, function (props) {\n return props.theme.checkBox.toggle.knob.extend;\n});\nStyledCheckBoxKnob.defaultProps = {};\nObject.setPrototypeOf(StyledCheckBoxKnob.defaultProps, defaultProps);\nvar StyledCheckBox = styled.div.withConfig({\n displayName: \"StyledCheckBox\",\n componentId: \"sc-1dbk5ju-6\"\n})([\"flex-shrink:0;\"]);\nStyledCheckBox.defaultProps = {};\nObject.setPrototypeOf(StyledCheckBox.defaultProps, defaultProps);\nexport { StyledCheckBoxIcon, StyledCheckBoxContainer, StyledCheckBoxInput, StyledCheckBoxBox, StyledCheckBoxToggle, StyledCheckBoxKnob, StyledCheckBox };","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nimport React, { forwardRef, useContext, useEffect, useState } from 'react';\nimport { ThemeContext } from 'styled-components';\nimport { removeUndefined } from '../../utils/object';\nimport { defaultProps } from '../../default-props';\nimport { Box } from '../Box';\nimport { FormContext } from '../Form/FormContext';\nimport { StyledCheckBox, StyledCheckBoxBox, StyledCheckBoxIcon, StyledCheckBoxContainer, StyledCheckBoxInput, StyledCheckBoxToggle, StyledCheckBoxKnob } from './StyledCheckBox';\nimport { normalizeColor } from '../../utils';\n\nvar stopLabelClick = function stopLabelClick(event) {\n // prevents clicking on the label trigging the event twice\n // https://stackoverflow.com/questions/24501497/why-the-onclick-element-will-trigger-twice-for-label-element\n if (event.target.type !== 'checkbox') {\n event.stopPropagation();\n }\n};\n\nvar CheckBox = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var _ref2;\n\n var a11yTitle = _ref.a11yTitle,\n checkedProp = _ref.checked,\n disabled = _ref.disabled,\n focusProp = _ref.focus,\n id = _ref.id,\n label = _ref.label,\n name = _ref.name,\n _onBlur = _ref.onBlur,\n _onChange = _ref.onChange,\n _onFocus = _ref.onFocus,\n reverse = _ref.reverse,\n toggle = _ref.toggle,\n indeterminate = _ref.indeterminate,\n rest = _objectWithoutPropertiesLoose(_ref, [\"a11yTitle\", \"checked\", \"disabled\", \"focus\", \"id\", \"label\", \"name\", \"onBlur\", \"onChange\", \"onFocus\", \"reverse\", \"toggle\", \"indeterminate\"]);\n\n var theme = useContext(ThemeContext) || defaultProps.theme;\n var formContext = useContext(FormContext);\n\n var _formContext$useFormI = formContext.useFormInput(name, checkedProp, false),\n checked = _formContext$useFormI[0],\n setChecked = _formContext$useFormI[1];\n\n var _useState = useState(focusProp),\n focus = _useState[0],\n setFocus = _useState[1];\n\n useEffect(function () {\n return setFocus(focusProp);\n }, [focusProp]);\n useEffect(function () {\n if (checkedProp && indeterminate) {\n console.warn('Checkbox cannot be \"checked\" and \"indeterminate\" at the same time.');\n }\n\n if (toggle && indeterminate) {\n console.warn('Checkbox of type toggle does not have \"indeterminate\" state.');\n }\n }, [checkedProp, toggle, indeterminate]);\n var themeableProps = {\n checked: checked,\n disabled: disabled,\n focus: focus,\n reverse: reverse,\n toggle: toggle,\n indeterminate: indeterminate\n };\n var hidden;\n\n if (disabled && checked) {\n hidden = /*#__PURE__*/React.createElement(\"input\", {\n name: name,\n type: \"hidden\",\n value: \"true\"\n });\n }\n\n var _theme$checkBox$icons = theme.checkBox.icons,\n CheckedIcon = _theme$checkBox$icons.checked,\n IndeterminateIcon = _theme$checkBox$icons.indeterminate;\n var borderColor = normalizeColor(theme.checkBox.border.color, theme);\n\n if (checked) {\n borderColor = normalizeColor(theme.checkBox.color || 'control', theme);\n }\n\n var visual = toggle ? /*#__PURE__*/React.createElement(StyledCheckBoxToggle, themeableProps, /*#__PURE__*/React.createElement(StyledCheckBoxKnob, themeableProps)) : /*#__PURE__*/React.createElement(StyledCheckBoxBox, _extends({\n as: Box,\n align: \"center\",\n justify: \"center\",\n width: theme.checkBox.size,\n height: theme.checkBox.size,\n border: {\n size: theme.checkBox.border.width,\n color: borderColor\n },\n round: theme.checkBox.check.radius\n }, themeableProps), !indeterminate && checked && (CheckedIcon ? /*#__PURE__*/React.createElement(CheckedIcon, {\n theme: theme,\n as: StyledCheckBoxIcon\n }) : /*#__PURE__*/React.createElement(StyledCheckBoxIcon, _extends({\n theme: theme,\n viewBox: \"0 0 24 24\",\n preserveAspectRatio: \"xMidYMid meet\"\n }, themeableProps), /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M6,11.3 L10.3,16 L18,6.2\"\n }))), !checked && indeterminate && (IndeterminateIcon ? /*#__PURE__*/React.createElement(IndeterminateIcon, {\n theme: theme,\n as: StyledCheckBoxIcon\n }) : /*#__PURE__*/React.createElement(StyledCheckBoxIcon, _extends({\n theme: theme,\n viewBox: \"0 0 24 24\",\n preserveAspectRatio: \"xMidYMid meet\"\n }, themeableProps), /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n d: \"M6,12 L18,12\"\n }))));\n var side = reverse ? 'left' : 'right';\n var checkBoxNode = /*#__PURE__*/React.createElement(StyledCheckBox, _extends({\n as: Box,\n align: \"center\",\n justify: \"center\",\n margin: label && (_ref2 = {}, _ref2[side] = theme.checkBox.gap || 'small', _ref2)\n }, themeableProps), /*#__PURE__*/React.createElement(StyledCheckBoxInput, _extends({}, rest, {\n ref: ref,\n type: \"checkbox\"\n }, removeUndefined({\n id: id,\n name: name,\n checked: checked,\n disabled: disabled\n }), themeableProps, {\n onFocus: function onFocus(event) {\n setFocus(true);\n if (_onFocus) _onFocus(event);\n },\n onBlur: function onBlur(event) {\n setFocus(false);\n if (_onBlur) _onBlur(event);\n },\n onChange: function onChange(event) {\n setChecked(event.target.checked);\n if (_onChange) _onChange(event);\n }\n })), visual, hidden);\n var normalizedLabel = typeof label === 'string' ? /*#__PURE__*/React.createElement(\"span\", null, label) : label;\n var first = reverse ? normalizedLabel : checkBoxNode;\n var second = reverse ? checkBoxNode : normalizedLabel;\n return /*#__PURE__*/React.createElement(StyledCheckBoxContainer, _extends({\n \"aria-label\": a11yTitle,\n reverse: reverse\n }, removeUndefined({\n htmlFor: id,\n disabled: disabled\n }), {\n checked: checked,\n onClick: stopLabelClick\n }, themeableProps), first, second);\n});\nCheckBox.displayName = 'CheckBox';\nvar CheckBoxDoc;\n\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line global-require\n CheckBoxDoc = require('./doc').doc(CheckBox);\n}\n\nvar CheckBoxWrapper = CheckBoxDoc || CheckBox;\nexport { CheckBoxWrapper as CheckBox };"],"sourceRoot":""}