{"version":3,"file":"cart-block-frontend.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACsE;AACC;AAClC;AACoB;AACvB;;AAElC;AACA;AACA;AACoC;AAE7B,MAAMU,KAAK,GAAIC,KAAK,IAAK;EAC/B;AACD;AACA;AACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA,OACCC,oDAAA;IAAKC,SAAS,EAAC;EAAK,GAKnBD,oDAAA,CAACT,gEAAa;IACbW,KAAK,EAAET,mDAAE,CAAC,UAAU,EAAE,mBAAmB,CAAE;IAC3CU,KAAK,EAAE,GAAI;IACXN,OAAO,EAAEA,6CAAOA;EAAC,CACjB,CACG,CAAC;AAER,CAAC;;;;;;;;;;;;;;;;AC9JD;AACA;AACA;AACqC;AAE9B,MAAMA,OAAO,GAAG,CACtB;EACCK,KAAK,EAAET,mDAAE,CAAC,uBAAuB,EAAE,mBAAmB,CAAC;EACvDU,KAAK,EAAE;AACR;AACA;AACD;AACA;AACA,GAHC,CAIA;;;;;;;;;;ACdD;;;;;;;;;;ACAA;;;;;;;;;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H,IAAI,CAACY,aAAc;AAC7C;AACA,kIAAkIZ,IAAI,CAACY,aAAc;AACrJ;AACA;AACA,sBAAsBP,KAAM;AAC5B;AACA;AACA,0DAA0DL,IAAI,CAACa,WAAY,KAAIxC,mDAAE,CAAC,aAAa,CAAE;AACjG,gBAAgB;IACR;IACA,IAAG2B,IAAI,CAACc,YAAY,EAAC;MACjB,IAAIT,KAAK,GAAI,EAAC;MACd,IAAIC,CAAC,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;MAClBR,IAAI,CAACS,MAAM,CAACC,OAAO,CAACC,GAAG,IAAI;QACvBN,KAAK,IACJ;AACjB,+CAA+CM,GAAG,CAACI,QAAS;AAC5D,0FAA0FJ,GAAG,CAACK,GAAI;AAClG;AACA,oEAAoEL,GAAG,CAACM,IAAK;AAC7E,uBAAuB;MACX,CAAC,CAAC;MACF,IAAIC,QAAQ,GAAGlB,IAAI,CAACa,WAAW,GAAI,2CAA0Cb,IAAI,CAACa,WAAY,KAAIxC,mDAAE,CAAC,iBAAiB,CAAE,MAAK,GAAG,EAAE;MAElI8B,IAAI,IAAK,eAAcH,IAAI,CAACY,aAAc;AACtD,wHAAwHZ,IAAI,CAACY,aAAc;AAC3I,sBAAsBP,KAAM;AAC5B;AACA,kBAAkBa,QAAS;AAC3B,uBAAuB;IACf;EACJ;EAEA,OAAQ,GAAEf,IAAK,EAAC;AACpB,CAAC;AAEDX,uBAAuB,CAAEL,wCAAQ,EAAE;EAC/BgC,QAAQ,EAAEzB;AACd,CAAE,CAAC,C","sources":["webpack://online-design/./src/js/cart-block/block.js","webpack://online-design/./src/js/cart-block/options.js","webpack://online-design/external window \"React\"","webpack://online-design/external window \"lodash\"","webpack://online-design/external window [\"wc\",\"blocksCheckout\"]","webpack://online-design/external window [\"wc\",\"wcBlocksRegistry\"]","webpack://online-design/external window [\"wp\",\"components\"]","webpack://online-design/external window [\"wp\",\"data\"]","webpack://online-design/external window [\"wp\",\"element\"]","webpack://online-design/external window [\"wp\",\"i18n\"]","webpack://online-design/external window [\"wp\",\"plugins\"]","webpack://online-design/webpack/bootstrap","webpack://online-design/webpack/runtime/compat get default export","webpack://online-design/webpack/runtime/define property getters","webpack://online-design/webpack/runtime/hasOwnProperty shorthand","webpack://online-design/webpack/runtime/make namespace object","webpack://online-design/./src/js/cart-block/frontend.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useEffect, useState, useCallback } from '@wordpress/element';\nimport { SelectControl, TextareaControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { debounce } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport { options } from './options';\n\nexport const Block = (props) => {\n\t/**\n\t * setExtensionData will update the wc/store/checkout data store with the values supplied. It\n\t * can be used to pass data from the client to the server when submitting the checkout form.\n\t */\n\t// const { setExtensionData } = checkoutExtensionData;\n\t// /**\n\t// * Debounce the setExtensionData function to avoid multiple calls to the API when rapidly\n\t// * changing options.\n\t// */\n\t// // eslint-disable-next-line react-hooks/exhaustive-deps\n\t// const debouncedSetExtensionData = useCallback(\n\t// \tdebounce((namespace, key, value) => {\n\t// \t\tsetExtensionData(namespace, key, value);\n\t// \t}, 1000),\n\t// \t[setExtensionData]\n\t// );\n\t// console.log(checkoutExtensionData);\n\t// const validationErrorId = 'shipping-workshop-other-value';\n\n\t// const { setValidationErrors, clearValidationError } = useDispatch(\n\t// \t'wc/store/validation'\n\t// );\n\n\t// const validationError = useSelect((select) => {\n\t// \tconst store = select('wc/store/validation');\n\t// \t/**\n\t// \t * [frontend-step-07]\n\t// \t * π Write some code to get the validation error from the `wc/store/validation` data store.\n\t// \t * Using the `getValidationError` selector on the `store` object, get the validation error.\n\t// \t *\n\t// \t * The `validationErrorId` variable can be used to get the validation error. Documentation\n\t// \t * on the validation data store can be found here:\n\t// \t * https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/data-store/validation.md\n\t// \t */\n\n\t// \t/**\n\t// \t * [frontend-step-07-extra-credit]\n\t// \t * π° Extra credit: In the `useEffect` that handles the \"other\" textarea, only call\n\t// \t * `clearValidationError` if the validation error is in the data store already.\n\t// \t */\n\t// });\n\t// const [\n\t// \tselectedAlternateShippingInstruction,\n\t// \tsetSelectedAlternateShippingInstruction,\n\t// ] = useState('try-again');\n\t// const [otherShippingValue, setOtherShippingValue] = useState('');\n\n\t// /* Handle changing the select's value */\n\t// useEffect(() => {\n\t// \t/**\n\t// \t * [frontend-step-02]\n\t// \t * π Using `setExtensionData`, write some code in this useEffect that will run when the\n\t// \t * `selectedAlternateShippingInstruction` value changes.\n\t// \t *\n\t// \t * The API of this function is: setExtensionData( namespace, key, value )\n\t// \t *\n\t// \t * This code should use `setExtensionData` to update the `alternateShippingInstruction` key\n\t// \t * in the `shipping-workshop` namespace of the checkout data store.\n\t// \t */\n\t// \t/**\n\t// \t * [frontend-step-02-extra-credit-1]\n\t// \t * π° Extra credit: Ensure the `setExtensionData` function is not called multiple times. We\n\t// \t * can use the `debouncedSetExtensionData` function for this. The API is the same.\n\t// \t */\n\t// }, [setExtensionData, selectedAlternateShippingInstruction]);\n\n\t// /**\n\t// * [frontend-step-02-extra-credit-2]\n\t// * π° Extra credit: Use a `useState` to track whether the user has interacted with the \"other\"\n\t// * textbox. If they have, then the validation error should not be hidden when the user changes\n\t// * the select's value. If it is \"pristine\" then we should keep the error hidden.\n\t// */\n\n\t// /* Handle changing the \"other\" value */\n\t// useEffect(() => {\n\t// \t/**\n\t// \t * [frontend-step-03]\n\t// \t * π Write some code in this useEffect that will run when the `otherShippingValue` value\n\t// \t * changes. This code should use `setExtensionData` to update the `otherShippingValue` key\n\t// \t * in the `shipping-workshop` namespace of the checkout data store.\n\t// \t */\n\t// \t/**\n\t// \t * [frontend-step-03-extra-credit]\n\t// \t * π° Extra credit: Ensure the `setExtensionData` function is not called multiple times. We\n\t// \t * can use the `debouncedSetExtensionData` function for this. The API is the same.\n\t// \t */\n\t// \t/**\n\t// \t * [frontend-step-04]\n\t// \t * π Write some code that will use `setValidationErrors` to add an entry to the validation\n\t// \t * data store if `otherShippingValue` is empty.\n\t// \t *\n\t// \t * The API of this function is: `setValidationErrors( errors )`.\n\t// \t *\n\t// \t * `errors` is an object with the following shape:\n\t// \t * {\n\t// \t * [ validationErrorId ]: {\n\t// \t * \t\tmessage: string,\n\t// \t *\t \thidden: boolean,\n\t// \t * }\n\t// \t * }\n\t// \t *\n\t// \t * For now, the error should remain hidden until the user has interacted with the field.\n\t// \t *\n\t// \t * [frontend-step-04-extra-credit]\n\t// \t * π° Extra credit: If the `selectedAlternateShippingInstruction` is not `other` let's skip\n\t// \t * adding the validation error. Make sure to place this code before the\n\t// \t * `setValidationErrors` call, thus, the spoiler of [frontend-step-04] comes after the one\n\t// \t * of [frontend-step-04-extra-credit].\n\t// \t */\n\t// \t/**\n\t// \t * [frontend-step-05]\n\t// \t * π Update the above code so that it will use `clearValidationError` to remove the\n\t// \t * validation error from the data store if `selectedAlternateShippingInstruction` is not\n\t// \t * `other`, or if the `otherShippingValue` is not empty.\n\t// \t *\n\t// \t * The API of `clearValidationError` is: `clearValidationError( validationErrorId )`\n\t// \t *\n\t// \t * π‘Don't forget to update the dependencies of the `useEffect` when you reference new\n\t// \t * functions/variables!\n\t// \t */\n\t// }, [\n\t// \t/**\n\t// \t * [frontend-step-06]\n\t// \t * π‘ Don't forget to update the dependencies of the `useEffect` when you reference new\n\t// \t * functions/variables!\n\t// \t */\n\t// \totherShippingValue,\n\t// \tsetExtensionData,\n\t// ]);\n\n\treturn (\n\t\t
${img.name}
\nUpload fileΓ
\n ${image}\n