/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@vue-storefront/odoo@1.5.3-rc.9/lib/index.cjs.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@vue-storefront/core"),compositionApi=require("@vue/composition-api"),odooApi=require("@vue-storefront/odoo-api"),compositionApi$1=require("@nuxtjs/composition-api"),__assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},__assign.apply(this,arguments)};function __awaiter(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function u(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((o=o.apply(e,t||[])).next())}))}function __generator(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a}function __spreadArray(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var resolvePath$1=function(e,t,r){return t.split(".").reduce((function(e,t){return e?e[t]:r}),e)},params$9={load:function(e,t){var r=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,o,n,i,a,u,s,d;return __generator(this,(function(c){switch(c.label){case 0:return[4,e.$odoo.api.cartLoad(r)];case 1:return t=c.sent().data,o=(null===(s=null===(u=null===(a=null===(i=null===(n=null==e?void 0:e.$odoo)||void 0===n?void 0:n.config)||void 0===i?void 0:i.app)||void 0===a?void 0:a.$config)||void 0===u?void 0:u.cart)||void 0===s?void 0:s.cookieIndex)||"orderLines.length",e.$odoo.config.app.$cookies.set("cart-size",resolvePath$1(null===(d=null==t?void 0:t.cart)||void 0===d?void 0:d.order,o,0)||0),[2,t.cart]}}))}))},addItem:function(e,t){var r=t.currentCart,o=t.product,n=t.quantity,i=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,a,u,s,d,c,l,v,g,p,m,f;return __generator(this,(function(h){switch(h.label){case 0:return params$9.isInCart(e,{currentCart:r,product:o})?[3,2]:(t=o.realProduct?null===(c=null===(d=o.realProduct)||void 0===d?void 0:d.product)||void 0===c?void 0:c.id:o.firstVariant.id,a={productId:t,quantity:n},[4,e.$odoo.api.cartAddItem(a,i)]);case 1:return u=h.sent().data,s=(null===(m=null===(p=null===(g=null===(v=null===(l=null==e?void 0:e.$odoo)||void 0===l?void 0:l.config)||void 0===v?void 0:v.app)||void 0===g?void 0:g.$config)||void 0===p?void 0:p.cart)||void 0===m?void 0:m.cookieIndex)||"orderLines.length",e.$odoo.config.app.$cookies.set("cart-size",resolvePath$1(null===(f=null==u?void 0:u.cartAddItem)||void 0===f?void 0:f.order,s,0)||0),[2,null==u?void 0:u.cartAddItem];case 2:return[2,r]}}))}))},removeItem:function(e,t){t.currentCart;var r=t.product,o=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,n,i,a,u,s,d,c,l;return __generator(this,(function(v){switch(v.label){case 0:return t={lineId:r.id},[4,e.$odoo.api.cartRemoveItem(t,o)];case 1:return n=v.sent().data,i=(null===(c=null===(d=null===(s=null===(u=null===(a=null==e?void 0:e.$odoo)||void 0===a?void 0:a.config)||void 0===u?void 0:u.app)||void 0===s?void 0:s.$config)||void 0===d?void 0:d.cart)||void 0===c?void 0:c.cookieIndex)||"orderLines.length",e.$odoo.config.app.$cookies.set("cart-size",resolvePath$1(null===(l=null==n?void 0:n.cartRemoveItem)||void 0===l?void 0:l.order,i,0)||0),[2,null==n?void 0:n.cartRemoveItem]}}))}))},updateItemQty:function(e,t){t.currentCart;var r=t.product,o=t.quantity,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,i,a,u,s,d,c,l,v;return __generator(this,(function(g){switch(g.label){case 0:return t={lineId:r.id,quantity:o},[4,e.$odoo.api.cartUpdateItemQty(t,n)];case 1:return i=g.sent().data,a=(null===(l=null===(c=null===(d=null===(s=null===(u=null==e?void 0:e.$odoo)||void 0===u?void 0:u.config)||void 0===s?void 0:s.app)||void 0===d?void 0:d.$config)||void 0===c?void 0:c.cart)||void 0===l?void 0:l.cookieIndex)||"orderLines.length",e.$odoo.config.app.$cookies.set("cart-size",resolvePath$1(null===(v=null==i?void 0:i.cartUpdateItem)||void 0===v?void 0:v.order,a,0)||0),[2,null==i?void 0:i.cartUpdateItem]}}))}))},clear:function(e,t){var r=t.currentCart;return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return console.log("Mocked: clearCart"),[2,r]}))}))},applyCoupon:function(e,t){var r=t.currentCart,o=t.couponCode,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,i,a,u,s,d;return __generator(this,(function(c){switch(c.label){case 0:return t={promo:o},[4,e.$odoo.api.applyCoupon(t,n)];case 1:return i=c.sent(),a=i.data,(null===(u=a.applyCoupon)||void 0===u?void 0:u.error)?[4,e.$odoo.api.cartLoad(n)]:[3,3];case 2:return[2,{updatedCart:c.sent().data.cart,updatedCoupon:{applied:null===(s=a.applyCoupon)||void 0===s?void 0:s.error}}];case 3:return[2,{updatedCart:r,updatedCoupon:{applied:null===(d=a.applyCoupon)||void 0===d?void 0:d.error}}]}}))}))},removeCoupon:function(e,t){var r=t.currentCart;return t.couponCode,t.customQuery,__awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return console.log("Mocked: removeCoupon"),[2,{updatedCart:r}]}))}))},isInCart:function(e,t){var r,o,n=t.currentCart,i=t.product,a=i.realProduct?i.realProduct.product.id:i.firstVariant.id;return(null===(o=null===(r=null==n?void 0:n.order)||void 0===r?void 0:r.orderLines)||void 0===o?void 0:o.some((function(e){return e.product.id===a})))||!1}},useCart=core.useCartFactory(params$9),throwErrors$3=function(e){var t,r,o,n,i,a,u,s;if(null===(r=null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.data)||void 0===r?void 0:r.networkError){var d=(null===(i=null===(n=null===(o=e.response.data)||void 0===o?void 0:o.networkError)||void 0===n?void 0:n.result)||void 0===i?void 0:i.errors)||[];throw new Error(d.map((function(e){return e.message})).join(",")||"Some error")}if(null===(u=null===(a=null==e?void 0:e.response)||void 0===a?void 0:a.data)||void 0===u?void 0:u.graphQLErrors){d=(null===(s=e.response.data)||void 0===s?void 0:s.graphQLErrors)||[];throw new Error(d.map((function(e){return e.message})).join(",")||"Some error")}},factoryParams$8={provide:function(){return{useCart:useCart()}},load:function(e,t){var r=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,o,n,i,a,u,s;return __generator(this,(function(d){switch(d.label){case 0:return e.useCart.cart?[3,2]:[4,e.useCart.load(r)];case 1:d.sent(),d.label=2;case 2:return t=(null===(a=null===(i=null===(n=null===(o=e.useCart)||void 0===o?void 0:o.cart)||void 0===n?void 0:n.value)||void 0===i?void 0:i.order)||void 0===a?void 0:a.partnerInvoice)||{},[2,__assign(__assign({},t),{country:{id:String((null===(u=null==t?void 0:t.country)||void 0===u?void 0:u.id)||null)},state:{id:String((null===(s=null==t?void 0:t.state)||void 0===s?void 0:s.id)||null)}})]}}))}))},save:function(e,t){var r=t.params,o=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,n,i,a,u;return __generator(this,(function(s){switch(s.label){case 0:if(!("id"in r)||!r.id)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e.$odoo.api.billingUpdateAddress(r,o)];case 2:return t=s.sent().data,e.useCart.cart.value.order.partnerInvoice=t.updateAddress,[2,t.updateAddress];case 3:return n=s.sent(),throwErrors$3(n),[3,4];case 4:return[4,e.$odoo.api.billingAddAddress(r,o)];case 5:return i=s.sent(),a=i.data,u=i.errors,throwErrors$3(u),e.useCart.cart.value.order.partnerShipping=a.addAddress,[2,a.addAddress]}}))}))}},index$g=core.useBillingFactory(factoryParams$8),useShippingAsBillingAddress=function(){var e=useCart().cart;return{use:function(){return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(r){return t=e.value.order.partnerShipping,[2,__assign(__assign({},t),{country:{id:String(t.country.id)},state:{id:String(t.state.id)}})]}))}))}}},useShippingAsBillingAddress$1=useShippingAsBillingAddress,params$8={categorySearch:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o;return __generator(this,(function(n){switch(n.label){case 0:return[4,e.$odoo.api.getCategories(t,null==t?void 0:t.customQuery)];case 1:return r=n.sent().data,[2,null===(o=null==r?void 0:r.categories)||void 0===o?void 0:o.categories]}}))}))}},index$f=core.useCategoryFactory(params$8),params$7={categorySearch:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o;return __generator(this,(function(n){switch(n.label){case 0:return[4,e.$odoo.api.getCategories(t,null==t?void 0:t.customQuery)];case 1:return r=n.sent().data,[2,null===(o=null==r?void 0:r.categories)||void 0===o?void 0:o.categories]}}))}))}},index$e=core.useCategoryFactory(params$7);function useContent(){}var factoryParams$7={search:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o,n,i,a,u,s,d,c,l,v,g,p,m,f,h,y,_,P,w,$;return __generator(this,(function(I){switch(I.label){case 0:return r=t.input,o=r.customQueryProducts,n=r.customQueryCategories,i=null,a=null,u=null,t.input.fetchCategory?[4,e.$odoo.api.getCategory(t.input.categoryParams,n,null===(d=t.input.categoryParams)||void 0===d?void 0:d.cacheKey)]:[3,2];case 1:i=I.sent(),u=null===(l=null===(c=i.data)||void 0===c?void 0:c.category)||void 0===l?void 0:l.id,I.label=2;case 2:return t.input.fetchCategories?[4,e.$odoo.api.getCategories(t.input.categoryParams,n,null===(v=t.input.categoryParams)||void 0===v?void 0:v.cacheKey)]:[3,4];case 3:a=I.sent(),u=null===(f=null===(m=null===(p=null===(g=null==a?void 0:a.data)||void 0===g?void 0:g.categories)||void 0===p?void 0:p.categories)||void 0===m?void 0:m[0])||void 0===f?void 0:f.id,I.label=4;case 4:return[4,e.$odoo.api.getProductTemplatesList(t.input.productParams,o,null===(h=t.input.productParams)||void 0===h?void 0:h.cacheKey,u)];case 5:return s=I.sent().data,[2,{minPrice:(null===(y=null==s?void 0:s.products)||void 0===y?void 0:y.minPrice)||0,maxPrice:(null===(_=null==s?void 0:s.products)||void 0===_?void 0:_.maxPrice)||1e4,category:(null===(P=null==i?void 0:i.data)||void 0===P?void 0:P.category)||{},categories:(null===($=null===(w=null==a?void 0:a.data)||void 0===w?void 0:w.categories)||void 0===$?void 0:$.categories)||[],products:s.products.products,attributes:s.products.attributeValues,itemsPerPage:1,facets:{},perPageOptions:20,totalProducts:s.products.totalCount}]}}))}))}},index$d=core.useFacetFactory(factoryParams$7),factoryParams$6={make:function(e,t){return t.customQuery,__awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return console.log("Mocked: makeOrder"),[2,{id:"123-456-7890"}]}))}))}},useMakeOrder=core.useMakeOrderFactory(factoryParams$6),useMakeOrder$1=useMakeOrder,params$6={productsSearch:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(o){switch(o.label){case 0:return r=t.customQuery,[4,e.$odoo.api.getProductTemplate(t,r,t.cacheKey)];case 1:return[2,o.sent().data.product]}}))}))}},index$c=core.useProductFactory(params$6),useMultipleProductFactory=function(e){return function(){var t=this,r=core.sharedRef(!1,"useMultipleProduct-loading"),o=core.configureFactoryParams(e),n=core.sharedRef({addMultipleProductsToCart:null,removeMultipleProductsFromCart:null},"useMultipleProduct-error"),i=function(){n.value={addMultipleProductsToCart:null,removeMultipleProductsFromCart:null}};return{error:compositionApi.computed((function(){return n.value})),loading:compositionApi.computed((function(){return r.value})),addMultipleProductsToCart:function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(a){switch(a.label){case 0:core.Logger.debug("useMultipleProduct.addMultipleProductsToCart",e),i(),a.label=1;case 1:return a.trys.push([1,3,4,5]),r.value=!0,n.value.addMultipleProductsToCart=null,[4,o.addMultipleProductsToCart(e)];case 2:return[2,a.sent()];case 3:return t=a.sent(),n.value.addMultipleProductsToCart=t,core.Logger.error("useMultipleProduct/addMultipleProductsToCart",t),[3,5];case 4:return r.value=!1,[7];case 5:return[2]}}))}))},removeMultipleProductsFromCart:function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(a){switch(a.label){case 0:core.Logger.debug("useMultipleProduct.removeMultipleProductsToCart",e),i(),a.label=1;case 1:return a.trys.push([1,3,4,5]),r.value=!0,n.value.removeMultipleProductsFromCart=null,[4,o.removeMultipleProductsFromCart(e)];case 2:return[2,a.sent()];case 3:return t=a.sent(),n.value.removeMultipleProductsFromCart=t,core.Logger.error("useMultipleProduct/removeMultipleProductsToCart",t),[3,5];case 4:return r.value=!1,[7];case 5:return[2]}}))}))}}}},useMultipleProductFactory$1=Object.freeze({__proto__:null,useMultipleProductFactory:useMultipleProductFactory}),resolvePath=function(e,t,r){return t.split(".").reduce((function(e,t){return e?e[t]:r}),e)},params$5={provide:function(){return{useCart:useCart()}},addMultipleProductsToCart:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o,n,i,a,u,s,d,c;return __generator(this,(function(l){switch(l.label){case 0:return r=t.customQuery,[4,e.$odoo.api.cartAddMultipleItems(t,r)];case 1:return o=l.sent().data,e.useCart.setCart(o.cartAddMultipleItems),n=(null===(d=null===(s=null===(u=null===(a=null===(i=null==e?void 0:e.$odoo)||void 0===i?void 0:i.config)||void 0===a?void 0:a.app)||void 0===u?void 0:u.$config)||void 0===s?void 0:s.cart)||void 0===d?void 0:d.cookieIndex)||"orderLines.length",e.$odoo.config.app.$cookies.set("cart-size",resolvePath(null===(c=null==o?void 0:o.cartAddMultipleItems)||void 0===c?void 0:c.order,n,0)||0),[2,o.cartAddMultipleItems]}}))}))},removeMultipleProductsFromCart:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o,n,i,a,u,s,d,c;return __generator(this,(function(l){switch(l.label){case 0:return r=t.customQuery,[4,e.$odoo.api.cartRemoveMultipleItems(t,r)];case 1:return o=l.sent().data,e.useCart.setCart(o.cartRemoveMultipleItems),n=(null===(d=null===(s=null===(u=null===(a=null===(i=null==e?void 0:e.$odoo)||void 0===i?void 0:i.config)||void 0===a?void 0:a.app)||void 0===u?void 0:u.$config)||void 0===s?void 0:s.cart)||void 0===d?void 0:d.cookieIndex)||"orderLines.length",e.$odoo.config.app.$cookies.set("cart-size",resolvePath(null===(c=null==o?void 0:o.cartRemoveMultipleItems)||void 0===c?void 0:c.order,n,0)||0),[2,o.cartRemoveMultipleItems]}}))}))}},index$b=useMultipleProductFactory(params$5),params$4={searchReviews:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return console.log("Mocked: searchReviews"),[2,{}]}))}))},addReview:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return console.log("Mocked: addReview"),[2,{}]}))}))}},index$a=core.useReviewFactory(params$4),throwErrors$2=function(e){var t,r,o,n,i,a;if(null===(t=null==e?void 0:e.response.data)||void 0===t?void 0:t.networkError){var u=(null===(n=null===(o=null===(r=e.response.data)||void 0===r?void 0:r.networkError)||void 0===o?void 0:o.result)||void 0===n?void 0:n.errors)||[];throw new Error(u.map((function(e){return e.message})).join(",")||"Some error")}if(null===(i=null==e?void 0:e.response.data)||void 0===i?void 0:i.graphQLErrors){u=(null===(a=e.response.data)||void 0===a?void 0:a.graphQLErrors)||[];throw new Error(u.map((function(e){return e.message})).join(",")||"Some error")}},factoryParams$5={provide:function(){return{useCart:useCart()}},load:function(e,t){var r=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,o,n,i,a,u,s;return __generator(this,(function(d){switch(d.label){case 0:return e.useCart.cart?[3,2]:[4,e.useCart.load(r)];case 1:d.sent(),d.label=2;case 2:return t=(null===(a=null===(i=null===(n=null===(o=e.useCart)||void 0===o?void 0:o.cart)||void 0===n?void 0:n.value)||void 0===i?void 0:i.order)||void 0===a?void 0:a.partnerShipping)||{},[2,__assign(__assign({},t),{country:{id:String(null===(u=null==t?void 0:t.country)||void 0===u?void 0:u.id)},state:{id:String(null===(s=null==t?void 0:t.state)||void 0===s?void 0:s.id)}})]}}))}))},save:function(e,t){var r=t.params,o=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,n,i,a,u;return __generator(this,(function(s){switch(s.label){case 0:if(!("id"in r)||!r.id)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e.$odoo.api.shippingUpdateAddress(r,o)];case 2:return t=s.sent().data,e.useCart.cart.value.order.partnerShipping=t.updateAddress,[2,t.updateAddress];case 3:return n=s.sent(),throwErrors$2(n),[3,4];case 4:return[4,e.$odoo.api.shippingAddAdress(r,o)];case 5:return i=s.sent(),a=i.data,u=i.errors,throwErrors$2(u),e.useCart.cart.value.order.partnerShipping=a.addAddress,[2,a.addAddress]}}))}))}},index$9=core.useShippingFactory(factoryParams$5),throwErrors$1=function(e){var t,r,o,n,i,a;if(null===(t=null==e?void 0:e.response.data)||void 0===t?void 0:t.networkError){var u=(null===(n=null===(o=null===(r=e.response.data)||void 0===r?void 0:r.networkError)||void 0===o?void 0:o.result)||void 0===n?void 0:n.errors)||[];throw new Error(u.map((function(e){return e.message})).join(",")||"Some error")}if(null===(i=null==e?void 0:e.response.data)||void 0===i?void 0:i.graphQLErrors){u=(null===(a=e.response.data)||void 0===a?void 0:a.graphQLErrors)||[];throw new Error(u.map((function(e){return e.message})).join(",")||"Some error")}},useShippingProviderFactoryParams={provide:function(){return{useCart:useCart()}},load:function(e,t){var r=t.customQuery,o=t.state;return __awaiter(void 0,void 0,void 0,(function(){var t,n,i;return __generator(this,(function(a){switch(a.label){case 0:return[4,e.$odoo.api.shippingGetDeliveryMethods(r)];case 1:return t=a.sent(),n=t.data,i=t.errors,o.value=n.deliveryMethods,throwErrors$1(i),[2,n.deliveryMethods]}}))}))},save:function(e,t){var r=t.shippingMethod,o=t.customQuery;return t.state,__awaiter(void 0,void 0,void 0,(function(){var t,n,i,a,u,s,d;return __generator(this,(function(c){switch(c.label){case 0:return[4,e.$odoo.api.setShippingMethod({shippingMethodId:r.id},o)];case 1:return t=c.sent(),n=t.data,i=t.errors,e.useCart.cart.value.order.shippingMethod=null===(u=null===(a=n.setShippingMethod)||void 0===a?void 0:a.order)||void 0===u?void 0:u.shippingMethod,throwErrors$1(i),[2,[null===(d=null===(s=n.setShippingMethod)||void 0===s?void 0:s.order)||void 0===d?void 0:d.shippingMethod]]}}))}))}},useShippingProvider=core.useShippingProviderFactory(useShippingProviderFactoryParams),throwErrors=function(e){if(e)throw new Error(e.map((function(e){return e.message})).join(",")||"Some error")},factoryParams$4={load:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o,n,i;return __generator(this,(function(a){switch(a.label){case 0:return r=t.customQuery,(o=e.$odoo.config.app.$cookies.get("odoo-user"))?[3,2]:[4,e.$odoo.api.loadUser(r)];case 1:return n=a.sent(),i=n.data,e.$odoo.config.app.$cookies.set("odoo-user",null==i?void 0:i.partner,{sameSite:!0}),[2,null==i?void 0:i.partner];case 2:return[2,o]}}))}))},logOut:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return e.$odoo.config.app.$cookies.remove("odoo-user"),[4,e.$odoo.api.logOutUser()];case 1:return t.sent(),[2]}}))}))},updateUser:function(e,t){var r=t.currentUser,o=t.updatedUserData,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,i,a,u;return __generator(this,(function(s){switch(s.label){case 0:return t={id:r.id,name:o.name,email:o.email},[4,e.$odoo.api.updateAccount(t,n)];case 1:return i=s.sent(),a=i.data,u=i.errors,throwErrors(u),[2,a.updateMyAccount]}}))}))},register:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o,n,i;return __generator(this,(function(a){switch(a.label){case 0:return r=t.customQuery,[4,e.$odoo.api.signUpUser(t,r)];case 1:return o=a.sent(),n=o.data,i=o.errors,throwErrors(i),e.$odoo.config.app.$cookies.set("odoo-user",n.register,{sameSite:!0}),[2,null==n?void 0:n.register]}}))}))},logIn:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o,n,i,a,u;return __generator(this,(function(s){switch(s.label){case 0:return r=t.customQuery,[4,e.$odoo.api.logInUser(t,r)];case 1:return o=s.sent(),n=o.data,i=o.errors,throwErrors(i),e.$odoo.config.app.$cookies.set("odoo-user",null===(a=null==n?void 0:n.login)||void 0===a?void 0:a.partner,{sameSite:!0}),[2,null===(u=null==n?void 0:n.login)||void 0===u?void 0:u.partner]}}))}))},changePassword:function(e,t){return t.currentUser,t.currentPassword,t.newPassword,__awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return console.log("Mocked: changePassword"),[2,{}]}))}))}},index$8=core.useUserFactory(factoryParams$4),params$3={addAddress:function(e,t){var r=t.address,o=t.billing,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:return[4,e.$odoo.api.billingAddAddress(r,n)];case 1:return t=i.sent().data,[2,__spreadArray(__spreadArray([],__read(o)),[t.addAddress])]}}))}))},deleteAddress:function(e,t){var r=t.address,o=t.billing,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:return t={id:r.id},[4,e.$odoo.api.deleteAddress(t,n)];case 1:return i.sent(),[2,o.filter((function(e){return e.id!==r.id}))]}}))}))},updateAddress:function(e,t){var r=t.address,o=t.billing,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,i,a;return __generator(this,(function(u){switch(u.label){case 0:return[4,e.$odoo.api.billingUpdateAddress(r,n)];case 1:return t=u.sent().data,i=__spreadArray([],__read(o)),a=i.findIndex((function(e){return e.id===t.updateAddress.id})),i[a]=t.updateAddress,[2,i]}}))}))},load:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(o){switch(o.label){case 0:return r=t.customQuery,[4,e.$odoo.api.billingGetAddress(r)];case 1:return[2,o.sent().data.addresses]}}))}))},setDefaultAddress:function(e,t){var r=t.address,o=t.billing;return __awaiter(void 0,void 0,void 0,(function(){var t,n,i,a,u;return __generator(this,(function(s){switch(s.label){case 0:return[4,e.$odoo.api.setDefaultAddress({id:r.id,type:odooApi.AddressType.Billing})];case 1:return t=s.sent(),n=t.data,i=t.errors,throwErrors$1(i),a=__spreadArray([],__read(o)),u=a.findIndex((function(e){return e.id===n.selectAddress.id})),a[u]=n.selectAddress,[2,a]}}))}))}},index$7=core.useUserBillingFactory(params$3),params$2={searchOrders:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o;return __generator(this,(function(n){switch(n.label){case 0:return[4,e.$odoo.api.ordersGet(t,null==t?void 0:t.customQuery)];case 1:return r=n.sent().data,[2,(null===(o=null==r?void 0:r.orders)||void 0===o?void 0:o.orders)||[]]}}))}))}},index$6=core.useUserOrderFactory(params$2),params$1={addAddress:function(e,t){var r=t.address,o=t.shipping,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:return[4,e.$odoo.api.shippingAddAdress(r,n)];case 1:return t=i.sent().data,[2,__spreadArray(__spreadArray([],__read(o)),[t.addAddress])]}}))}))},deleteAddress:function(e,t){var r=t.address,o=t.shipping,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:return t={id:r.id},[4,e.$odoo.api.deleteAddress(t,n)];case 1:return i.sent(),[2,o.filter((function(e){return e.id!==r.id}))]}}))}))},updateAddress:function(e,t){var r=t.address,o=t.shipping,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,i,a;return __generator(this,(function(u){switch(u.label){case 0:return[4,e.$odoo.api.shippingUpdateAddress(r,n)];case 1:return t=u.sent().data,i=__spreadArray([],__read(o)),a=i.findIndex((function(e){return e.id===t.updateAddress.id})),i[a]=t.updateAddress,[2,i]}}))}))},load:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(o){switch(o.label){case 0:return r=t.customQuery,[4,e.$odoo.api.shippingGetAddress(r)];case 1:return[2,o.sent().data.addresses]}}))}))},setDefaultAddress:function(e,t){var r=t.address,o=t.shipping;return __awaiter(void 0,void 0,void 0,(function(){var t,n,i,a,u;return __generator(this,(function(s){switch(s.label){case 0:return[4,e.$odoo.api.setDefaultAddress({id:r.id,type:odooApi.AddressType.Shipping})];case 1:return t=s.sent(),n=t.data,i=t.errors,throwErrors$1(i),a=__spreadArray([],__read(o)),u=a.findIndex((function(e){return e.id===n.selectAddress.id})),a[u]=n.selectAddress,[2,a]}}))}))}},index$5=core.useUserShippingFactory(params$1),params={load:function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r;return __generator(this,(function(o){switch(o.label){case 0:return[4,e.$odoo.api.wishlistLoad()];case 1:return t=o.sent().data,e.$odoo.config.app.$cookies.set("wishlist-size",(null===(r=null==t?void 0:t.wishlistItems.wishlistItems)||void 0===r?void 0:r.length)||0),[2,t.wishlistItems]}}))}))},addItem:function(e,t){var r=t.currentWishlist,o=t.product,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,i,a;return __generator(this,(function(u){switch(u.label){case 0:return params.isInWishlist(e,{currentWishlist:r,product:o})?[3,2]:(t={productId:o.firstVariant.id},[4,e.$odoo.api.wishlistAddItem(t,n)]);case 1:return i=u.sent().data,e.$odoo.config.app.$cookies.set("wishlist-size",(null===(a=null==i?void 0:i.wishlistAddItem.wishlistItems)||void 0===a?void 0:a.length)||0),[2,i.wishlistAddItem];case 2:return[2,r]}}))}))},removeItem:function(e,t){var r=t.currentWishlist,o=t.product,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t,i,a,u,s;return __generator(this,(function(d){switch(d.label){case 0:return t=o.product.firstVariant.id||o.product.id,i=r.wishlistItems.find((function(e){return e.product.id==t})),a={wishId:i.id},[4,e.$odoo.api.wishlistRemoveItem(a,n)];case 1:return u=d.sent().data,e.$odoo.config.app.$cookies.set("wishlist-size",(null===(s=null==u?void 0:u.wishlistRemoveItem.wishlistItems)||void 0===s?void 0:s.length)||0),[2,u.wishlistRemoveItem]}}))}))},isInWishlist:function(e,t){var r=t.currentWishlist,o=t.product;return null==r?void 0:r.wishlistItems.some((function(e){return e.product.id==o.firstVariant.id}))},clear:function(e,t){var r=t.currentWishlist;return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return console.log("Mocked: clearWishlist"),[2,r]}))}))}},index$4=core.useWishlistFactory(params),useCountrySearch=function(e){var t="country",r=core.useVSFContext(),o=compositionApi$1.ref({graphQLErrors:[]}),n=compositionApi$1.ssrRef([],t),i=compositionApi$1.ssrRef([],t);return{search:function(){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,r.$odoo.api.getCountries()];case 1:return e=t.sent().data,n.value=e.countries.countries,[2]}}))}))},resetCountryErrors:function(){return o.value={graphQLErrors:[]}},searchCountryStates:function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,o,n;return __generator(this,(function(a){switch(a.label){case 0:return e?(t={id:parseInt(e)},[4,r.$odoo.api.getCountryStates(t)]):[2];case 1:return o=a.sent().data,i.value=(null===(n=null==o?void 0:o.country)||void 0===n?void 0:n.states)||[],[2]}}))}))},countries:n,countryStates:i,errors:o}},useCountrySearch$1=useCountrySearch,usePassword=function(){var e=core.useVSFContext(),t=compositionApi$1.ref(null),r=core.sharedRef(!1,"usePasswordLoading"),o=function(){return t.value=null};return{resetPassword:function(r){var o=r.password,n=r.token;return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,e.$odoo.api.changePassword({newPassword:o,token:n}).catch((function(e){t.value=e}))];case 1:return[2,r.sent()]}}))}))},sendResetPassword:function(r){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,e.$odoo.api.sendResetPassword(r).catch((function(e){t.value=e}))];case 1:return[2,o.sent()]}}))}))},resetPasswordErrors:o,errors:t,updatePassword:function(n,i){return __awaiter(void 0,void 0,void 0,(function(){var a,u,s,d;return __generator(this,(function(c){switch(c.label){case 0:o(),r.value=!0,c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,e.$odoo.api.updatePassword({currentPassword:n,newPassword:i})];case 2:return a=c.sent(),u=a.data,s=a.errors,u.updatePassword?[2,u.updatePassword]:(t.value=s,[3,5]);case 3:return d=c.sent(),t.value=d,[3,5];case 4:return r.value=!1,[7];case 5:return[2]}}))}))},loading:r}},usePassword$1=usePassword,useProductVariant=function(e){var t,r=core.useVSFContext(),o=core.vsfRef([],"errors"),n=core.vsfRef([],"productVariants"),i=core.sharedRef(null,(null===(t=null==Object?void 0:Object.values(e))||void 0===t?void 0:t.join("-"))||"realProduct");return{elementNames:core.vsfRef({},"elementNames"),resetPasswordErrors:function(){return o.value=[]},searchRealProduct:function(e){var t=e.productTemplateId,o=e.combinationIds,n=e.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var e,a;return __generator(this,(function(u){switch(u.label){case 0:return e={combinationId:o.map((function(e){return parseInt(e)})),productTemplateId:t},0===o.length?[2]:[4,r.$odoo.api.getRealProduct(e,n)];case 1:return a=u.sent().data,i.value=null==a?void 0:a.productVariant,[2]}}))}))},productVariants:n,realProduct:i,errors:o}},useProductVariant$1=useProductVariant,factoryParams$3={resetPassword:function(e,t){var r=t.email,o=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return t={email:r},[4,e.$odoo.api.sendResetPassword(t,o)];case 1:return[2,n.sent().data]}}))}))},setNewPassword:function(e,t){var r=t.tokenValue,o=t.newPassword,n=t.customQuery;return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,e.$odoo.api.changePassword({token:r,newPassword:o},n)];case 1:return t.sent(),[2,{}]}}))}))}},index$3=core.useForgotPasswordFactory(factoryParams$3),usePaymentFactory=function(e){return function(t){var r=this,o=t||"usePayment",n=core.configureFactoryParams(e),i=core.sharedRef(null,o+"-providerList"),a=core.sharedRef(!1,o+"-loading"),u=core.sharedRef({getPaymentProviderList:null,getPaymentConfirmation:null},o+"-error");return{loading:compositionApi$1.computed((function(){return a.value})),error:compositionApi$1.computed((function(){return u.value})),providerList:i,getPaymentProviderList:function(e){return __awaiter(r,void 0,void 0,(function(){var r,o;return __generator(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,3,4]),a.value=!0,[4,n.getPaymentProviderList(e)];case 1:return r=s.sent(),i.value=r,[2,r];case 2:return o=s.sent(),u.value.getPaymentProviderList=o,core.Logger.error("UsePayment/"+t+"/getPaymentProviderList",o),[3,4];case 3:return a.value=!1,[7];case 4:return[2]}}))}))},getPaymentConfirmation:function(e){return __awaiter(r,void 0,void 0,(function(){var r;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,4]),a.value=!0,[4,n.getPaymentConfirmation(e)];case 1:return[2,o.sent()];case 2:return r=o.sent(),u.value.getPaymentConfirmation=r,core.Logger.error("UsePayment/"+t+"/getPaymentConfirmation",r),[3,4];case 3:return a.value=!1,[7];case 4:return[2]}}))}))}}}},usePaymentFactory$1=Object.freeze({__proto__:null,usePaymentFactory:usePaymentFactory}),factoryParams$2={provide:function(){return{useCart:useCart()}},getPaymentProviderList:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,e.$odoo.api.paymentLoadProviders(t)];case 1:return[2,r.sent().data.paymentAcquirers]}}))}))},getPaymentConfirmation:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,o;return __generator(this,(function(n){switch(n.label){case 0:return r=t.customQuery,[4,e.$odoo.api.paymentConfirmation(t,r)];case 1:return o=n.sent().data,e.useCart.cart.value=o.paymentConfirmation,[2,o.paymentConfirmation]}}))}))}},index$2=usePaymentFactory(factoryParams$2),usePaymentProviderFactory=function(e){return function(t){var r=this,o=core.configureFactoryParams(e),n=t.id||"usePaymentProvider",i=core.sharedRef(null,n+"-provider"),a=core.sharedRef(!1,n+"-loading"),u=core.sharedRef({getPaymentMethods:null,getPaymentExternal:null},n+"-error"),s=o.getPaymentMethods;return{loading:compositionApi$1.computed((function(){return a.value})),error:compositionApi$1.computed((function(){return u.value})),getPaymentMethods:s,getPaymentExternal:function(){return __awaiter(r,void 0,void 0,(function(){var e,r,a;return __generator(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),e={paymentAcquireId:t.id},[4,o.getPaymentExternal({params:e})];case 1:return r=s.sent(),i.value=r,[2,r];case 2:return a=s.sent(),u.value.getPaymentExternal=a,core.Logger.error("UsePayment/"+n+"/getPaymentExternal",a),[3,3];case 3:return[2]}}))}))},paymentExternalResponse:i}}},usePaymentProviderFactory$1=Object.freeze({__proto__:null,usePaymentProviderFactory:usePaymentProviderFactory}),factoryParams$1={getPaymentMethods:function(e,t){return console.log("implement getPaymentMethods"),[]},getPaymentExternal:function(e,t){var r=t.params;return __awaiter(void 0,void 0,void 0,(function(){var t,o;return __generator(this,(function(n){switch(n.label){case 0:return t={paymentAcquireId:r.paymentAcquireId},[4,e.$odoo.api.paymentMakeExternal(t)];case 1:return[2,null==(o=n.sent().data)?void 0:o.makePayment.form]}}))}))}},index$1=usePaymentProviderFactory(factoryParams$1),useAdyenDirectPayment=function(e,t){var r=core.useVSFContext(),o=core.sharedRef({},"transaction-"+t),n=core.sharedRef({},"acquirerInfo-"+t),i=core.sharedRef({},"paymentMethods-"+t),a=core.sharedRef({},"paymentDetails-"+t);return{getAdyenPaymentMethods:function(){return __awaiter(void 0,void 0,void 0,(function(){var t,o;return __generator(this,(function(n){switch(n.label){case 0:return[4,r.$odoo.api.adyenPaymentMethods({acquirerId:e})];case 1:return t=n.sent().data,i.value=(null===(o=null==t?void 0:t.adyenPaymentMethods)||void 0===o?void 0:o.adyenPaymentMethods)||{},[2]}}))}))},paymentMethods:i,transaction:o,acquirerInfo:n,openAdyenTransaction:function(){return __awaiter(void 0,void 0,void 0,(function(){var t,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,r.$odoo.api.adyenOpenTransaction({acquirerId:e})];case 1:return t=i.sent().data,o.value=(null===(n=null==t?void 0:t.adyenTransaction)||void 0===n?void 0:n.transaction)||{},[2]}}))}))},adyenMakeDirectPayment:function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,o;return __generator(this,(function(n){switch(n.label){case 0:return[4,r.$odoo.api.adyenMakeDirectPayment(e)];case 1:return t=n.sent().data,[2,(null===(o=null==t?void 0:t.adyenPayments)||void 0===o?void 0:o.adyenPayments)||{}]}}))}))},getAdyenAcquirerInfo:function(){return __awaiter(void 0,void 0,void 0,(function(){var t,o;return __generator(this,(function(i){switch(i.label){case 0:return[4,r.$odoo.api.adyenAcquirerInfo({acquirerId:e})];case 1:return t=i.sent().data,n.value=(null===(o=null==t?void 0:t.adyenAcquirerInfo)||void 0===o?void 0:o.adyenAcquirerInfo)||{},[2]}}))}))},getAdyenPaymentDetails:function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,o;return __generator(this,(function(n){switch(n.label){case 0:return[4,r.$odoo.api.adyenPaymentDetails(e)];case 1:return t=n.sent().data,a.value=(null===(o=null==t?void 0:t.adyenPaymentDetails)||void 0===o?void 0:o.adyenPaymentDetails)||{},[2]}}))}))},setTransaction:function(e){return e.value=e}}},useAdyenDirectPayment$1=useAdyenDirectPayment,useShipping=function(){var e=core.useVSFContext(),t=compositionApi$1.ref({graphQLErrors:[]}),r=core.sharedRef([],"shippingMethods");return{resetCountryErrors:function(){return t.value={graphQLErrors:[]}},searchShippingMethods:function(){return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(o){switch(o.label){case 0:return r.value.length>0?[2,r]:[4,e.$odoo.api.shippingGetDeliveryMethods()];case 1:return t=o.sent().data,r.value=t.deliveryMethods.map((function(e){return __assign(__assign({},e),{id:String(e.id)})})),[2]}}))}))},shippingMethods:r,errors:t}},useShipping$1=useShipping,useStore=core.useStoreFactory({load:function(e,t){return console.log("Mocked: useStore.load"),Promise.resolve({})},change:function(e,t){return console.log("Mocked: useStore.change"),Promise.resolve({})}}),useStore$1=useStore,useNewsletterFactory=function(e){return function(){var t=this,r=core.sharedRef(!1,"useNewsletter-loading"),o=core.configureFactoryParams(e),n=core.sharedRef({sendSubscription:null},"useNewsletter-error");return{error:compositionApi.computed((function(){return n.value})),loading:compositionApi.computed((function(){return r.value})),sendSubscription:function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:core.Logger.debug("useNewsletterFactory.sendSubscription",e),n.value={sendSubscription:null},i.label=1;case 1:return i.trys.push([1,3,4,5]),r.value=!0,n.value.sendSubscription=null,[4,o.sendSubscription(e)];case 2:return[2,i.sent()];case 3:return t=i.sent(),n.value.sendSubscription=t,core.Logger.error("useNewsletter/sendSubscription",t),[3,5];case 4:return r.value=!1,[7];case 5:return[2]}}))}))}}}},useNewsLetterFactory=Object.freeze({__proto__:null,useNewsletterFactory:useNewsletterFactory}),factoryParams={sendSubscription:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return core.Logger.debug("[Odoo]: Update user newsletter subscription",{params:t}),[4,e.$odoo.api.subscribeNewsLetter({email:t.email})];case 1:return[2,r.sent().data.newsletterSubscribe]}}))}))}},index=useNewsletterFactory(factoryParams),useMailing=function(){var e=core.useVSFContext(),t=compositionApi$1.ref(!1),r=core.sharedRef([],"mailingList"),o=core.sharedRef([],"mailingContacts"),n=compositionApi$1.ref({}),i=function(){n.value={graphQLErrors:[]}};return{getMailingContacts:function(){return __awaiter(void 0,void 0,void 0,(function(){var r,a,u;return __generator(this,(function(s){switch(s.label){case 0:i(),t.value=!0,s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,e.$odoo.api.getMailingContacts()];case 2:return r=s.sent().data,o.value=null===(u=null==r?void 0:r.mailingContacts)||void 0===u?void 0:u.mailingContacts,[3,5];case 3:return a=s.sent(),n.value=a,[3,5];case 4:return t.value=!1,[7];case 5:return[2]}}))}))},getMailingLists:function(){return __awaiter(void 0,void 0,void 0,(function(){var o,a,u;return __generator(this,(function(s){switch(s.label){case 0:i(),t.value=!0,s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,e.$odoo.api.getMailingLists()];case 2:return o=s.sent().data,r.value=null===(u=null==o?void 0:o.mailingLists)||void 0===u?void 0:u.mailingLists,[3,5];case 3:return a=s.sent(),n.value=a,[3,5];case 4:return t.value=!1,[7];case 5:return[2]}}))}))},userAddMultipleMailing:function(r){return __awaiter(void 0,void 0,void 0,(function(){var o,a,u;return __generator(this,(function(s){switch(s.label){case 0:i(),t.value=!0,s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,e.$odoo.api.addMultipleMailings({mailings:r})];case 2:return o=s.sent(),(a=o.data)?[2,a]:(n.value=o.errors,[3,5]);case 3:return u=s.sent(),n.value=u,[3,5];case 4:return t.value=!1,[7];case 5:return[2]}}))}))},errors:n,loading:t,mailingList:r,mailingContacts:o}},useMailing$1=useMailing,useCartRedis=function(e){var t=core.useVSFContext().$odoo,r=useCart(),o=r.cart,n=r.load,i=r.setCart,a=core.sharedRef({orderLines:[],totalItemsInCart:0,totalItemsInCartWithQuantity:0},"vsf-odoo-cart"),u=core.sharedRef(!1,"cart-loading"),s=compositionApi$1.computed((function(){var e;return(null===(e=a.value)||void 0===e?void 0:e.totalItemsInCart)||0})),d=compositionApi$1.computed((function(){var e;return(null===(e=a.value)||void 0===e?void 0:e.totalItemsInCartWithQuantity)||0})),c=compositionApi$1.computed((function(){var e;return(null===(e=a.value)||void 0===e?void 0:e.amountTotal)||0}));return{load:function(){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return u.value=!0,[4,t.api.redisLoadCart()];case 1:return e=r.sent().data,a.value=e,u.value=!1,[2]}}))}))},addItem:function(e,r){return void 0===r&&(r=1),__awaiter(void 0,void 0,void 0,(function(){var o;return __generator(this,(function(n){switch(n.label){case 0:return u.value=!0,[4,t.api.redisAddItemToCart(e,r)];case 1:return o=n.sent().data,a.value=o,u.value=!1,[2]}}))}))},removeItem:function(r,s){return __awaiter(void 0,void 0,void 0,(function(){var d,c,l,v;return __generator(this,(function(g){switch(g.label){case 0:return u.value=!0,d=null,s&&(d=null===(v=null===(l=o.value.order)||void 0===l?void 0:l.orderLines)||void 0===v?void 0:v.find((function(e){return e.product.id===s})).id),[4,t.api.redisRemoveItem(r,d)];case 1:return c=g.sent().data,s?(i(null),[4,n({customQuery:{cartLoad:e}})]):[3,3];case 2:g.sent(),g.label=3;case 3:return a.value=c,u.value=!1,[2]}}))}))},updateItemQty:function(r,s,d){return void 0===s&&(s=1),__awaiter(void 0,void 0,void 0,(function(){var c,l,v,g;return __generator(this,(function(p){switch(p.label){case 0:return u.value=!0,c=null,console.log(d),d&&(c=null===(g=null===(v=o.value.order)||void 0===v?void 0:v.orderLines)||void 0===g?void 0:g.find((function(e){return e.product.id===d})).id),[4,t.api.redisUpdateItemQty(r,s,c)];case 1:return l=p.sent().data,d?(i(null),[4,n({customQuery:{cartLoad:e}})]):[3,3];case 2:p.sent(),p.label=3;case 3:return a.value=l,u.value=!1,[2]}}))}))},isInCart:function(e){var t,r;return null===(r=null===(t=a.value)||void 0===t?void 0:t.orderLines)||void 0===r?void 0:r.some((function(t){return t.product.id===e.id}))},syncCartRedisToOdoo:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.api.redisSyncCartToOdoo()];case 1:return e.sent(),[2]}}))}))},loading:u,amountTotal:c,totalItemsInCart:s,totalItemsInCartWithQuantity:d,cart:a}},useCartRedis$1=useCartRedis;function roundDecimal(e){var t=Number((100*Math.abs(e)).toPrecision(15));return Math.round(t)/100*Math.sign(e)}var getCartItems=function(e){var t,r;return e&&(null===(t=null==e?void 0:e.order)||void 0===t?void 0:t.orderLines)?null===(r=null==e?void 0:e.order)||void 0===r?void 0:r.orderLines:[]},getCartItemName=function(e){return(null==e?void 0:e.product.name)||"Product's name"},getCartItemImage=function(e){var t;return(null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.image)||""},getCartItemPrice=function(e){var t,r,o,n;return{regular:(null===(r=null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.combinationInfo)||void 0===r?void 0:r.list_price)||0,special:(null===(n=null===(o=null==e?void 0:e.product)||void 0===o?void 0:o.combinationInfo)||void 0===n?void 0:n.price)||0}},getCartItemQty=function(e){return e.quantity},getCartItemAttributes=function(e,t){return{}},getCartItemSku=function(e){var t,r;return(null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.sku)||String(null===(r=null==e?void 0:e.product)||void 0===r?void 0:r.id)||"some-sku"},getCartTotals=function(e){var t,r,o;return{total:(null===(t=null==e?void 0:e.order)||void 0===t?void 0:t.amountTotal)||0,subtotal:roundDecimal((null===(r=null==e?void 0:e.order)||void 0===r?void 0:r.amountTotal)-(null===(o=null==e?void 0:e.order)||void 0===o?void 0:o.amountDelivery))||0}},getItemImageFilename=function(e){var t;return(null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.imageFilename)||"Product filename"},getSlug=function(e){var t;return(null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.slug)||"/"},getCartShippingPrice=function(e){var t;return(null===(t=null==e?void 0:e.order)||void 0===t?void 0:t.amountDelivery)||0},getCartTotalItems=function(e){var t,r;return(null===(r=null===(t=null==e?void 0:e.order)||void 0===t?void 0:t.orderLines)||void 0===r?void 0:r.length)||0},getFormattedPrice$4=function(e){return String(e)},getCoupons=function(e){return[]},getDiscounts=function(e){return[]},getCartOrderNumber=function(e){return e.order.name},getCartState=function(e){return e.order.stage},getCartAmountTax=function(e){var t;return(null===(t=null==e?void 0:e.order)||void 0===t?void 0:t.amountTax)||0},cartGetters={getTotals:getCartTotals,getShippingPrice:getCartShippingPrice,getItems:getCartItems,getItemName:getCartItemName,getItemImage:getCartItemImage,getItemPrice:getCartItemPrice,getItemQty:getCartItemQty,getItemAttributes:getCartItemAttributes,getItemSku:getCartItemSku,getFormattedPrice:getFormattedPrice$4,getTotalItems:getCartTotalItems,getItemImageFilename:getItemImageFilename,getCoupons:getCoupons,getDiscounts:getDiscounts,getOrderNumber:getCartOrderNumber,getStage:getCartState,getAmountTax:getCartAmountTax,getSlug:getSlug},cartGetters$1=cartGetters,buildTree=function(e){return e?e.map((function(e){return{label:e.name,slug:e.slug,items:buildTree(e.childs),isCurrent:!1,id:e.id}})):[]},itemToTree=function(e){return{label:e.name,slug:e.slug,items:buildTree(e.childs),isCurrent:!1,id:e.id}},getCategoryTree$1=function(e){return e?itemToTree(e):{}},categoryGetters={getTree:getCategoryTree$1},CategoryGetters=categoryGetters,getShippingMethodId=function(e){return String(e.id)||""},getShippingMethodName=function(e){return e.name||""},getShippingMethodDescription=function(e){return""},getShippingMethodPrice=function(e){return(null==e?void 0:e.price)||0},getFormattedPrice$3=function(e){return String(e)},checkoutGetters={getShippingMethodId:getShippingMethodId,getShippingMethodName:getShippingMethodName,getShippingMethodDescription:getShippingMethodDescription,getFormattedPrice:getFormattedPrice$3,getShippingMethodPrice:getShippingMethodPrice},checkoutGetters$1=checkoutGetters,getAll=function(e,t){return[]},isNumeric=function(e){return!isNaN(e)},getGrouped=function(e,t){var r;if(!(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.attributes))return[];var o=[];return e.data.attributes.forEach((function(e){var t,r,n=o.find((function(t){var r;return t.atributeName===(null===(r=e.attribute)||void 0===r?void 0:r.name)}));n||o.push({id:String(e.attribute.id),label:null===(t=e.attribute)||void 0===t?void 0:t.name,atributeName:null===(r=e.attribute)||void 0===r?void 0:r.name,type:e.displayType,count:0,options:[]}),o.find((function(t){var r;return t.atributeName===(null===(r=e.attribute)||void 0===r?void 0:r.name)})).options.push({id:String(e.search),value:e.id,label:e.name,metadata:e.search,htmlColor:e.htmlColor})})),o},getSortOptions=function(e){return{options:[{id:"list_price desc",value:"price,DESC",attrName:"Price: High to Low",type:""},{id:"list_price asc",value:"price,ASC",attrName:"Price: Low to High",type:""},{id:"name asc",value:"name,ASC",attrName:"Name: A to Z",type:""},{id:"name desc",value:"name,DESC",attrName:"Name: Z to A",type:""}],selected:e.input.sort||"name asc"}},getCategoryTree=function(e){var t,r;if(!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.category))return{items:[],label:"",isCurrent:!1};var o=e.data.category,n=o;return!(null==o?void 0:o.childs)&&(null==o?void 0:o.parent)&&(n=null===(r=null==o?void 0:o.parent)||void 0===r?void 0:r.parent),CategoryGetters.getTree(n)},getProducts=function(e){var t,r,o;return(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.products)&&0!==(null===(o=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.products)||void 0===o?void 0:o.length)?e.data.products:[]},getPagination=function(e){var t,r,o,n=(null===(t=e.input)||void 0===t?void 0:t.pageSize)||12;return{currentPage:1,totalPages:Math.ceil((null===(r=e.data)||void 0===r?void 0:r.totalProducts)/n)||1,totalItems:null===(o=e.data)||void 0===o?void 0:o.totalProducts,itemsPerPage:n,pageOptions:[5,12,15,20]}},getBreadcrumbsByProduct=function(e){var t,r,o,n=null===(t=e.categories)||void 0===t?void 0:t.filter((function(e){return"All"!==(null==e?void 0:e.name)})),i=[{text:"Home",link:"/"}];return n?(i.push({text:null===(r=n[0])||void 0===r?void 0:r.name,link:null===(o=n[0])||void 0===o?void 0:o.slug}),i||[]):[]},getBreadcrumbs=function(e){var t,r,o=e.input,n=[{text:"Home",link:"/"}];if(n.push({text:null===(t=o.currentRootCategory)||void 0===t?void 0:t.name,link:null===(r=o.currentRootCategory)||void 0===r?void 0:r.slug}),o.params.slug_2&&!isNumeric(o.params.slug_2)){var i=o.params.slug_2.split("-");n.push({text:i[2],link:""})}return n},facetGetters={getBreadcrumbsByProduct:getBreadcrumbsByProduct,getSortOptions:getSortOptions,getGrouped:getGrouped,getAll:getAll,getProducts:getProducts,getCategoryTree:getCategoryTree,getBreadcrumbs:getBreadcrumbs,getPagination:getPagination},facetGetters$1=facetGetters,getProductName=function(e){return(null==e?void 0:e.name)||"Product's name"},getProductProperties=function(e){return(null==e?void 0:e.attributeValues)||[]},getProductCode=function(e){return(null==e?void 0:e.sku)||""},getProductSlug=function(e){return(null==e?void 0:e.slug)||""},getProductPrice=function(e){var t,r,o,n;return{regular:(null===(t=null==e?void 0:e.combinationInfo)||void 0===t?void 0:t.list_price)||(null===(r=null==e?void 0:e.combinationInfo)||void 0===r?void 0:r.list_price),special:(null===(o=null==e?void 0:e.combinationInfo)||void 0===o?void 0:o.price)||(null===(n=null==e?void 0:e.combinationInfo)||void 0===n?void 0:n.price)}},getProductGallery=function(e){var t,r,o=[],n=(null===(r=null===(t=null==e?void 0:e.realProduct)||void 0===t?void 0:t.product)||void 0===r?void 0:r.image)||(null==e?void 0:e.image)||"",i=n;return o.push({small:""+((null==e?void 0:e.smallImage)||""),big:i,normal:n}),o},getProductCoverImage=function(e){return(null==e?void 0:e.image)||""},getProductImageFilename=function(e){return(null==e?void 0:e.imageFilename)||""},getProductSku=function(e){return e.sku},getProductFiltered=function(e,t){return e||[]},getProductAttributes=function(e,t){var r,o,n,i={},a={};return null===(r=null==e?void 0:e.attributeValues)||void 0===r||r.forEach((function(e){a[e.attribute.name]={type:e.displayType,variantId:e.id,label:e.attribute.name,values:[]}})),null===(o=null==e?void 0:e.attributeValues)||void 0===o||o.forEach((function(e){a[e.attribute.name].values.push({value:String(e.id),label:e.name})})),null===(n=null==e?void 0:e.attributeValues)||void 0===n||n.forEach((function(e){i[e.displayType]||(i[e.displayType]=[]),a[e.attribute.name].type!==e.displayType||i[e.displayType].some((function(t){return t.variantId===a[e.attribute.name].variantId}))||i[e.displayType].push(a[e.attribute.name])})),i},getProductDescription=function(e){var t;return(null===(t=e)||void 0===t?void 0:t.description)||""},getProductCategoryIds=function(e){var t;return(null===(t=e)||void 0===t?void 0:t.categoriesRef)||""},getProductId=function(e){var t;return(null===(t=e)||void 0===t?void 0:t.id)||""},getFormattedPrice$2=function(e){return String(e)},getProductTotalReviews=function(e){return 0},getProductAverageRating=function(e){return 0},productGetters={getName:getProductName,getSlug:getProductSlug,getPrice:getProductPrice,getGallery:getProductGallery,getCoverImage:getProductCoverImage,getFiltered:getProductFiltered,getAttributes:getProductAttributes,getDescription:getProductDescription,getCategoryIds:getProductCategoryIds,getId:getProductId,getFormattedPrice:getFormattedPrice$2,getTotalReviews:getProductTotalReviews,getAverageRating:getProductAverageRating,getProperties:getProductProperties,getCode:getProductCode,getSku:getProductSku,getImageFilename:getProductImageFilename},productGetters$1=productGetters,getItems$1=function(e){return[]},getReviewId=function(e){return""},getReviewAuthor=function(e){return""},getReviewMessage=function(e){return""},getReviewRating=function(e){return 0},getReviewDate=function(e){return""},getTotalReviews=function(e){return 0},getAverageRating=function(e){return 0},getRatesCount=function(e){return[]},getReviewsPage=function(e){return 1},reviewGetters={getItems:getItems$1,getReviewId:getReviewId,getReviewAuthor:getReviewAuthor,getReviewMessage:getReviewMessage,getReviewRating:getReviewRating,getReviewDate:getReviewDate,getTotalReviews:getTotalReviews,getAverageRating:getAverageRating,getRatesCount:getRatesCount,getReviewsPage:getReviewsPage},reviewGetters$1=reviewGetters,getUserFirstName=function(e){return(null==e?void 0:e.name)||""},getUserLastName=function(e){return(null==e?void 0:e.name)||""},getUserFullName=function(e){return(null==e?void 0:e.name)||""},getUserEmailAddress=function(e){return(null==e?void 0:e.email)||""},getAgnosticUserFromUser=function(e){return{password:e.password,email:e.email,name:e.name,is_admin:!1,uid:0,username:e.name}},userGetters$4={getFirstName:getUserFirstName,getLastName:getUserLastName,getFullName:getUserFullName,getEmailAddress:getUserEmailAddress,getAgnosticUserFromUser:getAgnosticUserFromUser},userGetters$5=userGetters$4,userGetters$2={getAddresses:function(e,t){return e},getDefault:function(e){return e.addresses.find((function(e){return e.isDefault}))},getTotal:function(e){return e.addresses.length},getPostCode:function(e){return e?e.zip:""},getStreetName:function(e){return e?e.street:""},getStreetNumber:function(e){return e?e.streetNumber:""},getCity:function(e){return e?e.city:""},getFirstName:function(e){return e?e.name:""},getLastName:function(e){return e?e.lastName:""},getCountry:function(e){return e?e.country.name:""},getPhone:function(e){return e?e.phone:""},getEmail:function(e){return e?e.email:""},getProvince:function(e){return e?e.state.name:""},getCompanyName:function(e){return e?e.company:""},getTaxNumber:function(e){return e?e.taxId:""},getId:function(e){return e?e.id:""},getApartmentNumber:function(e){return e?e.apartment:""},isDefault:function(e){return!!e&&e.isDefault}},userGetters$3=userGetters$2,userGetters={getAddresses:function(e,t){return e},getDefault:function(e){return e.addresses.find((function(e){return e.isDefault}))},getTotal:function(e){return e.addresses.length},getPostCode:function(e){return e?e.zip:""},getStreetName:function(e){return e?e.street:""},getStreetNumber:function(e){return e?e.streetNumber:""},getCity:function(e){return e?e.city:""},getFirstName:function(e){return e?e.name:""},getLastName:function(e){return e?e.lastName:""},getCountry:function(e){return e?e.country.name:""},getPhone:function(e){return e?e.phone:""},getEmail:function(e){return e?e.email:""},getProvince:function(e){return e?e.state.name:""},getCompanyName:function(e){return e?e.company:""},getTaxNumber:function(e){return e?e.taxId:""},getId:function(e){return e?e.id:""},getApartmentNumber:function(e){return e?e.apartment:""},isDefault:function(e){return!!e&&e.isDefault}},userGetters$1=userGetters,getDate=function(e){var t;return(null===(t=null==e?void 0:e.dateOrder)||void 0===t?void 0:t.toString())||"-"},getId=function(e){var t;return(null===(t=null==e?void 0:e.id)||void 0===t?void 0:t.toString())||""},getStatus=function(e){var t;return(null===(t=null==e?void 0:e.stage)||void 0===t?void 0:t.toString())||"Failed"},getPrice=function(e){return(null==e?void 0:e.amountTotal)||0},getItems=function(e){return(null==e?void 0:e.orderLines)||[]},getItemSku=function(e){return(null==e?void 0:e.name)||""},getItemName=function(e){return(null==e?void 0:e.name)||""},getItemQty=function(e){return(null==e?void 0:e.quantity)||0},getItemPrice=function(e){return e.priceUnit},getFormattedPrice$1=function(e){return String(e)},getOrdersTotal=function(e){return(null==e?void 0:e.length)||0},orderGetters={getDate:getDate,getId:getId,getStatus:getStatus,getPrice:getPrice,getItems:getItems,getItemSku:getItemSku,getItemName:getItemName,getItemQty:getItemQty,getItemPrice:getItemPrice,getFormattedPrice:getFormattedPrice$1,getOrdersTotal:getOrdersTotal},orderGetters$1=orderGetters,getWishlistItems=function(e){return e.wishlistItems},getWishlistItemName=function(e){var t;return(null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.name)||"Product's name"},getWishlistItemImage=function(e){var t;return(null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.image)||""},getWishlistItemImageFilename=function(e){var t;return(null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.imageFilename)||""},getWishlistItemPrice=function(e){return{regular:(null==e?void 0:e.product.price)||1,special:(null==e?void 0:e.product.price)||1}},getWishlistItemQty=function(e){return 1},getWishlistItemAttributes=function(e,t){return{color:"red"}},getWishlistItemSku=function(e){return String(null==e?void 0:e.id)||"some-sku"},getWishlistTotals=function(e){var t,r=null===(t=null==e?void 0:e.wishlistItems)||void 0===t?void 0:t.reduce((function(e,t){return e+t.product.price}),0);return{total:r,subtotal:r}},getWishlistShippingPrice=function(e){return 0},getWishlistTotalItems=function(e){var t;return null===(t=null==e?void 0:e.wishlistItems)||void 0===t?void 0:t.length},getFormattedPrice=function(e){return String(e)},wishlistGetters={getTotals:getWishlistTotals,getShippingPrice:getWishlistShippingPrice,getItems:getWishlistItems,getItemName:getWishlistItemName,getItemImage:getWishlistItemImage,getItemPrice:getWishlistItemPrice,getItemQty:getWishlistItemQty,getItemAttributes:getWishlistItemAttributes,getItemSku:getWishlistItemSku,getTotalItems:getWishlistTotalItems,getItemImageFilename:getWishlistItemImageFilename,getFormattedPrice:getFormattedPrice},wishlistGetters$1=wishlistGetters;function getResetPasswordToken(e){return""}function isPasswordChanged(e){return!1}var forgotPasswordGetters={getResetPasswordToken:getResetPasswordToken,isPasswordChanged:isPasswordChanged},forgotPasswordGetters$1=forgotPasswordGetters,checkWinstonHook=function(){if(!process.winstonLog)throw console.error("YOU MUST INSTALL AND CONFIGURE NUXT WINSTON MODULE FROM https://github.com/aaronransley/nuxt-winston-log"),new Error("YOU MUST INSTALL AND CONFIGURE NUXT WINSTON MODULE FROM https://github.com/aaronransley/nuxt-winston-log")};exports.cartGetters=cartGetters$1,exports.categoryGetters=CategoryGetters,exports.checkWinstonHook=checkWinstonHook,exports.checkoutGetters=checkoutGetters$1,exports.facetGetters=facetGetters$1,exports.forgotPasswordGetters=forgotPasswordGetters$1,exports.orderGetters=orderGetters$1,exports.productGetters=productGetters$1,exports.reviewGetters=reviewGetters$1,exports.throwErrors=throwErrors$1,exports.useAdyenDirectPayment=useAdyenDirectPayment$1,exports.useAdyenExternalPaymentProvider=index$1,exports.useBilling=index$g,exports.useCart=useCart,exports.useCartRedis=useCartRedis$1,exports.useCategories=index$e,exports.useCategory=index$f,exports.useContent=useContent,exports.useCountrySearch=useCountrySearch$1,exports.useFacet=index$d,exports.useForgotPassword=index$3,exports.useMailing=useMailing$1,exports.useMakeOrder=useMakeOrder$1,exports.useMultipleProduct=index$b,exports.useMultipleProductFactory=useMultipleProductFactory$1,exports.useNewsLetter=index,exports.useNewsLetterFactory=useNewsLetterFactory,exports.usePassword=usePassword$1,exports.usePayment=index$2,exports.usePaymentFactory=usePaymentFactory$1,exports.usePaymentProviderFactory=usePaymentProviderFactory$1,exports.useProduct=index$c,exports.useProductVariant=useProductVariant$1,exports.useReview=index$a,exports.useShipping=index$9,exports.useShippingAsBillingAddress=useShippingAsBillingAddress$1,exports.useShippingMethods=useShipping$1,exports.useShippingProvider=useShippingProvider,exports.useStore=useStore$1,exports.useUser=index$8,exports.useUserBilling=index$7,exports.useUserOrder=index$6,exports.useUserShipping=index$5,exports.useWishlist=index$4,exports.userBillingGetters=userGetters$1,exports.userGetters=userGetters$5,exports.userShippingGetters=userGetters$3,exports.wishlistGetters=wishlistGetters$1;
//# sourceMappingURL=/sm/3b45b5043432427238957bebe229415b350ae4e9d1a1cdbb52235c0c385cfb13.map