@artisan-commerce/products 0.7.4 → 0.7.5
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/build/main.bundle.js +2 -2
- package/build/report.json +1 -1
- package/build/src/lib/registerModifiersForm/registerModifiersForm.types.d.ts +2 -1
- package/build/src/types/modifiers.types.d.ts +5 -2
- package/build/src/utils/modifiers/common.utils.d.ts +6 -3
- package/build/src/utils/modifiers/form.utils.d.ts +15 -1
- package/build/src/utils/modifiers/renderer.utils.d.ts +3 -3
- package/package.json +5 -5
package/build/main.bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("products",[],r):"object"==typeof exports?exports.products=r():t.products=r()}(this,(function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=24)}([function(t,r,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[e]}})}:function(t,r,e,n){void 0===n&&(n=e),t[n]=r[e]}),o=this&&this.__exportStar||function(t,r){for(var e in t)"default"===e||r.hasOwnProperty(e)||n(r,t,e)};Object.defineProperty(r,"__esModule",{value:!0}),o(e(3),r),o(e(4),r),o(e(5),r),o(e(6),r),o(e(7),r),o(e(8),r),o(e(9),r),o(e(10),r),o(e(11),r),o(e(12),r),o(e(13),r),o(e(14),r),o(e(15),r),o(e(16),r)},function(t,r){var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var r=[],e=0;e<t.length;e++)r.push(255&t.charCodeAt(e));return r},bytesToString:function(t){for(var r=[],e=0;e<t.length;e++)r.push(String.fromCharCode(t[e]));return r.join("")}}};t.exports=e},function(t,r,e){(function(r){var n,o,i,u;n=e(22),o=e(1).utf8,i=e(1).bin,(u=function(t,e){var u=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==r&&"function"==typeof r.isBuffer&&r.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var e=n.bytesToWords(t),i=8*t.length,u=[],a=1732584193,s=-271733879,c=-1732584194,f=271733878,l=-1009589776;e[i>>5]|=128<<24-i%32,e[15+(i+64>>>9<<4)]=i;for(var h=0;h<e.length;h+=16){for(var
|
|
1
|
+
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("products",[],r):"object"==typeof exports?exports.products=r():t.products=r()}(this,(function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=24)}([function(t,r,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[e]}})}:function(t,r,e,n){void 0===n&&(n=e),t[n]=r[e]}),o=this&&this.__exportStar||function(t,r){for(var e in t)"default"===e||r.hasOwnProperty(e)||n(r,t,e)};Object.defineProperty(r,"__esModule",{value:!0}),o(e(3),r),o(e(4),r),o(e(5),r),o(e(6),r),o(e(7),r),o(e(8),r),o(e(9),r),o(e(10),r),o(e(11),r),o(e(12),r),o(e(13),r),o(e(14),r),o(e(15),r),o(e(16),r)},function(t,r){var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var r=[],e=0;e<t.length;e++)r.push(255&t.charCodeAt(e));return r},bytesToString:function(t){for(var r=[],e=0;e<t.length;e++)r.push(String.fromCharCode(t[e]));return r.join("")}}};t.exports=e},function(t,r,e){(function(r){var n,o,i,u;n=e(22),o=e(1).utf8,i=e(1).bin,(u=function(t,e){var u=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==r&&"function"==typeof r.isBuffer&&r.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var e=n.bytesToWords(t),i=8*t.length,u=[],a=1732584193,s=-271733879,c=-1732584194,f=271733878,l=-1009589776;e[i>>5]|=128<<24-i%32,e[15+(i+64>>>9<<4)]=i;for(var h=0;h<e.length;h+=16){for(var d=a,p=s,y=c,v=f,g=l,m=0;m<80;m++){if(m<16)u[m]=e[h+m];else{var b=u[m-3]^u[m-8]^u[m-14]^u[m-16];u[m]=b<<1|b>>>31}var w=(a<<5|a>>>27)+l+(u[m]>>>0)+(m<20?1518500249+(s&c|~s&f):m<40?1859775393+(s^c^f):m<60?(s&c|s&f|c&f)-1894007588:(s^c^f)-899497514);l=f,f=c,c=s<<30|s>>>2,s=a,a=w}a+=d,s+=p,c+=y,f+=v,l+=g}return[a,s,c,f,l]}(t));return e&&e.asBytes?u:e&&e.asString?i.bytesToString(u):n.bytesToHex(u)})._blocksize=16,u._digestsize=20,t.exports=u}).call(this,e(17).Buffer)},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.QuestionTypes=r.DayOfWeekName=r.TaxType=r.PriceCategoryType=r.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(r.ProductType||(r.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(r.PriceCategoryType||(r.PriceCategoryType={})),function(t){t.IVA="IVA"}(r.TaxType||(r.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(r.DayOfWeekName||(r.DayOfWeekName={})),function(t){t.BOOLEAN="BOOLEAN",t.RADIO="RADIO",t.CHECKBOX="CHECKBOX",t.COUNTER="COUNTER"}(r.QuestionTypes||(r.QuestionTypes={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ServiceStatus=r.Days=r.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(r.DeliveryTimeUnit||(r.DeliveryTimeUnit={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY",t.SPECIAL="SPECIAL"}(r.Days||(r.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(r.ServiceStatus||(r.ServiceStatus={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";(function(t){
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
7
|
*/
|
|
8
|
-
var n=e(19),o=e(20),i=e(21);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,r){if(u()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=s.prototype:(null===t&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,r,e)}function c(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);s.TYPED_ARRAY_SUPPORT?(t=r).__proto__=s.prototype:t=h(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(r,e),o=(t=a(t,n)).write(r,e);o!==n&&(t=t.slice(0,o));return t}(t,r,e):function(t,r){if(s.isBuffer(r)){var e=0|p(r.length);return 0===(t=a(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?a(t,0):h(t,r);if("Buffer"===r.type&&i(r.data))return h(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,r){if(f(r),t=a(t,r<0?0:0|p(r)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function h(t,r){var e=r.length<0?0:0|p(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function p(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function d(t,r){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return F(t).length;default:if(n)return k(t).length;r=(""+r).toLowerCase(),n=!0}}function y(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,r,e);case"utf8":case"utf-8":return I(this,r,e);case"ascii":return R(this,r,e);case"latin1":case"binary":return _(this,r,e);case"base64":return O(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function g(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=s.from(r,n)),s.isBuffer(r))return 0===r.length?-1:b(t,r,e,n,o);if("number"==typeof r)return r&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):b(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,r,e,n,o){var i,u=1,a=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,a/=2,s/=2,e/=2}function c(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(o){var f=-1;for(i=e;i<a;i++)if(c(t,i)===c(r,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===s)return f*u}else-1!==f&&(i-=i-f),f=-1}else for(e+s>a&&(e=a-s),i=e;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(c(t,i+h)!==c(r,h)){l=!1;break}if(l)return i}return-1}function m(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n))>o&&(n=o):n=o;var i=r.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var a=parseInt(r.substr(2*u,2),16);if(isNaN(a))return u;t[e+u]=a}return u}function w(t,r,e,n){return q(k(r,t.length-e),t,e,n)}function A(t,r,e,n){return q(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function E(t,r,e,n){return A(t,r,e,n)}function T(t,r,e,n){return q(F(r),t,e,n)}function P(t,r,e,n){return q(function(t,r){for(var e,n,o,i=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,o=e%256,i.push(o),i.push(n);return i}(r,t.length-e),t,e,n)}function O(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function I(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=e)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&c)<<6|63&i)>127&&(f=s);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&(s=(15&c)<<12|(63&i)<<6|63&u)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:i=t[o+1],u=t[o+2],a=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&a)&&(s=(15&c)<<18|(63&i)<<12|(63&u)<<6|63&a)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,r,e){return c(null,t,r,e)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,r,e){return function(t,r,e,n){return f(r),r<=0?a(t,r):void 0!==e?"string"==typeof n?a(t,r).fill(e,n):a(t,r).fill(e):a(t,r)}(null,t,r,e)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,r){if(!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,r){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=s.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!s.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,o),o+=u.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)v(this,r,r+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)v(this,r,r+3),v(this,r+1,r+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)v(this,r,r+7),v(this,r+1,r+6),v(this,r+2,r+5),v(this,r+3,r+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?I(this,0,t):y.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,r,e,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return-1;if(r>=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),a=Math.min(i,u),c=this.slice(n,o),f=t.slice(r,e),l=0;l<a;++l)if(c[l]!==f[l]){i=c[l],u=f[l];break}return i<u?-1:u<i?1:0},s.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},s.prototype.indexOf=function(t,r,e){return g(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return g(this,t,r,e,!1)},s.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||e>o)&&(e=o),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return m(this,t,r,e);case"utf8":case"utf-8":return w(this,t,r,e);case"ascii":return A(this,t,r,e);case"latin1":case"binary":return E(this,t,r,e);case"base64":return T(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function S(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=L(t[i]);return o}function D(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function x(t,r,e,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function U(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function j(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Y(t,r,e,n,i){return i||j(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function M(t,r,e,n,i){return i||j(t,0,e,8),o.write(t,r,e,n,52,8),e+8}s.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),s.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=s.prototype;else{var o=r-t;e=new s(o,void 0);for(var i=0;i<o;++i)e[i]=this[i+t]}return e},s.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},s.prototype.readUInt8=function(t,r){return r||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,r){return r||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,r){return r||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,r){return r||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,r){return r||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},s.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},s.prototype.readInt8=function(t,r){return r||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,r){r||C(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt16BE=function(t,r){r||C(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt32LE=function(t,r){return r||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,r){return r||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,r){return r||C(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,r){return r||C(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,r){return r||C(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,r){return r||C(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||x(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},s.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||x(this,t,r,e,Math.pow(2,8*e)-1,0);var o=e-1,i=1;for(this[r+o]=255&t;--o>=0&&(i*=256);)this[r+o]=t/i&255;return r+e},s.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},s.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):U(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):U(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):B(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):B(this,t,r,!1),r+4},s.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);x(this,t,r,e,o-1,-o)}var i=0,u=1,a=0;for(this[r]=255&t;++i<e&&(u*=256);)t<0&&0===a&&0!==this[r+i-1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);x(this,t,r,e,o-1,-o)}var i=e-1,u=1,a=0;for(this[r+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[r+i+1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},s.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):U(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):U(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):B(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):B(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return Y(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return Y(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return M(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return M(this,t,r,!1,e)},s.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o,i=n-e;if(this===t&&e<r&&r<n)for(o=i-1;o>=0;--o)t[o+r]=this[o+e];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},s.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var i;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(i=r;i<e;++i)this[i]=t;else{var u=s.isBuffer(t)?t:k(new s(t,n).toString()),a=u.length;for(i=0;i<e-r;++i)this[i+r]=u[i%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function k(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}}).call(this,e(18))},function(t,r){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r,e){"use strict";r.byteLength=function(t){var r=c(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=c(t),u=n[0],a=n[1],s=new i(function(t,r,e){return 3*(r+e)/4-e}(0,u,a)),f=0,l=a>0?u-4:u;for(e=0;e<l;e+=4)r=o[t.charCodeAt(e)]<<18|o[t.charCodeAt(e+1)]<<12|o[t.charCodeAt(e+2)]<<6|o[t.charCodeAt(e+3)],s[f++]=r>>16&255,s[f++]=r>>8&255,s[f++]=255&r;2===a&&(r=o[t.charCodeAt(e)]<<2|o[t.charCodeAt(e+1)]>>4,s[f++]=255&r);1===a&&(r=o[t.charCodeAt(e)]<<10|o[t.charCodeAt(e+1)]<<4|o[t.charCodeAt(e+2)]>>2,s[f++]=r>>8&255,s[f++]=255&r);return s},r.fromByteArray=function(t){for(var r,e=t.length,o=e%3,i=[],u=0,a=e-o;u<a;u+=16383)i.push(f(t,u,u+16383>a?a:u+16383));1===o?(r=t[e-1],i.push(n[r>>2]+n[r<<4&63]+"==")):2===o&&(r=(t[e-2]<<8)+t[e-1],i.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=u.length;a<s;++a)n[a]=u[a],o[u.charCodeAt(a)]=a;function c(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function f(t,r,e){for(var o,i,u=[],a=r;a<e;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),u.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return u.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,r){r.read=function(t,r,e,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=e?o-1:0,h=e?-1:1,p=t[r+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[r+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[r+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=c}return(p?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var u,a,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=f):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+l>=1?h/s:h*Math.pow(2,1-l))*s>=2&&(u++,s/=2),u+l>=f?(a=0,u=f):u+l>=1?(a=(r*s-1)*Math.pow(2,o),u+=l):(a=r*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[e+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[e+p]=255&u,p+=d,u/=256,c-=8);t[e+p-d]|=128*y}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r){var e,n;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,r){return t<<r|t>>>32-r},rotr:function(t,r){return t<<32-r|t>>>r},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var r=0;r<t.length;r++)t[r]=n.endian(t[r]);return t},randomBytes:function(t){for(var r=[];t>0;t--)r.push(Math.floor(256*Math.random()));return r},bytesToWords:function(t){for(var r=[],e=0,n=0;e<t.length;e++,n+=8)r[n>>>5]|=t[e]<<24-n%32;return r},wordsToBytes:function(t){for(var r=[],e=0;e<32*t.length;e+=8)r.push(t[e>>>5]>>>24-e%32&255);return r},bytesToHex:function(t){for(var r=[],e=0;e<t.length;e++)r.push((t[e]>>>4).toString(16)),r.push((15&t[e]).toString(16));return r.join("")},hexToBytes:function(t){for(var r=[],e=0;e<t.length;e+=2)r.push(parseInt(t.substr(e,2),16));return r},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?r.push(e.charAt(o>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(n))>>>6-2*o);return r}},t.exports=n},,function(t,r,e){"use strict";e.r(r),e.d(r,"getCategories",(function(){return A})),e.d(r,"getProductDetails",(function(){return ht})),e.d(r,"getProducts",(function(){return gt})),e.d(r,"getRecommendedProducts",(function(){return bt})),e.d(r,"getRelatedProducts",(function(){return mt})),e.d(r,"getStoreDetails",(function(){return Pt})),e.d(r,"registerModifiersForm",(function(){return qt})),e.d(r,"validateProduct",(function(){return Gt})),e.d(r,"initProducts",(function(){return Wt})),e.d(r,"getProductTotals",(function(){return Xt})),e.d(r,"transformers",(function(){return o})),e.d(r,"assertions",(function(){return n}));var n={};e.r(n),e.d(n,"isBaseProduct",(function(){return a})),e.d(n,"isProductDetails",(function(){return s})),e.d(n,"isCartProduct",(function(){return c})),e.d(n,"isFormCartProduct",(function(){return f}));var o={};e.r(o),e.d(o,"toCartProduct",(function(){return d})),e.d(o,"toFormCartProduct",(function(){return g})),e.d(o,"toFormCartProductHelper",(function(){return b})),e.d(o,"toFormCartProductFromProductDetails",(function(){return m})),e.d(o,"toFormCartProductFromAnswer",(function(){return w}));var i=e(0),u=function(t){return Object.keys(t)},a=function(t){var r=t.attributes,e=t.available,n=t.description,o=t.name,a=t.images,s=t.prices,c=t.productId,f=t.sponsored,l=t.status,h=t.type;return"boolean"==typeof r.showInMenu&&("boolean"==typeof e&&("boolean"==typeof f&&("string"==typeof n&&("string"==typeof o&&("string"==typeof c&&(!("object"!=typeof s||"object"==typeof s&&Object.keys(s).length<1)&&(!!Array.isArray(a)&&((!l||"ACTIVE"===l||"INACTIVE"===l)&&!!u(i.ProductType).includes(h)))))))))},s=function(t){if(!a(t))return!1;var r=t.isPriceVip,e=t.manufacturer,n=t.maxAmountForSale,o=t.schedule,i=t.questions;return"boolean"==typeof r&&(!!Array.isArray(e)&&("number"==typeof n&&(!!Array.isArray(o)&&!!Array.isArray(i))))},c=function(t){if(!s(t))return!1;var r=t.hash,e=t.createdAt,n=t.updatedAt,o=t.alerts,a=t.amount,c=t.priceCategory,f=t.comment,l=t.questionsAndAnswers;return"string"==typeof r&&("string"==typeof e&&("string"==typeof n&&(!!Array.isArray(o)&&("number"==typeof a&&("string"==typeof f&&(!!u(i.PriceCategoryType).includes(c)&&!!Array.isArray(l)))))))},f=function(t){var r;if(!c(t))return!1;var e=t.questions;if(!Array.isArray(e))return!1;var n=null===(r=null==e?void 0:e[0])||void 0===r?void 0:r.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},l=function(t){var r=t.min,e=t.max,n=t.type;if(n)return n;if(0===r&&1===e)return"CHECKBOX";if(1===r&&1===e)return"RADIO";if(0===r&&(0===e||e===1/0))return"COUNTER";if(e>=r)return"COUNTER";throw new Error("Modifier group bad configured. min "+r+", max "+e+", type "+n)},h=function(t,r){var e=t.max,n=t.min;return r>e?"Amount is heigher than the maximum allowed amount "+e:r<n?"Amount is lower than the minimum allowed amount "+n:""},p=function(){return(p=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},d=function(t,r){if(void 0===r&&(r={}),c(t))return p(p({},t),r);if(s(t))return y(t,r);var e=v(t);return y(e,r)},y=function(t,r){var e;return void 0===r&&(r={}),p(p(p({},t),{questionsAndAnswers:[],amount:null!==(e=t.amount)&&void 0!==e?e:0,priceCategory:i.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),r)},v=function(t,r){return void 0===r&&(r={}),p(p(p({},t),{hasModifiers:!1,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),r)},g=function(t,r){if(void 0===r&&(r={}),f(t))return p(p({},t),r);if(s(t))return m(t,r);var e=v(t);return m(e,r)},b=function(t,r){void 0===r&&(r={});var e=t.priceCategory,n=t.productId,o=t.amount,i=t.questions.map((function(t){var r=t.answers,i=t.questionId,u=t.min,a=t.max,s={rootId:n,min:u,max:a,type:l(t),modifiersCount:r.length,amount:o,path:[]};return p(p({},t),{answers:r.map((function(t){var r=function(t){var r=t.min;return 1===t.modifiersCount?r:0}(s),n=function(t){var r=t.max,e=t.type,n=r||1/0;return"RADIO"===e||"CHECKBOX"===e?1:n}(s),o=function(t){var r=t.groupType,e=t.min,n=t.max;return"RADIO"===r||1===e&&1===n?"RADIO":0===e&&1===n?"CHECKBOX":0!==e||0!==n&&n!==1/0?n>=e?"COUNTER":r:"COUNTER"}({min:r,max:n,groupType:s.type}),u=t.questions.length;return p(p({amount:0},t),{priceCategory:e,questionId:i,min:r,max:n,renderType:o,questions:u?b(t).questions:[]})}))})}));return p(p(p({},t),{questions:i}),r)},m=function(t,r){void 0===r&&(r={});var e=y(t);return b(e,r)},w=function(t,r){return void 0===r&&(r={}),b(t,r)},A=function(){console.log("Not supported yet")},E={CLIENT_NAME:"Trade S.A.",DEFAULT_REQUEST_TIMEOUT:1e4,EXCLUDED_LOGGER_STATUS_CODES:[422],INCLUDED_LOGGER_ENVS:["staging","production"],INCLUDED_INTL_LOG_ENVS:[""],COUNTRY:{NAME:"Ecuador",CODE:"593",LANGUAGE:"es"},DEFAULT_API_TIMEOUT:3e5,HEADERS:["accountId"],FILTERS:["vendorId","storeId","catalogueId","categoryId","productId"],GROUPS:["CATEGORIES","TAGS"],ORDER_FIELDS:["type","sort"],ORDER_TYPES:["ALPHABETIC","PRICE","PREDEFINED"],ORDER_SORTS:["ASC","DESC"],PAGINATION:["page","vendor","store","catalogue","category","product"],ADDITIONAL_FILTERS:["price","query","tags","manufacturerId","weight","dimensions"]},T=function(){return(T=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},P=E.DEFAULT_API_TIMEOUT,O={artisanApp:void 0,timeout:P,apiCache:{},expiresAt:(new Date).getTime()+P,forms:{}};Object.freeze(O);var I=T({},O);Object.seal(I);var R=function(t){I=T(T({},I),t)},_=function(){return T({},I)},S=function(t,r,e){void 0===e&&(e="");var n=r.headers.accountId,o=t.filterBy,i=o.vendorId,u=o.storeId,a=o.catalogueId;!function(t,r){void 0===r&&(r="");var e=_().accountId;if(void 0===t&&void 0===e)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+r)}(n,e),function(t,r){void 0===r&&(r="");var e=_().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+r)}(i,e),function(t,r){void 0===r&&(r="");var e=_().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+r)}(u,e),function(t,r){void 0===r&&(r="");var e=_().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+r)}(a,e)},D=E.FILTERS,C=E.HEADERS,x=function(t,r,e){var n=null==r?void 0:r.message;try{n=r?JSON.parse(r.message):r}catch(t){}return{data:t,hints:U(e),config:e,error:n}},U=function(t){var r={};return Object.entries(t.query).forEach((function(t){var e=t,n=e[0],o=e[1];D.includes(n)&&(r[n]=o)})),Object.entries(t.headers).forEach((function(t){var e=t,n=e[0],o=e[1];C.includes(n)&&(r[n]=o)})),r},B=function(){return(B=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},j=function(){return(j=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Y=E.PAGINATION,M=E.ADDITIONAL_FILTERS,N=E.ORDER_FIELDS,L=E.FILTERS,k=E.GROUPS,F=E.ORDER_SORTS,q=E.ORDER_TYPES,H=function(t){var r=_(),e=r.vendorId,n=r.storeId,o=_(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=j(j({},{vendorId:e,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),c=X(s,L,"filter"),f=K(c);return j(j({},t),{filterBy:f})},G=function(t){var r=J(t,k,"groupBy");return j({},r)},V=function(t){var r=t.orderBy,e=void 0===r?{}:r,n=X(e,N,"orderBy"),o=j({},n),i=e.sort,u=e.type;return u&&!q.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),q.includes(u)||(delete o.type,o.type="ALPHABETIC"),i&&!F.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order sort "+i),F.includes(i)||(delete o.sort,o.sort="ASC"),j(j({},t),{orderBy:o})},z=function(t){var r=t.pagination,e=X(void 0===r?{}:r,Y,"pagination");return j(j({},t),{pagination:e})},W=function(t){var r=t.additionalFilters,e=X(void 0===r?{}:r,M,"additionalFilters");return j(j({},t),{additionalFilters:e})},X=function(t,r,e){var n=j({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?r.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+t),delete n[t]):delete n[t]})),n},J=function(t,r,e){var n=j({},t),o=t[e];return void 0===o||r.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+o),delete n[e]),n},K=function(t){var r=j({},t);return Object.entries(r).forEach((function(t){var e=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete r[e]:Array.isArray(n)&&Q(n[0])||Q(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+e+" = "+n),delete r[e])})),r},Q=function(t){var r=typeof t;return"number"===r||"string"===r},Z=e(2),$=e.n(Z),tt=function(){return(tt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},rt=function(t){return Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1],i=o;return Array.isArray(o)&&(i=o.reduce((function(t,r){return t+","+r}))),tt(tt({},t),"catalogueId"===n?{channelId:i}:((e={})[n]=i,e))}),{})},et=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1];return"query"===n?tt(tt({},t),((e={})[n]=o,e)):t}),{})},nt=function(t,r){for(var e=t,n=0,o=Object.entries(r);n<o.length;n++){var i=o[n],u=i[0],a=i[1],s=new RegExp("/:"+u,"g");e=e.replace(s,"/"+a)}return e},ot=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},it=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ut=function(t,r,e,n){return ot(void 0,void 0,void 0,(function(){var o,i,u,a,s,c,f;return it(this,(function(l){switch(l.label){case 0:if(r=function(t){var r=H(t),e=G(r),n=V(e),o=z(n);return W(o)}(r),S(r,e),o=function(t,r,e){var n,o=r.filterBy,i=r.groupBy,u=r.additionalFilters,a=rt(o),s=et(u),c=tt(tt(tt({},a),{groupBy:i}),s);i||delete c.groupBy;var f=nt(t,e.params),l=(null!==(n=_().artisanApp)&&void 0!==n?n:{}).apiURL,h=Object.entries(c).reduce((function(t,r,e){var n=r[0],o=r[1];return void 0===o?t:t+(e?"&":"")+n+"="+o}),l+"/"+f+"?");return tt(tt({},e),{url:h,query:c})}(t,r,e),p=o.url,i=$()(p),u=function(t){return _().apiCache[t]}(i),h=_().expiresAt,(a=(new Date).getTime()>=h)&&function(){var t=_().timeout,r=void 0===t?0:t;R({apiCache:B({},O.apiCache),expiresAt:(new Date).getTime()+r})}(),u&&!a)return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,n(o)];case 2:return s=l.sent(),f=x(s,void 0,o),function(t,r){var e,n=_().apiCache,o=B(B({},n),((e={})[t]=r,e));R({apiCache:o})}(i,f),[2,f];case 3:return c=l.sent(),[2,f=x(void 0,c,o)];case 4:return[2,u]}var h,p}))}))},at=function(t){return ot(void 0,void 0,void 0,(function(){var r,e,n,o,i,u;return it(this,(function(a){switch(a.label){case 0:r=t.url,e=t.headers,n=t.body,"{}"===(o={headers:e,body:JSON.stringify(n)}).body&&delete o.body,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(r,o).then((function(t){return t.json()}))];case 2:return i=a.sent(),[3,4];case 3:return u=a.sent(),i={code:null,status:"failed",message:u.message,stack:u.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i.data]}}))}))},st=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},ct=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ft=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},lt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ht=function(t,r){return ft(void 0,void 0,void 0,(function(){return lt(this,(function(e){switch(e.label){case 0:return[4,ut("v1/products/:productId",r,{headers:{},params:{productId:t},query:{},body:{}},(function(t){return ft(void 0,void 0,void 0,(function(){return lt(this,(function(r){switch(r.label){case 0:return[4,(e=t,st(void 0,void 0,void 0,(function(){return ct(this,(function(t){switch(t.label){case 0:return[4,at(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,e.sent()]}}))}))},pt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},dt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},yt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},vt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},gt=function(t){return yt(void 0,void 0,void 0,(function(){return vt(this,(function(r){switch(r.label){case 0:return[4,ut("v1/products",t,{headers:{},params:{},query:{},body:{}},(function(t){return yt(void 0,void 0,void 0,(function(){return vt(this,(function(r){switch(r.label){case 0:return[4,(e=t,pt(void 0,void 0,void 0,(function(){return dt(this,(function(t){switch(t.label){case 0:return[4,at(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,r.sent()]}}))}))},bt=function(){console.log("Not implemented yet")},mt=function(){console.log("not implemented yet")},wt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},At=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Et=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},Tt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Pt=function(t){return Et(void 0,void 0,void 0,(function(){return Tt(this,(function(r){switch(r.label){case 0:return[4,ut("v1/stores/details",t,{headers:{},params:{},query:{},body:{}},(function(t){return Et(void 0,void 0,void 0,(function(){return Tt(this,(function(r){switch(r.label){case 0:return[4,(e=t,wt(void 0,void 0,void 0,(function(){return At(this,(function(t){switch(t.label){case 0:return[4,at(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,r.sent()]}}))}))},Ot=function(){return(Ot=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},It=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Rt=function(t,r){for(var e=It(r),n=t,o=t[0];e.length;){o=St(n,e[0]),e=e.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups}return o},_t=function(t,r,e){for(var n=It(r),o=t,i=St(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=St(o,n[0]),n=n.slice(1),o=(u=Object.prototype.hasOwnProperty.call(i,"modifiers"))?i.modifiers:i.groups;var a=n[0];if(1===r.length&&(i={groups:t},u=!1),u){var s=i.modifiers.map((function(t){return t.id===a?Ot({},e):Ot({},t)}));i.modifiers=s}else{var c=i.groups.map((function(t){return t.id===a?Ot({},e):Ot({},t)}));i.groups=c}return 1===r.length?It(i.groups):It(t)},St=function(t,r){var e=t.find((function(t){return t.id===r}));if(!e)throw new Error("Path segment "+r+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return e},Dt=function(){return(Dt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Ct=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},xt=function(t,r,e){var n=e.slice(0,-1),o=Rt(r,n),i=Ct(o.modifiers);"RADIO"===o.type&&(i=o.modifiers.map((function(t){return"RADIO"!==t.type||t.id===e[e.length-1]?Dt({},t):Dt(Dt({},t),{amount:0,touched:!1,error:"",totals:Xt(Dt(Dt({},t.data),{amount:0})),data:Dt(Dt({},t.data),{amount:0})})}))),i=i.map((function(r){var n=w(r.data),o=Ct(e.slice(0,-1),[r.id]);return Dt(Dt({},r),{groups:Nt(n,{rootId:t,path:o})})}));var u=Dt(Dt({},o),{touched:!0,modifiers:i}),a=_t(r,n,u);return n.length>1&&(a=Ut(t,a,n)),a},Ut=function(t,r,e){var n=e.slice(0,-1),o=Rt(r,n),i=o.groups.map((function(t){return Dt({},t)})),u=Dt(Dt({},o),{touched:!0,groups:i}),a=_t(r,n,u);return n.length>1&&(a=xt(t,a,n)),a},Bt=function(){return(Bt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},jt=function(t,r,e){var n,o=Bt({},_().forms),i=o[t],u=Rt(i.renderer,r),a=function(t,r,e,n){var o=Dt(Dt({},e),{amount:n,touched:!0,error:h(e,n),totals:Xt(Dt(Dt({},e.data),{amount:n})),data:Dt(Dt({},e.data),{amount:n})});return _t(t,r,o)}(i.renderer,r,u,e);a=xt(t,a,r);var s=Bt(Bt({},i),{renderer:a}),c=Bt(Bt({},o),((n={})[t]=s,n));R({forms:c});var f=Bt({},s);delete f.callback,i.callback(f)},Yt=function(){return(Yt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Mt=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Nt=function(t,r){var e=r.rootId,n=r.path;return t.questions.map((function(r){return Lt(r,{amount:t.amount,rootId:e,path:Mt(n)})}))},Lt=function(t,r){var e,n=t.questionId,o=t.name,i=t.description,u=t.max,a=t.min,s=t.images,c=r.amount,f=r.rootId,h=r.path,p={id:n,name:o,description:null!=i?i:"",images:null!=s?s:[],data:t,error:"",touched:!1,hidden:c<1,required:a>0,type:l(t)},d={rootId:f,max:u,min:a,type:p.type,modifiersCount:t.answers.length,amount:(e=t,e.answers.reduce((function(t,r){return t+r.amount}),0)),path:Mt(h,[n])},y=t.answers.map((function(t){return kt(t,d)}));return Yt(Yt({},p),{modifiers:y})},kt=function(t,r){var e=t.productId,n=t.questionId,o=t.name,i=t.images,u=t.amount,a=t.renderType,s=t.min,c=t.max,f=w(t),l=r.rootId,h=r.path,p=Mt(h,[e]);return{id:e,groupId:n,name:o,images:i,amount:u,data:t,groups:Nt(f,{rootId:l,path:p}),error:"",hidden:r.amount<1,min:s,max:c,required:s>0,touched:!1,totals:Xt(Yt(Yt({},t),{amount:u})),type:a,handleChange:function(t){jt(r.rootId,p,t)}}},Ft=function(){return(Ft=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},qt=function(t,r){var e,n,o=t.productId,i=_().forms;if(!!i[o])return n="Form for product with id "+o+" has already been register. Please unsuscribe if you need to register a new form.",console.error(n),function(){};var u=function(t){var r=g(t,{amount:1});return{product:r,renderer:Nt(r,{rootId:r.productId,path:[]}),validate:Gt}}(t),a=Ft(Ft({},i),((e={})[o]=Ft(Ft({},u),{callback:r}),e));return R({forms:a}),r(u),function(){return Ht(o)}},Ht=function(t){var r=_().forms,e=Ft({},r);delete e[t],R({forms:e})},Gt=function(){},Vt=function(){return(Vt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},zt=!1,Wt=function(t,r){if(void 0===r&&(r={}),zt)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(R(Vt({artisanApp:t},r)),void 0!==r.timeout){var e=(new Date).getTime()+r.timeout;R({expiresAt:e})}"undefined"==typeof window||(zt=!0)}},Xt=function(t){return{grossPrice:Kt(t),totalDiscounts:Qt(t),totalTaxes:Jt(t),netPrice:Zt(t)}},Jt=function(t){var r=d(t),e=r.prices,n=r.amount,o=r.priceCategory,i=e[o],u=i.taxes,a=i.grossPrice,s=tr(u,a);return r.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var e=r.prices,n=r.amount,i=e[o],u=i.taxes,a=i.grossPrice;return t+n*tr(u,a)}),0)}),0)+s*n},Kt=function(t){return $t(t,"grossPrice")},Qt=function(t){return 0},Zt=function(t){return $t(t,"netPrice")},$t=function(t,r){var e=d(t),n=e.prices,o=e.amount,i=e.priceCategory,u=n[i][r];return e.questionsAndAnswers.reduce((function(t,e){return t+e.answers.reduce((function(t,e){var n=e.prices;return t+e.amount*n[i][r]}),0)}),0)+u*o},tr=function(t,r){return t.reduce((function(t,e){return t+e.percentage/100*r}),0)}}])}));
|
|
8
|
+
var n=e(19),o=e(20),i=e(21);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,r){if(u()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=s.prototype:(null===t&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,r,e)}function c(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);s.TYPED_ARRAY_SUPPORT?(t=r).__proto__=s.prototype:t=h(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(r,e),o=(t=a(t,n)).write(r,e);o!==n&&(t=t.slice(0,o));return t}(t,r,e):function(t,r){if(s.isBuffer(r)){var e=0|d(r.length);return 0===(t=a(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?a(t,0):h(t,r);if("Buffer"===r.type&&i(r.data))return h(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,r){if(f(r),t=a(t,r<0?0:0|d(r)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function h(t,r){var e=r.length<0?0:0|d(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function d(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function p(t,r){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return F(t).length;default:if(n)return k(t).length;r=(""+r).toLowerCase(),n=!0}}function y(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return _(this,r,e);case"utf8":case"utf-8":return P(this,r,e);case"ascii":return R(this,r,e);case"latin1":case"binary":return S(this,r,e);case"base64":return O(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function g(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=s.from(r,n)),s.isBuffer(r))return 0===r.length?-1:m(t,r,e,n,o);if("number"==typeof r)return r&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):m(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,r,e,n,o){var i,u=1,a=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,a/=2,s/=2,e/=2}function c(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(o){var f=-1;for(i=e;i<a;i++)if(c(t,i)===c(r,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===s)return f*u}else-1!==f&&(i-=i-f),f=-1}else for(e+s>a&&(e=a-s),i=e;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(c(t,i+h)!==c(r,h)){l=!1;break}if(l)return i}return-1}function b(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n))>o&&(n=o):n=o;var i=r.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var a=parseInt(r.substr(2*u,2),16);if(isNaN(a))return u;t[e+u]=a}return u}function w(t,r,e,n){return q(k(r,t.length-e),t,e,n)}function A(t,r,e,n){return q(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function E(t,r,e,n){return A(t,r,e,n)}function I(t,r,e,n){return q(F(r),t,e,n)}function T(t,r,e,n){return q(function(t,r){for(var e,n,o,i=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,o=e%256,i.push(o),i.push(n);return i}(r,t.length-e),t,e,n)}function O(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function P(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=e)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&c)<<6|63&i)>127&&(f=s);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&(s=(15&c)<<12|(63&i)<<6|63&u)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:i=t[o+1],u=t[o+2],a=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&a)&&(s=(15&c)<<18|(63&i)<<12|(63&u)<<6|63&a)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,r,e){return c(null,t,r,e)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,r,e){return function(t,r,e,n){return f(r),r<=0?a(t,r):void 0!==e?"string"==typeof n?a(t,r).fill(e,n):a(t,r).fill(e):a(t,r)}(null,t,r,e)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,r){if(!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,r){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=s.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!s.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,o),o+=u.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)v(this,r,r+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)v(this,r,r+3),v(this,r+1,r+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)v(this,r,r+7),v(this,r+1,r+6),v(this,r+2,r+5),v(this,r+3,r+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):y.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,r,e,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return-1;if(r>=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),a=Math.min(i,u),c=this.slice(n,o),f=t.slice(r,e),l=0;l<a;++l)if(c[l]!==f[l]){i=c[l],u=f[l];break}return i<u?-1:u<i?1:0},s.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},s.prototype.indexOf=function(t,r,e){return g(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return g(this,t,r,e,!1)},s.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||e>o)&&(e=o),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,t,r,e);case"utf8":case"utf-8":return w(this,t,r,e);case"ascii":return A(this,t,r,e);case"latin1":case"binary":return E(this,t,r,e);case"base64":return I(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}function S(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function _(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=M(t[i]);return o}function D(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function U(t,r,e,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function x(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function L(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,e,n,i){return i||L(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function N(t,r,e,n,i){return i||L(t,0,e,8),o.write(t,r,e,n,52,8),e+8}s.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),s.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=s.prototype;else{var o=r-t;e=new s(o,void 0);for(var i=0;i<o;++i)e[i]=this[i+t]}return e},s.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},s.prototype.readUInt8=function(t,r){return r||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,r){return r||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,r){return r||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,r){return r||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,r){return r||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},s.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},s.prototype.readInt8=function(t,r){return r||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,r){r||C(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt16BE=function(t,r){r||C(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt32LE=function(t,r){return r||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,r){return r||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,r){return r||C(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,r){return r||C(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,r){return r||C(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,r){return r||C(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||U(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},s.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||U(this,t,r,e,Math.pow(2,8*e)-1,0);var o=e-1,i=1;for(this[r+o]=255&t;--o>=0&&(i*=256);)this[r+o]=t/i&255;return r+e},s.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},s.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):x(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):x(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):B(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):B(this,t,r,!1),r+4},s.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);U(this,t,r,e,o-1,-o)}var i=0,u=1,a=0;for(this[r]=255&t;++i<e&&(u*=256);)t<0&&0===a&&0!==this[r+i-1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);U(this,t,r,e,o-1,-o)}var i=e-1,u=1,a=0;for(this[r+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[r+i+1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},s.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):x(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):x(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):B(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):B(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return N(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return N(this,t,r,!1,e)},s.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o,i=n-e;if(this===t&&e<r&&r<n)for(o=i-1;o>=0;--o)t[o+r]=this[o+e];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},s.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var i;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(i=r;i<e;++i)this[i]=t;else{var u=s.isBuffer(t)?t:k(new s(t,n).toString()),a=u.length;for(i=0;i<e-r;++i)this[i+r]=u[i%a]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function M(t){return t<16?"0"+t.toString(16):t.toString(16)}function k(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}}).call(this,e(18))},function(t,r){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r,e){"use strict";r.byteLength=function(t){var r=c(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=c(t),u=n[0],a=n[1],s=new i(function(t,r,e){return 3*(r+e)/4-e}(0,u,a)),f=0,l=a>0?u-4:u;for(e=0;e<l;e+=4)r=o[t.charCodeAt(e)]<<18|o[t.charCodeAt(e+1)]<<12|o[t.charCodeAt(e+2)]<<6|o[t.charCodeAt(e+3)],s[f++]=r>>16&255,s[f++]=r>>8&255,s[f++]=255&r;2===a&&(r=o[t.charCodeAt(e)]<<2|o[t.charCodeAt(e+1)]>>4,s[f++]=255&r);1===a&&(r=o[t.charCodeAt(e)]<<10|o[t.charCodeAt(e+1)]<<4|o[t.charCodeAt(e+2)]>>2,s[f++]=r>>8&255,s[f++]=255&r);return s},r.fromByteArray=function(t){for(var r,e=t.length,o=e%3,i=[],u=0,a=e-o;u<a;u+=16383)i.push(f(t,u,u+16383>a?a:u+16383));1===o?(r=t[e-1],i.push(n[r>>2]+n[r<<4&63]+"==")):2===o&&(r=(t[e-2]<<8)+t[e-1],i.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=u.length;a<s;++a)n[a]=u[a],o[u.charCodeAt(a)]=a;function c(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function f(t,r,e){for(var o,i,u=[],a=r;a<e;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),u.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return u.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,r){r.read=function(t,r,e,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=e?o-1:0,h=e?-1:1,d=t[r+l];for(l+=h,i=d&(1<<-f)-1,d>>=-f,f+=a;f>0;i=256*i+t[r+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[r+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(d?-1:1);u+=Math.pow(2,n),i-=c}return(d?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var u,a,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=f):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+l>=1?h/s:h*Math.pow(2,1-l))*s>=2&&(u++,s/=2),u+l>=f?(a=0,u=f):u+l>=1?(a=(r*s-1)*Math.pow(2,o),u+=l):(a=r*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[e+d]=255&a,d+=p,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[e+d]=255&u,d+=p,u/=256,c-=8);t[e+d-p]|=128*y}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r){var e,n;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,r){return t<<r|t>>>32-r},rotr:function(t,r){return t<<32-r|t>>>r},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var r=0;r<t.length;r++)t[r]=n.endian(t[r]);return t},randomBytes:function(t){for(var r=[];t>0;t--)r.push(Math.floor(256*Math.random()));return r},bytesToWords:function(t){for(var r=[],e=0,n=0;e<t.length;e++,n+=8)r[n>>>5]|=t[e]<<24-n%32;return r},wordsToBytes:function(t){for(var r=[],e=0;e<32*t.length;e+=8)r.push(t[e>>>5]>>>24-e%32&255);return r},bytesToHex:function(t){for(var r=[],e=0;e<t.length;e++)r.push((t[e]>>>4).toString(16)),r.push((15&t[e]).toString(16));return r.join("")},hexToBytes:function(t){for(var r=[],e=0;e<t.length;e+=2)r.push(parseInt(t.substr(e,2),16));return r},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?r.push(e.charAt(o>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(n))>>>6-2*o);return r}},t.exports=n},,function(t,r,e){"use strict";e.r(r),e.d(r,"getCategories",(function(){return P})),e.d(r,"getProductDetails",(function(){return gt})),e.d(r,"getProducts",(function(){return Et})),e.d(r,"getRecommendedProducts",(function(){return It})),e.d(r,"getRelatedProducts",(function(){return Tt})),e.d(r,"getStoreDetails",(function(){return _t})),e.d(r,"registerModifiersForm",(function(){return Qt})),e.d(r,"validateProduct",(function(){return $t})),e.d(r,"initProducts",(function(){return er})),e.d(r,"getProductTotals",(function(){return nr})),e.d(r,"transformers",(function(){return o})),e.d(r,"assertions",(function(){return n}));var n={};e.r(n),e.d(n,"isBaseProduct",(function(){return s})),e.d(n,"isProductDetails",(function(){return c})),e.d(n,"isCartProduct",(function(){return f})),e.d(n,"isFormCartProduct",(function(){return l}));var o={};e.r(o),e.d(o,"toCartProduct",(function(){return b})),e.d(o,"toFormCartProduct",(function(){return E})),e.d(o,"toFormCartProductHelper",(function(){return I})),e.d(o,"toFormCartProductFromProductDetails",(function(){return T})),e.d(o,"toFormCartProductFromAnswer",(function(){return O}));var i=e(0),u=function(t){return Object.keys(t)},a=function(t){console.error(t)},s=function(t){var r=t.attributes,e=t.available,n=t.description,o=t.name,a=t.images,s=t.prices,c=t.productId,f=t.sponsored,l=t.status,h=t.type;return"boolean"==typeof r.showInMenu&&("boolean"==typeof e&&("boolean"==typeof f&&("string"==typeof n&&("string"==typeof o&&("string"==typeof c&&(!("object"!=typeof s||"object"==typeof s&&Object.keys(s).length<1)&&(!!Array.isArray(a)&&((!l||"ACTIVE"===l||"INACTIVE"===l)&&!!u(i.ProductType).includes(h)))))))))},c=function(t){if(!s(t))return!1;var r=t.isPriceVip,e=t.manufacturer,n=t.maxAmountForSale,o=t.schedule,i=t.questions;return"boolean"==typeof r&&(!!Array.isArray(e)&&("number"==typeof n&&(!!Array.isArray(o)&&!!Array.isArray(i))))},f=function(t){if(!c(t))return!1;var r=t.hash,e=t.createdAt,n=t.updatedAt,o=t.alerts,a=t.amount,s=t.priceCategory,f=t.comment,l=t.questionsAndAnswers;return"string"==typeof r&&("string"==typeof e&&("string"==typeof n&&(!!Array.isArray(o)&&("number"==typeof a&&("string"==typeof f&&(!!u(i.PriceCategoryType).includes(s)&&!!Array.isArray(l)))))))},l=function(t){var r;if(!f(t))return!1;var e=t.questions;if(!Array.isArray(e))return!1;var n=null===(r=null==e?void 0:e[0])||void 0===r?void 0:r.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},h=function(t){var r=t.min,e=t.max,n=t.type;if(n)return n;if(0===r&&1===e)return"CHECKBOX";if(1===r&&1===e)return"RADIO";if(0===r&&(0===e||e===1/0))return"COUNTER";if(e>=r)return"COUNTER";throw new Error("Modifier group bad configured. min "+r+", max "+e+", type "+n)},d=function(t,r){var e=[],n=t.max,o=t.min;return r>n&&e.push("Amount is heigher than the maximum allowed amount "+n),r<o&&e.push("Amount is lower than the minimum allowed amount "+o),e},p=function(t){var r=t.touched,e=t.errors,n=t.required,o=t.data,i=t.modifiers,u=o.min,a=i.some((function(t){return"FAIL"===t.status})),s=i.some((function(t){return"IDLE"===t.status})),c=i.some((function(t){return"INCOMPLETE"===t.status})),f=i.reduce((function(t,r){return t+r.amount}),0);return v({touched:r,errors:e,required:n,min:u,amount:f,childrenWithError:a,childrenIdle:s,childrenIncomplete:c,reviewChildren:!0})},y=function(t){var r=t.groups.some((function(t){return"FAIL"===t.status})),e=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,i=t.errors,u=t.required,a=t.min,s=t.amount;return v({touched:o,errors:i,required:u,min:a,amount:s,childrenWithError:r,childrenIdle:e,childrenIncomplete:n,reviewChildren:s>0})},v=function(t){var r=t.touched,e=t.errors,n=t.required,o=t.min,i=t.amount,u=t.reviewChildren,s=t.childrenWithError,c=t.childrenIdle,f=t.childrenIncomplete;return!r&&n?"IDLE":r||n?u&&(c||f)||i<o?"INCOMPLETE":s||e.length?"FAIL":i>=o?"OK":(a("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:r,errors:e,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK"},g=function(t){var r=t.every((function(t){var r=t.status,e=t.required;return"OK"===r||"IDLE"===r&&!e}));if(r)return"OK";var e=t.some((function(t){return"FAIL"===t.status}));if(e)return"FAIL";var n=t.some((function(t){return"INCOMPLETE"===t.status}));if(n)return"INCOMPLETE";var o=t.some((function(t){return"IDLE"===t.status}));return o?"IDLE":(a("Unhandled case. Unable to compute the renderer status "+JSON.stringify({allChildrenOk:r,childrenIsIdle:o,chidrenWithError:e,childrenIncompleted:n},void 0,2)),"FAIL")},m=function(){return(m=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},b=function(t,r){if(void 0===r&&(r={}),f(t))return m(m({},t),r);if(c(t))return w(t,r);var e=A(t);return w(e,r)},w=function(t,r){var e;return void 0===r&&(r={}),m(m(m({},t),{questionsAndAnswers:[],amount:null!==(e=t.amount)&&void 0!==e?e:0,priceCategory:i.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),r)},A=function(t,r){return void 0===r&&(r={}),m(m(m({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),r)},E=function(t,r){if(void 0===r&&(r={}),l(t))return m(m({},t),r);if(c(t))return T(t,r);var e=A(t);return T(e,r)},I=function(t,r){void 0===r&&(r={});var e=t.priceCategory,n=t.productId,o=t.amount,i=t.questions.map((function(t){var r=t.answers,i=t.questionId,u=t.min,a=t.max,s={rootId:n,min:u,max:a,type:h(t),modifiersCount:r.length,amount:o,path:[]};return m(m({},t),{answers:r.map((function(t){var r=function(t){var r=t.min;return 1===t.modifiersCount?r:0}(s),n=function(t){var r=t.max,e=t.type,n=r||1/0;return"RADIO"===e||"CHECKBOX"===e?1:n}(s),o=function(t){var r=t.groupType,e=t.min,n=t.max;return"RADIO"===r||1===e&&1===n?"RADIO":0===e&&1===n?"CHECKBOX":0!==e||0!==n&&n!==1/0?n>=e?"COUNTER":r:"COUNTER"}({min:r,max:n,groupType:s.type}),u=t.questions.length;return m(m({amount:0},t),{priceCategory:e,questionId:i,min:r,max:n,renderType:o,questions:u?I(t).questions:[]})}))})}));return m(m(m({},t),{questions:i}),r)},T=function(t,r){void 0===r&&(r={});var e=w(t);return I(e,r)},O=function(t,r){return void 0===r&&(r={}),I(t,r)},P=function(){console.log("Not supported yet")},R={CLIENT_NAME:"Trade S.A.",DEFAULT_REQUEST_TIMEOUT:1e4,EXCLUDED_LOGGER_STATUS_CODES:[422],INCLUDED_LOGGER_ENVS:["staging","production"],INCLUDED_INTL_LOG_ENVS:[""],COUNTRY:{NAME:"Ecuador",CODE:"593",LANGUAGE:"es"},DEFAULT_API_TIMEOUT:3e5,HEADERS:["accountId"],FILTERS:["vendorId","storeId","catalogueId","categoryId","productId"],GROUPS:["CATEGORIES","TAGS"],ORDER_FIELDS:["type","sort"],ORDER_TYPES:["ALPHABETIC","PRICE","PREDEFINED"],ORDER_SORTS:["ASC","DESC"],PAGINATION:["page","vendor","store","catalogue","category","product"],ADDITIONAL_FILTERS:["price","query","tags","manufacturerId","weight","dimensions"]},S=function(){return(S=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},_=R.DEFAULT_API_TIMEOUT,D={artisanApp:void 0,timeout:_,apiCache:{},expiresAt:(new Date).getTime()+_,forms:{}};Object.freeze(D);var C=S({},D);Object.seal(C);var U=function(t){C=S(S({},C),t)},x=function(){return S({},C)},B=function(t,r,e){void 0===e&&(e="");var n=r.headers.accountId,o=t.filterBy,i=o.vendorId,u=o.storeId,a=o.catalogueId;!function(t,r){void 0===r&&(r="");var e=x().accountId;if(void 0===t&&void 0===e)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+r)}(n,e),function(t,r){void 0===r&&(r="");var e=x().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+r)}(i,e),function(t,r){void 0===r&&(r="");var e=x().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+r)}(u,e),function(t,r){void 0===r&&(r="");var e=x().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+r)}(a,e)},L=R.FILTERS,j=R.HEADERS,N=function(t,r,e){var n=null==r?void 0:r.message;try{n=r?JSON.parse(r.message):r}catch(t){}return{data:t,hints:Y(e),config:e,error:n}},Y=function(t){var r={};return Object.entries(t.query).forEach((function(t){var e=t,n=e[0],o=e[1];L.includes(n)&&(r[n]=o)})),Object.entries(t.headers).forEach((function(t){var e=t,n=e[0],o=e[1];j.includes(n)&&(r[n]=o)})),r},M=function(){return(M=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},k=function(){return(k=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},F=R.PAGINATION,q=R.ADDITIONAL_FILTERS,H=R.ORDER_FIELDS,G=R.FILTERS,V=R.GROUPS,W=R.ORDER_SORTS,z=R.ORDER_TYPES,K=function(t){var r=x(),e=r.vendorId,n=r.storeId,o=x(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=k(k({},{vendorId:e,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),c=$(s,G,"filter"),f=rt(c);return k(k({},t),{filterBy:f})},X=function(t){var r=tt(t,V,"groupBy");return k({},r)},J=function(t){var r=t.orderBy,e=void 0===r?{}:r,n=$(e,H,"orderBy"),o=k({},n),i=e.sort,u=e.type;return u&&!z.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),z.includes(u)||(delete o.type,o.type="ALPHABETIC"),i&&!W.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order sort "+i),W.includes(i)||(delete o.sort,o.sort="ASC"),k(k({},t),{orderBy:o})},Q=function(t){var r=t.pagination,e=$(void 0===r?{}:r,F,"pagination");return k(k({},t),{pagination:e})},Z=function(t){var r=t.additionalFilters,e=$(void 0===r?{}:r,q,"additionalFilters");return k(k({},t),{additionalFilters:e})},$=function(t,r,e){var n=k({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?r.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+t),delete n[t]):delete n[t]})),n},tt=function(t,r,e){var n=k({},t),o=t[e];return void 0===o||r.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+o),delete n[e]),n},rt=function(t){var r=k({},t);return Object.entries(r).forEach((function(t){var e=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete r[e]:Array.isArray(n)&&et(n[0])||et(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+e+" = "+n),delete r[e])})),r},et=function(t){var r=typeof t;return"number"===r||"string"===r},nt=e(2),ot=e.n(nt),it=function(){return(it=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},ut=function(t){return Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1],i=o;return Array.isArray(o)&&(i=o.reduce((function(t,r){return t+","+r}))),it(it({},t),"catalogueId"===n?{channelId:i}:((e={})[n]=i,e))}),{})},at=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1];return"query"===n?it(it({},t),((e={})[n]=o,e)):t}),{})},st=function(t,r){for(var e=t,n=0,o=Object.entries(r);n<o.length;n++){var i=o[n],u=i[0],a=i[1],s=new RegExp("/:"+u,"g");e=e.replace(s,"/"+a)}return e},ct=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},ft=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},lt=function(t,r,e,n){return ct(void 0,void 0,void 0,(function(){var o,i,u,a,s,c,f;return ft(this,(function(l){switch(l.label){case 0:if(r=function(t){var r=K(t),e=X(r),n=J(e),o=Q(n);return Z(o)}(r),B(r,e),o=function(t,r,e){var n,o=r.filterBy,i=r.groupBy,u=r.additionalFilters,a=ut(o),s=at(u),c=it(it(it({},a),{groupBy:i}),s);i||delete c.groupBy;var f=st(t,e.params),l=(null!==(n=x().artisanApp)&&void 0!==n?n:{}).apiURL,h=Object.entries(c).reduce((function(t,r,e){var n=r[0],o=r[1];return void 0===o?t:t+(e?"&":"")+n+"="+o}),l+"/"+f+"?");return it(it({},e),{url:h,query:c})}(t,r,e),d=o.url,i=ot()(d),u=function(t){return x().apiCache[t]}(i),h=x().expiresAt,(a=(new Date).getTime()>=h)&&function(){var t=x().timeout,r=void 0===t?0:t;U({apiCache:M({},D.apiCache),expiresAt:(new Date).getTime()+r})}(),u&&!a)return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,n(o)];case 2:return s=l.sent(),f=N(s,void 0,o),function(t,r){var e,n=x().apiCache,o=M(M({},n),((e={})[t]=r,e));U({apiCache:o})}(i,f),[2,f];case 3:return c=l.sent(),[2,f=N(void 0,c,o)];case 4:return[2,u]}var h,d}))}))},ht=function(t){return ct(void 0,void 0,void 0,(function(){var r,e,n,o,i,u;return ft(this,(function(a){switch(a.label){case 0:r=t.url,e=t.headers,n=t.body,"{}"===(o={headers:e,body:JSON.stringify(n)}).body&&delete o.body,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(r,o).then((function(t){return t.json()}))];case 2:return i=a.sent(),[3,4];case 3:return u=a.sent(),i={code:null,status:"failed",message:u.message,stack:u.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i.data]}}))}))},dt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},pt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},yt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},vt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},gt=function(t,r){return yt(void 0,void 0,void 0,(function(){return vt(this,(function(e){switch(e.label){case 0:return[4,lt("v1/products/:productId",r,{headers:{},params:{productId:t},query:{},body:{}},(function(t){return yt(void 0,void 0,void 0,(function(){return vt(this,(function(r){switch(r.label){case 0:return[4,(e=t,dt(void 0,void 0,void 0,(function(){return pt(this,(function(t){switch(t.label){case 0:return[4,ht(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,e.sent()]}}))}))},mt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},bt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},wt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},At=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Et=function(t){return wt(void 0,void 0,void 0,(function(){return At(this,(function(r){switch(r.label){case 0:return[4,lt("v1/products",t,{headers:{},params:{},query:{},body:{}},(function(t){return wt(void 0,void 0,void 0,(function(){return At(this,(function(r){switch(r.label){case 0:return[4,(e=t,mt(void 0,void 0,void 0,(function(){return bt(this,(function(t){switch(t.label){case 0:return[4,ht(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,r.sent()]}}))}))},It=function(){console.log("Not implemented yet")},Tt=function(){console.log("not implemented yet")},Ot=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},Pt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Rt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},St=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},_t=function(t){return Rt(void 0,void 0,void 0,(function(){return St(this,(function(r){switch(r.label){case 0:return[4,lt("v1/stores/details",t,{headers:{},params:{},query:{},body:{}},(function(t){return Rt(void 0,void 0,void 0,(function(){return St(this,(function(r){switch(r.label){case 0:return[4,(e=t,Ot(void 0,void 0,void 0,(function(){return Pt(this,(function(t){switch(t.label){case 0:return[4,ht(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,r.sent()]}}))}))},Dt=function(){return(Dt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Ct=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Ut=function(t,r){for(var e=Ct(r),n=t,o=t[0];e.length;){o=Bt(n,e[0]),e=e.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups}return o},xt=function(t,r,e){for(var n=Ct(r),o=t,i=Bt(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Bt(o,n[0]),n=n.slice(1),u=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=Ct(u?i.modifiers:i.groups);var a=n[0];if(1===r.length&&(i={groups:t},u=!1),u){var s=i.modifiers.map((function(t){return t.id===a?Dt({},e):Dt({},t)}));i.modifiers=s}else{var c=i.groups.map((function(t){return t.id===a?Dt({},e):Dt({},t)}));i.groups=c}return 1===r.length?Ct(i.groups):Ct(t)},Bt=function(t,r){var e=t.find((function(t){return t.id===r}));if(!e)throw new Error("Path segment "+r+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return e},Lt=function(){return(Lt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},jt=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Nt=function(t,r,e){var n=e.slice(0,-1),o=Ut(r,n),i=jt(o.modifiers);"RADIO"===o.type&&(i=o.modifiers.map((function(t){return"RADIO"!==t.type||t.id===e[e.length-1]?Lt({},t):Lt(Lt({},t),{amount:0,error:"",totals:nr(Lt(Lt({},t.data),{amount:0})),data:Lt(Lt({},t.data),{amount:0})})})));var u=(i=i.map((function(r){var n=O(r.data),o=jt(e.slice(0,-1),[r.id]),i=Lt(Lt({},r),{groups:Ht(n,{rootId:t,path:o},r.groups)});return i.status=y(i),i}))).map((function(t){return Lt({},t.data)})),a=Lt(Lt({},o.data),{answers:u}),s=Lt(Lt({},o),{touched:!0,modifiers:i,data:a});s.status=p(s);var c=xt(r,n,s);return n.length>1&&(c=Yt(t,c,n)),c},Yt=function(t,r,e){var n=e.slice(0,-1),o=Ut(r,n),i=o.groups.map((function(t){return Lt({},t.data)})),u=Lt(Lt({},o.data),{questions:i}),a=o.groups.map((function(t){var r=Lt({},t);return r.status=p(r),r})),s=Lt(Lt({},o),{touched:!0,groups:a,data:u});s.status=y(s);var c=xt(r,n,s);return n.length>1&&(c=Nt(t,c,n)),c},Mt=function(){return(Mt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},kt=function(t,r,e){var n,o=Mt({},x().forms),i=o[t],u=Ut(i.renderer,r),a=function(t,r,e,n){var o=Lt(Lt({},e),{amount:n,touched:!0,errors:d(e,n),totals:nr(Lt(Lt({},e.data),{amount:n})),data:Lt(Lt({},e.data),{amount:n})});return o.status=y(o),xt(t,r,o)}(i.renderer,r,u,e);a=Nt(t,a,r);var s=zt(a,i.product),c=Mt(Mt({},i),{renderer:a,product:s,status:g(a)}),f=Mt(Mt({},o),((n={})[t]=c,n));U({forms:f});var l=Mt({},c);delete l.callback,i.callback(l)},Ft=function(){return(Ft=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},qt=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Ht=function(t,r,e){var n=r.rootId,o=r.path;return t.questions.map((function(r){var i=null==e?void 0:e.find((function(t){return t.id===r.questionId}));return Gt(r,{amount:t.amount,rootId:n,path:qt(o)},i)}))},Gt=function(t,r,e){var n=t.questionId,o=t.name,i=t.description,u=t.max,a=t.min,s=t.images,c=r.amount,f=r.rootId,l=r.path,d=null!=e?e:{},y=d.errors,v=d.touched,g={id:n,name:o,description:null!=i?i:"",images:qt(null!=s?s:[]),data:Ft({},t),errors:null!=y?y:[],touched:null!=v&&v,status:"IDLE",hidden:c<1,required:a>0,type:h(t)},m={rootId:f,max:u,min:a,type:g.type,modifiersCount:t.answers.length,amount:c,path:qt(l,[n])},b=t.answers.map((function(t){var r=null==e?void 0:e.modifiers.find((function(r){return r.id===t.productId}));return Vt(t,m,r)})),w=Ft(Ft({},g),{modifiers:b});return Ft(Ft({},w),{status:p(w)})},Vt=function(t,r,e){var n,o,i=t.productId,u=t.questionId,a=t.name,s=t.images,c=t.amount,f=t.renderType,l=t.min,h=t.max,d=O(t),p=r.rootId,v=r.path,g=qt(v,[i]),m=Ht(d,{rootId:p,path:g},null==e?void 0:e.groups),b={id:i,groupId:u,name:a,images:qt(s),amount:c,data:Ft({},t),groups:m,errors:null!==(n=null==e?void 0:e.errors)&&void 0!==n?n:[],hidden:r.amount<1,min:l,max:h,required:l>0,touched:null!==(o=null==e?void 0:e.touched)&&void 0!==o&&o,status:"IDLE",totals:nr(Ft(Ft({},t),{amount:c})),type:f,handleChange:function(t){kt(r.rootId,g,t)}};return Ft(Ft({},b),{status:y(b)})},Wt=function(){return(Wt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},zt=function(t,r){var e=b(r);return Wt(Wt({},e),{questionsAndAnswers:Kt(t)})},Kt=function(t){return t.map((function(t){return Wt(Wt({},t.data),{answers:Xt(t.modifiers)})}))},Xt=function(t){return t.map((function(t){return t.amount?Wt(Wt({},t.data),{questionsAndAnswers:Kt(t.groups)}):Wt(Wt({},t.data),{questionsAndAnswers:[]})}))},Jt=function(){return(Jt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Qt=function(t,r){var e,n=t.productId,o=x().forms;if(!!o[n])return a("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var i=function(t){var r=E(t,{amount:1}),e=Ht(r,{rootId:r.productId,path:[]});return{product:zt(e,t),renderer:e,validate:$t,status:g(e)}}(t),u=Jt(Jt({},o),((e={})[n]=Jt(Jt({},i),{callback:r}),e));return U({forms:u}),r(Jt({},i)),function(){return Zt(n)}},Zt=function(t){var r=x().forms,e=Jt({},r);delete e[t],U({forms:e})},$t=function(){},tr=function(){return(tr=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},rr=!1,er=function(t,r){if(void 0===r&&(r={}),rr)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(U(tr({artisanApp:t},r)),void 0!==r.timeout){var e=(new Date).getTime()+r.timeout;U({expiresAt:e})}"undefined"==typeof window||(rr=!0)}},nr=function(t){return{grossPrice:ir(t),totalDiscounts:ur(t),totalTaxes:or(t),netPrice:ar(t)}},or=function(t){var r=b(t),e=r.prices,n=r.amount,o=r.priceCategory,i=e[o],u=i.taxes,a=i.grossPrice,s=cr(u,a);return r.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var e=r.prices,n=r.amount,i=e[o],u=i.taxes,a=i.grossPrice;return t+n*cr(u,a)}),0)}),0)+s*n},ir=function(t){return sr(t,"grossPrice")},ur=function(t){return 0},ar=function(t){return sr(t,"netPrice")},sr=function(t,r){var e=b(t),n=e.prices,o=e.amount,i=e.priceCategory,u=n[i][r];return e.questionsAndAnswers.reduce((function(t,e){return t+e.answers.reduce((function(t,e){var n=e.prices;return t+e.amount*n[i][r]}),0)}),0)+u*o},cr=function(t,r){return t.reduce((function(t,e){return t+e.percentage/100*r}),0)}}])}));
|
package/build/report.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"label":"main.bundle.js","isAsset":true,"statSize":140560,"parsedSize":58335,"gzipSize":14947,"groups":[{"label":"types/build","path":"./types/build","statSize":5432,"groups":[{"id":0,"label":"index.js","path":"./types/build/index.js","statSize":1405,"parsedSize":532,"gzipSize":291},{"label":"types","path":"./types/build/types","statSize":4027,"groups":[{"id":3,"label":"app.types.js","path":"./types/build/types/app.types.js","statSize":114,"parsedSize":78,"gzipSize":97},{"id":4,"label":"account.types.js","path":"./types/build/types/account.types.js","statSize":150,"parsedSize":78,"gzipSize":97},{"id":5,"label":"artisanDB.types.js","path":"./types/build/types/artisanDB.types.js","statSize":120,"parsedSize":78,"gzipSize":97},{"id":6,"label":"category.types.js","path":"./types/build/types/category.types.js","statSize":119,"parsedSize":78,"gzipSize":97},{"id":7,"label":"channel.types.js","path":"./types/build/types/channel.types.js","statSize":150,"parsedSize":78,"gzipSize":97},{"id":8,"label":"common.types.js","path":"./types/build/types/common.types.js","statSize":162,"parsedSize":78,"gzipSize":97},{"id":9,"label":"coupons.types.js","path":"./types/build/types/coupons.types.js","statSize":118,"parsedSize":78,"gzipSize":97},{"id":10,"label":"image.types.js","path":"./types/build/types/image.types.js","statSize":146,"parsedSize":78,"gzipSize":97},{"id":11,"label":"product.types.js","path":"./types/build/types/product.types.js","statSize":1492,"parsedSize":723,"gzipSize":357},{"id":12,"label":"shippingCost.types.js","path":"./types/build/types/shippingCost.types.js","statSize":160,"parsedSize":78,"gzipSize":97},{"id":13,"label":"shoppingCart.types.js","path":"./types/build/types/shoppingCart.types.js","statSize":123,"parsedSize":78,"gzipSize":97},{"id":14,"label":"store.types.js","path":"./types/build/types/store.types.js","statSize":913,"parsedSize":485,"gzipSize":270},{"id":15,"label":"vendor.types.js","path":"./types/build/types/vendor.types.js","statSize":117,"parsedSize":78,"gzipSize":97},{"id":16,"label":"http.types.js","path":"./types/build/types/http.types.js","statSize":143,"parsedSize":78,"gzipSize":97}],"parsedSize":2144,"gzipSize":460}],"parsedSize":2676,"gzipSize":659},{"label":"node_modules","path":"./node_modules","statSize":60672,"groups":[{"label":"charenc","path":"./node_modules/charenc","statSize":850,"groups":[{"id":1,"label":"charenc.js","path":"./node_modules/charenc/charenc.js","statSize":850,"parsedSize":426,"gzipSize":231}],"parsedSize":426,"gzipSize":231},{"label":"sha1","path":"./node_modules/sha1","statSize":2124,"groups":[{"id":2,"label":"sha1.js","path":"./node_modules/sha1/sha1.js","statSize":2124,"parsedSize":947,"gzipSize":625}],"parsedSize":947,"gzipSize":625},{"label":"buffer","path":"./node_modules/buffer","statSize":48590,"groups":[{"id":17,"label":"index.js","path":"./node_modules/buffer/index.js","statSize":48590,"parsedSize":19827,"gzipSize":5835}],"parsedSize":19827,"gzipSize":5835},{"label":"base64-js","path":"./node_modules/base64-js","statSize":3944,"groups":[{"id":19,"label":"index.js","path":"./node_modules/base64-js/index.js","statSize":3944,"parsedSize":1406,"gzipSize":743}],"parsedSize":1406,"gzipSize":743},{"label":"ieee754","path":"./node_modules/ieee754","statSize":2064,"groups":[{"id":20,"label":"index.js","path":"./node_modules/ieee754/index.js","statSize":2064,"parsedSize":881,"gzipSize":496}],"parsedSize":881,"gzipSize":496},{"label":"isarray","path":"./node_modules/isarray","statSize":132,"groups":[{"id":21,"label":"index.js","path":"./node_modules/isarray/index.js","statSize":132,"parsedSize":104,"gzipSize":109}],"parsedSize":104,"gzipSize":109},{"label":"crypt","path":"./node_modules/crypt","statSize":2968,"groups":[{"id":22,"label":"crypt.js","path":"./node_modules/crypt/crypt.js","statSize":2968,"parsedSize":1273,"gzipSize":646}],"parsedSize":1273,"gzipSize":646}],"parsedSize":24864,"gzipSize":7854},{"label":"buildin","path":"./buildin","statSize":472,"groups":[{"id":18,"label":"global.js","path":"./buildin/global.js","statSize":472,"parsedSize":144,"gzipSize":129}],"parsedSize":144,"gzipSize":129},{"label":"src","path":"./src","statSize":73984,"groups":[{"id":24,"label":"index.ts + 30 modules (concatenated)","path":"./src/index.ts + 30 modules (concatenated)","statSize":73984,"parsedSize":29470,"gzipSize":6431,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 30 modules (concatenated)/src","statSize":73974,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 30 modules (concatenated)/src/index.ts","statSize":944,"parsedSize":376,"gzipSize":82,"inaccurateSizes":true},{"label":"utils","path":"./src/index.ts + 30 modules (concatenated)/src/utils","statSize":44044,"groups":[{"label":"assertions","path":"./src/index.ts + 30 modules (concatenated)/src/utils/assertions","statSize":3979,"groups":[{"id":null,"label":"assertions.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/assertions/assertions.utils.ts","statSize":3979,"parsedSize":1584,"gzipSize":345,"inaccurateSizes":true}],"parsedSize":1584,"gzipSize":345,"inaccurateSizes":true},{"label":"transformers","path":"./src/index.ts + 30 modules (concatenated)/src/utils/transformers","statSize":5545,"groups":[{"id":null,"label":"transformers.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/transformers/transformers.utils.ts","statSize":4629,"parsedSize":1843,"gzipSize":402,"inaccurateSizes":true},{"id":null,"label":"api.transformer.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/transformers/api.transformer.ts","statSize":916,"parsedSize":364,"gzipSize":79,"inaccurateSizes":true}],"parsedSize":2208,"gzipSize":481,"inaccurateSizes":true},{"label":"caculations","path":"./src/index.ts + 30 modules (concatenated)/src/utils/caculations","statSize":2900,"groups":[{"id":null,"label":"calculations.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/caculations/calculations.utils.ts","statSize":2900,"parsedSize":1155,"gzipSize":252,"inaccurateSizes":true}],"parsedSize":1155,"gzipSize":252,"inaccurateSizes":true},{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/common.utils.ts","statSize":383,"parsedSize":152,"gzipSize":33,"inaccurateSizes":true},{"label":"modifiers","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers","statSize":15317,"groups":[{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/common.utils.ts","statSize":2209,"parsedSize":879,"gzipSize":192,"inaccurateSizes":true},{"id":null,"label":"form.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/form.utils.ts","statSize":611,"parsedSize":243,"gzipSize":53,"inaccurateSizes":true},{"id":null,"label":"renderer.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/renderer.utils.ts","statSize":3772,"parsedSize":1502,"gzipSize":327,"inaccurateSizes":true},{"id":null,"label":"handleChange.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/handleChange.utils.ts","statSize":1630,"parsedSize":649,"gzipSize":141,"inaccurateSizes":true},{"id":null,"label":"rendererTraversal.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/rendererTraversal.utils.ts","statSize":3060,"parsedSize":1218,"gzipSize":265,"inaccurateSizes":true},{"id":null,"label":"updateRenderer.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/updateRenderer.utils.ts","statSize":4035,"parsedSize":1607,"gzipSize":350,"inaccurateSizes":true}],"parsedSize":6101,"gzipSize":1331,"inaccurateSizes":true},{"label":"http","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http","statSize":15920,"groups":[{"id":null,"label":"http.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/http.utils.ts","statSize":6121,"parsedSize":2438,"gzipSize":532,"inaccurateSizes":true},{"id":null,"label":"cache.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/cache.utils.ts","statSize":1178,"parsedSize":469,"gzipSize":102,"inaccurateSizes":true},{"id":null,"label":"purge.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/purge.utils.ts","statSize":5681,"parsedSize":2262,"gzipSize":493,"inaccurateSizes":true},{"id":null,"label":"request.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/request.utils.ts","statSize":2940,"parsedSize":1171,"gzipSize":255,"inaccurateSizes":true}],"parsedSize":6341,"gzipSize":1383,"inaccurateSizes":true}],"parsedSize":17544,"gzipSize":3828,"inaccurateSizes":true},{"label":"lib","path":"./src/index.ts + 30 modules (concatenated)/src/lib","statSize":16514,"groups":[{"label":"getCategories","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getCategories","statSize":109,"groups":[{"id":null,"label":"getCategories.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getCategories/getCategories.ts","statSize":109,"parsedSize":43,"gzipSize":9,"inaccurateSizes":true}],"parsedSize":43,"gzipSize":9,"inaccurateSizes":true},{"label":"getProductDetails","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProductDetails","statSize":3731,"groups":[{"id":null,"label":"getProductDetails.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProductDetails/getProductDetails.ts","statSize":3731,"parsedSize":1486,"gzipSize":324,"inaccurateSizes":true}],"parsedSize":1486,"gzipSize":324,"inaccurateSizes":true},{"label":"getProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProducts","statSize":3607,"groups":[{"id":null,"label":"getProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProducts/getProducts.ts","statSize":3607,"parsedSize":1436,"gzipSize":313,"inaccurateSizes":true}],"parsedSize":1436,"gzipSize":313,"inaccurateSizes":true},{"label":"getRecommendedProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRecommendedProducts","statSize":129,"groups":[{"id":null,"label":"getRecommendedProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRecommendedProducts/getRecommendedProducts.ts","statSize":129,"parsedSize":51,"gzipSize":11,"inaccurateSizes":true}],"parsedSize":51,"gzipSize":11,"inaccurateSizes":true},{"label":"getRelatedProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRelatedProducts","statSize":121,"groups":[{"id":null,"label":"getRelatedProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRelatedProducts/getRelatedProducts.ts","statSize":121,"parsedSize":48,"gzipSize":10,"inaccurateSizes":true}],"parsedSize":48,"gzipSize":10,"inaccurateSizes":true},{"label":"getStoreDetails","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getStoreDetails","statSize":3637,"groups":[{"id":null,"label":"getStoreDetails.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getStoreDetails/getStoreDetails.ts","statSize":3637,"parsedSize":1448,"gzipSize":316,"inaccurateSizes":true}],"parsedSize":1448,"gzipSize":316,"inaccurateSizes":true},{"label":"registerModifiersForm","path":"./src/index.ts + 30 modules (concatenated)/src/lib/registerModifiersForm","statSize":2691,"groups":[{"id":null,"label":"registerModifiersForm.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/registerModifiersForm/registerModifiersForm.ts","statSize":2691,"parsedSize":1071,"gzipSize":233,"inaccurateSizes":true}],"parsedSize":1071,"gzipSize":233,"inaccurateSizes":true},{"label":"validateProduct","path":"./src/index.ts + 30 modules (concatenated)/src/lib/validateProduct","statSize":75,"groups":[{"id":null,"label":"validateProduct.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/validateProduct/validateProduct.ts","statSize":75,"parsedSize":29,"gzipSize":6,"inaccurateSizes":true}],"parsedSize":29,"gzipSize":6,"inaccurateSizes":true},{"label":"initProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/initProducts","statSize":1484,"groups":[{"id":null,"label":"initProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/initProducts/initProducts.ts","statSize":1484,"parsedSize":591,"gzipSize":128,"inaccurateSizes":true}],"parsedSize":591,"gzipSize":128,"inaccurateSizes":true},{"id":null,"label":"common.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/common.ts","statSize":930,"parsedSize":370,"gzipSize":80,"inaccurateSizes":true}],"parsedSize":6578,"gzipSize":1435,"inaccurateSizes":true},{"label":"services","path":"./src/index.ts + 30 modules (concatenated)/src/services","statSize":8566,"groups":[{"label":"fetchProductDetails","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProductDetails","statSize":2858,"groups":[{"id":null,"label":"fetchProductDetails.service.tsx","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProductDetails/fetchProductDetails.service.tsx","statSize":2858,"parsedSize":1138,"gzipSize":248,"inaccurateSizes":true}],"parsedSize":1138,"gzipSize":248,"inaccurateSizes":true},{"label":"fetchProducts","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProducts","statSize":2852,"groups":[{"id":null,"label":"fetchProducts.service.tsx","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProducts/fetchProducts.service.tsx","statSize":2852,"parsedSize":1136,"gzipSize":247,"inaccurateSizes":true}],"parsedSize":1136,"gzipSize":247,"inaccurateSizes":true},{"label":"fetchStoreDetails","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchStoreDetails","statSize":2856,"groups":[{"id":null,"label":"fetchStoreDetails.service.tsx","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchStoreDetails/fetchStoreDetails.service.tsx","statSize":2856,"parsedSize":1137,"gzipSize":248,"inaccurateSizes":true}],"parsedSize":1137,"gzipSize":248,"inaccurateSizes":true}],"parsedSize":3412,"gzipSize":744,"inaccurateSizes":true},{"label":"config","path":"./src/index.ts + 30 modules (concatenated)/src/config","statSize":1528,"groups":[{"id":null,"label":"constants.ts","path":"./src/index.ts + 30 modules (concatenated)/src/config/constants.ts","statSize":1528,"parsedSize":608,"gzipSize":132,"inaccurateSizes":true}],"parsedSize":608,"gzipSize":132,"inaccurateSizes":true},{"label":"errors","path":"./src/index.ts + 30 modules (concatenated)/src/errors","statSize":2378,"groups":[{"id":null,"label":"api.errors.ts","path":"./src/index.ts + 30 modules (concatenated)/src/errors/api.errors.ts","statSize":2378,"parsedSize":947,"gzipSize":206,"inaccurateSizes":true}],"parsedSize":947,"gzipSize":206,"inaccurateSizes":true}],"parsedSize":29466,"gzipSize":6430,"inaccurateSizes":true}]}],"parsedSize":29470,"gzipSize":6431}]},{"label":"vendors.bundle.js","isAsset":true,"statSize":19,"parsedSize":1175,"gzipSize":529,"groups":[{"label":"src","path":"./src","statSize":19,"groups":[{"id":23,"label":"vendors.ts","path":"./src/vendors.ts","statSize":19,"parsedSize":15,"gzipSize":35}],"parsedSize":15,"gzipSize":35}]}]
|
|
1
|
+
[{"label":"main.bundle.js","isAsset":true,"statSize":149791,"parsedSize":61355,"gzipSize":15755,"groups":[{"label":"types/build","path":"./types/build","statSize":5432,"groups":[{"id":0,"label":"index.js","path":"./types/build/index.js","statSize":1405,"parsedSize":532,"gzipSize":291},{"label":"types","path":"./types/build/types","statSize":4027,"groups":[{"id":3,"label":"app.types.js","path":"./types/build/types/app.types.js","statSize":114,"parsedSize":78,"gzipSize":97},{"id":4,"label":"account.types.js","path":"./types/build/types/account.types.js","statSize":150,"parsedSize":78,"gzipSize":97},{"id":5,"label":"artisanDB.types.js","path":"./types/build/types/artisanDB.types.js","statSize":120,"parsedSize":78,"gzipSize":97},{"id":6,"label":"category.types.js","path":"./types/build/types/category.types.js","statSize":119,"parsedSize":78,"gzipSize":97},{"id":7,"label":"channel.types.js","path":"./types/build/types/channel.types.js","statSize":150,"parsedSize":78,"gzipSize":97},{"id":8,"label":"common.types.js","path":"./types/build/types/common.types.js","statSize":162,"parsedSize":78,"gzipSize":97},{"id":9,"label":"coupons.types.js","path":"./types/build/types/coupons.types.js","statSize":118,"parsedSize":78,"gzipSize":97},{"id":10,"label":"image.types.js","path":"./types/build/types/image.types.js","statSize":146,"parsedSize":78,"gzipSize":97},{"id":11,"label":"product.types.js","path":"./types/build/types/product.types.js","statSize":1492,"parsedSize":723,"gzipSize":357},{"id":12,"label":"shippingCost.types.js","path":"./types/build/types/shippingCost.types.js","statSize":160,"parsedSize":78,"gzipSize":97},{"id":13,"label":"shoppingCart.types.js","path":"./types/build/types/shoppingCart.types.js","statSize":123,"parsedSize":78,"gzipSize":97},{"id":14,"label":"store.types.js","path":"./types/build/types/store.types.js","statSize":913,"parsedSize":485,"gzipSize":270},{"id":15,"label":"vendor.types.js","path":"./types/build/types/vendor.types.js","statSize":117,"parsedSize":78,"gzipSize":97},{"id":16,"label":"http.types.js","path":"./types/build/types/http.types.js","statSize":143,"parsedSize":78,"gzipSize":97}],"parsedSize":2144,"gzipSize":460}],"parsedSize":2676,"gzipSize":659},{"label":"node_modules","path":"./node_modules","statSize":60672,"groups":[{"label":"charenc","path":"./node_modules/charenc","statSize":850,"groups":[{"id":1,"label":"charenc.js","path":"./node_modules/charenc/charenc.js","statSize":850,"parsedSize":426,"gzipSize":231}],"parsedSize":426,"gzipSize":231},{"label":"sha1","path":"./node_modules/sha1","statSize":2124,"groups":[{"id":2,"label":"sha1.js","path":"./node_modules/sha1/sha1.js","statSize":2124,"parsedSize":947,"gzipSize":625}],"parsedSize":947,"gzipSize":625},{"label":"buffer","path":"./node_modules/buffer","statSize":48590,"groups":[{"id":17,"label":"index.js","path":"./node_modules/buffer/index.js","statSize":48590,"parsedSize":19827,"gzipSize":5835}],"parsedSize":19827,"gzipSize":5835},{"label":"base64-js","path":"./node_modules/base64-js","statSize":3944,"groups":[{"id":19,"label":"index.js","path":"./node_modules/base64-js/index.js","statSize":3944,"parsedSize":1406,"gzipSize":743}],"parsedSize":1406,"gzipSize":743},{"label":"ieee754","path":"./node_modules/ieee754","statSize":2064,"groups":[{"id":20,"label":"index.js","path":"./node_modules/ieee754/index.js","statSize":2064,"parsedSize":881,"gzipSize":496}],"parsedSize":881,"gzipSize":496},{"label":"isarray","path":"./node_modules/isarray","statSize":132,"groups":[{"id":21,"label":"index.js","path":"./node_modules/isarray/index.js","statSize":132,"parsedSize":104,"gzipSize":109}],"parsedSize":104,"gzipSize":109},{"label":"crypt","path":"./node_modules/crypt","statSize":2968,"groups":[{"id":22,"label":"crypt.js","path":"./node_modules/crypt/crypt.js","statSize":2968,"parsedSize":1273,"gzipSize":646}],"parsedSize":1273,"gzipSize":646}],"parsedSize":24864,"gzipSize":7855},{"label":"buildin","path":"./buildin","statSize":472,"groups":[{"id":18,"label":"global.js","path":"./buildin/global.js","statSize":472,"parsedSize":144,"gzipSize":129}],"parsedSize":144,"gzipSize":129},{"label":"src","path":"./src","statSize":83215,"groups":[{"id":24,"label":"index.ts + 30 modules (concatenated)","path":"./src/index.ts + 30 modules (concatenated)","statSize":83215,"parsedSize":32490,"gzipSize":7232,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 30 modules (concatenated)/src","statSize":83205,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 30 modules (concatenated)/src/index.ts","statSize":944,"parsedSize":368,"gzipSize":82,"inaccurateSizes":true},{"label":"utils","path":"./src/index.ts + 30 modules (concatenated)/src/utils","statSize":53150,"groups":[{"label":"assertions","path":"./src/index.ts + 30 modules (concatenated)/src/utils/assertions","statSize":3979,"groups":[{"id":null,"label":"assertions.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/assertions/assertions.utils.ts","statSize":3979,"parsedSize":1553,"gzipSize":345,"inaccurateSizes":true}],"parsedSize":1553,"gzipSize":345,"inaccurateSizes":true},{"label":"transformers","path":"./src/index.ts + 30 modules (concatenated)/src/utils/transformers","statSize":5509,"groups":[{"id":null,"label":"transformers.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/transformers/transformers.utils.ts","statSize":4593,"parsedSize":1793,"gzipSize":399,"inaccurateSizes":true},{"id":null,"label":"api.transformer.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/transformers/api.transformer.ts","statSize":916,"parsedSize":357,"gzipSize":79,"inaccurateSizes":true}],"parsedSize":2150,"gzipSize":478,"inaccurateSizes":true},{"label":"caculations","path":"./src/index.ts + 30 modules (concatenated)/src/utils/caculations","statSize":2900,"groups":[{"id":null,"label":"calculations.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/caculations/calculations.utils.ts","statSize":2900,"parsedSize":1132,"gzipSize":252,"inaccurateSizes":true}],"parsedSize":1132,"gzipSize":252,"inaccurateSizes":true},{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/common.utils.ts","statSize":383,"parsedSize":149,"gzipSize":33,"inaccurateSizes":true},{"label":"modifiers","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers","statSize":24459,"groups":[{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/common.utils.ts","statSize":6937,"parsedSize":2708,"gzipSize":602,"inaccurateSizes":true},{"id":null,"label":"form.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/form.utils.ts","statSize":2319,"parsedSize":905,"gzipSize":201,"inaccurateSizes":true},{"id":null,"label":"renderer.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/renderer.utils.ts","statSize":5227,"parsedSize":2040,"gzipSize":454,"inaccurateSizes":true},{"id":null,"label":"handleChange.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/handleChange.utils.ts","statSize":1867,"parsedSize":728,"gzipSize":162,"inaccurateSizes":true},{"id":null,"label":"rendererTraversal.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/rendererTraversal.utils.ts","statSize":3092,"parsedSize":1207,"gzipSize":268,"inaccurateSizes":true},{"id":null,"label":"updateRenderer.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/updateRenderer.utils.ts","statSize":5017,"parsedSize":1958,"gzipSize":436,"inaccurateSizes":true}],"parsedSize":9549,"gzipSize":2125,"inaccurateSizes":true},{"label":"http","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http","statSize":15920,"groups":[{"id":null,"label":"http.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/http.utils.ts","statSize":6121,"parsedSize":2389,"gzipSize":531,"inaccurateSizes":true},{"id":null,"label":"cache.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/cache.utils.ts","statSize":1178,"parsedSize":459,"gzipSize":102,"inaccurateSizes":true},{"id":null,"label":"purge.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/purge.utils.ts","statSize":5681,"parsedSize":2218,"gzipSize":493,"inaccurateSizes":true},{"id":null,"label":"request.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/request.utils.ts","statSize":2940,"parsedSize":1147,"gzipSize":255,"inaccurateSizes":true}],"parsedSize":6215,"gzipSize":1383,"inaccurateSizes":true}],"parsedSize":20751,"gzipSize":4619,"inaccurateSizes":true},{"label":"lib","path":"./src/index.ts + 30 modules (concatenated)/src/lib","statSize":16639,"groups":[{"label":"getCategories","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getCategories","statSize":109,"groups":[{"id":null,"label":"getCategories.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getCategories/getCategories.ts","statSize":109,"parsedSize":42,"gzipSize":9,"inaccurateSizes":true}],"parsedSize":42,"gzipSize":9,"inaccurateSizes":true},{"label":"getProductDetails","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProductDetails","statSize":3731,"groups":[{"id":null,"label":"getProductDetails.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProductDetails/getProductDetails.ts","statSize":3731,"parsedSize":1456,"gzipSize":324,"inaccurateSizes":true}],"parsedSize":1456,"gzipSize":324,"inaccurateSizes":true},{"label":"getProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProducts","statSize":3607,"groups":[{"id":null,"label":"getProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProducts/getProducts.ts","statSize":3607,"parsedSize":1408,"gzipSize":313,"inaccurateSizes":true}],"parsedSize":1408,"gzipSize":313,"inaccurateSizes":true},{"label":"getRecommendedProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRecommendedProducts","statSize":129,"groups":[{"id":null,"label":"getRecommendedProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRecommendedProducts/getRecommendedProducts.ts","statSize":129,"parsedSize":50,"gzipSize":11,"inaccurateSizes":true}],"parsedSize":50,"gzipSize":11,"inaccurateSizes":true},{"label":"getRelatedProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRelatedProducts","statSize":121,"groups":[{"id":null,"label":"getRelatedProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRelatedProducts/getRelatedProducts.ts","statSize":121,"parsedSize":47,"gzipSize":10,"inaccurateSizes":true}],"parsedSize":47,"gzipSize":10,"inaccurateSizes":true},{"label":"getStoreDetails","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getStoreDetails","statSize":3637,"groups":[{"id":null,"label":"getStoreDetails.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getStoreDetails/getStoreDetails.ts","statSize":3637,"parsedSize":1420,"gzipSize":316,"inaccurateSizes":true}],"parsedSize":1420,"gzipSize":316,"inaccurateSizes":true},{"label":"registerModifiersForm","path":"./src/index.ts + 30 modules (concatenated)/src/lib/registerModifiersForm","statSize":2816,"groups":[{"id":null,"label":"registerModifiersForm.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/registerModifiersForm/registerModifiersForm.ts","statSize":2816,"parsedSize":1099,"gzipSize":244,"inaccurateSizes":true}],"parsedSize":1099,"gzipSize":244,"inaccurateSizes":true},{"label":"validateProduct","path":"./src/index.ts + 30 modules (concatenated)/src/lib/validateProduct","statSize":75,"groups":[{"id":null,"label":"validateProduct.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/validateProduct/validateProduct.ts","statSize":75,"parsedSize":29,"gzipSize":6,"inaccurateSizes":true}],"parsedSize":29,"gzipSize":6,"inaccurateSizes":true},{"label":"initProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/initProducts","statSize":1484,"groups":[{"id":null,"label":"initProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/initProducts/initProducts.ts","statSize":1484,"parsedSize":579,"gzipSize":128,"inaccurateSizes":true}],"parsedSize":579,"gzipSize":128,"inaccurateSizes":true},{"id":null,"label":"common.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/common.ts","statSize":930,"parsedSize":363,"gzipSize":80,"inaccurateSizes":true}],"parsedSize":6496,"gzipSize":1446,"inaccurateSizes":true},{"label":"services","path":"./src/index.ts + 30 modules (concatenated)/src/services","statSize":8566,"groups":[{"label":"fetchProductDetails","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProductDetails","statSize":2858,"groups":[{"id":null,"label":"fetchProductDetails.service.tsx","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProductDetails/fetchProductDetails.service.tsx","statSize":2858,"parsedSize":1115,"gzipSize":248,"inaccurateSizes":true}],"parsedSize":1115,"gzipSize":248,"inaccurateSizes":true},{"label":"fetchProducts","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProducts","statSize":2852,"groups":[{"id":null,"label":"fetchProducts.service.tsx","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProducts/fetchProducts.service.tsx","statSize":2852,"parsedSize":1113,"gzipSize":247,"inaccurateSizes":true}],"parsedSize":1113,"gzipSize":247,"inaccurateSizes":true},{"label":"fetchStoreDetails","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchStoreDetails","statSize":2856,"groups":[{"id":null,"label":"fetchStoreDetails.service.tsx","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchStoreDetails/fetchStoreDetails.service.tsx","statSize":2856,"parsedSize":1115,"gzipSize":248,"inaccurateSizes":true}],"parsedSize":1115,"gzipSize":248,"inaccurateSizes":true}],"parsedSize":3344,"gzipSize":744,"inaccurateSizes":true},{"label":"config","path":"./src/index.ts + 30 modules (concatenated)/src/config","statSize":1528,"groups":[{"id":null,"label":"constants.ts","path":"./src/index.ts + 30 modules (concatenated)/src/config/constants.ts","statSize":1528,"parsedSize":596,"gzipSize":132,"inaccurateSizes":true}],"parsedSize":596,"gzipSize":132,"inaccurateSizes":true},{"label":"errors","path":"./src/index.ts + 30 modules (concatenated)/src/errors","statSize":2378,"groups":[{"id":null,"label":"api.errors.ts","path":"./src/index.ts + 30 modules (concatenated)/src/errors/api.errors.ts","statSize":2378,"parsedSize":928,"gzipSize":206,"inaccurateSizes":true}],"parsedSize":928,"gzipSize":206,"inaccurateSizes":true}],"parsedSize":32486,"gzipSize":7231,"inaccurateSizes":true}]}],"parsedSize":32490,"gzipSize":7232}]},{"label":"vendors.bundle.js","isAsset":true,"statSize":19,"parsedSize":1175,"gzipSize":529,"groups":[{"label":"src","path":"./src","statSize":19,"groups":[{"id":23,"label":"vendors.ts","path":"./src/vendors.ts","statSize":19,"parsedSize":15,"gzipSize":35}],"parsedSize":15,"gzipSize":35}]}]
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CartProduct, Product } from "@artisan-commerce/types";
|
|
2
2
|
import { ValidateProduct } from "../validateProduct/validateProduct.types";
|
|
3
|
-
import { ModifierTypes } from "../../types/modifiers.types";
|
|
3
|
+
import { ModifierTypes, RendererStatus } from "../../types/modifiers.types";
|
|
4
4
|
import { ModifierGroupRenderer } from "../../types/modifiers.types";
|
|
5
5
|
export interface ModifiersForm {
|
|
6
6
|
renderer: ModifierGroupRenderer[];
|
|
7
7
|
product: CartProduct;
|
|
8
8
|
validate: ValidateProduct;
|
|
9
|
+
status: RendererStatus;
|
|
9
10
|
}
|
|
10
11
|
export interface ModifiersFormInternal extends ModifiersForm {
|
|
11
12
|
callback: ModifiersFormCallback;
|
|
@@ -11,13 +11,15 @@ export interface ModifierGroupRenderer {
|
|
|
11
11
|
images: Image[];
|
|
12
12
|
data: CartProductQuestion;
|
|
13
13
|
type: GroupTypes;
|
|
14
|
-
|
|
14
|
+
errors: string[];
|
|
15
15
|
hidden: boolean;
|
|
16
16
|
required: boolean;
|
|
17
17
|
touched: boolean;
|
|
18
|
+
status: RendererStatus;
|
|
18
19
|
modifiers: ModifierRenderer[];
|
|
19
20
|
}
|
|
20
21
|
export declare type GroupTypes = RenderTypes;
|
|
22
|
+
export declare type RendererStatus = "IDLE" | "FAIL" | "OK" | "INCOMPLETE";
|
|
21
23
|
export interface ModifierRenderer {
|
|
22
24
|
id: string;
|
|
23
25
|
groupId: string;
|
|
@@ -29,10 +31,11 @@ export interface ModifierRenderer {
|
|
|
29
31
|
groups: ModifierGroupRenderer[];
|
|
30
32
|
data: CartProductAnswer;
|
|
31
33
|
type: ModifierTypes;
|
|
32
|
-
|
|
34
|
+
errors: string[];
|
|
33
35
|
hidden: boolean;
|
|
34
36
|
required: boolean;
|
|
35
37
|
touched: boolean;
|
|
38
|
+
status: RendererStatus;
|
|
36
39
|
handleChange: HandleChangeFunction;
|
|
37
40
|
totals: ModifierTotals;
|
|
38
41
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ProductQuestion } from "@artisan-commerce/types";
|
|
2
2
|
import { BuildModifierRendererConfig } from "../../lib/registerModifiersForm/registerModifiersForm.types";
|
|
3
|
+
import { RendererStatus } from "../../types/modifiers.types";
|
|
3
4
|
import { ModifierRenderer } from "../../types/modifiers.types";
|
|
4
|
-
import {
|
|
5
|
+
import { ModifierGroupRenderer } from "../../types/modifiers.types";
|
|
5
6
|
import { GetModifierTypeConfig } from "../../types/modifiers.types";
|
|
6
7
|
import { GroupTypes, ModifierTypes } from "../../types/modifiers.types";
|
|
7
8
|
export declare const getGroupType: (group: ProductQuestion) => GroupTypes;
|
|
8
9
|
export declare const getModifierType: (config: GetModifierTypeConfig) => ModifierTypes;
|
|
9
10
|
export declare const getModifierMin: (groupConfig: BuildModifierRendererConfig) => number;
|
|
10
11
|
export declare const getModifierMax: (groupConfig: BuildModifierRendererConfig) => number;
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const getModifierErrors: (modifier: ModifierRenderer, amount: number) => string[];
|
|
13
|
+
export declare const getGroupRendererStatus: (group: ModifierGroupRenderer) => RendererStatus;
|
|
14
|
+
export declare const getModifierRendererStatus: (modifier: ModifierRenderer) => RendererStatus;
|
|
15
|
+
export declare const mapGlobalRendererStatus: (renderer: ModifierGroupRenderer[]) => RendererStatus;
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
import { Product } from "@artisan-commerce/types";
|
|
1
|
+
import { CartProduct, Product } from "@artisan-commerce/types";
|
|
2
|
+
import { CartProductQuestion } from "@artisan-commerce/types";
|
|
3
|
+
import { CartProductAnswer } from "@artisan-commerce/types";
|
|
4
|
+
import { ModifierGroupRenderer, ModifierRenderer } from "../..";
|
|
2
5
|
import { ModifiersForm } from "../..";
|
|
3
6
|
export declare const createForm: (product: Product) => ModifiersForm;
|
|
7
|
+
export declare const buildProductFromRenderer: (renderer: ModifierGroupRenderer[], product: Product) => CartProduct;
|
|
8
|
+
/**
|
|
9
|
+
* Update answers with up to date data
|
|
10
|
+
* @param groups Group renderers with up to date data
|
|
11
|
+
*/
|
|
12
|
+
export declare const buildQuestionAndAnswersFromRenderer: (groups: ModifierGroupRenderer[]) => CartProductQuestion[];
|
|
13
|
+
/**
|
|
14
|
+
* Update questionsAndAnswers with up to date data
|
|
15
|
+
* @param modifiers Group renderers with up to date data
|
|
16
|
+
*/
|
|
17
|
+
export declare const buildAnswersFromRenderer: (modifiers: ModifierRenderer[]) => CartProductAnswer[];
|
|
@@ -6,6 +6,6 @@ import { BuildModifierGroupConfig } from "../../lib/registerModifiersForm/regist
|
|
|
6
6
|
import { FormCartProduct } from "../../types/modifiers.types";
|
|
7
7
|
import { FormCartProductQuestions } from "../../types/modifiers.types";
|
|
8
8
|
import { FormCartProductAnswer } from "../../types/modifiers.types";
|
|
9
|
-
export declare const buildRenderer: (product: FormCartProduct, config: BuildRendererConfig) => ModifierGroupRenderer[];
|
|
10
|
-
export declare const buildModifierGroupRenderer: (modifierGroup: FormCartProductQuestions, parentConfig: BuildModifierGroupConfig) => ModifierGroupRenderer;
|
|
11
|
-
export declare const buildModifierRenderer: (modifier: FormCartProductAnswer, config: BuildModifierRendererConfig) => ModifierRenderer;
|
|
9
|
+
export declare const buildRenderer: (product: FormCartProduct, config: BuildRendererConfig, previous?: ModifierGroupRenderer[] | undefined) => ModifierGroupRenderer[];
|
|
10
|
+
export declare const buildModifierGroupRenderer: (modifierGroup: FormCartProductQuestions, parentConfig: BuildModifierGroupConfig, previous?: ModifierGroupRenderer | undefined) => ModifierGroupRenderer;
|
|
11
|
+
export declare const buildModifierRenderer: (modifier: FormCartProductAnswer, config: BuildModifierRendererConfig, previous?: ModifierRenderer | undefined) => ModifierRenderer;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artisan-commerce/products",
|
|
3
3
|
"description": "Artisan's product management library",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.5",
|
|
5
5
|
"main": "./build/main.bundle.js",
|
|
6
6
|
"types": "./build/src/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"author": "Luis Eduardo Andrade",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@artisan-commerce/auth": "^0.8.
|
|
35
|
-
"@artisan-commerce/builders": "^0.4.
|
|
34
|
+
"@artisan-commerce/auth": "^0.8.12",
|
|
35
|
+
"@artisan-commerce/builders": "^0.4.9",
|
|
36
36
|
"@bugsnag/js": "^7.2.0",
|
|
37
37
|
"axios": "^0.19.2",
|
|
38
38
|
"i18next": "^19.6.2",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"sha1": "^1.1.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@artisan-commerce/types": "^0.10.
|
|
44
|
+
"@artisan-commerce/types": "^0.10.4",
|
|
45
45
|
"@babel/core": "^7.10.5",
|
|
46
46
|
"@babel/preset-env": "^7.10.4",
|
|
47
47
|
"@babel/preset-react": "^7.10.4",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"webpack-dev-server": "^3.11.0",
|
|
89
89
|
"webpack-merge": "^5.0.9"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "70179e3a9c68515cc1f04c468e9262e4f996a64d"
|
|
92
92
|
}
|