{"version":3,"sources":["webpack:///./cartridges/app_storefront_widgets/cartridge/client/default/js/widgets/content/ContactUs.js"],"names":["Widget","ContactUs","onSuccessSubmit","form","data","success","isInModal","ref","render","undefined","msg","then","scrollToTop"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AACA;;;;;AAKA;;;;;AAIe,yEAAUA,MAAV,EAAkB;AAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,QAAMC,SAAN,SAAwBD,MAAxB,CAA+B;AAC3B;;;;;AAKAE,mBAAe,CAACC,IAAD,EAAOC,IAAP,EAAa;AACxB,UAAIA,IAAI,CAACC,OAAT,EAAkB;AACd,cAAMC,SAAS,GAAG,KAAKC,GAAL,CAAS,sBAAT,EAAiCH,IAAjC,CAAsC,WAAtC,CAAlB;AACA,aAAKI,MAAL,CAAYC,SAAZ,EAAuBA,SAAvB,EAAkCA,SAAlC,EAA6CL,IAAI,CAACM,GAAlD,EAAuDC,IAAvD,CAA4D,MAAK;AAC7D,cAAI,CAACL,SAAL,EAAgB;AACZM,+EAAW;AACd;AACJ,SAJD;AAKH;AACJ;;AAf0B;;AAkB/B,SAAOX,SAAP;AACH,C","file":"content.widgets.bundle.js","sourcesContent":["import { scrollToTop } from '../toolbox/scroll';\n/**\n * @typedef {InstanceType>} ajaxForm\n * @typedef {typeof import('widgets/Widget').default} Widget\n */\n\n/**\n * @param {Widget} Widget Base widget for extending\n * @returns {typeof ContactUs} ContactUs widget\n */\nexport default function (Widget) {\n /**\n * @category widgets\n * @subcategory content\n * @class ContactUs\n * @augments Widget\n * @classdesc Contact Us component with next features:\n * 1. Render success result content\n * 2. After rendering scroll to top if not in modal\n *\n * Contact Us component should contain `data-ref=\"contactUsFormWrapper\"` with `data-is-in-modal=\"${pdict.isAjax}\"` to indicate Is `concact us` component located in modal window\n * @example Contact us component\n *
\n *
\n * \n * ...\n * form fields\n * ...\n * \n *
\n *
\n */\n class ContactUs extends Widget {\n /**\n * @description Render success message and scroll to top if content not in modal window\n * @param {ajaxForm} form - Ajax form widget instance\n * @param {object} data - Contact us form submission response\n */\n onSuccessSubmit(form, data) {\n if (data.success) {\n const isInModal = this.ref('contactUsFormWrapper').data('isInModal');\n this.render(undefined, undefined, undefined, data.msg).then(()=> {\n if (!isInModal) {\n scrollToTop();\n }\n });\n }\n }\n }\n\n return ContactUs;\n}\n"],"sourceRoot":""}