{"version":3,"file":"step-progress-button-BO76J3yV.js","sources":["../../../app/javascript/components/StepProgressButton.jsx","../../../app/javascript/entrypoints/step-progress-button.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport $ from 'jquery';\n\nimport csrfObject from '../modules/csrf';\n\nconst propTypes = {\n dir: PropTypes.string,\n endpoint: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n};\n\nconst StepProgressButton = ({ dir = null, endpoint, text }) => {\n const [busy, setBusy] = useState(false);\n const handleClick = () => {\n setBusy(true);\n $.post(endpoint, csrfObject())\n .done(({ nextUrl }) => {\n window.location = nextUrl;\n });\n };\n\n return (\n \n {text}\n \n );\n};\n\nStepProgressButton.propTypes = propTypes;\n\nexport default StepProgressButton;\n","import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport StepProgressButton from '../components/StepProgressButton';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const node = document.getElementById('step-progress-button-app');\n\n if (!node) {\n return;\n }\n\n const props = {\n dir: node.dataset.dir,\n endpoint: node.dataset.endpoint,\n text: node.dataset.text,\n };\n\n createRoot(node).render();\n});\n"],"names":["propTypes","PropTypes","StepProgressButton","dir","endpoint","text","busy","setBusy","useState","handleClick","$","csrfObject","nextUrl","jsx","node","props","createRoot"],"mappings":"uQAMA,MAAMA,EAAY,CAChB,IAAKC,EAAU,OACf,SAAUA,EAAU,OAAO,WAC3B,KAAMA,EAAU,OAAO,UACzB,EAEMC,EAAqB,CAAC,CAAE,IAAAC,EAAM,KAAM,SAAAC,EAAU,KAAAC,KAAW,CAC7D,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAS,EAAK,EAChCC,EAAc,IAAM,CACxBF,EAAQ,EAAI,EACVG,EAAA,KAAKN,EAAUO,EAAW,CAAC,EAC1B,KAAK,CAAC,CAAE,QAAAC,KAAc,CACrB,OAAO,SAAWA,CAAA,CACnB,CACL,EAGE,OAAAC,EAAA,IAAC,SAAA,CACC,UAAU,iBACV,YAAU,qBACV,IAAAV,EACA,SAAUG,EACV,QAASG,EACT,KAAK,SAEJ,SAAAJ,CAAA,CACH,CAEJ,EAEAH,EAAmB,UAAYF,EChC/B,SAAS,iBAAiB,mBAAoB,IAAM,CAC5C,MAAAc,EAAO,SAAS,eAAe,0BAA0B,EAE/D,GAAI,CAACA,EACH,OAGF,MAAMC,EAAQ,CACZ,IAAKD,EAAK,QAAQ,IAClB,SAAUA,EAAK,QAAQ,SACvB,KAAMA,EAAK,QAAQ,IACrB,EAEAE,aAAWF,CAAI,EAAE,aAAQZ,EAAoB,CAAA,GAAGa,EAAO,CAAE,CAC3D,CAAC"}