@perevorot/shop 2.0.152 → 2.0.154

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.
Files changed (29) hide show
  1. package/dist/components/account/User.js +1 -1
  2. package/dist/components/account/User.js.map +1 -1
  3. package/dist/components/auth/Forget.js +1 -1
  4. package/dist/components/auth/Forget.js.map +1 -1
  5. package/dist/components/auth/Login.js +1 -1
  6. package/dist/components/auth/Login.js.map +1 -1
  7. package/dist/components/auth/Registration.js +1 -1
  8. package/dist/components/auth/Registration.js.map +1 -1
  9. package/dist/components/auth/Reset.js +1 -1
  10. package/dist/components/auth/Reset.js.map +1 -1
  11. package/dist/components/shop/Search.js +1 -1
  12. package/dist/components/shop/Search.js.map +1 -1
  13. package/dist/components/shop/cart/Cart.js +1 -1
  14. package/dist/components/shop/cart/Cart.js.map +1 -1
  15. package/dist/components/shop/cart/CartItem.js +1 -1
  16. package/dist/components/shop/cart/CartItem.js.map +1 -1
  17. package/dist/components/shop/filters/Price.js +1 -1
  18. package/dist/components/shop/filters/Price.js.map +1 -1
  19. package/dist/components/shop/order/Checkout.js +1 -1
  20. package/dist/components/shop/order/Checkout.js.map +1 -1
  21. package/dist/components/shop/order/CheckoutItem.js +1 -1
  22. package/dist/components/shop/order/CheckoutItem.js.map +1 -1
  23. package/dist/components/shop/order/OneClick.js +1 -1
  24. package/dist/components/shop/order/OneClick.js.map +1 -1
  25. package/dist/components/shop/reviews/Question.js +1 -1
  26. package/dist/components/shop/reviews/Question.js.map +1 -1
  27. package/dist/components/shop/reviews/Review.js +1 -1
  28. package/dist/components/shop/reviews/Review.js.map +1 -1
  29. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),r=require("vuex"),t=require("formvuelate"),a=require("vue-toastification"),n=require("@formvuelate/plugin-vee-validate"),o=require("@perevorot/shop/dist/api"),i=require("@perevorot/shop/dist/helpers");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(n);function s(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var a,n,o=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(a=t.next()).done)&&(o.push(a.value),!r||o.length!==r);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw n}}return o}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return c(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}var m={name:"user",components:{SchemaForm:t.SchemaFormFactory([u.default({})])},props:{mode:{type:String,default:"registration"}},setup:function(n){var l=r.useStore(),u=e.ref(!1),c=e.ref(!0),m=e.ref({}),d=e.ref({}),f=e.ref({}),v=e.ref({}),h=a.useToast(),p=e.ref(0);t.useSchemaForm(v);return o.auth.registerForm().then((function(e){var r=i.formParse(e.data);"confirm"==n.mode&&(r.schema.email.hidden=!0,r.schema.password.hidden=!0),d.value=r.schema,v.value=Object.assign({},r.model,e.data.model),f.value=r.validation})).finally((function(){c.value=!1})),{loading:u,loadingForm:c,errors:m,schema:d,validation:f,onSubmit:function(){u.value=!0,l.dispatch("auth/update",{credentials:v.value,finally:function(){u.value=!1},callback:function(){h(__("auth."+n.mode+".form.saved"),{type:"success"}),l.commit("auth/modal",null),l.dispatch("auth/me")},catch:function(e){if(e.response&&e.response.data&&e.response.data.errors)for(var r=0,t=Object.entries(e.response.data.errors);r<t.length;r++){var a=s(t[r],2),n=a[0],o=a[1];o[0]&&(m.value[n]=o[0])}else console.error(e);p.value++}})},model:v,key:p}}},d={class:"field"},f={class:"columns is-vcentered"},v={class:"column"};m.render=function(r,t,a,n,o,i){var l=e.resolveComponent("SchemaForm");return n.loadingForm?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.model.user_type?"is-user-type-"+n.model.user_type.replaceAll("_","-"):null)},[e.createVNode(l,{schemaRowClasses:"field",schema:n.schema,"validation-schema":n.validation,"initial-errors":n.errors,key:n.key,onSubmit:n.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",d,[e.createElementVNode("div",f,[e.createElementVNode("div",v,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":n.loading}]),type:"submit"},e.toDisplayString(r.__("auth."+a.mode+".form.save")),3)])])])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"])],2))},module.exports=m;
1
+ "use strict";var e=require("vue"),r=require("vuex"),t=require("formvuelate"),a=require("vue-toastification"),o=require("@formvuelate/plugin-vee-validate"),n=require("@perevorot/shop/dist/api"),i=require("@perevorot/shop/dist/helpers");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(o);function s(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var a,o,n=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(a=t.next()).done)&&(n.push(a.value),!r||n.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return n}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return c(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}var m={name:"user",components:{SchemaForm:t.SchemaFormFactory([u.default({})])},props:{mode:{type:String,default:"registration"}},setup:function(o){var l=r.useStore(),u=e.ref(!1),c=e.ref(!0),m=e.ref({}),d=e.ref({}),f=e.ref({}),v=e.ref({}),p=a.useToast(),h=e.ref(0);t.useSchemaForm(v);return n.auth.registerForm().then((function(e){var r=i.formParse(e.data);"confirm"==o.mode&&(r.schema.email.hidden=!0,r.schema.password.hidden=!0),d.value=r.schema,v.value=Object.assign({},r.model,e.data.model),f.value=r.validation})).finally((function(){c.value=!1})),{loading:u,loadingForm:c,errors:m,schema:d,validation:f,onSubmit:function(){u.value=!0,l.dispatch("auth/update",{credentials:v.value,finally:function(){u.value=!1},callback:function(){p(__("auth."+o.mode+".form.saved"),{type:"success"}),l.commit("auth/modal",null),l.dispatch("auth/me")},catch:function(e){if(e.response&&e.response.data&&e.response.data.errors)for(var r=0,t=Object.entries(e.response.data.errors);r<t.length;r++){var a=s(t[r],2),o=a[0],n=a[1];n[0]&&(m.value[o]=n[0])}else console.error(e);h.value++}})},model:v,key:h}}},d={class:"field"},f={class:"columns is-vcentered"},v={class:"column"};m.render=function(r,t,a,o,n,i){var l=e.resolveComponent("SchemaForm");return o.loadingForm?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.model.user_type?"is-user-type-"+o.model.user_type.replaceAll("_","-"):null)},[(e.openBlock(),e.createBlock(l,{schemaRowClasses:"field",schema:o.schema,"validation-schema":o.validation,"initial-errors":o.errors,key:o.key,onSubmit:o.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",d,[e.createElementVNode("div",f,[e.createElementVNode("div",v,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":o.loading}]),type:"submit"},e.toDisplayString(r.__("auth."+a.mode+".form.save")),3)])])])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],2))},module.exports=m;
2
2
  //# sourceMappingURL=User.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"User.js","sources":["../../../src/components/account/User.vue","../../../src/components/account/User.vue?vue&type=template&id=4578454c&lang.js"],"sourcesContent":["<template>\n <div v-if=\"!loadingForm\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.' + mode + '.form.save') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport { useToast } from \"vue-toastification\";\n\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'user',\n components: {\n SchemaForm\n },\n props: {\n mode: {\n type: String,\n default: 'registration'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const errors = ref({});\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n const toast = useToast();\n const key = ref(0);\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/update', {\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n toast(__('auth.' + props.mode + '.form.saved'), {\n type: 'success'\n });\n\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n },\n catch: (error) => {\n if (error.response && error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n } else {\n console.error(error);\n }\n\n key.value++;\n }\n });\n };\n\n api.registerForm()\n .then((response) => {\n const form = formParse(response.data);\n\n if (props.mode == 'confirm') {\n form.schema.email.hidden = true\n form.schema.password.hidden = true;\n }\n\n schema.value = form.schema;\n model.value = { ...form.model, ...response.data.model };\n validation.value = form.validation;\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n errors,\n schema,\n validation,\n onSubmit,\n model,\n key\n };\n }\n};\n</script>","<template>\n <div v-if=\"!loadingForm\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.' + mode + '.form.save') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport { useToast } from \"vue-toastification\";\n\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'user',\n components: {\n SchemaForm\n },\n props: {\n mode: {\n type: String,\n default: 'registration'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const errors = ref({});\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n const toast = useToast();\n const key = ref(0);\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/update', {\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n toast(__('auth.' + props.mode + '.form.saved'), {\n type: 'success'\n });\n\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n },\n catch: (error) => {\n if (error.response && error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n } else {\n console.error(error);\n }\n\n key.value++;\n }\n });\n };\n\n api.registerForm()\n .then((response) => {\n const form = formParse(response.data);\n\n if (props.mode == 'confirm') {\n form.schema.email.hidden = true\n form.schema.password.hidden = true;\n }\n\n schema.value = form.schema;\n model.value = { ...form.model, ...response.data.model };\n validation.value = form.validation;\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n errors,\n schema,\n validation,\n onSubmit,\n model,\n key\n };\n }\n};\n</script>"],"names":["name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","mode","type","String","setup","store","useStore","loading","ref","loadingForm","errors","schema","validation","model","toast","useToast","key","useSchemaForm","api","registerForm","then","response","form","formParse","data","email","hidden","password","value","onSubmit","dispatch","credentials","callback","__","commit","error","Object","entries","field","messages","console","$setup","_createElementBlock","user_type","replaceAll","_createVNode","schemaRowClasses","afterForm","_createElementVNode","_hoisted_1","_hoisted_2","_hoisted_3","_ctx","$props"],"mappings":"8wCA2BA,MAEe,CACXA,KAAM,OACNC,WAAY,CACRC,WALWC,oBAAkB,CAACC,UAAkB,OAOpDC,MAAO,CACHC,KAAM,CACFC,KAAMC,eACG,iBAGjBC,eAAMJ,OACIK,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAcD,OAAI,GAClBE,EAASF,MAAI,IACbG,EAASH,MAAI,IACbI,EAAaJ,MAAI,IACjBK,EAAQL,MAAI,IACZM,EAA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ources":["../../../src/components/account/User.vue","../../../src/components/account/User.vue?vue&type=template&id=4578454c&lang.js"],"sourcesContent":["<template>\n <div v-if=\"!loadingForm\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.' + mode + '.form.save') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport { useToast } from \"vue-toastification\";\n\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'user',\n components: {\n SchemaForm\n },\n props: {\n mode: {\n type: String,\n default: 'registration'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const errors = ref({});\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n const toast = useToast();\n const key = ref(0);\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/update', {\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n toast(__('auth.' + props.mode + '.form.saved'), {\n type: 'success'\n });\n\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n },\n catch: (error) => {\n if (error.response && error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n } else {\n console.error(error);\n }\n\n key.value++;\n }\n });\n };\n\n api.registerForm()\n .then((response) => {\n const form = formParse(response.data);\n\n if (props.mode == 'confirm') {\n form.schema.email.hidden = true\n form.schema.password.hidden = true;\n }\n\n schema.value = form.schema;\n model.value = { ...form.model, ...response.data.model };\n validation.value = form.validation;\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n errors,\n schema,\n validation,\n onSubmit,\n model,\n key\n };\n }\n};\n</script>","<template>\n <div v-if=\"!loadingForm\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.' + mode + '.form.save') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport { useToast } from \"vue-toastification\";\n\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'user',\n components: {\n SchemaForm\n },\n props: {\n mode: {\n type: String,\n default: 'registration'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const errors = ref({});\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n const toast = useToast();\n const key = ref(0);\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/update', {\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: () => {\n toast(__('auth.' + props.mode + '.form.saved'), {\n type: 'success'\n });\n\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n },\n catch: (error) => {\n if (error.response && error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n } else {\n console.error(error);\n }\n\n key.value++;\n }\n });\n };\n\n api.registerForm()\n .then((response) => {\n const form = formParse(response.data);\n\n if (props.mode == 'confirm') {\n form.schema.email.hidden = true\n form.schema.password.hidden = true;\n }\n\n schema.value = form.schema;\n model.value = { ...form.model, ...response.data.model };\n validation.value = form.validation;\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n errors,\n schema,\n validation,\n onSubmit,\n model,\n key\n };\n }\n};\n</script>"],"names":["name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","mode","type","String","setup","store","useStore","loading","ref","loadingForm","errors","schema","validation","model","toast","useToast","key","useSchemaForm","api","registerForm","then","response","form","formParse","data","email","hidden","password","value","onSubmit","dispatch","credentials","callback","__","commit","error","Object","entries","field","messages","console","$setup","_createElementBlock","user_type","replaceAll","_createBlock","schemaRowClasses","afterForm","_createElementVNode","_hoisted_1","_hoisted_2","_hoisted_3","_ctx","$props"],"mappings":"8wCA2BA,MAEe,CACXA,KAAM,OACNC,WAAY,CACRC,WALWC,oBAAkB,CAACC,UAAkB,OAOpDC,MAAO,CACHC,KAAM,CACFC,KAAMC,eACG,iBAGjBC,eAAMJ,OACIK,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAcD,OAAI,GAClBE,EAASF,MAAI,IACbG,EAASH,MAAI,IACbI,EAAaJ,MAAI,IACjBK,EAAQL,MAAI,IACZM,EAAQC,aACRC,EAAMR,MAAI,GAEhBS,gBAAcJ,UAkCdK,OAAIC,eACCC,MAAK,SAACC,OACGC,EAAOC,YAAUF,EAASG,MAEd,WAAdxB,EAAMC,OACNqB,EAAKX,OAAOc,MAAMC,QAAS,EAC3BJ,EAAKX,OAAOgB,SAASD,QAAS,GAGlCf,EAAOiB,MAAQN,EAAKX,OACpBE,EAAMe,uBAAaN,EAAKT,MAAUQ,EAASG,KAAKX,OAChDD,EAAWgB,MAAQN,EAAKV,uBAEnB,WACLH,EAAYmB,OAAQ,KAGrB,CACHrB,QAAAA,EACAE,YAAAA,EACAC,OAAAA,EACAC,OAAAA,EACAC,WAAAA,EACAiB,SAvDa,WACbtB,EAAQqB,OAAQ,EAEhBvB,EAAMyB,SAAS,cAAe,CAC1BC,YAAalB,EAAMe,cACV,WACLrB,EAAQqB,OAAQ,GAEpBI,SAAU,WACNlB,EAAMmB,GAAG,QAAUjC,EAAMC,KAAO,eAAgB,CAC5CC,KAAM,YAGVG,EAAM6B,OAAO,aAAc,MAC3B7B,EAAMyB,SAAS,kBAEZ,SAACK,MACAA,EAAMd,UAAYc,EAAMd,SAASG,MAAQW,EAAMd,SAASG,KAAKd,qBAC7B0B,OAAOC,QAAQF,EAAMd,SAASG,KAAKd,uBAAS,iBAAhE4B,OAAOC,OACXA,EAAS,KACT7B,EAAOkB,MAAMU,GAASC,EAAS,SAIvCC,QAAQL,MAAMA,GAGlBnB,EAAIY,YA6BZf,MAAAA,EACAG,IAAAA,cC1Ge,kBACI,iCACI,uFALnByB,6DAAZC,yDAAuCD,QAAME,0BAA8BF,QAAME,UAAUC,2CACvFC,iBAAYC,iBAAiB,QAASnC,OAAQ8B,6BAA4BA,8BAA6BA,SAASzB,IAAKyB,MAAMZ,SAAQY,aACpHM,qBACP,kBAAAC,2BAAAC,GACID,2BAAAE,GACIF,2BAAAG,GACIH,uDAAc,+BAA6DP,aAA5CvC,KAAK,4BAC7BkD,aAAaC"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),a=require("formvuelate"),n=require("@formvuelate/plugin-vee-validate"),r=require("@perevorot/shop/dist/forms/FormText"),o=require("yup");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var s=l(n),u=l(r),c=i(o);e.markRaw(u.default);var d={name:"forget",components:{SchemaForm:a.SchemaFormFactory([s.default({})])},props:{email:{type:String,default:""},emailOrPhone:{type:String,default:""},forgetType:{type:String,default:"email"},showPlaceholders:{type:Boolean,default:!1}},setup:function(n){var r=e.ref(!1),o=t.useStore(),l=e.ref(0),i=e.ref(""),s=e.ref(""),d=e.ref(!1),m=e.ref({}),v=e.ref({}),f=e.ref(!1),p=e.ref(""),g=e.ref(""),h=e.ref(""),y=e.ref("");e.getCurrentInstance();var N={email:{component:u.default,label:__("auth.login.form.email"),placeholder:n.showPlaceholders?__("auth.login.form.email"):""},emailOrPhone:{component:u.default,label:__("auth.login.form.emailOrPhone"),placeholder:n.showPlaceholders?__("auth.login.form.emailOrPhone"):""}},_={email:c.string().email(__("auth.validation.email")).required(__("auth.validation.required")),emailOrPhone:c.string().required(__("auth.validation.required")).test("test-name",__("auth.validation.emailOrPhone"),(function(e){var t=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e),a=/^(?:\+38)?(?:\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/.test(e);return!(!t&&!a)}))};m.value[n.forgetType]=N[n.forgetType],v.value[n.forgetType]=n[n.forgetType];var b={};b[n.forgetType]=_[n.forgetType];var E=c.object().shape(b);a.useSchemaForm(v);var V=e.inject("presetedResetToken"),S=e.inject("presetedResetEmail");return{loading:r,key:l,schema:m,validation:E,remembered:function(){o.commit("auth/modal","login")},onSubmit:function(){r.value=!0,i.value="",s.value="",o.dispatch("auth/reset",{credentials:v.value,callback:function(e,t,a){t?s.value=e:(i.value=e,f.value="phone"==(null==a?void 0:a.credentials))},finally:function(){v.value={},r.value=!1,d.value=!0,l.value++}})},again:function(){d.value=!1},sent:d,message:i,error:s,close:function(){o.commit("auth/modal",null)},sms:f,code1:p,code2:g,code3:h,code4:y,codeKeyUp:function(e){var t=e.target.nextElementSibling,a=e.target.previousElementSibling,n=t&&"INPUT"===t.tagName,r=a&&"INPUT"===a.tagName;e.keyCode>=48&&e.keyCode<=57&&(s.value="",n&&t.focus()),8===e.keyCode&&(s.value="",""===e.target.value&&r&&a.focus())},codePaste:function(e){e.preventDefault();var t=e.clipboardData.getData("Text");4==t.length&&(isNaN(t[0])||isNaN(t[1])||isNaN(t[2])||isNaN(t[3])||(p.value=t[0],g.value=t[1],h.value=t[2],y.value=t[3],s.value=""))},more:function(){f.value=!1,p.value="",g.value="",h.value="",y.value="",i.value="",d.value=!1},smsReset:function(){""===p.value||""===g.value||""===h.value||""===y.value?s.value=__("auth.validation.required"):(r.value=!0,s.value="",o.dispatch("auth/resetSms",{credentials:{code:String(p.value)+String(g.value)+String(h.value)+String(y.value)},callback:function(e,t){t?s.value=e.message:(p.value="",g.value="",h.value="",y.value="",V.value=e.token,S.value=e.email,o.commit("auth/modal","reset"))},finally:function(){r.value=!1,l.value++}}))}}}},m={class:"form auth-forget"},v={class:"title"},f={class:"field"},p={class:"columns is-vcentered"},g={class:"column"},h={class:"mt-2"},y={class:"forget-thanks-mesage"},N=["innerHTML"],_={class:"mt-2 close-button"},b={class:"forget-thanks-mesage schema-col"},E=["innerHTML"],V={class:"sms-code"},S={class:"control"},k=["innerHTML"],T={class:"actions-wrapper"},P={class:"forget-error-mesage"},w=["innerHTML"],D={class:"mt-2"};d.render=function(t,a,n,r,o,l){var i=e.resolveComponent("SchemaForm"),s=e.resolveDirective("maska");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",v,e.toDisplayString(t.__("auth.forget.title")),1),e.withDirectives(e.createElementVNode("div",null,[e.createVNode(i,{schemaRowClasses:"field",schema:r.schema,"validation-schema":r.validation,key:r.key,onSubmit:r.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",f,[e.createElementVNode("div",p,[e.createElementVNode("div",g,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":r.loading}]),type:"submit"},e.toDisplayString(t.__("auth.forget.form.submit")),3)])])])]})),_:1},8,["schema","validation-schema","onSubmit"]),e.createElementVNode("div",h,[e.createElementVNode("a",{onClick:a[0]||(a[0]=function(){return r.remembered&&r.remembered.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.remembered")),1)])],512),[[e.vShow,!r.sent]]),e.withDirectives(e.createElementVNode("div",y,[e.createElementVNode("div",{innerHTML:r.message,class:"thanks-message"},null,8,N),e.createElementVNode("div",_,[e.createElementVNode("a",{onClick:a[1]||(a[1]=function(){return r.close&&r.close.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.close")),1)])],512),[[e.vShow,r.sent&&r.message&&!r.sms]]),e.withDirectives(e.createElementVNode("div",b,[e.createElementVNode("div",{innerHTML:r.message,class:"thanks-message"},null,8,E),e.createElementVNode("div",V,[e.createElementVNode("div",S,[e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code1}]),"onUpdate:modelValue":a[2]||(a[2]=function(e){return r.code1=e}),onKeyup:a[3]||(a[3]=function(e){return r.codeKeyUp(e)}),onPaste:a[4]||(a[4]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code1],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code2}]),"onUpdate:modelValue":a[5]||(a[5]=function(e){return r.code2=e}),onKeyup:a[6]||(a[6]=function(e){return r.codeKeyUp(e)}),onPaste:a[7]||(a[7]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code2],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code3}]),"onUpdate:modelValue":a[8]||(a[8]=function(e){return r.code3=e}),onKeyup:a[9]||(a[9]=function(e){return r.codeKeyUp(e)}),onPaste:a[10]||(a[10]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code3],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code4}]),"onUpdate:modelValue":a[11]||(a[11]=function(e){return r.code4=e}),onKeyup:a[12]||(a[12]=function(e){return r.codeKeyUp(e)}),onPaste:a[13]||(a[13]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code4],[s,"#"]])]),r.error?(e.openBlock(),e.createElementBlock("p",{key:0,class:"help is-danger",innerHTML:r.error},null,8,k)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",T,[e.createElementVNode("button",{class:e.normalizeClass(["button",{"is-loading":r.loading}]),onClick:a[14]||(a[14]=function(){return r.smsReset&&r.smsReset.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.sms_reset_password")),3),e.createElementVNode("button",{class:"button",onClick:a[15]||(a[15]=function(){return r.more&&r.more.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.sms_more")),1),e.createElementVNode("button",{class:"button",onClick:a[16]||(a[16]=function(){return r.remembered&&r.remembered.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.remembered")),1)])],512),[[e.vShow,r.sent&&r.message&&r.sms]]),e.withDirectives(e.createElementVNode("div",P,[e.createElementVNode("div",{class:"message",innerHTML:r.error},null,8,w),e.createElementVNode("div",D,[e.createElementVNode("a",{onClick:a[17]||(a[17]=function(){return r.again&&r.again.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.send")),1)])],512),[[e.vShow,r.sent&&r.error&&!r.sms]])])},module.exports=d;
1
+ "use strict";var e=require("vue"),t=require("vuex"),a=require("formvuelate"),n=require("@formvuelate/plugin-vee-validate"),r=require("@perevorot/shop/dist/forms/FormText"),o=require("yup");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var s=l(n),u=l(r),c=i(o);e.markRaw(u.default);var d={name:"forget",components:{SchemaForm:a.SchemaFormFactory([s.default({})])},props:{email:{type:String,default:""},emailOrPhone:{type:String,default:""},forgetType:{type:String,default:"email"},showPlaceholders:{type:Boolean,default:!1}},setup:function(n){var r=e.ref(!1),o=t.useStore(),l=e.ref(0),i=e.ref(""),s=e.ref(""),d=e.ref(!1),m=e.ref({}),v=e.ref({}),f=e.ref(!1),p=e.ref(""),g=e.ref(""),h=e.ref(""),y=e.ref("");e.getCurrentInstance();var N={email:{component:u.default,label:__("auth.login.form.email"),placeholder:n.showPlaceholders?__("auth.login.form.email"):""},emailOrPhone:{component:u.default,label:__("auth.login.form.emailOrPhone"),placeholder:n.showPlaceholders?__("auth.login.form.emailOrPhone"):""}},_={email:c.string().email(__("auth.validation.email")).required(__("auth.validation.required")),emailOrPhone:c.string().required(__("auth.validation.required")).test("test-name",__("auth.validation.emailOrPhone"),(function(e){var t=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e),a=/^(?:\+38)?(?:\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/.test(e);return!(!t&&!a)}))};m.value[n.forgetType]=N[n.forgetType],v.value[n.forgetType]=n[n.forgetType];var b={};b[n.forgetType]=_[n.forgetType];var E=c.object().shape(b);a.useSchemaForm(v);var V=e.inject("presetedResetToken"),k=e.inject("presetedResetEmail");return{loading:r,key:l,schema:m,validation:E,remembered:function(){o.commit("auth/modal","login")},onSubmit:function(){r.value=!0,i.value="",s.value="",o.dispatch("auth/reset",{credentials:v.value,callback:function(e,t,a){t?s.value=e:(i.value=e,f.value="phone"==(null==a?void 0:a.credentials))},finally:function(){v.value={},r.value=!1,d.value=!0,l.value++}})},again:function(){d.value=!1},sent:d,message:i,error:s,close:function(){o.commit("auth/modal",null)},sms:f,code1:p,code2:g,code3:h,code4:y,codeKeyUp:function(e){var t=e.target.nextElementSibling,a=e.target.previousElementSibling,n=t&&"INPUT"===t.tagName,r=a&&"INPUT"===a.tagName;e.keyCode>=48&&e.keyCode<=57&&(s.value="",n&&t.focus()),8===e.keyCode&&(s.value="",""===e.target.value&&r&&a.focus())},codePaste:function(e){e.preventDefault();var t=e.clipboardData.getData("Text");4==t.length&&(isNaN(t[0])||isNaN(t[1])||isNaN(t[2])||isNaN(t[3])||(p.value=t[0],g.value=t[1],h.value=t[2],y.value=t[3],s.value=""))},more:function(){f.value=!1,p.value="",g.value="",h.value="",y.value="",i.value="",d.value=!1},smsReset:function(){""===p.value||""===g.value||""===h.value||""===y.value?s.value=__("auth.validation.required"):(r.value=!0,s.value="",o.dispatch("auth/resetSms",{credentials:{code:String(p.value)+String(g.value)+String(h.value)+String(y.value)},callback:function(e,t){t?s.value=e.message:(p.value="",g.value="",h.value="",y.value="",V.value=e.token,k.value=e.email,o.commit("auth/modal","reset"))},finally:function(){r.value=!1,l.value++}}))}}}},m={class:"form auth-forget"},v={class:"title"},f={class:"field"},p={class:"columns is-vcentered"},g={class:"column"},h={class:"mt-2"},y={class:"forget-thanks-mesage"},N=["innerHTML"],_={class:"mt-2 close-button"},b={class:"forget-thanks-mesage schema-col"},E=["innerHTML"],V={class:"sms-code"},k={class:"control"},S=["innerHTML"],T={class:"actions-wrapper"},P={class:"forget-error-mesage"},w=["innerHTML"],D={class:"mt-2"};d.render=function(t,a,n,r,o,l){var i=e.resolveComponent("SchemaForm"),s=e.resolveDirective("maska");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",v,e.toDisplayString(t.__("auth.forget.title")),1),e.withDirectives(e.createElementVNode("div",null,[(e.openBlock(),e.createBlock(i,{schemaRowClasses:"field",schema:r.schema,"validation-schema":r.validation,key:r.key,onSubmit:r.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",f,[e.createElementVNode("div",p,[e.createElementVNode("div",g,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":r.loading}]),type:"submit"},e.toDisplayString(t.__("auth.forget.form.submit")),3)])])])]})),_:1},8,["schema","validation-schema","onSubmit"])),e.createElementVNode("div",h,[e.createElementVNode("a",{onClick:a[0]||(a[0]=function(){return r.remembered&&r.remembered.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.remembered")),1)])],512),[[e.vShow,!r.sent]]),e.withDirectives(e.createElementVNode("div",y,[e.createElementVNode("div",{innerHTML:r.message,class:"thanks-message"},null,8,N),e.createElementVNode("div",_,[e.createElementVNode("a",{onClick:a[1]||(a[1]=function(){return r.close&&r.close.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.close")),1)])],512),[[e.vShow,r.sent&&r.message&&!r.sms]]),e.withDirectives(e.createElementVNode("div",b,[e.createElementVNode("div",{innerHTML:r.message,class:"thanks-message"},null,8,E),e.createElementVNode("div",V,[e.createElementVNode("div",k,[e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code1}]),"onUpdate:modelValue":a[2]||(a[2]=function(e){return r.code1=e}),onKeyup:a[3]||(a[3]=function(e){return r.codeKeyUp(e)}),onPaste:a[4]||(a[4]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code1],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code2}]),"onUpdate:modelValue":a[5]||(a[5]=function(e){return r.code2=e}),onKeyup:a[6]||(a[6]=function(e){return r.codeKeyUp(e)}),onPaste:a[7]||(a[7]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code2],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code3}]),"onUpdate:modelValue":a[8]||(a[8]=function(e){return r.code3=e}),onKeyup:a[9]||(a[9]=function(e){return r.codeKeyUp(e)}),onPaste:a[10]||(a[10]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code3],[s,"#"]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass(["input",{"is-filled":""!==r.code4}]),"onUpdate:modelValue":a[11]||(a[11]=function(e){return r.code4=e}),onKeyup:a[12]||(a[12]=function(e){return r.codeKeyUp(e)}),onPaste:a[13]||(a[13]=function(e){return r.codePaste(e)})},null,34),[[e.vModelText,r.code4],[s,"#"]])]),r.error?(e.openBlock(),e.createElementBlock("p",{key:0,class:"help is-danger",innerHTML:r.error},null,8,S)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",T,[e.createElementVNode("button",{class:e.normalizeClass(["button",{"is-loading":r.loading}]),onClick:a[14]||(a[14]=function(){return r.smsReset&&r.smsReset.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.sms_reset_password")),3),e.createElementVNode("button",{class:"button",onClick:a[15]||(a[15]=function(){return r.more&&r.more.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.sms_more")),1),e.createElementVNode("button",{class:"button",onClick:a[16]||(a[16]=function(){return r.remembered&&r.remembered.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.remembered")),1)])],512),[[e.vShow,r.sent&&r.message&&r.sms]]),e.withDirectives(e.createElementVNode("div",P,[e.createElementVNode("div",{class:"message",innerHTML:r.error},null,8,w),e.createElementVNode("div",D,[e.createElementVNode("a",{onClick:a[17]||(a[17]=function(){return r.again&&r.again.apply(r,arguments)})},e.toDisplayString(t.__("auth.forget.send")),1)])],512),[[e.vShow,r.sent&&r.error&&!r.sms]])])},module.exports=d;
2
2
  //# sourceMappingURL=Forget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Forget.js","sources":["../../../src/components/auth/Forget.vue","../../../src/components/auth/Forget.vue?vue&type=template&id=01249924&lang.js"],"sourcesContent":["<template>\n <div class=\"form auth-forget\">\n <div class=\"title\">{{ __('auth.forget.title') }}</div>\n <div v-show=\"!sent\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.forget.form.submit') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n <div class=\"mt-2\">\n <a @click=\"remembered\">{{ __('auth.forget.remembered') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && !sms\" class=\"forget-thanks-mesage\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"mt-2 close-button\">\n <a @click=\"close\">{{ __('auth.forget.close') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && sms\" class=\"forget-thanks-mesage schema-col\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"sms-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" v-model=\"code1\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code1 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code2\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code2 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code3\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code3 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code4\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code4 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n </div>\n <p class=\"help is-danger\" v-html=\"error\" v-if=\"error\"></p>\n </div>\n <div class=\"actions-wrapper\">\n <button class=\"button\" v-bind:class=\"{ 'is-loading': loading }\" @click=\"smsReset\">{{ __('auth.forget.sms_reset_password') }}</button>\n <button class=\"button\" @click=\"more\">{{ __('auth.forget.sms_more') }}</button>\n <button class=\"button\" @click=\"remembered\">{{ __('auth.forget.remembered') }}</button>\n </div>\n </div>\n <div v-show=\"sent && error && !sms\" class=\"forget-error-mesage\">\n <div class=\"message\" v-html=\"error\"></div>\n <div class=\"mt-2\">\n <a @click=\"again\">{{ __('auth.forget.send') }}</a>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, getCurrentInstance, inject } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'forget',\n components: {\n SchemaForm\n },\n props: {\n email: {\n type: String,\n default: ''\n },\n emailOrPhone: {\n type: String,\n default: ''\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const message = ref('');\n const error = ref('');\n const sent = ref(false);\n const schema = ref({});\n const model = ref({});\n const sms = ref(false);\n const code1 = ref('');\n const code2 = ref('');\n const code3 = ref('');\n const code4 = ref('');\n const instance = getCurrentInstance();\n\n const s = {\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n emailOrPhone: {\n component: FormText,\n label: __('auth.login.form.emailOrPhone'),\n placeholder: props.showPlaceholders ? __('auth.login.form.emailOrPhone') : '',\n }\n };\n\n const yupValidations = {\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n emailOrPhone: yup\n .string()\n .required(__('auth.validation.required'))\n .test('test-name', __('auth.validation.emailOrPhone'), function (value) {\n const emailRegex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n const phoneRegex = /^(?:\\+38)?(?:\\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/;\n\n let isValidEmail = emailRegex.test(value);\n let isValidPhone = phoneRegex.test(value);\n\n if (!isValidEmail && !isValidPhone) {\n return false;\n }\n\n return true;\n })\n };\n\n schema.value[props.forgetType] = s[props.forgetType];\n model.value[props.forgetType] = props[props.forgetType];\n\n let currentYupValidation = {};\n currentYupValidation[props.forgetType] = yupValidations[props.forgetType];\n\n const validation = yup.object().shape(currentYupValidation);\n\n useSchemaForm(model);\n\n const remembered = () => {\n store.commit('auth/modal', 'login');\n };\n\n const more = () => {\n sms.value = false;\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n message.value = '';\n sent.value = false;\n };\n\n const again = () => {\n sent.value = false;\n };\n\n const onSubmit = () => {\n loading.value = true;\n message.value = '';\n error.value = '';\n\n store.dispatch('auth/reset', {\n credentials: model.value,\n callback: (m, isError, response) => {\n if (!isError) {\n message.value = m;\n sms.value = response?.credentials == 'phone';\n } else {\n error.value = m;\n }\n },\n finally: () => {\n model.value = {};\n loading.value = false;\n sent.value = true;\n key.value++;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n };\n\n const codeKeyUp = (e) => {\n const nextElement = e.target.nextElementSibling;\n const prevElement = e.target.previousElementSibling;\n const isNextElementIsInput = nextElement && nextElement.tagName === 'INPUT';\n const isPrevElementIsInput = prevElement && prevElement.tagName === 'INPUT';\n\n if (e.keyCode >= 48 && e.keyCode <= 57) {\n error.value = '';\n\n if (isNextElementIsInput) {\n nextElement.focus();\n }\n }\n\n if (e.keyCode === 8) {\n error.value = '';\n\n if (e.target.value === '') {\n if (isPrevElementIsInput) {\n prevElement.focus();\n }\n }\n }\n\n // if (e.keyCode == 37) {\n // if (isPrevElementIsInput) {\n // prevElement.focus();\n // }\n // }\n\n // if (e.keyCode == 39) {\n // if (isNextElementIsInput) {\n // nextElement.focus();\n // }\n // }\n };\n\n const codePaste = (e) => {\n e.preventDefault();\n\n const value = e.clipboardData.getData('Text');\n\n if (value.length == 4) {\n if (!isNaN(value[0]) && !isNaN(value[1]) && !isNaN(value[2]) && !isNaN(value[3])) {\n code1.value = value[0];\n code2.value = value[1];\n code3.value = value[2];\n code4.value = value[3];\n\n error.value = '';\n }\n }\n };\n\n const presetedResetToken = inject('presetedResetToken');\n const presetedResetEmail = inject('presetedResetEmail');\n\n const smsReset = () => {\n if (code1.value === '' || code2.value === '' || code3.value === '' || code4.value === '') {\n error.value = __('auth.validation.required');\n } else {\n loading.value = true;\n error.value = '';\n\n store.dispatch('auth/resetSms', {\n credentials: {\n code: String(code1.value) + String(code2.value) + String(code3.value) + String(code4.value)\n },\n callback: (m, isError) => {\n if (!isError) {\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n\n presetedResetToken.value = m.token;\n presetedResetEmail.value = m.email;\n\n store.commit('auth/modal', 'reset');\n } else {\n error.value = m.message;\n }\n },\n finally: () => {\n loading.value = false;\n key.value++;\n }\n });\n }\n };\n\n return {\n loading,\n key,\n schema,\n validation,\n remembered,\n onSubmit,\n again,\n sent,\n message,\n error,\n close,\n sms,\n code1,\n code2,\n code3,\n code4,\n codeKeyUp,\n codePaste,\n more,\n smsReset\n };\n }\n};\n</script>","<template>\n <div class=\"form auth-forget\">\n <div class=\"title\">{{ __('auth.forget.title') }}</div>\n <div v-show=\"!sent\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.forget.form.submit') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n <div class=\"mt-2\">\n <a @click=\"remembered\">{{ __('auth.forget.remembered') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && !sms\" class=\"forget-thanks-mesage\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"mt-2 close-button\">\n <a @click=\"close\">{{ __('auth.forget.close') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && sms\" class=\"forget-thanks-mesage schema-col\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"sms-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" v-model=\"code1\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code1 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code2\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code2 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code3\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code3 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code4\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code4 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n </div>\n <p class=\"help is-danger\" v-html=\"error\" v-if=\"error\"></p>\n </div>\n <div class=\"actions-wrapper\">\n <button class=\"button\" v-bind:class=\"{ 'is-loading': loading }\" @click=\"smsReset\">{{ __('auth.forget.sms_reset_password') }}</button>\n <button class=\"button\" @click=\"more\">{{ __('auth.forget.sms_more') }}</button>\n <button class=\"button\" @click=\"remembered\">{{ __('auth.forget.remembered') }}</button>\n </div>\n </div>\n <div v-show=\"sent && error && !sms\" class=\"forget-error-mesage\">\n <div class=\"message\" v-html=\"error\"></div>\n <div class=\"mt-2\">\n <a @click=\"again\">{{ __('auth.forget.send') }}</a>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, getCurrentInstance, inject } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'forget',\n components: {\n SchemaForm\n },\n props: {\n email: {\n type: String,\n default: ''\n },\n emailOrPhone: {\n type: String,\n default: ''\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const message = ref('');\n const error = ref('');\n const sent = ref(false);\n const schema = ref({});\n const model = ref({});\n const sms = ref(false);\n const code1 = ref('');\n const code2 = ref('');\n const code3 = ref('');\n const code4 = ref('');\n const instance = getCurrentInstance();\n\n const s = {\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n emailOrPhone: {\n component: FormText,\n label: __('auth.login.form.emailOrPhone'),\n placeholder: props.showPlaceholders ? __('auth.login.form.emailOrPhone') : '',\n }\n };\n\n const yupValidations = {\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n emailOrPhone: yup\n .string()\n .required(__('auth.validation.required'))\n .test('test-name', __('auth.validation.emailOrPhone'), function (value) {\n const emailRegex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n const phoneRegex = /^(?:\\+38)?(?:\\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/;\n\n let isValidEmail = emailRegex.test(value);\n let isValidPhone = phoneRegex.test(value);\n\n if (!isValidEmail && !isValidPhone) {\n return false;\n }\n\n return true;\n })\n };\n\n schema.value[props.forgetType] = s[props.forgetType];\n model.value[props.forgetType] = props[props.forgetType];\n\n let currentYupValidation = {};\n currentYupValidation[props.forgetType] = yupValidations[props.forgetType];\n\n const validation = yup.object().shape(currentYupValidation);\n\n useSchemaForm(model);\n\n const remembered = () => {\n store.commit('auth/modal', 'login');\n };\n\n const more = () => {\n sms.value = false;\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n message.value = '';\n sent.value = false;\n };\n\n const again = () => {\n sent.value = false;\n };\n\n const onSubmit = () => {\n loading.value = true;\n message.value = '';\n error.value = '';\n\n store.dispatch('auth/reset', {\n credentials: model.value,\n callback: (m, isError, response) => {\n if (!isError) {\n message.value = m;\n sms.value = response?.credentials == 'phone';\n } else {\n error.value = m;\n }\n },\n finally: () => {\n model.value = {};\n loading.value = false;\n sent.value = true;\n key.value++;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n };\n\n const codeKeyUp = (e) => {\n const nextElement = e.target.nextElementSibling;\n const prevElement = e.target.previousElementSibling;\n const isNextElementIsInput = nextElement && nextElement.tagName === 'INPUT';\n const isPrevElementIsInput = prevElement && prevElement.tagName === 'INPUT';\n\n if (e.keyCode >= 48 && e.keyCode <= 57) {\n error.value = '';\n\n if (isNextElementIsInput) {\n nextElement.focus();\n }\n }\n\n if (e.keyCode === 8) {\n error.value = '';\n\n if (e.target.value === '') {\n if (isPrevElementIsInput) {\n prevElement.focus();\n }\n }\n }\n\n // if (e.keyCode == 37) {\n // if (isPrevElementIsInput) {\n // prevElement.focus();\n // }\n // }\n\n // if (e.keyCode == 39) {\n // if (isNextElementIsInput) {\n // nextElement.focus();\n // }\n // }\n };\n\n const codePaste = (e) => {\n e.preventDefault();\n\n const value = e.clipboardData.getData('Text');\n\n if (value.length == 4) {\n if (!isNaN(value[0]) && !isNaN(value[1]) && !isNaN(value[2]) && !isNaN(value[3])) {\n code1.value = value[0];\n code2.value = value[1];\n code3.value = value[2];\n code4.value = value[3];\n\n error.value = '';\n }\n }\n };\n\n const presetedResetToken = inject('presetedResetToken');\n const presetedResetEmail = inject('presetedResetEmail');\n\n const smsReset = () => {\n if (code1.value === '' || code2.value === '' || code3.value === '' || code4.value === '') {\n error.value = __('auth.validation.required');\n } else {\n loading.value = true;\n error.value = '';\n\n store.dispatch('auth/resetSms', {\n credentials: {\n code: String(code1.value) + String(code2.value) + String(code3.value) + String(code4.value)\n },\n callback: (m, isError) => {\n if (!isError) {\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n\n presetedResetToken.value = m.token;\n presetedResetEmail.value = m.email;\n\n store.commit('auth/modal', 'reset');\n } else {\n error.value = m.message;\n }\n },\n finally: () => {\n loading.value = false;\n key.value++;\n }\n });\n }\n };\n\n return {\n loading,\n key,\n schema,\n validation,\n remembered,\n onSubmit,\n again,\n sent,\n message,\n error,\n close,\n sms,\n code1,\n code2,\n code3,\n code4,\n codeKeyUp,\n codePaste,\n more,\n smsReset\n };\n }\n};\n</script>"],"names":["markRaw","FormText","name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","email","type","String","emailOrPhone","forgetType","showPlaceholders","Boolean","setup","loading","ref","store","useStore","key","message","error","sent","schema","model","sms","code1","code2","code3","code4","getCurrentInstance","s","component","label","__","placeholder","yupValidations","yup","string","required","test","value","isValidEmail","isValidPhone","currentYupValidation","validation","object","shape","useSchemaForm","presetedResetToken","inject","presetedResetEmail","remembered","commit","onSubmit","dispatch","credentials","callback","m","isError","response","again","close","codeKeyUp","e","nextElement","target","nextElementSibling","prevElement","previousElementSibling","isNextElementIsInput","tagName","isPrevElementIsInput","keyCode","focus","codePaste","preventDefault","clipboardData","getData","length","isNaN","more","smsReset","code","token","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_ctx","_createVNode","schemaRowClasses","$setup","afterForm","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","onClick","_hoisted_7","innerHTML","_hoisted_9","_hoisted_10","_hoisted_12","_hoisted_13","onKeyup","$event","onPaste","_hoisted_15","_hoisted_16","_hoisted_18"],"mappings":"6jBA4DAA,UAAQC,WAER,MAEe,CACXC,KAAM,SACNC,WAAY,CACRC,WALWC,oBAAkB,CAACC,UAAkB,OAOpDC,MAAO,CACHC,MAAO,CACHC,KAAMC,eACG,IAEbC,aAAc,CACVF,KAAMC,eACG,IAEbE,WAAY,CACRH,KAAMC,eACG,SAEbG,iBAAkB,CACdJ,KAAMK,iBACG,IAGjBC,eAAMR,OACIS,EAAUC,OAAI,GACdC,EAAQC,aACRC,EAAMH,MAAI,GACVI,EAAUJ,MAAI,IACdK,EAAQL,MAAI,IACZM,EAAON,OAAI,GACXO,EAASP,MAAI,IACbQ,EAAQR,MAAI,IACZS,EAAMT,OAAI,GACVU,EAAQV,MAAI,IACZW,EAAQX,MAAI,IACZY,EAAQZ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gEAAlDA,YAAmEa,uCAAOb,YAAUc,KAAUC,uCAAOf,YAAUc,8BAA/Gd,YAAgB,wBAC1DL,8BAAO/E,KAAK,+BAAa,0BAAmEoF,gEAAlDA,YAAmEa,uCAAOb,YAAUc,KAAUC,yCAAOf,YAAUc,8BAA/Gd,YAAgB,wBAC1DL,8BAAO/E,KAAK,+BAAa,0BAAmEoF,kEAAlDA,YAAmEa,yCAAOb,YAAUc,KAAUC,yCAAOf,YAAUc,8BAA/Gd,YAAgB,SAEfA,uBAA/CP,sCAAS,iBAAiBe,UAAQR,sDAEtCL,2BAAAqB,GACIrB,uDAAc,uBAAuCK,aAAYM,wCAAON,+DAAaH,2CACrFF,qCAAc,SAAUW,wCAAON,uDAASH,iCACxCF,qCAAc,SAAUW,wCAAON,mEAAeH,qDAdzCG,QAAQA,WAAWA,0BAiBhCL,2BAAAsB,GACItB,kCAAW,UAAUa,UAAQR,mBAC7BL,2BAAAuB,GACIvB,0BAAIW,wCAAON,yDAAUH,+CAHhBG,QAAQA,UAAUA"}
1
+ {"version":3,"file":"Forget.js","sources":["../../../src/components/auth/Forget.vue","../../../src/components/auth/Forget.vue?vue&type=template&id=01249924&lang.js"],"sourcesContent":["<template>\n <div class=\"form auth-forget\">\n <div class=\"title\">{{ __('auth.forget.title') }}</div>\n <div v-show=\"!sent\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.forget.form.submit') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n <div class=\"mt-2\">\n <a @click=\"remembered\">{{ __('auth.forget.remembered') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && !sms\" class=\"forget-thanks-mesage\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"mt-2 close-button\">\n <a @click=\"close\">{{ __('auth.forget.close') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && sms\" class=\"forget-thanks-mesage schema-col\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"sms-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" v-model=\"code1\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code1 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code2\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code2 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code3\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code3 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code4\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code4 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n </div>\n <p class=\"help is-danger\" v-html=\"error\" v-if=\"error\"></p>\n </div>\n <div class=\"actions-wrapper\">\n <button class=\"button\" v-bind:class=\"{ 'is-loading': loading }\" @click=\"smsReset\">{{ __('auth.forget.sms_reset_password') }}</button>\n <button class=\"button\" @click=\"more\">{{ __('auth.forget.sms_more') }}</button>\n <button class=\"button\" @click=\"remembered\">{{ __('auth.forget.remembered') }}</button>\n </div>\n </div>\n <div v-show=\"sent && error && !sms\" class=\"forget-error-mesage\">\n <div class=\"message\" v-html=\"error\"></div>\n <div class=\"mt-2\">\n <a @click=\"again\">{{ __('auth.forget.send') }}</a>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, getCurrentInstance, inject } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'forget',\n components: {\n SchemaForm\n },\n props: {\n email: {\n type: String,\n default: ''\n },\n emailOrPhone: {\n type: String,\n default: ''\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const message = ref('');\n const error = ref('');\n const sent = ref(false);\n const schema = ref({});\n const model = ref({});\n const sms = ref(false);\n const code1 = ref('');\n const code2 = ref('');\n const code3 = ref('');\n const code4 = ref('');\n const instance = getCurrentInstance();\n\n const s = {\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n emailOrPhone: {\n component: FormText,\n label: __('auth.login.form.emailOrPhone'),\n placeholder: props.showPlaceholders ? __('auth.login.form.emailOrPhone') : '',\n }\n };\n\n const yupValidations = {\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n emailOrPhone: yup\n .string()\n .required(__('auth.validation.required'))\n .test('test-name', __('auth.validation.emailOrPhone'), function (value) {\n const emailRegex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n const phoneRegex = /^(?:\\+38)?(?:\\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/;\n\n let isValidEmail = emailRegex.test(value);\n let isValidPhone = phoneRegex.test(value);\n\n if (!isValidEmail && !isValidPhone) {\n return false;\n }\n\n return true;\n })\n };\n\n schema.value[props.forgetType] = s[props.forgetType];\n model.value[props.forgetType] = props[props.forgetType];\n\n let currentYupValidation = {};\n currentYupValidation[props.forgetType] = yupValidations[props.forgetType];\n\n const validation = yup.object().shape(currentYupValidation);\n\n useSchemaForm(model);\n\n const remembered = () => {\n store.commit('auth/modal', 'login');\n };\n\n const more = () => {\n sms.value = false;\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n message.value = '';\n sent.value = false;\n };\n\n const again = () => {\n sent.value = false;\n };\n\n const onSubmit = () => {\n loading.value = true;\n message.value = '';\n error.value = '';\n\n store.dispatch('auth/reset', {\n credentials: model.value,\n callback: (m, isError, response) => {\n if (!isError) {\n message.value = m;\n sms.value = response?.credentials == 'phone';\n } else {\n error.value = m;\n }\n },\n finally: () => {\n model.value = {};\n loading.value = false;\n sent.value = true;\n key.value++;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n };\n\n const codeKeyUp = (e) => {\n const nextElement = e.target.nextElementSibling;\n const prevElement = e.target.previousElementSibling;\n const isNextElementIsInput = nextElement && nextElement.tagName === 'INPUT';\n const isPrevElementIsInput = prevElement && prevElement.tagName === 'INPUT';\n\n if (e.keyCode >= 48 && e.keyCode <= 57) {\n error.value = '';\n\n if (isNextElementIsInput) {\n nextElement.focus();\n }\n }\n\n if (e.keyCode === 8) {\n error.value = '';\n\n if (e.target.value === '') {\n if (isPrevElementIsInput) {\n prevElement.focus();\n }\n }\n }\n\n // if (e.keyCode == 37) {\n // if (isPrevElementIsInput) {\n // prevElement.focus();\n // }\n // }\n\n // if (e.keyCode == 39) {\n // if (isNextElementIsInput) {\n // nextElement.focus();\n // }\n // }\n };\n\n const codePaste = (e) => {\n e.preventDefault();\n\n const value = e.clipboardData.getData('Text');\n\n if (value.length == 4) {\n if (!isNaN(value[0]) && !isNaN(value[1]) && !isNaN(value[2]) && !isNaN(value[3])) {\n code1.value = value[0];\n code2.value = value[1];\n code3.value = value[2];\n code4.value = value[3];\n\n error.value = '';\n }\n }\n };\n\n const presetedResetToken = inject('presetedResetToken');\n const presetedResetEmail = inject('presetedResetEmail');\n\n const smsReset = () => {\n if (code1.value === '' || code2.value === '' || code3.value === '' || code4.value === '') {\n error.value = __('auth.validation.required');\n } else {\n loading.value = true;\n error.value = '';\n\n store.dispatch('auth/resetSms', {\n credentials: {\n code: String(code1.value) + String(code2.value) + String(code3.value) + String(code4.value)\n },\n callback: (m, isError) => {\n if (!isError) {\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n\n presetedResetToken.value = m.token;\n presetedResetEmail.value = m.email;\n\n store.commit('auth/modal', 'reset');\n } else {\n error.value = m.message;\n }\n },\n finally: () => {\n loading.value = false;\n key.value++;\n }\n });\n }\n };\n\n return {\n loading,\n key,\n schema,\n validation,\n remembered,\n onSubmit,\n again,\n sent,\n message,\n error,\n close,\n sms,\n code1,\n code2,\n code3,\n code4,\n codeKeyUp,\n codePaste,\n more,\n smsReset\n };\n }\n};\n</script>","<template>\n <div class=\"form auth-forget\">\n <div class=\"title\">{{ __('auth.forget.title') }}</div>\n <div v-show=\"!sent\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.forget.form.submit') }}\n </button>\n </div>\n </div>\n </div>\n </template>\n </SchemaForm>\n <div class=\"mt-2\">\n <a @click=\"remembered\">{{ __('auth.forget.remembered') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && !sms\" class=\"forget-thanks-mesage\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"mt-2 close-button\">\n <a @click=\"close\">{{ __('auth.forget.close') }}</a>\n </div>\n </div>\n <div v-show=\"sent && message && sms\" class=\"forget-thanks-mesage schema-col\">\n <div v-html=\"message\" class=\"thanks-message\"></div>\n <div class=\"sms-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" v-model=\"code1\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code1 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code2\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code2 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code3\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code3 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n <input type=\"text\" class=\"input\" v-model=\"code4\" v-maska=\"'#'\" v-bind:class=\"{ 'is-filled': code4 !== '' }\" @keyup=\"codeKeyUp($event)\" @paste=\"codePaste($event)\" />\n </div>\n <p class=\"help is-danger\" v-html=\"error\" v-if=\"error\"></p>\n </div>\n <div class=\"actions-wrapper\">\n <button class=\"button\" v-bind:class=\"{ 'is-loading': loading }\" @click=\"smsReset\">{{ __('auth.forget.sms_reset_password') }}</button>\n <button class=\"button\" @click=\"more\">{{ __('auth.forget.sms_more') }}</button>\n <button class=\"button\" @click=\"remembered\">{{ __('auth.forget.remembered') }}</button>\n </div>\n </div>\n <div v-show=\"sent && error && !sms\" class=\"forget-error-mesage\">\n <div class=\"message\" v-html=\"error\"></div>\n <div class=\"mt-2\">\n <a @click=\"again\">{{ __('auth.forget.send') }}</a>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, markRaw, getCurrentInstance, inject } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'forget',\n components: {\n SchemaForm\n },\n props: {\n email: {\n type: String,\n default: ''\n },\n emailOrPhone: {\n type: String,\n default: ''\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const message = ref('');\n const error = ref('');\n const sent = ref(false);\n const schema = ref({});\n const model = ref({});\n const sms = ref(false);\n const code1 = ref('');\n const code2 = ref('');\n const code3 = ref('');\n const code4 = ref('');\n const instance = getCurrentInstance();\n\n const s = {\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n emailOrPhone: {\n component: FormText,\n label: __('auth.login.form.emailOrPhone'),\n placeholder: props.showPlaceholders ? __('auth.login.form.emailOrPhone') : '',\n }\n };\n\n const yupValidations = {\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n emailOrPhone: yup\n .string()\n .required(__('auth.validation.required'))\n .test('test-name', __('auth.validation.emailOrPhone'), function (value) {\n const emailRegex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n const phoneRegex = /^(?:\\+38)?(?:\\((044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)\\)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[ .-]?[0-9]{3}[ .-]?[0-9]{2}[ .-]?[0-9]{2}|(044|050|067|066|095|099|063|073|093|068|096|097|098|091|092|094)[0-9]{7})$/;\n\n let isValidEmail = emailRegex.test(value);\n let isValidPhone = phoneRegex.test(value);\n\n if (!isValidEmail && !isValidPhone) {\n return false;\n }\n\n return true;\n })\n };\n\n schema.value[props.forgetType] = s[props.forgetType];\n model.value[props.forgetType] = props[props.forgetType];\n\n let currentYupValidation = {};\n currentYupValidation[props.forgetType] = yupValidations[props.forgetType];\n\n const validation = yup.object().shape(currentYupValidation);\n\n useSchemaForm(model);\n\n const remembered = () => {\n store.commit('auth/modal', 'login');\n };\n\n const more = () => {\n sms.value = false;\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n message.value = '';\n sent.value = false;\n };\n\n const again = () => {\n sent.value = false;\n };\n\n const onSubmit = () => {\n loading.value = true;\n message.value = '';\n error.value = '';\n\n store.dispatch('auth/reset', {\n credentials: model.value,\n callback: (m, isError, response) => {\n if (!isError) {\n message.value = m;\n sms.value = response?.credentials == 'phone';\n } else {\n error.value = m;\n }\n },\n finally: () => {\n model.value = {};\n loading.value = false;\n sent.value = true;\n key.value++;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n };\n\n const codeKeyUp = (e) => {\n const nextElement = e.target.nextElementSibling;\n const prevElement = e.target.previousElementSibling;\n const isNextElementIsInput = nextElement && nextElement.tagName === 'INPUT';\n const isPrevElementIsInput = prevElement && prevElement.tagName === 'INPUT';\n\n if (e.keyCode >= 48 && e.keyCode <= 57) {\n error.value = '';\n\n if (isNextElementIsInput) {\n nextElement.focus();\n }\n }\n\n if (e.keyCode === 8) {\n error.value = '';\n\n if (e.target.value === '') {\n if (isPrevElementIsInput) {\n prevElement.focus();\n }\n }\n }\n\n // if (e.keyCode == 37) {\n // if (isPrevElementIsInput) {\n // prevElement.focus();\n // }\n // }\n\n // if (e.keyCode == 39) {\n // if (isNextElementIsInput) {\n // nextElement.focus();\n // }\n // }\n };\n\n const codePaste = (e) => {\n e.preventDefault();\n\n const value = e.clipboardData.getData('Text');\n\n if (value.length == 4) {\n if (!isNaN(value[0]) && !isNaN(value[1]) && !isNaN(value[2]) && !isNaN(value[3])) {\n code1.value = value[0];\n code2.value = value[1];\n code3.value = value[2];\n code4.value = value[3];\n\n error.value = '';\n }\n }\n };\n\n const presetedResetToken = inject('presetedResetToken');\n const presetedResetEmail = inject('presetedResetEmail');\n\n const smsReset = () => {\n if (code1.value === '' || code2.value === '' || code3.value === '' || code4.value === '') {\n error.value = __('auth.validation.required');\n } else {\n loading.value = true;\n error.value = '';\n\n store.dispatch('auth/resetSms', {\n credentials: {\n code: String(code1.value) + String(code2.value) + String(code3.value) + String(code4.value)\n },\n callback: (m, isError) => {\n if (!isError) {\n code1.value = '';\n code2.value = '';\n code3.value = '';\n code4.value = '';\n\n presetedResetToken.value = m.token;\n presetedResetEmail.value = m.email;\n\n store.commit('auth/modal', 'reset');\n } else {\n error.value = m.message;\n }\n },\n finally: () => {\n loading.value = false;\n key.value++;\n }\n });\n }\n };\n\n return {\n loading,\n key,\n schema,\n validation,\n remembered,\n onSubmit,\n again,\n sent,\n message,\n error,\n close,\n sms,\n code1,\n code2,\n code3,\n code4,\n codeKeyUp,\n codePaste,\n more,\n smsReset\n };\n }\n};\n</script>"],"names":["markRaw","FormText","name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","email","type","String","emailOrPhone","forgetType","showPlaceholders","Boolean","setup","loading","ref","store","useStore","key","message","error","sent","schema","model","sms","code1","code2","code3","code4","getCurrentInstance","s","component","label","__","placeholder","yupValidations","yup","string","required","test","value","isValidEmail","isValidPhone","currentYupValidation","validation","object","shape","useSchemaForm","presetedResetToken","inject","presetedResetEmail","remembered","commit","onSubmit","dispatch","credentials","callback","m","isError","response","again","close","codeKeyUp","e","nextElement","target","nextElementSibling","prevElement","previousElementSibling","isNextElementIsInput","tagName","isPrevElementIsInput","keyCode","focus","codePaste","preventDefault","clipboardData","getData","length","isNaN","more","smsReset","code","token","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_ctx","_createBlock","schemaRowClasses","$setup","afterForm","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","onClick","_hoisted_7","innerHTML","_hoisted_9","_hoisted_10","_hoisted_12","_hoisted_13","onKeyup","$event","onPaste","_hoisted_15","_hoisted_16","_hoisted_18"],"mappings":"6jBA4DAA,UAAQC,WAER,MAEe,CACXC,KAAM,SACNC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GAO3BF,2BAAAU,GACIV,0BAAIW,sCAAON,mEAAeH,sDAfpBG,2BAkBdL,2BAAAY,GACIZ,4BAAKa,UAAQR,gBAAe,4BAC5BL,2BAAAc,GACId,0BAAIW,sCAAON,yDAAUH,gDAHhBG,QAAQA,YAAYA,0BAMjCL,2BAAAe,GACIf,4BAAKa,UAAQR,gBAAe,4BAC5BL,2BAAAgB,GACIhB,2BAAAiB,oBACIjB,8BAAO/E,KAAK,+BAAa,0BAAmEoF,gEAAlDA,YAAmEa,uCAAOb,YAAUc,KAAUC,uCAAOf,YAAUc,8BAA/Gd,YAAgB,wBAC1DL,8BAAO/E,KAAK,+BAAa,0BAAmEoF,gEAAlDA,YAAmEa,uCAAOb,YAAUc,KAAUC,uCAAOf,YAAUc,8BAA/Gd,YAAgB,wBAC1DL,8BAAO/E,KAAK,+BAAa,0BAAmEoF,gEAAlDA,YAAmEa,uCAAOb,YAAUc,KAAUC,yCAAOf,YAAUc,8BAA/Gd,YAAgB,wBAC1DL,8BAAO/E,KAAK,+BAAa,0BAAmEoF,kEAAlDA,YAAmEa,yCAAOb,YAAUc,KAAUC,yCAAOf,YAAUc,8BAA/Gd,YAAgB,SAEfA,uBAA/CP,sCAAS,iBAAiBe,UAAQR,sDAEtCL,2BAAAqB,GACIrB,uDAAc,uBAAuCK,aAAYM,wCAAON,+DAAaH,2CACrFF,qCAAc,SAAUW,wCAAON,uDAASH,iCACxCF,qCAAc,SAAUW,wCAAON,mEAAeH,qDAdzCG,QAAQA,WAAWA,0BAiBhCL,2BAAAsB,GACItB,kCAAW,UAAUa,UAAQR,mBAC7BL,2BAAAuB,GACIvB,0BAAIW,wCAAON,yDAAUH,+CAHhBG,QAAQA,UAAUA"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),o=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),n=require("@perevorot/shop/dist/forms/FormPassword"),l=require("yup");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var s=i(r),u=i(a),d=i(n),m=c(l);function f(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var r,a,n=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(n.push(r.value),!t||n.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}e.markRaw(u.default);var h=o.SchemaFormFactory([s.default({})]),v={props:f({loginCallback:{type:Function,default:function(){}},forgetType:{type:String,default:"email"},showPlaceholders:{type:Boolean,default:!1}},"showPlaceholders",{type:Boolean,default:!1}),name:"login",components:{SchemaForm:h},setup:function(r){var a,n=e.ref(!1),l=t.useStore(),i=e.ref(0),c=e.ref({}),s=e.computed((function(){return l.getters["auth/modal"]})),p=e.ref({email:{component:u.default,label:__("auth.login.form.email"),store:"login",model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""},password:{component:d.default,label:__("auth.login.form.password"),placeholder:r.showPlaceholders?__("auth.login.form.password"):""}}),h=m.object().shape({email:m.string().email(__("auth.validation.email")).required(__("auth.validation.required")),password:m.string().required(__("auth.validation.required"))}),v=e.ref({email:"",password:""});o.useSchemaForm(v);return f(a={loading:n,modal:s,schema:p,validation:h,reset:function(){l.commit("auth/modal","forget")},facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})}},"schema",p),f(a,"onSubmit",(function(){n.value=!0,l.dispatch("auth/login",{credentials:v.value,callback:function(e){if(r.loginCallback&&r.loginCallback(),window.authUserLoginCallback&&window.authUserLoginCallback(),e.data&&e.data.user&&!e.data.user.is_login_tracked){var t={event:"login",user_id:e.data.user.id,method:"site"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}},finally:function(){n.value=!1},catch:function(e){if(e.response.data&&e.response.data.errors){for(var t=0,o=Object.entries(e.response.data.errors);t<o.length;t++){var r=g(o[t],2),a=r[0],n=r[1];n[0]&&(c.value[a]=n[0])}v.value.password="",i.value++}}})})),f(a,"errors",c),f(a,"key",i),f(a,"model",v),f(a,"register",(function(){l.commit("auth/modal","registration")})),a}},b={class:"auth-login"},y={class:"title"},w={class:"href-forget-password"},_={class:"field"},k={class:"socials"},E={class:"description has-text-centered"},N={class:"buttons"},S=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],V=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],C={class:"href-register"};v.render=function(t,o,r,a,n,l){var i=e.resolveComponent("SchemaForm"),c=e.resolveComponent("forget");return e.openBlock(),e.createElementBlock("div",b,[e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",y,e.toDisplayString(t.__("auth.login.title")),1),e.createVNode(i,{schemaRowClasses:"field",schema:a.schema,"validation-schema":a.validation,"initial-errors":a.errors,key:a.key,onSubmit:a.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",w,[e.createElementVNode("a",{onClick:o[0]||(o[0]=function(){return a.reset&&a.reset.apply(a,arguments)})},e.toDisplayString(t.__("auth.login.forget_password")),1)]),e.createElementVNode("div",_,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":a.loading}]),type:"submit"},e.toDisplayString(t.__("auth.login.form.submit")),3)]),e.createElementVNode("div",k,[e.createElementVNode("div",E,e.toDisplayString(t.__("auth.login.socials")),1),e.createElementVNode("div",N,[e.createElementVNode("a",{class:"button",onClick:o[1]||(o[1]=function(){return a.facebook&&a.facebook.apply(a,arguments)})},S),e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return a.google&&a.google.apply(a,arguments)})},V)])]),e.createElementVNode("div",C,[e.createElementVNode("a",{onClick:o[3]||(o[3]=function(){return a.register&&a.register.apply(a,arguments)})},e.toDisplayString(t.__("auth.login.signup")),1)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"])],512),[[e.vShow,"login"==a.modal]]),"forget"==a.modal?(e.openBlock(),e.createBlock(c,{key:0,email:a.model.email,"forget-type":r.forgetType,"show-placeholders":r.showPlaceholders},null,8,["email","forget-type","show-placeholders"])):e.createCommentVNode("v-if",!0)])},module.exports=v;
1
+ "use strict";var e=require("vue"),t=require("vuex"),o=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),n=require("@perevorot/shop/dist/forms/FormPassword"),l=require("yup");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var s=i(r),u=i(a),d=i(n),m=c(l);function f(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var r,a,n=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(n.push(r.value),!t||n.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}e.markRaw(u.default);var h=o.SchemaFormFactory([s.default({})]),v={props:f({loginCallback:{type:Function,default:function(){}},forgetType:{type:String,default:"email"},showPlaceholders:{type:Boolean,default:!1}},"showPlaceholders",{type:Boolean,default:!1}),name:"login",components:{SchemaForm:h},setup:function(r){var a,n=e.ref(!1),l=t.useStore(),i=e.ref(0),c=e.ref({}),s=e.computed((function(){return l.getters["auth/modal"]})),p=e.ref({email:{component:u.default,label:__("auth.login.form.email"),store:"login",model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""},password:{component:d.default,label:__("auth.login.form.password"),placeholder:r.showPlaceholders?__("auth.login.form.password"):""}}),h=m.object().shape({email:m.string().email(__("auth.validation.email")).required(__("auth.validation.required")),password:m.string().required(__("auth.validation.required"))}),v=e.ref({email:"",password:""});o.useSchemaForm(v);return f(a={loading:n,modal:s,schema:p,validation:h,reset:function(){l.commit("auth/modal","forget")},facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})}},"schema",p),f(a,"onSubmit",(function(){n.value=!0,l.dispatch("auth/login",{credentials:v.value,callback:function(e){if(r.loginCallback&&r.loginCallback(),window.authUserLoginCallback&&window.authUserLoginCallback(),e.data&&e.data.user&&!e.data.user.is_login_tracked){var t={event:"login",user_id:e.data.user.id,method:"site"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}},finally:function(){n.value=!1},catch:function(e){if(e.response.data&&e.response.data.errors){for(var t=0,o=Object.entries(e.response.data.errors);t<o.length;t++){var r=g(o[t],2),a=r[0],n=r[1];n[0]&&(c.value[a]=n[0])}v.value.password="",i.value++}}})})),f(a,"errors",c),f(a,"key",i),f(a,"model",v),f(a,"register",(function(){l.commit("auth/modal","registration")})),a}},b={class:"auth-login"},y={class:"title"},w={class:"href-forget-password"},k={class:"field"},_={class:"socials"},E={class:"description has-text-centered"},S={class:"buttons"},N=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],V=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],C={class:"href-register"};v.render=function(t,o,r,a,n,l){var i=e.resolveComponent("SchemaForm"),c=e.resolveComponent("forget");return e.openBlock(),e.createElementBlock("div",b,[e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",y,e.toDisplayString(t.__("auth.login.title")),1),(e.openBlock(),e.createBlock(i,{schemaRowClasses:"field",schema:a.schema,"validation-schema":a.validation,"initial-errors":a.errors,key:a.key,onSubmit:a.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",w,[e.createElementVNode("a",{onClick:o[0]||(o[0]=function(){return a.reset&&a.reset.apply(a,arguments)})},e.toDisplayString(t.__("auth.login.forget_password")),1)]),e.createElementVNode("div",k,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":a.loading}]),type:"submit"},e.toDisplayString(t.__("auth.login.form.submit")),3)]),e.createElementVNode("div",_,[e.createElementVNode("div",E,e.toDisplayString(t.__("auth.login.socials")),1),e.createElementVNode("div",S,[e.createElementVNode("a",{class:"button",onClick:o[1]||(o[1]=function(){return a.facebook&&a.facebook.apply(a,arguments)})},N),e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return a.google&&a.google.apply(a,arguments)})},V)])]),e.createElementVNode("div",C,[e.createElementVNode("a",{onClick:o[3]||(o[3]=function(){return a.register&&a.register.apply(a,arguments)})},e.toDisplayString(t.__("auth.login.signup")),1)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],512),[[e.vShow,"login"==a.modal]]),"forget"==a.modal?(e.openBlock(),e.createBlock(c,{key:0,email:a.model.email,"forget-type":r.forgetType,"show-placeholders":r.showPlaceholders},null,8,["email","forget-type","show-placeholders"])):e.createCommentVNode("v-if",!0)])},module.exports=v;
2
2
  //# sourceMappingURL=Login.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Login.js","sources":["../../../src/components/auth/Login.vue","../../../src/components/auth/Login.vue?vue&type=template&id=11762c76&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\" :forget-type=\"forgetType\" :show-placeholders=\"showPlaceholders\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: {\n type: Function,\n default: () => { }\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password'),\n placeholder: props.showPlaceholders ? __('auth.login.form.password') : '',\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: (response) => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n\n if (window.authUserLoginCallback) {\n window.authUserLoginCallback();\n }\n\n if (response.data && response.data.user && !response.data.user.is_login_tracked) {\n let object = {\n event: 'login',\n user_id: response.data.user.id,\n method: 'site'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n },\n finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>","<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\" :forget-type=\"forgetType\" :show-placeholders=\"showPlaceholders\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: {\n type: Function,\n default: () => { }\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password'),\n placeholder: props.showPlaceholders ? __('auth.login.form.password') : '',\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: (response) => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n\n if (window.authUserLoginCallback) {\n window.authUserLoginCallback();\n }\n\n if (response.data && response.data.user && !response.data.user.is_login_tracked) {\n let object = {\n event: 'login',\n user_id: response.data.user.id,\n method: 'site'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n },\n finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>"],"names":["markRaw","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","loginCallback","type","Function","forgetType","String","showPlaceholders","Boolean","name","components","setup","loading","ref","store","useStore","key","errors","modal","computed","getters","schema","email","component","label","__","model","placeholder","password","FormPassword","validation","yup","object","shape","string","required","useSchemaForm","reset","commit","facebook","window","location","href","$ziggy","provider","google","value","dispatch","credentials","callback","response","authUserLoginCallback","data","user","is_login_tracked","event","user_id","id","method","$env","debug","ecommerce","console","log","dataLayer","push","error","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","_createVNode","schemaRowClasses","$setup","onSubmit","afterForm","_hoisted_3","onClick","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_14","_createBlock","$props"],"mappings":"isDAgDAA,UAAQC,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAEzC,CACXC,SACIC,cAAe,CACXC,KAAMC,iBACG,cAEbC,WAAY,CACRF,KAAMG,eACG,SAEbC,iBAAkB,CACdJ,KAAMK,iBACG,uBAEK,CACdL,KAAMK,iBACG,IAGjBC,KAAM,QACNC,WAAY,CACRZ,WAAAA,GAEJa,eAAMV,SACIW,EAAUC,OAAI,GACdC,EAAQC,aACRC,EAAMH,MAAI,GACVI,EAASJ,MAAI,IACbK,EAAQC,YAAS,kBAAML,EAAMM,QAAQ,iBAErCC,EAASR,MAAI,CACfS,MAAO,CACHC,UAAW1B,UACX2B,MAAOC,GAAG,yBACVX,MAAO,QACPY,MAAO,QACPC,YAAa1B,EAAMM,iBAAmBkB,GAAG,yBAA2B,IAExEG,SAAU,CACNL,UAAWM,UACXL,MAAOC,GAAG,4BACVE,YAAa1B,EAAMM,iBAAmBkB,GAAG,4BAA8B,MAIzEK,EAAaC,EAAIC,SAASC,MAAM,CAClCX,MAAOS,EAAIG,SAASZ,MAAMG,GAAG,0BAA0BU,SAASV,GAAG,6BACnEG,SAAUG,EAAIG,SAASC,SAASV,GAAG,+BAGjCC,EAAQb,MAAI,CACdS,MAAO,GACPM,SAAU,KAGdQ,gBAAcV,eA4EVd,QAAAA,EACAM,MAAAA,EACAG,OAAAA,EACAS,WAAAA,EACAO,MA9EU,WACVvB,EAAMwB,OAAO,aAAc,WA8E3B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C,SAAQD,aACpHE,qBACP,kBAAAT,2BAAAU,GACIV,0BAAIW,sCAAOJ,yDAAUH,yCAEzBJ,2BAAAY,GACIZ,uDAAc,+BAA6DO,aAA5C3E,KAAK,4BAAqDwE,qCAE7FJ,2BAAAa,GACIb,2BAAAc,oBAA8CV,+BAC9CJ,2BAAAe,GACIf,gCAAS,SAAUW,sCAAOJ,gDAM1BP,gCAAS,SAAUW,sCAAOJ,gDAQlCP,2BAAAgB,GACIhB,0BAAIW,sCAAOJ,+DAAaH,gIA5B3BG,qBAkCCA,uBAAdU,uBAAkClE,MAAOwD,QAAMxD,oBAAqBmE,iCAAgCA"}
1
+ {"version":3,"file":"Login.js","sources":["../../../src/components/auth/Login.vue","../../../src/components/auth/Login.vue?vue&type=template&id=11762c76&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\" :forget-type=\"forgetType\" :show-placeholders=\"showPlaceholders\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: {\n type: Function,\n default: () => { }\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password'),\n placeholder: props.showPlaceholders ? __('auth.login.form.password') : '',\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: (response) => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n\n if (window.authUserLoginCallback) {\n window.authUserLoginCallback();\n }\n\n if (response.data && response.data.user && !response.data.user.is_login_tracked) {\n let object = {\n event: 'login',\n user_id: response.data.user.id,\n method: 'site'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n },\n finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>","<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\" :forget-type=\"forgetType\" :show-placeholders=\"showPlaceholders\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: {\n type: Function,\n default: () => { }\n },\n forgetType: {\n type: String,\n default: 'email'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password'),\n placeholder: props.showPlaceholders ? __('auth.login.form.password') : '',\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: (response) => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n\n if (window.authUserLoginCallback) {\n window.authUserLoginCallback();\n }\n\n if (response.data && response.data.user && !response.data.user.is_login_tracked) {\n let object = {\n event: 'login',\n user_id: response.data.user.id,\n method: 'site'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n },\n finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>"],"names":["markRaw","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","loginCallback","type","Function","forgetType","String","showPlaceholders","Boolean","name","components","setup","loading","ref","store","useStore","key","errors","modal","computed","getters","schema","email","component","label","__","model","placeholder","password","FormPassword","validation","yup","object","shape","string","required","useSchemaForm","reset","commit","facebook","window","location","href","$ziggy","provider","google","value","dispatch","credentials","callback","response","authUserLoginCallback","data","user","is_login_tracked","event","user_id","id","method","$env","debug","ecommerce","console","log","dataLayer","push","error","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","_createBlock","schemaRowClasses","$setup","onSubmit","afterForm","_hoisted_3","onClick","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_14","$props"],"mappings":"isDAgDAA,UAAQC,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAEzC,CACXC,SACIC,cAAe,CACXC,KAAMC,iBACG,cAEbC,WAAY,CACRF,KAAMG,eACG,SAEbC,iBAAk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ate/plugin-vee-validate"),a=require("@perevorot/shop/dist/api"),n=require("@perevorot/shop/dist/helpers"),i=require("secure-ls");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(o),c=l(i);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,a,n=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var m={name:"registration",components:{SchemaForm:r.SchemaFormFactory([s.default({})])},setup:function(){var o,i=t.useStore(),l=e.ref(!1),s=e.ref(!0),d=e.ref(0),m=e.ref({}),f=e.ref(!1),v=e.ref(""),h=e.ref({}),g=e.ref({}),p=e.ref({});r.useSchemaForm(p);return a.auth.registerForm().then((function(e){if(e.data){var t=n.formParse(e.data);o=t.model,h.value=t.schema,p.value=t.model,g.value=t.validation,v.value=e.data.type}})).finally((function(){s.value=!1})),{loading:l,loadingForm:s,key:d,errors:m,schema:h,validation:g,onSubmit:function(){l.value=!0,i.dispatch("auth/register",{type:v.value?v.value.charAt(0).toUpperCase()+v.value.slice(1):"",credentials:p.value,finally:function(){l.value=!1},callback:function(e){if(e.data&&e.data.user_id){var t={event:"sign_up",user_id:e.data.user_id,method:"site"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}f.value=!0,p.value=o,d.value++;var r=new c.default({isCompression:!1}),a=r.get("forms");a.registration&&(a.registration={}),r.set("forms",a)},catch:function(e){var t={};if(e.response.data&&e.response.data.errors){for(var r=0,o=Object.entries(e.response.data.errors);r<o.length;r++){var a=u(o[r],2),n=a[0],i=a[1];i[0]&&(t[n]=i[0])}d.value++}m.value=t}})},facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},thanks:f,model:p,close:function(){i.commit("auth/modal",null),i.dispatch("auth/me")},type:v,login:function(){i.commit("auth/modal","login")}}}},f={key:0,class:"auth-registration"},v={class:"title"},h={class:"field"},g={class:"socials"},p={class:"description has-text-centered"},y={class:"buttons"},b=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],k=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],E={class:"href-already-register"},N={class:"mt-3"};m.render=function(t,r,o,a,n,i){var l=e.resolveComponent("SchemaForm");return a.loadingForm?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("div",v,e.toDisplayString(t.__("auth.registration.title")),1),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(a.model.user_type?"is-user-type-"+a.model.user_type.replaceAll("_","-"):null)},[e.createVNode(l,{schemaRowClasses:"field",schema:a.schema,"validation-schema":a.validation,"initial-errors":a.errors,key:a.key,onSubmit:a.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",h,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":a.loading}]),type:"submit"},e.toDisplayString(t.__("auth.registration.form.submit"+("short"==a.type?"_short":""))),3)]),e.createElementVNode("div",g,[e.createElementVNode("div",p,e.toDisplayString(t.__("auth.login.socials")),1),e.createElementVNode("div",y,[e.createElementVNode("a",{class:"button",onClick:r[0]||(r[0]=function(){return a.facebook&&a.facebook.apply(a,arguments)})},b),e.createElementVNode("a",{class:"button",onClick:r[1]||(r[1]=function(){return a.google&&a.google.apply(a,arguments)})},k)])]),e.createElementVNode("div",E,[e.createElementVNode("a",{onClick:r[2]||(r[2]=function(){return a.login&&a.login.apply(a,arguments)})},e.toDisplayString(t.__("auth.registration.already")),1)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"])],2),[[e.vShow,!a.thanks]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",null,e.toDisplayString(t.__("auth.registration.thanks"+("short"==a.type?"_short":""),{email:a.model.email})),1),e.createElementVNode("div",N,[e.createElementVNode("button",{class:"button",onClick:r[3]||(r[3]=function(){return a.close&&a.close.apply(a,arguments)})},e.toDisplayString(t.__("auth.registration.continue")),1)])],512),[[e.vShow,a.thanks]])]))},module.exports=m;
1
+ "use strict";var e=require("vue"),t=require("vuex"),r=require("formvuelate"),o=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/api"),n=require("@perevorot/shop/dist/helpers"),i=require("secure-ls");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(o),c=l(i);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,a,n=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var m={name:"registration",components:{SchemaForm:r.SchemaFormFactory([s.default({})])},setup:function(){var o,i=t.useStore(),l=e.ref(!1),s=e.ref(!0),d=e.ref(0),m=e.ref({}),f=e.ref(!1),v=e.ref(""),h=e.ref({}),g=e.ref({}),p=e.ref({});r.useSchemaForm(p);return a.auth.registerForm().then((function(e){if(e.data){var t=n.formParse(e.data);o=t.model,h.value=t.schema,p.value=t.model,g.value=t.validation,v.value=e.data.type}})).finally((function(){s.value=!1})),{loading:l,loadingForm:s,key:d,errors:m,schema:h,validation:g,onSubmit:function(){l.value=!0,i.dispatch("auth/register",{type:v.value?v.value.charAt(0).toUpperCase()+v.value.slice(1):"",credentials:p.value,finally:function(){l.value=!1},callback:function(e){if(e.data&&e.data.user_id){var t={event:"sign_up",user_id:e.data.user_id,method:"site"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}f.value=!0,p.value=o,d.value++;var r=new c.default({isCompression:!1}),a=r.get("forms");a.registration&&(a.registration={}),r.set("forms",a)},catch:function(e){var t={};if(e.response.data&&e.response.data.errors){for(var r=0,o=Object.entries(e.response.data.errors);r<o.length;r++){var a=u(o[r],2),n=a[0],i=a[1];i[0]&&(t[n]=i[0])}d.value++}m.value=t}})},facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},thanks:f,model:p,close:function(){i.commit("auth/modal",null),i.dispatch("auth/me")},type:v,login:function(){i.commit("auth/modal","login")}}}},f={key:0,class:"auth-registration"},v={class:"title"},h={class:"field"},g={class:"socials"},p={class:"description has-text-centered"},y={class:"buttons"},b=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],k=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],E={class:"href-already-register"},N={class:"mt-3"};m.render=function(t,r,o,a,n,i){var l=e.resolveComponent("SchemaForm");return a.loadingForm?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("div",v,e.toDisplayString(t.__("auth.registration.title")),1),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(a.model.user_type?"is-user-type-"+a.model.user_type.replaceAll("_","-"):null)},[(e.openBlock(),e.createBlock(l,{schemaRowClasses:"field",schema:a.schema,"validation-schema":a.validation,"initial-errors":a.errors,key:a.key,onSubmit:a.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",h,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":a.loading}]),type:"submit"},e.toDisplayString(t.__("auth.registration.form.submit"+("short"==a.type?"_short":""))),3)]),e.createElementVNode("div",g,[e.createElementVNode("div",p,e.toDisplayString(t.__("auth.login.socials")),1),e.createElementVNode("div",y,[e.createElementVNode("a",{class:"button",onClick:r[0]||(r[0]=function(){return a.facebook&&a.facebook.apply(a,arguments)})},b),e.createElementVNode("a",{class:"button",onClick:r[1]||(r[1]=function(){return a.google&&a.google.apply(a,arguments)})},k)])]),e.createElementVNode("div",E,[e.createElementVNode("a",{onClick:r[2]||(r[2]=function(){return a.login&&a.login.apply(a,arguments)})},e.toDisplayString(t.__("auth.registration.already")),1)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],2),[[e.vShow,!a.thanks]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",null,e.toDisplayString(t.__("auth.registration.thanks"+("short"==a.type?"_short":""),{email:a.model.email})),1),e.createElementVNode("div",N,[e.createElementVNode("button",{class:"button",onClick:r[3]||(r[3]=function(){return a.close&&a.close.apply(a,arguments)})},e.toDisplayString(t.__("auth.registration.continue")),1)])],512),[[e.vShow,a.thanks]])]))},module.exports=m;
2
2
  //# sourceMappingURL=Registration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Registration.js","sources":["../../../src/components/auth/Registration.vue","../../../src/components/auth/Registration.vue?vue&type=template&id=5718b73a&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-registration\" v-if=\"!loadingForm\">\n <div class=\"title\">{{ __('auth.registration.title') }}</div>\n <div v-show=\"!thanks\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.registration.form.submit' + (type == 'short' ? '_short' : '')) }}\n </button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">\n {{ __('auth.login.socials') }}\n </div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\"><svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-already-register\">\n <a @click=\"login\">{{ __('auth.registration.already') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div>\n {{\n __('auth.registration.thanks' + (type == 'short' ? '_short' : ''), {\n email: model.email\n })\n }}\n </div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close\">\n {{ __('auth.registration.continue') }}\n </button>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\nimport SecureLS from 'secure-ls';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'registration',\n components: {\n SchemaForm\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const key = ref(0);\n const errors = ref({});\n const thanks = ref(false);\n const type = ref('');\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n\n let emptyModel;\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/register', {\n type: type.value ? type.value.charAt(0).toUpperCase() + type.value.slice(1) : '',\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: (response) => {\n if (response.data && response.data.user_id) {\n let object = {\n event: 'sign_up',\n user_id: response.data.user_id,\n method: 'site',\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n\n model.value = emptyModel;\n\n key.value++;\n\n let ls = new SecureLS({\n isCompression: false\n });\n\n let forms = ls.get('forms');\n\n if (forms.registration) {\n forms.registration = {};\n }\n\n ls.set('forms', forms);\n },\n catch: (error) => {\n let incomingErrors = {};\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n incomingErrors[field] = messages[0];\n }\n }\n\n key.value++;\n }\n\n errors.value = incomingErrors;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const login = () => {\n store.commit('auth/modal', 'login');\n };\n\n api.registerForm()\n .then((response) => {\n if (response.data) {\n const form = formParse(response.data);\n\n emptyModel = form.model;\n\n schema.value = form.schema;\n model.value = form.model;\n validation.value = form.validation;\n\n type.value = response.data.type;\n }\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n key,\n errors,\n schema,\n validation,\n onSubmit,\n facebook,\n google,\n thanks,\n model,\n close,\n type,\n login\n };\n }\n};\n</script>","<template>\n <div class=\"auth-registration\" v-if=\"!loadingForm\">\n <div class=\"title\">{{ __('auth.registration.title') }}</div>\n <div v-show=\"!thanks\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.registration.form.submit' + (type == 'short' ? '_short' : '')) }}\n </button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">\n {{ __('auth.login.socials') }}\n </div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\"><svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-already-register\">\n <a @click=\"login\">{{ __('auth.registration.already') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div>\n {{\n __('auth.registration.thanks' + (type == 'short' ? '_short' : ''), {\n email: model.email\n })\n }}\n </div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close\">\n {{ __('auth.registration.continue') }}\n </button>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\nimport SecureLS from 'secure-ls';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'registration',\n components: {\n SchemaForm\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const key = ref(0);\n const errors = ref({});\n const thanks = ref(false);\n const type = ref('');\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n\n let emptyModel;\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/register', {\n type: type.value ? type.value.charAt(0).toUpperCase() + type.value.slice(1) : '',\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: (response) => {\n if (response.data && response.data.user_id) {\n let object = {\n event: 'sign_up',\n user_id: response.data.user_id,\n method: 'site',\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n\n model.value = emptyModel;\n\n key.value++;\n\n let ls = new SecureLS({\n isCompression: false\n });\n\n let forms = ls.get('forms');\n\n if (forms.registration) {\n forms.registration = {};\n }\n\n ls.set('forms', forms);\n },\n catch: (error) => {\n let incomingErrors = {};\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n incomingErrors[field] = messages[0];\n }\n }\n\n key.value++;\n }\n\n errors.value = incomingErrors;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const login = () => {\n store.commit('auth/modal', 'login');\n };\n\n api.registerForm()\n .then((response) => {\n if (response.data) {\n const form = formParse(response.data);\n\n emptyModel = form.model;\n\n schema.value = form.schema;\n model.value = form.model;\n validation.value = form.validation;\n\n type.value = response.data.type;\n }\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n key,\n errors,\n schema,\n validation,\n onSubmit,\n facebook,\n google,\n thanks,\n model,\n close,\n type,\n login\n };\n }\n};\n</script>"],"names":["name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","setup","emptyModel","store","useStore","loading","ref","loadingForm","key","errors","thanks","type","schema","validation","model","useSchemaForm","api","registerForm","then","response","data","form","formParse","value","onSubmit","dispatch","charAt","toUpperCase","slice","credentials","callback","user_id","object","event","method","$env","debug","ecommerce","console","log","window","dataLayer","push","ls","SecureLS","isCompression","forms","get","registration","set","error","incomingErrors","Object","entries","field","messages","facebook","location","href","$ziggy","provider","google","close","commit","login","_createElementVNode","$setup","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","user_type","replaceAll","_createVNode","schemaRowClasses","afterForm","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","onClick","_hoisted_13","_hoisted_14"],"mappings":"4wCA4DA,MAEe,CACXA,KAAM,eACNC,WAAY,CACRC,WALWC,oBAAkB,CAACC,UAAkB,OAOpDC,qBAYQC,EAXEC,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAcD,OAAI,GAClBE,EAAMF,MAAI,GACVG,EAASH,MAAI,IACbI,EAASJ,OAAI,GACbK,EAAOL,MAAI,IACXM,EAASN,MAAI,IACbO,EAAaP,MAAI,IACjBQ,EAAQR,MAAI,IAIlBS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C,EAAIe,QAGRd,EAAOc,MAAQ4B,MAoDvBK,SA1Ca,WACbhB,OAAOiB,SAASC,KAAOC,OAAO,oBAAqB,CAC/CC,SAAU,cAyCdC,OArCW,WACXrB,OAAOiB,SAASC,KAAOC,OAAO,oBAAqB,CAC/CC,SAAU,YAoCdlD,OAAAA,EACAI,MAAAA,EACAgD,MAnDU,WACV3D,EAAM4D,OAAO,aAAc,MAC3B5D,EAAMsB,SAAS,YAkDfd,KAAAA,EACAqD,MApCU,WACV7D,EAAM4D,OAAO,aAAc,4BCtKxB,8BACI,kBAIY,kBAKA,oBACI,0CAGA,cAEHE,kCAAW,gBACPA,yCAAgB,6BAEpBA,iCAAM,mBAEwBA,kCAAW,oBACrCA,yCAAgB,2BAEpBA,iCAAM,uBAIP,kCAcR,qFA1CmBC,6DAAtCC,2BAAAC,GACIH,2BAAAI,oBAAsBC,qDACtBL,mDAAoCC,QAAMK,0BAA8BL,QAAMK,UAAUC,4BACpFC,iBAAYC,iBAAiB,QAAS9D,OAAQsD,6BAA4BA,8BAA6BA,SAAS1D,IAAK0D,MAAM1C,SAAQ0C,aACpHS,qBACP,kBAAAV,2BAAAW,GACIX,uDAAc,+BAA6DC,aAA5CvD,KAAK,4BAC7B2D,+CAAsCJ,2BAGjDD,2BAAAY,GACIZ,2BAAAa,oBACOR,+BAEPL,2BAAAc,GACId,gCAAS,SAAUe,sCAAOd,gDAM1BD,gCAAS,SAAUe,sCAAOd,gDAOlCD,2BAAAgB,GACIhB,0BAAIe,sCAAOd,yDAAUI,8HA3BvBJ,6BAgCdD,iCACIA,kDAEIK,0CAAiCJ,+CAKrCD,2BAAAiB,GACIjB,qCAAc,SAAUe,sCAAOd,yDACxBI,yDAVFJ"}
1
+ {"version":3,"file":"Registration.js","sources":["../../../src/components/auth/Registration.vue","../../../src/components/auth/Registration.vue?vue&type=template&id=5718b73a&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-registration\" v-if=\"!loadingForm\">\n <div class=\"title\">{{ __('auth.registration.title') }}</div>\n <div v-show=\"!thanks\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.registration.form.submit' + (type == 'short' ? '_short' : '')) }}\n </button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">\n {{ __('auth.login.socials') }}\n </div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\"><svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-already-register\">\n <a @click=\"login\">{{ __('auth.registration.already') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div>\n {{\n __('auth.registration.thanks' + (type == 'short' ? '_short' : ''), {\n email: model.email\n })\n }}\n </div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close\">\n {{ __('auth.registration.continue') }}\n </button>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\nimport SecureLS from 'secure-ls';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'registration',\n components: {\n SchemaForm\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const key = ref(0);\n const errors = ref({});\n const thanks = ref(false);\n const type = ref('');\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n\n let emptyModel;\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/register', {\n type: type.value ? type.value.charAt(0).toUpperCase() + type.value.slice(1) : '',\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: (response) => {\n if (response.data && response.data.user_id) {\n let object = {\n event: 'sign_up',\n user_id: response.data.user_id,\n method: 'site',\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n\n model.value = emptyModel;\n\n key.value++;\n\n let ls = new SecureLS({\n isCompression: false\n });\n\n let forms = ls.get('forms');\n\n if (forms.registration) {\n forms.registration = {};\n }\n\n ls.set('forms', forms);\n },\n catch: (error) => {\n let incomingErrors = {};\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n incomingErrors[field] = messages[0];\n }\n }\n\n key.value++;\n }\n\n errors.value = incomingErrors;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const login = () => {\n store.commit('auth/modal', 'login');\n };\n\n api.registerForm()\n .then((response) => {\n if (response.data) {\n const form = formParse(response.data);\n\n emptyModel = form.model;\n\n schema.value = form.schema;\n model.value = form.model;\n validation.value = form.validation;\n\n type.value = response.data.type;\n }\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n key,\n errors,\n schema,\n validation,\n onSubmit,\n facebook,\n google,\n thanks,\n model,\n close,\n type,\n login\n };\n }\n};\n</script>","<template>\n <div class=\"auth-registration\" v-if=\"!loadingForm\">\n <div class=\"title\">{{ __('auth.registration.title') }}</div>\n <div v-show=\"!thanks\" v-bind:class=\"model.user_type ? 'is-user-type-' + model.user_type.replaceAll('_', '-') : null\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.registration.form.submit' + (type == 'short' ? '_short' : '')) }}\n </button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">\n {{ __('auth.login.socials') }}\n </div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\"><svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-already-register\">\n <a @click=\"login\">{{ __('auth.registration.already') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div>\n {{\n __('auth.registration.thanks' + (type == 'short' ? '_short' : ''), {\n email: model.email\n })\n }}\n </div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close\">\n {{ __('auth.registration.continue') }}\n </button>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport { formParse } from '@perevorot/shop/dist/helpers';\nimport SecureLS from 'secure-ls';\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n name: 'registration',\n components: {\n SchemaForm\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n const loadingForm = ref(true);\n const key = ref(0);\n const errors = ref({});\n const thanks = ref(false);\n const type = ref('');\n const schema = ref({});\n const validation = ref({});\n const model = ref({});\n\n let emptyModel;\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/register', {\n type: type.value ? type.value.charAt(0).toUpperCase() + type.value.slice(1) : '',\n credentials: model.value,\n finally: () => {\n loading.value = false;\n },\n callback: (response) => {\n if (response.data && response.data.user_id) {\n let object = {\n event: 'sign_up',\n user_id: response.data.user_id,\n method: 'site',\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n thanks.value = true;\n\n model.value = emptyModel;\n\n key.value++;\n\n let ls = new SecureLS({\n isCompression: false\n });\n\n let forms = ls.get('forms');\n\n if (forms.registration) {\n forms.registration = {};\n }\n\n ls.set('forms', forms);\n },\n catch: (error) => {\n let incomingErrors = {};\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n incomingErrors[field] = messages[0];\n }\n }\n\n key.value++;\n }\n\n errors.value = incomingErrors;\n }\n });\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const login = () => {\n store.commit('auth/modal', 'login');\n };\n\n api.registerForm()\n .then((response) => {\n if (response.data) {\n const form = formParse(response.data);\n\n emptyModel = form.model;\n\n schema.value = form.schema;\n model.value = form.model;\n validation.value = form.validation;\n\n type.value = response.data.type;\n }\n })\n .finally(() => {\n loadingForm.value = false;\n });\n\n return {\n loading,\n loadingForm,\n key,\n errors,\n schema,\n validation,\n onSubmit,\n facebook,\n google,\n thanks,\n model,\n close,\n type,\n login\n };\n }\n};\n</script>"],"names":["name","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","setup","emptyModel","store","useStore","loading","ref","loadingForm","key","errors","thanks","type","schema","validation","model","useSchemaForm","api","registerForm","then","response","data","form","formParse","value","onSubmit","dispatch","charAt","toUpperCase","slice","credentials","callback","user_id","object","event","method","$env","debug","ecommerce","console","log","window","dataLayer","push","ls","SecureLS","isCompression","forms","get","registration","set","error","incomingErrors","Object","entries","field","messages","facebook","location","href","$ziggy","provider","google","close","commit","login","_createElementVNode","$setup","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","user_type","replaceAll","_createBlock","schemaRowClasses","afterForm","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","onClick","_hoisted_13","_hoisted_14"],"mappings":"4wCA4DA,MAEe,CACXA,KAAM,eACNC,WAAY,CACRC,WALWC,oBAAkB,CAACC,UAAkB,OAOpDC,qBAYQC,EAXEC,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAcD,OAAI,GAClBE,EAAMF,MAAI,GACVG,EAASH,MAAI,IACbI,EAASJ,OAAI,GACbK,EAAOL,MAAI,IACXM,EAASN,MAAI,IACbO,EAAaP,MAAI,IACjBQ,EAAQR,MAAI,IAIlBS,gBAAcD,UAyFdE,OAAIC,eACCC,MAAK,SAACC,MACCA,EAASC,KAAM,KACTC,EAAOC,YAAUH,EAASC,MAEhClB,EAAamB,EAAKP,MAElBF,EAAOW,MAAQF,EAAKT,OACpBE,EAAMS,MAAQF,EAAKP,MACnBD,EAAWU,MAAQF,EAAKR,WAExBF,EAAKY,MAAQJ,EAASC,KAAKT,kBAG1B,WACLJ,EAAYgB,OAAQ,KAGrB,CACHlB,QAAAA,EACAE,YAAAA,EACAC,IAAAA,EACAC,OAAAA,EACAG,OAAAA,EACAC,WAAAA,EACAW,SAhHa,WACbnB,EAAQkB,OAAQ,EAEhBpB,EAAMsB,SAAS,gBAAiB,CA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