crmbonus-component-wake 2.0.56 → 2.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-modal.cjs.entry.js +1 -1
- package/dist/cjs/countdown-timer_4.cjs.entry.js +7 -5
- package/dist/cjs/countdown-timer_4.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-bonus-form.cjs.entry.js +2 -2
- package/dist/cjs/crm-bonus-note.cjs.entry.js +10 -4
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +11 -3
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-button.cjs.entry.js +1 -1
- package/dist/cjs/crm-giftback-form.cjs.entry.js +23 -7
- package/dist/cjs/crm-giftback-form.cjs.entry.js.map +1 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +2 -2
- package/dist/{esm/crmbonus.service-9cba7b49.js → cjs/crmbonus.service-bd457de6.js} +30 -4
- package/dist/cjs/crmbonus.service-bd457de6.js.map +1 -0
- package/dist/cjs/giftback-finish_4.cjs.entry.js +1 -1
- package/dist/cjs/{index-80419303.js → index-b7babd3d.js} +29 -3
- package/dist/cjs/index-b7babd3d.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +2 -2
- package/dist/cjs/phone-cancel-input.cjs.entry.js +1 -1
- package/dist/cjs/phone-input-mask.cjs.entry.js +1 -1
- package/dist/cjs/phone-input.cjs.entry.js +1 -1
- package/dist/collection/components/crm-bonus/crm-bonus.js +12 -1
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
- package/dist/collection/components/giftback-form/giftback-form.js +45 -6
- package/dist/collection/components/giftback-form/giftback-form.js.map +1 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +1 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +5 -3
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -1
- package/dist/collection/components/note/crm-bonus-note.js +9 -3
- package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
- package/dist/collection/services/crmbonus.service.js +18 -2
- package/dist/collection/services/crmbonus.service.js.map +1 -1
- package/dist/collection/utils/keys.storage.js +8 -0
- package/dist/collection/utils/keys.storage.js.map +1 -0
- package/dist/components/app-modal.js +1 -1
- package/dist/components/countdown-timer.js +1 -1
- package/dist/components/crm-bonus-form.js +7 -7
- package/dist/components/crm-bonus-note.js +10 -4
- package/dist/components/crm-bonus-note.js.map +1 -1
- package/dist/components/crm-bonus.js +21 -11
- package/dist/components/crm-bonus.js.map +1 -1
- package/dist/components/crm-button.js +1 -1
- package/dist/components/crm-giftback-form.js +1 -1
- package/dist/components/giftback-finish.js +1 -1
- package/dist/components/giftback-info.js +1 -1
- package/dist/components/giftback-pin.js +1 -1
- package/dist/components/giftback-progress.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/name-input.js +1 -1
- package/dist/components/{p-f168d5f6.js → p-289746ae.js} +3 -3
- package/dist/components/{p-f168d5f6.js.map → p-289746ae.js.map} +1 -1
- package/dist/components/{p-bb3a781b.js → p-2f1ab7c1.js} +2 -2
- package/dist/components/{p-bb3a781b.js.map → p-2f1ab7c1.js.map} +1 -1
- package/dist/components/{p-0837b8be.js → p-39096a16.js} +34 -16
- package/dist/components/p-39096a16.js.map +1 -0
- package/dist/components/{p-e4ac17bf.js → p-42b3ecdf.js} +3 -3
- package/dist/components/{p-e4ac17bf.js.map → p-42b3ecdf.js.map} +1 -1
- package/dist/components/{p-1633784e.js → p-4b8c0f24.js} +3 -3
- package/dist/components/{p-1633784e.js.map → p-4b8c0f24.js.map} +1 -1
- package/dist/components/{p-5c3fe5a8.js → p-697ad499.js} +2 -2
- package/dist/components/{p-5c3fe5a8.js.map → p-697ad499.js.map} +1 -1
- package/dist/{cjs/crmbonus.service-3c4ebbdf.js → components/p-8655e19b.js} +27 -6
- package/dist/components/p-8655e19b.js.map +1 -0
- package/dist/components/{p-39d680b6.js → p-9451863e.js} +2 -2
- package/dist/components/{p-39d680b6.js.map → p-9451863e.js.map} +1 -1
- package/dist/components/{p-70431539.js → p-9a1a1346.js} +5 -5
- package/dist/components/{p-70431539.js.map → p-9a1a1346.js.map} +1 -1
- package/dist/components/{p-f5fcff75.js → p-a662c21e.js} +2 -2
- package/dist/components/{p-f5fcff75.js.map → p-a662c21e.js.map} +1 -1
- package/dist/components/{p-a30bd6b1.js → p-b4a3a6b1.js} +3 -3
- package/dist/components/{p-a30bd6b1.js.map → p-b4a3a6b1.js.map} +1 -1
- package/dist/components/{p-d78762f7.js → p-d36f79db.js} +5 -5
- package/dist/components/{p-d78762f7.js.map → p-d36f79db.js.map} +1 -1
- package/dist/components/{p-2f266d73.js → p-d980defa.js} +23 -3
- package/dist/components/p-d980defa.js.map +1 -0
- package/dist/components/{p-f579d773.js → p-fcded764.js} +8 -6
- package/dist/components/p-fcded764.js.map +1 -0
- package/dist/components/pedido-finalizado.js +2 -2
- package/dist/components/phone-cancel-input.js +3 -3
- package/dist/components/phone-form.js +1 -1
- package/dist/components/phone-input-mask.js +1 -1
- package/dist/components/phone-input.js +3 -3
- package/dist/components/pin-form.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-16b4ec37.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-16b4ec37.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-1a8fa499.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-1a8fa499.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-1b576638.entry.js +2 -0
- package/dist/crmbonus-component-wake/{p-d398c696.entry.js → p-3e961e9f.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-4a7c3241.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-4a7c3241.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-0bf0fffe.entry.js → p-5cc2263b.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-8b9a1aec.entry.js → p-5f8da192.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-7db39512.entry.js +2 -0
- package/dist/crmbonus-component-wake/{p-dd6f6ab7.js → p-8655e19b.js} +2 -2
- package/dist/crmbonus-component-wake/p-8655e19b.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-6e6bf96e.js → p-a19d8144.js} +3 -3
- package/dist/crmbonus-component-wake/p-a19d8144.js.map +1 -0
- package/dist/crmbonus-component-wake/p-b76bc8b0.entry.js +2 -0
- package/dist/crmbonus-component-wake/{p-3beb5158.entry.js → p-b8d492f5.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-c86583a2.entry.js → p-ccedd998.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-db613cd0.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-db613cd0.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-66f41fd0.entry.js → p-dc393e47.entry.js} +2 -2
- package/dist/esm/app-modal.entry.js +1 -1
- package/dist/esm/countdown-timer_4.entry.js +7 -5
- package/dist/esm/countdown-timer_4.entry.js.map +1 -1
- package/dist/esm/crm-bonus-form.entry.js +2 -2
- package/dist/esm/crm-bonus-note.entry.js +10 -4
- package/dist/esm/crm-bonus-note.entry.js.map +1 -1
- package/dist/esm/crm-bonus.entry.js +11 -3
- package/dist/esm/crm-bonus.entry.js.map +1 -1
- package/dist/esm/crm-button.entry.js +1 -1
- package/dist/esm/crm-giftback-form.entry.js +23 -7
- package/dist/esm/crm-giftback-form.entry.js.map +1 -1
- package/dist/esm/crmbonus-component-wake.js +3 -3
- package/dist/{components/p-dd6f6ab7.js → esm/crmbonus.service-5a5e8f29.js} +27 -4
- package/dist/esm/crmbonus.service-5a5e8f29.js.map +1 -0
- package/dist/esm/giftback-finish_4.entry.js +1 -1
- package/dist/esm/{index-a4c14fca.js → index-5010d0a3.js} +29 -3
- package/dist/esm/index-5010d0a3.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/loading-spinner.entry.js +1 -1
- package/dist/esm/pedido-finalizado.entry.js +2 -2
- package/dist/esm/phone-cancel-input.entry.js +1 -1
- package/dist/esm/phone-input-mask.entry.js +1 -1
- package/dist/esm/phone-input.entry.js +1 -1
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +1 -0
- package/dist/types/components/giftback-form/giftback-form.d.ts +4 -1
- package/dist/types/components/note/crm-bonus-note.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/types/services/crmbonus.service.d.ts +1 -0
- package/dist/types/utils/keys.storage.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/crmbonus.service-3c4ebbdf.js.map +0 -1
- package/dist/cjs/index-80419303.js.map +0 -1
- package/dist/components/p-0837b8be.js.map +0 -1
- package/dist/components/p-2f266d73.js.map +0 -1
- package/dist/components/p-dd6f6ab7.js.map +0 -1
- package/dist/components/p-f579d773.js.map +0 -1
- package/dist/crmbonus-component-wake/p-16f94bb3.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-16f94bb3.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-2d58da10.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-2d58da10.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-3522a3e3.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-6e6bf96e.js.map +0 -1
- package/dist/crmbonus-component-wake/p-9b5e8c4a.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-9b5e8c4a.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-adb37e26.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-d88e7fc6.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-d88e7fc6.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-dd6f6ab7.js.map +0 -1
- package/dist/crmbonus-component-wake/p-e81abe7f.entry.js +0 -2
- package/dist/esm/crmbonus.service-9cba7b49.js.map +0 -1
- package/dist/esm/index-a4c14fca.js.map +0 -1
- /package/dist/crmbonus-component-wake/{p-e81abe7f.entry.js.map → p-1b576638.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-d398c696.entry.js.map → p-3e961e9f.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-0bf0fffe.entry.js.map → p-5cc2263b.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-8b9a1aec.entry.js.map → p-5f8da192.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-3522a3e3.entry.js.map → p-7db39512.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-adb37e26.entry.js.map → p-b76bc8b0.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-3beb5158.entry.js.map → p-b8d492f5.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-c86583a2.entry.js.map → p-ccedd998.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-66f41fd0.entry.js.map → p-dc393e47.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","userId","storeName","productsInString","cartId","showModal","products","customer","loading","message","phone","canCancel","amountCancel","sent","session","stepNext","loadingModal","saveStore","cancel","handleCustomerName","step","bonus","setStep","sendPin","value","isOpen","modalTitle","storename","config","orderId","metadadoString","txtBtn","handleClick","initialValue","disabled","getPhone","size","color","handlerSubmit","validate","resend","pin","isVerified","canResend","reserve","usedValue","selectedOption","sliderPosition","downtime","counter","pinInfo","sucess","error","applyName","newValue"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"0HAOA,IAAIA,EAAe,KAUjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EClB7BH,IAAeQ,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAc,+BAA8B,CAAAC,OAAS,aAAAC,UAAA,gBAAAC,iBAAA,eAAAC,OAAA,aAAAC,UAAA,KAAAC,SAAA,KAAAC,SAAA,KAAAC,QAAA,KAAAC,QAAA,KAAAC,MAAA,KAAAC,UAAA,KAAAC,aAAA,KAAAC,KAAA,KAAAC,QAAA,
|
1
|
+
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","userId","storeName","productsInString","cartId","showModal","products","customer","loading","message","phone","canCancel","amountCancel","sent","session","stepNext","loadingModal","saveStore","cancel","handleCustomerName","step","bonus","setStep","sendPin","value","isOpen","modalTitle","storename","config","orderId","metadadoString","txtBtn","handleClick","initialValue","disabled","getPhone","size","color","handlerSubmit","validate","resend","pin","isVerified","canResend","reserve","usedValue","selectedOption","sliderPosition","downtime","counter","pinInfo","sucess","error","hasApplyBonus","applyName","newValue"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"0HAOA,IAAIA,EAAe,KAUjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EClB7BH,IAAeQ,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAc,+BAA8B,CAAAC,OAAS,aAAAC,UAAA,gBAAAC,iBAAA,eAAAC,OAAA,aAAAC,UAAA,KAAAC,SAAA,KAAAC,SAAA,KAAAC,QAAA,KAAAC,QAAA,KAAAC,MAAA,KAAAC,UAAA,KAAAC,aAAA,KAAAC,KAAA,KAAAC,QAAA,YAAAX,iBAAA,0DAAAD,UAAA,gBAAAE,OAAA,cAAAE,SAAA,KAAAC,SAAA,KAAAM,KAAA,KAAAE,SAAA,gBAAAL,MAAA,IAAAM,aAAA,oBAAAC,UAAA,KAAAC,OAAA,KAAAC,mBAAA,KAAAX,QAAA,KAAAY,KAAA,KAAAX,QAAA,KAAAY,MAAA,KAAAC,QAAA,iDAAAC,QAAA,KAAAf,QAAA,IAAAgB,MAAA,yCAAAD,QAAA,KAAAf,QAAA,IAAAgB,MAAA,uCAAAC,OAAA,gBAAAC,WAAA,0DAAAtB,OAAA,aAAAuB,UAAA,IAAArC,IAAA,KAAAsC,OAAA,gDAAAxB,OAAA,aAAAyB,QAAA,cAAAC,eAAA,mDAAAC,OAAA,cAAAvB,QAAA,IAAAwB,YAAA,+CAAAC,aAAA,oBAAAC,SAAA,IAAAxB,MAAA,KAAAD,QAAA,KAAA0B,SAAA,8CAAAC,KAAA,IAAAC,MAAA,wCAAAb,MAAA,IAAAhB,QAAA,IAAA8B,cAAA,KAAAV,OAAA,sBAAAW,SAAA,KAAArB,OAAA,KAAAsB,OAAA,KAAA3B,KAAA,KAAAL,QAAA,IAAAE,MAAA,IAAAkB,OAAA,KAAAa,IAAA,KAAAC,WAAA,KAAAC,UAAA,2BAAAnC,QAAA,IAAAa,MAAA,KAAAuB,QAAA,KAAA1B,OAAA,KAAA2B,UAAA,KAAAC,eAAA,KAAAC,eAAA,6BAAAC,SAAA,KAAAC,QAAA,gDAAA/C,UAAA,gBAAAE,OAAA,cAAAE,SAAA,KAAAC,SAAA,KAAAiB,MAAA,KAAAhB,QAAA,KAAAC,QAAA,KAAAC,MAAA,KAAAwC,QAAA,KAAA9B,KAAA,KAAAC,MAAA,KAAA8B,OAAA,KAAAC,MAAA,KAAAxB,OAAA,KAAAyB,cAAA,2CAAAxC,KAAA,KAAA0B,SAAA,KAAArB,OAAA,KAAAV,QAAA,IAAAiC,IAAA,KAAAC,WAAA,+BAAAlC,QAAA,IAAAa,MAAA,KAAAuB,QAAA,KAAA1B,OAAA,KAAA2B,UAAA,wBAAArB,MAAA,IAAAhB,QAAA,IAAA8C,UAAA,KAAApC,OAAA,KAAAqC,SAAA,KAAA9C,QAAA,gCAAAX,EAAA","ignoreList":[]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as t,h as i}from"./p-a19d8144.js";import{C as s,g as e}from"./p-8655e19b.js";import{S as o}from"./p-a561251a.js";import{g as n}from"./p-75ba7b9a.js";import{i as a}from"./p-fb505488.js";const h="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-family:Roboto;font-size:var(--crmfont-sizebodymd);font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:14px;color:var(--crm-btn)}.crm-title{font-weight:700;line-height:20px;color:#262626;font-size:16px}.crm-message-info{color:#619013;font-weight:500;font-size:12px}.crm-message-error{color:#E11D48;font-weight:500;font-size:12px}";const r=h;const c=class{constructor(i){t(this,i);this.crmBonusService=s.getInstance();this.storeName=undefined;this.cartId=undefined;this.products=undefined;this.customer=undefined;this.value=undefined;this.loading=false;this.message=undefined;this.phone=undefined;this.pinInfo=undefined;this.step=o.STEP_PHONE;this.bonus=undefined;this.sucess="";this.error="";this.config=undefined;this.hasApplyBonus=false}async handleSendPin(t){this.message="";if(!t){this.message="Informe seu telefone";return}this.phone=t;this.sendPin()}componentWillLoad(){this.sucess="";this.error="";this.config=n(this.storeName);this.handleApply()}handleApply(){const t=localStorage.getItem(e(this.cartId));if(t){this.bonus=JSON.parse(t);this.step=o.STEP_RESERVE}}convertStringToNumber(){const t=this.phone.replace(/\D/g,"");return Number(t)}async sendPin(){var t,i;this.loading=true;this.message="";this.sucess="";this.error="";try{const t=this.convertStringToNumber();this.pinInfo=await this.crmBonusService.sendPin(t,"",this.storeName);this.step=o.STEP_PIN}catch(s){this.message=(i=(t=s===null||s===void 0?void 0:s.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.message}finally{this.loading=false}}changePhone(){this.sucess="";this.error="";this.step=o.STEP_PHONE}async validateBonus(t){var i,s;if(this.sucess){this.step=o.STEP_RESERVE;return}this.loading=true;this.sucess="";this.error="";const e={pin:t,cellphone:this.phone.toString(),storeId:this.pinInfo.storeId.toString(),userId:this.pinInfo.userId.toString(),checkoutId:this.cartId,checkoutProducts:this.products,name:null,storeName:this.storeName};try{this.bonus=await this.crmBonusService.validatePinBonus(e);if(!this.bonus.hasBonus){this.loading=false;this.step=o.STEP_NO_BONUS;return}this.sucess="Código validado com sucesso!"}catch(t){const e=(s=(i=t===null||t===void 0?void 0:t.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.message;if(e.includes("Pin")){this.error="Código inválido!"}else{this.error=e;this.step=o.STEP_NO_BONUS}}finally{this.loading=false}}handleCancel(){this.cancel()}async cancel(){this.message="";this.loading=true;try{await this.crmBonusService.cancel(this.cartId);this.save(0)}catch(t){this.message="Não consegui cancelar o bônus, tente novamente!"}finally{this.loading=false}}async reserveApply(t){this.loading=true;this.message="";try{await this.reserve(t);this.save(t);localStorage.setItem(e(this.cartId),JSON.stringify(this.bonus))}catch(t){this.message="ocorreu um error ao solicitar a aplicação do bonus! tente novamente";this.step=o.STEP_NO_BONUS;localStorage.removeItem(this.cartId)}finally{this.loading=false}}save(t){localStorage.setItem(this.cartId,t.toString())}async reserve(t){await this.crmBonusService.reserve({redeemedBonus:t,cartId:this.cartId,ticket:this.cartId,grossValue:Number(this.bonus.totalValue),storeName:this.storeName,storeId:this.bonus.storeId.toString(),userId:this.bonus.userId})}render(){return i("div",{key:"6e1606eaec511132df6a1d7aba66103182eac58b",class:"crm-container-form fbits-responsive-carrinho-desconto"},i("label",{key:"a246f11b8e9aa1eeb2147f1178d17e0912b0d751",class:"crm-title"},this.config.giftbackTitle),this.step===o.STEP_PHONE&&i("phone-form",{key:"15bd1a8b01675711cc2fec08620555e207796586",value:this.customer.phone,config:this.config,loading:this.loading,handlerSubmit:t=>this.handleSendPin(t)}),this.step===o.STEP_PIN&&i("pin-form",{key:"5bc81c0dd0473da58c760c95c046ecdd915ae74a",config:this.config,phone:this.phone,cancel:()=>this.changePhone(),resend:()=>this.sendPin(),validate:t=>this.validateBonus(t),loading:this.loading},this.sucess&&i("p",{key:"07c778c2c9a69deb51f4b33db1e0c806d2bd8d19",class:"crm-message-info"},this.sucess),this.error&&i("p",{key:"84fad905cfc281915a3534f52a09a284eab2fd89",class:"crm-message-error"},this.error)),this.step===o.STEP_RESERVE&&i("giftback-info",{key:"2f76ecd6109afd43259835bb18d6a934fafabed7",loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:t=>this.reserveApply(t)}),this.step===o.STEP_NO_BONUS&&i("div",{key:"1bc84ded4f32d6ad8a9a0658f4be120e16126a47",class:"container-message"},a.t("noGiftback",{storename:this.config.giftbackTitle})))}};c.style=r;export{c as crm_giftback_form};
|
2
|
+
//# sourceMappingURL=p-16b4ec37.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["giftbackFormCss","CrmGiftbackFormStyle0","CrmBonus","this","crmBonusService","CrmBonusService","getInstance","StepFormEnum","STEP_PHONE","handleSendPin","phone","message","sendPin","componentWillLoad","sucess","error","config","getInfoCustomization","storeName","handleApply","bonus","localStorage","getItem","getKeyReserveByCartId","cartId","JSON","parse","step","STEP_RESERVE","convertStringToNumber","_phone","replace","Number","loading","pinInfo","STEP_PIN","_b","_a","response","data","changePhone","validateBonus","pin","payload","cellphone","toString","storeId","userId","checkoutId","checkoutProducts","products","name","validatePinBonus","hasBonus","STEP_NO_BONUS","_error","includes","handleCancel","cancel","save","reserveApply","amount","reserve","setItem","stringify","removeItem","redeemedBonus","ticket","grossValue","totalValue","render","h","key","class","giftbackTitle","value","customer","handlerSubmit","resend","validate","amountRedeemed","i18next","t","storename"],"sources":["src/components/giftback-form/giftback-form.css?tag=crm-giftback-form","src/components/giftback-form/giftback-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css'\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_PHONE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n\n @State() hasApplyBonus = false;\n\n async handleSendPin(phone: string) {\n\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin()\n }\n\n componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n\n this.handleApply()\n\n }\n\n handleApply() {\n const bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (bonus) {\n this.bonus = JSON.parse(bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n }\n\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber()\n\n this.pinInfo = await this.crmBonusService.sendPin(_phone, \"\", this.storeName);\n\n this.step = StepFormEnum.STEP_PIN;\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n if (this.sucess) {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: null,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n if (!this.bonus.hasBonus) {\n this.loading = false;\n this.step = StepFormEnum.STEP_NO_BONUS;\n return\n }\n\n this.sucess = \"Código validado com sucesso!\";\n\n } catch (error) {\n const _error: string = error?.response?.data?.message;\n\n if (_error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n\n\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n // localStorage.removeItem(this.cartId);\n this.save(0)\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n this.save(amount);\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify(this.bonus));\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" >\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n value={this.customer.phone}\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)}\n />\n }\n\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"],"mappings":"kMAAA,MAAMA,EAAkB,k9BACxB,MAAAC,EAAeD,E,MCaFE,EAAQ,M,yBAGXC,KAAAC,gBAAmCC,EAAgBC,c,iIAQ/B,M,6EAIEC,EAAaC,W,iCAGjB,G,WACD,G,yCAGA,K,CAEzB,mBAAMC,CAAcC,GAElBP,KAAKQ,QAAU,GACf,IAAKD,EAAO,CACVP,KAAKQ,QAAU,uBACf,M,CAGFR,KAAKO,MAAQA,EAEbP,KAAKS,S,CAGP,iBAAAC,GACEV,KAAKW,OAAS,GACdX,KAAKY,MAAQ,GACbZ,KAAKa,OAASC,EAAqBd,KAAKe,WAExCf,KAAKgB,a,CAIP,WAAAA,GACE,MAAMC,EAAQC,aAAaC,QAAQC,EAAsBpB,KAAKqB,SAE9D,GAAIJ,EAAO,CACTjB,KAAKiB,MAAQK,KAAKC,MAAMN,GACxBjB,KAAKwB,KAAOpB,EAAaqB,Y,EAKrB,qBAAAC,GACN,MAAMC,EAAS3B,KAAKO,MAAMqB,QAAQ,MAAO,IACzC,OAAOC,OAAOF,E,CAGT,aAAMlB,G,QACXT,KAAK8B,QAAU,KACf9B,KAAKQ,QAAU,GACfR,KAAKW,OAAS,GACdX,KAAKY,MAAQ,GAEb,IAEE,MAAMe,EAAS3B,KAAK0B,wBAEpB1B,KAAK+B,cAAgB/B,KAAKC,gBAAgBQ,QAAQkB,EAAQ,GAAI3B,KAAKe,WAEnEf,KAAKwB,KAAOpB,EAAa4B,Q,CAEzB,MAAOpB,GACPZ,KAAKQ,SAAUyB,GAAAC,EAAAtB,IAAK,MAALA,SAAK,SAALA,EAAOuB,YAAQ,MAAAD,SAAA,SAAAA,EAAEE,QAAI,MAAAH,SAAA,SAAAA,EAAEzB,O,SAEtCR,KAAK8B,QAAU,K,EAInB,WAAAO,GACErC,KAAKW,OAAS,GACdX,KAAKY,MAAQ,GACbZ,KAAKwB,KAAOpB,EAAaC,U,CAGpB,mBAAMiC,CAAcC,G,QAEzB,GAAIvC,KAAKW,OAAQ,CACfX,KAAKwB,KAAOpB,EAAaqB,aACzB,M,CAGFzB,KAAK8B,QAAU,KACf9B,KAAKW,OAAS,GACdX,KAAKY,MAAQ,GACb,MAAM4B,EAA+B,CACnCD,IAAKA,EACLE,UAAWzC,KAAKO,MAAMmC,WACtBC,QAAS3C,KAAK+B,QAAQY,QAAQD,WAC9BE,OAAQ5C,KAAK+B,QAAQa,OAAOF,WAC5BG,WAAY7C,KAAKqB,OACjByB,iBAAkB9C,KAAK+C,SACvBC,KAAM,KACNjC,UAAWf,KAAKe,WAGlB,IACEf,KAAKiB,YAAcjB,KAAKC,gBAAgBgD,iBAAiBT,GAEzD,IAAKxC,KAAKiB,MAAMiC,SAAU,CACxBlD,KAAK8B,QAAU,MACf9B,KAAKwB,KAAOpB,EAAa+C,cACzB,M,CAGFnD,KAAKW,OAAS,8B,CAEd,MAAOC,GACP,MAAMwC,GAAiBnB,GAAAC,EAAAtB,IAAK,MAALA,SAAK,SAALA,EAAOuB,YAAQ,MAAAD,SAAA,SAAAA,EAAEE,QAAI,MAAAH,SAAA,SAAAA,EAAEzB,QAE9C,GAAI4C,EAAOC,SAAS,OAAQ,CAC1BrD,KAAKY,MAAQ,kB,KACR,CACLZ,KAAKY,MAAQwC,EACbpD,KAAKwB,KAAOpB,EAAa+C,a,UAK3BnD,KAAK8B,QAAU,K,EAIZ,YAAAwB,GAELtD,KAAKuD,Q,CAGP,YAAMA,GACJvD,KAAKQ,QAAU,GACfR,KAAK8B,QAAU,KACf,UACQ9B,KAAKC,gBAAgBsD,OAAOvD,KAAKqB,QAEvCrB,KAAKwD,KAAK,E,CACV,MAAO5C,GACPZ,KAAKQ,QAAU,iD,SAEfR,KAAK8B,QAAU,K,EAIZ,kBAAM2B,CAAaC,GACxB1D,KAAK8B,QAAU,KACf9B,KAAKQ,QAAU,GACf,UACQR,KAAK2D,QAAQD,GACnB1D,KAAKwD,KAAKE,GACVxC,aAAa0C,QAAQxC,EAAsBpB,KAAKqB,QAASC,KAAKuC,UAAU7D,KAAKiB,O,CAC7E,MAAOL,GACPZ,KAAKQ,QAAU,sEAEfR,KAAKwB,KAAOpB,EAAa+C,cACzBjC,aAAa4C,WAAW9D,KAAKqB,O,SAE7BrB,KAAK8B,QAAU,K,EAInB,IAAA0B,CAAKE,GACHxC,aAAa0C,QAAQ5D,KAAKqB,OAAQqC,EAAOhB,W,CAGpC,aAAMiB,CAAQD,SAEb1D,KAAKC,gBAAgB0D,QAAQ,CACjCI,cAAeL,EACfrC,OAAQrB,KAAKqB,OACb2C,OAAQhE,KAAKqB,OACb4C,WAAYpC,OAAO7B,KAAKiB,MAAMiD,YAC9BnD,UAAWf,KAAKe,UAChB4B,QAAS3C,KAAKiB,MAAM0B,QAAQD,WAC5BE,OAAQ5C,KAAKiB,MAAM2B,Q,CAIvB,MAAAuB,GACE,OACEC,EAAA,OAAAC,IAAA,2CAAKC,MAAM,yDACTF,EAAA,SAAAC,IAAA,2CAAOC,MAAM,aAAatE,KAAKa,OAAO0D,eAErCvE,KAAKwB,OAASpB,EAAaC,YAC1B+D,EAAA,cAAAC,IAAA,2CACEG,MAAOxE,KAAKyE,SAASlE,MACrBM,OAAQb,KAAKa,OACbiB,QAAS9B,KAAK8B,QACd4C,cAAgBnE,GAAUP,KAAKM,cAAcC,KAG/CP,KAAKwB,OAASpB,EAAa4B,UAC3BoC,EAAA,YAAAC,IAAA,2CACExD,OAAQb,KAAKa,OACbN,MAAOP,KAAKO,MACZgD,OAAQ,IAAMvD,KAAKqC,cACnBsC,OAAQ,IAAM3E,KAAKS,UACnBmE,SAAWxC,GAASpC,KAAKsC,cAAcF,GACvCN,QAAS9B,KAAK8B,SAEb9B,KAAKW,QAAUyD,EAAA,KAAAC,IAAA,2CAAGC,MAAM,oBAAoBtE,KAAKW,QACjDX,KAAKY,OAASwD,EAAA,KAAAC,IAAA,2CAAGC,MAAM,qBAAqBtE,KAAKY,QAMpDZ,KAAKwB,OAASpB,EAAaqB,cAC3B2C,EAAA,iBAAAC,IAAA,2CACEvC,QAAS9B,KAAK8B,QACdyB,OAAQ,IAAMvD,KAAKsD,eACnBrC,MAAOjB,KAAKiB,MACZ0C,QAAUkB,GAA2B7E,KAAKyD,aAAaoB,KAMzD7E,KAAKwB,OAASpB,EAAa+C,eAEzBiB,EAAA,OAAAC,IAAA,2CAAKC,MAAM,qBACRQ,EAAQC,EAAE,aAAc,CAAEC,UAAWhF,KAAKa,OAAO0D,iB","ignoreList":[]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as e,h as t}from"./p-a19d8144.js";import{g as i}from"./p-75ba7b9a.js";import{C as a}from"./p-8655e19b.js";const o="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEwIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIvPg0KPHBhdGggZD0iTTE1IDkuOTQ3MjhDMTQuNSA5LjMgMTMuOCA4LjUgMTIgOC41QzEwLjIgOC41IDkgOS41MTM5MyA5IDkuOTQ3MjhDOSAxMC4zODA2IDkuMDY3ODYgMTAuOTI3NyAxMCAxMS41QzEwLjc1MjIgMTEuOTYxOCAxMi42Njg0IDEyLjA0MzkgMTMuNSAxMi41QzE0LjY3OSAxMy4xNDY3IDE0Ljg0OTcgMTMuODIwMiAxNC44NDk3IDE0LjA1MjJDMTQuODQ5NyAxNC42ODM3IDEzLjQxNzUgMTUuNDg1MiAxMiAxNS41QzEwLjUzNiAxNS41MTUzIDkuNSAxNC43IDkgMTQuMDUyMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPHBhdGggZD0iTTEyIDdWMTciIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPC9zdmc+";const d=".note-container{border:1px solid #dddddd;padding:0 15px 15px;margin:0 0 26px 0px}.note-container hr{border:1px solid #CCC}.note-container .back-cart{display:flex;text-align:center}.note-header{display:flex;align-items:baseline;justify-content:space-between}.note-title{font-weight:700;text-align:left;display:flex;gap:6px;align-items:center;margin-top:11px;color:#000}.note-description{font-family:Arial;color:#6d6d5f;padding:0;margin:0 auto}.back-cart{font-size:.9em;color:#27272A;text-decoration:none;cursor:pointer;margin-top:11px}.note-description-2{color:var(--crm-scheme-fg-main-inverse, #262626);font-family:Roboto;font-size:var(--crm-font-size-body-lg, 16px);font-style:normal;font-weight:var(--crm-font-weight-body-bold, 400);line-height:var(--crm-line-height-body-md, 20px);letter-spacing:var(--crm-letter-spacing-title-md, 0px);margin-top:11px;color:#000}.note-description-not{font-size:16px}";const n=d;const c=class{constructor(t){e(this,t);this.cartId=undefined;this.storename=undefined;this.url=undefined;this.config=undefined}componentWillLoad(){this.upadateCheckToFreteAndGetUrl()}upadateCheckToFreteAndGetUrl(){this.config=i(this.storename);const e=document.getElementsByName("forma-envio");e.forEach((e=>{e.checked=false}));this.url=window.location.origin}handleHide(){const e=localStorage.getItem(this.cartId);return!!e}getAmount(){const e=localStorage.getItem(this.cartId);console.log("amount",e);return Number(e).toFixed(2).replace(".",",")||"0,00"}async handleCancel(){await a.getInstance().cancelBonus(this.cartId,this.storename);window.location.href=this.url}render(){return t("div",{key:"df9c70a5a069bfed7fcbef3882c1079c78019e78"},t("div",{key:"eaa13fccbcabf194da631436d0e7234d9e4ae06c",class:"note-container"},t("div",{key:"145f6d3bba36e423064a46169bba209f74f484d4",class:"note-header"},t("p",{key:"e76de748da7e54f26510de70899720ba7df58cf1",class:"note-title"},t("img",{key:"7960d99a6637b0617f79ccc9de2345269dfb9ee3",src:o,width:23}),this.config.giftbackTitle),this.handleHide()&&t("p",{key:"35edb4072af1f0d7ba304527bff18833c7170d71",class:"back-cart",onClick:()=>this.handleCancel()},"Editar")),t("hr",{key:"0bc7dd65524c3a40f25a18b291a976f44050b848"}),this.handleHide()&&t("p",{key:"2bbd572fac93b989655b0a500575fb52e3cf0fb6",class:"note-description-2"},this.config.giftbackTitle||"Giftback"," aplicado ao pedido: ",t("strong",{key:"9fde20de64bd6a73d47d62d6162c7268d18c9f47"},"R$ ",this.getAmount())),!this.handleHide()&&t("p",{key:"99460d211c0a37480f87a4937540883a43928bbf",class:"note-description-not"},"Não há ",this.config.giftbackTitle||"Giftback"," disponível para essa compra")))}};c.style=n;export{c as crm_bonus_note};
|
2
|
+
//# sourceMappingURL=p-1a8fa499.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["moneyDollarsSvgrepoComSvg","crmBonusNoteCss","CrmBonusNoteStyle0","CrmBonusNote","componentWillLoad","this","upadateCheckToFreteAndGetUrl","config","getInfoCustomization","storename","envios","document","getElementsByName","forEach","envio","checked","url","window","location","origin","handleHide","amount","localStorage","getItem","cartId","getAmount","console","log","Number","toFixed","replace","handleCancel","CrmBonusService","getInstance","cancelBonus","href","render","h","key","class","src","money","width","giftbackTitle","onClick"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\r\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n</svg>",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl()\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n console.log('amount', amount)\n\n return Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\"\n }\n\n async handleCancel() {\n await CrmBonusService.getInstance().cancelBonus(this.cartId, this.storename);\n window.location.href = this.url;\n }\n\n render() {\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n this.handleHide() && (\n <p class=\"back-cart\" onClick={() => this.handleCancel()}>\n Editar\n </p>\n )\n }\n </div>\n\n <hr />\n {\n this.handleHide() &&\n (\n <p class=\"note-description-2\">\n {this.config.giftbackTitle || \"Giftback\"} aplicado ao pedido: <strong>R$ {this.getAmount()}</strong>\n </p>\n )\n }\n\n {\n !this.handleHide() &&\n (\n <p class=\"note-description-not\">\n Não há {this.config.giftbackTitle || \"Giftback\"} disponível para essa compra\n </p>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"mappings":"mHAAA,MAAMA,EAA4B,ihCCAlC,MAAMC,EAAkB,04BACxB,MAAAC,EAAeD,E,MCSFE,EAAY,M,iHAQrB,iBAAAC,GACIC,KAAKC,8B,CAGT,4BAAAA,GAEID,KAAKE,OAASC,EAAqBH,KAAKI,WACxC,MAAMC,EAASC,SAASC,kBAAkB,eAC1CF,EAAOG,SAASC,IACZA,EAAMC,QAAU,KAAK,IAGzBV,KAAKW,IAAMC,OAAOC,SAASC,M,CAG/B,UAAAC,GACI,MAAMC,EAASC,aAAaC,QAAQlB,KAAKmB,QACzC,QAASH,C,CAGb,SAAAI,GACI,MAAMJ,EAASC,aAAaC,QAAQlB,KAAKmB,QAEzCE,QAAQC,IAAI,SAAUN,GAEtB,OAAOO,OAAOP,GAAQQ,QAAQ,GAAGC,QAAQ,IAAK,MAAQ,M,CAG1D,kBAAMC,SACIC,EAAgBC,cAAcC,YAAY7B,KAAKmB,OAAQnB,KAAKI,WAClEQ,OAAOC,SAASiB,KAAO9B,KAAKW,G,CAGhC,MAAAoB,GAEI,OACIC,EAAA,OAAAC,IAAA,4CACID,EAAA,OAAAC,IAAA,2CAAKC,MAAM,kBACPF,EAAA,OAAAC,IAAA,2CAAKC,MAAM,eAEPF,EAAA,KAAAC,IAAA,2CAAGC,MAAM,cACLF,EAAA,OAAAC,IAAA,2CAAKE,IAAKC,EAAOC,MAAO,KACvBrC,KAAKE,OAAOoC,eAGbtC,KAAKe,cACDiB,EAAA,KAAAC,IAAA,2CAAGC,MAAM,YAAYK,QAAS,IAAMvC,KAAK0B,gBAAc,WAOnEM,EAAA,MAAAC,IAAA,6CAEIjC,KAAKe,cAEDiB,EAAA,KAAAC,IAAA,2CAAGC,MAAM,sBACJlC,KAAKE,OAAOoC,eAAiB,WAAU,wBAAsBN,EAAA,UAAAC,IAAA,kDAAYjC,KAAKoB,eAMtFpB,KAAKe,cAEFiB,EAAA,KAAAC,IAAA,2CAAGC,MAAM,wBAAsB,UACnBlC,KAAKE,OAAOoC,eAAiB,WAAU,iC","ignoreList":[]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as t,h as s}from"./p-a19d8144.js";import{C as d}from"./p-8655e19b.js";const i=class{constructor(s){t(this,s);this.cartId=undefined;this.orderId=undefined;this.metadadoString=undefined}async componentWillLoad(){const t=this.metadadoString?JSON.parse(this.metadadoString):{id:null};if(this.cartId&&this.orderId){d.getInstance().updateOrder({cartId:this.cartId,orderId:this.orderId,cartIdCrm:t.id});const s=`bc-products:${this.cartId}`;localStorage.removeItem(s);localStorage.removeItem(this.cartId)}}render(){return s("div",{key:"ac2fe6b25bdbe08f088de1a60e1020ddc3a7bd87"})}};export{i as pedido_finalizado};
|
2
|
+
//# sourceMappingURL=p-1b576638.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as o,h as
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as o,h as t}from"./p-a19d8144.js";import{M as e}from"./p-a561251a.js";const s="*{margin:0;padding:0;box-sizing:border-box}.phone{display:block;width:100%;height:24px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:0px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.phone-input-form{width:246px;height:48px;padding:13px 16px 13px 16px;border:1px solid #CCCCCC}.crm-erro-msg{color:#E11D48;font-size:12px;font-weight:500;margin-top:11px}";const i=s;const n=class{constructor(t){o(this,t);this.phone="";this.message="";this.initialValue=undefined;this.disabled=undefined}componentWillLoad(){this.phone=this.initialValue}formatPhone(o){const t=o.replace(/\D/g,"");const e=t.match(/^(\d{0,2})(\d{0,5})(\d{0,4})$/);if(!e)return o;const s=e[1]?`(${e[1]}`:"";const i=e[2]?`) ${e[2]}`:"";const n=e[3]?` ${e[3]}`:"";return`${s}${i}${n}`}handleInput(o){const t=o.target;this.phone=this.formatPhone(t.value);if(!this.validatePhoneNumber(t.value)){this.message=e}else{this.message=""}}validatePhoneNumber(o){if(o.length<15){return true}const t=/^\(\d{2}\) \d{5} \d{4}$/;return t.test(o)}async getPhone(){return this.phone}render(){return t("div",{key:"a01b0eda3879ca00258fa9bc739155aa8a57741c"},t("input",{key:"6b134121f4990b8e46c4efa88c4f801764832f04",disabled:this.disabled,id:"phone",type:"text",class:"phone-input-form",value:this.phone,onInput:o=>this.handleInput(o),placeholder:"(12) 94567 8910"}),t("p",{key:"b193d31cf07633a05459f0e356755153afaa8534",class:"crm-erro-msg"},this.message))}};n.style=i;export{n as phone_input_mask};
|
2
|
+
//# sourceMappingURL=p-3e961e9f.entry.js.map
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as t,h as i}from"./p-a19d8144.js";import{C as s}from"./p-8655e19b.js";import{S as e}from"./p-a561251a.js";import{i as n}from"./p-fb505488.js";const o=".container-button{cursor:pointer;padding:5px 5px 5px 14px;}.section-crm{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}.section-cart-crm{margin-top:10px}.section-cart-crm p{padding:0;margin:0px 0px 0px 15px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer;margin-left:10px;height:70px}.form-container{width:97%;display:flex;justify-content:space-around}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:0px}.form-container .btnCrm{background:#00162e;border-color:#00162e;width:30%;color:#fff}.message-alert{font-family:sans-serif;color:#df4d4d;margin-top:5px}";const a=o;const r=class{constructor(i){t(this,i);this.crmBonusService=s.getInstance();this.showModal=false;this.userId=undefined;this.storeName=undefined;this.productsInString=undefined;this.cartId=undefined;this.products=undefined;this.customer={birthDate:"",document:"",name:"",phone:""};this.loading=false;this.message=undefined;this.phone=undefined;this.canCancel=false;this.amountCancel=undefined;this.sent=undefined;this.session=undefined}watchProducts(t,i){console.log("[NEW VALUE PRODUCTS]",t);console.log("[OLD VALUE PRODUCTS]",i)}async componentWillLoad(){n.changeLanguage(n.language);await this.loadSession();await this.loadConfigStore();await this.handleLoad()}async loadConfigStore(){await this.crmBonusService.getCustomization(this.storeName)}async handleLoad(){try{if(this.userId){this.customer=await this.crmBonusService.getCustomer(this.userId,this.storeName)}const t=localStorage.getItem(this.cartId);if(t){this.canCancel=true;this.amountCancel=t}}catch(t){console.log("info customer")}this.buildAndGetProducts()}async loadSession(){this.session=await this.crmBonusService.getToken(this.storeName);setTimeout((()=>{this.loadSession()}),15e5)}async buildAndGetProducts(){const t=`bc-products:${this.cartId}`;const i=localStorage.getItem(t);if(!i){localStorage.setItem(t,this.productsInString)}const s=JSON.parse(this.productsInString);const e=JSON.parse(localStorage.getItem(t));const n=[];for(const t of s){const[i]=e.filter((i=>i.ProdutoVarianteId==t.ProdutoVarianteId));if(i){n.push(Object.assign(Object.assign({},t),{PrecoPor:i.PrecoPor}))}else{n.push(t)}}this.products=n}async sendPin(t){var i,s;this.loading=true;this.message="";try{const i=t.replace(/\D/g,"");this.phone=Number(i);this.sent=await this.crmBonusService.sendPin(this.phone,this.customer.name,this.storeName);await this.crmBonusRef.setStep(e.STEP_PIN);this.showModal=true}catch(t){this.message=(s=(i=t===null||t===void 0?void 0:t.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.message}finally{this.loading=false}}async sendPinName(t){var i,s;this.loading=true;this.message="";try{this.customer.name=t;this.sent=await this.crmBonusService.sendPin(this.phone,this.customer.name,this.storeName);await this.crmBonusRef.setStep(e.STEP_PIN);this.showModal=true}catch(t){this.message=(s=(i=t===null||t===void 0?void 0:t.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.message}finally{this.loading=false}}buildProducts(){return this.products.map((t=>({sku:t.SKU,value:t.PrecoPor*t.Quantidade,productVariantId:t.ProdutoVarianteId.toString(),quantity:t.Quantidade})))}handleCloseModal(){this.showModal=false}save(t){localStorage.setItem(this.cartId,t.toString());this.canCancel=true;this.amountCancel=t.toString()}async cancel(){this.message="";this.loading=true;try{await this.crmBonusService.cancel(this.cartId);this.canCancel=false;localStorage.removeItem(this.cartId)}catch(t){this.message="Não consegui cancelar o bônus, tente novamente!"}finally{this.loading=false}}async handleSendPin(t){this.message="";if(!t){this.message="Informe seu telefone";return}this.customer.phone=t;const i=t.replace(/\D/g,"");this.phone=Number(i);if(this.customer.name){return this.sendPin(t)}await this.crmBonusRef.setStep(e.STEP_NAME);this.showModal=true}render(){return i("crm-giftback-form",{key:"ac0d570fb5109b5a56dfb10731b44c6b55cbeee0",storeName:this.storeName,products:this.buildProducts(),cartId:this.cartId,customer:this.customer})}static get assetsDirs(){return["assets"]}static get watchers(){return{productsInString:["watchProducts"]}}};r.style=a;export{r as crm_bonus};
|
2
|
+
//# sourceMappingURL=p-4a7c3241.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["crmBonusCss","CrmBonusStyle0","CrmBonus","this","crmBonusService","CrmBonusService","getInstance","birthDate","document","name","phone","watchProducts","newValue","oldValue","console","log","componentWillLoad","i18next","changeLanguage","language","loadSession","loadConfigStore","handleLoad","getCustomization","storeName","userId","customer","getCustomer","amount","localStorage","getItem","cartId","canCancel","amountCancel","error","buildAndGetProducts","session","getToken","setTimeout","key","cache_products","setItem","productsInString","productsInCart","JSON","parse","products_in_cache","products","product_cart","pro","filter","p","ProdutoVarianteId","push","Object","assign","PrecoPor","sendPin","loading","message","_phone","replace","Number","sent","crmBonusRef","setStep","StepFormEnum","STEP_PIN","showModal","_b","_a","response","data","sendPinName","customerName","buildProducts","map","product","sku","SKU","value","Quantidade","productVariantId","toString","quantity","handleCloseModal","save","cancel","removeItem","handleSendPin","STEP_NAME","render","h"],"sources":["src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=shadow","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["\n.container-button {\n /* max-width: 100%; */\n cursor: pointer;\n padding: 5px 5px 5px 14px;\n /* display: flex; */\n}\n\n/* padding: 0 15px 15px;\nborder: 1px solid #ddd;\nmargin-bottom: 20px; */\n\n.section-crm {\n border: 1px solid #dbd4d4;\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.section-cart-crm {\n margin-top: 10px;\n}\n\n.section-cart-crm p {\n padding: 0;\n margin: 0px 0px 0px 15px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n /* border-radius: 10px; */\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n margin-left: 10px;\n height: 70px;\n}\n\n.form-container {\n width: 97%;\n display: flex;\n justify-content: space-around;\n}\n\n\n.btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 0px;\n}\n\n.form-container .btnCrm {\n background: #00162e;\n border-color: #00162e;\n width: 30%;\n color: #fff;\n}\n\n.message-alert {\n font-family: sans-serif;\n color: #df4d4d;\n margin-top: 5px;\n}","import { Component, Prop, State, Watch, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\nimport i18next from '../../i18n/i18n'\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() amountCancel: string;\n @State() sent: IPinSent;\n\n @State() session: string;\n\n\n @Watch(\"productsInString\")\n watchProducts(newValue: string, oldValue: string) {\n\n console.log('[NEW VALUE PRODUCTS]', newValue);\n console.log('[OLD VALUE PRODUCTS]', oldValue);\n\n }\n\n async componentWillLoad() {\n i18next.changeLanguage(i18next.language);\n\n await this.loadSession();\n await this.loadConfigStore()\n await this.handleLoad();\n }\n\n async loadConfigStore() {\n await this.crmBonusService.getCustomization(this.storeName);\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n // this.phone = Number(this.customer.phone)\n }\n\n const amount = localStorage.getItem(this.cartId);\n\n if (amount) {\n this.canCancel = true;\n this.amountCancel = amount;\n }\n\n } catch (error) {\n console.log('info customer')\n }\n \n this.buildAndGetProducts();\n }\n\n\n async loadSession() {\n this.session = await this.crmBonusService.getToken(this.storeName);\n\n setTimeout(() => {\n this.loadSession()\n }, 1500000)\n\n }\n\n async buildAndGetProducts() {\n const key = `bc-products:${this.cartId}`;\n const cache_products = localStorage.getItem(key)\n\n if (!cache_products) {\n localStorage.setItem(key, this.productsInString);\n }\n\n const productsInCart = JSON.parse(this.productsInString);\n const products_in_cache = JSON.parse(localStorage.getItem(key));\n\n const products: Array<IProductWake> = []\n\n for (const product_cart of productsInCart) {\n\n const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId)\n\n if (pro) {\n products.push({\n ...product_cart,\n PrecoPor: pro.PrecoPor\n })\n } else {\n products.push(product_cart)\n }\n \n }\n\n this.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);\n\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n public async sendPinName(customerName: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n this.customer.name = customerName;\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), productVariantId: product.ProdutoVarianteId.toString(), quantity: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n this.canCancel = true;\n this.amountCancel = amount.toString()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n this.canCancel = false;\n\n localStorage.removeItem(this.cartId);\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n async handleSendPin(phone: string) {\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.customer.phone = phone;\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n if (this.customer.name) {\n return this.sendPin(phone)\n }\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);\n this.showModal = true;\n }\n\n render() {\n\n return (\n <crm-giftback-form \n storeName={this.storeName}\n products={this.buildProducts()}\n cartId={this.cartId}\n customer={this.customer}\n />\n // <div class=\"section-cart-crm\">\n // <p class=\"text-left fbits-responsive-carrinho-desconto-texto\">Giftback</p>\n // <div class=\"container-button\">\n // {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n // {\n // this.canCancel ? <phone-cancel-input value={this.amountCancel} sendPin={() => { this.cancel() }} loading={this.loading} />\n // : <phone-input value={this.customer.phone} sendPin={(phone) => { this.handleSendPin(phone) }} loading={this.loading} />\n // }\n // </div>\n // <p class=\"message-alert\" >{this.message}</p>\n // <app-modal\n // isOpen={this.showModal}\n // modalTitle={`Giftback`}\n // onModalClosed={() => (this.showModal = false)}\n // >\n // <crm-bonus-form\n // loadingModal={this.loading}\n // saveStore={(amount: number) => this.save(amount)}\n // ref={ref => this.crmBonusRef = ref}\n // sent={this.sent}\n // phone={this.phone}\n // cancel={() => this.handleCloseModal()}\n // storeName={this.storeName}\n // products={this.buildProducts()}\n // cartId={this.cartId} customer={this.customer}\n // handleCustomerName={(name: string) => this.sendPinName(name)}\n // />\n // </app-modal>\n // </div>\n )\n }\n}\n"],"mappings":"uJAAA,MAAMA,EAAc,0/BACpB,MAAAC,EAAeD,E,MCaFE,EAAQ,M,yBAEXC,KAAAC,gBAAmCC,EAAgBC,c,eAI7B,M,2IAOC,CAC7BC,UAAW,GACXC,SAAU,GACVC,KAAM,GACNC,MAAO,I,aAGmB,M,2DAGE,M,uEAQ9B,aAAAC,CAAcC,EAAkBC,GAE9BC,QAAQC,IAAI,uBAAwBH,GACpCE,QAAQC,IAAI,uBAAwBF,E,CAItC,uBAAMG,GACJC,EAAQC,eAAeD,EAAQE,gBAEzBhB,KAAKiB,oBACLjB,KAAKkB,wBACLlB,KAAKmB,Y,CAGb,qBAAMD,SACElB,KAAKC,gBAAgBmB,iBAAiBpB,KAAKqB,U,CAGnD,gBAAMF,GACJ,IACE,GAAInB,KAAKsB,OAAQ,CACftB,KAAKuB,eAAiBvB,KAAKC,gBAAgBuB,YAAYxB,KAAKsB,OAAQtB,KAAKqB,U,CAI3E,MAAMI,EAASC,aAAaC,QAAQ3B,KAAK4B,QAEzC,GAAIH,EAAQ,CACVzB,KAAK6B,UAAY,KACjB7B,KAAK8B,aAAeL,C,EAGtB,MAAOM,GACPpB,QAAQC,IAAI,gB,CAGdZ,KAAKgC,qB,CAIP,iBAAMf,GACJjB,KAAKiC,cAAiBjC,KAAKC,gBAAgBiC,SAASlC,KAAKqB,WAEzDc,YAAW,KACTnC,KAAKiB,aAAa,GACjB,K,CAIL,yBAAMe,GACJ,MAAMI,EAAM,eAAepC,KAAK4B,SAChC,MAAMS,EAAiBX,aAAaC,QAAQS,GAE5C,IAAKC,EAAgB,CACnBX,aAAaY,QAAQF,EAAKpC,KAAKuC,iB,CAGjC,MAAMC,EAAiBC,KAAKC,MAAM1C,KAAKuC,kBACvC,MAAMI,EAAoBF,KAAKC,MAAMhB,aAAaC,QAAQS,IAE1D,MAAMQ,EAAgC,GAEtC,IAAK,MAAMC,KAAgBL,EAAgB,CAEzC,MAAOM,GAAOH,EAAkBI,QAAOC,GAAKA,EAAEC,mBAAqBJ,EAAaI,oBAEhF,GAAIH,EAAK,CACPF,EAASM,KAAIC,OAAAC,OAAAD,OAAAC,OAAA,GACRP,GAAY,CACfQ,SAAUP,EAAIO,W,KAEX,CACLT,EAASM,KAAKL,E,EAKlB7C,KAAK4C,SAAWA,C,CAIX,aAAMU,CAAQ/C,G,QACnBP,KAAKuD,QAAU,KACfvD,KAAKwD,QAAU,GAEf,IAEE,MAAMC,EAASlD,EAAMmD,QAAQ,MAAO,IACpC1D,KAAKO,MAAQoD,OAAOF,GAEpBzD,KAAK4D,WAAa5D,KAAKC,gBAAgBqD,QAAQtD,KAAKO,MAAOP,KAAKuB,SAASjB,KAAMN,KAAKqB,iBAE9ErB,KAAK6D,YAAYC,QAAQC,EAAaC,UAE5ChE,KAAKiE,UAAY,I,CACjB,MAAOlC,GACP/B,KAAKwD,SAAUU,GAAAC,EAAApC,IAAK,MAALA,SAAK,SAALA,EAAOqC,YAAQ,MAAAD,SAAA,SAAAA,EAAEE,QAAI,MAAAH,SAAA,SAAAA,EAAEV,O,SAEtCxD,KAAKuD,QAAU,K,EAIZ,iBAAMe,CAAYC,G,QACvBvE,KAAKuD,QAAU,KACfvD,KAAKwD,QAAU,GAEf,IACExD,KAAKuB,SAASjB,KAAOiE,EAErBvE,KAAK4D,WAAa5D,KAAKC,gBAAgBqD,QAAQtD,KAAKO,MAAOP,KAAKuB,SAASjB,KAAMN,KAAKqB,iBAE9ErB,KAAK6D,YAAYC,QAAQC,EAAaC,UAE5ChE,KAAKiE,UAAY,I,CACjB,MAAOlC,GACP/B,KAAKwD,SAAUU,GAAAC,EAAApC,IAAK,MAALA,SAAK,SAALA,EAAOqC,YAAQ,MAAAD,SAAA,SAAAA,EAAEE,QAAI,MAAAH,SAAA,SAAAA,EAAEV,O,SAEtCxD,KAAKuD,QAAU,K,EAInB,aAAAiB,GACE,OAAOxE,KAAK4C,SAAS6B,KAAIC,IAAO,CAAOC,IAAKD,EAAQE,IAAKC,MAAQH,EAAQrB,SAAWqB,EAAQI,WAAaC,iBAAkBL,EAAQzB,kBAAkB+B,WAAYC,SAAUP,EAAQI,c,CAGrL,gBAAAI,GACElF,KAAKiE,UAAY,K,CAGnB,IAAAkB,CAAK1D,GACHC,aAAaY,QAAQtC,KAAK4B,OAAQH,EAAOuD,YACzChF,KAAK6B,UAAY,KACjB7B,KAAK8B,aAAeL,EAAOuD,U,CAG7B,YAAMI,GACJpF,KAAKwD,QAAU,GACfxD,KAAKuD,QAAU,KACf,UACQvD,KAAKC,gBAAgBmF,OAAOpF,KAAK4B,QACvC5B,KAAK6B,UAAY,MAEjBH,aAAa2D,WAAWrF,KAAK4B,O,CAC7B,MAAOG,GACP/B,KAAKwD,QAAU,iD,SAEfxD,KAAKuD,QAAU,K,EAInB,mBAAM+B,CAAc/E,GAClBP,KAAKwD,QAAU,GACf,IAAKjD,EAAO,CACVP,KAAKwD,QAAU,uBACf,M,CAGFxD,KAAKuB,SAAShB,MAAQA,EACtB,MAAMkD,EAASlD,EAAMmD,QAAQ,MAAO,IACpC1D,KAAKO,MAAQoD,OAAOF,GAEpB,GAAIzD,KAAKuB,SAASjB,KAAM,CACtB,OAAON,KAAKsD,QAAQ/C,E,OAGhBP,KAAK6D,YAAYC,QAAQC,EAAawB,WAC5CvF,KAAKiE,UAAY,I,CAGnB,MAAAuB,GAEE,OACEC,EAAA,qBAAArD,IAAA,2CACEf,UAAWrB,KAAKqB,UAChBuB,SAAU5C,KAAKwE,gBACf5C,OAAQ5B,KAAK4B,OACbL,SAAUvB,KAAKuB,U","ignoreList":[]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,h as i}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,h as i}from"./p-a19d8144.js";const t="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiANCgkgdmlld0JveD0iMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxjaXJjbGUgc3R5bGU9ImZpbGw6IzI1QUU4ODsiIGN4PSIyNSIgY3k9IjI1IiByPSIyNSIvPg0KPHBvbHlsaW5lIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwOyIgcG9pbnRzPSINCgkzOCwxNSAyMiwzMyAxMiwyNSAiLz4NCjwvc3ZnPg==";const n=".message-finish{align-content:center;text-align:center}.message-finish p{color:#777676;font-size:xx-large;font-family:sans-serif}";const o=n;const a=class{constructor(i){e(this,i)}render(){return i("div",{key:"b2db01665e3e19659c35a8c912742352bca4a1ae",class:"message-finish"},i("img",{key:"0cb6d72a9bb696cf16ee38255cb2d5d6170e5ff1",src:t,width:80}),i("p",{key:"489dd5b09d20ff2140be375c1e234d5bf9671622"},"Legal! O Bônus será aplicado na sua compra."))}};a.style=o;const c=":host{display:block;font-family:Arial, sans-serif}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;gap:10px;margin:26px 0}input{width:58px;height:40px;font-size:18px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;border:none;border-radius:5px;cursor:pointer}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.footer-button{display:flex;justify-content:space-between;width:100%}";const s=c;const d=class{constructor(i){e(this,i);this.sent=undefined;this.validate=undefined;this.cancel=undefined;this.pin=["","","",""];this.isVerified=false;this.loading=false}handleInput(e,i){const t=e.target;const n=t.value.slice(0,1);this.pin[i]=n;if(n&&i<this.pin.length-1){const e=t.nextElementSibling;e===null||e===void 0?void 0:e.focus()}this.pin=[...this.pin]}validatePin(){this.validate(this.pin.join(""))}verifyPin(){const e=this.pin.join("");if(e==="9999"){this.isVerified=true}}render(){return i("div",{key:"6a91db0c8c2d522fcd7c0c3a9249711cedea8263",class:"form-container-pin"},i("div",{key:"9a894eda70decb59549c0b0418e38b8cc64c3e91"},i("p",{key:"0eea92e1f7a121cf7435fb8855d74da71b3a8435"},"Insira o PIN de 4 dígitos enviado por SMS."),i("div",{key:"c574ba350400555e6bfc16f995b5c122bc3b7cd5",class:"pin-container"},this.pin.map(((e,t)=>i("input",{type:"text",maxLength:1,value:this.pin[t],onInput:e=>this.handleInput(e,t)}))))),i("div",{key:"b904758b7a26c79a1fb87e9b93f3c986c98ec318",class:"footer-button"},i("button",{key:"31a4f91fca0c3d5a47c4eedb7d2a47ee8184b882",class:"button-cancel",disabled:this.loading,onClick:()=>this.cancel()},"Cancelar"),i("button",{key:"d5a1a344d7cd6ae8c113ea43f35512b75d6c01c9",class:`button ${this.loading?"disabled":""} `,disabled:this.loading,onClick:()=>this.validatePin()},!this.loading?"Enviar":i("loading-spinner",{size:"15px",color:"#fff"}))))}};d.style=s;const r=":host{display:flex;font-family:Arial, sans-serif;border-radius:10px;padding:16px;max-width:100%;flex-direction:column}.giftback-container{display:flex;flex-direction:column}.giftback-container p{font-size:medium}h3{margin:0 0 10px;font-size:18px}p{margin:5px 0;font-size:14px;align-self:start}.validity{font-size:12px;color:#888}.progress-container{display:flex;align-items:center;margin:10px 0}progress-container span{font-size:12px;color:#666}input[type='range']{flex:1;margin:0 10px;appearance:none;background-color:#ccc;height:6px;border-radius:3px;outline:none;cursor:pointer}input[type='range']::-webkit-slider-thumb{appearance:none;width:14px;height:14px;border-radius:50%;background-color:#555;cursor:pointer}.remaining{font-weight:bold;font-size:14px;color:#333}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.disabled{opacity:0.6;cursor:not-allowed}.footer-button-giftback{display:flex;justify-content:space-between;margin-top:14px}";const b=r;const l=class{constructor(i){e(this,i);this.usedValue=0;this.loading=false;this.bonus={totalBonus:0,cartId:"",minimumPurchase:0,bonusBalance:0,calculatedValue:0,firstValidityDate:""};this.reserve=undefined;this.cancel=undefined}componentWillLoad(){this.usedValue=parseFloat(this.bonus.bonusBalance.toString())}handleSliderChange(e){const i=e.target;this.usedValue=parseFloat(i.value)}async handleReserve(e){this.reserve(e)}render(){const e=this.bonus.minimumPurchase-this.bonus.totalValue;return i("div",{key:"a5e02f60ab5e081341582ea0b1cfaa05583a22c2",class:"giftback-container"},i("p",{key:"12eddb011e6a6beda91a1bc937fcacdb891b12a5"},"Você possui até ",i("strong",{key:"eb6018fe44106dd2a9928d4efe77dbd17180e3d3"},"R$ ",this.bonus.totalBonus.toFixed(2))," de Giftback nessa compra!"),i("p",{key:"065028af79e33d565c82bd55ea2245e3562617e8",class:"validity"},"Válido até: ",new Date(this.bonus.firstValidityDate).toLocaleDateString("pt-Br")),i("p",{key:"1ed8896f6301c2c70fb7232190a2c68bc82e5f07"},"Você está utilizando ",i("strong",{key:"e2019caa7c7697f73021416632ca884097e21abe"},"R$ ",this.usedValue.toFixed(2))," nessa compra"),i("div",{key:"b0257ef4d99c4009f23a4d9fae52b42d2ef41209",class:"progress-container"},i("span",{key:"bb0d1abe791dfcab30e87fea8eb025a9f3787be0"},"R$ 0"),i("input",{key:"a4220c65f24d68b56ccf522a46c0bd3d007c9ed6",disabled:true,type:"range",min:"0",step:"0.01",max:this.bonus.totalBonus,value:this.usedValue,onInput:e=>this.handleSliderChange(e)}),i("span",{key:"c216b57ffdd2a3613f05db327aad395f1f2e1285"},"R$ ",this.bonus.totalBonus.toFixed(2))),i("p",{key:"7a5dc6a68801da2c09a33f3cdb6cf82e521be581",class:"remaining"},"Faltam ",i("strong",{key:"9c20b260d4a95887844aa038e0f74180fff5c1eb"},"R$ ",e>0?e.toFixed(2):Number(0).toFixed(2))," para utilizar o valor total do Giftback."),i("div",{key:"d99639afcac1ea180ad414ca923391f99f3d5296",class:"footer-button-giftback"},i("button",{key:"4c1bdd2ea2ecd5037d1c29b6af31c3163fffe84a",class:"button-cancel",disabled:this.loading,onClick:()=>this.cancel()},"Cancelar"),i("button",{key:"77fc073d28272334d51ab7073e34654509c0ac26",class:`button ${this.loading?"disabled":""} `,disabled:this.loading,onClick:()=>this.handleReserve(this.usedValue)},!this.loading?"Aplicar":i("loading-spinner",{size:"10px",color:"#fff"}))))}};l.style=b;const f=".bc-form-control{display:block;width:90%;height:24px;padding:7px 18px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:0px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.bc-btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:0px}.bc-btn-process{background:#00162e;border-color:#00162e;width:30%;color:#fff}.bc-footer-btn{display:flex;justify-content:end;margin:11px}.name-container{font-weight:bold;color:#494545}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}button:hover{background-color:#bbb}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:11px;min-width:120px;font-size:20px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.footer-button{display:flex;justify-content:space-between;width:97%;margin-top:14px}";const p=f;const u=class{constructor(i){e(this,i);this.value=undefined;this.loading=undefined;this.applyName=undefined;this.cancel=undefined;this.newValue=undefined;this.message=undefined}handleChangeName(e){this.newValue=e.target.value}handleSetName(e){if(!e){this.message="Informe seu nome";return}this.applyName(e)}render(){return i("div",{key:"dc6b958c6cfb83af8275cf4ff47b1ece5f8f6d93",class:"name-container"},i("p",{key:"d9c1105b6aab09acbd970a001735b58eb5104d9b"},"Seu Nome:"),i("input",{key:"f562d5e2b1b626245abb5260ad1e197fd9a60e43",class:"bc-form-control",type:"text",value:this.value,onChange:e=>this.handleChangeName(e)}),i("p",{key:"980d915607979ee8ae8873a2fe17998c46d1ae64"},this.message),i("div",{key:"b4e75bbb6ee5c6f53e27722ffad3c6e1b9ae6d7f",class:"footer-button"},i("button",{key:"c421fbbe0d0bcf38e057afeb86f864ebb39f9fc8",class:"button-cancel",disabled:this.loading,onClick:()=>this.cancel()},"Cancelar"),i("button",{key:"17d357d3de919698efab46febb5c1ad97c398c77",class:`button ${this.loading?"disabled":""} `,disabled:this.loading,onClick:()=>this.handleSetName(this.newValue)},!this.loading?"Continua":i("loading-spinner",{size:"15px",color:"#fff"}))))}};u.style=p;export{a as giftback_finish,d as giftback_pin,l as giftback_progress,u as name_input};
|
2
|
+
//# sourceMappingURL=p-5cc2263b.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as a,h as e}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as a,h as e}from"./p-a19d8144.js";const i=class{constructor(e){a(this,e);this.sendPin=undefined;this.loading=undefined;this.value=undefined}async validatePhone(){const a=await this.phoneInputMask.getPhone();await this.sendPin(a)}render(){return e("div",{key:"04c879b5671b42602a36a9a88734604fcfa1d1da",class:"form-container"},e("phone-input-mask",{key:"a0ced8d74da25026383eac206bbf45f6fa9482e7",initialValue:`Valor aplicado R$ ${this.value}`,ref:a=>this.phoneInputMask=a,disabled:true}),e("button",{key:"89b08e7af3145068a449fb8e375372c280da7b7a",class:`btn btn-success btnCrm ${this.loading?"disabled":""} `,disabled:this.loading,onClick:()=>this.validatePhone()},!this.loading?"Cancelar":e("loading-spinner",{size:"11px",color:"#fff"})))}};export{i as phone_cancel_input};
|
2
|
+
//# sourceMappingURL=p-5f8da192.entry.js.map
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as t,h as e,H as s}from"./p-a19d8144.js";import{C as i}from"./p-8655e19b.js";import{S as a}from"./p-a561251a.js";const n=".form-container{width:100%;display:flex;justify-content:center;justify-content:space-around}.disabled{opacity:0.6;cursor:not-allowed}.message-error{color:#d11111;font-weight:bold;font-family:Arial;font-size:small;margin-left:16px}";const h=n;const d=class{constructor(e){t(this,e);this.crmBonusService=i.getInstance();this.storeName=undefined;this.cartId=undefined;this.products=undefined;this.customer={phone:"",birthDate:"",document:"",name:""};this.sent=undefined;this.stepNext=undefined;this.phone=undefined;this.loadingModal=undefined;this.saveStore=undefined;this.cancel=undefined;this.handleCustomerName=undefined;this.loading=false;this.step=a.STEP_NAME;this.message=undefined;this.bonus=undefined}async setStep(t){this.step=t}async validateBonus(t){var e,s;this.loading=true;this.message="";const i={pin:t,cellphone:this.phone.toString(),storeId:this.sent.storeId.toString(),userId:this.sent.userId.toString(),checkoutId:this.cartId,checkoutProducts:this.products,name:null,storeName:this.storeName};try{this.bonus=await this.crmBonusService.validatePinBonus(i);this.step=a.STEP_RESERVE}catch(t){this.message=(s=(e=t===null||t===void 0?void 0:t.response)===null||e===void 0?void 0:e.data)===null||s===void 0?void 0:s.message}finally{this.loading=false}}async reserveApply(t){this.loading=true;this.message="";try{await this.reserve(t);this.step=a.STEP_APPLY;this.saveStore(t)}catch(t){this.message="ocorreu um error ao solicitar a aplicação do bonus! tente novamente"}finally{this.loading=false}}async reserve(t){await this.crmBonusService.reserve({redeemedBonus:t,cartId:this.cartId,ticket:this.cartId,grossValue:Number(this.bonus.totalValue),storeName:this.storeName,storeId:this.bonus.storeId.toString(),userId:this.bonus.userId})}handleCancel(){this.step=a.STEP_PHONE;this.cancel()}render(){return e(s,{key:"56bef07243aafe1abb78fdfd38922801b84c269b"},this.step==a.STEP_NAME&&e("name-input",{key:"685df95ea0cd693f9a62893798464834524f5168",loading:this.loadingModal,value:this.customer.name,applyName:t=>this.handleCustomerName(t)}),this.step===a.STEP_PIN&&e("giftback-pin",{key:"af82b751ed04382498e25614276ac08d5cade07a",cancel:()=>this.handleCancel(),sent:this.sent,validate:t=>this.validateBonus(t),loading:this.loading}),this.step===a.STEP_RESERVE&&e("giftback-progress",{key:"1b493c06bf11bc7596d672fcec789a9f93573751",loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:t=>this.reserveApply(t)}),this.step===a.STEP_APPLY&&e("giftback-finish",{key:"272438aa4dbc8bb1ef9fdb45d3c2cc657d41ef4a"}),e("p",{key:"a3a0e8a1be44d65b1edd34e28956d1b34b732fef",class:"message-error"},this.message))}};d.style=h;export{d as crm_bonus_form};
|
2
|
+
//# sourceMappingURL=p-7db39512.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function t(t,e){return function n(){return t.apply(e,arguments)}}const{toString:e}=Object.prototype;const{getPrototypeOf:n}=Object;const o=(t=>n=>{const o=e.call(n);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null));const r=t=>{t=t.toLowerCase();return e=>o(e)===t};const s=t=>e=>typeof e===t;const{isArray:i}=Array;const c=s("undefined");function u(t){return t!==null&&!c(t)&&t.constructor!==null&&!c(t.constructor)&&d(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const a=r("ArrayBuffer");function l(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&a(t.buffer)}return e}const f=s("string");const d=s("function");const h=s("number");const p=t=>t!==null&&typeof t==="object";const m=t=>t===true||t===false;const w=t=>{if(o(t)!=="object"){return false}const e=n(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};const y=r("Date");const b=r("File");const g=r("Blob");const R=r("FileList");const O=t=>p(t)&&d(t.pipe);const E=t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||d(t.append)&&((e=o(t))==="formdata"||e==="object"&&d(t.toString)&&t.toString()==="[object FormData]"))};const S=r("URLSearchParams");const[T,A,j,x]=["ReadableStream","Request","Response","Headers"].map(r);const N=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function v(t,e,{allOwnKeys:n=false}={}){if(t===null||typeof t==="undefined"){return}let o;let r;if(typeof t!=="object"){t=[t]}if(i(t)){for(o=0,r=t.length;o<r;o++){e.call(null,t[o],o,t)}}else{const r=n?Object.getOwnPropertyNames(t):Object.keys(t);const s=r.length;let i;for(o=0;o<s;o++){i=r[o];e.call(null,t[i],i,t)}}}function C(t,e){e=e.toLowerCase();const n=Object.keys(t);let o=n.length;let r;while(o-- >0){r=n[o];if(e===r.toLowerCase()){return r}}return null}const P=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const B=t=>!c(t)&&t!==P;function D(){const{caseless:t}=B(this)&&this||{};const e={};const n=(n,o)=>{const r=t&&C(e,o)||o;if(w(e[r])&&w(n)){e[r]=D(e[r],n)}else if(w(n)){e[r]=D({},n)}else if(i(n)){e[r]=n.slice()}else{e[r]=n}};for(let t=0,e=arguments.length;t<e;t++){arguments[t]&&v(arguments[t],n)}return e}const F=(e,n,o,{allOwnKeys:r}={})=>{v(n,((n,r)=>{if(o&&d(n)){e[r]=t(n,o)}else{e[r]=n}}),{allOwnKeys:r});return e};const U=t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t};const _=(t,e,n,o)=>{t.prototype=Object.create(e.prototype,o);t.prototype.constructor=t;Object.defineProperty(t,"super",{value:e.prototype});n&&Object.assign(t.prototype,n)};const k=(t,e,o,r)=>{let s;let i;let c;const u={};e=e||{};if(t==null)return e;do{s=Object.getOwnPropertyNames(t);i=s.length;while(i-- >0){c=s[i];if((!r||r(c,t,e))&&!u[c]){e[c]=t[c];u[c]=true}}t=o!==false&&n(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e};const q=(t,e,n)=>{t=String(t);if(n===undefined||n>t.length){n=t.length}n-=e.length;const o=t.indexOf(e,n);return o!==-1&&o===n};const L=t=>{if(!t)return null;if(i(t))return t;let e=t.length;if(!h(e))return null;const n=new Array(e);while(e-- >0){n[e]=t[e]}return n};const I=(t=>e=>t&&e instanceof t)(typeof Uint8Array!=="undefined"&&n(Uint8Array));const z=(t,e)=>{const n=t&&t[Symbol.iterator];const o=n.call(t);let r;while((r=o.next())&&!r.done){const n=r.value;e.call(t,n[0],n[1])}};const M=(t,e)=>{let n;const o=[];while((n=t.exec(e))!==null){o.push(n)}return o};const $=r("HTMLFormElement");const H=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function t(e,n,o){return n.toUpperCase()+o}));const J=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype);const K=r("RegExp");const V=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t);const o={};v(n,((n,r)=>{let s;if((s=e(n,r,t))!==false){o[r]=s||n}}));Object.defineProperties(t,o)};const W=t=>{V(t,((e,n)=>{if(d(t)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const o=t[n];if(!d(o))return;e.enumerable=false;if("writable"in e){e.writable=false;return}if(!e.set){e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}}}))};const G=(t,e)=>{const n={};const o=t=>{t.forEach((t=>{n[t]=true}))};i(t)?o(t):o(String(t).split(e));return n};const X=()=>{};const Y=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;const Z="abcdefghijklmnopqrstuvwxyz";const Q="0123456789";const tt={DIGIT:Q,ALPHA:Z,ALPHA_DIGIT:Z+Z.toUpperCase()+Q};const et=(t=16,e=tt.ALPHA_DIGIT)=>{let n="";const{length:o}=e;while(t--){n+=e[Math.random()*o|0]}return n};function nt(t){return!!(t&&d(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ot=t=>{const e=new Array(10);const n=(t,o)=>{if(p(t)){if(e.indexOf(t)>=0){return}if(!("toJSON"in t)){e[o]=t;const r=i(t)?[]:{};v(t,((t,e)=>{const s=n(t,o+1);!c(s)&&(r[e]=s)}));e[o]=undefined;return r}}return t};return n(t,0)};const rt=r("AsyncFunction");const st=t=>t&&(p(t)||d(t))&&d(t.then)&&d(t.catch);const it=((t,e)=>{if(t){return setImmediate}return e?((t,e)=>{P.addEventListener("message",(({source:n,data:o})=>{if(n===P&&o===t){e.length&&e.shift()()}}),false);return n=>{e.push(n);P.postMessage(t,"*")}})(`axios@${Math.random()}`,[]):t=>setTimeout(t)})(typeof setImmediate==="function",d(P.postMessage));const ct=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(P):typeof process!=="undefined"&&process.nextTick||it;const ut={isArray:i,isArrayBuffer:a,isBuffer:u,isFormData:E,isArrayBufferView:l,isString:f,isNumber:h,isBoolean:m,isObject:p,isPlainObject:w,isReadableStream:T,isRequest:A,isResponse:j,isHeaders:x,isUndefined:c,isDate:y,isFile:b,isBlob:g,isRegExp:K,isFunction:d,isStream:O,isURLSearchParams:S,isTypedArray:I,isFileList:R,forEach:v,merge:D,extend:F,trim:N,stripBOM:U,inherits:_,toFlatObject:k,kindOf:o,kindOfTest:r,endsWith:q,toArray:L,forEachEntry:z,matchAll:M,isHTMLForm:$,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:V,freezeMethods:W,toObjectSet:G,toCamelCase:H,noop:X,toFiniteNumber:Y,findKey:C,global:P,isContextDefined:B,ALPHABET:tt,generateString:et,isSpecCompliantForm:nt,toJSONObject:ot,isAsyncFn:rt,isThenable:st,setImmediate:it,asap:ct};function at(t,e,n,o,r){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=t;this.name="AxiosError";e&&(this.code=e);n&&(this.config=n);o&&(this.request=o);if(r){this.response=r;this.status=r.status?r.status:null}}ut.inherits(at,Error,{toJSON:function t(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ut.toJSONObject(this.config),code:this.code,status:this.status}}});const lt=at.prototype;const ft={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{ft[t]={value:t}}));Object.defineProperties(at,ft);Object.defineProperty(lt,"isAxiosError",{value:true});at.from=(t,e,n,o,r,s)=>{const i=Object.create(lt);ut.toFlatObject(t,i,(function t(e){return e!==Error.prototype}),(t=>t!=="isAxiosError"));at.call(i,t.message,e,n,o,r);i.cause=t;i.name=t.name;s&&Object.assign(i,s);return i};const dt=null;function ht(t){return ut.isPlainObject(t)||ut.isArray(t)}function pt(t){return ut.endsWith(t,"[]")?t.slice(0,-2):t}function mt(t,e,n){if(!t)return e;return t.concat(e).map((function t(e,o){e=pt(e);return!n&&o?"["+e+"]":e})).join(n?".":"")}function wt(t){return ut.isArray(t)&&!t.some(ht)}const yt=ut.toFlatObject(ut,{},null,(function t(e){return/^is[A-Z]/.test(e)}));function bt(t,e,n){if(!ut.isObject(t)){throw new TypeError("target must be an object")}e=e||new FormData;n=ut.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function t(e,n){return!ut.isUndefined(n[e])}));const o=n.metaTokens;const r=n.visitor||l;const s=n.dots;const i=n.indexes;const c=n.Blob||typeof Blob!=="undefined"&&Blob;const u=c&&ut.isSpecCompliantForm(e);if(!ut.isFunction(r)){throw new TypeError("visitor must be a function")}function a(t){if(t===null)return"";if(ut.isDate(t)){return t.toISOString()}if(!u&&ut.isBlob(t)){throw new at("Blob is not supported. Use a Buffer instead.")}if(ut.isArrayBuffer(t)||ut.isTypedArray(t)){return u&&typeof Blob==="function"?new Blob([t]):Buffer.from(t)}return t}function l(t,n,r){let c=t;if(t&&!r&&typeof t==="object"){if(ut.endsWith(n,"{}")){n=o?n:n.slice(0,-2);t=JSON.stringify(t)}else if(ut.isArray(t)&&wt(t)||(ut.isFileList(t)||ut.endsWith(n,"[]"))&&(c=ut.toArray(t))){n=pt(n);c.forEach((function t(o,r){!(ut.isUndefined(o)||o===null)&&e.append(i===true?mt([n],r,s):i===null?n:n+"[]",a(o))}));return false}}if(ht(t)){return true}e.append(mt(r,n,s),a(t));return false}const f=[];const d=Object.assign(yt,{defaultVisitor:l,convertValue:a,isVisitable:ht});function h(t,n){if(ut.isUndefined(t))return;if(f.indexOf(t)!==-1){throw Error("Circular reference detected in "+n.join("."))}f.push(t);ut.forEach(t,(function t(o,s){const i=!(ut.isUndefined(o)||o===null)&&r.call(e,o,ut.isString(s)?s.trim():s,n,d);if(i===true){h(o,n?n.concat(s):[s])}}));f.pop()}if(!ut.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}function gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function t(n){return e[n]}))}function Rt(t,e){this._pairs=[];t&&bt(t,this,e)}const Ot=Rt.prototype;Ot.append=function t(e,n){this._pairs.push([e,n])};Ot.toString=function t(e){const n=e?function(t){return e.call(this,t,gt)}:gt;return this._pairs.map((function t(e){return n(e[0])+"="+n(e[1])}),"").join("&")};function Et(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function St(t,e,n){if(!e){return t}const o=n&&n.encode||Et;const r=n&&n.serialize;let s;if(r){s=r(e,n)}else{s=ut.isURLSearchParams(e)?e.toString():new Rt(e,n).toString(o)}if(s){const e=t.indexOf("#");if(e!==-1){t=t.slice(0,e)}t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Tt{constructor(){this.handlers=[]}use(t,e,n){this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){ut.forEach(this.handlers,(function e(n){if(n!==null){t(n)}}))}}const At=Tt;const jt={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const xt=typeof URLSearchParams!=="undefined"?URLSearchParams:Rt;const Nt=typeof FormData!=="undefined"?FormData:null;const vt=typeof Blob!=="undefined"?Blob:null;const Ct={isBrowser:true,classes:{URLSearchParams:xt,FormData:Nt,Blob:vt},protocols:["http","https","file","blob","url","data"]};const Pt=typeof window!=="undefined"&&typeof document!=="undefined";const Bt=typeof navigator==="object"&&navigator||undefined;const Dt=Pt&&(!Bt||["ReactNative","NativeScript","NS"].indexOf(Bt.product)<0);const Ft=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const Ut=Pt&&window.location.href||"http://localhost";const _t=Object.freeze({__proto__:null,hasBrowserEnv:Pt,hasStandardBrowserWebWorkerEnv:Ft,hasStandardBrowserEnv:Dt,navigator:Bt,origin:Ut});const kt={..._t,...Ct};function qt(t,e){return bt(t,new kt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,o){if(kt.isNode&&ut.isBuffer(t)){this.append(e,t.toString("base64"));return false}return o.defaultVisitor.apply(this,arguments)}},e))}function Lt(t){return ut.matchAll(/\w+|\[(\w*)]/g,t).map((t=>t[0]==="[]"?"":t[1]||t[0]))}function It(t){const e={};const n=Object.keys(t);let o;const r=n.length;let s;for(o=0;o<r;o++){s=n[o];e[s]=t[s]}return e}function zt(t){function e(t,n,o,r){let s=t[r++];if(s==="__proto__")return true;const i=Number.isFinite(+s);const c=r>=t.length;s=!s&&ut.isArray(o)?o.length:s;if(c){if(ut.hasOwnProp(o,s)){o[s]=[o[s],n]}else{o[s]=n}return!i}if(!o[s]||!ut.isObject(o[s])){o[s]=[]}const u=e(t,n,o[s],r);if(u&&ut.isArray(o[s])){o[s]=It(o[s])}return!i}if(ut.isFormData(t)&&ut.isFunction(t.entries)){const n={};ut.forEachEntry(t,((t,o)=>{e(Lt(t),o,n,0)}));return n}return null}function Mt(t,e,n){if(ut.isString(t)){try{(e||JSON.parse)(t);return ut.trim(t)}catch(t){if(t.name!=="SyntaxError"){throw t}}}return(n||JSON.stringify)(t)}const $t={transitional:jt,adapter:["xhr","http","fetch"],transformRequest:[function t(e,n){const o=n.getContentType()||"";const r=o.indexOf("application/json")>-1;const s=ut.isObject(e);if(s&&ut.isHTMLForm(e)){e=new FormData(e)}const i=ut.isFormData(e);if(i){return r?JSON.stringify(zt(e)):e}if(ut.isArrayBuffer(e)||ut.isBuffer(e)||ut.isStream(e)||ut.isFile(e)||ut.isBlob(e)||ut.isReadableStream(e)){return e}if(ut.isArrayBufferView(e)){return e.buffer}if(ut.isURLSearchParams(e)){n.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let c;if(s){if(o.indexOf("application/x-www-form-urlencoded")>-1){return qt(e,this.formSerializer).toString()}if((c=ut.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return bt(c?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(s||r){n.setContentType("application/json",false);return Mt(e)}return e}],transformResponse:[function t(e){const n=this.transitional||$t.transitional;const o=n&&n.forcedJSONParsing;const r=this.responseType==="json";if(ut.isResponse(e)||ut.isReadableStream(e)){return e}if(e&&ut.isString(e)&&(o&&!this.responseType||r)){const t=n&&n.silentJSONParsing;const o=!t&&r;try{return JSON.parse(e)}catch(t){if(o){if(t.name==="SyntaxError"){throw at.from(t,at.ERR_BAD_RESPONSE,this,null,this.response)}throw t}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};ut.forEach(["delete","get","head","post","put","patch"],(t=>{$t.headers[t]={}}));const Ht=$t;const Jt=ut.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Kt=t=>{const e={};let n;let o;let r;t&&t.split("\n").forEach((function t(s){r=s.indexOf(":");n=s.substring(0,r).trim().toLowerCase();o=s.substring(r+1).trim();if(!n||e[n]&&Jt[n]){return}if(n==="set-cookie"){if(e[n]){e[n].push(o)}else{e[n]=[o]}}else{e[n]=e[n]?e[n]+", "+o:o}}));return e};const Vt=Symbol("internals");function Wt(t){return t&&String(t).trim().toLowerCase()}function Gt(t){if(t===false||t==null){return t}return ut.isArray(t)?t.map(Gt):String(t)}function Xt(t){const e=Object.create(null);const n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;while(o=n.exec(t)){e[o[1]]=o[2]}return e}const Yt=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Zt(t,e,n,o,r){if(ut.isFunction(o)){return o.call(this,e,n)}if(r){e=n}if(!ut.isString(e))return;if(ut.isString(o)){return e.indexOf(o)!==-1}if(ut.isRegExp(o)){return o.test(e)}}function Qt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}function te(t,e){const n=ut.toCamelCase(" "+e);["get","set","has"].forEach((o=>{Object.defineProperty(t,o+n,{value:function(t,n,r){return this[o].call(this,e,t,n,r)},configurable:true})}))}class ee{constructor(t){t&&this.set(t)}set(t,e,n){const o=this;function r(t,e,n){const r=Wt(e);if(!r){throw new Error("header name must be a non-empty string")}const s=ut.findKey(o,r);if(!s||o[s]===undefined||n===true||n===undefined&&o[s]!==false){o[s||e]=Gt(t)}}const s=(t,e)=>ut.forEach(t,((t,n)=>r(t,n,e)));if(ut.isPlainObject(t)||t instanceof this.constructor){s(t,e)}else if(ut.isString(t)&&(t=t.trim())&&!Yt(t)){s(Kt(t),e)}else if(ut.isHeaders(t)){for(const[e,o]of t.entries()){r(o,e,n)}}else{t!=null&&r(e,t,n)}return this}get(t,e){t=Wt(t);if(t){const n=ut.findKey(this,t);if(n){const t=this[n];if(!e){return t}if(e===true){return Xt(t)}if(ut.isFunction(e)){return e.call(this,t,n)}if(ut.isRegExp(e)){return e.exec(t)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){t=Wt(t);if(t){const n=ut.findKey(this,t);return!!(n&&this[n]!==undefined&&(!e||Zt(this,this[n],n,e)))}return false}delete(t,e){const n=this;let o=false;function r(t){t=Wt(t);if(t){const r=ut.findKey(n,t);if(r&&(!e||Zt(n,n[r],r,e))){delete n[r];o=true}}}if(ut.isArray(t)){t.forEach(r)}else{r(t)}return o}clear(t){const e=Object.keys(this);let n=e.length;let o=false;while(n--){const r=e[n];if(!t||Zt(this,this[r],r,t,true)){delete this[r];o=true}}return o}normalize(t){const e=this;const n={};ut.forEach(this,((o,r)=>{const s=ut.findKey(n,r);if(s){e[s]=Gt(o);delete e[r];return}const i=t?Qt(r):String(r).trim();if(i!==r){delete e[r]}e[i]=Gt(o);n[i]=true}));return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);ut.forEach(this,((n,o)=>{n!=null&&n!==false&&(e[o]=t&&ut.isArray(n)?n.join(", "):n)}));return e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);e.forEach((t=>n.set(t)));return n}static accessor(t){const e=this[Vt]=this[Vt]={accessors:{}};const n=e.accessors;const o=this.prototype;function r(t){const e=Wt(t);if(!n[e]){te(o,t);n[e]=true}}ut.isArray(t)?t.forEach(r):r(t);return this}}ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ut.reduceDescriptors(ee.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}));ut.freezeMethods(ee);const ne=ee;function oe(t,e){const n=this||Ht;const o=e||n;const r=ne.from(o.headers);let s=o.data;ut.forEach(t,(function t(o){s=o.call(n,s,r.normalize(),e?e.status:undefined)}));r.normalize();return s}function re(t){return!!(t&&t.__CANCEL__)}function se(t,e,n){at.call(this,t==null?"canceled":t,at.ERR_CANCELED,e,n);this.name="CanceledError"}ut.inherits(se,at,{__CANCEL__:true});function ie(t,e,n){const o=n.config.validateStatus;if(!n.status||!o||o(n.status)){t(n)}else{e(new at("Request failed with status code "+n.status,[at.ERR_BAD_REQUEST,at.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function ce(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ue(t,e){t=t||10;const n=new Array(t);const o=new Array(t);let r=0;let s=0;let i;e=e!==undefined?e:1e3;return function c(u){const a=Date.now();const l=o[s];if(!i){i=a}n[r]=u;o[r]=a;let f=s;let d=0;while(f!==r){d+=n[f++];f=f%t}r=(r+1)%t;if(r===s){s=(s+1)%t}if(a-i<e){return}const h=l&&a-l;return h?Math.round(d*1e3/h):undefined}}function ae(t,e){let n=0;let o=1e3/e;let r;let s;const i=(e,o=Date.now())=>{n=o;r=null;if(s){clearTimeout(s);s=null}t.apply(null,e)};const c=(...t)=>{const e=Date.now();const c=e-n;if(c>=o){i(t,e)}else{r=t;if(!s){s=setTimeout((()=>{s=null;i(r)}),o-c)}}};const u=()=>r&&i(r);return[c,u]}const le=(t,e,n=3)=>{let o=0;const r=ue(50,250);return ae((n=>{const s=n.loaded;const i=n.lengthComputable?n.total:undefined;const c=s-o;const u=r(c);const a=s<=i;o=s;const l={loaded:s,total:i,progress:i?s/i:undefined,bytes:c,rate:u?u:undefined,estimated:u&&i&&a?(i-s)/u:undefined,event:n,lengthComputable:i!=null,[e?"download":"upload"]:true};t(l)}),n)};const fe=(t,e)=>{const n=t!=null;return[o=>e[0]({lengthComputable:n,total:t,loaded:o}),e[1]]};const de=t=>(...e)=>ut.asap((()=>t(...e)));const he=kt.hasStandardBrowserEnv?function t(){const e=kt.navigator&&/(msie|trident)/i.test(kt.navigator.userAgent);const n=document.createElement("a");let o;function r(t){let o=t;if(e){n.setAttribute("href",o);o=n.href}n.setAttribute("href",o);return{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}o=r(window.location.href);return function t(e){const n=ut.isString(e)?r(e):e;return n.protocol===o.protocol&&n.host===o.host}}():function t(){return function t(){return true}}();const pe=kt.hasStandardBrowserEnv?{write(t,e,n,o,r,s){const i=[t+"="+encodeURIComponent(e)];ut.isNumber(n)&&i.push("expires="+new Date(n).toGMTString());ut.isString(o)&&i.push("path="+o);ut.isString(r)&&i.push("domain="+r);s===true&&i.push("secure");document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function me(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function we(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ye(t,e){if(t&&!me(e)){return we(t,e)}return e}const be=t=>t instanceof ne?{...t}:t;function ge(t,e){e=e||{};const n={};function o(t,e,n){if(ut.isPlainObject(t)&&ut.isPlainObject(e)){return ut.merge.call({caseless:n},t,e)}else if(ut.isPlainObject(e)){return ut.merge({},e)}else if(ut.isArray(e)){return e.slice()}return e}function r(t,e,n){if(!ut.isUndefined(e)){return o(t,e,n)}else if(!ut.isUndefined(t)){return o(undefined,t,n)}}function s(t,e){if(!ut.isUndefined(e)){return o(undefined,e)}}function i(t,e){if(!ut.isUndefined(e)){return o(undefined,e)}else if(!ut.isUndefined(t)){return o(undefined,t)}}function c(n,r,s){if(s in e){return o(n,r)}else if(s in t){return o(undefined,n)}}const u={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(t,e)=>r(be(t),be(e),true)};ut.forEach(Object.keys(Object.assign({},t,e)),(function o(s){const i=u[s]||r;const a=i(t[s],e[s],s);ut.isUndefined(a)&&i!==c||(n[s]=a)}));return n}const Re=t=>{const e=ge({},t);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:s,headers:i,auth:c}=e;e.headers=i=ne.from(i);e.url=St(ye(e.baseURL,e.url),t.params,t.paramsSerializer);if(c){i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")))}let u;if(ut.isFormData(n)){if(kt.hasStandardBrowserEnv||kt.hasStandardBrowserWebWorkerEnv){i.setContentType(undefined)}else if((u=i.getContentType())!==false){const[t,...e]=u?u.split(";").map((t=>t.trim())).filter(Boolean):[];i.setContentType([t||"multipart/form-data",...e].join("; "))}}if(kt.hasStandardBrowserEnv){o&&ut.isFunction(o)&&(o=o(e));if(o||o!==false&&he(e.url)){const t=r&&s&&pe.read(s);if(t){i.set(r,t)}}}return e};const Oe=typeof XMLHttpRequest!=="undefined";const Ee=Oe&&function(t){return new Promise((function e(n,o){const r=Re(t);let s=r.data;const i=ne.from(r.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:a}=r;let l;let f,d;let h,p;function m(){h&&h();p&&p();r.cancelToken&&r.cancelToken.unsubscribe(l);r.signal&&r.signal.removeEventListener("abort",l)}let w=new XMLHttpRequest;w.open(r.method.toUpperCase(),r.url,true);w.timeout=r.timeout;function y(){if(!w){return}const e=ne.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders());const r=!c||c==="text"||c==="json"?w.responseText:w.response;const s={data:r,status:w.status,statusText:w.statusText,headers:e,config:t,request:w};ie((function t(e){n(e);m()}),(function t(e){o(e);m()}),s);w=null}if("onloadend"in w){w.onloadend=y}else{w.onreadystatechange=function t(){if(!w||w.readyState!==4){return}if(w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)){return}setTimeout(y)}}w.onabort=function e(){if(!w){return}o(new at("Request aborted",at.ECONNABORTED,t,w));w=null};w.onerror=function e(){o(new at("Network Error",at.ERR_NETWORK,t,w));w=null};w.ontimeout=function e(){let n=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||jt;if(r.timeoutErrorMessage){n=r.timeoutErrorMessage}o(new at(n,s.clarifyTimeoutError?at.ETIMEDOUT:at.ECONNABORTED,t,w));w=null};s===undefined&&i.setContentType(null);if("setRequestHeader"in w){ut.forEach(i.toJSON(),(function t(e,n){w.setRequestHeader(n,e)}))}if(!ut.isUndefined(r.withCredentials)){w.withCredentials=!!r.withCredentials}if(c&&c!=="json"){w.responseType=r.responseType}if(a){[d,p]=le(a,true);w.addEventListener("progress",d)}if(u&&w.upload){[f,h]=le(u);w.upload.addEventListener("progress",f);w.upload.addEventListener("loadend",h)}if(r.cancelToken||r.signal){l=e=>{if(!w){return}o(!e||e.type?new se(null,t,w):e);w.abort();w=null};r.cancelToken&&r.cancelToken.subscribe(l);if(r.signal){r.signal.aborted?l():r.signal.addEventListener("abort",l)}}const b=ce(r.url);if(b&&kt.protocols.indexOf(b)===-1){o(new at("Unsupported protocol "+b+":",at.ERR_BAD_REQUEST,t));return}w.send(s||null)}))};const Se=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n=new AbortController;let o;const r=function(t){if(!o){o=true;i();const e=t instanceof Error?t:this.reason;n.abort(e instanceof at?e:new se(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null;r(new at(`timeout ${e} of ms exceeded`,at.ETIMEDOUT))}),e);const i=()=>{if(t){s&&clearTimeout(s);s=null;t.forEach((t=>{t.unsubscribe?t.unsubscribe(r):t.removeEventListener("abort",r)}));t=null}};t.forEach((t=>t.addEventListener("abort",r)));const{signal:c}=n;c.unsubscribe=()=>ut.asap(i);return c}};const Te=Se;const Ae=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let o=0;let r;while(o<n){r=o+e;yield t.slice(o,r);o=r}};const je=async function*(t,e){for await(const n of xe(t)){yield*Ae(n,e)}};const xe=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t){break}yield n}}finally{await e.cancel()}};const Ne=(t,e,n,o)=>{const r=je(t,e);let s=0;let i;let c=t=>{if(!i){i=true;o&&o(t)}};return new ReadableStream({async pull(t){try{const{done:e,value:o}=await r.next();if(e){c();t.close();return}let i=o.byteLength;if(n){let t=s+=i;n(t)}t.enqueue(new Uint8Array(o))}catch(t){c(t);throw t}},cancel(t){c(t);return r.return()}},{highWaterMark:2})};const ve=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const Ce=ve&&typeof ReadableStream==="function";const Pe=ve&&(typeof TextEncoder==="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer()));const Be=(t,...e)=>{try{return!!t(...e)}catch(t){return false}};const De=Ce&&Be((()=>{let t=false;const e=new Request(kt.origin,{body:new ReadableStream,method:"POST",get duplex(){t=true;return"half"}}).headers.has("Content-Type");return t&&!e}));const Fe=64*1024;const Ue=Ce&&Be((()=>ut.isReadableStream(new Response("").body)));const _e={stream:Ue&&(t=>t.body)};ve&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!_e[e]&&(_e[e]=ut.isFunction(t[e])?t=>t[e]():(t,n)=>{throw new at(`Response type '${e}' is not supported`,at.ERR_NOT_SUPPORT,n)})}))})(new Response);const ke=async t=>{if(t==null){return 0}if(ut.isBlob(t)){return t.size}if(ut.isSpecCompliantForm(t)){const e=new Request(kt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}if(ut.isArrayBufferView(t)||ut.isArrayBuffer(t)){return t.byteLength}if(ut.isURLSearchParams(t)){t=t+""}if(ut.isString(t)){return(await Pe(t)).byteLength}};const qe=async(t,e)=>{const n=ut.toFiniteNumber(t.getContentLength());return n==null?ke(e):n};const Le=ve&&(async t=>{let{url:e,method:n,data:o,signal:r,cancelToken:s,timeout:i,onDownloadProgress:c,onUploadProgress:u,responseType:a,headers:l,withCredentials:f="same-origin",fetchOptions:d}=Re(t);a=a?(a+"").toLowerCase():"text";let h=Te([r,s&&s.toAbortSignal()],i);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let w;try{if(u&&De&&n!=="get"&&n!=="head"&&(w=await qe(l,o))!==0){let t=new Request(e,{method:"POST",body:o,duplex:"half"});let n;if(ut.isFormData(o)&&(n=t.headers.get("content-type"))){l.setContentType(n)}if(t.body){const[e,n]=fe(w,le(de(u)));o=Ne(t.body,Fe,e,n)}}if(!ut.isString(f)){f=f?"include":"omit"}const r="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:o,duplex:"half",credentials:r?f:undefined});let s=await fetch(p);const i=Ue&&(a==="stream"||a==="response");if(Ue&&(c||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=s[e]}));const e=ut.toFiniteNumber(s.headers.get("content-length"));const[n,o]=c&&fe(e,le(de(c),true))||[];s=new Response(Ne(s.body,Fe,n,(()=>{o&&o();m&&m()})),t)}a=a||"text";let y=await _e[ut.findKey(_e,a)||"text"](s,t);!i&&m&&m();return await new Promise(((e,n)=>{ie(e,n,{data:y,headers:ne.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:p})}))}catch(e){m&&m();if(e&&e.name==="TypeError"&&/fetch/i.test(e.message)){throw Object.assign(new at("Network Error",at.ERR_NETWORK,t,p),{cause:e.cause||e})}throw at.from(e,e&&e.code,t,p)}});const Ie={http:dt,xhr:Ee,fetch:Le};ut.forEach(Ie,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ze=t=>`- ${t}`;const Me=t=>ut.isFunction(t)||t===null||t===false;const $e={getAdapter:t=>{t=ut.isArray(t)?t:[t];const{length:e}=t;let n;let o;const r={};for(let s=0;s<e;s++){n=t[s];let e;o=n;if(!Me(n)){o=Ie[(e=String(n)).toLowerCase()];if(o===undefined){throw new at(`Unknown adapter '${e}'`)}}if(o){break}r[e||"#"+s]=o}if(!o){const t=Object.entries(r).map((([t,e])=>`adapter ${t} `+(e===false?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map(ze).join("\n"):" "+ze(t[0]):"as no adapter specified";throw new at(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return o},adapters:Ie};function He(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new se(null,t)}}function Je(t){He(t);t.headers=ne.from(t.headers);t.data=oe.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=$e.getAdapter(t.adapter||Ht.adapter);return e(t).then((function e(n){He(t);n.data=oe.call(t,t.transformResponse,n);n.headers=ne.from(n.headers);return n}),(function e(n){if(!re(n)){He(t);if(n&&n.response){n.response.data=oe.call(t,t.transformResponse,n.response);n.response.headers=ne.from(n.response.headers)}}return Promise.reject(n)}))}const Ke="1.7.7";const Ve={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ve[t]=function n(o){return typeof o===t||"a"+(e<1?"n ":" ")+t}}));const We={};Ve.transitional=function t(e,n,o){function r(t,e){return"[Axios v"+Ke+"] Transitional option '"+t+"'"+e+(o?". "+o:"")}return(t,o,s)=>{if(e===false){throw new at(r(o," has been removed"+(n?" in "+n:"")),at.ERR_DEPRECATED)}if(n&&!We[o]){We[o]=true;console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))}return e?e(t,o,s):true}};function Ge(t,e,n){if(typeof t!=="object"){throw new at("options must be an object",at.ERR_BAD_OPTION_VALUE)}const o=Object.keys(t);let r=o.length;while(r-- >0){const s=o[r];const i=e[s];if(i){const e=t[s];const n=e===undefined||i(e,s,t);if(n!==true){throw new at("option "+s+" must be "+n,at.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new at("Unknown option "+s,at.ERR_BAD_OPTION)}}}const Xe={assertOptions:Ge,validators:Ve};const Ye=Xe.validators;class Ze{constructor(t){this.defaults=t;this.interceptors={request:new At,response:new At}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{if(!t.stack){t.stack=n}else if(n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))){t.stack+="\n"+n}}catch(t){}}throw t}}_request(t,e){if(typeof t==="string"){e=e||{};e.url=t}else{e=t||{}}e=ge(this.defaults,e);const{transitional:n,paramsSerializer:o,headers:r}=e;if(n!==undefined){Xe.assertOptions(n,{silentJSONParsing:Ye.transitional(Ye.boolean),forcedJSONParsing:Ye.transitional(Ye.boolean),clarifyTimeoutError:Ye.transitional(Ye.boolean)},false)}if(o!=null){if(ut.isFunction(o)){e.paramsSerializer={serialize:o}}else{Xe.assertOptions(o,{encode:Ye.function,serialize:Ye.function},true)}}e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=r&&ut.merge(r.common,r[e.method]);r&&ut.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete r[t]}));e.headers=ne.concat(s,r);const i=[];let c=true;this.interceptors.request.forEach((function t(n){if(typeof n.runWhen==="function"&&n.runWhen(e)===false){return}c=c&&n.synchronous;i.unshift(n.fulfilled,n.rejected)}));const u=[];this.interceptors.response.forEach((function t(e){u.push(e.fulfilled,e.rejected)}));let a;let l=0;let f;if(!c){const t=[Je.bind(this),undefined];t.unshift.apply(t,i);t.push.apply(t,u);f=t.length;a=Promise.resolve(e);while(l<f){a=a.then(t[l++],t[l++])}return a}f=i.length;let d=e;l=0;while(l<f){const t=i[l++];const e=i[l++];try{d=t(d)}catch(t){e.call(this,t);break}}try{a=Je.call(this,d)}catch(t){return Promise.reject(t)}l=0;f=u.length;while(l<f){a=a.then(u[l++],u[l++])}return a}getUri(t){t=ge(this.defaults,t);const e=ye(t.baseURL,t.url);return St(e,t.params,t.paramsSerializer)}}ut.forEach(["delete","get","head","options"],(function t(e){Ze.prototype[e]=function(t,n){return this.request(ge(n||{},{method:e,url:t,data:(n||{}).data}))}}));ut.forEach(["post","put","patch"],(function t(e){function n(t){return function n(o,r,s){return this.request(ge(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Ze.prototype[e]=n();Ze.prototype[e+"Form"]=n(true)}));const Qe=Ze;class tn{constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let e;this.promise=new Promise((function t(n){e=n}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;while(e-- >0){n._listeners[e](t)}n._listeners=null}));this.promise.then=t=>{let e;const o=new Promise((t=>{n.subscribe(t);e=t})).then(t);o.cancel=function t(){n.unsubscribe(e)};return o};t((function t(o,r,s){if(n.reason){return}n.reason=new se(o,r,s);e(n.reason)}))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const e=this._listeners.indexOf(t);if(e!==-1){this._listeners.splice(e,1)}}toAbortSignal(){const t=new AbortController;const e=e=>{t.abort(e)};this.subscribe(e);t.signal.unsubscribe=()=>this.unsubscribe(e);return t.signal}static source(){let t;const e=new tn((function e(n){t=n}));return{token:e,cancel:t}}}const en=tn;function nn(t){return function e(n){return t.apply(null,n)}}function on(t){return ut.isObject(t)&&t.isAxiosError===true}const rn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rn).forEach((([t,e])=>{rn[e]=t}));const sn=rn;function cn(e){const n=new Qe(e);const o=t(Qe.prototype.request,n);ut.extend(o,Qe.prototype,n,{allOwnKeys:true});ut.extend(o,n,null,{allOwnKeys:true});o.create=function t(n){return cn(ge(e,n))};return o}const un=cn(Ht);un.Axios=Qe;un.CanceledError=se;un.CancelToken=en;un.isCancel=re;un.VERSION=Ke;un.toFormData=bt;un.AxiosError=at;un.Cancel=un.CanceledError;un.all=function t(e){return Promise.all(e)};un.spread=nn;un.isAxiosError=on;un.mergeConfig=ge;un.AxiosHeaders=ne;un.formToJSON=t=>zt(ut.isHTMLForm(t)?new FormData(t):t);un.getAdapter=$e.getAdapter;un.HttpStatusCode=sn;un.default=un;const an=un;const ln="https://wake-middleware.crmbonus.com/api";class fn{constructor(){this.axiosInstance=an.create({baseURL:ln,headers:{"Content-Type":"application/json",accept:"application/json"}})}static getInstance(){if(this._instance){return this._instance}this._instance=new fn;return this._instance}async getCustomer(t,e){var n,o;const r={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const s=await this.axiosInstance.get(`/store/${e}/customer/${t}`,{headers:r});this.token=(n=s===null||s===void 0?void 0:s.data)===null||n===void 0?void 0:n.token;return(o=s===null||s===void 0?void 0:s.data)===null||o===void 0?void 0:o.customer}async updateOrder(t){const e=localStorage.getItem("@BYCODERS_KEY");const n={"Content-Type":"application/json",Authorization:`Bearer ${e}`};await this.axiosInstance.patch(`/checkouts/${t.cartId}/updateOrder`,{orderId:t.orderId,externalId:t.cartIdCrm},{headers:n});localStorage.removeItem("@BYCODERS_KEY")}async sendPin(t,e,n){const o={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const r=await this.axiosInstance.post("/crmbonus/send-pin",{cellphone:t,name:e,storeName:n},{headers:o});return{storeId:r.data.storeId,userId:r.data.userId}}async validatePinBonus(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/process-pin-bonus",t,{headers:e});return n.data}async reserve(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/redeem-bonus",t,{headers:e});return n.data}async cancel(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/cancel-apply-bonus",{ticket:t},{headers:e});return n.data}async getToken(t){var e,n;const o=await this.axiosInstance.post("/wake/requestToken",{storeName:t});this.token=(e=o===null||o===void 0?void 0:o.data)===null||e===void 0?void 0:e.token;localStorage.setItem("@BYCODERS_KEY",this.token);return(n=o===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.token}async getCustomization(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.get(`/stores/${t}/customizations`,{headers:e});localStorage.setItem(`bc:${t}`,JSON.stringify(n.data))}}fn._instance=null;export{fn as C};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
function t(t,e){return function n(){return t.apply(e,arguments)}}const{toString:e}=Object.prototype;const{getPrototypeOf:n}=Object;const o=(t=>n=>{const o=e.call(n);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null));const r=t=>{t=t.toLowerCase();return e=>o(e)===t};const s=t=>e=>typeof e===t;const{isArray:i}=Array;const c=s("undefined");function u(t){return t!==null&&!c(t)&&t.constructor!==null&&!c(t.constructor)&&d(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const a=r("ArrayBuffer");function l(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&a(t.buffer)}return e}const f=s("string");const d=s("function");const h=s("number");const p=t=>t!==null&&typeof t==="object";const m=t=>t===true||t===false;const w=t=>{if(o(t)!=="object"){return false}const e=n(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};const y=r("Date");const b=r("File");const g=r("Blob");const R=r("FileList");const O=t=>p(t)&&d(t.pipe);const E=t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||d(t.append)&&((e=o(t))==="formdata"||e==="object"&&d(t.toString)&&t.toString()==="[object FormData]"))};const S=r("URLSearchParams");const[T,A,j,N]=["ReadableStream","Request","Response","Headers"].map(r);const v=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function x(t,e,{allOwnKeys:n=false}={}){if(t===null||typeof t==="undefined"){return}let o;let r;if(typeof t!=="object"){t=[t]}if(i(t)){for(o=0,r=t.length;o<r;o++){e.call(null,t[o],o,t)}}else{const r=n?Object.getOwnPropertyNames(t):Object.keys(t);const s=r.length;let i;for(o=0;o<s;o++){i=r[o];e.call(null,t[i],i,t)}}}function C(t,e){e=e.toLowerCase();const n=Object.keys(t);let o=n.length;let r;while(o-- >0){r=n[o];if(e===r.toLowerCase()){return r}}return null}const P=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const B=t=>!c(t)&&t!==P;function D(){const{caseless:t}=B(this)&&this||{};const e={};const n=(n,o)=>{const r=t&&C(e,o)||o;if(w(e[r])&&w(n)){e[r]=D(e[r],n)}else if(w(n)){e[r]=D({},n)}else if(i(n)){e[r]=n.slice()}else{e[r]=n}};for(let t=0,e=arguments.length;t<e;t++){arguments[t]&&x(arguments[t],n)}return e}const F=(e,n,o,{allOwnKeys:r}={})=>{x(n,((n,r)=>{if(o&&d(n)){e[r]=t(n,o)}else{e[r]=n}}),{allOwnKeys:r});return e};const U=t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t};const _=(t,e,n,o)=>{t.prototype=Object.create(e.prototype,o);t.prototype.constructor=t;Object.defineProperty(t,"super",{value:e.prototype});n&&Object.assign(t.prototype,n)};const k=(t,e,o,r)=>{let s;let i;let c;const u={};e=e||{};if(t==null)return e;do{s=Object.getOwnPropertyNames(t);i=s.length;while(i-- >0){c=s[i];if((!r||r(c,t,e))&&!u[c]){e[c]=t[c];u[c]=true}}t=o!==false&&n(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e};const q=(t,e,n)=>{t=String(t);if(n===undefined||n>t.length){n=t.length}n-=e.length;const o=t.indexOf(e,n);return o!==-1&&o===n};const L=t=>{if(!t)return null;if(i(t))return t;let e=t.length;if(!h(e))return null;const n=new Array(e);while(e-- >0){n[e]=t[e]}return n};const I=(t=>e=>t&&e instanceof t)(typeof Uint8Array!=="undefined"&&n(Uint8Array));const z=(t,e)=>{const n=t&&t[Symbol.iterator];const o=n.call(t);let r;while((r=o.next())&&!r.done){const n=r.value;e.call(t,n[0],n[1])}};const $=(t,e)=>{let n;const o=[];while((n=t.exec(e))!==null){o.push(n)}return o};const M=r("HTMLFormElement");const H=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function t(e,n,o){return n.toUpperCase()+o}));const J=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype);const K=r("RegExp");const V=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t);const o={};x(n,((n,r)=>{let s;if((s=e(n,r,t))!==false){o[r]=s||n}}));Object.defineProperties(t,o)};const W=t=>{V(t,((e,n)=>{if(d(t)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const o=t[n];if(!d(o))return;e.enumerable=false;if("writable"in e){e.writable=false;return}if(!e.set){e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}}}))};const G=(t,e)=>{const n={};const o=t=>{t.forEach((t=>{n[t]=true}))};i(t)?o(t):o(String(t).split(e));return n};const X=()=>{};const Y=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;const Z="abcdefghijklmnopqrstuvwxyz";const Q="0123456789";const tt={DIGIT:Q,ALPHA:Z,ALPHA_DIGIT:Z+Z.toUpperCase()+Q};const et=(t=16,e=tt.ALPHA_DIGIT)=>{let n="";const{length:o}=e;while(t--){n+=e[Math.random()*o|0]}return n};function nt(t){return!!(t&&d(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ot=t=>{const e=new Array(10);const n=(t,o)=>{if(p(t)){if(e.indexOf(t)>=0){return}if(!("toJSON"in t)){e[o]=t;const r=i(t)?[]:{};x(t,((t,e)=>{const s=n(t,o+1);!c(s)&&(r[e]=s)}));e[o]=undefined;return r}}return t};return n(t,0)};const rt=r("AsyncFunction");const st=t=>t&&(p(t)||d(t))&&d(t.then)&&d(t.catch);const it=((t,e)=>{if(t){return setImmediate}return e?((t,e)=>{P.addEventListener("message",(({source:n,data:o})=>{if(n===P&&o===t){e.length&&e.shift()()}}),false);return n=>{e.push(n);P.postMessage(t,"*")}})(`axios@${Math.random()}`,[]):t=>setTimeout(t)})(typeof setImmediate==="function",d(P.postMessage));const ct=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(P):typeof process!=="undefined"&&process.nextTick||it;const ut={isArray:i,isArrayBuffer:a,isBuffer:u,isFormData:E,isArrayBufferView:l,isString:f,isNumber:h,isBoolean:m,isObject:p,isPlainObject:w,isReadableStream:T,isRequest:A,isResponse:j,isHeaders:N,isUndefined:c,isDate:y,isFile:b,isBlob:g,isRegExp:K,isFunction:d,isStream:O,isURLSearchParams:S,isTypedArray:I,isFileList:R,forEach:x,merge:D,extend:F,trim:v,stripBOM:U,inherits:_,toFlatObject:k,kindOf:o,kindOfTest:r,endsWith:q,toArray:L,forEachEntry:z,matchAll:$,isHTMLForm:M,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:V,freezeMethods:W,toObjectSet:G,toCamelCase:H,noop:X,toFiniteNumber:Y,findKey:C,global:P,isContextDefined:B,ALPHABET:tt,generateString:et,isSpecCompliantForm:nt,toJSONObject:ot,isAsyncFn:rt,isThenable:st,setImmediate:it,asap:ct};function at(t,e,n,o,r){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=t;this.name="AxiosError";e&&(this.code=e);n&&(this.config=n);o&&(this.request=o);if(r){this.response=r;this.status=r.status?r.status:null}}ut.inherits(at,Error,{toJSON:function t(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ut.toJSONObject(this.config),code:this.code,status:this.status}}});const lt=at.prototype;const ft={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{ft[t]={value:t}}));Object.defineProperties(at,ft);Object.defineProperty(lt,"isAxiosError",{value:true});at.from=(t,e,n,o,r,s)=>{const i=Object.create(lt);ut.toFlatObject(t,i,(function t(e){return e!==Error.prototype}),(t=>t!=="isAxiosError"));at.call(i,t.message,e,n,o,r);i.cause=t;i.name=t.name;s&&Object.assign(i,s);return i};const dt=null;function ht(t){return ut.isPlainObject(t)||ut.isArray(t)}function pt(t){return ut.endsWith(t,"[]")?t.slice(0,-2):t}function mt(t,e,n){if(!t)return e;return t.concat(e).map((function t(e,o){e=pt(e);return!n&&o?"["+e+"]":e})).join(n?".":"")}function wt(t){return ut.isArray(t)&&!t.some(ht)}const yt=ut.toFlatObject(ut,{},null,(function t(e){return/^is[A-Z]/.test(e)}));function bt(t,e,n){if(!ut.isObject(t)){throw new TypeError("target must be an object")}e=e||new FormData;n=ut.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function t(e,n){return!ut.isUndefined(n[e])}));const o=n.metaTokens;const r=n.visitor||l;const s=n.dots;const i=n.indexes;const c=n.Blob||typeof Blob!=="undefined"&&Blob;const u=c&&ut.isSpecCompliantForm(e);if(!ut.isFunction(r)){throw new TypeError("visitor must be a function")}function a(t){if(t===null)return"";if(ut.isDate(t)){return t.toISOString()}if(!u&&ut.isBlob(t)){throw new at("Blob is not supported. Use a Buffer instead.")}if(ut.isArrayBuffer(t)||ut.isTypedArray(t)){return u&&typeof Blob==="function"?new Blob([t]):Buffer.from(t)}return t}function l(t,n,r){let c=t;if(t&&!r&&typeof t==="object"){if(ut.endsWith(n,"{}")){n=o?n:n.slice(0,-2);t=JSON.stringify(t)}else if(ut.isArray(t)&&wt(t)||(ut.isFileList(t)||ut.endsWith(n,"[]"))&&(c=ut.toArray(t))){n=pt(n);c.forEach((function t(o,r){!(ut.isUndefined(o)||o===null)&&e.append(i===true?mt([n],r,s):i===null?n:n+"[]",a(o))}));return false}}if(ht(t)){return true}e.append(mt(r,n,s),a(t));return false}const f=[];const d=Object.assign(yt,{defaultVisitor:l,convertValue:a,isVisitable:ht});function h(t,n){if(ut.isUndefined(t))return;if(f.indexOf(t)!==-1){throw Error("Circular reference detected in "+n.join("."))}f.push(t);ut.forEach(t,(function t(o,s){const i=!(ut.isUndefined(o)||o===null)&&r.call(e,o,ut.isString(s)?s.trim():s,n,d);if(i===true){h(o,n?n.concat(s):[s])}}));f.pop()}if(!ut.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}function gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function t(n){return e[n]}))}function Rt(t,e){this._pairs=[];t&&bt(t,this,e)}const Ot=Rt.prototype;Ot.append=function t(e,n){this._pairs.push([e,n])};Ot.toString=function t(e){const n=e?function(t){return e.call(this,t,gt)}:gt;return this._pairs.map((function t(e){return n(e[0])+"="+n(e[1])}),"").join("&")};function Et(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function St(t,e,n){if(!e){return t}const o=n&&n.encode||Et;const r=n&&n.serialize;let s;if(r){s=r(e,n)}else{s=ut.isURLSearchParams(e)?e.toString():new Rt(e,n).toString(o)}if(s){const e=t.indexOf("#");if(e!==-1){t=t.slice(0,e)}t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Tt{constructor(){this.handlers=[]}use(t,e,n){this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){ut.forEach(this.handlers,(function e(n){if(n!==null){t(n)}}))}}const At=Tt;const jt={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const Nt=typeof URLSearchParams!=="undefined"?URLSearchParams:Rt;const vt=typeof FormData!=="undefined"?FormData:null;const xt=typeof Blob!=="undefined"?Blob:null;const Ct={isBrowser:true,classes:{URLSearchParams:Nt,FormData:vt,Blob:xt},protocols:["http","https","file","blob","url","data"]};const Pt=typeof window!=="undefined"&&typeof document!=="undefined";const Bt=typeof navigator==="object"&&navigator||undefined;const Dt=Pt&&(!Bt||["ReactNative","NativeScript","NS"].indexOf(Bt.product)<0);const Ft=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const Ut=Pt&&window.location.href||"http://localhost";const _t=Object.freeze({__proto__:null,hasBrowserEnv:Pt,hasStandardBrowserWebWorkerEnv:Ft,hasStandardBrowserEnv:Dt,navigator:Bt,origin:Ut});const kt={..._t,...Ct};function qt(t,e){return bt(t,new kt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,o){if(kt.isNode&&ut.isBuffer(t)){this.append(e,t.toString("base64"));return false}return o.defaultVisitor.apply(this,arguments)}},e))}function Lt(t){return ut.matchAll(/\w+|\[(\w*)]/g,t).map((t=>t[0]==="[]"?"":t[1]||t[0]))}function It(t){const e={};const n=Object.keys(t);let o;const r=n.length;let s;for(o=0;o<r;o++){s=n[o];e[s]=t[s]}return e}function zt(t){function e(t,n,o,r){let s=t[r++];if(s==="__proto__")return true;const i=Number.isFinite(+s);const c=r>=t.length;s=!s&&ut.isArray(o)?o.length:s;if(c){if(ut.hasOwnProp(o,s)){o[s]=[o[s],n]}else{o[s]=n}return!i}if(!o[s]||!ut.isObject(o[s])){o[s]=[]}const u=e(t,n,o[s],r);if(u&&ut.isArray(o[s])){o[s]=It(o[s])}return!i}if(ut.isFormData(t)&&ut.isFunction(t.entries)){const n={};ut.forEachEntry(t,((t,o)=>{e(Lt(t),o,n,0)}));return n}return null}function $t(t,e,n){if(ut.isString(t)){try{(e||JSON.parse)(t);return ut.trim(t)}catch(t){if(t.name!=="SyntaxError"){throw t}}}return(n||JSON.stringify)(t)}const Mt={transitional:jt,adapter:["xhr","http","fetch"],transformRequest:[function t(e,n){const o=n.getContentType()||"";const r=o.indexOf("application/json")>-1;const s=ut.isObject(e);if(s&&ut.isHTMLForm(e)){e=new FormData(e)}const i=ut.isFormData(e);if(i){return r?JSON.stringify(zt(e)):e}if(ut.isArrayBuffer(e)||ut.isBuffer(e)||ut.isStream(e)||ut.isFile(e)||ut.isBlob(e)||ut.isReadableStream(e)){return e}if(ut.isArrayBufferView(e)){return e.buffer}if(ut.isURLSearchParams(e)){n.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let c;if(s){if(o.indexOf("application/x-www-form-urlencoded")>-1){return qt(e,this.formSerializer).toString()}if((c=ut.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return bt(c?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(s||r){n.setContentType("application/json",false);return $t(e)}return e}],transformResponse:[function t(e){const n=this.transitional||Mt.transitional;const o=n&&n.forcedJSONParsing;const r=this.responseType==="json";if(ut.isResponse(e)||ut.isReadableStream(e)){return e}if(e&&ut.isString(e)&&(o&&!this.responseType||r)){const t=n&&n.silentJSONParsing;const o=!t&&r;try{return JSON.parse(e)}catch(t){if(o){if(t.name==="SyntaxError"){throw at.from(t,at.ERR_BAD_RESPONSE,this,null,this.response)}throw t}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};ut.forEach(["delete","get","head","post","put","patch"],(t=>{Mt.headers[t]={}}));const Ht=Mt;const Jt=ut.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Kt=t=>{const e={};let n;let o;let r;t&&t.split("\n").forEach((function t(s){r=s.indexOf(":");n=s.substring(0,r).trim().toLowerCase();o=s.substring(r+1).trim();if(!n||e[n]&&Jt[n]){return}if(n==="set-cookie"){if(e[n]){e[n].push(o)}else{e[n]=[o]}}else{e[n]=e[n]?e[n]+", "+o:o}}));return e};const Vt=Symbol("internals");function Wt(t){return t&&String(t).trim().toLowerCase()}function Gt(t){if(t===false||t==null){return t}return ut.isArray(t)?t.map(Gt):String(t)}function Xt(t){const e=Object.create(null);const n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;while(o=n.exec(t)){e[o[1]]=o[2]}return e}const Yt=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Zt(t,e,n,o,r){if(ut.isFunction(o)){return o.call(this,e,n)}if(r){e=n}if(!ut.isString(e))return;if(ut.isString(o)){return e.indexOf(o)!==-1}if(ut.isRegExp(o)){return o.test(e)}}function Qt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}function te(t,e){const n=ut.toCamelCase(" "+e);["get","set","has"].forEach((o=>{Object.defineProperty(t,o+n,{value:function(t,n,r){return this[o].call(this,e,t,n,r)},configurable:true})}))}class ee{constructor(t){t&&this.set(t)}set(t,e,n){const o=this;function r(t,e,n){const r=Wt(e);if(!r){throw new Error("header name must be a non-empty string")}const s=ut.findKey(o,r);if(!s||o[s]===undefined||n===true||n===undefined&&o[s]!==false){o[s||e]=Gt(t)}}const s=(t,e)=>ut.forEach(t,((t,n)=>r(t,n,e)));if(ut.isPlainObject(t)||t instanceof this.constructor){s(t,e)}else if(ut.isString(t)&&(t=t.trim())&&!Yt(t)){s(Kt(t),e)}else if(ut.isHeaders(t)){for(const[e,o]of t.entries()){r(o,e,n)}}else{t!=null&&r(e,t,n)}return this}get(t,e){t=Wt(t);if(t){const n=ut.findKey(this,t);if(n){const t=this[n];if(!e){return t}if(e===true){return Xt(t)}if(ut.isFunction(e)){return e.call(this,t,n)}if(ut.isRegExp(e)){return e.exec(t)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){t=Wt(t);if(t){const n=ut.findKey(this,t);return!!(n&&this[n]!==undefined&&(!e||Zt(this,this[n],n,e)))}return false}delete(t,e){const n=this;let o=false;function r(t){t=Wt(t);if(t){const r=ut.findKey(n,t);if(r&&(!e||Zt(n,n[r],r,e))){delete n[r];o=true}}}if(ut.isArray(t)){t.forEach(r)}else{r(t)}return o}clear(t){const e=Object.keys(this);let n=e.length;let o=false;while(n--){const r=e[n];if(!t||Zt(this,this[r],r,t,true)){delete this[r];o=true}}return o}normalize(t){const e=this;const n={};ut.forEach(this,((o,r)=>{const s=ut.findKey(n,r);if(s){e[s]=Gt(o);delete e[r];return}const i=t?Qt(r):String(r).trim();if(i!==r){delete e[r]}e[i]=Gt(o);n[i]=true}));return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);ut.forEach(this,((n,o)=>{n!=null&&n!==false&&(e[o]=t&&ut.isArray(n)?n.join(", "):n)}));return e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);e.forEach((t=>n.set(t)));return n}static accessor(t){const e=this[Vt]=this[Vt]={accessors:{}};const n=e.accessors;const o=this.prototype;function r(t){const e=Wt(t);if(!n[e]){te(o,t);n[e]=true}}ut.isArray(t)?t.forEach(r):r(t);return this}}ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ut.reduceDescriptors(ee.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}));ut.freezeMethods(ee);const ne=ee;function oe(t,e){const n=this||Ht;const o=e||n;const r=ne.from(o.headers);let s=o.data;ut.forEach(t,(function t(o){s=o.call(n,s,r.normalize(),e?e.status:undefined)}));r.normalize();return s}function re(t){return!!(t&&t.__CANCEL__)}function se(t,e,n){at.call(this,t==null?"canceled":t,at.ERR_CANCELED,e,n);this.name="CanceledError"}ut.inherits(se,at,{__CANCEL__:true});function ie(t,e,n){const o=n.config.validateStatus;if(!n.status||!o||o(n.status)){t(n)}else{e(new at("Request failed with status code "+n.status,[at.ERR_BAD_REQUEST,at.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function ce(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ue(t,e){t=t||10;const n=new Array(t);const o=new Array(t);let r=0;let s=0;let i;e=e!==undefined?e:1e3;return function c(u){const a=Date.now();const l=o[s];if(!i){i=a}n[r]=u;o[r]=a;let f=s;let d=0;while(f!==r){d+=n[f++];f=f%t}r=(r+1)%t;if(r===s){s=(s+1)%t}if(a-i<e){return}const h=l&&a-l;return h?Math.round(d*1e3/h):undefined}}function ae(t,e){let n=0;let o=1e3/e;let r;let s;const i=(e,o=Date.now())=>{n=o;r=null;if(s){clearTimeout(s);s=null}t.apply(null,e)};const c=(...t)=>{const e=Date.now();const c=e-n;if(c>=o){i(t,e)}else{r=t;if(!s){s=setTimeout((()=>{s=null;i(r)}),o-c)}}};const u=()=>r&&i(r);return[c,u]}const le=(t,e,n=3)=>{let o=0;const r=ue(50,250);return ae((n=>{const s=n.loaded;const i=n.lengthComputable?n.total:undefined;const c=s-o;const u=r(c);const a=s<=i;o=s;const l={loaded:s,total:i,progress:i?s/i:undefined,bytes:c,rate:u?u:undefined,estimated:u&&i&&a?(i-s)/u:undefined,event:n,lengthComputable:i!=null,[e?"download":"upload"]:true};t(l)}),n)};const fe=(t,e)=>{const n=t!=null;return[o=>e[0]({lengthComputable:n,total:t,loaded:o}),e[1]]};const de=t=>(...e)=>ut.asap((()=>t(...e)));const he=kt.hasStandardBrowserEnv?function t(){const e=kt.navigator&&/(msie|trident)/i.test(kt.navigator.userAgent);const n=document.createElement("a");let o;function r(t){let o=t;if(e){n.setAttribute("href",o);o=n.href}n.setAttribute("href",o);return{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}o=r(window.location.href);return function t(e){const n=ut.isString(e)?r(e):e;return n.protocol===o.protocol&&n.host===o.host}}():function t(){return function t(){return true}}();const pe=kt.hasStandardBrowserEnv?{write(t,e,n,o,r,s){const i=[t+"="+encodeURIComponent(e)];ut.isNumber(n)&&i.push("expires="+new Date(n).toGMTString());ut.isString(o)&&i.push("path="+o);ut.isString(r)&&i.push("domain="+r);s===true&&i.push("secure");document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function me(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function we(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ye(t,e){if(t&&!me(e)){return we(t,e)}return e}const be=t=>t instanceof ne?{...t}:t;function ge(t,e){e=e||{};const n={};function o(t,e,n){if(ut.isPlainObject(t)&&ut.isPlainObject(e)){return ut.merge.call({caseless:n},t,e)}else if(ut.isPlainObject(e)){return ut.merge({},e)}else if(ut.isArray(e)){return e.slice()}return e}function r(t,e,n){if(!ut.isUndefined(e)){return o(t,e,n)}else if(!ut.isUndefined(t)){return o(undefined,t,n)}}function s(t,e){if(!ut.isUndefined(e)){return o(undefined,e)}}function i(t,e){if(!ut.isUndefined(e)){return o(undefined,e)}else if(!ut.isUndefined(t)){return o(undefined,t)}}function c(n,r,s){if(s in e){return o(n,r)}else if(s in t){return o(undefined,n)}}const u={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(t,e)=>r(be(t),be(e),true)};ut.forEach(Object.keys(Object.assign({},t,e)),(function o(s){const i=u[s]||r;const a=i(t[s],e[s],s);ut.isUndefined(a)&&i!==c||(n[s]=a)}));return n}const Re=t=>{const e=ge({},t);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:s,headers:i,auth:c}=e;e.headers=i=ne.from(i);e.url=St(ye(e.baseURL,e.url),t.params,t.paramsSerializer);if(c){i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")))}let u;if(ut.isFormData(n)){if(kt.hasStandardBrowserEnv||kt.hasStandardBrowserWebWorkerEnv){i.setContentType(undefined)}else if((u=i.getContentType())!==false){const[t,...e]=u?u.split(";").map((t=>t.trim())).filter(Boolean):[];i.setContentType([t||"multipart/form-data",...e].join("; "))}}if(kt.hasStandardBrowserEnv){o&&ut.isFunction(o)&&(o=o(e));if(o||o!==false&&he(e.url)){const t=r&&s&&pe.read(s);if(t){i.set(r,t)}}}return e};const Oe=typeof XMLHttpRequest!=="undefined";const Ee=Oe&&function(t){return new Promise((function e(n,o){const r=Re(t);let s=r.data;const i=ne.from(r.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:a}=r;let l;let f,d;let h,p;function m(){h&&h();p&&p();r.cancelToken&&r.cancelToken.unsubscribe(l);r.signal&&r.signal.removeEventListener("abort",l)}let w=new XMLHttpRequest;w.open(r.method.toUpperCase(),r.url,true);w.timeout=r.timeout;function y(){if(!w){return}const e=ne.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders());const r=!c||c==="text"||c==="json"?w.responseText:w.response;const s={data:r,status:w.status,statusText:w.statusText,headers:e,config:t,request:w};ie((function t(e){n(e);m()}),(function t(e){o(e);m()}),s);w=null}if("onloadend"in w){w.onloadend=y}else{w.onreadystatechange=function t(){if(!w||w.readyState!==4){return}if(w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)){return}setTimeout(y)}}w.onabort=function e(){if(!w){return}o(new at("Request aborted",at.ECONNABORTED,t,w));w=null};w.onerror=function e(){o(new at("Network Error",at.ERR_NETWORK,t,w));w=null};w.ontimeout=function e(){let n=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||jt;if(r.timeoutErrorMessage){n=r.timeoutErrorMessage}o(new at(n,s.clarifyTimeoutError?at.ETIMEDOUT:at.ECONNABORTED,t,w));w=null};s===undefined&&i.setContentType(null);if("setRequestHeader"in w){ut.forEach(i.toJSON(),(function t(e,n){w.setRequestHeader(n,e)}))}if(!ut.isUndefined(r.withCredentials)){w.withCredentials=!!r.withCredentials}if(c&&c!=="json"){w.responseType=r.responseType}if(a){[d,p]=le(a,true);w.addEventListener("progress",d)}if(u&&w.upload){[f,h]=le(u);w.upload.addEventListener("progress",f);w.upload.addEventListener("loadend",h)}if(r.cancelToken||r.signal){l=e=>{if(!w){return}o(!e||e.type?new se(null,t,w):e);w.abort();w=null};r.cancelToken&&r.cancelToken.subscribe(l);if(r.signal){r.signal.aborted?l():r.signal.addEventListener("abort",l)}}const b=ce(r.url);if(b&&kt.protocols.indexOf(b)===-1){o(new at("Unsupported protocol "+b+":",at.ERR_BAD_REQUEST,t));return}w.send(s||null)}))};const Se=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n=new AbortController;let o;const r=function(t){if(!o){o=true;i();const e=t instanceof Error?t:this.reason;n.abort(e instanceof at?e:new se(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null;r(new at(`timeout ${e} of ms exceeded`,at.ETIMEDOUT))}),e);const i=()=>{if(t){s&&clearTimeout(s);s=null;t.forEach((t=>{t.unsubscribe?t.unsubscribe(r):t.removeEventListener("abort",r)}));t=null}};t.forEach((t=>t.addEventListener("abort",r)));const{signal:c}=n;c.unsubscribe=()=>ut.asap(i);return c}};const Te=Se;const Ae=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let o=0;let r;while(o<n){r=o+e;yield t.slice(o,r);o=r}};const je=async function*(t,e){for await(const n of Ne(t)){yield*Ae(n,e)}};const Ne=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t){break}yield n}}finally{await e.cancel()}};const ve=(t,e,n,o)=>{const r=je(t,e);let s=0;let i;let c=t=>{if(!i){i=true;o&&o(t)}};return new ReadableStream({async pull(t){try{const{done:e,value:o}=await r.next();if(e){c();t.close();return}let i=o.byteLength;if(n){let t=s+=i;n(t)}t.enqueue(new Uint8Array(o))}catch(t){c(t);throw t}},cancel(t){c(t);return r.return()}},{highWaterMark:2})};const xe=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const Ce=xe&&typeof ReadableStream==="function";const Pe=xe&&(typeof TextEncoder==="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer()));const Be=(t,...e)=>{try{return!!t(...e)}catch(t){return false}};const De=Ce&&Be((()=>{let t=false;const e=new Request(kt.origin,{body:new ReadableStream,method:"POST",get duplex(){t=true;return"half"}}).headers.has("Content-Type");return t&&!e}));const Fe=64*1024;const Ue=Ce&&Be((()=>ut.isReadableStream(new Response("").body)));const _e={stream:Ue&&(t=>t.body)};xe&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!_e[e]&&(_e[e]=ut.isFunction(t[e])?t=>t[e]():(t,n)=>{throw new at(`Response type '${e}' is not supported`,at.ERR_NOT_SUPPORT,n)})}))})(new Response);const ke=async t=>{if(t==null){return 0}if(ut.isBlob(t)){return t.size}if(ut.isSpecCompliantForm(t)){const e=new Request(kt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}if(ut.isArrayBufferView(t)||ut.isArrayBuffer(t)){return t.byteLength}if(ut.isURLSearchParams(t)){t=t+""}if(ut.isString(t)){return(await Pe(t)).byteLength}};const qe=async(t,e)=>{const n=ut.toFiniteNumber(t.getContentLength());return n==null?ke(e):n};const Le=xe&&(async t=>{let{url:e,method:n,data:o,signal:r,cancelToken:s,timeout:i,onDownloadProgress:c,onUploadProgress:u,responseType:a,headers:l,withCredentials:f="same-origin",fetchOptions:d}=Re(t);a=a?(a+"").toLowerCase():"text";let h=Te([r,s&&s.toAbortSignal()],i);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let w;try{if(u&&De&&n!=="get"&&n!=="head"&&(w=await qe(l,o))!==0){let t=new Request(e,{method:"POST",body:o,duplex:"half"});let n;if(ut.isFormData(o)&&(n=t.headers.get("content-type"))){l.setContentType(n)}if(t.body){const[e,n]=fe(w,le(de(u)));o=ve(t.body,Fe,e,n)}}if(!ut.isString(f)){f=f?"include":"omit"}const r="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:o,duplex:"half",credentials:r?f:undefined});let s=await fetch(p);const i=Ue&&(a==="stream"||a==="response");if(Ue&&(c||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=s[e]}));const e=ut.toFiniteNumber(s.headers.get("content-length"));const[n,o]=c&&fe(e,le(de(c),true))||[];s=new Response(ve(s.body,Fe,n,(()=>{o&&o();m&&m()})),t)}a=a||"text";let y=await _e[ut.findKey(_e,a)||"text"](s,t);!i&&m&&m();return await new Promise(((e,n)=>{ie(e,n,{data:y,headers:ne.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:p})}))}catch(e){m&&m();if(e&&e.name==="TypeError"&&/fetch/i.test(e.message)){throw Object.assign(new at("Network Error",at.ERR_NETWORK,t,p),{cause:e.cause||e})}throw at.from(e,e&&e.code,t,p)}});const Ie={http:dt,xhr:Ee,fetch:Le};ut.forEach(Ie,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ze=t=>`- ${t}`;const $e=t=>ut.isFunction(t)||t===null||t===false;const Me={getAdapter:t=>{t=ut.isArray(t)?t:[t];const{length:e}=t;let n;let o;const r={};for(let s=0;s<e;s++){n=t[s];let e;o=n;if(!$e(n)){o=Ie[(e=String(n)).toLowerCase()];if(o===undefined){throw new at(`Unknown adapter '${e}'`)}}if(o){break}r[e||"#"+s]=o}if(!o){const t=Object.entries(r).map((([t,e])=>`adapter ${t} `+(e===false?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map(ze).join("\n"):" "+ze(t[0]):"as no adapter specified";throw new at(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return o},adapters:Ie};function He(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new se(null,t)}}function Je(t){He(t);t.headers=ne.from(t.headers);t.data=oe.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=Me.getAdapter(t.adapter||Ht.adapter);return e(t).then((function e(n){He(t);n.data=oe.call(t,t.transformResponse,n);n.headers=ne.from(n.headers);return n}),(function e(n){if(!re(n)){He(t);if(n&&n.response){n.response.data=oe.call(t,t.transformResponse,n.response);n.response.headers=ne.from(n.response.headers)}}return Promise.reject(n)}))}const Ke="1.7.7";const Ve={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ve[t]=function n(o){return typeof o===t||"a"+(e<1?"n ":" ")+t}}));const We={};Ve.transitional=function t(e,n,o){function r(t,e){return"[Axios v"+Ke+"] Transitional option '"+t+"'"+e+(o?". "+o:"")}return(t,o,s)=>{if(e===false){throw new at(r(o," has been removed"+(n?" in "+n:"")),at.ERR_DEPRECATED)}if(n&&!We[o]){We[o]=true;console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))}return e?e(t,o,s):true}};function Ge(t,e,n){if(typeof t!=="object"){throw new at("options must be an object",at.ERR_BAD_OPTION_VALUE)}const o=Object.keys(t);let r=o.length;while(r-- >0){const s=o[r];const i=e[s];if(i){const e=t[s];const n=e===undefined||i(e,s,t);if(n!==true){throw new at("option "+s+" must be "+n,at.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new at("Unknown option "+s,at.ERR_BAD_OPTION)}}}const Xe={assertOptions:Ge,validators:Ve};const Ye=Xe.validators;class Ze{constructor(t){this.defaults=t;this.interceptors={request:new At,response:new At}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{if(!t.stack){t.stack=n}else if(n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))){t.stack+="\n"+n}}catch(t){}}throw t}}_request(t,e){if(typeof t==="string"){e=e||{};e.url=t}else{e=t||{}}e=ge(this.defaults,e);const{transitional:n,paramsSerializer:o,headers:r}=e;if(n!==undefined){Xe.assertOptions(n,{silentJSONParsing:Ye.transitional(Ye.boolean),forcedJSONParsing:Ye.transitional(Ye.boolean),clarifyTimeoutError:Ye.transitional(Ye.boolean)},false)}if(o!=null){if(ut.isFunction(o)){e.paramsSerializer={serialize:o}}else{Xe.assertOptions(o,{encode:Ye.function,serialize:Ye.function},true)}}e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=r&&ut.merge(r.common,r[e.method]);r&&ut.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete r[t]}));e.headers=ne.concat(s,r);const i=[];let c=true;this.interceptors.request.forEach((function t(n){if(typeof n.runWhen==="function"&&n.runWhen(e)===false){return}c=c&&n.synchronous;i.unshift(n.fulfilled,n.rejected)}));const u=[];this.interceptors.response.forEach((function t(e){u.push(e.fulfilled,e.rejected)}));let a;let l=0;let f;if(!c){const t=[Je.bind(this),undefined];t.unshift.apply(t,i);t.push.apply(t,u);f=t.length;a=Promise.resolve(e);while(l<f){a=a.then(t[l++],t[l++])}return a}f=i.length;let d=e;l=0;while(l<f){const t=i[l++];const e=i[l++];try{d=t(d)}catch(t){e.call(this,t);break}}try{a=Je.call(this,d)}catch(t){return Promise.reject(t)}l=0;f=u.length;while(l<f){a=a.then(u[l++],u[l++])}return a}getUri(t){t=ge(this.defaults,t);const e=ye(t.baseURL,t.url);return St(e,t.params,t.paramsSerializer)}}ut.forEach(["delete","get","head","options"],(function t(e){Ze.prototype[e]=function(t,n){return this.request(ge(n||{},{method:e,url:t,data:(n||{}).data}))}}));ut.forEach(["post","put","patch"],(function t(e){function n(t){return function n(o,r,s){return this.request(ge(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Ze.prototype[e]=n();Ze.prototype[e+"Form"]=n(true)}));const Qe=Ze;class tn{constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let e;this.promise=new Promise((function t(n){e=n}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;while(e-- >0){n._listeners[e](t)}n._listeners=null}));this.promise.then=t=>{let e;const o=new Promise((t=>{n.subscribe(t);e=t})).then(t);o.cancel=function t(){n.unsubscribe(e)};return o};t((function t(o,r,s){if(n.reason){return}n.reason=new se(o,r,s);e(n.reason)}))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const e=this._listeners.indexOf(t);if(e!==-1){this._listeners.splice(e,1)}}toAbortSignal(){const t=new AbortController;const e=e=>{t.abort(e)};this.subscribe(e);t.signal.unsubscribe=()=>this.unsubscribe(e);return t.signal}static source(){let t;const e=new tn((function e(n){t=n}));return{token:e,cancel:t}}}const en=tn;function nn(t){return function e(n){return t.apply(null,n)}}function on(t){return ut.isObject(t)&&t.isAxiosError===true}const rn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rn).forEach((([t,e])=>{rn[e]=t}));const sn=rn;function cn(e){const n=new Qe(e);const o=t(Qe.prototype.request,n);ut.extend(o,Qe.prototype,n,{allOwnKeys:true});ut.extend(o,n,null,{allOwnKeys:true});o.create=function t(n){return cn(ge(e,n))};return o}const un=cn(Ht);un.Axios=Qe;un.CanceledError=se;un.CancelToken=en;un.isCancel=re;un.VERSION=Ke;un.toFormData=bt;un.AxiosError=at;un.Cancel=un.CanceledError;un.all=function t(e){return Promise.all(e)};un.spread=nn;un.isAxiosError=on;un.mergeConfig=ge;un.AxiosHeaders=ne;un.formToJSON=t=>zt(ut.isHTMLForm(t)?new FormData(t):t);un.getAdapter=Me.getAdapter;un.HttpStatusCode=sn;un.default=un;const an=un;const ln="https://wake-middleware.crmbonus.com/api";const fn=t=>`bc:reserve${t}`;const dn="@BYCODERS_KEY";const hn=t=>`bc:${t}`;class pn{constructor(){this.axiosInstance=an.create({baseURL:ln,headers:{"Content-Type":"application/json",accept:"application/json"}})}static getInstance(){if(this._instance){return this._instance}this._instance=new pn;return this._instance}async getCustomer(t,e){var n,o;const r={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const s=await this.axiosInstance.get(`/store/${e}/customer/${t}`,{headers:r});this.token=(n=s===null||s===void 0?void 0:s.data)===null||n===void 0?void 0:n.token;return(o=s===null||s===void 0?void 0:s.data)===null||o===void 0?void 0:o.customer}async updateOrder(t){const e=localStorage.getItem("@BYCODERS_KEY");const n={"Content-Type":"application/json",Authorization:`Bearer ${e}`};await this.axiosInstance.patch(`/checkouts/${t.cartId}/updateOrder`,{orderId:t.orderId,externalId:t.cartIdCrm},{headers:n});localStorage.removeItem("@BYCODERS_KEY")}async sendPin(t,e,n){const o={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const r=await this.axiosInstance.post("/crmbonus/send-pin",{cellphone:t,name:e,storeName:n},{headers:o});return{storeId:r.data.storeId,userId:r.data.userId}}async validatePinBonus(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/process-pin-bonus",t,{headers:e});return n.data}async reserve(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/redeem-bonus",t,{headers:e});return n.data}async cancel(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/cancel-apply-bonus",{ticket:t},{headers:e});return n.data}async getToken(t){var e,n;const o=await this.axiosInstance.post("/wake/requestToken",{storeName:t});this.token=(e=o===null||o===void 0?void 0:o.data)===null||e===void 0?void 0:e.token;localStorage.setItem(dn,this.token);return(n=o===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.token}async getCustomization(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.get(`/stores/${t}/customizations`,{headers:e});localStorage.setItem(hn(t),JSON.stringify(n.data))}async cancelBonus(t,e){const n=localStorage.getItem(dn);const o={"Content-Type":"application/json",Authorization:`Bearer ${n}`};await this.axiosInstance.post(`/crmbonus/cancel-bonus`,{cartId:t,usedBonus:true,storeName:e},{headers:o});localStorage.setItem(t,"0");localStorage.removeItem(fn(t));localStorage.removeItem("bc:used")}}pn._instance=null;export{pn as C,fn as g};
|
2
|
+
//# sourceMappingURL=p-8655e19b.js.map
|