@artisan-commerce/analytics-rn 0.1.1-canary.5 → 0.1.1-canary.7

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [0.1.1-canary.7](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.1.1-canary.6...@artisan-commerce/analytics-rn@0.1.1-canary.7) (2021-04-14)
7
+
8
+ **Note:** Version bump only for package @artisan-commerce/analytics-rn
9
+
10
+
11
+
12
+
13
+
14
+ ### [0.1.1-canary.6](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.1.1-canary.5...@artisan-commerce/analytics-rn@0.1.1-canary.6) (2021-04-14)
15
+
16
+ **Note:** Version bump only for package @artisan-commerce/analytics-rn
17
+
18
+
19
+
20
+
21
+
6
22
  ### [0.1.1-canary.5](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.1.1-canary.4...@artisan-commerce/analytics-rn@0.1.1-canary.5) (2021-04-14)
7
23
 
8
24
  **Note:** Version bump only for package @artisan-commerce/analytics-rn
@@ -1,2 +1,8 @@
1
- export { initAnalytics } from "./lib/initAnalytics/initAnalytics";
1
+ import Providers from "./lib/providers/providers";
2
+ export * from "./lib/initAnalytics/initAnalytics";
2
3
  export * from "./lib/initAnalytics/initAnalytics.types";
4
+ export { Providers };
5
+ export * from "./lib/providers/FacebookPixel/FacebookPixel.types";
6
+ export * from "./lib/providers/GoogleAnalytics/GoogleAnalytics.types";
7
+ export { default as events } from "./lib/events/events";
8
+ export * from "./types/common.types";
@@ -1 +1,59 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-native")):"function"==typeof define&&define.amd?define("analytics-rn",["react-native"],t):"object"==typeof exports?exports["analytics-rn"]=t(require("react-native")):e["analytics-rn"]=t(e["react-native"])}(this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){n.r(t),n.d(t,"initState",(function(){return o})),n.d(t,"getState",(function(){return s})),n.d(t,"setState",(function(){return a}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i={},o=function(e){Object.freeze(e),i=r({},e),Object.seal(i)},a=function(e){i=r(r({},i),e)},s=function(){return r({},i)}}])},function(t,n){t.exports=e},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.setState=t.getState=t.setInitialState=void 0;var i=n(1),o=n(0),a=n(0),s=n(0),c=r(n(3)),l={providers:[],activeVendor:void 0,vendors:[],debug:!1,meta:{accountId:void 0,vendorId:void 0,vendorName:void 0,storeId:void 0,storeName:void 0,catalogueId:void 0,catalogueName:void 0,appName:void 0,platform:i.Platform.OS,versionApp:void 0,versionSDK:c.default.version}};t.setInitialState=function(){o.initState(l)};t.getState=function(){return a.getState()};t.setState=function(e){return s.setState(e)}},function(e){e.exports=JSON.parse('{"name":"@artisan-commerce/analytics-rn","description":"Artisan commerce analytics react native library","version":"0.1.1-canary.5","main":"./build/main.bundle.js","types":"./build/index.d.ts","files":["build/","LICENSE","README.md"],"scripts":{"start":"webpack --config webpack.dev.js","dev":"webpack --watch --config webpack.dev.js","build":"webpack --config webpack.prod.js","start:build":"nodemon ./build/main.bundle.js","test":"jest --watchAll --runInBand --passWithNoTests","test:all":"yarn test -- --watchAll=false --coverage","test:ci":"cross-env CI=true jest --runInBand --passWithNoTests","test:staged":"yarn test:ci --findRelatedTests ./src","check-types":"tsc --noEmit","lint":"eslint --ignore-path .gitignore --ignore-pattern !cypress/.eslintrc.js --ext .js,jsx,.ts,.tsx .","lint:staged":"yarn lint --max-warnings=0","prettier":"prettier --ignore-path .gitignore \\"**/*.+(js|jsx|ts|tsx|json|css|scss|html)\\"","format":"yarn prettier -- --write","check-format":"yarn prettier -- --list-different","validate":"cross-env CI=true npm-run-all --parallel test:ci check-types check-format lint build","validate:ci":"npm-run-all --parallel check-types check-format lint","prepare":"yarn build"},"author":"Luis Eduardo Andrade","license":"MIT","devDependencies":{"@artisan-commerce/types":"0.13.0-canary.4","@babel/core":"^7.13.15","@babel/preset-env":"^7.10.4","@babel/preset-react":"^7.10.4","@react-native-firebase/analytics":"^11.2.0","@react-native-firebase/app":"^11.2.0","@types/faker":"^4.1.12","@types/jest":"^26.0.5","@types/jest-in-case":"^1.0.2","@types/node":"^14.0.24","@types/react-native":"0.63.2","@typescript-eslint/eslint-plugin":"^4.15.2","@typescript-eslint/parser":"^4.15.2","avn":"^0.2.4","avn-nvm":"^0.2.2","babel-preset-expo":"^8.3.0","clean-webpack-plugin":"^3.0.0","cross-env":"^7.0.2","dotenv-webpack":"^2.0.0","env-cmd":"^10.1.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-config-react-app":"^5.2.1","eslint-config-universe":"^4.0.0","eslint-plugin-cypress":"^2.11.1","eslint-plugin-flowtype":"^5.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.3","eslint-plugin-react-hooks":"^4.0.8","is-ci-cli":"^2.1.2","jest-axe":"^3.5.0","jest-expo":"^40.0.2","jest-in-case":"^1.0.2","jest-styled-components":"^7.0.2","nodemon":"^2.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","react":"16.13.1","react-native":"0.63.2","react-native-fbsdk":"^3.0.0","start-server-and-test":"^1.11.2","test-data-bot":"^0.8.0","ts-jest":"^26.1.4","ts-loader":"^8.0.2","webpack":"^4.43.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0","webpack-merge":"^5.0.9","webpack-node-externals":"^2.5.2"},"peerDependencies":{"@react-native-firebase/app":"*","react":">= 16.8.6","react-native-fbsdk":"*"},"gitHead":"e8060b103c27e4ced72b4c04259f55b09c28adfa"}')},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.initAnalytics=void 0;var o=n(5);Object.defineProperty(t,"initAnalytics",{enumerable:!0,get:function(){return o.initAnalytics}}),i(n(8),t)},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.initAnalytics=void 0;var a=n(1),s=n(2),c=n(6),l=o(n(3)),u=n(7),d=!1;t.initAnalytics=function(e){if(d)c.logMessage("initAnalytics has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initAnalytics is only called once.","warn");else{d=!0;var t=e.providers;if(!t.length)return c.logMessage("At least one provider should be included but none were found","severe");if(!u.checkUniqueProvider(t))return c.logMessage("Providers must be unique, check that no provider are repeated","severe");var n=e.meta,o=i(e,["meta"]),f=r(r({},o),{providers:t,meta:r(r({},n),{vendorId:o.activeVendor,platform:a.Platform.OS,versionSDK:l.default.version})});s.setState(f),t.forEach((function(e){e.init()}))}}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.logProviderConfigUpdated=t.logProvidersSDKNotLoaded=t.eventSent=t.vendorNotIncluded=t.noActiveVendor=t.logMessage=void 0;var o=n(2);t.logMessage=function(e,t){var n=o.getState().debug,r="artisan-commerce/analytics";if("debug"!==t||n)switch(t){case"debug":console.log("%c(Debug) %c"+r+":\n"+e,"font-weight: bold","font-weight: normal");break;case"log":console.log("%c(Log) %c"+r+":\n"+e,"font-weight: bold","font-weight: normal");break;case"warn":console.warn("%c(Warning) %c"+r+":\n"+e,"font-weight: bold","font-weight: normal");break;case"error":console.error("%c(Error) %c"+r+":\n"+e,"font-weight: bold","font-weight: normal");break;case"severe":throw new Error(r+": \n"+e);default:throw new Error("Log message "+e+" of type "+t+" is not a supported type.")}};t.noActiveVendor=function(){t.logMessage("No active vendor is set. Please make sure you configure an active vendor before trying to emit an event","warn")};t.vendorNotIncluded=function(e,n){var r=o.getState().activeVendor;t.logMessage("Skipping vendor "+r+" for event "+e+" of provider "+n.name+" as configured","debug")};t.eventSent=function(e,n){var o=n.reduce((function(e,t){var n,o,a=t.name,s=t.type,c=null!==(o=e[s])&&void 0!==o?o:[];return r(r({},e),((n={})[s]=i(i([],c),[a]),n))}),{}),a=Object.entries(o).reduce((function(e,t){var n=t[0],r=t[1];return""+e+(n.charAt(0).toUpperCase()+n.slice(1))+": "+r.join(", ")+"\n"}),"");t.logMessage("Event "+e+" was successfully sent to the following providers "+a,"debug")};t.logProvidersSDKNotLoaded=function(e){t.logMessage(e+" SDK not initialized. Please make sure the SDK is initialized before trying to emit an event","severe")};t.logProviderConfigUpdated=function(e,n){var r=Object.entries(n).reduce((function(e,t,n){var r=t[0],i=t[1];return 0===n?r+": "+i:e+"\n"+r+": "+i}),"");t.logMessage(e.name+" config updated for the following fields.\n "+r,"debug")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkUniqueProvider=void 0;t.checkUniqueProvider=function(e){var t=e.map((function(e){return e.type}));return new Set(t).size===t.length}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})}])}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-native"),require("@react-native-firebase/analytics")):"function"==typeof define&&define.amd?define("analytics-rn",["react-native","@react-native-firebase/analytics"],e):"object"==typeof exports?exports["analytics-rn"]=e(require("react-native"),require("@react-native-firebase/analytics")):t["analytics-rn"]=e(t["react-native"],t["@react-native-firebase/analytics"])}(this,(function(t,e){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=13)}([function(e,r){e.exports=t},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.setState=e.getState=e.setInitialState=void 0;var o=r(0),i=r(9),u=r(9),a=r(9),s=n(r(11)),c={providers:[],activeVendor:void 0,vendors:[],debug:!1,meta:{accountId:void 0,vendorId:void 0,vendorName:void 0,storeId:void 0,storeName:void 0,catalogueId:void 0,catalogueName:void 0,appName:void 0,platform:o.Platform.OS,versionApp:void 0,versionSDK:s.default.version}};e.setInitialState=function(){i.initState(c)};e.getState=function(){return u.getState()};e.setState=function(t){return a.setState(t)}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.eventParamsToSnakeCase=void 0;var o=r(66);e.eventParamsToSnakeCase=function(t){return Object.entries(t).reduce((function(t,e){var r,i=e[0],u=e[1],a=o.snakeCase(i);return n(n({},t),((r={})[a]=u,r))}),{})}},function(t,e,r){"use strict";t.exports=r(40)},function(t,r){t.exports=e},function(t,e,r){"use strict";t.exports={get ShareOpenGraphAction(){return r(27)},get ShareOpenGraphObject(){return r(28)},get ShareOpenGraphValueContainer(){return r(10)},get AccessToken(){return r(29)},get AppEventsLogger(){return r(30)},get AppLink(){return r(31)},get GameRequestDialog(){return r(32)},get GraphRequest(){return r(33)},get GraphRequestManager(){return r(34)},get LoginManager(){return r(35)},get MessageDialog(){return r(36)},get Settings(){return r(37)},get ShareDialog(){return r(38)},get LoginButton(){return r(39)},get SendButton(){return r(42)},get ShareButton(){return r(43)}}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.mapProductToGoogleItem=e.mapProductsToGoogleItems=e.getProductContent=e.getProductContentFromShoppingCart=e.getProductIdsFromShoppingCart=e.triageEventToProviders=void 0;var i=r(44),u=r(45),a=r(7),s=r(1),c=r(46);e.triageEventToProviders=function(t,e,r){var i=r.facebookPixelHandler,u=r.googleAnalyticsHandler,f=s.getState().providers,l=n(n({},e),{artisanEvent:t}),h=f.reduce((function(e,r){if(c.skipVendor(t,r))return e;switch(r.type){case"FACEBOOK_PIXEL":i(r,l);break;case"GOOGLE_ANALYTICS":u(r,l);break;default:throw new Error("Provider of type "+r.type+" is not supported")}return o(o([],e),[r])}),[]);a.eventSent(t,h)};e.getProductIdsFromShoppingCart=function(t){return i.getShoppingCartProducts(t).map((function(t){return t.productId}))};e.getProductContentFromShoppingCart=function(t){return i.getShoppingCartProducts(t).map((function(t){return e.getProductContent(t)}))};e.getProductContent=function(t){var e=u.getProductTotals(t);return t.name+":"+e.netPrice};e.mapProductsToGoogleItems=function(t,r){return i.getShoppingCartProducts(t).map((function(t){return e.mapProductToGoogleItem(t,r)}))};e.mapProductToGoogleItem=function(t,e){var r=u.getProductTotals(t);return{item_id:t.productId,item_name:t.name,quantity:t.amount,price:r.netPrice,currency:e}}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.logProviderConfigUpdated=e.logProvidersSDKNotLoaded=e.eventSent=e.vendorNotIncluded=e.noActiveVendor=e.logMessage=void 0;var i=r(1);e.logMessage=function(t,e){var r=i.getState().debug,n="artisan-commerce/analytics";if("debug"!==e||r)switch(e){case"debug":console.log("%c(Debug) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"log":console.log("%c(Log) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"warn":console.warn("%c(Warning) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"error":console.error("%c(Error) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"severe":throw new Error(n+": \n"+t);default:throw new Error("Log message "+t+" of type "+e+" is not a supported type.")}};e.noActiveVendor=function(){e.logMessage("No active vendor is set. Please make sure you configure an active vendor before trying to emit an event","warn")};e.vendorNotIncluded=function(t,r){var n=i.getState().activeVendor;e.logMessage("Skipping vendor "+n+" for event "+t+" of provider "+r.name+" as configured","debug")};e.eventSent=function(t,r){var i=r.reduce((function(t,e){var r,i,u=e.name,a=e.type,s=null!==(i=t[a])&&void 0!==i?i:[];return n(n({},t),((r={})[a]=o(o([],s),[u]),r))}),{}),u=Object.entries(i).reduce((function(t,e){var r=e[0],n=e[1];return""+t+(r.charAt(0).toUpperCase()+r.slice(1))+": "+n.join(", ")+"\n"}),"");e.logMessage("Event "+t+" was successfully sent to the following providers "+u,"debug")};e.logProvidersSDKNotLoaded=function(t){e.logMessage(t+" SDK not initialized. Please make sure the SDK is initialized before trying to emit an event","severe")};e.logProviderConfigUpdated=function(t,r){var n=Object.entries(r).reduce((function(t,e,r){var n=e[0],o=e[1];return 0===r?n+": "+o:t+"\n"+n+": "+o}),"");e.logMessage(t.name+" config updated for the following fields.\n "+n,"debug")}},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,r){"use strict";t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return a})),r.d(e,"setState",(function(){return u}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},u=function(t){o=n(n({},o),t)},a=function(){return n({},o)}}])},function(t,e,r){"use strict";t.exports=class{constructor(t){var e,r,n;n=void 0,(r="_properties")in(e=this)?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,this._properties=t||{}}putNumber(t,e){this._properties[t]={type:"number",value:e}}putObject(t,e){this._properties[t]={type:"open-graph-object",value:e}}putPhoto(t,e){this._properties[t]={type:"photo",value:e}}putString(t,e){this._properties[t]={type:"string",value:e}}getEntry(t){return this._properties[t]}}},function(t){t.exports=JSON.parse('{"name":"@artisan-commerce/analytics-rn","description":"Artisan commerce analytics react native library","version":"0.1.1-canary.7","main":"./build/main.bundle.js","types":"./build/analytics-rn/src/index.d.ts","files":["build/","LICENSE","README.md"],"scripts":{"start":"webpack --config webpack.dev.js","dev":"webpack --watch --config webpack.dev.js","build":"webpack --config webpack.prod.js","start:build":"nodemon ./build/main.bundle.js","test":"jest --watchAll --runInBand --passWithNoTests","test:all":"yarn test -- --watchAll=false --coverage","test:ci":"cross-env CI=true jest --runInBand --passWithNoTests","test:staged":"yarn test:ci --findRelatedTests ./src","check-types":"tsc --noEmit","lint":"eslint --ignore-path .gitignore --ignore-pattern !cypress/.eslintrc.js --ext .js,jsx,.ts,.tsx .","lint:staged":"yarn lint --max-warnings=0","prettier":"prettier --ignore-path .gitignore \\"**/*.+(js|jsx|ts|tsx|json|css|scss|html)\\"","format":"yarn prettier -- --write","check-format":"yarn prettier -- --list-different","validate":"cross-env CI=true npm-run-all --parallel test:ci check-types check-format lint build","validate:ci":"npm-run-all --parallel check-types check-format lint","prepare":"yarn build"},"author":"Luis Eduardo Andrade","license":"MIT","devDependencies":{"@artisan-commerce/types":"0.13.0-canary.4","@babel/core":"^7.13.15","@babel/preset-env":"^7.10.4","@babel/preset-react":"^7.10.4","@react-native-firebase/analytics":"^11.2.0","@react-native-firebase/app":"^11.2.0","@types/faker":"^4.1.12","@types/jest":"^26.0.5","@types/jest-in-case":"^1.0.2","@types/node":"^14.0.24","@types/react-native":"0.63.2","@typescript-eslint/eslint-plugin":"^4.15.2","@typescript-eslint/parser":"^4.15.2","avn":"^0.2.4","avn-nvm":"^0.2.2","babel-preset-expo":"^8.3.0","clean-webpack-plugin":"^3.0.0","cross-env":"^7.0.2","dotenv-webpack":"^2.0.0","env-cmd":"^10.1.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-config-react-app":"^5.2.1","eslint-config-universe":"^4.0.0","eslint-plugin-cypress":"^2.11.1","eslint-plugin-flowtype":"^5.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.3","eslint-plugin-react-hooks":"^4.0.8","is-ci-cli":"^2.1.2","jest-axe":"^3.5.0","jest-expo":"^40.0.2","jest-in-case":"^1.0.2","jest-styled-components":"^7.0.2","nodemon":"^2.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","react":"16.13.1","react-native":"0.63.2","react-native-fbsdk":"^3.0.0","start-server-and-test":"^1.11.2","test-data-bot":"^0.8.0","ts-jest":"^26.1.4","ts-loader":"^8.0.2","webpack":"^4.43.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0","webpack-merge":"^5.0.9","webpack-node-externals":"^2.5.2"},"peerDependencies":{"@react-native-firebase/app":"*","react":">= 16.8.6","react-native-fbsdk":"*"},"gitHead":"5b35addec6ba05bd2c9d1c0900fc650fd07e1900"}')},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(7),o=r(1),i=function(){function t(t){var e=t.type,r=t.name,n=t.vendors;this.type=e,this.name=r,this._vendors=n}return Object.defineProperty(t.prototype,"vendors",{get:function(){var t,e=o.getState().vendors;return null!==(t=this._vendors)&&void 0!==t?t:e},enumerable:!1,configurable:!0}),t.prototype.updateConfig=function(t){n.logProviderConfigUpdated(this,t)},t}();e.default=i},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.events=e.Providers=void 0;var u=r(1),a=i(r(14));e.Providers=a.default,o(r(17),e),o(r(19),e),o(r(20),e),o(r(21),e);var s=r(22);Object.defineProperty(e,"events",{enumerable:!0,get:function(){return i(s).default}}),o(r(65),e),u.setInitialState()},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(15)),i=n(r(16)),u={FacebookPixel:o.default,GoogleAnalytics:i.default};e.default=u},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var r=this,n=e.version,o=e.currency;return(r=t.call(this,i(i({},e),{type:"FACEBOOK_PIXEL"}))||this)._version=null!=n?n:"10.0",r._currency=null!=o?o:"USD",r}return o(e,t),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.currency;r.includes("currency")&&(this._currency=n),t.prototype.updateConfig.call(this,e)},e}(u(r(12)).default);e.default=a},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var r=t.call(this,i(i({},e),{type:"GOOGLE_ANALYTICS"}))||this,n=e.userId,o=e.currency,u=e.language,a=e.sampleRate;return r._sampleRate=a,r._userId=n,r._language=u,r._currency=null!=o?o:"USD",r}return o(e,t),Object.defineProperty(e.prototype,"sampleRate",{get:function(){return this._sampleRate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.userId,o=e.currency,i=e.language;r.includes("userId")&&(this._userId=n),r.includes("currency")&&(this._currency=o),r.includes("language")&&(this._language=i),t.prototype.updateConfig.call(this,e)},e}(u(r(12)).default);e.default=a},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.initAnalytics=void 0;var u=r(0),a=r(1),s=r(7),c=i(r(11)),f=r(18),l=!1;e.initAnalytics=function(t){if(l)s.logMessage("initAnalytics has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initAnalytics is only called once.","warn");else{l=!0;var e=t.providers;if(!e.length)return s.logMessage("At least one provider should be included but none were found","severe");if(!f.checkUniqueProvider(e))return s.logMessage("Providers must be unique, check that no provider are repeated","severe");var r=t.meta,i=o(t,["meta"]),h=n(n({},i),{providers:e,meta:n(n({},r),{vendorId:i.activeVendor,platform:u.Platform.OS,versionSDK:c.default.version})});a.setState(h),e.forEach((function(t){t.init()}))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkUniqueProvider=void 0;e.checkUniqueProvider=function(t){var e=t.map((function(t){return t.type}));return new Set(e).size===e.length}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o={auth:n(r(23)).default};e.default=o},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(24)),i=n(r(47)),u=n(r(50)),a=n(r(53)),s=n(r(56)),c=n(r(59)),f=n(r(62)),l={logChangePasswordAttempt:o.default,logSignUpAttempt:i.default,logChangePasswordFail:u.default,logChangePasswordSuccess:a.default,logSignIn:s.default,logSignOut:c.default,logSignUp:f.default};e.default=l},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(25)),i=n(r(26)),u=r(6);e.default=function(t){u.triageEventToProviders("changePasswordAttempt",t,{googleAnalyticsHandler:o.default,facebookPixelHandler:i.default})}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(r(4)),a=r(2),s=r(1);e.default=function(t,e){var r=t.userId,i=(e.callback,e.userId),c=o(e,["callback","userId"]),f=null!=i?i:r,l=n(n({},c),{userId:f}),h=a.eventParamsToSnakeCase(l),p=s.getState().meta,d=a.eventParamsToSnakeCase(p);u.default().logEvent("change_password_attempt",n(n({},h),d))}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),u=r(2),a=r(1);e.default=function(t,e){var r=o(e,[]);delete r.userId;var s=n({},r),c=u.eventParamsToSnakeCase(s),f=a.getState().meta,l=u.eventParamsToSnakeCase(f);i.AppEventsLogger.logEvent("ChangePasswordAttempt",n(n({},c),l))}},function(t,e,r){"use strict";const n=r(10);t.exports=class extends n{constructor(t){var e,r,n;super(null),n=void 0,(r="actionType")in(e=this)?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,this.actionType=t}}},function(t,e,r){"use strict";const n=r(10);t.exports=class extends n{}},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const o=r(0).NativeModules.FBAccessToken,i=new(0,r(0).NativeEventEmitter)(o);class u{constructor(t){n(this,"accessToken",void 0),n(this,"permissions",void 0),n(this,"declinedPermissions",void 0),n(this,"expiredPermissions",void 0),n(this,"applicationID",void 0),n(this,"userID",void 0),n(this,"expirationTime",void 0),n(this,"lastRefreshTime",void 0),n(this,"dataAccessExpirationTime",void 0),n(this,"accessTokenSource",void 0),this.accessToken=t.accessToken,this.permissions=t.permissions,this.declinedPermissions=t.declinedPermissions,this.expiredPermissions=t.expiredPermissions,this.applicationID=t.applicationID,this.userID=t.userID,this.expirationTime=t.expirationTime,this.lastRefreshTime=t.lastRefreshTime,this.dataAccessExpirationTime=t.dataAccessExpirationTime,this.accessTokenSource=t.accessTokenSource,Object.freeze(this)}static getCurrentAccessToken(){return new Promise((t,e)=>{o.getCurrentAccessToken(e=>{t(e?new u(e):null)})})}static setCurrentAccessToken(t){o.setCurrentAccessToken(t)}static refreshCurrentAccessTokenAsync(){return o.refreshCurrentAccessTokenAsync()}static addListener(t){const e=i.addListener("fbsdk.accessTokenDidChange",e=>{t(e?new u(e):null)});return()=>e.remove()}getExpires(){return this.expirationTime}getPermissions(){return this.permissions}getDeclinedPermissions(){return this.declinedPermissions}getExpiredPermissions(){return this.expiredPermissions}getLastRefresh(){return this.lastRefreshTime}getDataAccessExpiration(){return this.dataAccessExpirationTime}getApplicationId(){return this.applicationID}getUserId(){return this.userID}}t.exports=u},function(t,e,r){"use strict";const n=r(0).NativeModules.FBAppEventsLogger,{Platform:o}=r(0);t.exports={setFlushBehavior(t){n.setFlushBehavior(t)},logEvent(t,...e){let r=0;"number"==typeof e[0]&&(r=e.shift());let o=null;"object"==typeof e[0]&&(o=e[0]),n.logEvent(t,r,o)},logPurchase(t,e,r){n.logPurchase(t,e,r)},logPushNotificationOpen(t){n.logPushNotificationOpen(t)},flush(){n.flush()},setUserID(t){n.setUserID(t)},getUserID:async()=>await n.getUserID(),getAnonymousID:async()=>await n.getAnonymousID(),getAdvertiserID:async()=>await n.getAdvertiserID(),getAttributionID:async()=>"ios"===o.OS?null:await n.getAttributionID(),updateUserProperties(t){n.updateUserProperties(t)},setUserData(t){n.setUserData(t)},setPushNotificationsDeviceToken(t){n.setPushNotificationsDeviceToken(t)},setPushNotificationsRegistrationId(t){n.setPushNotificationsRegistrationId(t)}}},function(t,e,r){"use strict";const n=r(0).NativeModules.FBAppLink;t.exports={fetchDeferredAppLink:()=>n.fetchDeferredAppLink()}},function(t,e,r){"use strict";const n=r(0).NativeModules.FBGameRequestDialog;t.exports={canShow:()=>n.canShow(),show:t=>n.show(t)}},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}t.exports=class{constructor(t,e,r){n(this,"graphPath",void 0),n(this,"config",void 0),n(this,"callback",void 0),this.graphPath=t,this.config=e||{},this.callback=r||(()=>{})}addStringParameter(t,e){null!=this.config&&null!=this.config.parameters&&(this.config.parameters[e]={string:t})}}},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const o=r(0).NativeModules.FBGraphRequest;t.exports=class{constructor(){n(this,"requestBatch",void 0),n(this,"requestCallbacks",void 0),n(this,"batchCallback",void 0),this.requestBatch=[],this.requestCallbacks=[]}addRequest(t){return function(t){if(t.config&&t.config.parameters)for(var e in t.config.parameters){var r=t.config.parameters[e];if("object"!=typeof r||!r.string)throw new Error("Unexpected value for parameter '"+e+"'. Request parameters need to be objects with a 'string' field.")}}(t),this.requestBatch.push(t),this.requestCallbacks.push(t.callback),this}addBatchCallback(t){return this.batchCallback=t,this}start(t){const e=this;o.start(this.requestBatch,t||0,(t,r,n)=>{n&&e.requestCallbacks.forEach((t,e,r)=>{t&&t(n[e][0],n[e][1])}),e.batchCallback&&e.batchCallback(t,r)})}}},function(t,e,r){"use strict";const{NativeModules:n,Platform:o}=r(0),i=n.FBLoginManager;t.exports={logInWithPermissions:t=>i.logInWithPermissions(t),getLoginBehavior:()=>"ios"===o.OS?Promise.resolve("browser"):i.getLoginBehavior(),setLoginBehavior(t){"ios"!==o.OS&&i.setLoginBehavior(t)},getDefaultAudience:()=>i.getDefaultAudience(),setDefaultAudience(t){i.setDefaultAudience(t)},logOut(){i.logOut()}}},function(t,e,r){"use strict";const n=r(0).NativeModules.FBMessageDialog;t.exports={canShow:t=>n.canShow(t),show:t=>n.show(t),setShouldFailOnDataError(t){n.setShouldFailOnDataError(t)}}},function(t,e,r){"use strict";r.r(e),function(t){var e=r(0);const n=r(0).NativeModules.FBSettings;t.exports={getAdvertiserTrackingEnabled:()=>"ios"===e.Platform.OS?n.getAdvertiserTrackingEnabled():Promise.resolve(!0),setAdvertiserTrackingEnabled:t=>"ios"===e.Platform.OS?n.setAdvertiserTrackingEnabled(t):Promise.resolve(!1),setDataProcessingOptions(t,...e){let r=0;"number"==typeof e[0]&&(r=e[0]);let o=0;"number"==typeof e[1]&&(o=e[1]),n.setDataProcessingOptions(t,r,o)}}}.call(this,r(8)(t))},function(t,e,r){"use strict";const n=r(0).NativeModules.FBShareDialog;t.exports={canShow:t=>n.canShow(t),show:t=>n.show(t),setMode(t){n.setMode(t)},setShouldFailOnDataError(t){n.setShouldFailOnDataError(t)}}},function(t,e,r){"use strict";r.r(e),function(t){var e,n,o,i=r(3),u=r(0);function a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}class s extends i.Component{_eventHandler(t){const e=t.nativeEvent;"loginFinished"===e.type?this.props.onLoginFinished&&this.props.onLoginFinished(e.error,e.result):"logoutFinished"===e.type&&this.props.onLogoutFinished&&this.props.onLogoutFinished()}render(){return i.createElement(f,a({},this.props,{onChange:this._eventHandler.bind(this)}))}}o=void 0,(n="defaultProps")in(e=s)?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o;const c=u.StyleSheet.create({defaultButtonStyle:{height:30,width:190}});s.defaultProps={style:c.defaultButtonStyle};const f=Object(u.requireNativeComponent)("RCTFBLoginButton");t.exports=s}.call(this,r(8)(t))},function(t,e,r){"use strict";
2
+ /** @license React v16.13.1
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var n=r(41),o="function"==typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,u=o?Symbol.for("react.portal"):60106,a=o?Symbol.for("react.fragment"):60107,s=o?Symbol.for("react.strict_mode"):60108,c=o?Symbol.for("react.profiler"):60114,f=o?Symbol.for("react.provider"):60109,l=o?Symbol.for("react.context"):60110,h=o?Symbol.for("react.forward_ref"):60112,p=o?Symbol.for("react.suspense"):60113,d=o?Symbol.for("react.memo"):60115,y=o?Symbol.for("react.lazy"):60116,v="function"==typeof Symbol&&Symbol.iterator;function g(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w={};function m(t,e,r){this.props=t,this.context=e,this.refs=w,this.updater=r||b}function O(){}function P(t,e,r){this.props=t,this.context=e,this.refs=w,this.updater=r||b}m.prototype.isReactComponent={},m.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error(g(85));this.updater.enqueueSetState(this,t,e,"setState")},m.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},O.prototype=m.prototype;var A=P.prototype=new O;A.constructor=P,n(A,m.prototype),A.isPureReactComponent=!0;var _={current:null},S=Object.prototype.hasOwnProperty,E={key:!0,ref:!0,__self:!0,__source:!0};function T(t,e,r){var n,o={},u=null,a=null;if(null!=e)for(n in void 0!==e.ref&&(a=e.ref),void 0!==e.key&&(u=""+e.key),e)S.call(e,n)&&!E.hasOwnProperty(n)&&(o[n]=e[n]);var s=arguments.length-2;if(1===s)o.children=r;else if(1<s){for(var c=Array(s),f=0;f<s;f++)c[f]=arguments[f+2];o.children=c}if(t&&t.defaultProps)for(n in s=t.defaultProps)void 0===o[n]&&(o[n]=s[n]);return{$$typeof:i,type:t,key:u,ref:a,props:o,_owner:_.current}}function I(t){return"object"==typeof t&&null!==t&&t.$$typeof===i}var j=/\/+/g,x=[];function R(t,e,r,n){if(x.length){var o=x.pop();return o.result=t,o.keyPrefix=e,o.func=r,o.context=n,o.count=0,o}return{result:t,keyPrefix:e,func:r,context:n,count:0}}function C(t){t.result=null,t.keyPrefix=null,t.func=null,t.context=null,t.count=0,10>x.length&&x.push(t)}function B(t,e,r){return null==t?0:function t(e,r,n,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var s=!1;if(null===e)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case i:case u:s=!0}}if(s)return n(o,e,""===r?"."+M(e,0):r),1;if(s=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var f=r+M(a=e[c],c);s+=t(a,f,n,o)}else if(null===e||"object"!=typeof e?f=null:f="function"==typeof(f=v&&e[v]||e["@@iterator"])?f:null,"function"==typeof f)for(e=f.call(e),c=0;!(a=e.next()).done;)s+=t(a=a.value,f=r+M(a,c++),n,o);else if("object"===a)throw n=""+e,Error(g(31,"[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return s}(t,"",e,r)}function M(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,(function(t){return e[t]}))}(t.key):e.toString(36)}function k(t,e){t.func.call(t.context,e,t.count++)}function D(t,e,r){var n=t.result,o=t.keyPrefix;t=t.func.call(t.context,e,t.count++),Array.isArray(t)?U(t,n,r,(function(t){return t})):null!=t&&(I(t)&&(t=function(t,e){return{$$typeof:i,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(t,o+(!t.key||e&&e.key===t.key?"":(""+t.key).replace(j,"$&/")+"/")+r)),n.push(t))}function U(t,e,r,n,o){var i="";null!=r&&(i=(""+r).replace(j,"$&/")+"/"),B(t,D,e=R(e,i,n,o)),C(e)}var Y={current:null};function L(){var t=Y.current;if(null===t)throw Error(g(321));return t}var N={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:_,IsSomeRendererActing:{current:!1},assign:n};e.Children={map:function(t,e,r){if(null==t)return t;var n=[];return U(t,n,null,e,r),n},forEach:function(t,e,r){if(null==t)return t;B(t,k,e=R(null,null,e,r)),C(e)},count:function(t){return B(t,(function(){return null}),null)},toArray:function(t){var e=[];return U(t,e,null,(function(t){return t})),e},only:function(t){if(!I(t))throw Error(g(143));return t}},e.Component=m,e.Fragment=a,e.Profiler=c,e.PureComponent=P,e.StrictMode=s,e.Suspense=p,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,e.cloneElement=function(t,e,r){if(null==t)throw Error(g(267,t));var o=n({},t.props),u=t.key,a=t.ref,s=t._owner;if(null!=e){if(void 0!==e.ref&&(a=e.ref,s=_.current),void 0!==e.key&&(u=""+e.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(f in e)S.call(e,f)&&!E.hasOwnProperty(f)&&(o[f]=void 0===e[f]&&void 0!==c?c[f]:e[f])}var f=arguments.length-2;if(1===f)o.children=r;else if(1<f){c=Array(f);for(var l=0;l<f;l++)c[l]=arguments[l+2];o.children=c}return{$$typeof:i,type:t.type,key:u,ref:a,props:o,_owner:s}},e.createContext=function(t,e){return void 0===e&&(e=null),(t={$$typeof:l,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:f,_context:t},t.Consumer=t},e.createElement=T,e.createFactory=function(t){var e=T.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:h,render:t}},e.isValidElement=I,e.lazy=function(t){return{$$typeof:y,_ctor:t,_status:-1,_result:null}},e.memo=function(t,e){return{$$typeof:d,type:t,compare:void 0===e?null:e}},e.useCallback=function(t,e){return L().useCallback(t,e)},e.useContext=function(t,e){return L().useContext(t,e)},e.useDebugValue=function(){},e.useEffect=function(t,e){return L().useEffect(t,e)},e.useImperativeHandle=function(t,e,r){return L().useImperativeHandle(t,e,r)},e.useLayoutEffect=function(t,e){return L().useLayoutEffect(t,e)},e.useMemo=function(t,e){return L().useMemo(t,e)},e.useReducer=function(t,e,r){return L().useReducer(t,e,r)},e.useRef=function(t){return L().useRef(t)},e.useState=function(t){return L().useState(t)},e.version="16.13.1"},function(t,e,r){"use strict";
10
+ /*
11
+ object-assign
12
+ (c) Sindre Sorhus
13
+ @license MIT
14
+ */var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function u(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,a,s=u(t),c=1;c<arguments.length;c++){for(var f in r=Object(arguments[c]))o.call(r,f)&&(s[f]=r[f]);if(n){a=n(r);for(var l=0;l<a.length;l++)i.call(r,a[l])&&(s[a[l]]=r[a[l]])}}return s}},function(t,e,r){"use strict";r.r(e),function(t){var e,n,o,i=r(3),u=r(0);class a extends i.Component{render(){return i.createElement(c,this.props)}}o=void 0,(n="defaultProps")in(e=a)?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o;const s=u.StyleSheet.create({defaultButtonStyle:{height:30,width:80}});a.defaultProps={style:s.defaultButtonStyle};const c=Object(u.requireNativeComponent)("RCTFBSendButton");t.exports=a}.call(this,r(8)(t))},function(t,e,r){"use strict";r.r(e),function(t){var e,n,o,i=r(3),u=r(0);class a extends i.Component{render(){return i.createElement(c,this.props)}}o=void 0,(n="defaultProps")in(e=a)?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o;const s=u.StyleSheet.create({defaultButtonStyle:{height:30,width:80}});a.defaultProps={style:s.defaultButtonStyle};const c=Object(u.requireNativeComponent)("RCTFBShareButton");t.exports=a}.call(this,r(8)(t))},function(t,e,r){"use strict";t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=32)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=32)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return a})),r.d(e,"setState",(function(){return u}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},u=function(t){o=n(n({},o),t)},a=function(){return n({},o)}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return a})),r.d(e,"setState",(function(){return u}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},u=function(t){o=n(n({},o),t)},a=function(){return n({},o)}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,u;n=r(8),o=r(1).utf8,i=r(1).bin,(u=function(t,r){var u=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,u=[],a=1732584193,s=-271733879,c=-1732584194,f=271733878,l=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var h=0;h<r.length;h+=16){for(var p=a,d=s,y=c,v=f,g=l,b=0;b<80;b++){if(b<16)u[b]=r[h+b];else{var w=u[b-3]^u[b-8]^u[b-14]^u[b-16];u[b]=w<<1|w>>>31}var m=(a<<5|a>>>27)+l+(u[b]>>>0)+(b<20?1518500249+(s&c|~s&f):b<40?1859775393+(s^c^f):b<60?(s&c|s&f|c&f)-1894007588:(s^c^f)-899497514);l=f,f=c,c=s<<30|s>>>2,s=a,a=m}a+=p,s+=d,c+=y,f+=v,l+=g}return[a,s,c,f,l]}(t));return r&&r.asBytes?u:r&&r.asString?i.bytesToString(u):n.bytesToHex(u)})._blocksize=16,u._digestsize=20,t.exports=u}).call(this,r(3).Buffer)},function(t,e,r){(function(t){
15
+ /*!
16
+ * The buffer module from node.js, for the browser.
17
+ *
18
+ * @author Feross Aboukhadijeh <http://feross.org>
19
+ * @license MIT
20
+ */
21
+ var n=r(5),o=r(6),i=r(7);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=h(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(s.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}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,e){if(f(e),t=a(t,e<0?0:0|p(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[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,e){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 r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,u=1,a=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}function c(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-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(r+s>a&&(r=a-s),i=r;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(c(t,i+h)!==c(e,h)){l=!1;break}if(l)return i}return-1}function w(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.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(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function O(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return O(t,e,r,n)}function A(t,e,r,n){return q(F(e),t,r,n)}function _(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)n=(r=t.charCodeAt(u))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=r)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 e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function T(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function k(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||k(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return i||k(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.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}}(),e.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return c(null,t,e,r)},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,e,r){return function(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},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,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?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,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var u=t[r];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 e=0;e<t;e+=2)v(this,e,e+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 e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+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 e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(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="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),a=Math.min(i,u),c=this.slice(n,o),f=t.slice(e,r),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,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return O(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);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)}},s.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=s.prototype;else{var o=e-t;r=new s(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},s.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,u=1,a=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,u=1,a=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=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(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var u=s.isBuffer(t)?t:N(new s(t,n).toString()),a=u.length;for(i=0;i<r-e;++i)this[i+e]=u[i%a]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|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,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(4))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),u=n[0],a=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,u,a)),f=0,l=a>0?u-4:u;for(r=0;r<l;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=255&e;return 2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,s[f++]=255&e),1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,s[f++]=e>>8&255,s[f++]=255&e),s},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],u=0,a=r-o;u<a;u+=16383)i.push(f(t,u,u+16383>a?a:u+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),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 e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var o,i,u=[],a=e;a<r;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,e){
22
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
23
+ e.read=function(t,e,r,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[e+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)},e.write=function(t,e,r,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=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),(e+=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=(e*s-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[r+p]=255&u,p+=d,u/=256,c-=8);t[r+p-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],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?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){r.r(e),r.d(e,"handleHttpCache",(function(){return l})),r.d(e,"transformResponse",(function(){return s}));var n=r(0),o=r(2),i=r.n(o),u=["vendorId","storeId","catalogueId","categoryId","productId"],a=["accountId"],s=function(t,e,r){var n,o=null==e?void 0:e.message;try{o=e?JSON.parse(e.message):e}catch(t){}return{data:null!==(n=null==t?void 0:t.data)&&void 0!==n?n:t,hints:c(r),config:r,error:o,pagination:{hasMorePages:null==t?void 0:t.hasMorePages,page:null==t?void 0:t.page}}},c=function(t){var e={};return Object.entries(t.query).forEach((function(t){var r=t,n=r[0],o=r[1];u.includes(n)&&(e[n]=o)})),Object.entries(t.headers).forEach((function(t){var r=t,n=r[0],o=r[1];a.includes(n)&&(e[n]=o)})),e},f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{u(n.next(t))}catch(t){e(t)}}function i(t){try{u(n.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}u((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var r,o,u,a,c,l;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(h){switch(h.label){case 0:if(d=t.url,r=i()(d),o=function(t){return Object(n.getState)().apiCache[t]}(r),p=Object(n.getState)().expiresAt,(u=(new Date).getTime()>=p)&&function(){var t=Object(n.getState)().timeout,e=void 0===t?0:t;Object(n.setState)({apiCache:{},expiresAt:(new Date).getTime()+e})}(),o&&!u)return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,e(t)];case 2:return a=h.sent(),l=s(a,void 0,t),function(t,e){var r,o=Object(n.getState)().apiCache,i=f(f({},o),((r={})[t]=e,r));Object(n.setState)({apiCache:i})}(r,l),[2,l];case 3:return c=h.sent(),[2,l=s(void 0,c,t)];case 4:return[2,o]}var p,d}))}))},h=3e5,p={artisanApp:void 0,apiCache:{},expiresAt:(new Date).getTime()+h,timeout:h};Object(n.initState)(p)}])},function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(6),e),o(r(7),e),o(r(8),e),o(r(9),e),o(r(10),e),o(r(11),e),o(r(12),e),o(r(13),e),o(r(14),e),o(r(15),e),o(r(16),e),o(r(17),e),o(r(18),e),o(r(19),e),o(r(20),e),o(r(21),e),o(r(22),e),o(r(23),e),o(r(24),e)},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,u;n=r(30),o=r(3).utf8,i=r(3).bin,(u=function(t,r){var u=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,u=[],a=1732584193,s=-271733879,c=-1732584194,f=271733878,l=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var h=0;h<r.length;h+=16){for(var p=a,d=s,y=c,v=f,g=l,b=0;b<80;b++){if(b<16)u[b]=r[h+b];else{var w=u[b-3]^u[b-8]^u[b-14]^u[b-16];u[b]=w<<1|w>>>31}var m=(a<<5|a>>>27)+l+(u[b]>>>0)+(b<20?1518500249+(s&c|~s&f):b<40?1859775393+(s^c^f):b<60?(s&c|s&f|c&f)-1894007588:(s^c^f)-899497514);l=f,f=c,c=s<<30|s>>>2,s=a,a=m}a+=p,s+=d,c+=y,f+=v,l+=g}return[a,s,c,f,l]}(t));return r&&r.asBytes?u:r&&r.asString?i.bytesToString(u):n.bytesToHex(u)})._blocksize=16,u._digestsize=20,t.exports=u}).call(this,r(25).Buffer)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.DayOfWeekName=e.TaxType=e.PriceCategoryType=e.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(e.ProductType||(e.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(e.PriceCategoryType||(e.PriceCategoryType={})),function(t){t.IVA="IVA"}(e.TaxType||(e.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(e.DayOfWeekName||(e.DayOfWeekName={}))},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceStatus=e.Days=e.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(e.DeliveryTimeUnit||(e.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"}(e.Days||(e.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(e.ServiceStatus||(e.ServiceStatus={}))},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.Gender=e.MaritalStatus=void 0,function(t){t.MARRIED="MARRIED",t.DIVORCED="DIVORCED",t.SINGLE="SINGLE"}(e.MaritalStatus||(e.MaritalStatus={})),function(t){t.MALE="MALE",t.FEMALE="FEMALE"}(e.Gender||(e.Gender={}))},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){(function(t){
24
+ /*!
25
+ * The buffer module from node.js, for the browser.
26
+ *
27
+ * @author Feross Aboukhadijeh <http://feross.org>
28
+ * @license MIT
29
+ */
30
+ var n=r(27),o=r(28),i=r(29);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=h(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(s.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}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,e){if(f(e),t=a(t,e<0?0:0|p(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[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,e){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 r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,u=1,a=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}function c(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-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(r+s>a&&(r=a-s),i=r;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(c(t,i+h)!==c(e,h)){l=!1;break}if(l)return i}return-1}function w(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.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(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function O(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return O(t,e,r,n)}function A(t,e,r,n){return q(F(e),t,r,n)}function _(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)n=(r=t.charCodeAt(u))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=r)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 e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function T(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function k(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||k(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return i||k(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.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}}(),e.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return c(null,t,e,r)},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,e,r){return function(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},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,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?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,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var u=t[r];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 e=0;e<t;e+=2)v(this,e,e+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 e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+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 e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(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="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),a=Math.min(i,u),c=this.slice(n,o),f=t.slice(e,r),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,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return O(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);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)}},s.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=s.prototype;else{var o=e-t;r=new s(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},s.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,u=1,a=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,u=1,a=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=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(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var u=s.isBuffer(t)?t:N(new s(t,n).toString()),a=u.length;for(i=0;i<r-e;++i)this[i+e]=u[i%a]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|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,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(26))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),u=n[0],a=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,u,a)),f=0,l=a>0?u-4:u;for(r=0;r<l;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=255&e;return 2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,s[f++]=255&e),1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,s[f++]=e>>8&255,s[f++]=255&e),s},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],u=0,a=r-o;u<a;u+=16383)i.push(f(t,u,u+16383>a?a:u+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),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 e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var o,i,u=[],a=e;a<r;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,e){
31
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
32
+ e.read=function(t,e,r,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[e+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)},e.write=function(t,e,r,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=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),(e+=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=(e*s-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[r+p]=255&u,p+=d,u/=256,c-=8);t[r+p-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],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?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){r.r(e),r.d(e,"getCategories",(function(){return k})),r.d(e,"getProductDetails",(function(){return bt})),r.d(e,"getProducts",(function(){return Pt})),r.d(e,"getRecommendedProducts",(function(){return At})),r.d(e,"getRelatedProducts",(function(){return _t})),r.d(e,"getStoreDetails",(function(){return It})),r.d(e,"registerModifiersForm",(function(){return Kt})),r.d(e,"validateProduct",(function(){return te})),r.d(e,"initProducts",(function(){return ie})),r.d(e,"getProductTotals",(function(){return ue})),r.d(e,"transformers",(function(){return i})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return s})),r.d(n,"isProductDetails",(function(){return c})),r.d(n,"isCartProduct",(function(){return f})),r.d(n,"isFormCartProduct",(function(){return l}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return m})),r.d(o,"divideProductQA",(function(){return O})),r.d(o,"operationOnProductQA",(function(){return P}));var i={};r.r(i),r.d(i,"toCartProduct",(function(){return _})),r.d(i,"toFormCartProduct",(function(){return T})),r.d(i,"toFormCartProductHelper",(function(){return I})),r.d(i,"toFormCartProductFromProductDetails",(function(){return j})),r.d(i,"toFormCartProductFromAnswer",(function(){return x})),r.d(i,"normalizeProductDetails",(function(){return R}));var u=r(2),a=function(t){console.error(t)},s=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,i=t.prices,u=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof u&&!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)},c=function(t){if(!s(t))return!1;var e=t.questions;return!!Array.isArray(e)},f=function(t){if(!c(t))return!1;var e,r=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,a=t.priceCategory,s=t.comment,f=t.questionsAndAnswers;return"string"==typeof r&&"string"==typeof n&&"string"==typeof o&&"number"==typeof i&&"string"==typeof s&&!!(e=u.PriceCategoryType,Object.keys(e)).includes(a)&&!!Array.isArray(f)},l=function(t){var e;if(!f(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},h=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},p=function(t,e,r){var n=[],o=t.max,i=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},d=function(t,e){var r=[],n=t.modifiers,o=t.data,i=o.min,u=o.max;0===i&&0===u&&(u=1/0);var a=n.reduce((function(t,e){return t+e.amount}),0);return a>u&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+u}),e&&a<i&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),r},y=function(t){var e=t.touched,r=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,e){return t+e.amount}),0);return g({touched:e,errors:r,required:n,min:u,amount:f,childrenWithError:a,childrenIdle:s,childrenIncomplete:c,reviewChildren:!0})},v=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=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 g({touched:o,errors:i,required:u,min:a,amount:s,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:s>0})},g=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,i=t.amount,u=t.reviewChildren,s=t.childrenWithError,c=t.childrenIdle,f=t.childrenIncomplete,l=i>0&&!e;return l||e||!n?l||e||n?r.length||u&&s?"FAIL":u&&(c||f)||i<o?"INCOMPLETE":i>=o?"OK":(a("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},b=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},w=function(){return(w=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},m=function(t){return P(t,(function(t,e){var r=t.amount*e,n=m(w(w({},t),{amount:r}));return w(w({},n),{amount:t.amount*e})}))},O=function(t){return P(t,(function(t,e){var r=O(t);return w(w({},r),{amount:t.amount/e})}))},P=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return w(w({},t),{answers:r})}));return w(w({},t),{questionsAndAnswers:i})},A=function(){return(A=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_=function(t,e){if(void 0===e&&(e={}),f(t))return A(A({},t),e);if(c(t))return S(t,e);var r=E(t);return S(r,e)},S=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,i=r.amount;return A(A(A({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:u.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},E=function(t,e){return void 0===e&&(e={}),A(A(A({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},T=function(t,e){if(void 0===e&&(e={}),l(t))return A(A({},t),e);if(c(t))return j(t,e);var r=E(t);return j(r,e)},I=function(t,e){void 0===e&&(e={});var r=O(t),n=r.priceCategory,o=r.productId,i=r.amount,u=r.questions.map((function(t){var e,u=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),a=null!=u?u:t,s=a.questionId,c=a.min,f=a.max,l={rootId:o,min:c,max:f,type:h(a),modifiersCount:t.answers.length,amount:i,path:[]};return A(A({},a),{answers:t.answers.map((function(t){var e,r=null==u?void 0:u.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,i=function(t){return 1===t.modifiersCount?t.min:0}(l),a=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(l),c=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:i,max:a,groupType:l.type,type:o.renderType}),f=o.questions.length,h=A(A({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:s,min:i,max:a,renderType:c});return A(A({},h),{questions:f?I(h).questions:[]})}))})}));return A(A(A({},r),{questions:u}),e)},j=function(t,e){void 0===e&&(e={});var r=S(t);return I(r,e)},x=function(t,e){return void 0===e&&(e={}),I(t,e)},R=function(t){var e=t.questions;return A(A({},t),{questions:e.map((function(t){var e=t.answers;return A(A({},t),{answers:e.map((function(t){var e=t.questions;return A(A({},t),{questions:null!=e?e:[]})}))})}))})},C=r(0),B=3e5,M={artisanApp:void 0,timeout:B,apiCache:{},expiresAt:(new Date).getTime()+B,forms:{}},k=function(){console.log("Not supported yet")},D=function(){return(D=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},U=["page","vendor","store","catalogue","category","product"],Y=["price","query","tags","manufacturerId","weight","dimensions"],L=["type","method"],N=["vendorId","storeId","catalogueId","categoryId","productId"],F=["category"],q=["asc","desc"],$=["alphabetic","price","predefined"],z=function(t){var e=H(t),r=G(e),n=W(r),o=V(n);return J(o)},H=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=D(D({},{vendorId:r,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),c=K(s,N,"filter"),f=X(c);return D(D({},t),{filterBy:f})},G=function(t){var e=Q(t,F,"groupBy");return D({},e)},W=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=K(r,L,"orderBy"),o=D({},n),i=r.method,u=r.type;return u&&!$.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),$.includes(u)||(delete o.type,o.type="predefined"),i&&!q.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),q.includes(i)||(delete o.method,o.method="asc"),D(D({},t),{orderBy:o})},V=function(t){var e=t.pagination,r=K(void 0===e?{}:e,U,"pagination"),n=D({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,D(D({},t),{pagination:n})},J=function(t){var e=t.additionalFilters,r=K(void 0===e?{}:e,Y,"additionalFilters");return D(D({},t),{additionalFilters:r})},K=function(t,e,r){var n=D({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},Q=function(t,e,r){var n=D({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},X=function(t){var e=D({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&Z(n[0])||Z(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},Z=function(t){var e=typeof t;return"number"===e||"string"===e},tt=(r(4),function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),et=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,u=i.vendorId,a=i.storeId,s=i.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(a,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(s,r)}(e=z(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,i=e.additionalFilters,u=e.orderBy,a=e.pagination,s=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],u=i;return Array.isArray(i)&&(u=i.reduce((function(t,e){return t+","+e}))),tt(tt({},t),"catalogueId"===o?((r={})[o]=u,r.channelId=u,r):((n={})[o]=u,n))}),{})}(n),c=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(u),f=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?tt(tt({},t),((r={})[n]=o,r)):t}),{})}(i),l=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],i=void 0===n?{}:n;return"page"===r?tt(tt({},t),{page:i}):"product"===r?tt(tt({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===r?tt(tt({},t),{size:i.size}):t}),{})}(a),h=tt(tt(tt(tt(tt({},s),{groupBy:o}),c),f),l);o||delete h.groupBy;var p=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var i=o[n],u=i[0],a=i[1],s=new RegExp("/:"+u,"g");r=r.replace(s,"/"+a)}return r}(t,r.params),d=Object(C.getState)().artisanApp,y=(null!=d?d:{}).apiURL,v=Object.entries(h).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),y+"/"+p+"?");return tt(tt({},r),{url:v,query:h})}(t,e,r)},rt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{u(n.next(t))}catch(t){e(t)}}function i(t){try{u(n.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}u((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var e,r,n,o,i,u;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(a){switch(a.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(e,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]}}))}))},nt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{u(n.next(t))}catch(t){e(t)}}function i(t){try{u(n.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}u((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},ot=r(5),it=function(){return(it=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ut=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},at=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},st={"Content-Type":"application/json"},ct=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),ut(void 0,void 0,void 0,(function(){var r,n,o,i,u,a,s,c,f,l,h,p,d,y,v,g;return at(this,(function(b){switch(b.label){case 0:return r=Object(C.getState)().artisanApp,n=r.settings,o=n.platform,i=n.accountId,u=null!==(p=null!==(h=null===(l=e.account)||void 0===l?void 0:l.toString())&&void 0!==h?h:null==i?void 0:i.toString())&&void 0!==p?p:"",a=null!==(y=null!==(d=e.Platform)&&void 0!==d?d:o)&&void 0!==y?y:"",s=a,null===(v=e.Authorization)||void 0===v?[3,1]:(f=v,[3,3]);case 1:return[4,ft(t)];case 2:f=b.sent(),b.label=3;case 3:return c=null!==(g=f)&&void 0!==g?g:"",[2,new Headers(it(it(it({},st),e),{Authorization:c,Platform:s,account:u}))]}}))}))},ft=function(t,e){return void 0===t&&(t=!0),ut(void 0,void 0,void 0,(function(){var r,n,o;return at(this,(function(i){switch(i.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(ot.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=i.sent())||t?!n&&t?(a("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},lt=r(1),ht=function(){return(ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pt=function(t,e){var r=z(e).pagination,n=t.pagination;return ht(ht({},t),{pagination:dt(r,n)})},dt=function(t,e){return ht(ht({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},yt=function(){return(yt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},vt=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},gt=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},bt=function(t,e){return vt(void 0,void 0,void 0,(function(){var r,n,o;return gt(this,(function(i){switch(i.label){case 0:return[4,ct(!1)];case 1:return r=i.sent(),n=et("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(lt.handleHttpCache)(n,(function(t){return vt(void 0,void 0,void 0,(function(){var e,r;return gt(this,(function(n){switch(n.label){case 0:return[4,nt(t)];case 1:return e=n.sent(),r=R(e.data),[2,yt(yt({},e),{data:r})]}}))}))}))];case 2:return o=i.sent(),[2,pt(o,e)]}}))}))},wt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{u(n.next(t))}catch(t){e(t)}}function i(t){try{u(n.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}u((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},mt=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},Ot=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=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 mt(void 0,void 0,void 0,(function(){var e,r,n;return Ot(this,(function(o){switch(o.label){case 0:return[4,ct(!1)];case 1:return e=o.sent(),r=et("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(lt.handleHttpCache)(r,(function(t){return mt(void 0,void 0,void 0,(function(){return Ot(this,(function(e){switch(e.label){case 0:return[4,wt(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,pt(n,t)]}}))}))},At=function(){console.log("Not implemented yet")},_t=function(){console.log("not implemented yet")},St=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{u(n.next(t))}catch(t){e(t)}}function i(t){try{u(n.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}u((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},Et=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},Tt=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},It=function(t){return Et(void 0,void 0,void 0,(function(){var e,r,n;return Tt(this,(function(o){switch(o.label){case 0:return[4,ct(!1)];case 1:return e=o.sent(),r=et("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(lt.handleHttpCache)(r,(function(t){return Et(void 0,void 0,void 0,(function(){return Tt(this,(function(e){switch(e.label){case 0:return[4,St(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,pt(n,t)]}}))}))},jt=function(){return(jt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Rt=function(t,e){for(var r=xt([],e),n=t,o=t[0];r.length;)o=Bt(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Ct=function(t,e,r){for(var n=xt([],e),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=xt([],u?i.modifiers:i.groups);var a=n[0];if(1===e.length&&(i={groups:t},u=!1),u){var s=i.modifiers.map((function(t){return t.id===a?jt({},r):jt({},t)}));i.modifiers=s}else{var c=i.groups.map((function(t){return t.id===a?jt({},r):jt({},t)}));i.groups=c}return 1===e.length?xt([],i.groups):xt([],t)},Bt=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Mt=function(){return(Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Dt=function(t,e,r,n,o){var i=Mt(Mt({},r),{amount:n,touched:!0,errors:p(r,n,o),totals:ue(Mt(Mt({},r.data),{amount:n})),data:Mt(Mt({},r.data),{amount:n})});return i.status=v(i),Ct(t,e,i)},Ut=function(t,e,r,n){var o=r.slice(0,-1),i=Rt(e,o),u=kt([],i.modifiers);"RADIO"!==i.type||n||(u=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Mt({},t):Mt(Mt({},t),{amount:0,error:"",totals:ue(Mt(Mt({},t.data),{amount:0})),data:Mt(Mt({},t.data),{amount:0})})})));var a=(u=u.map((function(e){var o=x(e.data),i=kt(kt([],r.slice(0,-1)),[e.id]),u=Mt(Mt({},e),{groups:qt(o,{rootId:t,path:i},e.groups)});return u.errors=p(u,u.amount,n),u.status=v(u),u}))).map((function(t){return Mt({},t.data)})),s=Mt(Mt({},i.data),{answers:a}),c=Mt(Mt({},i),{touched:!0,modifiers:u,data:s});c.errors=d(c,n),c.status=y(c);var f=Ct(e,o,c);return o.length>1&&(f=Yt(t,f,o,n)),f},Yt=function(t,e,r,n){var o=r.slice(0,-1),i=Rt(e,o),u=i.groups.map((function(t){return Mt({},t.data)})),a=Mt(Mt({},i.data),{questions:u}),s=i.groups.map((function(t){var e=Mt({},t);return e.errors=d(e,n),e.status=y(e),e})),c=Mt(Mt({},i),{touched:!0,groups:s,data:a});c.errors=p(c,c.amount,n),c.status=v(c);var f=Ct(e,o,c);return o.length>1&&(f=Ut(t,f,o,n)),f},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(){return(Nt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ft=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},qt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var i=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return $t(e,{amount:t.amount,rootId:n,path:Ft([],o)},i)}))},$t=function(t,e,r){var n=t.questionId,o=t.name,i=t.description,u=t.max,a=t.min,s=t.images,c=e.amount,f=e.rootId,l=e.path,p=null!=r?r:{},d=p.errors,v=p.touched,g={id:n,name:o,description:null!=i?i:"",images:Ft([],null!=s?s:[]),data:Nt({},t),errors:null!=d?d:[],touched:null!=v&&v,status:"IDLE",hidden:c<1,required:a>0,type:h(t)},b={rootId:f,max:u,min:a,type:g.type,modifiersCount:t.answers.length,amount:c,path:Ft(Ft([],l),[n])},w=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return zt(t,b,e)})),m=Nt(Nt({},g),{modifiers:w});return Nt(Nt({},m),{status:y(m)})},zt=function(t,e,r){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,p=x(t),d=e.rootId,y=e.path,g=Ft(Ft([],y),[i]),w=qt(p,{rootId:d,path:g},null==r?void 0:r.groups),m={id:i,groupId:u,name:a,images:Ft([],s),amount:c,data:Nt({},t),groups:w,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:l,max:h,required:l>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:ue(Nt(Nt({},t),{amount:c})),type:f,handleChange:function(t){!function(t,e,r){var n,o=Lt({},Object(C.getState)().forms),i=o[t],u=Rt(i.renderer,e),a=Dt(i.renderer,e,u,r,!1);a=Ut(t,a,e,!1);var s=Gt(a,i.product),c=Lt(Lt({},i),{renderer:a,product:s,status:b(a)}),f=Lt(Lt({},o),((n={})[t]=c,n));Object(C.setState)({forms:f});var l=Lt({},c);delete l.callback,i.callback(l)}(e.rootId,g,t)}};return Nt(Nt({},m),{status:v(m)})},Ht=function(){return(Ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gt=function(t,e){var r=_(e);return Ht(Ht({},r),{questionsAndAnswers:Wt(t),updatedAt:""})},Wt=function(t){return t.map((function(t){return Ht(Ht({},t.data),{answers:Vt(t.modifiers)})}))},Vt=function(t){return t.map((function(t){return t.amount?Ht(Ht({},t.data),{questionsAndAnswers:Wt(t.groups)}):Ht(Ht({},t.data),{questionsAndAnswers:[]})}))},Jt=function(){return(Jt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kt=function(t,e){var r,n=t.productId,o=Object(C.getState)().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 e,r=T(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=qt(r,{rootId:r.productId,path:[]});return{product:Gt(n,t),renderer:n,validate:function(){return te(t.productId)},status:b(n)}}(t),u=Jt(Jt({},o),((r={})[n]=Jt(Jt({},i),{callback:e}),r));return Object(C.setState)({forms:u}),e(Jt({},i)),function(){return Qt(n)}},Qt=function(t){var e=Object(C.getState)().forms,r=Jt({},e);delete r[t],Object(C.setState)({forms:r})},Xt=function(){return(Xt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},te=function(t){var e,r=Xt({},Object(C.getState)().forms),n=r[t],o=n.renderer,i=n.callback,u=n.product,a=Zt([],o);o.forEach((function(e){var r=[e.id];a=ee(e,a,t,r)}));var s=Gt(a,u),c=Xt(Xt({},n),{renderer:a,product:s,status:b(a)}),f=Xt(Xt({},r),((e={})[t]=c,e));Object(C.setState)({forms:f});var l=Xt({},c);return delete l.callback,i(l),c.status},ee=function(t,e,r,n){var o=t.modifiers,i=t.id,u=!o.length,a=Zt([],e);return u?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),a):(o.forEach((function(t){var e=Zt(Zt([],n),[t.id]);a=re(t,a,r,e)})),a)},re=function(t,e,r,n){var o=t.groups,i=t.amount,u=t.status,a=t.required,s=!o.length||0===i,c=Zt([],e);if(s){var f="IDLE"===u&&a||"FAIL"===u||"INCOMPLETE"===u?"FAIL":u,l=Xt(Xt({},t),{status:f}),h=Zt([],n);c=Dt(c,h,l,l.amount,!0),c=Ut(r,c,h,!0)}else o.forEach((function(t){var e=Zt(Zt([],n),[t.id]);c=ee(t,c,r,e)}));return c},ne=function(){return(ne=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oe=!1,ie=function(t,e){if(void 0===e&&(e={}),oe)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(Object(C.setState)(ne({artisanApp:t},e)),void 0!==e.timeout){var r=(new Date).getTime()+e.timeout;Object(C.setState)({expiresAt:r})}"undefined"==typeof window||(oe=!0)}},ue=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?O(r):t;return{unitGrossPrice:ce(n,1),unitTotalDiscounts:fe(n,1),unitTotalTaxes:ae(n,1),unitNetPrice:le(n,1),amount:e,grossPrice:ce(n,e),totalDiscounts:fe(n,e),totalTaxes:ae(n,e),netPrice:le(n,e)}},ae=function(t,e){var r=_(t,{amount:e}),n=r.prices,o=r.amount,i=n[r.priceCategory],u=i.taxes,a=i.grossPrice,s=de(u,a);return se(r,e)+s*o},se=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,i=n[r.priceCategory],u=i.taxes,a=i.grossPrice;return t+o*(de(u,a)+se(r,e))}),0)*e}),0)},ce=function(t,e){return he(t,"grossPrice",e)},fe=function(t,e){return 0},le=function(t,e){return he(t,"netPrice",e)},he=function(t,e,r){var n=_(t,{amount:r}),o=n.prices,i=n.amount,u=o[n.priceCategory][e];return(pe(n,e)+u)*i},pe=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+pe(r,e))}),0)}),0)},de=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)};Object(C.initState)(M)}])},function(t,e,r){t.exports=function(){var t="millisecond",e="second",r="minute",n="hour",o="day",i="week",u="month",a="quarter",s="year",c="date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},p=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},d={s:p,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+p(n,2,"0")+":"+p(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,u),i=r-o<0,a=e.clone().add(n+(i?-1:1),u);return+(-(n+(r-o)/(i?o-a:a-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(f){return{M:u,y:s,w:i,d:o,D:c,h:n,m:r,s:e,ms:t,Q:a}[f]||String(f||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",v={};v[y]=h;var g=function(t){return t instanceof O},b=function(t,e,r){var n;if(!t)return y;if("string"==typeof t)v[t]&&(n=t),e&&(v[t]=e,n=t);else{var o=t.name;v[o]=t,n=o}return!r&&n&&(y=n),n||!r&&y},w=function(t,e){if(g(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new O(r)},m=d;m.l=b,m.i=g,m.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function h(t){this.$L=b(t.locale,null,!0),this.parse(t)}var p=h.prototype;return p.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(m.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(f);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},p.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},p.$utils=function(){return m},p.isValid=function(){return!("Invalid Date"===this.$d.toString())},p.isSame=function(t,e){var r=w(t);return this.startOf(e)<=r&&r<=this.endOf(e)},p.isAfter=function(t,e){return w(t)<this.startOf(e)},p.isBefore=function(t,e){return this.endOf(e)<w(t)},p.$g=function(t,e,r){return m.u(t)?this[e]:this.set(r,t)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(t,a){var f=this,l=!!m.u(a)||a,h=m.p(t),p=function(t,e){var r=m.w(f.$u?Date.UTC(f.$y,e,t):new Date(f.$y,e,t),f);return l?r:r.endOf(o)},d=function(t,e){return m.w(f.toDate()[t].apply(f.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(e)),f)},y=this.$W,v=this.$M,g=this.$D,b="set"+(this.$u?"UTC":"");switch(h){case s:return l?p(1,0):p(31,11);case u:return l?p(1,v):p(0,v+1);case i:var w=this.$locale().weekStart||0,O=(y<w?y+7:y)-w;return p(l?g-O:g+(6-O),v);case o:case c:return d(b+"Hours",0);case n:return d(b+"Minutes",1);case r:return d(b+"Seconds",2);case e:return d(b+"Milliseconds",3);default:return this.clone()}},p.endOf=function(t){return this.startOf(t,!1)},p.$set=function(i,a){var f,l=m.p(i),h="set"+(this.$u?"UTC":""),p=(f={},f[o]=h+"Date",f[c]=h+"Date",f[u]=h+"Month",f[s]=h+"FullYear",f[n]=h+"Hours",f[r]=h+"Minutes",f[e]=h+"Seconds",f[t]=h+"Milliseconds",f)[l],d=l===o?this.$D+(a-this.$W):a;if(l===u||l===s){var y=this.clone().set(c,1);y.$d[p](d),y.init(),this.$d=y.set(c,Math.min(this.$D,y.daysInMonth())).$d}else p&&this.$d[p](d);return this.init(),this},p.set=function(t,e){return this.clone().$set(t,e)},p.get=function(t){return this[m.p(t)]()},p.add=function(t,a){var c,f=this;t=Number(t);var l=m.p(a),h=function(e){var r=w(f);return m.w(r.date(r.date()+Math.round(e*t)),f)};if(l===u)return this.set(u,this.$M+t);if(l===s)return this.set(s,this.$y+t);if(l===o)return h(1);if(l===i)return h(7);var p=(c={},c[r]=6e4,c[n]=36e5,c[e]=1e3,c)[l]||1,d=this.$d.getTime()+t*p;return m.w(d,this)},p.subtract=function(t,e){return this.add(-1*t,e)},p.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=m.z(this),o=this.$locale(),i=this.$H,u=this.$m,a=this.$M,s=o.weekdays,c=o.months,f=function(t,n,o,i){return t&&(t[n]||t(e,r))||o[n].substr(0,i)},h=function(t){return m.s(i%12||12,t,"0")},p=o.meridiem||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n},d={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:m.s(a+1,2,"0"),MMM:f(o.monthsShort,a,c,3),MMMM:f(c,a),D:this.$D,DD:m.s(this.$D,2,"0"),d:String(this.$W),dd:f(o.weekdaysMin,this.$W,s,2),ddd:f(o.weekdaysShort,this.$W,s,3),dddd:s[this.$W],H:String(i),HH:m.s(i,2,"0"),h:h(1),hh:h(2),a:p(i,u,!0),A:p(i,u,!1),m:String(u),mm:m.s(u,2,"0"),s:String(this.$s),ss:m.s(this.$s,2,"0"),SSS:m.s(this.$ms,3,"0"),Z:n};return r.replace(l,(function(t,e){return e||d[t]||n.replace(":","")}))},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(t,c,f){var l,h=m.p(c),p=w(t),d=6e4*(p.utcOffset()-this.utcOffset()),y=this-p,v=m.m(this,p);return v=(l={},l[s]=v/12,l[u]=v,l[a]=v/3,l[i]=(y-d)/6048e5,l[o]=(y-d)/864e5,l[n]=y/36e5,l[r]=y/6e4,l[e]=y/1e3,l)[h]||y,f?v:m.a(v)},p.daysInMonth=function(){return this.endOf(u).$D},p.$locale=function(){return v[this.$L]},p.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=b(t,e,!0);return n&&(r.$L=n),r},p.clone=function(){return m.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},h}(),P=O.prototype;return w.prototype=P,[["$ms",t],["$s",e],["$m",r],["$H",n],["$W",o],["$M",u],["$y",s],["$D",c]].forEach((function(t){P[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,O,w),t.$i=!0),w},w.locale=b,w.isDayjs=g,w.unix=function(t){return w(1e3*t)},w.en=v[y],w.Ls=v,w.p={},w}()},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,u;n=r(11),o=r(2).utf8,i=r(2).bin,(u=function(t,r){var u=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,u=[],a=1732584193,s=-271733879,c=-1732584194,f=271733878,l=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var h=0;h<r.length;h+=16){for(var p=a,d=s,y=c,v=f,g=l,b=0;b<80;b++){if(b<16)u[b]=r[h+b];else{var w=u[b-3]^u[b-8]^u[b-14]^u[b-16];u[b]=w<<1|w>>>31}var m=(a<<5|a>>>27)+l+(u[b]>>>0)+(b<20?1518500249+(s&c|~s&f):b<40?1859775393+(s^c^f):b<60?(s&c|s&f|c&f)-1894007588:(s^c^f)-899497514);l=f,f=c,c=s<<30|s>>>2,s=a,a=m}a+=p,s+=d,c+=y,f+=v,l+=g}return[a,s,c,f,l]}(t));return r&&r.asBytes?u:r&&r.asString?i.bytesToString(u):n.bytesToHex(u)})._blocksize=16,u._digestsize=20,t.exports=u}).call(this,r(6).Buffer)},function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(12),e),o(r(13),e),o(r(14),e),o(r(15),e),o(r(16),e),o(r(17),e),o(r(18),e),o(r(19),e),o(r(20),e),o(r(21),e),o(r(22),e),o(r(23),e),o(r(24),e),o(r(25),e),o(r(26),e),o(r(27),e),o(r(28),e),o(r(29),e),o(r(30),e)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){(function(t){
33
+ /*!
34
+ * The buffer module from node.js, for the browser.
35
+ *
36
+ * @author Feross Aboukhadijeh <http://feross.org>
37
+ * @license MIT
38
+ */
39
+ var n=r(8),o=r(9),i=r(10);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=h(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(s.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}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,e){if(f(e),t=a(t,e<0?0:0|p(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[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,e){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 r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,u=1,a=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}function c(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-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(r+s>a&&(r=a-s),i=r;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(c(t,i+h)!==c(e,h)){l=!1;break}if(l)return i}return-1}function w(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.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(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function O(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return O(t,e,r,n)}function A(t,e,r,n){return q(F(e),t,r,n)}function _(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)n=(r=t.charCodeAt(u))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=r)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 e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function T(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function k(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||k(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return i||k(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.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}}(),e.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return c(null,t,e,r)},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,e,r){return function(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},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,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?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,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var u=t[r];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 e=0;e<t;e+=2)v(this,e,e+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 e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+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 e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(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="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),a=Math.min(i,u),c=this.slice(n,o),f=t.slice(e,r),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,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return O(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);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)}},s.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=s.prototype;else{var o=e-t;r=new s(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},s.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,u=1,a=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,u=1,a=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=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(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var u=s.isBuffer(t)?t:N(new s(t,n).toString()),a=u.length;for(i=0;i<r-e;++i)this[i+e]=u[i%a]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|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,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(7))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),u=n[0],a=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,u,a)),f=0,l=a>0?u-4:u;for(r=0;r<l;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=255&e;return 2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,s[f++]=255&e),1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,s[f++]=e>>8&255,s[f++]=255&e),s},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],u=0,a=r-o;u<a;u+=16383)i.push(f(t,u,u+16383>a?a:u+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),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 e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var o,i,u=[],a=e;a<r;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,e){
40
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
41
+ e.read=function(t,e,r,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[e+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)},e.write=function(t,e,r,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=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),(e+=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=(e*s-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[r+p]=255&u,p+=d,u/=256,c-=8);t[r+p-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],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?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.DayOfWeekName=e.TaxType=e.PriceCategoryType=e.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(e.ProductType||(e.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(e.PriceCategoryType||(e.PriceCategoryType={})),function(t){t.IVA="IVA"}(e.TaxType||(e.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(e.DayOfWeekName||(e.DayOfWeekName={}))},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceStatus=e.Days=e.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(e.DeliveryTimeUnit||(e.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"}(e.Days||(e.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(e.ServiceStatus||(e.ServiceStatus={}))},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.Gender=e.MaritalStatus=void 0,function(t){t.MARRIED="MARRIED",t.DIVORCED="DIVORCED",t.SINGLE="SINGLE"}(e.MaritalStatus||(e.MaritalStatus={})),function(t){t.MALE="MALE",t.FEMALE="FEMALE"}(e.Gender||(e.Gender={}))},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},,function(t,e,r){r.r(e),r.d(e,"initShoppingCart",(function(){return h})),r.d(e,"closeShoppingCart",(function(){return p})),r.d(e,"listenShoppingCart",(function(){return T})),r.d(e,"getShoppingCart",(function(){return E})),r.d(e,"addProduct",(function(){return it})),r.d(e,"subtractProduct",(function(){return ht})),r.d(e,"removeProduct",(function(){return vt})),r.d(e,"setProduct",(function(){return At})),r.d(e,"replaceProduct",(function(){return Et})),r.d(e,"createShoppingCart",(function(){return xt})),r.d(e,"emptyShoppingCart",(function(){return Mt})),r.d(e,"deleteShoppingCart",(function(){return Dt})),r.d(e,"getShoppingCartTotal",(function(){return K})),r.d(e,"getShoppingCartProducts",(function(){return Q})),r.d(e,"validateShoppingCart",(function(){return Jt})),r.d(e,"setShoppingCartAdditionalInfo",(function(){return Qt})),r.d(e,"getProductHash",(function(){return V})),r.d(e,"UNSAFE_listenBenefitsWallet",(function(){return pe})),r.d(e,"listenBenefitsWallet",(function(){return be})),r.d(e,"applyBenefits",(function(){return Pe})),r.d(e,"redeemCoupon",(function(){return Se})),r.d(e,"useBenefit",(function(){return Ie})),r.d(e,"unuseBenefit",(function(){return Re}));var n="YYYY-MM-DD hh:mm:ss.SSS",o="default",i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u={artisanApp:void 0,accountId:void 0,customerId:void 0,activeShoppingCart:o,maxShoppingCarts:2,wallets:{}};Object.freeze(u);var a=i({},u);Object.seal(a);var s=function(t){a=i(i({},a),t)},c=function(){return i({},a)},f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=!1,h=function(t,e){void 0===e&&(e={}),l?console.warn("initShoppingCart has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initShoppingCart is only called once "):(s(f({artisanApp:t},e)),"undefined"==typeof window||(l=!0))},p=function(){var t;null===(t=c().artisanApp)||void 0===t||t.__internals__.firestore().terminate(),s(f({},u)),l=!1},d=function(t){if(void 0===t&&(t=""),!c().artisanApp)throw new Error("Artisan app must be provided, you probably forgot to initialize the shopping cart. Please make sure initShoppingCart has been called beforehand. "+t)},y=function(t,e){void 0===e&&(e="");var r=c().accountId;if(void 0===t&&void 0===r)throw new Error("AccountId must be defined. Either provide a global accountId or at the function call level. "+e)},v=function(t,e){void 0===e&&(e="");var r=c().customerId;if(void 0===t&&void 0===r)throw new Error("CustomerId must be defined. Either provide a global customerId or at the function call level. "+e)},g=function(t,e){void 0===e&&(e="");var r=c().store;if(void 0===t&&void 0===r)throw new Error("StoreId must be defined. Either provide a global storeId or at the function call level. "+e)},b=function(t){void 0===t&&(t={});var e=t.accountId,r=t.customerId;y(e),v(r)},w=function(t){var e=t.customerId;!function(t,e){if(void 0===e&&(e=""),void 0===t)throw new Error("VendorId must be defined. Either provide a global vendorId or at the function call level to retrieve a wallet. "+e)}(t.vendorId),v(e)},m=function(t){var e=null!=t?t:{},r=e.Platform,n=e.account;!function(t,e){void 0===e&&(e="");var r=c().artisanApp.settings.platform;if(void 0===t&&void 0===r)throw new Error("Platform must be defined. Either provide a global Plafform in the artisan object or at the function call level. "+e)}(r),y(n)},O=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},P=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},A=o,_=function(t){return void 0===t&&(t={}),O(void 0,void 0,void 0,(function(){var e,r,n,o,i,u,a,s,f;return P(this,(function(l){switch(l.label){case 0:return e=c(),r=e.artisanApp,n=e.accountId,o=c().customerId,i=t.accountId,u=t.customerId,d(),b(t),a=null==r?void 0:r.__internals__.firestore(),[4,null===(f=null===(s=null==a?void 0:a.collection("shoppingCartByUser"))||void 0===s?void 0:s.doc(String(null!=u?u:o)))||void 0===f?void 0:f.collection(String(null!=i?i:n))];case 1:return[2,l.sent()]}}))}))},S=function(t,e){return O(void 0,void 0,void 0,(function(){var r,n;return P(this,(function(o){switch(o.label){case 0:return r=null!=e?e:c().activeShoppingCart,[4,_(t)];case 1:return(n=o.sent())?[4,n.where("name","==",r).get().then((function(t){return t.docs[0]}))]:[2,void 0];case 2:return[2,o.sent()]}}))}))},E=function(t,e){return O(void 0,void 0,void 0,(function(){var r,n;return P(this,(function(o){switch(o.label){case 0:return r=null!=t?t:c().activeShoppingCart,[4,S(e,r)];case 1:return(n=o.sent())?(s({activeShoppingCart:r}),[4,n.data()]):[2];case 2:return[2,o.sent()]}}))}))},T=function(t,e,r){return void 0===r&&(r={}),O(void 0,void 0,void 0,(function(){var n,o;return P(this,(function(i){switch(i.label){case 0:return n=null!=e?e:c().activeShoppingCart,[4,_(r)];case 1:return(o=i.sent())?(s({activeShoppingCart:n}),o.where("name","==",n).onSnapshot((function(e){return O(void 0,void 0,void 0,(function(){var r;return P(this,(function(o){switch(o.label){case 0:return e.docs[0]?[4,e.docs[0].data()]:(n!==A&&console.warn("Failed to fetch a shopping cart with name "+n+" because there wasn't any."),[2,t(void 0)]);case 1:return r=o.sent(),[2,t(r)]}}))}))})),[2]):[2]}}))}))},I=r(1),j=r.n(I),x=r(0),R=function(){return(R=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},C=o,B=function(t){return void 0===t&&(t=C),function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(r){switch(r.label){case 0:return[4,S({},t)];case 1:return[2,null==(e=r.sent())?void 0:e.id]}}))}))},M=function(t){if(void 0!==t)return"number"==typeof t?t:t.storeId},k=function(t,e){var r=M(t);return R("number"!=typeof t?R({},t):{},e[r])},D=function(t){var e=t.store,r=t.amount,n=M(e);g(n),function(t){if("number"!=typeof t)throw new Error("Invalid amount recieved, please make sure you include a valid amount.");if(t<0)throw new Error("Cannot receive a negative amount of an item. Please ensure you have added a proper amount of items.");if(0===t)throw new Error("Attempting to pass 0 amount. This might indicate a problem with your code. Please ensure you have added a proper amount of items.")}(r)},U=r(3),Y=r.n(U),L=r(4),N=function(t,e,r){var n=e[t],o=r[t];return n>o?1:o>n?-1:0},F=function(t,e){return N("productId",t,e)},q=function(t,e){return N("questionId",t,e)},$=function(t){console.error(t)},z=function(){return(z=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},H=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},G=x.transformers.toCartProduct,W=x.modifierUtils.divideProductQA,V=function(t){var e=W(t),r=e.productId,n=e.questionsAndAnswers,o=e.priceCategory,i=r+"-"+J(n).sort(q).reduce((function(t,e){var r=e.answers.sort(F).reduce((function(t,e,r){var n=e.productId,o=e.amount,i=V(e),u=i?"{"+i+"}":"";return 0===r?n+"="+o+u:t+"|"+n+"="+o+u}),""),n=e.questionId+":"+r;return""===t?""+n:t+"-"+n}),"")+"*"+o;return Y()(i)},J=function(t){return t.reduce((function(t,e){var r=e.answers.filter((function(t){return t.amount>0})).map((function(t){var e=J(t.questionsAndAnswers);return z(z({},t),{questionsAndAnswers:e})}));return H(H([],t),[z(z({},e),{answers:r})])}),[]).filter((function(t){return t.answers.length>0}))},K=function(t,e){void 0===e&&(e={});var r=Q(t).reduce((function(t,e){var r=G(e),n=r.priceCategory,o=Object(x.getProductTotals)(r),i=n===L.PriceCategoryType.POINTS,u=i?o.netPrice:0,a=i?0:o.netPrice,s=i?0:o.grossPrice;return{subtotal:t.subtotal+s,totalDiscounts:t.totalDiscounts+o.totalDiscounts,totalTaxes:t.totalTaxes+o.totalTaxes,totalPoints:t.totalPoints+u,total:t.total+a}}),{subtotal:0,totalDiscounts:0,totalTaxes:0,totalPoints:0,total:0}),n=X(null==t?void 0:t.additional_info,null==t?void 0:t.benefits,r),o=e.shippingCost,i=void 0===o?t.shippingCost:o;if(!i)return n;var u=i.grossPrice,a=i.netPrice,s=i.taxTotal,c=i.discountTotal;return{subtotal:n.subtotal+u,totalDiscounts:n.totalDiscounts+c,totalTaxes:n.totalTaxes+s,shippingCost:a,totalPoints:n.totalPoints,total:n.total+a}},Q=function(t){return Object.values(t.stores).reduce((function(t,e){var r=Object.values(e.products);return H(H([],t),r)}),[])},X=function(t,e,r){return e?Object.values(e).reduce((function(e,r){return"DISCOUNT"===r.type?Z(r,e,t):e}),r):r},Z=function(t,e,r){var n=e.subtotal,o=e.total,i=e.totalDiscounts,u=.01*t.discountPercentage;if(void 0!==(null==r?void 0:r.copayment)){var a=null==r?void 0:r.copayment,s=a*u,c=i+s,f=(a-s).toFixed(4);return z(z({},e),{totalDiscounts:c,total:Number(f)})}var l=n*u,h=i+l,p=o-l;return z(z({},e),{totalDiscounts:h,total:p})},tt=function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},et=n,rt=x.transformers.toCartProduct,nt=x.modifierUtils.multiplyProductQA,ot=x.modifierUtils.divideProductQA,it=function(t,e){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(u){switch(u.label){case 0:return D(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=u.sent())?[4,n.data()]:(console.warn("Cannot add a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=u.sent(),i=ut(o,t,e),[4,n.ref.set(i)];case 3:return u.sent(),[2]}}))}))},ut=function(t,e,r){var n=e.amount||1,o=rt(e,tt(tt({},r),{amount:null!=n?n:1})),i=rt(e,r),u=c().store,a=r.store,s=null!=a?a:u,f=M(s),l=V(o),h=tt({},t),p=tt({},t.stores),d=k(s,p),y=tt({},d.products),v=y[l],g=j()().format(et);v?(y[l]=ot(y[l]),y[l].amount+=i.amount):(y[l]=i,y[l].hash=l,y[l].createdAt=g),y[l].updatedAt=g;var b=y[l],w=(b=nt(b)).questionsAndAnswers,m=J(w);return y[l]=tt(tt({},b),{questionsAndAnswers:m}),d.products=y,p[f]=d,h.stores=p,h},at=function(){return(at=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},st=n,ct=x.transformers.toCartProduct,ft=x.modifierUtils.multiplyProductQA,lt=x.modifierUtils.divideProductQA,ht=function(t,e){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(u){switch(u.label){case 0:return D(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=u.sent())?[4,n.data()]:(console.warn("Cannot subtract product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=u.sent(),i=pt(o,t,e),[4,n.ref.set(i)];case 3:return u.sent(),[2]}}))}))},pt=function(t,e,r){var n=e.amount||1,o=ct(e,at(at({},r),{amount:null!=n?n:1})),i=ct(e,r),u=c().store,a=r.store,s=null!=a?a:u,f=M(s),l=V(o),h=at({},t),p=at({},t.stores);if(void 0===p[f])return console.warn("StoreId given is invalid. There is no store with id "+f+" on the shopping cart."),t;var d=k(s,p),y=at({},d.products),v=y[l],g=j()().format(st);if(!v)return console.warn("Attempting to subtract the amount of product that is not in the given shopping cart store."),t;y[l]=lt(y[l]);var b=y[l].amount-i.amount;return b>0?(y[l].amount=b,y[l].updatedAt=g,y[l]=ft(y[l])):delete y[l],d.products=y,Object.keys(d.products).length?p[f]=d:delete p[f],h.stores=p,h},dt=function(){return(dt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yt=x.transformers.toCartProduct,vt=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(u){switch(u.label){case 0:return function(t){var e=t.store,r=M(e);g(r)}(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=u.sent())?[4,n.data()]:(console.warn("Cannot remove a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=u.sent(),i=gt(o,t,e),[4,n.ref.set(i)];case 3:return u.sent(),[2]}}))}))},gt=function(t,e,r){var n=e.hash;if(!n){var o=yt(e);n=V(o)}var i=c().store,u=r.store,a=null!=u?u:i,s=M(a),f=dt({},t),l=dt({},t.stores);if(void 0===l[s])return console.warn("StoreId given is invalid. There is no store with id "+s+" on the shopping cart."),t;var h=k(a,l),p=dt({},h.products);return p[n]?(delete p[n],h.products=p,Object.keys(h.products).length?l[s]=h:delete l[s],f.stores=l,f):(console.warn("Attempting to remove product that is not in the given shopping cart store."),t)},bt=function(){return(bt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wt=n,mt=x.transformers.toCartProduct,Ot=x.modifierUtils.multiplyProductQA,Pt=x.modifierUtils.divideProductQA,At=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i,u,a,s,c,f;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(l){switch(l.label){case 0:return r=null!==(f=null!==(s=e.amount)&&void 0!==s?s:null===(c=t)||void 0===c?void 0:c.amount)&&void 0!==f?f:1,n=bt(bt({},e),{amount:r}),D(n),o=e.shoppingCartName,[4,S(e,o)];case 1:return(i=l.sent())?[4,i.data()]:(console.warn("Cannot set product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return u=l.sent(),a=_t(u,t,n),[4,i.ref.set(a)];case 3:return l.sent(),[2]}}))}))},_t=function(t,e,r){var n,o,i=null!==(o=null===(n=e)||void 0===n?void 0:n.amount)&&void 0!==o?o:1,u=mt(e,bt(bt({},r),{amount:i})),a=c().store,s=r.store,f=null!=s?s:a,l=M(f),h=V(u),p=bt({},t),d=bt({},t.stores),y=k(f,d),v=bt({},y.products),g=v[h],b=j()().format(wt);v[h]=u,g?v[h]=Pt(v[h]):(v[h].createdAt=b,v[h].hash=h),v[h].updatedAt=b;var w=mt(v[h],r),m=(w=Ot(w)).questionsAndAnswers,O=J(m);return v[h]=bt(bt({},w),{questionsAndAnswers:O}),y.products=v,d[l]=y,p.stores=d,p},St=function(){return(St=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Et=function(t,e){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(u){switch(u.label){case 0:return function(t){var e=t.store,r=M(e);g(r)}(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=u.sent())?[4,n.data()]:(console.warn("Cannot replace product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=u.sent(),i=Tt(o,t,e),[4,n.ref.set(i)];case 3:return u.sent(),[2]}}))}))},Tt=function(t,e,r){var n=r.hash,o=null!=n?n:e.hash,i=c().store,u=r.store,a=null!=u?u:i,s=M(a),f=St({},t.stores),l=k(a,f),h=St({},l.products);if(!h[o])return console.warn("Cannot replace a product because no product was found in the given store"),t;delete h[o],l.products=h,Object.keys(l.products).length?f[s]=l:delete f[s];var p=St({},t);p.stores=f;var d=St(St({},e),{amount:0});return ut(p,d,r)},It=function(){return(It=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jt=o,xt=function(t,e){return void 0===t&&(t={}),function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i,u,a,s;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(f){switch(f.label){case 0:return[4,_(e)];case 1:return r=f.sent(),n=Rt(t),r?(o=n.name,[4,r.get()]):(console.warn("Couldn't find a shopping cart collection with the given config. Please make sure everything is correct in your configuration before continue."),[2]);case 2:if(i=null===(s=f.sent())||void 0===s?void 0:s.docs.length,u=c().maxShoppingCarts,i>=u)throw new Error("Cannot add more carts. Carts limit ("+u+") reached.");return[4,r.where("name","==",o).get()];case 3:if(f.sent().docs.length>0)throw new Error("Attempted to add a shopping cart with the name "+o+", but there is already one shopping cart with that name.");return[4,r.add(n)];case 4:return(a=f.sent())?[4,a.set(It(It({},n),{id:a.id}))]:(console.error("Failed to create a new shopping cart"),[2]);case 5:return f.sent(),[2]}}))}))},Rt=function(t){void 0===t&&(t={});var e=(new Date).toISOString();return It({id:"",name:jt,latitude:-1,longitude:-1,createdAt:e,updatedAt:e,channelId:1,stores:{},billTotal:{}},t)},Ct=function(){return(Ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bt=o,Mt=function(t,e){return void 0===t&&(t=Bt),function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(i){switch(i.label){case 0:return[4,S(e,t)];case 1:return(r=i.sent())?[4,r.data()]:(console.warn("Cannot empty cart, shopping cart nodes not found. Please ensure you have a shopping cart with name "+t+" before continue."),[2]);case 2:return n=i.sent(),o=Ct(Ct({},n),{stores:{}}),[4,r.ref.set(o)];case 3:return i.sent(),[2]}}))}))},kt=o,Dt=function(t,e){return void 0===t&&(t=kt),function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(n){switch(n.label){case 0:return[4,S(e,t)];case 1:return(r=n.sent())?[4,r.ref.delete()]:(console.warn("Coundn't find any shopping cart with name "+t+" with the given config."),[2]);case 2:return n.sent(),[2]}}))}))},Ut=r(5),Yt={"Content-Type":"application/json"},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},Ft=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},qt=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n,o,i,u,a,s,f,l,h,p,d,y,v;return Ft(this,(function(g){switch(g.label){case 0:return e=c().artisanApp.settings,r=e.platform,n=e.accountId,o=null!==(h=null!==(l=null===(f=null==t?void 0:t.account)||void 0===f?void 0:f.toString())&&void 0!==l?l:null==n?void 0:n.toString())&&void 0!==h?h:"",i=null!==(d=null!==(p=null==t?void 0:t.Platform)&&void 0!==p?p:r)&&void 0!==d?d:"",u=i,null===(y=null==t?void 0:t.Authorization)||void 0===y?[3,1]:(s=y,[3,3]);case 1:return[4,$t()];case 2:s=g.sent(),g.label=3;case 3:return a=null!==(v=s)&&void 0!==v?v:"",[2,new Headers(Lt(Lt(Lt({},Yt),t),{Authorization:a,Platform:u,account:o}))]}}))}))},$t=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n;return Ft(this,(function(o){switch(o.label){case 0:return e=c().artisanApp,[4,null===(n=Object(Ut.initAuth)(e).currentUser)||void 0===n?void 0:n.getIdToken(t)];case 1:return(r=o.sent())?[2,"Bearer "+r]:($("Please make sure you are authenticated before trying to call a restricted action."),[2])}}))}))},zt=function(){return(zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ht=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},Gt=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Wt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Vt=function(t,e){return Ht(void 0,void 0,void 0,(function(){var r,n,o,i,u,a,s,f,l,h;return Gt(this,(function(p){switch(p.label){case 0:return r=c().artisanApp.apiURL,n=t.id,o=t.latitude,i=t.longitude,[4,qt(zt({},e))];case 1:u=p.sent(),p.label=2;case 2:return p.trys.push([2,4,,5]),[4,fetch(r+"/api/shopping-cart/"+n+"/validateShoppingCart?latitude="+o+"&longitude="+i,{headers:u}).then((function(t){return Ht(void 0,void 0,void 0,(function(){return Gt(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(a=p.sent(),!(s=a.data))throw new Error("No shopping cart was found.");return f=Object.values(s.stores).reduce((function(t,e){return e.alerts.length?Wt(Wt([],t),e.alerts):t}),[]),l=Object.values(s.stores).some((function(t){return!!t.alerts.length||Object.values(t.products).some((function(t){return t.alerts.length}))})),[2,{stores:f,products:l}];case 4:return h=p.sent(),console.error(h.message),[2,{stores:[{errorLevel:1,message:"Occurrió un error desconocido, comuníquese con soporte",type:""}],products:!1}];case 5:return[2]}}))}))},Jt=function(t,e,r){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var n,o,i,u;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(a){switch(a.label){case 0:return function(t,e){!function(t,e){void 0===e&&(e="");var r=c().artisanApp.apiURL;if(void 0===t&&void 0===r)throw new Error("ApiURL must be defined. Either provide a global ApiURL or at the function call level. "+e)}(t.apiURL),m(e)}(t,e),n=null!=r?r:c().activeShoppingCart,[4,B(n)];case 1:return void 0===(o=a.sent())?(console.error("Cannot use undefined as a shopping cart id. Shopping cart "+n+" was not found. Validation canceled."),[2]):(i=t.latitude,u=t.longitude,[4,Vt({id:o,latitude:i,longitude:u},e)]);case 2:return[2,a.sent()]}}))}))},Kt=function(){return(Kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qt=function(t,e){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(u){switch(u.label){case 0:return[4,S({},e)];case 1:return(r=u.sent())?[4,r.data()]:(n=null!=e?e:c().activeShoppingCart,console.warn("Cannot set additional info because no shopping cart was found. Please ensure you create a shopping cart with name "+n+" before continue."),[2]);case 2:return o=u.sent(),i=Xt(o,t),[4,r.ref.set(i)];case 3:return u.sent(),[2]}}))}))},Xt=function(t,e){return Kt(Kt({},t),{additional_info:e(t.additional_info)})},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},te=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},ee=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},re=function(t){return void 0===t&&(t={}),Zt({benefits:[],usedBenefits:[],unusedBenefits:[]},t)},ne=function(t,e){var r,n=c().wallets,o=Zt(Zt({},n),((r={})[t]=Zt({},e),r));s({wallets:o})},oe=function(t){return void 0===t&&(t={}),te(void 0,void 0,void 0,(function(){var e,r,n,o,i,u,a,s,f;return ee(this,(function(l){switch(l.label){case 0:return e=c(),r=e.artisanApp,n=e.customerId,o=e.accountId,i=t.accountId,u=t.customerId,d(),b(t),a=null==r?void 0:r.__internals__.firestore(),[4,null===(f=null===(s=null==a?void 0:a.collection("benefitsByUser"))||void 0===s?void 0:s.doc(String(null!=u?u:n)))||void 0===f?void 0:f.collection(String(null!=i?i:o))];case 1:return[2,l.sent()]}}))}))},ie=function(t){return te(void 0,void 0,void 0,(function(){var e;return ee(this,(function(r){switch(r.label){case 0:return[4,oe(t)];case 1:return(e=r.sent())?[4,e.get().then((function(t){return t.docs[0]}))]:[2,void 0];case 2:return[2,r.sent()]}}))}))},ue=function(t){return te(void 0,void 0,void 0,(function(){var e,r;return ee(this,(function(n){switch(n.label){case 0:return[4,ie(t)];case 1:return(e=n.sent())?0===Object.keys(e.data()).length?[2,[]]:(r=e.id,[2,Object.values(e.data()).map((function(t){return Zt(Zt({},t),{hash:r})}))]):[2]}}))}))},ae=function(){return(ae=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},se=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},ce=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},fe=function(t,e){return se(void 0,void 0,void 0,(function(){var r,n,o,i,u;return ce(this,(function(a){switch(a.label){case 0:return r=c().artisanApp.apiURL,n=t.vendorId,o=t.customerId,[4,qt(ae(ae({},e),{uid:o.toString()}))];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,fetch(r+"/api/shopping-cart/retrieveBenefits?vendorId="+n,{headers:i}).then((function(t){return se(void 0,void 0,void 0,(function(){return ce(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(!a.sent())throw new Error("The benefits wallet is not defined. Make sure coupons arewell configured");return[3,5];case 4:throw u=a.sent(),Error(u.message);case 5:return[2]}}))}))},le=function(t,e,r){return se(void 0,void 0,void 0,(function(){var n,o,i,u,a,s;return ce(this,(function(f){switch(f.label){case 0:return n=c().artisanApp.apiURL,o=t.customerId,[4,qt(ae(ae({},r),{uid:o.toString()}))];case 1:i=f.sent(),f.label=2;case 2:return f.trys.push([2,4,,5]),[4,fetch(n+"/api/wallet_profit/apply",{method:"post",body:JSON.stringify({code:e}),headers:i}).then((function(t){return se(void 0,void 0,void 0,(function(){return ce(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(u=f.sent(),200===(a=u).code)return[2,!0];if(null===a.data||!a.data)throw new Error(a.message);return $("Unhandled response when redeeming coupon "+JSON.stringify(a,void 0,2)),[2,!1];case 4:throw s=f.sent(),new Error("Failed to redeem coupon "+e+". "+s.message);case 5:return[2]}}))}))},he=function(){return(he=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pe=function(t,e,r,n){w(e);var o=c().customerId,i=c(),u=i.activeShoppingCart,a=i.wallets,f=null!=r?r:u,l=a[f],h=e.customerId,p=null!=h?h:o;return l?($("There is already a listener for wallet of name "+f+". Either unsubscribe to the other listener or create a new listener for a different cart"),function(){return de(f)}):(function(t,e,r,n){new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,o,i,u,c;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(l){switch(l.label){case 0:r=he(he({},e),{customerId:p}),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,fe(r,n)];case 2:return l.sent(),[3,4];case 3:return l.sent(),[2,function(){return de(f)}];case 4:return[4,ue()];case 5:return(o=l.sent())?(i={benefits:o,unusedBenefits:o,usedBenefits:[]},u=he(he({},a),((c={})[f]=he(he({},i),{callback:t}),c)),s({wallets:u}),t(i),[2]):[2,function(){return de(f)}]}}))})),function(){return de(f)})},de=function(t){var e=c().wallets,r=he({},e);delete r[t],s({wallets:r})},ye=function(){return(ye=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ve=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},ge=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},be=function(t,e,r,n){w(e),m(n);var o=c().customerId,i=c(),u=i.activeShoppingCart,a=i.wallets,s=null!=r?r:u,f=a[s],l=e.customerId,h=null!=l?l:o;if(f)return $("There is already a listener for wallet of name "+s+". Either unsubscribe to the other listener or create a new listener for a different cart"),function(){return we(s)};var p=re();ne(s,ye(ye({},p),{callback:t}));var d=void 0;return ve(void 0,void 0,void 0,(function(){var r,o;return ge(this,(function(i){switch(i.label){case 0:r=ye(ye({},e),{customerId:h}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,fe(r,n)];case 2:return i.sent(),[3,4];case 3:return i.sent(),console.error("Failed to retrieve the user's wallet"),[2];case 4:return[4,oe(e)];case 5:return(o=i.sent())?(d=o.onSnapshot((function(e){return ve(void 0,void 0,void 0,(function(){var r,n,o,i,u,a,c;return ge(this,(function(f){return r=null!==(c=null===(a=e.docs[0])||void 0===a?void 0:a.data())&&void 0!==c?c:{},0===Object.keys(r).length?(n=re(),ne(s,ye(ye({},n),{callback:t})),t(n),[2]):(o=e.docs[0].id,i=function(t,e){return Object.values(t).map((function(t){return Zt(Zt({},t),{hash:e})}))}(r,o),u=re({benefits:i,unusedBenefits:i}),ne(s,ye(ye({},u),{callback:t})),t(u),[2])}))}))})),[2]):(console.error("Failed to retrieve the benefits wallet node"),[2])}}))})),function(){return we(s,d)}},we=function(t,e){var r=c().wallets,n=ye({},r);delete n[t],s({wallets:n}),e&&e()},me=function(){return(me=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Oe=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Pe=function(t,e,r){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var n,o,i,u,a,f,l,h,p,d,y,v,g,w,O;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(P){switch(P.label){case 0:if(n=c().customerId,b(t),m(r),o=c(),i=o.activeShoppingCart,u=o.wallets,!(f=u[a=null!=e?e:i]))return $("No benefits wallet available for "+a+", you probably forgot to call listenBenefitsWallet beforehand."),[2];l=f.usedBenefits,h=t.customerId,p=null!=h?h:n,d=me(me({},t),{customerId:p}),y=l.map((function(t){var e=t.hash,n=t.benefitId;return function(t,e){return se(void 0,void 0,void 0,(function(){var r,n,o,i,u,a,s,f;return ce(this,(function(l){switch(l.label){case 0:return r=t.benefitId,n=t.benefitHash,o=t.shoppingCartId,i=t.customerId,u=c().artisanApp.apiURL,[4,qt(ae(ae({},e),{uid:i.toString()}))];case 1:return a=l.sent(),s={benefitId:r,shoppingCartId:o},[4,fetch(u+"/api/shopping-cart/benefitsByUser/"+n+"/applyBenefit",{method:"post",body:JSON.stringify(s),headers:a}).then((function(t){return se(void 0,void 0,void 0,(function(){return ce(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 2:if((f=l.sent()).benefits){if(Object.keys(null==f?void 0:f.benefits).length>0)return[2,f];if(0===Object.keys(null==f?void 0:f.benefits).length)throw Error("No benefits were applied to the current shopping cart")}if(200!==(null==f?void 0:f.code))throw Error(f.message);return[2]}}))}))}(me(me({},d),{benefitId:n,benefitHash:e}),r)})),P.label=1;case 1:return P.trys.push([1,3,,4]),[4,Promise.all(y)];case 2:return P.sent(),[3,4];case 3:throw v=P.sent(),Error(v.message);case 4:return g={benefits:Oe([],f.unusedBenefits),unusedBenefits:Oe([],f.unusedBenefits),usedBenefits:[],callback:f.callback},w=me(me({},u),((O={})[a]=g,O)),s({wallets:w}),f.callback(g),[2]}}))}))},Ae=function(){return(Ae=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_e=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Se=function(t,e,r,n){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var o,i,u,a,f,l,h,p,d,y,v,g,w,O;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(P){switch(P.label){case 0:return o=c().customerId,b(t),m(n),i=c(),u=i.activeShoppingCart,a=i.wallets,(l=a[f=null!=r?r:u])||$("No benefits wallet available for "+f+", you probably forgot to call listenBenefitsWallet beforehand."),h=t.customerId,p=null!=h?h:o,d=Ae(Ae({},t),{customerId:p}),[4,le(d,e,n)];case 1:if(!P.sent())return[2];P.label=2;case 2:return P.trys.push([2,4,,5]),[4,fe(d,n)];case 3:return P.sent(),[3,5];case 4:return P.sent(),console.error("Failed to retrieve the user's wallet after redeeming coupon"),[2];case 5:return[4,ue()];case 6:if(!(y=P.sent()))throw new Error("Failed to fetch benefits from ArtisanDB for the current customer after redeeming coupon");return v=re({benefits:y,unusedBenefits:y,usedBenefits:[]}),g={benefits:_e([],v.benefits),unusedBenefits:_e(_e([],l.unusedBenefits),v.unusedBenefits),usedBenefits:_e(_e([],l.usedBenefits),v.usedBenefits),callback:l.callback},w=Ae(Ae({},a),((O={})[f]=g,O)),s({wallets:w}),l.callback(v),[2]}}))}))},Ee=function(){return(Ee=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Te=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Ie=function(t,e){var r,n=c(),o=n.activeShoppingCart,i=n.wallets,u=null!=e?e:o,a=i[u],f=t.benefitId;if(a){var l=a.benefits.find((function(t){return t.benefitId===f}));if(l){var h=a.unusedBenefits.filter((function(t){return t.benefitId!==f})),p=Ee(Ee({},a),{unusedBenefits:h,usedBenefits:Te(Te([],a.usedBenefits),[l])}),d=Ee(Ee({},p),{callback:a.callback}),y=Ee(Ee({},i),((r={})[u]=d,r));s({wallets:y}),a.callback(p)}else $("There is no benefit to apply with the id "+f+" on the current cart. This might indicate something bad configured.")}else $("No benefits wallet available for "+u+", you probably forgot to call listenBenefitsWallet beforehand.")},je=function(){return(je=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xe=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Re=function(t,e){var r,n=c(),o=n.activeShoppingCart,i=n.wallets,u=null!=e?e:o,a=i[u],f=t.benefitId;if(a){var l=a.benefits.find((function(t){return t.benefitId===f}));if(l){var h=a.usedBenefits.filter((function(t){return t.benefitId!==f})),p=je(je({},a),{unusedBenefits:xe(xe([],a.unusedBenefits),[l]),usedBenefits:h}),d=je(je({},p),{callback:a.callback}),y=je(je({},i),((r={})[u]=d,r));s({wallets:y}),a.callback(p)}else $("There is no benefit to unuse with the id "+f+" on the current cart. This might indicate something bad configured.")}else $("No benefits wallet available for "+u+", you probably forgot to call listenBenefitsWallet beforehand.")}}])},function(t,e,r){"use strict";t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=32)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return a})),r.d(e,"setState",(function(){return u}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},u=function(t){o=n(n({},o),t)},a=function(){return n({},o)}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return a})),r.d(e,"setState",(function(){return u}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},u=function(t){o=n(n({},o),t)},a=function(){return n({},o)}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,u;n=r(8),o=r(1).utf8,i=r(1).bin,(u=function(t,r){var u=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,u=[],a=1732584193,s=-271733879,c=-1732584194,f=271733878,l=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var h=0;h<r.length;h+=16){for(var p=a,d=s,y=c,v=f,g=l,b=0;b<80;b++){if(b<16)u[b]=r[h+b];else{var w=u[b-3]^u[b-8]^u[b-14]^u[b-16];u[b]=w<<1|w>>>31}var m=(a<<5|a>>>27)+l+(u[b]>>>0)+(b<20?1518500249+(s&c|~s&f):b<40?1859775393+(s^c^f):b<60?(s&c|s&f|c&f)-1894007588:(s^c^f)-899497514);l=f,f=c,c=s<<30|s>>>2,s=a,a=m}a+=p,s+=d,c+=y,f+=v,l+=g}return[a,s,c,f,l]}(t));return r&&r.asBytes?u:r&&r.asString?i.bytesToString(u):n.bytesToHex(u)})._blocksize=16,u._digestsize=20,t.exports=u}).call(this,r(3).Buffer)},function(t,e,r){(function(t){
42
+ /*!
43
+ * The buffer module from node.js, for the browser.
44
+ *
45
+ * @author Feross Aboukhadijeh <http://feross.org>
46
+ * @license MIT
47
+ */
48
+ var n=r(5),o=r(6),i=r(7);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=h(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(s.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}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,e){if(f(e),t=a(t,e<0?0:0|p(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[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,e){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 r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,u=1,a=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}function c(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-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(r+s>a&&(r=a-s),i=r;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(c(t,i+h)!==c(e,h)){l=!1;break}if(l)return i}return-1}function w(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.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(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function O(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return O(t,e,r,n)}function A(t,e,r,n){return q(F(e),t,r,n)}function _(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)n=(r=t.charCodeAt(u))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=r)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 e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function T(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function k(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||k(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return i||k(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.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}}(),e.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return c(null,t,e,r)},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,e,r){return function(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},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,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?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,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var u=t[r];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 e=0;e<t;e+=2)v(this,e,e+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 e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+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 e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(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="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),a=Math.min(i,u),c=this.slice(n,o),f=t.slice(e,r),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,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return O(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);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)}},s.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=s.prototype;else{var o=e-t;r=new s(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},s.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,u=1,a=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,u=1,a=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=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(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var u=s.isBuffer(t)?t:N(new s(t,n).toString()),a=u.length;for(i=0;i<r-e;++i)this[i+e]=u[i%a]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|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,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(4))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),u=n[0],a=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,u,a)),f=0,l=a>0?u-4:u;for(r=0;r<l;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=255&e;return 2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,s[f++]=255&e),1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,s[f++]=e>>8&255,s[f++]=255&e),s},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],u=0,a=r-o;u<a;u+=16383)i.push(f(t,u,u+16383>a?a:u+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),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 e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var o,i,u=[],a=e;a<r;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,e){
49
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
50
+ e.read=function(t,e,r,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[e+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)},e.write=function(t,e,r,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=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),(e+=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=(e*s-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[r+p]=255&u,p+=d,u/=256,c-=8);t[r+p-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],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?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){r.r(e),r.d(e,"handleHttpCache",(function(){return l})),r.d(e,"transformResponse",(function(){return s}));var n=r(0),o=r(2),i=r.n(o),u=["vendorId","storeId","catalogueId","categoryId","productId"],a=["accountId"],s=function(t,e,r){var n,o=null==e?void 0:e.message;try{o=e?JSON.parse(e.message):e}catch(t){}return{data:null!==(n=null==t?void 0:t.data)&&void 0!==n?n:t,hints:c(r),config:r,error:o,pagination:{hasMorePages:null==t?void 0:t.hasMorePages,page:null==t?void 0:t.page}}},c=function(t){var e={};return Object.entries(t.query).forEach((function(t){var r=t,n=r[0],o=r[1];u.includes(n)&&(e[n]=o)})),Object.entries(t.headers).forEach((function(t){var r=t,n=r[0],o=r[1];a.includes(n)&&(e[n]=o)})),e},f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{u(n.next(t))}catch(t){e(t)}}function i(t){try{u(n.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}u((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var r,o,u,a,c,l;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(h){switch(h.label){case 0:if(d=t.url,r=i()(d),o=function(t){return Object(n.getState)().apiCache[t]}(r),p=Object(n.getState)().expiresAt,(u=(new Date).getTime()>=p)&&function(){var t=Object(n.getState)().timeout,e=void 0===t?0:t;Object(n.setState)({apiCache:{},expiresAt:(new Date).getTime()+e})}(),o&&!u)return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,e(t)];case 2:return a=h.sent(),l=s(a,void 0,t),function(t,e){var r,o=Object(n.getState)().apiCache,i=f(f({},o),((r={})[t]=e,r));Object(n.setState)({apiCache:i})}(r,l),[2,l];case 3:return c=h.sent(),[2,l=s(void 0,c,t)];case 4:return[2,o]}var p,d}))}))},h=3e5,p={artisanApp:void 0,apiCache:{},expiresAt:(new Date).getTime()+h,timeout:h};Object(n.initState)(p)}])},function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(6),e),o(r(7),e),o(r(8),e),o(r(9),e),o(r(10),e),o(r(11),e),o(r(12),e),o(r(13),e),o(r(14),e),o(r(15),e),o(r(16),e),o(r(17),e),o(r(18),e),o(r(19),e),o(r(20),e),o(r(21),e),o(r(22),e),o(r(23),e),o(r(24),e)},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,u;n=r(30),o=r(3).utf8,i=r(3).bin,(u=function(t,r){var u=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,u=[],a=1732584193,s=-271733879,c=-1732584194,f=271733878,l=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var h=0;h<r.length;h+=16){for(var p=a,d=s,y=c,v=f,g=l,b=0;b<80;b++){if(b<16)u[b]=r[h+b];else{var w=u[b-3]^u[b-8]^u[b-14]^u[b-16];u[b]=w<<1|w>>>31}var m=(a<<5|a>>>27)+l+(u[b]>>>0)+(b<20?1518500249+(s&c|~s&f):b<40?1859775393+(s^c^f):b<60?(s&c|s&f|c&f)-1894007588:(s^c^f)-899497514);l=f,f=c,c=s<<30|s>>>2,s=a,a=m}a+=p,s+=d,c+=y,f+=v,l+=g}return[a,s,c,f,l]}(t));return r&&r.asBytes?u:r&&r.asString?i.bytesToString(u):n.bytesToHex(u)})._blocksize=16,u._digestsize=20,t.exports=u}).call(this,r(25).Buffer)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.DayOfWeekName=e.TaxType=e.PriceCategoryType=e.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(e.ProductType||(e.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(e.PriceCategoryType||(e.PriceCategoryType={})),function(t){t.IVA="IVA"}(e.TaxType||(e.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(e.DayOfWeekName||(e.DayOfWeekName={}))},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceStatus=e.Days=e.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(e.DeliveryTimeUnit||(e.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"}(e.Days||(e.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(e.ServiceStatus||(e.ServiceStatus={}))},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.Gender=e.MaritalStatus=void 0,function(t){t.MARRIED="MARRIED",t.DIVORCED="DIVORCED",t.SINGLE="SINGLE"}(e.MaritalStatus||(e.MaritalStatus={})),function(t){t.MALE="MALE",t.FEMALE="FEMALE"}(e.Gender||(e.Gender={}))},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){(function(t){
51
+ /*!
52
+ * The buffer module from node.js, for the browser.
53
+ *
54
+ * @author Feross Aboukhadijeh <http://feross.org>
55
+ * @license MIT
56
+ */
57
+ var n=r(27),o=r(28),i=r(29);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=h(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(s.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}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,e){if(f(e),t=a(t,e<0?0:0|p(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[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,e){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 r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,u=1,a=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}function c(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-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(r+s>a&&(r=a-s),i=r;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(c(t,i+h)!==c(e,h)){l=!1;break}if(l)return i}return-1}function w(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.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(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function O(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return O(t,e,r,n)}function A(t,e,r,n){return q(F(e),t,r,n)}function _(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)n=(r=t.charCodeAt(u))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=r)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 e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function T(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function k(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||k(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return i||k(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.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}}(),e.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return c(null,t,e,r)},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,e,r){return function(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},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,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?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,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var u=t[r];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 e=0;e<t;e+=2)v(this,e,e+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 e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+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 e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(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="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),a=Math.min(i,u),c=this.slice(n,o),f=t.slice(e,r),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,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return O(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);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)}},s.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=s.prototype;else{var o=e-t;r=new s(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},s.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,u=1,a=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,u=1,a=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=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(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var u=s.isBuffer(t)?t:N(new s(t,n).toString()),a=u.length;for(i=0;i<r-e;++i)this[i+e]=u[i%a]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|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,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(26))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),u=n[0],a=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,u,a)),f=0,l=a>0?u-4:u;for(r=0;r<l;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=255&e;return 2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,s[f++]=255&e),1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,s[f++]=e>>8&255,s[f++]=255&e),s},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],u=0,a=r-o;u<a;u+=16383)i.push(f(t,u,u+16383>a?a:u+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),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 e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var o,i,u=[],a=e;a<r;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,e){
58
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
59
+ e.read=function(t,e,r,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[e+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)},e.write=function(t,e,r,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=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),(e+=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=(e*s-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[r+p]=255&u,p+=d,u/=256,c-=8);t[r+p-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],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?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){r.r(e),r.d(e,"getCategories",(function(){return q})),r.d(e,"getProductDetails",(function(){return St})),r.d(e,"getProducts",(function(){return jt})),r.d(e,"getRecommendedProducts",(function(){return xt})),r.d(e,"getRelatedProducts",(function(){return Rt})),r.d(e,"getStoreDetails",(function(){return kt})),r.d(e,"registerModifiersForm",(function(){return ne})),r.d(e,"validateProduct",(function(){return ae})),r.d(e,"initProducts",(function(){return he})),r.d(e,"getProductTotals",(function(){return pe})),r.d(e,"transformers",(function(){return i})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return s})),r.d(n,"isProductDetails",(function(){return c})),r.d(n,"isCartProduct",(function(){return f})),r.d(n,"isFormCartProduct",(function(){return l}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return m})),r.d(o,"divideProductQA",(function(){return O})),r.d(o,"operationOnProductQA",(function(){return P}));var i={};r.r(i),r.d(i,"toCartProduct",(function(){return _})),r.d(i,"toFormCartProduct",(function(){return T})),r.d(i,"toFormCartProductHelper",(function(){return I})),r.d(i,"toFormCartProductFromProductDetails",(function(){return j})),r.d(i,"toFormCartProductFromAnswer",(function(){return x})),r.d(i,"normalizeProductDetails",(function(){return R}));var u=r(2),a=function(t){console.error(t)},s=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,i=t.prices,u=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof u&&!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)},c=function(t){if(!s(t))return!1;var e=t.questions;return!!Array.isArray(e)},f=function(t){if(!c(t))return!1;var e,r=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,a=t.priceCategory,s=t.comment,f=t.questionsAndAnswers;return"string"==typeof r&&"string"==typeof n&&"string"==typeof o&&"number"==typeof i&&"string"==typeof s&&!!(e=u.PriceCategoryType,Object.keys(e)).includes(a)&&!!Array.isArray(f)},l=function(t){var e;if(!f(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},h=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},p=function(t,e,r){var n=[],o=t.max,i=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},d=function(t,e){var r=[],n=t.modifiers,o=t.data,i=o.min,u=o.max;0===i&&0===u&&(u=1/0);var a=n.reduce((function(t,e){return t+e.amount}),0);return a>u&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+u}),e&&a<i&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),r},y=function(t){var e=t.touched,r=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,e){return t+e.amount}),0);return g({touched:e,errors:r,required:n,min:u,amount:f,childrenWithError:a,childrenIdle:s,childrenIncomplete:c,reviewChildren:!0})},v=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=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 g({touched:o,errors:i,required:u,min:a,amount:s,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:s>0})},g=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,i=t.amount,u=t.reviewChildren,s=t.childrenWithError,c=t.childrenIdle,f=t.childrenIncomplete,l=i>0&&!e;return l||e||!n?l||e||n?r.length||u&&s?"FAIL":u&&(c||f)||i<o?"INCOMPLETE":i>=o?"OK":(a("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},b=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},w=function(){return(w=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},m=function(t){return P(t,(function(t,e){var r=t.amount*e,n=m(w(w({},t),{amount:r}));return w(w({},n),{amount:t.amount*e})}))},O=function(t){return P(t,(function(t,e){var r=O(t);return w(w({},r),{amount:t.amount/e})}))},P=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return w(w({},t),{answers:r})}));return w(w({},t),{questionsAndAnswers:i})},A=function(){return(A=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_=function(t,e){if(void 0===e&&(e={}),f(t))return A(A({},t),e);if(c(t))return S(t,e);var r=E(t);return S(r,e)},S=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,i=r.amount;return A(A(A({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:u.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},E=function(t,e){return void 0===e&&(e={}),A(A(A({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},T=function(t,e){if(void 0===e&&(e={}),l(t))return A(A({},t),e);if(c(t))return j(t,e);var r=E(t);return j(r,e)},I=function(t,e){void 0===e&&(e={});var r=O(t),n=r.priceCategory,o=r.productId,i=r.amount,u=r.questions.map((function(t){var e,u=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),a=null!=u?u:t,s=a.questionId,c=a.min,f=a.max,l={rootId:o,min:c,max:f,type:h(a),modifiersCount:t.answers.length,amount:i,path:[]};return A(A({},a),{answers:t.answers.map((function(t){var e,r=null==u?void 0:u.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,i=function(t){return 1===t.modifiersCount?t.min:0}(l),a=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(l),c=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:i,max:a,groupType:l.type,type:o.renderType}),f=o.questions.length,h=A(A({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:s,min:i,max:a,renderType:c});return A(A({},h),{questions:f?I(h).questions:[]})}))})}));return A(A(A({},r),{questions:u}),e)},j=function(t,e){void 0===e&&(e={});var r=S(t);return I(r,e)},x=function(t,e){return void 0===e&&(e={}),I(t,e)},R=function(t){var e=t.questions;return A(A({},t),{questions:e.map((function(t){var e=t.answers;return A(A({},t),{answers:e.map((function(t){var e=t.questions;return A(A({},t),{questions:null!=e?e:[]})}))})}))})},C=r(0),B=["vendorId","storeId","catalogueId","categoryId","productId"],M=["category"],k=["type","method"],D=["alphabetic","price","predefined"],U=["asc","desc"],Y=["page","vendor","store","catalogue","category","product"],L=["price","query","tags","manufacturerId","weight","dimensions"],N=3e5,F={artisanApp:void 0,timeout:N,apiCache:{},expiresAt:(new Date).getTime()+N,forms:{}},q=function(){console.log("Not supported yet")},$=function(){return($=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},z=Y,H=L,G=k,W=B,V=M,J=U,K=D,Q=function(t){var e=X(t),r=Z(e),n=tt(r),o=et(n);return rt(o)},X=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=$($({},{vendorId:r,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),c=nt(s,W,"filter"),f=it(c);return $($({},t),{filterBy:f})},Z=function(t){var e=ot(t,V,"groupBy");return $({},e)},tt=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=nt(r,G,"orderBy"),o=$({},n),i=r.method,u=r.type;return u&&!K.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),K.includes(u)||(delete o.type,o.type="predefined"),i&&!J.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),J.includes(i)||(delete o.method,o.method="asc"),$($({},t),{orderBy:o})},et=function(t){var e=t.pagination,r=nt(void 0===e?{}:e,z,"pagination"),n=$({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,$($({},t),{pagination:n})},rt=function(t){var e=t.additionalFilters,r=nt(void 0===e?{}:e,H,"additionalFilters");return $($({},t),{additionalFilters:r})},nt=function(t,e,r){var n=$({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},ot=function(t,e,r){var n=$({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},it=function(t){var e=$({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&ut(n[0])||ut(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},ut=function(t){var e=typeof t;return"number"===e||"string"===e},at=(r(4),function(){return(at=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),st=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,u=i.vendorId,a=i.storeId,s=i.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(a,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(s,r)}(e=Q(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,i=e.additionalFilters,u=e.orderBy,a=e.pagination,s=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],u=i;return Array.isArray(i)&&(u=i.reduce((function(t,e){return t+","+e}))),at(at({},t),"catalogueId"===o?((r={})[o]=u,r.channelId=u,r):((n={})[o]=u,n))}),{})}(n),c=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(u),f=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?at(at({},t),((r={})[n]=o,r)):t}),{})}(i),l=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],i=void 0===n?{}:n;return"page"===r?at(at({},t),{page:i}):"product"===r?at(at({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===r?at(at({},t),{size:i.size}):t}),{})}(a),h=at(at(at(at(at({},s),{groupBy:o}),c),f),l);o||delete h.groupBy;var p=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var i=o[n],u=i[0],a=i[1],s=new RegExp("/:"+u,"g");r=r.replace(s,"/"+a)}return r}(t,r.params),d=Object(C.getState)().artisanApp,y=(null!=d?d:{}).apiURL,v=Object.entries(h).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),y+"/"+p+"?");return at(at({},r),{url:v,query:h})}(t,e,r)},ct=function(t){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e,r,n,o,i,u;return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(a){switch(a.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(e,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]}}))}))},ft=function(t){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return[4,ct(t)];case 1:return[2,e.sent()]}}))}))},lt=r(5),ht=function(){return(ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pt=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},dt=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},yt={"Content-Type":"application/json"},vt=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),pt(void 0,void 0,void 0,(function(){var r,n,o,i,u,a,s,c,f,l,h,p,d,y,v,g;return dt(this,(function(b){switch(b.label){case 0:return r=Object(C.getState)().artisanApp,n=r.settings,o=n.platform,i=n.accountId,u=null!==(p=null!==(h=null===(l=e.account)||void 0===l?void 0:l.toString())&&void 0!==h?h:null==i?void 0:i.toString())&&void 0!==p?p:"",a=null!==(y=null!==(d=e.Platform)&&void 0!==d?d:o)&&void 0!==y?y:"",s=a,null===(v=e.Authorization)||void 0===v?[3,1]:(f=v,[3,3]);case 1:return[4,gt(t)];case 2:f=b.sent(),b.label=3;case 3:return c=null!==(g=f)&&void 0!==g?g:"",[2,new Headers(ht(ht(ht({},yt),e),{Authorization:c,Platform:s,account:u}))]}}))}))},gt=function(t,e){return void 0===t&&(t=!0),pt(void 0,void 0,void 0,(function(){var r,n,o;return dt(this,(function(i){switch(i.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(lt.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=i.sent())||t?!n&&t?(a("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},bt=r(1),wt=function(){return(wt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mt=function(t,e){var r=Q(e).pagination,n=t.pagination;return wt(wt({},t),{pagination:Ot(r,n)})},Ot=function(t,e){return wt(wt({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},Pt=function(){return(Pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},At=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},_t=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},St=function(t,e){return At(void 0,void 0,void 0,(function(){var r,n,o;return _t(this,(function(i){switch(i.label){case 0:return[4,vt(!1)];case 1:return r=i.sent(),n=st("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(bt.handleHttpCache)(n,(function(t){return At(void 0,void 0,void 0,(function(){var e,r;return _t(this,(function(n){switch(n.label){case 0:return[4,ft(t)];case 1:return e=n.sent(),r=R(e.data),[2,Pt(Pt({},e),{data:r})]}}))}))}))];case 2:return o=i.sent(),[2,mt(o,e)]}}))}))},Et=function(t){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return[4,ct(t)];case 1:return[2,e.sent()]}}))}))},Tt=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},It=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},jt=function(t){return Tt(void 0,void 0,void 0,(function(){var e,r,n;return It(this,(function(o){switch(o.label){case 0:return[4,vt(!1)];case 1:return e=o.sent(),r=st("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(bt.handleHttpCache)(r,(function(t){return Tt(void 0,void 0,void 0,(function(){return It(this,(function(e){switch(e.label){case 0:return[4,Et(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,mt(n,t)]}}))}))},xt=function(){console.log("Not implemented yet")},Rt=function(){console.log("not implemented yet")},Ct=function(t){return function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return[4,ct(t)];case 1:return[2,e.sent()]}}))}))},Bt=function(t,e,r,n){return new(r||(r=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 e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,a)}s((n=n.apply(t,e||[])).next())}))},Mt=function(t,e){var r,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(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=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=(o=u.trys).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=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},kt=function(t){return Bt(void 0,void 0,void 0,(function(){var e,r,n;return Mt(this,(function(o){switch(o.label){case 0:return[4,vt(!1)];case 1:return e=o.sent(),r=st("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(bt.handleHttpCache)(r,(function(t){return Bt(void 0,void 0,void 0,(function(){return Mt(this,(function(e){switch(e.label){case 0:return[4,Ct(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,mt(n,t)]}}))}))},Dt=function(){return(Dt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ut=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Yt=function(t,e){for(var r=Ut([],e),n=t,o=t[0];r.length;)o=Nt(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Lt=function(t,e,r){for(var n=Ut([],e),o=t,i=Nt(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Nt(o,n[0]),n=n.slice(1),u=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=Ut([],u?i.modifiers:i.groups);var a=n[0];if(1===e.length&&(i={groups:t},u=!1),u){var s=i.modifiers.map((function(t){return t.id===a?Dt({},r):Dt({},t)}));i.modifiers=s}else{var c=i.groups.map((function(t){return t.id===a?Dt({},r):Dt({},t)}));i.groups=c}return 1===e.length?Ut([],i.groups):Ut([],t)},Nt=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Ft=function(){return(Ft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},$t=function(t,e,r,n,o){var i=Ft(Ft({},r),{amount:n,touched:!0,errors:p(r,n,o),totals:pe(Ft(Ft({},r.data),{amount:n})),data:Ft(Ft({},r.data),{amount:n})});return i.status=v(i),Lt(t,e,i)},zt=function(t,e,r,n){var o=r.slice(0,-1),i=Yt(e,o),u=qt([],i.modifiers);"RADIO"!==i.type||n||(u=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Ft({},t):Ft(Ft({},t),{amount:0,error:"",totals:pe(Ft(Ft({},t.data),{amount:0})),data:Ft(Ft({},t.data),{amount:0})})})));var a=(u=u.map((function(e){var o=x(e.data),i=qt(qt([],r.slice(0,-1)),[e.id]),u=Ft(Ft({},e),{groups:Jt(o,{rootId:t,path:i},e.groups)});return u.errors=p(u,u.amount,n),u.status=v(u),u}))).map((function(t){return Ft({},t.data)})),s=Ft(Ft({},i.data),{answers:a}),c=Ft(Ft({},i),{touched:!0,modifiers:u,data:s});c.errors=d(c,n),c.status=y(c);var f=Lt(e,o,c);return o.length>1&&(f=Ht(t,f,o,n)),f},Ht=function(t,e,r,n){var o=r.slice(0,-1),i=Yt(e,o),u=i.groups.map((function(t){return Ft({},t.data)})),a=Ft(Ft({},i.data),{questions:u}),s=i.groups.map((function(t){var e=Ft({},t);return e.errors=d(e,n),e.status=y(e),e})),c=Ft(Ft({},i),{touched:!0,groups:s,data:a});c.errors=p(c,c.amount,n),c.status=v(c);var f=Lt(e,o,c);return o.length>1&&(f=zt(t,f,o,n)),f},Gt=function(){return(Gt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wt=function(){return(Wt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Jt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var i=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return Kt(e,{amount:t.amount,rootId:n,path:Vt([],o)},i)}))},Kt=function(t,e,r){var n=t.questionId,o=t.name,i=t.description,u=t.max,a=t.min,s=t.images,c=e.amount,f=e.rootId,l=e.path,p=null!=r?r:{},d=p.errors,v=p.touched,g={id:n,name:o,description:null!=i?i:"",images:Vt([],null!=s?s:[]),data:Wt({},t),errors:null!=d?d:[],touched:null!=v&&v,status:"IDLE",hidden:c<1,required:a>0,type:h(t)},b={rootId:f,max:u,min:a,type:g.type,modifiersCount:t.answers.length,amount:c,path:Vt(Vt([],l),[n])},w=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return Qt(t,b,e)})),m=Wt(Wt({},g),{modifiers:w});return Wt(Wt({},m),{status:y(m)})},Qt=function(t,e,r){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,p=x(t),d=e.rootId,y=e.path,g=Vt(Vt([],y),[i]),w=Jt(p,{rootId:d,path:g},null==r?void 0:r.groups),m={id:i,groupId:u,name:a,images:Vt([],s),amount:c,data:Wt({},t),groups:w,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:l,max:h,required:l>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:pe(Wt(Wt({},t),{amount:c})),type:f,handleChange:function(t){!function(t,e,r){var n,o=Gt({},Object(C.getState)().forms),i=o[t],u=Yt(i.renderer,e),a=$t(i.renderer,e,u,r,!1);a=zt(t,a,e,!1);var s=Zt(a,i.product),c=Gt(Gt({},i),{renderer:a,product:s,status:b(a)}),f=Gt(Gt({},o),((n={})[t]=c,n));Object(C.setState)({forms:f});var l=Gt({},c);delete l.callback,i.callback(l)}(e.rootId,g,t)}};return Wt(Wt({},m),{status:v(m)})},Xt=function(){return(Xt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zt=function(t,e){var r=_(e);return Xt(Xt({},r),{questionsAndAnswers:te(t),updatedAt:""})},te=function(t){return t.map((function(t){return Xt(Xt({},t.data),{answers:ee(t.modifiers)})}))},ee=function(t){return t.map((function(t){return t.amount?Xt(Xt({},t.data),{questionsAndAnswers:te(t.groups)}):Xt(Xt({},t.data),{questionsAndAnswers:[]})}))},re=function(){return(re=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ne=function(t,e){var r,n=t.productId,o=Object(C.getState)().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 e,r=T(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=Jt(r,{rootId:r.productId,path:[]});return{product:Zt(n,t),renderer:n,validate:function(){return ae(t.productId)},status:b(n)}}(t),u=re(re({},o),((r={})[n]=re(re({},i),{callback:e}),r));return Object(C.setState)({forms:u}),e(re({},i)),function(){return oe(n)}},oe=function(t){var e=Object(C.getState)().forms,r=re({},e);delete r[t],Object(C.setState)({forms:r})},ie=function(){return(ie=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ue=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},ae=function(t){var e,r=ie({},Object(C.getState)().forms),n=r[t],o=n.renderer,i=n.callback,u=n.product,a=ue([],o);o.forEach((function(e){var r=[e.id];a=se(e,a,t,r)}));var s=Zt(a,u),c=ie(ie({},n),{renderer:a,product:s,status:b(a)}),f=ie(ie({},r),((e={})[t]=c,e));Object(C.setState)({forms:f});var l=ie({},c);return delete l.callback,i(l),c.status},se=function(t,e,r,n){var o=t.modifiers,i=t.id,u=!o.length,a=ue([],e);return u?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),a):(o.forEach((function(t){var e=ue(ue([],n),[t.id]);a=ce(t,a,r,e)})),a)},ce=function(t,e,r,n){var o=t.groups,i=t.amount,u=t.status,a=t.required,s=!o.length||0===i,c=ue([],e);if(s){var f="IDLE"===u&&a||"FAIL"===u||"INCOMPLETE"===u?"FAIL":u,l=ie(ie({},t),{status:f}),h=ue([],n);c=$t(c,h,l,l.amount,!0),c=zt(r,c,h,!0)}else o.forEach((function(t){var e=ue(ue([],n),[t.id]);c=se(t,c,r,e)}));return c},fe=function(){return(fe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},le=!1,he=function(t,e){if(void 0===e&&(e={}),le)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(Object(C.setState)(fe({artisanApp:t},e)),void 0!==e.timeout){var r=(new Date).getTime()+e.timeout;Object(C.setState)({expiresAt:r})}"undefined"==typeof window||(le=!0)}},pe=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?O(r):t;return{unitGrossPrice:ve(n,1),unitTotalDiscounts:ge(n,1),unitTotalTaxes:de(n,1),unitNetPrice:be(n,1),amount:e,grossPrice:ve(n,e),totalDiscounts:ge(n,e),totalTaxes:de(n,e),netPrice:be(n,e)}},de=function(t,e){var r=_(t,{amount:e}),n=r.prices,o=r.amount,i=n[r.priceCategory],u=i.taxes,a=i.grossPrice,s=Oe(u,a);return ye(r,e)+s*o},ye=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,i=n[r.priceCategory],u=i.taxes,a=i.grossPrice;return t+o*(Oe(u,a)+ye(r,e))}),0)*e}),0)},ve=function(t,e){return we(t,"grossPrice",e)},ge=function(t,e){return 0},be=function(t,e){return we(t,"netPrice",e)},we=function(t,e,r){var n=_(t,{amount:r}),o=n.prices,i=n.amount,u=o[n.priceCategory][e];return(me(n,e)+u)*i},me=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+me(r,e))}),0)}),0)},Oe=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)};Object(C.initState)(F)}])},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.skipVendor=void 0;var n=r(1),o=r(7);e.skipVendor=function(t,e){var r=e.vendors,i=n.getState().activeVendor;return(!i||!r.includes(i))&&(void 0===i?o.noActiveVendor():o.vendorNotIncluded(t,e),!0)}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(48)),i=n(r(49)),u=r(6);e.default=function(t){u.triageEventToProviders("signUpAttempt",t,{googleAnalyticsHandler:o.default,facebookPixelHandler:i.default})}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(r(4)),a=r(2),s=r(1);e.default=function(t,e){var r=t.userId,i=(e.callback,e.userId),c=o(e,["callback","userId"]),f=null!=i?i:r,l=n(n({},c),{userId:f}),h=a.eventParamsToSnakeCase(l),p=s.getState().meta,d=a.eventParamsToSnakeCase(p);u.default().logEvent("sign_up_attempt",n(n({},h),d))}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),u=r(2),a=r(1);e.default=function(t,e){var r=o(e,[]);delete r.userId;var s=n({},r),c=u.eventParamsToSnakeCase(s),f=a.getState().meta,l=u.eventParamsToSnakeCase(f);i.AppEventsLogger.logEvent("SignUpAttempt",n(n({},c),l))}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(51)),i=n(r(52)),u=r(6);e.default=function(t){u.triageEventToProviders("changePasswordFail",t,{googleAnalyticsHandler:o.default,facebookPixelHandler:i.default})}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(r(4)),a=r(2),s=r(1);e.default=function(t,e){var r=t.userId,i=(e.callback,e.userId),c=o(e,["callback","userId"]),f=null!=i?i:r,l=n(n({},c),{userId:f}),h=a.eventParamsToSnakeCase(l),p=s.getState().meta,d=a.eventParamsToSnakeCase(p);u.default().logEvent("change_password_fail",n(n({},h),d))}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),u=r(2),a=r(1);e.default=function(t,e){var r=o(e,[]);delete r.userId;var s=n({},r),c=u.eventParamsToSnakeCase(s),f=a.getState().meta,l=u.eventParamsToSnakeCase(f);i.AppEventsLogger.logEvent("ChangePasswordFail",n(n({},c),l))}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(54)),i=n(r(55)),u=r(6);e.default=function(t){u.triageEventToProviders("changePasswordSuccess",t,{googleAnalyticsHandler:o.default,facebookPixelHandler:i.default})}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(r(4)),a=r(2),s=r(1);e.default=function(t,e){var r=t.userId,i=(e.callback,e.userId),c=o(e,["callback","userId"]),f=null!=i?i:r,l=n(n({},c),{userId:f}),h=a.eventParamsToSnakeCase(l),p=s.getState().meta,d=a.eventParamsToSnakeCase(p);u.default().logEvent("change_password_success",n(n({},h),d))}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),u=r(2),a=r(1);e.default=function(t,e){var r=o(e,[]);delete r.userId;var s=n({},r),c=u.eventParamsToSnakeCase(s),f=a.getState().meta,l=u.eventParamsToSnakeCase(f);i.AppEventsLogger.logEvent("ChangePasswordSuccess",n(n({},c),l))}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(57)),i=n(r(58)),u=r(6);e.default=function(t){u.triageEventToProviders("signIn",t,{googleAnalyticsHandler:o.default,facebookPixelHandler:i.default})}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(r(4)),a=r(2),s=r(1);e.default=function(t,e){var r=t.userId,i=(e.callback,e.userId),c=o(e,["callback","userId"]),f=null!=i?i:r,l=n(n({},c),{userId:f}),h=a.eventParamsToSnakeCase(l),p=s.getState().meta,d=a.eventParamsToSnakeCase(p);u.default().logEvent("login",n(n({},h),d))}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),u=r(2),a=r(1);e.default=function(t,e){var r=o(e,[]);delete r.userId;var s=n({},r),c=u.eventParamsToSnakeCase(s),f=a.getState().meta,l=u.eventParamsToSnakeCase(f);i.AppEventsLogger.logEvent("SignIn",n(n({},c),l))}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(60)),i=n(r(61)),u=r(6);e.default=function(t){u.triageEventToProviders("signOut",t,{googleAnalyticsHandler:o.default,facebookPixelHandler:i.default})}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(r(4)),a=r(2),s=r(1);e.default=function(t,e){var r=t.userId,i=(e.callback,e.userId),c=o(e,["callback","userId"]),f=null!=i?i:r,l=n(n({},c),{userId:f}),h=a.eventParamsToSnakeCase(l),p=s.getState().meta,d=a.eventParamsToSnakeCase(p);u.default().logEvent("sign_out",n(n({},h),d))}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),u=r(2),a=r(1);e.default=function(t,e){var r=o(e,[]);delete r.userId;var s=n({},r),c=u.eventParamsToSnakeCase(s),f=a.getState().meta,l=u.eventParamsToSnakeCase(f);i.AppEventsLogger.logEvent("SignOut",n(n({},c),l))}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(63)),i=n(r(64)),u=r(6);e.default=function(t){u.triageEventToProviders("signUp",t,{googleAnalyticsHandler:o.default,facebookPixelHandler:i.default})}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(r(4)),a=r(2),s=r(1);e.default=function(t,e){var r=t.userId,i=(e.callback,e.userId),c=o(e,["callback","userId"]),f=null!=i?i:r,l=n(n({},c),{userId:f}),h=a.eventParamsToSnakeCase(l),p=s.getState().meta,d=a.eventParamsToSnakeCase(p);u.default().logEvent("sign_up",n(n({},h),d))}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(e,"__esModule",{value:!0});var i=r(5),u=r(2),a=r(1);e.default=function(t,e){var r=o(e,[]);delete r.userId;var s=n({},r),c=u.eventParamsToSnakeCase(s),f=a.getState().meta,l=u.eventParamsToSnakeCase(f);i.AppEventsLogger.logEvent("CompleteRegistration",n(n({},c),l))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";r.r(e),r.d(e,"snakeCase",(function(){return c}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.create;Object.create;function o(t){return t.toLowerCase()}var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],u=/[^A-Z0-9]+/gi;function a(t,e,r){return e instanceof RegExp?t.replace(e,r):e.reduce((function(t,e){return t.replace(e,r)}),t)}function s(t,e){return void 0===e&&(e={}),function(t,e){void 0===e&&(e={});for(var r=e.splitRegexp,n=void 0===r?i:r,s=e.stripRegexp,c=void 0===s?u:s,f=e.transform,l=void 0===f?o:f,h=e.delimiter,p=void 0===h?" ":h,d=a(a(t,n,"$1\0$2"),c,"\0"),y=0,v=d.length;"\0"===d.charAt(y);)y++;for(;"\0"===d.charAt(v-1);)v--;return d.slice(y,v).split("\0").map(l).join(p)}(t,n({delimiter:"."},e))}function c(t,e){return void 0===e&&(e={}),s(t,n({delimiter:"_"},e))}}])}));
package/build/report.json CHANGED
@@ -1 +1 @@
1
- [{"label":"main.bundle.js","isAsset":true,"statSize":17657,"parsedSize":10933,"gzipSize":3496,"groups":[{"label":"state/build","path":"./state/build","statSize":2099,"groups":[{"id":0,"label":"main.bundle.js","path":"./state/build/main.bundle.js","statSize":2099,"parsedSize":1440,"gzipSize":622}],"parsedSize":1440,"gzipSize":622},{"label":"src","path":"./src","statSize":12188,"groups":[{"label":"utils","path":"./src/utils","statSize":7501,"groups":[{"id":2,"label":"state.utils.ts","path":"./src/utils/state.utils.ts","statSize":1432,"parsedSize":656,"gzipSize":352},{"id":6,"label":"logs.utils.ts","path":"./src/utils/logs.utils.ts","statSize":6069,"parsedSize":2292,"gzipSize":982}],"parsedSize":2948,"gzipSize":1191},{"id":4,"label":"index.ts","path":"./src/index.ts","statSize":920,"parsedSize":547,"gzipSize":301},{"label":"lib/initAnalytics","path":"./src/lib/initAnalytics","statSize":3767,"groups":[{"id":5,"label":"initAnalytics.ts","path":"./src/lib/initAnalytics/initAnalytics.ts","statSize":3057,"parsedSize":1510,"gzipSize":798},{"id":7,"label":"initAnalytics.helpers.ts","path":"./src/lib/initAnalytics/initAnalytics.helpers.ts","statSize":631,"parsedSize":218,"gzipSize":173},{"id":8,"label":"initAnalytics.types.ts","path":"./src/lib/initAnalytics/initAnalytics.types.ts","statSize":79,"parsedSize":78,"gzipSize":97}],"parsedSize":1806,"gzipSize":853}],"parsedSize":5301,"gzipSize":1827},{"id":3,"label":"package.json","path":"./package.json","statSize":3370,"parsedSize":2906,"gzipSize":1202}]}]
1
+ [{"label":"main.bundle.js","isAsset":true,"statSize":645957,"parsedSize":349972,"gzipSize":66562,"groups":[{"label":"src","path":"./src","statSize":70046,"groups":[{"label":"utils","path":"./src/utils","statSize":15211,"groups":[{"id":1,"label":"state.utils.ts","path":"./src/utils/state.utils.ts","statSize":1432,"parsedSize":657,"gzipSize":352},{"id":2,"label":"common.utils.ts","path":"./src/utils/common.utils.ts","statSize":1155,"parsedSize":516,"gzipSize":330},{"id":6,"label":"events.utils.ts","path":"./src/utils/events.utils.ts","statSize":5417,"parsedSize":1682,"gzipSize":750},{"id":7,"label":"logs.utils.ts","path":"./src/utils/logs.utils.ts","statSize":6069,"parsedSize":2292,"gzipSize":982},{"id":46,"label":"validations.utils.ts","path":"./src/utils/validations.utils.ts","statSize":1138,"parsedSize":276,"gzipSize":215}],"parsedSize":5423,"gzipSize":1732},{"label":"lib","path":"./src/lib","statSize":53130,"groups":[{"label":"providers","path":"./src/lib/providers","statSize":40340,"groups":[{"label":"AnalyticsProvider","path":"./src/lib/providers/AnalyticsProvider","statSize":1785,"groups":[{"id":12,"label":"AnalyticsProvider.ts","path":"./src/lib/providers/AnalyticsProvider/AnalyticsProvider.ts","statSize":1785,"parsedSize":464,"gzipSize":294}],"parsedSize":464,"gzipSize":294},{"id":14,"label":"providers.ts","path":"./src/lib/providers/providers.ts","statSize":579,"parsedSize":254,"gzipSize":207},{"label":"FacebookPixel","path":"./src/lib/providers/FacebookPixel","statSize":17329,"groups":[{"id":15,"label":"FacebookPixel.ts","path":"./src/lib/providers/FacebookPixel/FacebookPixel.ts","statSize":3525,"parsedSize":1580,"gzipSize":723},{"id":20,"label":"FacebookPixel.types.ts","path":"./src/lib/providers/FacebookPixel/FacebookPixel.types.ts","statSize":79,"parsedSize":78,"gzipSize":97},{"label":"events/auth","path":"./src/lib/providers/FacebookPixel/events/auth","statSize":13725,"groups":[{"label":"changePasswordAttempt","path":"./src/lib/providers/FacebookPixel/events/auth/changePasswordAttempt","statSize":1998,"groups":[{"id":26,"label":"changePasswordAttempt.ts","path":"./src/lib/providers/FacebookPixel/events/auth/changePasswordAttempt/changePasswordAttempt.ts","statSize":1998,"parsedSize":900,"gzipSize":500}],"parsedSize":900,"gzipSize":500},{"label":"signUpAttempt","path":"./src/lib/providers/FacebookPixel/events/auth/signUpAttempt","statSize":1958,"groups":[{"id":49,"label":"signUpAttempt.ts","path":"./src/lib/providers/FacebookPixel/events/auth/signUpAttempt/signUpAttempt.ts","statSize":1958,"parsedSize":892,"gzipSize":494}],"parsedSize":892,"gzipSize":494},{"label":"changePasswordFail","path":"./src/lib/providers/FacebookPixel/events/auth/changePasswordFail","statSize":1983,"groups":[{"id":52,"label":"changePasswordFail.ts","path":"./src/lib/providers/FacebookPixel/events/auth/changePasswordFail/changePasswordFail.ts","statSize":1983,"parsedSize":897,"gzipSize":498}],"parsedSize":897,"gzipSize":498},{"label":"changePasswordSuccess","path":"./src/lib/providers/FacebookPixel/events/auth/changePasswordSuccess","statSize":1998,"groups":[{"id":55,"label":"changePasswordSuccess.ts","path":"./src/lib/providers/FacebookPixel/events/auth/changePasswordSuccess/changePasswordSuccess.ts","statSize":1998,"parsedSize":900,"gzipSize":500}],"parsedSize":900,"gzipSize":500},{"label":"signIn","path":"./src/lib/providers/FacebookPixel/events/auth/signIn","statSize":1923,"groups":[{"id":58,"label":"signIn.ts","path":"./src/lib/providers/FacebookPixel/events/auth/signIn/signIn.ts","statSize":1923,"parsedSize":885,"gzipSize":488}],"parsedSize":885,"gzipSize":488},{"label":"signOut","path":"./src/lib/providers/FacebookPixel/events/auth/signOut","statSize":1928,"groups":[{"id":61,"label":"signOut.ts","path":"./src/lib/providers/FacebookPixel/events/auth/signOut/signOut.ts","statSize":1928,"parsedSize":886,"gzipSize":489}],"parsedSize":886,"gzipSize":489},{"label":"signUp","path":"./src/lib/providers/FacebookPixel/events/auth/signUp","statSize":1937,"groups":[{"id":64,"label":"signUp.ts","path":"./src/lib/providers/FacebookPixel/events/auth/signUp/signUp.ts","statSize":1937,"parsedSize":899,"gzipSize":497}],"parsedSize":899,"gzipSize":497}],"parsedSize":6259,"gzipSize":596}],"parsedSize":7917,"gzipSize":1094},{"label":"GoogleAnalytics","path":"./src/lib/providers/GoogleAnalytics","statSize":20647,"groups":[{"id":16,"label":"GoogleAnalytics.ts","path":"./src/lib/providers/GoogleAnalytics/GoogleAnalytics.ts","statSize":4251,"parsedSize":1957,"gzipSize":786},{"id":21,"label":"GoogleAnalytics.types.ts","path":"./src/lib/providers/GoogleAnalytics/GoogleAnalytics.types.ts","statSize":79,"parsedSize":78,"gzipSize":97},{"label":"events/auth","path":"./src/lib/providers/GoogleAnalytics/events/auth","statSize":16317,"groups":[{"label":"changePasswordAttempt","path":"./src/lib/providers/GoogleAnalytics/events/auth/changePasswordAttempt","statSize":2371,"groups":[{"id":25,"label":"changePasswordAttempt.ts","path":"./src/lib/providers/GoogleAnalytics/events/auth/changePasswordAttempt/changePasswordAttempt.ts","statSize":2371,"parsedSize":1041,"gzipSize":551}],"parsedSize":1041,"gzipSize":551},{"label":"signUpAttempt","path":"./src/lib/providers/GoogleAnalytics/events/auth/signUpAttempt","statSize":2331,"groups":[{"id":48,"label":"signUpAttempt.ts","path":"./src/lib/providers/GoogleAnalytics/events/auth/signUpAttempt/signUpAttempt.ts","statSize":2331,"parsedSize":1033,"gzipSize":544}],"parsedSize":1033,"gzipSize":544},{"label":"changePasswordFail","path":"./src/lib/providers/GoogleAnalytics/events/auth/changePasswordFail","statSize":2356,"groups":[{"id":51,"label":"changePasswordFail.ts","path":"./src/lib/providers/GoogleAnalytics/events/auth/changePasswordFail/changePasswordFail.ts","statSize":2356,"parsedSize":1038,"gzipSize":549}],"parsedSize":1038,"gzipSize":549},{"label":"changePasswordSuccess","path":"./src/lib/providers/GoogleAnalytics/events/auth/changePasswordSuccess","statSize":2371,"groups":[{"id":54,"label":"changePasswordSuccess.ts","path":"./src/lib/providers/GoogleAnalytics/events/auth/changePasswordSuccess/changePasswordSuccess.ts","statSize":2371,"parsedSize":1041,"gzipSize":551}],"parsedSize":1041,"gzipSize":551},{"label":"signIn","path":"./src/lib/providers/GoogleAnalytics/events/auth/signIn","statSize":2293,"groups":[{"id":57,"label":"signIn.ts","path":"./src/lib/providers/GoogleAnalytics/events/auth/signIn/signIn.ts","statSize":2293,"parsedSize":1023,"gzipSize":537}],"parsedSize":1023,"gzipSize":537},{"label":"signOut","path":"./src/lib/providers/GoogleAnalytics/events/auth/signOut","statSize":2300,"groups":[{"id":60,"label":"signOut.ts","path":"./src/lib/providers/GoogleAnalytics/events/auth/signOut/signOut.ts","statSize":2300,"parsedSize":1026,"gzipSize":539}],"parsedSize":1026,"gzipSize":539},{"label":"signUp","path":"./src/lib/providers/GoogleAnalytics/events/auth/signUp","statSize":2295,"groups":[{"id":63,"label":"signUp.ts","path":"./src/lib/providers/GoogleAnalytics/events/auth/signUp/signUp.ts","statSize":2295,"parsedSize":1025,"gzipSize":539}],"parsedSize":1025,"gzipSize":539}],"parsedSize":7227,"gzipSize":641}],"parsedSize":9262,"gzipSize":1173}],"parsedSize":17897,"gzipSize":1628},{"label":"initAnalytics","path":"./src/lib/initAnalytics","statSize":3767,"groups":[{"id":17,"label":"initAnalytics.ts","path":"./src/lib/initAnalytics/initAnalytics.ts","statSize":3057,"parsedSize":1512,"gzipSize":797},{"id":18,"label":"initAnalytics.helpers.ts","path":"./src/lib/initAnalytics/initAnalytics.helpers.ts","statSize":631,"parsedSize":218,"gzipSize":172},{"id":19,"label":"initAnalytics.types.ts","path":"./src/lib/initAnalytics/initAnalytics.types.ts","statSize":79,"parsedSize":78,"gzipSize":97}],"parsedSize":1808,"gzipSize":850},{"label":"events","path":"./src/lib/events","statSize":9023,"groups":[{"id":22,"label":"events.ts","path":"./src/lib/events/events.ts","statSize":361,"parsedSize":204,"gzipSize":172},{"label":"auth","path":"./src/lib/events/auth","statSize":8662,"groups":[{"id":23,"label":"index.ts","path":"./src/lib/events/auth/index.ts","statSize":1199,"parsedSize":449,"gzipSize":269},{"label":"changePasswordAttempt","path":"./src/lib/events/auth/changePasswordAttempt","statSize":1170,"groups":[{"id":24,"label":"changePasswordAttempt.ts","path":"./src/lib/events/auth/changePasswordAttempt/changePasswordAttempt.ts","statSize":1170,"parsedSize":336,"gzipSize":253}],"parsedSize":336,"gzipSize":253},{"label":"signUpAttempt","path":"./src/lib/events/auth/signUpAttempt","statSize":1109,"groups":[{"id":47,"label":"signUpAttempt.ts","path":"./src/lib/events/auth/signUpAttempt/signUpAttempt.ts","statSize":1109,"parsedSize":328,"gzipSize":248}],"parsedSize":328,"gzipSize":248},{"label":"changePasswordFail","path":"./src/lib/events/auth/changePasswordFail","statSize":1119,"groups":[{"id":50,"label":"changePasswordFail.ts","path":"./src/lib/events/auth/changePasswordFail/changePasswordFail.ts","statSize":1119,"parsedSize":333,"gzipSize":251}],"parsedSize":333,"gzipSize":251},{"label":"changePasswordSuccess","path":"./src/lib/events/auth/changePasswordSuccess","statSize":1176,"groups":[{"id":53,"label":"changePasswordSuccess.ts","path":"./src/lib/events/auth/changePasswordSuccess/changePasswordSuccess.ts","statSize":1176,"parsedSize":336,"gzipSize":253}],"parsedSize":336,"gzipSize":253},{"label":"signIn","path":"./src/lib/events/auth/signIn","statSize":958,"groups":[{"id":56,"label":"signIn.ts","path":"./src/lib/events/auth/signIn/signIn.ts","statSize":958,"parsedSize":321,"gzipSize":243}],"parsedSize":321,"gzipSize":243},{"label":"signOut","path":"./src/lib/events/auth/signOut","statSize":973,"groups":[{"id":59,"label":"signOut.ts","path":"./src/lib/events/auth/signOut/signOut.ts","statSize":973,"parsedSize":322,"gzipSize":242}],"parsedSize":322,"gzipSize":242},{"label":"signUp","path":"./src/lib/events/auth/signUp","statSize":958,"groups":[{"id":62,"label":"signUp.ts","path":"./src/lib/events/auth/signUp/signUp.ts","statSize":958,"parsedSize":321,"gzipSize":241}],"parsedSize":321,"gzipSize":241}],"parsedSize":2746,"gzipSize":432}],"parsedSize":2950,"gzipSize":451}],"parsedSize":22655,"gzipSize":2331},{"id":13,"label":"index.ts","path":"./src/index.ts","statSize":1626,"parsedSize":732,"gzipSize":380},{"label":"types","path":"./src/types","statSize":79,"groups":[{"id":65,"label":"common.types.ts","path":"./src/types/common.types.ts","statSize":79,"parsedSize":78,"gzipSize":97}],"parsedSize":78,"gzipSize":97}],"parsedSize":28888,"gzipSize":3755},{"label":"node_modules","path":"./node_modules","statSize":51690,"groups":[{"label":"react","path":"./node_modules/react","statSize":6865,"groups":[{"id":3,"label":"index.js","path":"./node_modules/react/index.js","statSize":190,"parsedSize":45,"gzipSize":65},{"label":"cjs","path":"./node_modules/react/cjs","statSize":6675,"groups":[{"id":40,"label":"react.production.min.js","path":"./node_modules/react/cjs/react.production.min.js","statSize":6675,"parsedSize":6434,"gzipSize":2623}],"parsedSize":6434,"gzipSize":2623}],"parsedSize":6479,"gzipSize":2633},{"label":"react-native-fbsdk/lib/module","path":"./node_modules/react-native-fbsdk/lib/module","statSize":42717,"groups":[{"id":5,"label":"index.js","path":"./node_modules/react-native-fbsdk/lib/module/index.js","statSize":2438,"parsedSize":602,"gzipSize":255},{"label":"models","path":"./node_modules/react-native-fbsdk/lib/module/models","statSize":5739,"groups":[{"id":10,"label":"FBShareOpenGraphValueContainer.js","path":"./node_modules/react-native-fbsdk/lib/module/models/FBShareOpenGraphValueContainer.js","statSize":2520,"parsedSize":502,"gzipSize":268},{"id":27,"label":"FBShareOpenGraphAction.js","path":"./node_modules/react-native-fbsdk/lib/module/models/FBShareOpenGraphAction.js","statSize":1800,"parsedSize":248,"gzipSize":200},{"id":28,"label":"FBShareOpenGraphObject.js","path":"./node_modules/react-native-fbsdk/lib/module/models/FBShareOpenGraphObject.js","statSize":1419,"parsedSize":71,"gzipSize":88}],"parsedSize":821,"gzipSize":321},{"id":29,"label":"FBAccessToken.js","path":"./node_modules/react-native-fbsdk/lib/module/FBAccessToken.js","statSize":6724,"parsedSize":1742,"gzipSize":588},{"id":30,"label":"FBAppEventsLogger.js","path":"./node_modules/react-native-fbsdk/lib/module/FBAppEventsLogger.js","statSize":4739,"parsedSize":863,"gzipSize":399},{"id":31,"label":"FBAppLink.js","path":"./node_modules/react-native-fbsdk/lib/module/FBAppLink.js","statSize":1334,"parsedSize":128,"gzipSize":123},{"id":32,"label":"FBGameRequestDialog.js","path":"./node_modules/react-native-fbsdk/lib/module/FBGameRequestDialog.js","statSize":1552,"parsedSize":130,"gzipSize":133},{"id":33,"label":"FBGraphRequest.js","path":"./node_modules/react-native-fbsdk/lib/module/FBGraphRequest.js","statSize":2351,"parsedSize":436,"gzipSize":261},{"id":34,"label":"FBGraphRequestManager.js","path":"./node_modules/react-native-fbsdk/lib/module/FBGraphRequestManager.js","statSize":3839,"parsedSize":941,"gzipSize":479},{"id":35,"label":"FBLoginManager.js","path":"./node_modules/react-native-fbsdk/lib/module/FBLoginManager.js","statSize":2345,"parsedSize":402,"gzipSize":244},{"id":36,"label":"FBMessageDialog.js","path":"./node_modules/react-native-fbsdk/lib/module/FBMessageDialog.js","statSize":1777,"parsedSize":185,"gzipSize":151},{"id":37,"label":"FBSettings.js","path":"./node_modules/react-native-fbsdk/lib/module/FBSettings.js","statSize":1336,"parsedSize":493,"gzipSize":277},{"id":38,"label":"FBShareDialog.js","path":"./node_modules/react-native-fbsdk/lib/module/FBShareDialog.js","statSize":1871,"parsedSize":208,"gzipSize":158},{"id":39,"label":"FBLoginButton.js","path":"./node_modules/react-native-fbsdk/lib/module/FBLoginButton.js","statSize":2792,"parsedSize":954,"gzipSize":534},{"id":42,"label":"FBSendButton.js","path":"./node_modules/react-native-fbsdk/lib/module/FBSendButton.js","statSize":1936,"parsedSize":475,"gzipSize":328},{"id":43,"label":"FBShareButton.js","path":"./node_modules/react-native-fbsdk/lib/module/FBShareButton.js","statSize":1944,"parsedSize":476,"gzipSize":329}],"parsedSize":8856,"gzipSize":2338},{"label":"object-assign","path":"./node_modules/object-assign","statSize":2108,"groups":[{"id":41,"label":"index.js","path":"./node_modules/object-assign/index.js","statSize":2108,"parsedSize":990,"gzipSize":558}],"parsedSize":990,"gzipSize":558}],"parsedSize":16325,"gzipSize":5160},{"id":4,"label":"analytics\"","path":"./analytics\"","statSize":42,"parsedSize":26,"gzipSize":46},{"label":"buildin","path":"./buildin","statSize":573,"groups":[{"id":8,"label":"harmony-module.js","path":"./buildin/harmony-module.js","statSize":573,"parsedSize":341,"gzipSize":185}],"parsedSize":341,"gzipSize":185},{"label":"state/build","path":"./state/build","statSize":2099,"groups":[{"id":9,"label":"main.bundle.js","path":"./state/build/main.bundle.js","statSize":2099,"parsedSize":1440,"gzipSize":623}],"parsedSize":1440,"gzipSize":623},{"id":11,"label":"package.json","path":"./package.json","statSize":3387,"parsedSize":2923,"gzipSize":1205},{"label":"shopping-cart/build","path":"./shopping-cart/build","statSize":339209,"groups":[{"id":44,"label":"main.bundle.js","path":"./shopping-cart/build/main.bundle.js","statSize":339209,"parsedSize":197018,"gzipSize":38075}],"parsedSize":197018,"gzipSize":38075},{"label":"products/build","path":"./products/build","statSize":164158,"groups":[{"id":45,"label":"main.bundle.js","path":"./products/build/main.bundle.js","statSize":164158,"parsedSize":100515,"gzipSize":18469}],"parsedSize":100515,"gzipSize":18469},{"label":"Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015","statSize":14753,"groups":[{"id":66,"label":"index.js + 4 modules (concatenated)","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)","statSize":14753,"parsedSize":986,"gzipSize":530,"concatenated":true,"groups":[{"label":"Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules","statSize":14753,"groups":[{"label":"snake-case/dist.es2015","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015","statSize":261,"groups":[{"id":null,"label":"index.js","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js","statSize":261,"parsedSize":17,"gzipSize":9,"inaccurateSizes":true}],"parsedSize":17,"gzipSize":9,"inaccurateSizes":true},{"label":"tslib","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/tslib","statSize":11605,"groups":[{"id":null,"label":"tslib.es6.js","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/tslib/tslib.es6.js","statSize":11605,"parsedSize":775,"gzipSize":416,"inaccurateSizes":true}],"parsedSize":775,"gzipSize":416,"inaccurateSizes":true},{"label":"dot-case/dist.es2015","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/dot-case/dist.es2015","statSize":256,"groups":[{"id":null,"label":"index.js","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/dot-case/dist.es2015/index.js","statSize":256,"parsedSize":17,"gzipSize":9,"inaccurateSizes":true}],"parsedSize":17,"gzipSize":9,"inaccurateSizes":true},{"label":"no-case/dist.es2015","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/no-case/dist.es2015","statSize":1490,"groups":[{"id":null,"label":"index.js","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/no-case/dist.es2015/index.js","statSize":1490,"parsedSize":99,"gzipSize":53,"inaccurateSizes":true}],"parsedSize":99,"gzipSize":53,"inaccurateSizes":true},{"label":"lower-case/dist.es2015","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/lower-case/dist.es2015","statSize":1141,"groups":[{"id":null,"label":"index.js","path":"./Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/snake-case/dist.es2015/index.js + 4 modules (concatenated)/Users/DanielFryy/Documents/Projects/Libraries/artisan_monorepo/node_modules/lower-case/dist.es2015/index.js","statSize":1141,"parsedSize":76,"gzipSize":40,"inaccurateSizes":true}],"parsedSize":76,"gzipSize":40,"inaccurateSizes":true}],"parsedSize":986,"gzipSize":530,"inaccurateSizes":true}]}],"parsedSize":986,"gzipSize":530}]}]
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@artisan-commerce/analytics-rn",
3
3
  "description": "Artisan commerce analytics react native library",
4
- "version": "0.1.1-canary.5",
4
+ "version": "0.1.1-canary.7",
5
5
  "main": "./build/main.bundle.js",
6
- "types": "./build/index.d.ts",
6
+ "types": "./build/analytics-rn/src/index.d.ts",
7
7
  "files": [
8
8
  "build/",
9
9
  "LICENSE",
@@ -88,5 +88,5 @@
88
88
  "react": ">= 16.8.6",
89
89
  "react-native-fbsdk": "*"
90
90
  },
91
- "gitHead": "e8060b103c27e4ced72b4c04259f55b09c28adfa"
91
+ "gitHead": "5b35addec6ba05bd2c9d1c0900fc650fd07e1900"
92
92
  }