@perevorot/shop 2.0.144 → 2.0.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t={auth:{me:function(){return $http.post($ziggy("auth.me"))},login:function(t){return $http.post($ziggy("auth.login"),t)},logout:function(){return $http.post($ziggy("auth.logout"))},reset:function(t){return $http.post($ziggy("auth.password.email"),t)},resetSms:function(t){return $http.post($ziggy("auth.password.sms"),t)},passwordUpdate:function(t){return $http.post($ziggy("auth.password.update"),t)},registerShort:function(t){return $http.post($ziggy("auth.register.short"),t)},registerFull:function(t){return $http.post($ziggy("auth.register.full"),t)},registerForm:function(){return $http.post($ziggy("auth.register.form"))},update:function(t){return $http.post($ziggy("auth.register.update"),t)}},cart:{items:function(t){return $http.post($ziggy("api.cart"),{action:"get",storage:t})},add:function(t,i){return $http.post($ziggy("api.cart"),{action:"add",id:t.id,quantity:t.quantity,options:!!t.options&&t.options,extra:!!t.extra&&t.extra,storage:i})},options:function(t,i){return $http.post($ziggy("api.cart"),{action:"options",id:t.id,options:t.options,storage:i})},addBundle:function(t){return $http.post($ziggy("api.cart"),{action:"addBundle",id:t.id,second:t.second,third:t.third})},remove:function(t,i){return $http.post($ziggy("api.cart"),{action:"remove",id:t,storage:i})},clear:function(t){return $http.post($ziggy("api.cart"),{action:"clear",storage:t})},quantity:function(t,i){return $http.post($ziggy("api.cart"),{action:"quantity",id:t.id,exact:t.exact,storage:i})}},compare:{items:function(){return $http.post($ziggy("api.compare"),{action:"get"})},category:function(t){return $http.post($ziggy("api.compare"),{action:"category",slug:t})},toggle:function(t){return $http.post($ziggy("api.compare"),{action:"toggle",id:t})},delete:function(t){return $http.post($ziggy("api.compare"),{action:"delete",id:t})},modal:function(t){return $http.post($ziggy("api.compare"),{action:"modal",id:t})}},shop:{search:function(t){return $http.post($ziggy("api.search"),{term:t})}},wishlist:{items:function(){return $http.post($ziggy("api.wishlist"),{action:"get"})},toggle:function(t){return $http.post($ziggy("api.wishlist"),{action:"toggle",id:t})}}};module.exports=t;
1
+ "use strict";var t={auth:{me:function(){return $http.post($ziggy("auth.me"))},login:function(t){return $http.post($ziggy("auth.login"),t)},logout:function(){return $http.post($ziggy("auth.logout"))},reset:function(t){return $http.post($ziggy("auth.password.email"),t)},resetSms:function(t){return $http.post($ziggy("auth.password.sms"),t)},passwordUpdate:function(t){return $http.post($ziggy("auth.password.update"),t)},registerShort:function(t){return $http.post($ziggy("auth.register.short"),t)},registerFull:function(t){return $http.post($ziggy("auth.register.full"),t)},registerForm:function(t){return $http.post($ziggy("auth.register.form"),t?{store:t}:{})},update:function(t){return $http.post($ziggy("auth.register.update"),t)}},cart:{items:function(t){return $http.post($ziggy("api.cart"),{action:"get",storage:t})},add:function(t,i){return $http.post($ziggy("api.cart"),{action:"add",id:t.id,quantity:t.quantity,options:!!t.options&&t.options,extra:!!t.extra&&t.extra,storage:i})},options:function(t,i){return $http.post($ziggy("api.cart"),{action:"options",id:t.id,options:t.options,storage:i})},addBundle:function(t){return $http.post($ziggy("api.cart"),{action:"addBundle",id:t.id,second:t.second,third:t.third})},remove:function(t,i){return $http.post($ziggy("api.cart"),{action:"remove",id:t,storage:i})},clear:function(t){return $http.post($ziggy("api.cart"),{action:"clear",storage:t})},quantity:function(t,i){return $http.post($ziggy("api.cart"),{action:"quantity",id:t.id,exact:t.exact,storage:i})}},compare:{items:function(){return $http.post($ziggy("api.compare"),{action:"get"})},category:function(t){return $http.post($ziggy("api.compare"),{action:"category",slug:t})},toggle:function(t){return $http.post($ziggy("api.compare"),{action:"toggle",id:t})},delete:function(t){return $http.post($ziggy("api.compare"),{action:"delete",id:t})},modal:function(t){return $http.post($ziggy("api.compare"),{action:"modal",id:t})}},shop:{search:function(t){return $http.post($ziggy("api.search"),{term:t})}},wishlist:{items:function(){return $http.post($ziggy("api.wishlist"),{action:"get"})},toggle:function(t){return $http.post($ziggy("api.wishlist"),{action:"toggle",id:t})}}};module.exports=t;
2
2
  //# sourceMappingURL=api.js.map
package/dist/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sources":["../src/api/modules/auth.js","../src/api/index.js","../src/api/modules/cart.js","../src/api/modules/compare.js","../src/api/modules/shop.js","../src/api/modules/wishlist.js"],"sourcesContent":["export default {\n me() {\n return $http.post($ziggy('auth.me'));\n },\n login(credentials) {\n return $http.post($ziggy('auth.login'), credentials);\n },\n logout() {\n return $http.post($ziggy('auth.logout'));\n },\n reset(credentials) {\n return $http.post($ziggy('auth.password.email'), credentials);\n },\n resetSms(credentials) {\n return $http.post($ziggy('auth.password.sms'), credentials);\n },\n passwordUpdate(credentials) {\n return $http.post($ziggy('auth.password.update'), credentials);\n },\n registerShort(credentials) {\n return $http.post($ziggy('auth.register.short'), credentials);\n },\n registerFull(credentials) {\n return $http.post($ziggy('auth.register.full'), credentials);\n },\n registerForm() {\n return $http.post($ziggy('auth.register.form'));\n },\n update(credentials) {\n return $http.post($ziggy('auth.register.update'), credentials);\n },\n};\n","import auth from './modules/auth';\nimport cart from './modules/cart';\nimport compare from './modules/compare';\nimport shop from './modules/shop';\nimport wishlist from './modules/wishlist';\n\nexport default {\n auth,\n cart,\n compare,\n shop,\n wishlist\n};","export default {\n items(cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'get',\n storage: cart,\n });\n },\n\n add(item, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'add',\n id: item.id,\n quantity: item.quantity,\n options: item.options ? item.options : false,\n extra: item.extra ? item.extra : false,\n storage: cart,\n });\n },\n\n options(item, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'options',\n id: item.id,\n options: item.options,\n storage: cart,\n });\n },\n\n addBundle(item) {\n return $http.post($ziggy('api.cart'), {\n action: 'addBundle',\n id: item.id,\n second: item.second,\n third: item.third,\n });\n },\n\n remove(id, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'remove',\n id: id,\n storage: cart,\n });\n },\n\n clear(cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'clear',\n storage: cart,\n });\n },\n\n quantity(item, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'quantity',\n id: item.id,\n exact: item.exact,\n storage: cart,\n });\n },\n};\n","export default {\n items() {\n return $http.post($ziggy('api.compare'), {\n action: 'get',\n });\n },\n\n category(slug) {\n return $http.post($ziggy('api.compare'), {\n action: 'category',\n slug: slug,\n });\n },\n\n toggle(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'toggle',\n id: id,\n });\n },\n\n delete(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'delete',\n id: id,\n });\n },\n modal(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'modal',\n id: id,\n });\n },\n};\n","export default {\n search(term) {\n return $http.post($ziggy(\"api.search\"), {\n term: term,\n });\n },\n}","export default {\n items() {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"get\",\n });\n },\n\n toggle(id) {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"toggle\",\n id: id\n });\n },\n}"],"names":["auth","me","$http","post","$ziggy","login","credentials","logout","reset","resetSms","passwordUpdate","registerShort","registerFull","registerForm","update","cart","items","action","storage","add","item","id","quantity","options","extra","addBundle","second","third","remove","clear","exact","compare","category","slug","toggle","modal","shop","search","term","wishlist"],"mappings":"aAAA,MCMe,CACXA,KDPW,CACXC,qBACWC,MAAMC,KAAKC,OAAO,aAE7BC,eAAMC,UACKJ,MAAMC,KAAKC,OAAO,cAAeE,IAE5CC,yBACWL,MAAMC,KAAKC,OAAO,iBAE7BI,eAAMF,UACKJ,MAAMC,KAAKC,OAAO,uBAAwBE,IAErDG,kBAASH,UACEJ,MAAMC,KAAKC,OAAO,qBAAsBE,IAEnDI,wBAAeJ,UACJJ,MAAMC,KAAKC,OAAO,wBAAyBE,IAEtDK,uBAAcL,UACHJ,MAAMC,KAAKC,OAAO,uBAAwBE,IAErDM,sBAAaN,UACFJ,MAAMC,KAAKC,OAAO,sBAAuBE,IA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C,KAAKC,OAAO,eAAgB,CACrCa,OAAQ,QACRI,GAAIA,MFpBZe,KGVW,CACXC,gBAAOC,UACIpC,MAAMC,KAAKC,OAAO,cAAe,CACpCkC,KAAMA,MHQdC,SIXW,CACXvB,wBACWd,MAAMC,KAAKC,OAAO,gBAAiB,CACtCa,OAAQ,SAIhBiB,gBAAOb,UACInB,MAAMC,KAAKC,OAAO,gBAAiB,CACtCa,OAAQ,SACRI,GAAIA"}
1
+ {"version":3,"file":"api.js","sources":["../src/api/modules/auth.js","../src/api/index.js","../src/api/modules/cart.js","../src/api/modules/compare.js","../src/api/modules/shop.js","../src/api/modules/wishlist.js"],"sourcesContent":["export default {\n me() {\n return $http.post($ziggy('auth.me'));\n },\n login(credentials) {\n return $http.post($ziggy('auth.login'), credentials);\n },\n logout() {\n return $http.post($ziggy('auth.logout'));\n },\n reset(credentials) {\n return $http.post($ziggy('auth.password.email'), credentials);\n },\n resetSms(credentials) {\n return $http.post($ziggy('auth.password.sms'), credentials);\n },\n passwordUpdate(credentials) {\n return $http.post($ziggy('auth.password.update'), credentials);\n },\n registerShort(credentials) {\n return $http.post($ziggy('auth.register.short'), credentials);\n },\n registerFull(credentials) {\n return $http.post($ziggy('auth.register.full'), credentials);\n },\n registerForm(store) {\n return $http.post(\n $ziggy('auth.register.form'),\n store\n ? {\n store: store,\n }\n : {}\n );\n },\n update(credentials) {\n return $http.post($ziggy('auth.register.update'), credentials);\n },\n};\n","import auth from './modules/auth';\nimport cart from './modules/cart';\nimport compare from './modules/compare';\nimport shop from './modules/shop';\nimport wishlist from './modules/wishlist';\n\nexport default {\n auth,\n cart,\n compare,\n shop,\n wishlist\n};","export default {\n items(cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'get',\n storage: cart,\n });\n },\n\n add(item, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'add',\n id: item.id,\n quantity: item.quantity,\n options: item.options ? item.options : false,\n extra: item.extra ? item.extra : false,\n storage: cart,\n });\n },\n\n options(item, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'options',\n id: item.id,\n options: item.options,\n storage: cart,\n });\n },\n\n addBundle(item) {\n return $http.post($ziggy('api.cart'), {\n action: 'addBundle',\n id: item.id,\n second: item.second,\n third: item.third,\n });\n },\n\n remove(id, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'remove',\n id: id,\n storage: cart,\n });\n },\n\n clear(cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'clear',\n storage: cart,\n });\n },\n\n quantity(item, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'quantity',\n id: item.id,\n exact: item.exact,\n storage: cart,\n });\n },\n};\n","export default {\n items() {\n return $http.post($ziggy('api.compare'), {\n action: 'get',\n });\n },\n\n category(slug) {\n return $http.post($ziggy('api.compare'), {\n action: 'category',\n slug: slug,\n });\n },\n\n toggle(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'toggle',\n id: id,\n });\n },\n\n delete(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'delete',\n id: id,\n });\n },\n modal(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'modal',\n id: id,\n });\n },\n};\n","export default {\n search(term) {\n return $http.post($ziggy(\"api.search\"), {\n term: term,\n });\n },\n}","export default {\n items() {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"get\",\n });\n },\n\n toggle(id) {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"toggle\",\n id: id\n });\n },\n}"],"names":["auth","me","$http","post","$ziggy","login","credentials","logout","reset","resetSms","passwordUpdate","registerShort","registerFull","registerForm","store","update","cart","items","action","storage","add","item","id","quantity","options","extra","addBundle","second","third","remove","clear","exact","compare","category","slug","toggle","modal","shop","search","term","wishlist"],"mappings":"aAAA,MCMe,CACXA,KDPW,CACXC,qBACWC,MAAMC,KAAKC,OAAO,aAE7BC,eAAMC,UACKJ,MAAMC,KAAKC,OAAO,cAAeE,IAE5CC,yBACWL,MAAMC,KAAKC,OAAO,iBAE7BI,eAAMF,UACKJ,M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KC,OAAO,eAAgB,CACrCc,OAAQ,SAIhBe,kBAASC,UACEhC,MAAMC,KAAKC,OAAO,eAAgB,CACrCc,OAAQ,WACRgB,KAAMA,KAIdC,gBAAOb,UACIpB,MAAMC,KAAKC,OAAO,eAAgB,CACrCc,OAAQ,SACRI,GAAIA,qBAILA,UACIpB,MAAMC,KAAKC,OAAO,eAAgB,CACrCc,OAAQ,SACRI,GAAIA,KAGZc,eAAMd,UACKpB,MAAMC,KAAKC,OAAO,eAAgB,CACrCc,OAAQ,QACRI,GAAIA,MFpBZe,KGVW,CACXC,gBAAOC,UACIrC,MAAMC,KAAKC,OAAO,cAAe,CACpCmC,KAAMA,MHQdC,SIXW,CACXvB,wBACWf,MAAMC,KAAKC,OAAO,gBAAiB,CACtCc,OAAQ,SAIhBiB,gBAAOb,UACIpB,MAAMC,KAAKC,OAAO,gBAAiB,CACtCc,OAAQ,SACRI,GAAIA"}
@@ -1,2 +1,2 @@
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){if(e.response.data&&e.response.data.errors){for(var t=0,r=Object.entries(e.response.data.errors);t<r.length;t++){var o=u(r[t],2),a=o[0],n=o[1];n[0]&&(m.value[a]=n[0])}d.value++}}})},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;
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=40b43442&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 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 key.value++;\n }\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 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 key.value++;\n }\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","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,UAqFdE,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,SA5Ga,WACbnB,EAAQkB,OAAQ,EAEhBpB,EAAMsB,SAAS,gBAAiB,CAC5Bd,KAAMA,EAAKY,MAAQZ,EAAKY,MAAMG,OAAO,GAAGC,cAAgBhB,EAAKY,MAAMK,MAAM,GAAK,GAC9EC,YAAaf,EAAMS,cACV,WACLlB,EAAQkB,OAAQ,GAEpBO,SAAU,SAACX,MACHA,EAASC,MAAQD,EAASC,KAAKW,QAAS,KACpCC,EAAS,CACTC,MAAO,UACPF,QAASZ,EAASC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AAV,2BAAAW,GACIX,uDAAc,+BAA6DC,aAA5CtD,KAAK,4BAC7B0D,+CAAsCJ,2BAGjDD,2BAAAY,GACIZ,2BAAAa,oBACOR,+BAEPL,2BAAAc,GACId,gCAAS,SAAUe,sCAAOd,gDAM1BD,gCAAS,SAAUe,sCAAOd,gDAOlCD,2BAAAgB,GACIhB,0BAAIe,sCAAOd,yDAAUI,+HA3BvBJ,6BAgCdD,iCACIA,kDAEQK,0CAAiCJ,+CAKzCD,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,I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",setup:function(){var n=t.useStore(),o=e.computed((function(){return n.getters["auth/me"]})),u=e.computed((function(){return n.getters["auth/modal"]})),r=e.computed((function(){return Object.keys(o.value).length>0})),a=e.ref(!1),l=e.computed((function(){return n.getters["auth/account"]})),s=function(){n.commit("auth/modal",null),n.dispatch("auth/me")};o.value?a.value=!0:n.dispatch("auth/me",{finally:function(){a.value=!0}});return window.addEventListener("keyup",(function(e){u.value&&"Escape"===e.key&&s()})),{mounted:a,user:o,logged:r,modal:u,open:function(){n.commit("auth/modal","login")},close:s,routes:l,logout:function(){n.dispatch("auth/logout")}}}},o={key:0,class:"auth-user"},u={key:1,class:"auth-user is-logged"},r={class:"dropdown is-right is-hoverable"},a={class:"dropdown-trigger"},l=["href"],s=e.createElementVNode("i",{class:"fas fa-user"},null,-1),c=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"})],-1);n.render=function(t,n,i,d,m,p){return d.mounted&&!d.logged?(e.openBlock(),e.createElementBlock("div",o,[e.renderSlot(t.$slots,"login",{open:d.open,label:t.__("auth.login.login")},(function(){return[e.createElementVNode("a",{class:"button",onClick:n[0]||(n[0]=function(){return d.open&&d.open.apply(d,arguments)})},e.toDisplayString(t.label),1)]}))])):d.mounted?(e.openBlock(),e.createElementBlock("div",u,[e.renderSlot(t.$slots,"user",{user:d.user,routes:d.routes,logout:d.logout},(function(){return[e.createElementVNode("div",r,[e.createElementVNode("div",a,[e.createElementVNode("a",{class:"button",href:d.routes[0].path},[e.createElementVNode("span",null,[s,e.createTextVNode(" "+e.toDisplayString(d.user.name?d.user.name:d.user.email),1)]),c],8,l)])])]}))])):e.createCommentVNode("v-if",!0)},module.exports=n;
1
+ "use strict";var e=require("vue"),t=require("vuex"),o={name:"user-trigger",setup:function(){var o=t.useStore(),n=e.computed((function(){return o.getters["auth/me"]})),u=e.computed((function(){return o.getters["auth/modal"]})),r=e.computed((function(){return Object.keys(n.value).length>0})),a=e.ref(!1),l=e.computed((function(){return o.getters["auth/account"]})),s=function(){o.commit("auth/modal",null),o.dispatch("auth/me")};n.value?a.value=!0:o.dispatch("auth/me",{finally:function(){a.value=!0}});return window.addEventListener("keyup",(function(e){u.value&&"Escape"===e.key&&s()})),{mounted:a,user:n,logged:r,modal:u,open:function(){o.commit("auth/modal","login")},close:s,routes:l,logout:function(){o.dispatch("auth/logout"),window.authUserLogoutCallback&&window.authUserLogoutCallback()}}}},n={key:0,class:"auth-user"},u={key:1,class:"auth-user is-logged"},r={class:"dropdown is-right is-hoverable"},a={class:"dropdown-trigger"},l=["href"],s=e.createElementVNode("i",{class:"fas fa-user"},null,-1),c=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"})],-1);o.render=function(t,o,i,d,m,g){return d.mounted&&!d.logged?(e.openBlock(),e.createElementBlock("div",n,[e.renderSlot(t.$slots,"login",{open:d.open,label:t.__("auth.login.login")},(function(){return[e.createElementVNode("a",{class:"button",onClick:o[0]||(o[0]=function(){return d.open&&d.open.apply(d,arguments)})},e.toDisplayString(t.label),1)]}))])):d.mounted?(e.openBlock(),e.createElementBlock("div",u,[e.renderSlot(t.$slots,"user",{user:d.user,routes:d.routes,logout:d.logout},(function(){return[e.createElementVNode("div",r,[e.createElementVNode("div",a,[e.createElementVNode("a",{class:"button",href:d.routes[0].path},[e.createElementVNode("span",null,[s,e.createTextVNode(" "+e.toDisplayString(d.user.name?d.user.name:d.user.email),1)]),c],8,l)])])]}))])):e.createCommentVNode("v-if",!0)},module.exports=o;
2
2
  //# sourceMappingURL=UserTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserTrigger.js","sources":["../../../src/components/auth/UserTrigger.vue","../../../src/components/auth/UserTrigger.vue?vue&type=template&id=209bc8cc&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-user\" v-if=\"mounted && !logged\">\n <slot name=\"login\" :open=\"open\" :label=\"__('auth.login.login')\">\n <a class=\"button\" @click=\"open\">{{ label }}</a>\n </slot>\n </div>\n <div class=\"auth-user is-logged\" v-else-if=\"mounted\">\n <slot name=\"user\" :user=\"user\" :routes=\"routes\" :logout=\"logout\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <a class=\"button\" :href=\"routes[0].path\">\n <span>\n <i class=\"fas fa-user\"></i>\n {{ user.name ? user.name : user.email }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </a>\n </div>\n </div>\n </slot>\n </div>\n</template>\n<script>\nimport { ref, computed } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'user-trigger',\n setup() {\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n const modal = computed(() => store.getters['auth/modal']);\n const logged = computed(() => Object.keys(user.value).length > 0);\n const mounted = ref(false);\n const routes = computed(() => store.getters['auth/account']);\n\n const open = () => {\n store.commit('auth/modal', 'login');\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n };\n\n if (!user.value) {\n store.dispatch('auth/me', {\n finally: () => {\n mounted.value = true;\n }\n });\n } else {\n mounted.value = true;\n }\n\n const logout = () => {\n store.dispatch('auth/logout');\n };\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n return {\n mounted,\n user,\n logged,\n modal,\n open,\n close,\n routes,\n logout,\n };\n }\n};\n</script>","<template>\n <div class=\"auth-user\" v-if=\"mounted && !logged\">\n <slot name=\"login\" :open=\"open\" :label=\"__('auth.login.login')\">\n <a class=\"button\" @click=\"open\">{{ label }}</a>\n </slot>\n </div>\n <div class=\"auth-user is-logged\" v-else-if=\"mounted\">\n <slot name=\"user\" :user=\"user\" :routes=\"routes\" :logout=\"logout\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <a class=\"button\" :href=\"routes[0].path\">\n <span>\n <i class=\"fas fa-user\"></i>\n {{ user.name ? user.name : user.email }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </a>\n </div>\n </div>\n </slot>\n </div>\n</template>\n<script>\nimport { ref, computed } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'user-trigger',\n setup() {\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n const modal = computed(() => store.getters['auth/modal']);\n const logged = computed(() => Object.keys(user.value).length > 0);\n const mounted = ref(false);\n const routes = computed(() => store.getters['auth/account']);\n\n const open = () => {\n store.commit('auth/modal', 'login');\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n };\n\n if (!user.value) {\n store.dispatch('auth/me', {\n finally: () => {\n mounted.value = true;\n }\n });\n } else {\n mounted.value = true;\n }\n\n const logout = () => {\n store.dispatch('auth/logout');\n };\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n return {\n mounted,\n user,\n logged,\n modal,\n open,\n close,\n routes,\n logout,\n };\n }\n};\n</script>"],"names":["name","setup","store","useStore","user","computed","getters","modal","logged","Object","keys","value","length","mounted","ref","routes","close","commit","dispatch","window","addEventListener","e","key","open","logout","_createElementVNode","$setup","_createElementBlock","_hoisted_1","_renderSlot","label","_ctx","onClick","_hoisted_2","_hoisted_3","_hoisted_4","href","path","_hoisted_6","email","_hoisted_7"],"mappings":"sDA4Be,CACXA,KAAM,eACNC,qBACUC,EAAQC,aACRC,EAAOC,YAAS,kBAAMH,EAAMI,QAAQ,cACpCC,EAAQF,YAAS,kBAAMH,EAAMI,QAAQ,iBACrCE,EAASH,YAAS,kBAAMI,OAAOC,KAAKN,EAAKO,OAAOC,OAAS,KACzDC,EAAUC,OAAI,GACdC,EAASV,YAAS,kBAAMH,EAAMI,QAAQ,mBAMtCU,EAAQ,WACVd,EAAMe,OAAO,aAAc,MAC3Bf,EAAMgB,SAAS,YAGdd,EAAKO,MAONE,EAAQF,OAAQ,EANhBT,EAAMgB,SAAS,UAAW,SACb,WACLL,EAAQF,OAAQ,YAW5BQ,OAAOC,iBAAiB,SAAS,SAACC,GAC1Bd,EAAMI,OAAmB,WAAVU,EAAEC,KACjBN,OAID,CACHH,QAAAA,EACAT,KAAAA,EACAI,OAAAA,EACAD,MAAAA,EACAgB,KAlCS,WACTrB,EAAMe,OAAO,aAAc,UAkC3BD,MAAAA,EACAD,OAAAA,EACAS,OAlBW,WACXtB,EAAMgB,SAAS,kCCzDZ,4BAKA,gCAEQ,2CACI,iCAGCO,gCAAS,0BAGbA,mCAAY,kBACRA,gCAAS,kCAAgC,oDAfpCC,YAAYA,wBAAzCC,2BAAAC,GACIC,+BAAoBN,KAAMG,OAAOI,MAAOC,2BAAxC,kBACIN,gCAAS,SAAUO,sCAAON,uDAASK,mBAGCL,yBAA5CC,2BAAAM,GACIJ,8BAAmBzB,KAAMsB,OAAOX,OAAQW,SAASF,OAAQE,WAAzD,kBACID,2BAAAS,GACIT,2BAAAU,GACIV,gCAAS,SAAUW,KAAMV,YAAUW,OAC/BZ,kCACIa,0CACGZ,OAAK1B,KAAO0B,OAAK1B,KAAO0B,OAAKa,YAEpCC"}
1
+ {"version":3,"file":"UserTrigger.js","sources":["../../../src/components/auth/UserTrigger.vue","../../../src/components/auth/UserTrigger.vue?vue&type=template&id=d84c264c&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-user\" v-if=\"mounted && !logged\">\n <slot name=\"login\" :open=\"open\" :label=\"__('auth.login.login')\">\n <a class=\"button\" @click=\"open\">{{ label }}</a>\n </slot>\n </div>\n <div class=\"auth-user is-logged\" v-else-if=\"mounted\">\n <slot name=\"user\" :user=\"user\" :routes=\"routes\" :logout=\"logout\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <a class=\"button\" :href=\"routes[0].path\">\n <span>\n <i class=\"fas fa-user\"></i>\n {{ user.name ? user.name : user.email }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </a>\n </div>\n </div>\n </slot>\n </div>\n</template>\n<script>\nimport { ref, computed } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'user-trigger',\n setup() {\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n const modal = computed(() => store.getters['auth/modal']);\n const logged = computed(() => Object.keys(user.value).length > 0);\n const mounted = ref(false);\n const routes = computed(() => store.getters['auth/account']);\n\n const open = () => {\n store.commit('auth/modal', 'login');\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n };\n\n if (!user.value) {\n store.dispatch('auth/me', {\n finally: () => {\n mounted.value = true;\n }\n });\n } else {\n mounted.value = true;\n }\n\n const logout = () => {\n store.dispatch('auth/logout');\n\n if (window.authUserLogoutCallback) {\n window.authUserLogoutCallback();\n }\n };\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n return {\n mounted,\n user,\n logged,\n modal,\n open,\n close,\n routes,\n logout,\n };\n }\n};\n</script>","<template>\n <div class=\"auth-user\" v-if=\"mounted && !logged\">\n <slot name=\"login\" :open=\"open\" :label=\"__('auth.login.login')\">\n <a class=\"button\" @click=\"open\">{{ label }}</a>\n </slot>\n </div>\n <div class=\"auth-user is-logged\" v-else-if=\"mounted\">\n <slot name=\"user\" :user=\"user\" :routes=\"routes\" :logout=\"logout\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <a class=\"button\" :href=\"routes[0].path\">\n <span>\n <i class=\"fas fa-user\"></i>\n {{ user.name ? user.name : user.email }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </a>\n </div>\n </div>\n </slot>\n </div>\n</template>\n<script>\nimport { ref, computed } from 'vue';\nimport { useStore } from 'vuex';\n\nexport default {\n name: 'user-trigger',\n setup() {\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n const modal = computed(() => store.getters['auth/modal']);\n const logged = computed(() => Object.keys(user.value).length > 0);\n const mounted = ref(false);\n const routes = computed(() => store.getters['auth/account']);\n\n const open = () => {\n store.commit('auth/modal', 'login');\n };\n\n const close = () => {\n store.commit('auth/modal', null);\n store.dispatch('auth/me');\n };\n\n if (!user.value) {\n store.dispatch('auth/me', {\n finally: () => {\n mounted.value = true;\n }\n });\n } else {\n mounted.value = true;\n }\n\n const logout = () => {\n store.dispatch('auth/logout');\n\n if (window.authUserLogoutCallback) {\n window.authUserLogoutCallback();\n }\n };\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n return {\n mounted,\n user,\n logged,\n modal,\n open,\n close,\n routes,\n logout,\n };\n }\n};\n</script>"],"names":["name","setup","store","useStore","user","computed","getters","modal","logged","Object","keys","value","length","mounted","ref","routes","close","commit","dispatch","window","addEventListener","e","key","open","logout","authUserLogoutCallback","_createElementVNode","$setup","_createElementBlock","_hoisted_1","_renderSlot","label","_ctx","onClick","_hoisted_2","_hoisted_3","_hoisted_4","href","path","_hoisted_6","email","_hoisted_7"],"mappings":"sDA4Be,CACXA,KAAM,eACNC,qBACUC,EAAQC,aACRC,EAAOC,YAAS,kBAAMH,EAAMI,QAAQ,cACpCC,EAAQF,YAAS,kBAAMH,EAAMI,QAAQ,iBACrCE,EAASH,YAAS,kBAAMI,OAAOC,KAAKN,EAAKO,OAAOC,OAAS,KACzDC,EAAUC,OAAI,GACdC,EAASV,YAAS,kBAAMH,EAAMI,QAAQ,mBAMtCU,EAAQ,WACVd,EAAMe,OAAO,aAAc,MAC3Bf,EAAMgB,SAAS,YAGdd,EAAKO,MAONE,EAAQF,OAAQ,EANhBT,EAAMgB,SAAS,UAAW,SACb,WACLL,EAAQF,OAAQ,YAe5BQ,OAAOC,iBAAiB,SAAS,SAACC,GAC1Bd,EAAMI,OAAmB,WAAVU,EAAEC,KACjBN,OAID,CACHH,QAAAA,EACAT,KAAAA,EACAI,OAAAA,EACAD,MAAAA,EACAgB,KAtCS,WACTrB,EAAMe,OAAO,aAAc,UAsC3BD,MAAAA,EACAD,OAAAA,EACAS,OAtBW,WACXtB,EAAMgB,SAAS,eAEXC,OAAOM,wBACPN,OAAOM,4CC5DR,4BAKA,gCAEQ,2CACI,iCAGCC,gCAAS,0BAGbA,mCAAY,kBACRA,gCAAS,kCAAgC,oDAfpCC,YAAYA,wBAAzCC,2BAAAC,GACIC,+BAAoBP,KAAMI,OAAOI,MAAOC,2BAAxC,kBACIN,gCAAS,SAAUO,sCAAON,uDAASK,mBAGCL,yBAA5CC,2BAAAM,GACIJ,8BAAmB1B,KAAMuB,OAAOZ,OAAQY,SAASH,OAAQG,WAAzD,kBACID,2BAAAS,GACIT,2BAAAU,GACIV,gCAAS,SAAUW,KAAMV,YAAUW,OAC/BZ,kCACIa,0CACGZ,OAAK3B,KAAO2B,OAAK3B,KAAO2B,OAAKa,YAEpCC"}
package/dist/helpers.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var r=require("vue"),e=require("yup"),t=require("@perevorot/shop/dist/forms/FormCheckbox"),o=require("@perevorot/shop/dist/forms/FormCheckboxes"),n=require("@perevorot/shop/dist/forms/FormPassword"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=require("@perevorot/shop/dist/forms/FormRating"),u=require("@perevorot/shop/dist/forms/FormSection"),l=require("@perevorot/shop/dist/forms/FormSelect"),s=require("@perevorot/shop/dist/forms/FormSwitch"),c=require("@perevorot/shop/dist/forms/FormText"),f=require("@perevorot/shop/dist/forms/FormTextarea");function d(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}function m(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}})),e.default=r,Object.freeze(e)}var p=m(e),h=d(t),v=d(o),b=d(n),y=d(i),F=d(a),g=d(u),S=d(l),w=d(s),q=d(c),x=d(f);function j(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==t)return;var o,n,i=[],a=!0,u=!1;try{for(t=t.call(r);!(a=(o=t.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(r){u=!0,n=r}finally{try{a||null==t.return||t.return()}finally{if(u)throw n}}return i}(r,e)||k(r,e)||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 O(r){return function(r){if(Array.isArray(r))return A(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||k(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(r,e){if(r){if("string"==typeof r)return A(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?A(r,e):void 0}}function A(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=r[t];return o}p.addMethod(p.string,"minOrEmpty",(function(r,e){return this.test({name:"minOrEmpty",exclusive:!0,message:e,params:{min:r},test:function(e){return""==e||e.length>=r}})})),p.addMethod(p.string,"numberFilled",(function(r,e){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:r},test:function(r){return!(""==r||isNaN(r))}})}));var _={pluralize:function(r,e){var t=Number(String(r).replace(/\D/g,""));return r+" "+e[t%100>4&&t%100<20?2:[2,0,1,1,1,2][Math.min(t%10,5)]]},formParse:function(e){var t={FormCheckbox:h.default,FormCheckboxes:v.default,FormPassword:b.default,FormRadio:y.default,FormRating:F.default,FormSection:g.default,FormSelect:S.default,FormSwitch:w.default,FormText:q.default,FormTextarea:x.default},o={},n={},i={};if(e.form)for(var a=function(){var e=j(l[u],2),a=e[0],s=e[1];if("_"!=a.charAt(0)){var c;switch(s.component){case"FormCheckbox":case"FormSwitch":c=!1;break;case"FormCheckboxes":c=[];break;default:c=""}o[a]=c}var f=t[s.component];r.markRaw(f);var d={component:f,label:s.label,validations:{}};if(s.validation){var m=p;s.validation.forEach((function(r){var e=[],t=r;if(t.split(":").length>1){var o=r.split(":");t=o.shift(),e=JSON.parse(o)}("required"==t&&(d.validations.required=!0),"phone"==t&&d.validations.required)&&(t="matches",e=[s.pattern?new RegExp(s.pattern):/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")]);"array"!=t&&e.push(__("auth.validation."+t));try{var n;m=(n=m)[t].apply(n,O(e))}catch(r){}})),i[a]=m}s.condition&&(d.condition=function(r){return r[s.condition[0]]===s.condition[1]},i[a]=p.string().when(s.condition[0],{is:s.condition[1],then:i[a]})),["mask","placeholder","description","type","list","model","store","default","hidden"].forEach((function(r){s[r]&&(d[r]=s[r])})),n[a]=d},u=0,l=Object.entries(e.form);u<l.length;u++)a();return{schema:n,model:o,validation:p.object().shape(i)}},nl2p:function(r){return null==r?"":"<p>"+(r+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1</p><p>$2")+"</p>"},numberFormat:function(r){return r?r.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "):"0"}};module.exports=_;
1
+ "use strict";var r=require("vue"),e=require("yup"),t=require("@perevorot/shop/dist/forms/FormCheckbox"),o=require("@perevorot/shop/dist/forms/FormCheckboxes"),n=require("@perevorot/shop/dist/forms/FormPassword"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=require("@perevorot/shop/dist/forms/FormRating"),u=require("@perevorot/shop/dist/forms/FormSection"),l=require("@perevorot/shop/dist/forms/FormSelect"),s=require("@perevorot/shop/dist/forms/FormSwitch"),c=require("@perevorot/shop/dist/forms/FormText"),f=require("@perevorot/shop/dist/forms/FormTextarea");function d(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}function m(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}})),e.default=r,Object.freeze(e)}var p=m(e),h=d(t),v=d(o),b=d(n),y=d(i),F=d(a),g=d(u),S=d(l),w=d(s),q=d(c),x=d(f);function j(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==t)return;var o,n,i=[],a=!0,u=!1;try{for(t=t.call(r);!(a=(o=t.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(r){u=!0,n=r}finally{try{a||null==t.return||t.return()}finally{if(u)throw n}}return i}(r,e)||k(r,e)||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 O(r){return function(r){if(Array.isArray(r))return A(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||k(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(r,e){if(r){if("string"==typeof r)return A(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?A(r,e):void 0}}function A(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=r[t];return o}p.addMethod(p.string,"minOrEmpty",(function(r,e){return this.test({name:"minOrEmpty",exclusive:!0,message:e,params:{min:r},test:function(e){return""==e||e.length>=r}})})),p.addMethod(p.string,"numberFilled",(function(r,e){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:r},test:function(r){return!(""==r||isNaN(r))}})}));var _={pluralize:function(r,e){var t=Number(String(r).replace(/\D/g,""));return r+" "+e[t%100>4&&t%100<20?2:[2,0,1,1,1,2][Math.min(t%10,5)]]},formParse:function(e){var t={FormCheckbox:h.default,FormCheckboxes:v.default,FormPassword:b.default,FormRadio:y.default,FormRating:F.default,FormSection:g.default,FormSelect:S.default,FormSwitch:w.default,FormText:q.default,FormTextarea:x.default},o={},n={},i={};if(e.form)for(var a=function(){var e=j(l[u],2),a=e[0],s=e[1];if("_"!=a.charAt(0)){var c;switch(s.component){case"FormCheckbox":case"FormSwitch":c=!1;break;case"FormCheckboxes":c=[];break;default:c=""}o[a]=c}var f=t[s.component];f&&r.markRaw(f);var d={component:f||s.component,label:s.label,validations:{}};if(s.validation){var m=p;s.validation.forEach((function(r){var e=[],t=r;if(t.split(":").length>1){var o=r.split(":");t=o.shift(),e=JSON.parse(o)}("required"==t&&(d.validations.required=!0),"phone"==t&&d.validations.required)&&(t="matches",e=[s.pattern?new RegExp(s.pattern):/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")]);"array"!=t&&e.push(__("auth.validation."+t));try{var n;m=(n=m)[t].apply(n,O(e))}catch(r){}})),i[a]=m}s.condition&&(d.condition=function(r){return r[s.condition[0]]===s.condition[1]},i[a]=p.string().when(s.condition[0],{is:s.condition[1],then:i[a]})),["mask","placeholder","description","type","list","model","store","default","hidden"].forEach((function(r){s[r]&&(d[r]=s[r])})),n[a]=d},u=0,l=Object.entries(e.form);u<l.length;u++)a();return{schema:n,model:o,validation:p.object().shape(i)}},nl2p:function(r){return null==r?"":"<p>"+(r+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1</p><p>$2")+"</p>"},numberFormat:function(r){return r?r.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "):"0"}};module.exports=_;
2
2
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../src/helpers/modules/formParse.js","../src/helpers/index.js","../src/helpers/modules/pluralize.js","../src/helpers/modules/nl2p.js","../src/helpers/modules/numberFormat.js"],"sourcesContent":["import { markRaw } from 'vue';\nimport * as yup from 'yup';\n\nimport FormCheckbox from '@perevorot/shop/dist/forms/FormCheckbox';\nimport FormCheckboxes from '@perevorot/shop/dist/forms/FormCheckboxes';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport FormRating from '@perevorot/shop/dist/forms/FormRating';\nimport FormSection from '@perevorot/shop/dist/forms/FormSection';\nimport FormSelect from '@perevorot/shop/dist/forms/FormSelect';\nimport FormSwitch from '@perevorot/shop/dist/forms/FormSwitch';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\n\nyup.addMethod(yup.string, 'minOrEmpty', function (min, msg) {\n return this.test({\n name: 'minOrEmpty',\n exclusive: true,\n message: msg,\n params: {\n min: min,\n },\n test: (value) => value == '' || value.length >= min,\n });\n});\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nexport default function formParse(json) {\n let components = {\n FormCheckbox: FormCheckbox,\n FormCheckboxes: FormCheckboxes,\n FormPassword: FormPassword,\n FormRadio: FormRadio,\n FormRating: FormRating,\n FormSection: FormSection,\n FormSelect: FormSelect,\n FormSwitch: FormSwitch,\n FormText: FormText,\n FormTextarea: FormTextarea,\n };\n\n let model = {};\n let schema = {};\n let validation = {};\n\n if (json.form) {\n for (const [field, element] of Object.entries(json.form)) {\n if (field.charAt(0) != '_') {\n let value;\n\n switch (element.component) {\n case 'FormCheckbox':\n case 'FormSwitch':\n value = false;\n break;\n\n case 'FormCheckboxes':\n value = [];\n break;\n default:\n value = '';\n }\n\n model[field] = value;\n }\n\n const component = components[element.component];\n\n markRaw(component);\n\n let s = {\n component: component,\n label: element.label,\n validations: {},\n };\n\n if (element.validation) {\n let v = yup;\n\n const validations = element.validation;\n\n validations.forEach((rule) => {\n let attributes = [];\n let method = rule;\n\n if (method.split(':').length > 1) {\n let ruleWithAttributes = rule.split(':');\n method = ruleWithAttributes.shift();\n\n attributes = JSON.parse(ruleWithAttributes);\n }\n\n if (method == 'required') {\n s.validations.required = true;\n }\n\n if (method == 'phone' && s.validations.required) {\n const phoneRegExp = element.pattern ? new RegExp(element.pattern) : /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n method = 'matches';\n\n attributes = [phoneRegExp, __('auth.validation.phone')];\n }\n\n if (method != 'array') {\n attributes.push(__('auth.validation.' + method));\n }\n\n try {\n v = v[method](...attributes);\n } catch (error) {}\n });\n\n validation[field] = v;\n }\n\n if (element.condition) {\n s.condition = (model) => model[element.condition[0]] === element.condition[1];\n\n validation[field] = yup.string().when(element.condition[0], {\n is: element.condition[1],\n then: validation[field],\n });\n }\n\n ['mask', 'placeholder', 'description', 'type', 'list', 'model', 'store', 'default', 'hidden'].forEach((f) => {\n if (element[f]) {\n s[f] = element[f];\n }\n });\n\n schema[field] = s;\n }\n }\n\n return {\n schema: schema,\n model: model,\n validation: yup.object().shape(validation),\n };\n}\n","import pluralize from './modules/pluralize';\nimport formParse from './modules/formParse';\nimport nl2p from './modules/nl2p';\nimport numberFormat from './modules/numberFormat';\n\nexport default {\n pluralize,\n formParse,\n nl2p,\n numberFormat,\n};\n","export default function pluralize(count, words) {\n let cases = [2, 0, 1, 1, 1, 2];\n\n const countClear = Number(String(count).replace(/\\D/g, ''));\n\n return count + ' ' + words[countClear % 100 > 4 && countClear % 100 < 20 ? 2 : cases[Math.min(countClear % 10, 5)]];\n}\n","export default function nl2p(str) {\n if (typeof str === 'undefined' || str === null) {\n return '';\n }\n\n return '<p>' + (str + '').replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '$1' + '</p><p>' + '$2') + '</p>';\n}\n","export default function numberFormat(value) {\n return value ? value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ') : '0';\n}\n"],"names":["yup","addMethod","string","min","msg","this","test","name","exclusive","message","params","value","length","__","isNaN","pluralize","count","words","countClear","Number","String","replace","Math","formParse","json","components","FormCheckbox","FormCheckboxes","FormPassword","FormRadio","FormRating","FormSection","FormSelect","FormSwitch","FormText","FormTextarea","model","schema","validation","form","field","element","charAt","component","markRaw","s","label","validations","v","forEach","rule","attributes","method","split","ruleWithAttributes","shift","JSON","parse","required","pattern","RegExp","push","error","condition","when","is","then","f","Object","entries","object","shape","nl2p","str","numberFormat","toString"],"mappings":"kyEAcAA,EAAIC,UAAUD,EAAIE,OAAQ,cAAc,SAAUC,EAAKC,UAC5CC,KAAKC,KAAK,CACbC,KAAM,aACNC,WAAW,EACXC,QAASL,EACTM,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,SAAmB,IAATA,GAAeA,EAAMC,QAAUT,QAIxDH,EAAIC,UAAUD,EAAIE,OAAQ,gBAAgB,SAAUC,EAAKC,UAC9CC,KAAKC,KAAK,CACbC,KAAM,eACNC,WAAW,EACXC,QAASI,GAAG,0BACZH,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,WAAqB,IAATA,GAAeG,MAAMH,UC7BhD,MAAe,CACXI,UCNW,SAAmBC,EAAOC,OAG/BC,EAAaC,OAAOC,OAAOJ,GAAOK,QAAQ,MAAO,YAEhDL,EAAQ,IAAMC,EAAMC,EAAa,IAAM,GAAKA,EAAa,IAAM,GAAK,EAJ/D,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAIyDI,KAAKnB,IAAIe,EAAa,GAAI,MDE/GK,UD+BW,SAAmBC,OAC1BC,EAAa,CACbC,aAAcA,UACdC,e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SAAQ,SAACkB,GAC/F1B,EAAQ0B,KACRtB,EAAEsB,GAAK1B,EAAQ0B,OAIvB9B,EAAOG,GAASK,SArFWuB,OAAOC,QAAQ7C,EAAKe,+BAyFhD,CACHF,OAAQA,EACRD,MAAOA,EACPE,WAAYtC,EAAIsE,SAASC,MAAMjC,KC7InCkC,KERW,SAAcC,UACrB,MAAOA,EACA,GAGJ,OAASA,EAAM,IAAIpD,QAAQ,gCAAiC,eAA2B,QFI9FqD,aGTW,SAAsB/D,UAC1BA,EAAQA,EAAMgE,WAAWtD,QAAQ,wBAAyB,KAAO"}
1
+ {"version":3,"file":"helpers.js","sources":["../src/helpers/modules/formParse.js","../src/helpers/index.js","../src/helpers/modules/pluralize.js","../src/helpers/modules/nl2p.js","../src/helpers/modules/numberFormat.js"],"sourcesContent":["import { markRaw } from 'vue';\nimport * as yup from 'yup';\n\nimport FormCheckbox from '@perevorot/shop/dist/forms/FormCheckbox';\nimport FormCheckboxes from '@perevorot/shop/dist/forms/FormCheckboxes';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport FormRating from '@perevorot/shop/dist/forms/FormRating';\nimport FormSection from '@perevorot/shop/dist/forms/FormSection';\nimport FormSelect from '@perevorot/shop/dist/forms/FormSelect';\nimport FormSwitch from '@perevorot/shop/dist/forms/FormSwitch';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\n\nyup.addMethod(yup.string, 'minOrEmpty', function (min, msg) {\n return this.test({\n name: 'minOrEmpty',\n exclusive: true,\n message: msg,\n params: {\n min: min,\n },\n test: (value) => value == '' || value.length >= min,\n });\n});\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nexport default function formParse(json) {\n let components = {\n FormCheckbox: FormCheckbox,\n FormCheckboxes: FormCheckboxes,\n FormPassword: FormPassword,\n FormRadio: FormRadio,\n FormRating: FormRating,\n FormSection: FormSection,\n FormSelect: FormSelect,\n FormSwitch: FormSwitch,\n FormText: FormText,\n FormTextarea: FormTextarea,\n };\n\n let model = {};\n let schema = {};\n let validation = {};\n\n if (json.form) {\n for (const [field, element] of Object.entries(json.form)) {\n if (field.charAt(0) != '_') {\n let value;\n\n switch (element.component) {\n case 'FormCheckbox':\n case 'FormSwitch':\n value = false;\n break;\n\n case 'FormCheckboxes':\n value = [];\n break;\n default:\n value = '';\n }\n\n model[field] = value;\n }\n\n const component = components[element.component];\n\n if (component) {\n markRaw(component);\n }\n\n let s = {\n component: component ? component : element.component,\n label: element.label,\n validations: {},\n };\n\n if (element.validation) {\n let v = yup;\n\n const validations = element.validation;\n\n validations.forEach((rule) => {\n let attributes = [];\n let method = rule;\n\n if (method.split(':').length > 1) {\n let ruleWithAttributes = rule.split(':');\n method = ruleWithAttributes.shift();\n\n attributes = JSON.parse(ruleWithAttributes);\n }\n\n if (method == 'required') {\n s.validations.required = true;\n }\n\n if (method == 'phone' && s.validations.required) {\n const phoneRegExp = element.pattern ? new RegExp(element.pattern) : /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n method = 'matches';\n\n attributes = [phoneRegExp, __('auth.validation.phone')];\n }\n\n if (method != 'array') {\n attributes.push(__('auth.validation.' + method));\n }\n\n try {\n v = v[method](...attributes);\n } catch (error) {}\n });\n\n validation[field] = v;\n }\n\n if (element.condition) {\n s.condition = (model) => model[element.condition[0]] === element.condition[1];\n\n validation[field] = yup.string().when(element.condition[0], {\n is: element.condition[1],\n then: validation[field],\n });\n }\n\n ['mask', 'placeholder', 'description', 'type', 'list', 'model', 'store', 'default', 'hidden'].forEach((f) => {\n if (element[f]) {\n s[f] = element[f];\n }\n });\n\n schema[field] = s;\n }\n }\n\n return {\n schema: schema,\n model: model,\n validation: yup.object().shape(validation),\n };\n}\n","import pluralize from './modules/pluralize';\nimport formParse from './modules/formParse';\nimport nl2p from './modules/nl2p';\nimport numberFormat from './modules/numberFormat';\n\nexport default {\n pluralize,\n formParse,\n nl2p,\n numberFormat,\n};\n","export default function pluralize(count, words) {\n let cases = [2, 0, 1, 1, 1, 2];\n\n const countClear = Number(String(count).replace(/\\D/g, ''));\n\n return count + ' ' + words[countClear % 100 > 4 && countClear % 100 < 20 ? 2 : cases[Math.min(countClear % 10, 5)]];\n}\n","export default function nl2p(str) {\n if (typeof str === 'undefined' || str === null) {\n return '';\n }\n\n return '<p>' + (str + '').replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '$1' + '</p><p>' + '$2') + '</p>';\n}\n","export default function numberFormat(value) {\n return value ? value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ') : '0';\n}\n"],"names":["yup","addMethod","string","min","msg","this","test","name","exclusive","message","params","value","length","__","isNaN","pluralize","count","words","countClear","Number","String","replace","Math","formParse","json","components","FormCheckbox","FormCheckboxes","FormPassword","FormRadio","FormRating","FormSection","FormSelect","FormSwitch","FormText","FormTextarea","model","schema","validation","form","field","element","charAt","component","markRaw","s","label","validations","v","forEach","rule","attributes","method","split","ruleWithAttributes","shift","JSON","parse","required","pattern","RegExp","push","error","condition","when","is","then","f","Object","entries","object","shape","nl2p","str","numberFormat","toString"],"mappings":"kyEAcAA,EAAIC,UAAUD,EAAIE,OAAQ,cAAc,SAAUC,EAAKC,UAC5CC,KAAKC,KAAK,CACbC,KAAM,aACNC,WAAW,EACXC,QAASL,EACTM,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,SAAmB,IAATA,GAAeA,EAAMC,QAAUT,QAIxDH,EAAIC,UAAUD,EAAIE,OAAQ,gBAAgB,SAAUC,EAAKC,UAC9CC,KAAKC,KAAK,CACbC,KAAM,eACNC,WAAW,EACXC,QAASI,GAAG,0BACZH,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAAC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C,cAIxCJ,KAAIA,GAAEI,aAAWD,IACnB,MAAOW,QAGbxB,EAAWE,GAASQ,EAGpBP,EAAQsB,YACRlB,EAAEkB,UAAY,SAAC3B,UAAUA,EAAMK,EAAQsB,UAAU,MAAQtB,EAAQsB,UAAU,IAE3EzB,EAAWE,GAASxC,EAAIE,SAAS8D,KAAKvB,EAAQsB,UAAU,GAAI,CACxDE,GAAIxB,EAAQsB,UAAU,GACtBG,KAAM5B,EAAWE,OAIxB,OAAQ,cAAe,cAAe,OAAQ,OAAQ,QAAS,QAAS,UAAW,UAAUS,SAAQ,SAACkB,GAC/F1B,EAAQ0B,KACRtB,EAAEsB,GAAK1B,EAAQ0B,OAIvB9B,EAAOG,GAASK,SAvFWuB,OAAOC,QAAQ7C,EAAKe,+BA2FhD,CACHF,OAAQA,EACRD,MAAOA,EACPE,WAAYtC,EAAIsE,SAASC,MAAMjC,KC/InCkC,KERW,SAAcC,UACrB,MAAOA,EACA,GAGJ,OAASA,EAAM,IAAIpD,QAAQ,gCAAiC,eAA2B,QFI9FqD,aGTW,SAAsB/D,UAC1BA,EAAQA,EAAMgE,WAAWtD,QAAQ,wBAAyB,KAAO"}
package/dist/store.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("vue"),a=require("@perevorot/shop/dist/api"),n=require("vue-toastification");function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var c=e(require("js-cookie")),o=n.useToast(),i={namespaced:!0,state:{items:[],cross:[],bundles:[],modal:!1},getters:{items:function(t){return t.items},cross:function(t){return t.cross},bundles:function(t){return t.bundles},productQuantity:function(t,a){return function(t){var n=a.items.find((function(a){return a.id===t}));return n?n.quantity:0}},product:function(t,a){return function(t){var n=a.items.find((function(a){return a.id===t}));return n||null}},quantity:function(t,a){var n=0;return a.items.forEach((function(t){n+=parseInt(t.quantity)})),n},total:function(t,a){var n=0;return a.items.forEach((function(t){var a=t.attributes.price?t.attributes.price:t.price;if(t.attributes.options&&t.attributes.options.length&&t.options&&t.options.length){var e=0;t.options.forEach((function(a){-1!==t.attributes.options.indexOf(a.id)&&(e+=parseInt(a.price))})),a+=e}n+=a*(!1===t.attributes.active?0:t.quantity)})),n},modal:function(t){return!1!==t.modal&&document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal}},actions:{get:function(t,n){var e=t.commit;a.cart.items(n.cart).then((function(t){e("items",t.data.items),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},add:function(t,n){var e=t.commit,c=t.state;a.cart.add(n.product,n.cart).then((function(t){t.data&&t.data.error&&t.data.message?o(t.data.message,{type:"error"}):(t.data&&t.data.items&&t.data.items.length?e("items",t.data.items):e("quantity",n.product),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),c.modal||"modal"!==n.after||e("modal",!0),"function"==typeof n.callback&&n.callback())})).finally(n.finally)},options:function(t,n){var e=t.commit,c=t.state;a.cart.options(n.product).then((function(t){t.data&&t.data.items&&t.data.items.length&&e("items",t.data.items),c.modal||e("modal",!0),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},quantity:function(t,n){var e=t.commit;a.cart.quantity(n.product,n.cart).then((function(){e("quantity",n.product),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},remove:function(t,n){var e=t.commit;a.cart.remove(n.id,n.cart).then((function(t){e("remove",n.id),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},clear:function(t,n){var e=t.commit;a.cart.clear(n.id,n.cart).then((function(){e("clear"),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{modal:function(t,a){t.modal=a},items:function(t,a){t.items=a},cross:function(t,a){t.cross=a},bundles:function(t,a){t.bundles=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))},quantity:function(t,a){var n=t.items.find((function(t){return t.id===a.id}));n.quantity=a.exact?a.exact:n.quantity+a.quantity},clear:function(t){t.items=[],t.cross=[],t.bundles=[]}}};function l(t){if(null==t)throw new TypeError("Cannot destructure undefined")}var s=n.useToast(),r={user:{},modal:!1,account:[]},u={me:function(t){return t.user},account:function(t){return t.account},modal:function(t){return t.modal},is:function(t){return Object.keys(t.user).length>0}};t.watch((function(){return r.modal}),(function(t){!1!==t&&document.documentElement.classList[t?"add":"remove"]("is-modal-open")}),{immediate:!0});var f={me:function(t,a){t.user=Array.isArray(a.user)&&!a.user.length?{}:a.user,t.account=a.account},modal:function(t,a){t.modal=a}},d={namespaced:!0,state:{items:[],list:[],last:""},getters:{items:function(t){return t.items},item:function(t,a){return function(t){return-1!==a.items.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last}},actions:{get:function(t,n){var e=t.commit;a.wishlist.items().then((function(t){e("items",t.data.items),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(t,n){var e=t.commit;a.wishlist.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(t,n){var e=t.commit;t.state,a.wishlist.toggle(n.id).then((function(t){t.data&&t.data.items&&e("items",t.data.items),t.data&&t.data.last&&e("last",t.data.last),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{items:function(t,a){t.items=a},list:function(t,a){t.list=a},last:function(t,a){t.last=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))}}},m={namespaced:!0,state:{products:[],categories:[],list:[],last:"",modal:null},getters:{products:function(t){return t.products},categories:function(t){return t.categories},product:function(t,a){return function(t){return-1!==a.products.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last},modal:function(t){return t.modal}},actions:{get:function(t,n){var e=t.commit;a.compare.items().then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},category:function(t,n){var e=t.commit;a.compare.category(n.slug).then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(t,n){var e=t.commit;a.compare.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(t,n){var e=t.commit;t.state,a.compare.toggle(n.id).then((function(t){t.data&&(e("products",t.data.products),e("categories",t.data.categories),e("last",t.data.last)),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},delete:function(t,n){t.commit,t.state,a.compare.delete(n.id).then((function(t){"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},modal:function(t,n){var e=t.commit;t.state,a.compare.modal(n.id).then((function(t){e("modal",t.data),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)}},mutations:{products:function(t,a){t.products=a},categories:function(t,a){t.categories=a},list:function(t,a){t.list=a},remove:function(t,a){t.products=t.products.filter((function(t){return t.id!==a}))},last:function(t,a){t.last=a},modal:function(t,a){t.modal=a}}},p={namespaced:!0,state:{modal:!1},getters:{modal:function(t){return t.modal}},mutations:{modal:function(t,a){!1!==t.modal&&document.documentElement.classList[a?"add":"remove"]("is-modal-open"),t.modal=a}}},y={namespaced:!0,state:{steps:{},current:1,modal:!1},getters:{steps:function(t){return t.steps},current:function(t){return t.current},modal:function(t){return t.modal}},mutations:{step:function(t,a){Number.isInteger(a)?t.current=a:a.data&&(t.steps[a.step]=a.data)},stepInit:function(t,a){t.steps[a.step]||(t.steps[a.step]=a.data)},reset:function(t){t.steps={},t.current=1},modal:function(t,a){t.modal=a}}},h={modules:{cart:i,auth:{namespaced:!0,state:r,getters:u,actions:{me:function(t,n){var e=t.commit;a.auth.me().then((function(t){e("me",t.data),t.data.flash&&t.data.flash.message&&(console.error(t.data.flash.message),s(t.data.flash.message,{type:t.data.flash.type?t.data.flash.type:"default"})),t.data.flash&&t.data.flash.modal&&e("modal",t.data.flash.modal),n&&"function"==typeof n.callback&&n.callback()})).finally(n&&n.finally?n.finally:function(){})},login:function(t,n){var e=t.commit,c=t.dispatch;a.auth.login(n.credentials).then((function(t){t.data.csrf_token&&($http.defaults.headers.common["X-CSRF-TOKEN"]=t.data.csrf_token,delete t.data.csrf_token),e("me",t.data),e("modal",null),c("cart/get",{finally:function(){}},{root:!0}),c("wishlist/get",{finally:function(){}},{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback(t)})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},logout:function(t,n){var e=t.commit;a.auth.logout().then((function(){e("me",{user:{},account:[]}),e("wishlist/items",[],{root:!0}),window.localStorage&&window.localStorage.clear(),c.default.remove("user_id"),n&&"function"==typeof n.callback&&n.callback(),-1!==window.location.href.indexOf("/account")&&(window.location.href=$env.locale.url+"/")}))},reset:function(t,n){l(t),a.auth.reset(n.credentials).then((function(t){if(n&&"function"==typeof n.callback){var a=t.data&&t.data.message?t.data.message:"";n.callback(a,!1,t.data)}})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.errors&&t.response.data.errors.email&&n.callback(t.response.data.errors.email[0],!0)})).finally(n.finally)},resetSms:function(t,n){l(t),a.auth.resetSms(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback(t.data,!1)})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.error&&n.callback(t.response.data,!0)})).finally(n.finally)},passwordUpdate:function(t,n){l(t),a.auth.passwordUpdate(n.credentials).then((function(t){if(n&&"function"==typeof n.callback){var a=t.data&&t.data.message?t.data.message:"";n.callback(a)}})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.errors&&t.response.data.errors.email&&n.callback(t.response.data.errors.email[0],!0)})).finally(n.finally)},register:function(t,n){t.commit,a.auth["register"+n.type](n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback(t)})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},update:function(t,n){t.commit,a.auth.update(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)}},mutations:f},wishlist:d,compare:m,review:p,order:y,checkout:{namespaced:!0,state:{user:{},payment:null,shipping:null,shippingData:{},dontcall:!1,comment:""},getters:{user:function(t,a,n,e){return Object.keys(t.user).length?t.user:JSON.parse(JSON.stringify(e["auth/me"]))},shipping:function(t){return t.shipping},shippingData:function(t){return t.shippingData},payment:function(t){return t.payment},dontcall:function(t){return t.dontcall},comment:function(t){return t.comment}},mutations:{user:function(t,a){t.user=a},shipping:function(t,a){t.shipping=a},shippingData:function(t,a){t.shippingData=a},payment:function(t,a){t.payment=a},dontcall:function(t,a){t.dontcall=a},comment:function(t,a){t.comment=a},reset:function(t){t.user={},t.payment=null,t.shipping=null,t.shippingData={},t.dontcall=!1,t.comment=""}}}},strict:!1};module.exports=h;
1
+ "use strict";var t=require("vue"),a=require("@perevorot/shop/dist/api"),n=require("vue-toastification");function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var c=e(require("js-cookie")),o=n.useToast(),i={namespaced:!0,state:{items:[],cross:[],bundles:[],modal:!1},getters:{items:function(t){return t.items},cross:function(t){return t.cross},bundles:function(t){return t.bundles},productQuantity:function(t,a){return function(t){var n=a.items.find((function(a){return a.id===t}));return n?n.quantity:0}},product:function(t,a){return function(t){var n=a.items.find((function(a){return a.id===t}));return n||null}},quantity:function(t,a){var n=0;return a.items.forEach((function(t){n+=parseInt(t.quantity)})),n},total:function(t,a){var n=0;return a.items.forEach((function(t){var a=t.attributes.price?t.attributes.price:t.price;if(t.attributes.options&&t.attributes.options.length&&t.options&&t.options.length){var e=0;t.options.forEach((function(a){-1!==t.attributes.options.indexOf(a.id)&&(e+=parseInt(a.price))})),a+=e}n+=a*(!1===t.attributes.active?0:t.quantity)})),n},modal:function(t){return!1!==t.modal&&document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal}},actions:{get:function(t,n){var e=t.commit;a.cart.items(n.cart).then((function(t){e("items",t.data.items),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},add:function(t,n){var e=t.commit,c=t.state;a.cart.add(n.product,n.cart).then((function(t){t.data&&t.data.error&&t.data.message?o(t.data.message,{type:"error"}):(t.data&&t.data.items&&t.data.items.length?e("items",t.data.items):e("quantity",n.product),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),c.modal||"modal"!==n.after||e("modal",!0),"function"==typeof n.callback&&n.callback())})).finally(n.finally)},options:function(t,n){var e=t.commit,c=t.state;a.cart.options(n.product).then((function(t){t.data&&t.data.items&&t.data.items.length&&e("items",t.data.items),c.modal||e("modal",!0),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},quantity:function(t,n){var e=t.commit;a.cart.quantity(n.product,n.cart).then((function(){e("quantity",n.product),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},remove:function(t,n){var e=t.commit;a.cart.remove(n.id,n.cart).then((function(t){e("remove",n.id),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},clear:function(t,n){var e=t.commit;a.cart.clear(n.id,n.cart).then((function(){e("clear"),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{modal:function(t,a){t.modal=a},items:function(t,a){t.items=a},cross:function(t,a){t.cross=a},bundles:function(t,a){t.bundles=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))},quantity:function(t,a){var n=t.items.find((function(t){return t.id===a.id}));n.quantity=a.exact?a.exact:n.quantity+a.quantity},clear:function(t){t.items=[],t.cross=[],t.bundles=[]}}};function l(t){if(null==t)throw new TypeError("Cannot destructure undefined")}var s=n.useToast(),r={user:{},modal:!1,account:[]},u={me:function(t){return t.user},account:function(t){return t.account},modal:function(t){return t.modal},is:function(t){return Object.keys(t.user).length>0}};t.watch((function(){return r.modal}),(function(t){!1!==t&&document.documentElement.classList[t?"add":"remove"]("is-modal-open")}),{immediate:!0});var f={me:function(t,a){t.user=Array.isArray(a.user)&&!a.user.length?{}:a.user,t.account=a.account},modal:function(t,a){t.modal=a}},d={namespaced:!0,state:{items:[],list:[],last:""},getters:{items:function(t){return t.items},item:function(t,a){return function(t){return-1!==a.items.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last}},actions:{get:function(t,n){var e=t.commit;a.wishlist.items().then((function(t){e("items",t.data.items),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(t,n){var e=t.commit;a.wishlist.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(t,n){var e=t.commit;t.state,a.wishlist.toggle(n.id).then((function(t){t.data&&t.data.items&&e("items",t.data.items),t.data&&t.data.last&&e("last",t.data.last),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{items:function(t,a){t.items=a},list:function(t,a){t.list=a},last:function(t,a){t.last=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))}}},m={namespaced:!0,state:{products:[],categories:[],list:[],last:"",modal:null},getters:{products:function(t){return t.products},categories:function(t){return t.categories},product:function(t,a){return function(t){return-1!==a.products.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last},modal:function(t){return t.modal}},actions:{get:function(t,n){var e=t.commit;a.compare.items().then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},category:function(t,n){var e=t.commit;a.compare.category(n.slug).then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(t,n){var e=t.commit;a.compare.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(t,n){var e=t.commit;t.state,a.compare.toggle(n.id).then((function(t){t.data&&(e("products",t.data.products),e("categories",t.data.categories),e("last",t.data.last)),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},delete:function(t,n){t.commit,t.state,a.compare.delete(n.id).then((function(t){"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},modal:function(t,n){var e=t.commit;t.state,a.compare.modal(n.id).then((function(t){e("modal",t.data),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)}},mutations:{products:function(t,a){t.products=a},categories:function(t,a){t.categories=a},list:function(t,a){t.list=a},remove:function(t,a){t.products=t.products.filter((function(t){return t.id!==a}))},last:function(t,a){t.last=a},modal:function(t,a){t.modal=a}}},p={namespaced:!0,state:{modal:!1},getters:{modal:function(t){return t.modal}},mutations:{modal:function(t,a){!1!==t.modal&&document.documentElement.classList[a?"add":"remove"]("is-modal-open"),t.modal=a}}},y={namespaced:!0,state:{steps:{},current:1,modal:!1},getters:{steps:function(t){return t.steps},current:function(t){return t.current},modal:function(t){return t.modal}},mutations:{step:function(t,a){Number.isInteger(a)?t.current=a:a.data&&(t.steps[a.step]=a.data)},stepInit:function(t,a){t.steps[a.step]||(t.steps[a.step]=a.data)},reset:function(t){t.steps={},t.current=1},modal:function(t,a){t.modal=a}}},h={modules:{cart:i,auth:{namespaced:!0,state:r,getters:u,actions:{me:function(t,n){var e=t.commit;a.auth.me().then((function(t){e("me",t.data),t.data.flash&&t.data.flash.message&&(console.error(t.data.flash.message),s(t.data.flash.message,{type:t.data.flash.type?t.data.flash.type:"default"})),t.data.flash&&t.data.flash.modal&&e("modal",t.data.flash.modal),n&&"function"==typeof n.callback&&n.callback()})).finally(n&&n.finally?n.finally:function(){})},login:function(t,n){var e=t.commit,c=t.dispatch;a.auth.login(n.credentials).then((function(t){t.data.csrf_token&&($http.defaults.headers.common["X-CSRF-TOKEN"]=t.data.csrf_token,delete t.data.csrf_token),e("me",t.data),n&&!n.ignoreModal&&e("modal",null),c("cart/get",{finally:function(){}},{root:!0}),c("wishlist/get",{finally:function(){}},{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback(t)})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},logout:function(t,n){var e=t.commit;a.auth.logout().then((function(){e("me",{user:{},account:[]}),e("wishlist/items",[],{root:!0}),window.localStorage&&window.localStorage.clear(),c.default.remove("user_id"),n&&"function"==typeof n.callback&&n.callback(),-1!==window.location.href.indexOf("/account")&&(window.location.href=$env.locale.url+"/")}))},reset:function(t,n){l(t),a.auth.reset(n.credentials).then((function(t){if(n&&"function"==typeof n.callback){var a=t.data&&t.data.message?t.data.message:"";n.callback(a,!1,t.data)}})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.errors&&t.response.data.errors.email&&n.callback(t.response.data.errors.email[0],!0)})).finally(n.finally)},resetSms:function(t,n){l(t),a.auth.resetSms(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback(t.data,!1)})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.error&&n.callback(t.response.data,!0)})).finally(n.finally)},passwordUpdate:function(t,n){l(t),a.auth.passwordUpdate(n.credentials).then((function(t){if(n&&"function"==typeof n.callback){var a=t.data&&t.data.message?t.data.message:"";n.callback(a)}})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.errors&&t.response.data.errors.email&&n.callback(t.response.data.errors.email[0],!0)})).finally(n.finally)},register:function(t,n){t.commit,a.auth["register"+n.type](n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback(t)})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},update:function(t,n){t.commit,a.auth.update(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)}},mutations:f},wishlist:d,compare:m,review:p,order:y,checkout:{namespaced:!0,state:{user:{},payment:null,shipping:null,shippingData:{},dontcall:!1,comment:""},getters:{user:function(t,a,n,e){return Object.keys(t.user).length?t.user:JSON.parse(JSON.stringify(e["auth/me"]))},shipping:function(t){return t.shipping},shippingData:function(t){return t.shippingData},payment:function(t){return t.payment},dontcall:function(t){return t.dontcall},comment:function(t){return t.comment}},mutations:{user:function(t,a){t.user=a},shipping:function(t,a){t.shipping=a},shippingData:function(t,a){t.shippingData=a},payment:function(t,a){t.payment=a},dontcall:function(t,a){t.dontcall=a},comment:function(t,a){t.comment=a},reset:function(t){t.user={},t.payment=null,t.shipping=null,t.shippingData={},t.dontcall=!1,t.comment=""}}}},strict:!1};module.exports=h;
2
2
  //# sourceMappingURL=store.js.map
package/dist/store.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sources":["../src/store/modules/cart.js","../src/store/modules/auth.js","../src/store/modules/wishlist.js","../src/store/modules/compare.js","../src/store/modules/review.js","../src/store/modules/order.js","../src/store/index.js","../src/store/modules/checkout.js"],"sourcesContent":["import { watch } from 'vue';\n\nimport { cart as api } from '@perevorot/shop/dist/api';\nimport { useToast } from 'vue-toastification';\nconst toast = useToast();\n\nconst state = {\n items: [],\n cross: [],\n bundles: [],\n modal: false,\n};\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n\n cross: (state) => {\n return state.cross;\n },\n\n bundles: (state) => {\n return state.bundles;\n },\n\n productQuantity: (state, getters) => (id) => {\n const product = getters.items.find((product) => product.id === id);\n\n return product ? product.quantity : 0;\n },\n\n product: (state, getters) => (id) => {\n const product = getters.items.find((product) => product.id === id);\n\n return product ? product : null;\n },\n\n quantity: (state, getters) => {\n let count = 0;\n\n getters.items.forEach((item) => {\n count += parseInt(item.quantity);\n });\n\n return count;\n },\n\n total: (state, getters) => {\n let total = 0;\n\n getters.items.forEach((item) => {\n let price = item.attributes.price ? item.attributes.price : item.price;\n\n if (item.attributes.options && item.attributes.options.length && item.options && item.options.length) {\n let optionsPrice = 0;\n\n item.options.forEach((option) => {\n if (item.attributes.options.indexOf(option.id) !== -1) {\n optionsPrice += parseInt(option.price);\n }\n });\n\n price += optionsPrice;\n }\n\n total += price * (item.attributes.active === false ? 0 : item.quantity);\n });\n\n return total;\n },\n\n modal: (state) => {\n //initial state\n if (state.modal !== false) {\n document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n }\n\n return state.modal;\n },\n};\n\nconst actions = {\n get({ commit }, data) {\n api.items(data.cart)\n .then((response) => {\n commit('items', response.data.items);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n add({ commit, state }, data) {\n api.add(data.product, data.cart)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n } else {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n } else {\n commit('quantity', data.product);\n }\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (!state.modal && data.after === 'modal') {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }\n })\n .finally(data.finally);\n },\n\n options({ commit, state }, data) {\n api.options(data.product)\n .then((response) => {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n }\n\n if (!state.modal) {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n quantity({ commit }, data) {\n api.quantity(data.product, data.cart)\n .then(() => {\n commit('quantity', data.product);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n remove({ commit }, data) {\n api.remove(data.id, data.cart)\n .then((response) => {\n commit('remove', data.id);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n clear({ commit }, data) {\n api.clear(data.id, data.cart)\n .then(() => {\n commit('clear');\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n modal(state, action) {\n state.modal = action;\n },\n\n items(state, items) {\n state.items = items;\n },\n\n cross(state, cross) {\n state.cross = cross;\n },\n\n bundles(state, bundles) {\n state.bundles = bundles;\n },\n\n remove(state, id) {\n state.items = state.items.filter((item) => item.id !== id);\n },\n\n quantity(state, item) {\n const product = state.items.find((product) => product.id === item.id);\n\n product.quantity = item.exact ? item.exact : product.quantity + item.quantity;\n },\n\n clear(state) {\n state.items = [];\n state.cross = [];\n state.bundles = [];\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","import { watch } from 'vue';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport Cookies from 'js-cookie';\n// import {\n// useGlobalToast as useToast\n// } from \"@/global/toast\";\nimport { useToast } from 'vue-toastification';\nconst toast = useToast();\n\nconst state = {\n user: {},\n modal: false,\n account: [],\n};\n\nconst getters = {\n me: (state) => {\n return state.user;\n },\n account: (state) => {\n return state.account;\n },\n modal: (state) => {\n //initial state\n // if (state.modal !== false) {\n // document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n // }\n\n return state.modal;\n },\n is: (state) => {\n return Object.keys(state.user).length > 0;\n },\n};\n\nwatch(\n () => state.modal,\n (modal) => {\n if (modal !== false) {\n document.documentElement.classList[modal ? 'add' : 'remove']('is-modal-open');\n }\n },\n {\n immediate: true,\n }\n);\n\nconst actions = {\n me({ commit }, data) {\n api.me()\n .then((response) => {\n commit('me', response.data);\n\n if (response.data.flash && response.data.flash.message) {\n console.error(response.data.flash.message);\n\n toast(response.data.flash.message, {\n type: response.data.flash.type ? response.data.flash.type : 'default',\n });\n }\n\n if (response.data.flash && response.data.flash.modal) {\n commit('modal', response.data.flash.modal);\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data && data.finally ? data.finally : () => {});\n },\n login({ commit, dispatch }, data) {\n api.login(data.credentials)\n .then((response) => {\n if (response.data.csrf_token) {\n $http.defaults.headers.common['X-CSRF-TOKEN'] = response.data.csrf_token;\n\n delete response.data.csrf_token;\n }\n\n commit('me', response.data);\n commit('modal', null);\n\n dispatch(\n 'cart/get',\n {\n finally: () => {},\n },\n {\n root: true,\n }\n );\n\n dispatch(\n 'wishlist/get',\n {\n finally: () => {},\n },\n {\n root: true,\n }\n );\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback(response);\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n logout({ commit }, data) {\n api.logout().then(() => {\n commit('me', {\n user: {},\n account: [],\n });\n\n commit('wishlist/items', [], {\n root: true,\n });\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n Cookies.remove('user_id');\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n\n if (window.location.href.indexOf('/account') !== -1) {\n window.location.href = $env.locale.url + '/';\n }\n });\n },\n reset({}, data) {\n api.reset(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ? response.data.message : '';\n\n data.callback(message, false, response.data);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n })\n .finally(data.finally);\n },\n resetSms({}, data) {\n api.resetSms(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback(response.data, false);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.error) {\n data.callback(error.response.data, true);\n }\n }\n })\n .finally(data.finally);\n },\n passwordUpdate({}, data) {\n api.passwordUpdate(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ? response.data.message : '';\n\n data.callback(message);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n })\n .finally(data.finally);\n },\n register({ commit }, data) {\n api['register' + data.type](data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback(response);\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n update({ commit }, data) {\n api['update'](data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n me(state, me) {\n state.user = Array.isArray(me.user) && !me.user.length ? {} : me.user;\n state.account = me.account;\n },\n modal(state, action) {\n state.modal = action;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","import {\n wishlist as api\n} from '@perevorot/shop/dist/api'\n\nconst state = {\n items: [],\n list: [],\n last: ''\n}\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n item: (state, getters) => (id) => {\n return getters.items.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n // badge: (state) => {\n // return state.items.length;\n // },\n last: (state) => {\n return state.last;\n },\n}\n\nconst actions = {\n get({\n commit,\n }, data) {\n api.items().then((response) => {\n commit('items', response.data.items);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n list({\n commit,\n }, data) {\n api.list().then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n toggle({\n commit,\n state\n }, data) {\n api.toggle(data.id).then((response) => {\n if (response.data && response.data.items) {\n commit('items', response.data.items);\n }\n\n if (response.data && response.data.last) {\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n}\n\nconst mutations = {\n items(state, items) {\n state.items = items;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n last(state, last) {\n state.last = last;\n },\n\n remove(state, id) {\n state.items = state.items.filter(item => item.id !== id);\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}","import { compare as api } from '@perevorot/shop/dist/api';\n\nconst state = {\n products: [],\n categories: [],\n list: [],\n last: '',\n modal: null,\n};\n\nconst getters = {\n products: (state) => {\n return state.products;\n },\n categories: (state) => {\n return state.categories;\n },\n product: (state, getters) => (id) => {\n return getters.products.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n last: (state) => {\n return state.last;\n },\n modal: (state) => {\n return state.modal;\n },\n};\n\nconst actions = {\n get({ commit }, data) {\n api.items()\n .then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n category({ commit }, data) {\n api.category(data.slug)\n .then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n list({ commit }, data) {\n api.list()\n .then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n toggle({ commit, state }, data) {\n api.toggle(data.id)\n .then((response) => {\n if (response.data) {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n\n delete({ commit, state }, data) {\n api.delete(data.id)\n .then((response) => {\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n\n modal({ commit, state }, data) {\n api.modal(data.id)\n .then((response) => {\n commit('modal', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n products(state, products) {\n state.products = products;\n },\n\n categories(state, categories) {\n state.categories = categories;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n remove(state, id) {\n state.products = state.products.filter((item) => item.id !== id);\n },\n\n last(state, last) {\n state.last = last;\n },\n\n modal(state, modal) {\n state.modal = modal;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","const state = {\n modal: false,\n};\n\nconst getters = {\n modal: (state) => {\n return state.modal;\n },\n};\n\nconst mutations = {\n modal(state, action) {\n //initial state\n if (state.modal !== false) {\n document.documentElement.classList[action ? 'add' : 'remove']('is-modal-open');\n }\n\n state.modal = action;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations,\n};\n","const state = {\n steps: {},\n current: 1,\n modal: false,\n}\n\nconst getters = {\n steps: (state) => {\n return state.steps;\n },\n current: (state) => {\n return state.current;\n },\n modal: (state) => {\n return state.modal;\n }\n}\n\nconst mutations = {\n step(state, data) {\n if (Number.isInteger(data)) {\n state.current = data;\n } else {\n if (data.data) {\n state.steps[data.step] = data.data;\n }\n }\n },\n stepInit(state, data) {\n if (!state.steps[data.step]) {\n state.steps[data.step] = data.data;\n }\n },\n reset(state) {\n state.steps = {};\n state.current = 1;\n },\n modal(state, action) {\n state.modal = action;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations\n}","import cart from './modules/cart';\nimport auth from './modules/auth';\nimport wishlist from './modules/wishlist';\nimport compare from './modules/compare';\nimport review from './modules/review';\nimport order from './modules/order';\nimport checkout from './modules/checkout';\n\nexport default {\n modules: {\n cart,\n auth,\n wishlist,\n compare,\n review,\n order,\n checkout,\n },\n strict: false,\n};","const state = {\n user: {},\n payment: null,\n shipping: null,\n shippingData: {},\n dontcall: false,\n comment: '',\n};\n\nconst getters = {\n user: (state, getters, rootState, rootGetters) => {\n return Object.keys(state.user).length ? state.user : JSON.parse(JSON.stringify(rootGetters['auth/me']));\n },\n shipping: (state) => {\n return state.shipping;\n },\n shippingData: (state) => {\n return state.shippingData;\n },\n payment: (state) => {\n return state.payment;\n },\n dontcall: (state) => {\n return state.dontcall;\n },\n comment: (state) => {\n return state.comment;\n },\n};\n\nconst mutations = {\n user(state, data) {\n state.user = data;\n },\n shipping(state, data) {\n state.shipping = data;\n },\n shippingData(state, data) {\n state.shippingData = data;\n },\n payment(state, data) {\n state.payment = data;\n },\n dontcall(state, data) {\n state.dontcall = data;\n },\n comment(state, data) {\n state.comment = data;\n },\n reset(state) {\n state.user = {};\n state.payment = null;\n state.shipping = null;\n state.shippingData = {};\n state.dontcall = false;\n state.comment = '';\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations,\n};\n"],"names":["toast","useToast","namespaced","state","items","cross","bundles","modal","getters","productQuantity","id","product","find","quantity","count","forEach","item","parseInt","total","price","attributes","options","length","optionsPrice","option","indexOf","active","document","documentElement","classList","actions","get","data","commit","api","cart","then","response","callback","add","error","message","type","after","remove","clear","mutations","action","filter","exact","user","account","me","is","Object","keys","watch","immediate","Array","isArray","list","last","toggle","products","categories","category","slug","steps","current","step","Number","isInteger","stepInit","reset","modules","auth","flash","console","login","dispatch","credentials","csrf_token","$http","defaults","headers","common","root","window","localStorage","logout","Cookies","location","href","$env","locale","url","errors","email","resetSms","passwordUpdate","register","update","wishlist","compare","review","order","checkout","payment","shipping","shippingData","dontcall","comment","rootState","rootGetters","JSON","parse","stringify","strict"],"mappings":"8MAIMA,EAAQC,eAsOC,CACXC,YAAY,EACZC,MAtOU,CACVC,MAAO,GACPC,MAAO,GACPC,QAAS,GACTC,OAAO,GAmOPC,QAhOY,CACZJ,MAAO,SAACD,UACGA,EAAMC,OAGjBC,MAAO,SAACF,UACGA,EAAME,OAGjBC,QAAS,SAACH,UACCA,EAAMG,SAGjBG,gBAAiB,SAACN,EAAOK,UAAY,SAACE,OAC5BC,EAAUH,EAAQJ,MAAMQ,MAAK,SAACD,UAAYA,EAAQD,KAAOA,YAExDC,EAAUA,EAAQE,SAAW,IAGxCF,QAAS,SAACR,EAAOK,UAAY,SAACE,OACpBC,EAAUH,EAAQJ,MAAMQ,MAAK,SAACD,UAAYA,EAAQD,KAAOA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AAQ5G,EAAO6B,GACX7B,EAAM4G,QAAU/E,GAEpByC,eAAMtE,GACFA,EAAM+C,KAAO,GACb/C,EAAMwG,QAAU,KAChBxG,EAAMyG,SAAW,KACjBzG,EAAM0G,aAAe,GACrB1G,EAAM2G,UAAW,EACjB3G,EAAM4G,QAAU,ODrCpBM,QAAQ"}
1
+ {"version":3,"file":"store.js","sources":["../src/store/modules/cart.js","../src/store/modules/auth.js","../src/store/modules/wishlist.js","../src/store/modules/compare.js","../src/store/modules/review.js","../src/store/modules/order.js","../src/store/index.js","../src/store/modules/checkout.js"],"sourcesContent":["import { watch } from 'vue';\n\nimport { cart as api } from '@perevorot/shop/dist/api';\nimport { useToast } from 'vue-toastification';\nconst toast = useToast();\n\nconst state = {\n items: [],\n cross: [],\n bundles: [],\n modal: false,\n};\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n\n cross: (state) => {\n return state.cross;\n },\n\n bundles: (state) => {\n return state.bundles;\n },\n\n productQuantity: (state, getters) => (id) => {\n const product = getters.items.find((product) => product.id === id);\n\n return product ? product.quantity : 0;\n },\n\n product: (state, getters) => (id) => {\n const product = getters.items.find((product) => product.id === id);\n\n return product ? product : null;\n },\n\n quantity: (state, getters) => {\n let count = 0;\n\n getters.items.forEach((item) => {\n count += parseInt(item.quantity);\n });\n\n return count;\n },\n\n total: (state, getters) => {\n let total = 0;\n\n getters.items.forEach((item) => {\n let price = item.attributes.price ? item.attributes.price : item.price;\n\n if (item.attributes.options && item.attributes.options.length && item.options && item.options.length) {\n let optionsPrice = 0;\n\n item.options.forEach((option) => {\n if (item.attributes.options.indexOf(option.id) !== -1) {\n optionsPrice += parseInt(option.price);\n }\n });\n\n price += optionsPrice;\n }\n\n total += price * (item.attributes.active === false ? 0 : item.quantity);\n });\n\n return total;\n },\n\n modal: (state) => {\n //initial state\n if (state.modal !== false) {\n document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n }\n\n return state.modal;\n },\n};\n\nconst actions = {\n get({ commit }, data) {\n api.items(data.cart)\n .then((response) => {\n commit('items', response.data.items);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n add({ commit, state }, data) {\n api.add(data.product, data.cart)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n } else {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n } else {\n commit('quantity', data.product);\n }\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (!state.modal && data.after === 'modal') {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }\n })\n .finally(data.finally);\n },\n\n options({ commit, state }, data) {\n api.options(data.product)\n .then((response) => {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n }\n\n if (!state.modal) {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n quantity({ commit }, data) {\n api.quantity(data.product, data.cart)\n .then(() => {\n commit('quantity', data.product);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n remove({ commit }, data) {\n api.remove(data.id, data.cart)\n .then((response) => {\n commit('remove', data.id);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n clear({ commit }, data) {\n api.clear(data.id, data.cart)\n .then(() => {\n commit('clear');\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n modal(state, action) {\n state.modal = action;\n },\n\n items(state, items) {\n state.items = items;\n },\n\n cross(state, cross) {\n state.cross = cross;\n },\n\n bundles(state, bundles) {\n state.bundles = bundles;\n },\n\n remove(state, id) {\n state.items = state.items.filter((item) => item.id !== id);\n },\n\n quantity(state, item) {\n const product = state.items.find((product) => product.id === item.id);\n\n product.quantity = item.exact ? item.exact : product.quantity + item.quantity;\n },\n\n clear(state) {\n state.items = [];\n state.cross = [];\n state.bundles = [];\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","import { watch } from 'vue';\nimport { auth as api } from '@perevorot/shop/dist/api';\nimport Cookies from 'js-cookie';\n// import {\n// useGlobalToast as useToast\n// } from \"@/global/toast\";\nimport { useToast } from 'vue-toastification';\nconst toast = useToast();\n\nconst state = {\n user: {},\n modal: false,\n account: [],\n};\n\nconst getters = {\n me: (state) => {\n return state.user;\n },\n account: (state) => {\n return state.account;\n },\n modal: (state) => {\n //initial state\n // if (state.modal !== false) {\n // document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n // }\n\n return state.modal;\n },\n is: (state) => {\n return Object.keys(state.user).length > 0;\n },\n};\n\nwatch(\n () => state.modal,\n (modal) => {\n if (modal !== false) {\n document.documentElement.classList[modal ? 'add' : 'remove']('is-modal-open');\n }\n },\n {\n immediate: true,\n }\n);\n\nconst actions = {\n me({ commit }, data) {\n api.me()\n .then((response) => {\n commit('me', response.data);\n\n if (response.data.flash && response.data.flash.message) {\n console.error(response.data.flash.message);\n\n toast(response.data.flash.message, {\n type: response.data.flash.type ? response.data.flash.type : 'default',\n });\n }\n\n if (response.data.flash && response.data.flash.modal) {\n commit('modal', response.data.flash.modal);\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data && data.finally ? data.finally : () => {});\n },\n login({ commit, dispatch }, data) {\n api.login(data.credentials)\n .then((response) => {\n if (response.data.csrf_token) {\n $http.defaults.headers.common['X-CSRF-TOKEN'] = response.data.csrf_token;\n\n delete response.data.csrf_token;\n }\n\n commit('me', response.data);\n\n if (data && !data.ignoreModal) {\n commit('modal', null);\n }\n\n dispatch(\n 'cart/get',\n {\n finally: () => {},\n },\n {\n root: true,\n }\n );\n\n dispatch(\n 'wishlist/get',\n {\n finally: () => {},\n },\n {\n root: true,\n }\n );\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback(response);\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n logout({ commit }, data) {\n api.logout().then(() => {\n commit('me', {\n user: {},\n account: [],\n });\n\n commit('wishlist/items', [], {\n root: true,\n });\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n Cookies.remove('user_id');\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n\n if (window.location.href.indexOf('/account') !== -1) {\n window.location.href = $env.locale.url + '/';\n }\n });\n },\n reset({}, data) {\n api.reset(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ? response.data.message : '';\n\n data.callback(message, false, response.data);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n })\n .finally(data.finally);\n },\n resetSms({}, data) {\n api.resetSms(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback(response.data, false);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.error) {\n data.callback(error.response.data, true);\n }\n }\n })\n .finally(data.finally);\n },\n passwordUpdate({}, data) {\n api.passwordUpdate(data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ? response.data.message : '';\n\n data.callback(message);\n }\n })\n .catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n })\n .finally(data.finally);\n },\n register({ commit }, data) {\n api['register' + data.type](data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback(response);\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n update({ commit }, data) {\n api['update'](data.credentials)\n .then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n })\n .catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n me(state, me) {\n state.user = Array.isArray(me.user) && !me.user.length ? {} : me.user;\n state.account = me.account;\n },\n modal(state, action) {\n state.modal = action;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","import {\n wishlist as api\n} from '@perevorot/shop/dist/api'\n\nconst state = {\n items: [],\n list: [],\n last: ''\n}\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n item: (state, getters) => (id) => {\n return getters.items.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n // badge: (state) => {\n // return state.items.length;\n // },\n last: (state) => {\n return state.last;\n },\n}\n\nconst actions = {\n get({\n commit,\n }, data) {\n api.items().then((response) => {\n commit('items', response.data.items);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n list({\n commit,\n }, data) {\n api.list().then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n toggle({\n commit,\n state\n }, data) {\n api.toggle(data.id).then((response) => {\n if (response.data && response.data.items) {\n commit('items', response.data.items);\n }\n\n if (response.data && response.data.last) {\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n}\n\nconst mutations = {\n items(state, items) {\n state.items = items;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n last(state, last) {\n state.last = last;\n },\n\n remove(state, id) {\n state.items = state.items.filter(item => item.id !== id);\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}","import { compare as api } from '@perevorot/shop/dist/api';\n\nconst state = {\n products: [],\n categories: [],\n list: [],\n last: '',\n modal: null,\n};\n\nconst getters = {\n products: (state) => {\n return state.products;\n },\n categories: (state) => {\n return state.categories;\n },\n product: (state, getters) => (id) => {\n return getters.products.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n last: (state) => {\n return state.last;\n },\n modal: (state) => {\n return state.modal;\n },\n};\n\nconst actions = {\n get({ commit }, data) {\n api.items()\n .then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n category({ commit }, data) {\n api.category(data.slug)\n .then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n list({ commit }, data) {\n api.list()\n .then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n })\n .finally(data.finally);\n },\n\n toggle({ commit, state }, data) {\n api.toggle(data.id)\n .then((response) => {\n if (response.data) {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n\n delete({ commit, state }, data) {\n api.delete(data.id)\n .then((response) => {\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n\n modal({ commit, state }, data) {\n api.modal(data.id)\n .then((response) => {\n commit('modal', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n })\n .finally(data.finally);\n },\n};\n\nconst mutations = {\n products(state, products) {\n state.products = products;\n },\n\n categories(state, categories) {\n state.categories = categories;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n remove(state, id) {\n state.products = state.products.filter((item) => item.id !== id);\n },\n\n last(state, last) {\n state.last = last;\n },\n\n modal(state, modal) {\n state.modal = modal;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations,\n};\n","const state = {\n modal: false,\n};\n\nconst getters = {\n modal: (state) => {\n return state.modal;\n },\n};\n\nconst mutations = {\n modal(state, action) {\n //initial state\n if (state.modal !== false) {\n document.documentElement.classList[action ? 'add' : 'remove']('is-modal-open');\n }\n\n state.modal = action;\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations,\n};\n","const state = {\n steps: {},\n current: 1,\n modal: false,\n}\n\nconst getters = {\n steps: (state) => {\n return state.steps;\n },\n current: (state) => {\n return state.current;\n },\n modal: (state) => {\n return state.modal;\n }\n}\n\nconst mutations = {\n step(state, data) {\n if (Number.isInteger(data)) {\n state.current = data;\n } else {\n if (data.data) {\n state.steps[data.step] = data.data;\n }\n }\n },\n stepInit(state, data) {\n if (!state.steps[data.step]) {\n state.steps[data.step] = data.data;\n }\n },\n reset(state) {\n state.steps = {};\n state.current = 1;\n },\n modal(state, action) {\n state.modal = action;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations\n}","import cart from './modules/cart';\nimport auth from './modules/auth';\nimport wishlist from './modules/wishlist';\nimport compare from './modules/compare';\nimport review from './modules/review';\nimport order from './modules/order';\nimport checkout from './modules/checkout';\n\nexport default {\n modules: {\n cart,\n auth,\n wishlist,\n compare,\n review,\n order,\n checkout,\n },\n strict: false,\n};","const state = {\n user: {},\n payment: null,\n shipping: null,\n shippingData: {},\n dontcall: false,\n comment: '',\n};\n\nconst getters = {\n user: (state, getters, rootState, rootGetters) => {\n return Object.keys(state.user).length ? state.user : JSON.parse(JSON.stringify(rootGetters['auth/me']));\n },\n shipping: (state) => {\n return state.shipping;\n },\n shippingData: (state) => {\n return state.shippingData;\n },\n payment: (state) => {\n return state.payment;\n },\n dontcall: (state) => {\n return state.dontcall;\n },\n comment: (state) => {\n return state.comment;\n },\n};\n\nconst mutations = {\n user(state, data) {\n state.user = data;\n },\n shipping(state, data) {\n state.shipping = data;\n },\n shippingData(state, data) {\n state.shippingData = data;\n },\n payment(state, data) {\n state.payment = data;\n },\n dontcall(state, data) {\n state.dontcall = data;\n },\n comment(state, data) {\n state.comment = data;\n },\n reset(state) {\n state.user = {};\n state.payment = null;\n state.shipping = null;\n state.shippingData = {};\n state.dontcall = false;\n state.comment = '';\n },\n};\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations,\n};\n"],"names":["toast","useToast","namespaced","state","items","cross","bundles","modal","getters","productQuantity","id","product","find","quantity","count","forEach","item","parseInt","total","price","attributes","options","length","optionsPrice","option","indexOf","active","document","documentElement","classList","actions","get","data","commit","api","cart","then","response","callback","add","error","message","type","after","remove","clear","mutations","action","filter","exact","user","account","me","is","Object","keys","watch","immediate","Array","isArray","list","last","toggle","products","categories","category","slug","steps","current","step","Number","isInteger","stepInit","reset","modules","auth","flash","console","login","dispatch","credentials","csrf_token","$http","defaults","headers","common","ignoreModal","root","window","localStorage","logout","Cookies","location","href","$env","locale","url","errors","email","resetSms","passwordUpdate","register","update","wishlist","compare","review","order","checkout","payment","shipping","shippingData","dontcall","comment","rootState","rootGetters","JSON","parse","stringify","strict"],"mappings":"8MAIMA,EAAQC,eAsOC,CACXC,YAAY,EACZC,MAtOU,CACVC,MAAO,GACPC,MAAO,GACPC,QAAS,GACTC,OAAO,GAmOPC,QAhOY,CACZJ,MAAO,SAACD,UACGA,EAAMC,OAGjBC,MAAO,SAACF,UACGA,EAAME,OAGjBC,QAAS,SAACH,UACCA,EAAMG,SAGjBG,gBAAiB,SAACN,EAAOK,UAAY,SAACE,OAC5BC,EAAUH,EAAQJ,MAAMQ,MAAK,SAACD,UAAYA,EAAQD,KAAOA,YAExDC,EAAUA,EAAQE,SAAW,IAGxCF,QAAS,SAACR,EAAOK,UAAY,SAACE,OACpBC,EAAUH,EAAQJ,MAAMQ,MAAK,SAACD,UAAYA,EAAQD,KAAOA,YAExDC,GAAoB,OAG/BE,SAAU,SAACV,EAA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B,GACX7B,EAAM6G,QAAUhF,GAEpByC,eAAMtE,GACFA,EAAM+C,KAAO,GACb/C,EAAMyG,QAAU,KAChBzG,EAAM0G,SAAW,KACjB1G,EAAM2G,aAAe,GACrB3G,EAAM4G,UAAW,EACjB5G,EAAM6G,QAAU,ODrCpBM,QAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perevorot/shop",
3
- "version": "2.0.144",
3
+ "version": "2.0.145",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist/*"