@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
21 lines • 138 kB
JavaScript
var ecommerceDriver=function(e){function t(r){if(o[r])return o[r].exports;var a=o[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,r){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var o=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(o,'a',o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='',t(t.s=128)}([function(e,t,o){'use strict';o.d(t,'a',function(){return n});var r=o(1),a=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function r(){this.constructor=t}if('function'!=typeof o&&null!==o)throw new TypeError('Class extends value '+(o+'')+' is not a constructor or null');e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),n=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.id=-1,t.title='',t}return a(t,e),t.prototype.mergeWithPartial=function(t){return e.prototype.mergeWithPartial.call(this,t)},t.matchObjects=function(e,t,o){var r;return function(e){e[e.Ok=0]='Ok',e[e.NotExists=1]='NotExists',e[e.Fail=2]='Fail'}(r||(r={})),o.reduce(function(o,a){var n=Object.keys(a)[0],i=a[n];return o===r.Ok?r.Ok:o===r.NotExists?'undefined'==typeof(t||{})[i]?r.NotExists:e[n]===t[i]?r.Ok:r.Fail:r.Fail},r.NotExists)===r.Ok},t.prototype.matchesPartial=function(e){return this.id===e.id||'undefined'==typeof e.id&&this.title===e.title},t}(r.a)},function(e,t,o){'use strict';o.d(t,'a',function(){return a});var r=o(3),a=function(){function e(){}return e.prototype.clone=function(){return new this.constructor().mergeWithPartial(this)},e.prototype.validateModel=function(e){return!!e},e.prototype.mergeWithModel=function(t){var o=e.BuildFromModel(this,t);return e.typeSafeMerge(this,o)},e.prototype.mergeWithPartial=function(t){return e.typeSafeMerge(this,t)},e.BuildFromModel=function(e,t){if(!t)return null;var o=e.clone();return o.validateModel(t)?(o.init(t),o):null},e.Build=function(t,o,a){switch(a){case r.a.ExternalModel:return e.BuildFromModel(t,o);case r.a.PartialSelf:return e.BuildFromPartialSelf(t,o);default:throw'Unexpected ModelTreatment found!';}},e.BuildFromPartialSelf=function(t,o){return o?e.typeSafeMerge(t,o):null},e.typeSafeMerge=function(t,o){if(typeof o!=typeof t)return o;if(!t)return t;var a=function(e,t){return e===t||null!==e&&'object'==typeof e&&'function'==typeof e.equals&&e.equals(t)};return Object.keys(o||{}).forEach(function(n){if(!!t[n]&&'undefined'!=typeof t[n].pushMerged){var i=t[n];o[n].forEach(function(e){i.pushMerged(e,r.a.PartialSelf)})}else if(Array.isArray(t[n]))o[n].forEach(function(e){var o=JSON.stringify(e);null===t[n].find(function(e){return JSON.stringify(e)===o})&&t[n].push(e)});else if('undefined'!=typeof o[n]&&!a(t[n],o[n])&&('undefined'==typeof t[n]||null===t[n]||'undefined'==typeof t[n].subscribe))switch(!0){case null!==t[n]&&'object'==typeof t[n]:t[n]=e.typeSafeMerge(t[n],o[n]);break;default:t[n]=o[n];}}),t},e}()},function(e,t,o){'use strict';(function(r,a){var n='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&'function'==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?'symbol':typeof e},i,l;/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/(function(r,a){'object'===n(t)&&'undefined'!=typeof e?e.exports=a():(i=a,l='function'==typeof i?i.call(t,o,t,e):i,!(l!==void 0&&(e.exports=l)))})(void 0,function(){function e(e){var t='undefined'==typeof e?'undefined':n(e);return null!==e&&('object'===t||'function'===t)}function t(e){return'function'==typeof e}function o(){return'undefined'==typeof D?i():function(){D(l)}}function i(){var e=setTimeout;return function(){return e(l,1)}}function l(){for(var e=0;e<A;e+=2){var t=V[e],o=V[e+1];t(o),V[e]=void 0,V[e+1]=void 0}A=0}function d(e,t){var o=this,r=new this.constructor(u);void 0===r[W]&&w(r);var a=o._state;if(a){var n=arguments[a-1];B(function(){return x(a,r,n,o._result)})}else P(o,r,e,t);return r}function p(e){var t=this;if(e&&'object'===('undefined'==typeof e?'undefined':n(e))&&e.constructor===t)return e;var o=new t(u);return g(o,e),o}function u(){}function s(){return new TypeError('You cannot resolve a promise with itself')}function c(){return new TypeError('A promises callback cannot return that same promise.')}function f(e,t,o,r){try{e.call(t,o,r)}catch(t){return t}}function _(e,t,o){B(function(e){var r=!1,a=f(o,t,function(o){r||(r=!0,t===o?h(e,o):g(e,o))},function(t){r||(r=!0,v(e,t))},'Settle: '+(e._label||' unknown promise'));!r&&a&&(r=!0,v(e,a))},e)}function y(e,t){t._state===H?h(e,t._result):t._state===K?v(e,t._result):P(t,void 0,function(t){return g(e,t)},function(t){return v(e,t)})}function b(e,o,r){o.constructor===e.constructor&&r===d&&o.constructor.resolve===p?y(e,o):void 0===r?h(e,o):t(r)?_(e,o,r):h(e,o)}function g(t,o){if(t===o)v(t,s());else if(e(o)){var r;try{r=o.then}catch(e){return void v(t,e)}b(t,o,r)}else h(t,o)}function m(e){e._onerror&&e._onerror(e._result),M(e)}function h(e,t){e._state!==R||(e._result=t,e._state=H,0!==e._subscribers.length&&B(M,e))}function v(e,t){e._state!==R||(e._state=K,e._result=t,B(m,e))}function P(e,t,o,r){var a=e._subscribers,n=a.length;e._onerror=null,a[n]=t,a[n+H]=o,a[n+K]=r,0===n&&e._state&&B(M,e)}function M(e){var t=e._subscribers,o=e._state;if(0!==t.length){for(var r=void 0,a=void 0,n=e._result,l=0;l<t.length;l+=3)r=t[l],a=t[l+o],r?x(o,r,a,n):a(n);e._subscribers.length=0}}function x(e,o,r,a){var n=t(r),i=!0,l,d;if(n){try{l=r(a)}catch(t){i=!1,d=t}if(o===l)return void v(o,c())}else l=a;o._state!==R||(n&&i?g(o,l):!1==i?v(o,d):e===H?h(o,l):e===K&&v(o,l))}function O(t,e){try{e(function(e){g(t,e)},function(e){v(t,e)})}catch(o){v(t,o)}}function S(){return G++}function w(e){e[W]=G++,e._state=void 0,e._result=void 0,e._subscribers=[]}function k(){return new Error('Array Methods must be provided an Array')}function E(){throw new TypeError('You must pass a resolver function as the first argument to the promise constructor')}function j(){throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.')}var C=Array.isArray?Array.isArray:function(e){return'[object Array]'===Object.prototype.toString.call(e)};var I=C,A=0,D=void 0,U=void 0,B=function(e,t){V[A]=e,V[A+1]=t,A+=2,2==A&&(U?U(l):z())},L='undefined'==typeof window?void 0:window,F=L||{},T=F.MutationObserver||F.WebKitMutationObserver,N='undefined'==typeof self&&'undefined'!=typeof r&&'[object process]'==={}.toString.call(r),q='undefined'!=typeof Uint8ClampedArray&&'undefined'!=typeof importScripts&&'undefined'!=typeof MessageChannel,V=Array(1e3),z=void 0;z=N?function(){return function(){return r.nextTick(l)}}():T?function(){var e=0,t=new T(l),o=document.createTextNode('');return t.observe(o,{characterData:!0}),function(){o.data=e=++e%2}}():q?function(){var e=new MessageChannel;return e.port1.onmessage=l,function(){return e.port2.postMessage(0)}}():void 0!==L||0?i():function(){try{var e=Function('return this')().require('vertx');return D=e.runOnLoop||e.runOnContext,o()}catch(t){return i()}}();var W=Math.random().toString(36).substring(2),R=void 0,H=1,K=2,G=0,J=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(u),this.promise[W]||w(this.promise),I(t)?(this.length=t.length,this._remaining=t.length,this._result=Array(this.length),0===this.length?h(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&h(this.promise,this._result))):v(this.promise,k())}return e.prototype._enumerate=function(e){for(var t=0;this._state===R&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var o=this._instanceConstructor,r=o.resolve;if(r===p){var a=void 0,n=void 0,i=!1;try{a=e.then}catch(t){i=!0,n=t}if(a===d&&e._state!==R)this._settledAt(e._state,t,e._result);else if('function'!=typeof a)this._remaining--,this._result[t]=e;else if(o===Y){var l=new o(u);i?v(l,n):b(l,e,a),this._willSettleAt(l,t)}else this._willSettleAt(new o(function(t){return t(e)}),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,o){var r=this.promise;r._state===R&&(this._remaining--,e===K?v(r,o):this._result[t]=o),0===this._remaining&&h(r,this._result)},e.prototype._willSettleAt=function(e,t){var o=this;P(e,void 0,function(e){return o._settledAt(H,t,e)},function(e){return o._settledAt(K,t,e)})},e}(),Y=function(){function e(t){this[W]=S(),this._result=this._state=void 0,this._subscribers=[],u!==t&&('function'!=typeof t&&E(),this instanceof e?O(this,t):j())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var o=this,r=o.constructor;return t(e)?o.then(function(t){return r.resolve(e()).then(function(){return t})},function(t){return r.resolve(e()).then(function(){throw t})}):o.then(e,e)},e}();return Y.prototype.then=d,Y.all=function(e){return new J(this,e).promise},Y.race=function(e){var t=this;return I(e)?new t(function(o,r){for(var a=e.length,n=0;n<a;n++)t.resolve(e[n]).then(o,r)}):new t(function(e,t){return t(new TypeError('You must pass an array to race.'))})},Y.resolve=p,Y.reject=function(e){var t=this,o=new t(u);return v(o,e),o},Y._setScheduler=function(e){U=e},Y._setAsap=function(e){B=e},Y._asap=B,Y.polyfill=function(){var e;if('undefined'!=typeof a)e=a;else if('undefined'!=typeof self)e=self;else try{e=Function('return this')()}catch(t){throw new Error('polyfill failed because global object is unavailable in this environment')}var t=e.Promise;if(t){var o=null;try{o=Object.prototype.toString.call(t.resolve())}catch(t){}if('[object Promise]'===o&&!t.cast)return}e.Promise=Y},Y.Promise=Y,Y})}).call(t,o(18),o(15))},function(e,t,o){'use strict';o.d(t,'a',function(){return d}),o.d(t,'b',function(){return p});var r=o(4),a=o(1),n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function r(){this.constructor=t}if('function'!=typeof o&&null!==o)throw new TypeError('Class extends value '+(o+'')+' is not a constructor or null');e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),i=this&&this.__decorate||function(e,t,o,a){var n=arguments.length,l=3>n?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a,r;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,a);else for(var d=e.length-1;0<=d;d--)(r=e[d])&&(l=(3>n?r(l):3<n?r(t,o,l):r(t,o))||l);return 3<n&&l&&Object.defineProperty(t,o,l),l},l=this&&this.__metadata||function(e,t){if('object'==typeof Reflect&&'function'==typeof Reflect.metadata)return Reflect.metadata(e,t)},d;(function(e){e[e.ExternalModel=0]='ExternalModel',e[e.PartialSelf=1]='PartialSelf'})(d||(d={}));var p=function(e){function t(t,o){void 0===o&&(o=null);var r=e.call(this)||this;return r._owner=null,r.current=null,r._itemCreatorFactory=t,r._owner=o,r}return n(t,e),t.prototype.pushAndMoveCursor=function(e){return this.push(e),this.current=e},t.prototype.moveCursorTo=function(e){var t=this.indexOf(e);return 0<=t?this.current=this[t]:this.pushAndMoveCursor(e)},t.prototype.setCurrent=function(e){if(0<=e&&e<=this.length-1){var t=this[e];t&&(this.current=t)}else this.current=null},t.prototype.pushMerged=function(e,t,o){void 0===t&&(t=d.PartialSelf),void 0===o&&(o=!0);var r=this.findIndex(function(o){return t===d.ExternalModel?o.matchesModel(e):o.matchesPartial(e)});if(-1<r)return this[r]=t===d.ExternalModel?this[r].mergeWithModel(e):this[r].mergeWithPartial(e),this.moveCursorTo(this[r]),this[r];var n=a.a.Build(this._itemCreatorFactory(e,t),e,t);return void 0!==n.owner&&(n.owner=this._owner),o?this.pushAndMoveCursor(n):(this.push(n),n)},t.prototype.initByMerged=function(e,t){this.splice(0,this.length);var o=this;'undefined'==typeof e&&(e=[]),e.forEach(function(e){o.pushAndMoveCursor(o._itemCreatorFactory(e,t))})},t=i([Object(r.d)(),l('design:paramtypes',[Function,Object])],t),t}(Array)},function(e,t,o){'use strict';t.d=function(){return function(e){return function(t){function o(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,e.prototype),a}return n(o,t),o}(e)}},t.a=function(e){return function(){for(var t in i={},e)e.hasOwnProperty(t)&&(i[t]=function(e){var t=null;try{t=new e}catch(t){}return t}.bind(null,e[t],t))}},t.b=function(e){return function(t,o){Object.defineProperty(t,o,{get:function(){return i[e]()}})}},t.c=function(e){return function(t){return function(o){function i(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var l=this;try{l=o.apply(this,n)||this}catch(t){}return l.info=new a.a(r.a,e),window.Aurigma=window.Aurigma||{},window.Aurigma.EcommerceDriver=l.info,Object.setPrototypeOf(l,t.prototype),l}return n(i,o),i}(t)}};var r=o(32),a=o(33),n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function r(){this.constructor=t}if('function'!=typeof o&&null!==o)throw new TypeError('Class extends value '+(o+'')+' is not a constructor or null');e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),i={}},function(e,t,o){'use strict';var r=o(20);o.d(t,'a',function(){return r.a});var a=o(21);o.d(t,'b',function(){return a.a});var n=o(7);o.d(t,'c',function(){return n.a});o(17)},function(e,t,o){'use strict';/*!
* Strongly Typed Events for TypeScript - Core
* https://github.com/KeesCBakker/StronlyTypedEvents/
* http://keestalkstech.com
*
* Copyright Kees C. Bakker / KeesTalksTech
* Released under the MIT license
*/Object.defineProperty(t,'__esModule',{value:!0});var r=o(24);Object.defineProperty(t,'DispatcherBase',{enumerable:!0,get:function(){return r.DispatcherBase}}),Object.defineProperty(t,'DispatcherWrapper',{enumerable:!0,get:function(){return r.DispatcherWrapper}}),Object.defineProperty(t,'EventListBase',{enumerable:!0,get:function(){return r.EventListBase}});var a=o(12);Object.defineProperty(t,'Subscription',{enumerable:!0,get:function(){return a.Subscription}})},function(e,t,o){'use strict';(function(e){o.d(t,'a',function(){return r});var r=function(){function t(){}return t.clone=function(e){if('object'!=typeof e)return e;if(!e)return e;var t=e instanceof Array?[]:{};for(var r in e)e.hasOwnProperty(r)&&(t[r]=this.clone(e[r]));return t},t.JSON_to_URLEncoded=function(e,t,o){if(void 0===t&&(t=null),void 0===o&&(o=[]),o=o||[],'object'==typeof e)for(var r in e)e.hasOwnProperty(r)&&this.JSON_to_URLEncoded(e[r],t?t+'['+r+']':r,o);else o.push(t+'='+encodeURIComponent(e));return o.join('&')},t.FormatPrice=function(e,t,o){if(null===e||void 0===e)return null;var r='number'==typeof e?e:parseFloat(e.replace(',','.').replace(/[^0-9\.]+/g,''));return r.toLocaleString(t,{style:'currency',currency:o})},t.loadJsonJsonp=function(t,o){return void 0===o&&(o={}),new e(function(e,r){var a='jsonp_callback_'+Math.round(1e5*Math.random());window[a]=function(t){delete window[a],document.body.removeChild(n);try{var o=JSON.parse(t);e(o)}catch(t){e(null)}},o&&Object.keys(o).forEach(function(e){t+=(0<=t.indexOf('?')?'&':'?')+e+'='+o[e]});var n=document.createElement('script');n.src=t+(0<=t.indexOf('?')?'&':'?')+'callback='+a,n.onerror=function(){r(arguments)},document.body.appendChild(n)})},t.ensureArrayLength=function(e,t){return e.length>=t?e:e.concat(Array(t-e.length))},Object.defineProperty(t,'guidRegex',{get:function(){return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/},enumerable:!1,configurable:!0}),t.isNotEmptyString=function(e){return null!==e&&void 0!==e&&''!==e},t.stringOrNumberEquals=function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&e.toString()===t.toString()},t.ensureStartsWith=function(e,t){return e.startsWith(t)?e:t+e},t.ensureEndsWith=function(e,t){return e.endsWith(t)?e:e+t},t}()}).call(t,o(2).Promise)},function(e,t,o){'use strict';/*!
* Strongly Typed Events for TypeScript
* https://github.com/KeesCBakker/StronlyTypedEvents/
* http://keestalkstech.com
*
* Copyright Kees C. Bakker / KeesTalksTech
* Released under the MIT license
*/Object.defineProperty(t,'__esModule',{value:!0});var r=o(6);Object.defineProperty(t,'DispatcherBase',{enumerable:!0,get:function(){return r.DispatcherBase}}),Object.defineProperty(t,'DispatcherWrapper',{enumerable:!0,get:function(){return r.DispatcherWrapper}}),Object.defineProperty(t,'EventListBase',{enumerable:!0,get:function(){return r.EventListBase}}),Object.defineProperty(t,'Subscription',{enumerable:!0,get:function(){return r.Subscription}});var a=o(26);Object.defineProperty(t,'EventDispatcher',{enumerable:!0,get:function(){return a.EventDispatcher}}),Object.defineProperty(t,'EventHandlingBase',{enumerable:!0,get:function(){return a.EventHandlingBase}}),Object.defineProperty(t,'EventList',{enumerable:!0,get:function(){return a.EventList}}),Object.defineProperty(t,'NonUniformEventList',{enumerable:!0,get:function(){return a.NonUniformEventList}});var n=o(28);Object.defineProperty(t,'SimpleEventDispatcher',{enumerable:!0,get:function(){return n.SimpleEventDispatcher}}),Object.defineProperty(t,'SimpleEventHandlingBase',{enumerable:!0,get:function(){return n.SimpleEventHandlingBase}}),Object.defineProperty(t,'SimpleEventList',{enumerable:!0,get:function(){return n.SimpleEventList}}),Object.defineProperty(t,'NonUniformSimpleEventList',{enumerable:!0,get:function(){return n.NonUniformSimpleEventList}});var i=o(30);Object.defineProperty(t,'SignalDispatcher',{enumerable:!0,get:function(){return i.SignalDispatcher}}),Object.defineProperty(t,'SignalHandlingBase',{enumerable:!0,get:function(){return i.SignalHandlingBase}}),Object.defineProperty(t,'SignalList',{enumerable:!0,get:function(){return i.SignalList}})},function(e,t,o){'use strict';o.d(t,'a',function(){return r});var r=function(){function e(e,t,o,r){this.err=e,this.response=t,this.body=o,this.readyState=r,this.isFromCart=!1}return e.empty=function(){return new e(null,null,'')},e}()},function(e,t,o){'use strict';o.d(t,'a',function(){return n});var r=o(23),a=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function r(){this.constructor=t}if('function'!=typeof o&&null!==o)throw new TypeError('Class extends value '+(o+'')+' is not a constructor or null');e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t}(r.a)},function(e,t,o){'use strict';(function(e){o.d(t,'a',function(){return i});var r=o(8),a=o.n(r),n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function r(){this.constructor=t}if('function'!=typeof o&&null!==o)throw new TypeError('Class extends value '+(o+'')+' is not a constructor or null');e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),i=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.callbacks=[],e}return n(o,t),o.prototype.subscribe=function(e){var t=this;return e&&this.callbacks.push(new r.Subscription(e,!1)),function(){t.unsubscribe(e)}},o.prototype.unsubscribe=function(e){if(e)for(var t=0;t<this.callbacks.length;t++)if(this.callbacks[t].handler===e){this.callbacks.splice(t,1);break}},o.prototype.dispatch=function(t,o){var r=this,a=this.callbacks.map(function(e){return r.executeCallback(e,t,o)});return e.all(a).then(function(){})},o.prototype.executeCallback=function(t,o,r){var a=t.handler.apply(this,[o,r]);return this.isPromise(a)?a:e.resolve()},o.prototype.isPromise=function(e){return!!e&&'function'==typeof e.then},o}(r.EventDispatcher)}).call(t,o(2).Promise)},function(e,t){'use strict';Object.defineProperty(t,'__esModule',{value:!0}),t.Subscription=void 0;var o=function(){function e(e,t){this.handler=e,this.isOnce=t,this.isExecuted=!1}return e.prototype.execute=function(e,t,o){if(!this.isOnce||!this.isExecuted){this.isExecuted=!0;var r=this.handler;e?setTimeout(function(){r.apply(t,o)},1):r.apply(t,o)}},e}();t.Subscription=o},function(e,t,o){'use strict';o.d(t,'c',function(){return a}),o.d(t,'b',function(){return n}),o.d(t,'a',function(){return i});var r;(function(e){e.Preselect='Preselect',e.Filter='Filter'})(r||(r={}));var a;(function(e){e[e.Template=1]='Template',e[e.OptionBasedProduct=2]='OptionBasedProduct'})(a||(a={}));var n;(function(e){e[e.Custom=0]='Custom',e[e.ShopifyLegacy=1]='ShopifyLegacy',e[e.DocketManager=2]='DocketManager',e[e.Auth0Saml=3]='Auth0Saml',e[e.NopCommerce=4]='NopCommerce',e[e.WooCommerce=5]='WooCommerce',e[e.Magento=6]='Magento',e[e.BigCommerce=7]='BigCommerce',e[e.Shopify=8]='Shopify',e[e.ShopifyCustom=9]='ShopifyCustom'})(n||(n={}));var i=function(){return function(){this.storefrontId='',this.apiGatewayUrl='',this.backOfficeUrl='',this.assetStorageUrl='',this.assetProcessorUrl='',this.designAtomsApiUrl='',this.tenantId=0,this.userId=0,this.token='',this.externalProductId='',this.integrationType=a.Template,this.optionBasedProductInfo=void 0,this.ecommerceSystemType=n.Custom}}()},function(e,t,o){'use strict';o.d(t,'a',function(){return d});var r=o(4),a=o(9),n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function r(){this.constructor=t}if('function'!=typeof o&&null!==o)throw new TypeError('Class extends value '+(o+'')+' is not a constructor or null');e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),i=this&&this.__decorate||function(e,t,o,a){var n=arguments.length,l=3>n?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a,r;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,a);else for(var d=e.length-1;0<=d;d--)(r=e[d])&&(l=(3>n?r(l):3<n?r(t,o,l):r(t,o))||l);return 3<n&&l&&Object.defineProperty(t,o,l),l},l=this&&this.__metadata||function(e,t){if('object'==typeof Reflect&&'function'==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=function(e){function t(t,o){var r=e.call(this,t)||this;return'undefined'!=typeof o&&(r.body=o.body,r.response=o.response),r}return n(t,e),t=i([Object(r.d)(),l('design:paramtypes',[String,a.a])],t),t}(Error)},function(e){'use strict';var t='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&'function'==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?'symbol':typeof e},o;o=function(){return this}();try{o=o||Function('return this')()||(1,eval)('this')}catch(r){'object'===('undefined'==typeof window?'undefined':t(window))&&(o=window)}e.exports=o},function(e,t,o){'use strict';o.d(t,'a',function(){return r});var r=function(){return function(e,t){this.option=e,this.value=[],t&&(t instanceof Array?this.value=t:this.value.push(t))}}()},function(e,t,o){'use strict';o.d(t,'a',function(){return r});var r=function(){function e(){}return e.postByForm=function(t,o,r){void 0===r&&(r='post');var a=document.createElement('form');for(var n in a.method=r,a.action=t,a.enctype='multipart/form-data',o)if(o.hasOwnProperty(n))if(!!o[n]&&'object'==typeof o[n])e.genInput(o[n],a,n);else{var i=document.createElement('input');i.type='hidden',i.name=n,i.value=o[n]||'',a.appendChild(i)}document.body.appendChild(a),a.submit()},e.genInput=function(t,o,r){Object.keys(t).forEach(function(a){var n=r?r+'['+a+']':a;if(!!t[a]&&'object'==typeof t[a])t[a]&&e.genInput(t[a],o,n);else{var i=document.createElement('input');i.type='hidden',i.name=n,i.value=t[a]||'',o.appendChild(i)}})},e}()},function(e){'use strict';function t(){throw new Error('setTimeout has not been defined')}function o(){throw new Error('clearTimeout has not been defined')}function r(e){if(u===setTimeout)return setTimeout(e,0);if((u===t||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function a(e){if(s===clearTimeout)return clearTimeout(e);if((s===o||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(e);try{return s(e)}catch(t){try{return s.call(null,e)}catch(t){return s.call(this,e)}}}function n(){f&&y&&(f=!1,y.length?c=y.concat(c):_=-1,c.length&&l())}function l(){if(!f){var e=r(n);f=!0;for(var t=c.length;t;){for(y=c,c=[];++_<t;)y&&y[_].run();_=-1,t=c.length}y=null,f=!1,a(e)}}function d(e,t){this.fun=e,this.array=t}function i(){}var p=e.exports={},u,s;(function(){try{u='function'==typeof setTimeout?setTimeout:t}catch(o){u=t}try{s='function'==typeof clearTimeout?clearTimeout:o}catch(t){s=o}})();var c=[],f=!1,_=-1,y;p.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var o=1;o<arguments.length;o++)t[o-1]=arguments[o];c.push(new d(e,t)),1!==c.length||f||r(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},p.title='browser',p.browser=!0,p.env={},p.argv=[],p.version='',p.versions={},p.on=i,p.addListener=i,p.once=i,p.off=i,p.removeListener=i,p.removeAllListeners=i,p.emit=i,p.prependListener=i,p.prependOnceListener=i,p.listeners=function(){return[]},p.binding=function(){throw new Error('process.binding is not supported')},p.cwd=function(){return'/'},p.chdir=function(){throw new Error('process.chdir is not supported')},p.umask=function(){return 0}},function(e,t,o){'use strict';(function(e){o.d(t,'a',function(){return m});var r=o(5),a=o(22),n=o(34),i=o.n(n),l=o(35),d=o.n(l),p=o(13),u=o(36),s=o(4),c=o(1),f=o(3),_=this&&this.__decorate||function(e,t,o,a){var n=arguments.length,l=3>n?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a,r;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,a);else for(var d=e.length-1;0<=d;d--)(r=e[d])&&(l=(3>n?r(l):3<n?r(t,o,l):r(t,o))||l);return 3<n&&l&&Object.defineProperty(t,o,l),l},y=this&&this.__metadata||function(e,t){if('object'==typeof Reflect&&'function'==typeof Reflect.metadata)return Reflect.metadata(e,t)},b=this&&this.__awaiter||function(t,o,r,a){function n(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=e))(function(e,r){function i(e){try{d(a.next(e))}catch(t){r(t)}}function l(e){try{d(a['throw'](e))}catch(t){r(t)}}function d(t){t.done?e(t.value):n(t.value).then(i,l)}d((a=a.apply(t,o||[])).next())})},g=this&&this.__generator||function(e,o){function r(e){return function(t){return a([e,t])}}function a(r){if(i)throw new TypeError('Generator is already executing.');for(;n;)try{if(i=1,l&&(d=2&r[0]?l['return']:r[0]?l['throw']||((d=l['return'])&&d.call(l),0):l.next)&&!(d=d.call(l,r[1])).done)return d;switch((l=0,d)&&(r=[2&r[0],d.value]),r[0]){case 0:case 1:d=r;break;case 4:return n.label++,{value:r[1],done:!1};case 5:n.label++,l=r[1],r=[0];continue;case 7:r=n.ops.pop(),n.trys.pop();continue;default:if((d=n.trys,!(d=0<d.length&&d[d.length-1]))&&(6===r[0]||2===r[0])){n=0;continue}if(3===r[0]&&(!d||r[1]>d[0]&&r[1]<d[3])){n.label=r[1];break}if(6===r[0]&&n.label<d[1]){n.label=d[1],d=r;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(r);break}d[2]&&n.ops.pop(),n.trys.pop();continue;}r=o.call(e,n)}catch(t){r=[6,t],l=0}finally{i=d=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var n={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]},i,l,d,p;return p={next:r(0),throw:r(1),return:r(2)},'function'==typeof Symbol&&(p[Symbol.iterator]=function(){return this}),p},m=function(){function e(){var e=this;this._products=new f.b(function(){return e.productCreateInstance},this),this._orders=new f.b(function(){return e.orderCreateInstance},this),this._localization=[],this._additionalProductsPromises=[],this.findProduct={byId:function(t){return b(e,void 0,void 0,function(){return g(this,function(){return[2,this.findProductById(t)]})})}}}return e.prototype.productFactoryFromModel=function(e,t){var o=c.a.BuildFromModel(this.productCreateInstance,e);return o?(o.owner=t,o):null},e.prototype.productFactoryFromPartialSelf=function(e,t){var o=c.a.BuildFromPartialSelf(this.productCreateInstance,e);return o?(o.owner=t,o):null},e.prototype.init=function(e,t,o,r,n,i,l,d,s,f){return b(this,void 0,void 0,function(){var _,y,b,m,h,v,P;return g(this,function(){for(this.backOffice=d||new p.a,this.settings=c.a.BuildFromModel(this.pluginSettingsCreateInstance,r),this.editor=t,s&&(this.themeSettings=s),this.localization=f,Array.isArray(e)||(e=[e]),(_=0,y=e);_<y.length;_++)b=y[_],this.products.push(this.productFactoryFromModel(b,this));if(this.products.setCurrent(0),n=n||{},Object.assign(n,{quantity:i,product:this.products.current,settings:this.settings}),m=this.orders.pushAndMoveCursor(this.buildOrder(n)),m.driver=this,this._cart=new a.a(this),this.user=c.a.BuildFromModel(this.userCreateInstance,l),this.config=o.config||o,this._configProcessor=new u.a(this),t&&'multistep'!==t.editorType&&(this.config=this.configProcessor.processConfig(o)),o.additionalProducts)for(h=0,v=o.additionalProducts;h<v.length;h++)P=v[h],this._additionalProductsPromises.push(this.findProduct.byId(P.id));return t&&(t.driver=this),this._supportUserLogin=!1,[2,this]})})},Object.defineProperty(e.prototype,'supportUserLogin',{get:function(){return this._supportUserLogin},set:function(e){this._supportUserLogin=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'backOffice',{get:function(){return this._backOffice},set:function(e){this._backOffice=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'info',{get:function(){return this._info},set:function(e){this._info=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'editor',{get:function(){return this._editor},set:function(e){this._editor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'config',{get:function(){return this._config},set:function(e){this._config=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'configProcessor',{get:function(){return this._configProcessor},set:function(e){this._configProcessor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'user',{get:function(){return this._user},set:function(e){this._user=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'settings',{get:function(){return this._settings},set:function(e){this._settings=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'products',{get:function(){return this._products},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'orders',{get:function(){return this._orders},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'cart',{get:function(){return this._cart},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'themeSettings',{get:function(){return this._themeSettings},set:function(e){this._themeSettings=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'localization',{get:function(){return this._localization},set:function(e){this._localization=e?Array.isArray(e)?e:[e]:this._localization},enumerable:!1,configurable:!0}),e.prototype.addProduct=function(e){var t=this.products.find(function(t){return t.id===e.id});t||this.products.push(e)},e.prototype.findProductById=function(e){return b(this,void 0,void 0,function(){var t,o;return g(this,function(a){switch(a.label){case 0:return t=this.products.find(function(t){return r.c.stringOrNumberEquals(t.id,e)}),t?[2,t]:[4,this.getExternalProductModel(e)];case 1:return o=a.sent(),null===o?[2,null]:[2,this.productFactoryFromModel(o,this)];}})})},e.prototype.buildOrder=function(e){return c.a.BuildFromModel(this.orderCreateInstance,e)},_([Object(s.b)('Product'),y('design:type',Object)],e.prototype,'productCreateInstance',void 0),_([Object(s.b)('Order'),y('design:type',Object)],e.prototype,'orderCreateInstance',void 0),_([Object(s.b)('PluginSettings'),y('design:type',Object)],e.prototype,'pluginSettingsCreateInstance',void 0),_([Object(s.b)('User'),y('design:type',Object)],e.prototype,'userCreateInstance',void 0),e}()}).call(t,o(2).Promise)},function(e,t,o){'use strict';o.d(t,'a',function(){return r});var r=function(){function e(){}return e.colorNameToHex=function(e){return null===e||void 0===e?null:'undefined'==typeof this.colors[e.toLowerCase()]?null:this.colors[e.toLowerCase()]},e.colors={aliceblue:'#f0f8ff',antiquewhite:'#faebd7',aqua:'#00ffff',aquamarine:'#7fffd4',azure:'#f0ffff',beige:'#f5f5dc',bisque:'#ffe4c4',black:'#000000',blanchedalmond:'#ffebcd',blue:'#0000ff',blueviolet:'#8a2be2',brown:'#a52a2a',burlywood:'#deb887',cadetblue:'#5f9ea0',chartreuse:'#7fff00',chocolate:'#d2691e',coral:'#ff7f50',cornflowerblue:'#6495ed',cornsilk:'#fff8dc',crimson:'#dc143c',cyan:'#00ffff',darkblue:'#00008b',darkcyan:'#008b8b',darkgoldenrod:'#b8860b',darkgray:'#a9a9a9',darkgreen:'#006400',darkkhaki:'#bdb76b',darkmagenta:'#8b008b',darkolivegreen:'#556b2f',darkorange:'#ff8c00',darkorchid:'#9932cc',darkred:'#8b0000',darksalmon:'#e9967a',darkseagreen:'#8fbc8f',darkslateblue:'#483d8b',darkslategray:'#2f4f4f',darkturquoise:'#00ced1',darkviolet:'#9400d3',deeppink:'#ff1493',deepskyblue:'#00bfff',dimgray:'#696969',dodgerblue:'#1e90ff',firebrick:'#b22222',floralwhite:'#fffaf0',forestgreen:'#228b22',fuchsia:'#ff00ff',gainsboro:'#dcdcdc',ghostwhite:'#f8f8ff',gold:'#ffd700',goldenrod:'#daa520',gray:'#808080',green:'#008000',greenyellow:'#adff2f',honeydew:'#f0fff0',hotpink:'#ff69b4',"indianred ":'#cd5c5c',indigo:'#4b0082',ivory:'#fffff0',khaki:'#f0e68c',lavender:'#e6e6fa',lavenderblush:'#fff0f5',lawngreen:'#7cfc00',lemonchiffon:'#fffacd',lightblue:'#add8e6',lightcoral:'#f08080',lightcyan:'#e0ffff',lightgoldenrodyellow:'#fafad2',lightgrey:'#d3d3d3',lightgreen:'#90ee90',lightpink:'#ffb6c1',lightsalmon:'#ffa07a',lightseagreen:'#20b2aa',lightskyblue:'#87cefa',lightslategray:'#778899',lightsteelblue:'#b0c4de',lightyellow:'#ffffe0',lime:'#00ff00',limegreen:'#32cd32',linen:'#faf0e6',magenta:'#ff00ff',maroon:'#800000',mediumaquamarine:'#66cdaa',mediumblue:'#0000cd',mediumorchid:'#ba55d3',mediumpurple:'#9370d8',mediumseagreen:'#3cb371',mediumslateblue:'#7b68ee',mediumspringgreen:'#00fa9a',mediumturquoise:'#48d1cc',mediumvioletred:'#c71585',midnightblue:'#191970',mintcream:'#f5fffa',mistyrose:'#ffe4e1',moccasin:'#ffe4b5',navajowhite:'#ffdead',navy:'#000080',oldlace:'#fdf5e6',olive:'#808000',olivedrab:'#6b8e23',orange:'#ffa500',orangered:'#ff4500',orchid:'#da70d6',palegoldenrod:'#eee8aa',palegreen:'#98fb98',paleturquoise:'#afeeee',palevioletred:'#d87093',papayawhip:'#ffefd5',peachpuff:'#ffdab9',peru:'#cd853f',pink:'#ffc0cb',plum:'#dda0dd',powderblue:'#b0e0e6',purple:'#800080',rebeccapurple:'#663399',red:'#ff0000',rosybrown:'#bc8f8f',royalblue:'#4169e1',saddlebrown:'#8b4513',salmon:'#fa8072',sandybrown:'#f4a460',seagreen:'#2e8b57',seashell:'#fff5ee',sienna:'#a0522d',silver:'#c0c0c0',skyblue:'#87ceeb',slateblue:'#6a5acd',slategray:'#708090',snow:'#fffafa',springgreen:'#00ff7f',steelblue:'#4682b4',tan:'#d2b48c',teal:'#008080',thistle:'#d8bfd8',tomato:'#ff6347',turquoise:'#40e0d0',violet:'#ee82ee',wheat:'#f5deb3',white:'#ffffff',whitesmoke:'#f5f5f5',yellow:'#ffff00',yellowgreen:'#9acd32'},e}()},function(e,t,o){'use strict';o.d(t,'a',function(){return r});var r=function(){function e(){}return e.guid=function(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+'-'+e()+'-'+e()+'-'+e()+'-'+e()+e()+e()},e}()},function(e,t,o){'use strict';(function(e){o.d(t,'a',function(){return p});var r=o(10),a=o(11),n=o(3),i=o(5),l=this&&this.__awaiter||function(t,o,r,a){function n(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=e))(function(e,r){function i(e){try{d(a.next(e))}catch(t){r(t)}}function l(e){try{d(a['throw'](e))}catch(t){r(t)}}function d(t){t.done?e(t.value):n(t.value).then(i,l)}d((a=a.apply(t,o||[])).next())})},d=this&&this.__generator||function(e,o){function r(e){return function(t){return a([e,t])}}function a(r){if(i)throw new TypeError('Generator is already executing.');for(;n;)try{if(i=1,l&&(d=2&r[0]?l['return']:r[0]?l['throw']||((d=l['return'])&&d.call(l),0):l.next)&&!(d=d.call(l,r[1])).done)return d;switch((l=0,d)&&(r=[2&r[0],d.value]),r[0]){case 0:case 1:d=r;break;case 4:return n.label++,{value:r[1],done:!1};case 5:n.label++,l=r[1],r=[0];continue;case 7:r=n.ops.pop(),n.trys.pop();continue;default:if((d=n.trys,!(d=0<d.length&&d[d.length-1]))&&(6===r[0]||2===r[0])){n=0;continue}if(3===r[0]&&(!d||r[1]>d[0]&&r[1]<d[3])){n.label=r[1];break}if(6===r[0]&&n.label<d[1]){n.label=d[1],d=r;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(r);break}d[2]&&n.ops.pop(),n.trys.pop();continue;}r=o.call(e,n)}catch(t){r=[6,t],l=0}finally{i=d=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var n={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]},i,l,d,p;return p={next:r(0),throw:r(1),return:r(2)},'function'==typeof Symbol&&(p[Symbol.iterator]=function(){return this}),p},p=function(){function t(e){var t=this;this._onSubmitting=new a.a,this._onSubmitted=new a.a,this._onPriceChanging=new a.a,this._onPriceChanged=new a.a,this._onSaving=new a.a,this._onSaved=new a.a,this._onError=new a.a,this._owner=e,this._settings=e.settings,this._lineItems=e.orders,this._subscribePriceChange(),this.onSubmitted.subscribe(function(e){!0===t._settings.redirectToCartAfterAdd&&e.lineItems[0].redirectToCart()})}return t.prototype._subscribePriceChange=function(){for(var e=0,t=this._lineItems,o;e<t.length;e++)o=t[e],this.subscribePriceChanges(o)},t.prototype.subscribePriceChanges=function(e){var t=this,o=new r.a;o.old=this.price,e.onPriceChanging.subscribe(function(){return l(t,void 0,void 0,function(){return d(this,function(){return[2,this._onPriceChanging.dispatch(this,o)]})})}),e.onPriceChanged.subscribe(function(){return l(t,void 0,void 0,function(){return d(this,function(){return o.new=this.price,o.newLocalized=this.priceLocalized,[2,this._onPriceChanged.dispatch(this,o)]})})})},Object.defineProperty(t.prototype,'lineItems',{get:function(){return this._lineItems},set:function(e){var t=this.price;this._lineItems.length=0;for(var o=0,r=e,a;o<r.length;o++)a=r[o],this._lineItems.push(a);this._lineItems.setCurrent(0),this._subscribePriceChange(),t!==this.price&&this.updatePrice(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'price',{get:function(){for(var e=0,t=0,o=this._lineItems,r;t<o.length;t++)r=o[t],e+=r.price;return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'priceLocalized',{get:function(){return this.formatPrice(this.price)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'discount',{get:function(){for(var e=0,t=0,o=this._lineItems,r;t<o.length;t++)r=o[t],e+=r.discount;return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'discountLocalized',{get:function(){return this.formatPrice(this.discount)},enumerable:!1,configurable:!0}),t.prototype.formatPrice=function(e){return(null===e||void 0===e)&&(e=this.price),i.c.FormatPrice(e,this._settings.locale,this._settings.currency)},t.prototype.updatePrice=function(e){var t=new r.a;t.old=e,t.new=this.price,t.newLocalized=this.priceLocalized,this._onPriceChanged.dispatch(this,t)},t.prototype.add=function(e,t){void 0===t&&(t=1);var o=this.price,r=this._lineItems.pushMerged({product:e,quantity:t},n.a.PartialSelf,!1);this.subscribePriceChanges(r),o!==this.price&&this.updatePrice(o)},t.prototype.remove=function(e){var t=this.price;this._lineItems.splice(this._lineItems.indexOf(e),1),t!==this.price&&this.updatePrice(t)},t.prototype.submit=function(){return l(this,void 0,void 0,function(){var t,o,r,a,n,i;return d(this,function(l){switch(l.label){case 0:return 0===this._lineItems.length||0===this._lineItems.filter(function(e){return 0<e.quantity}).length?[2,e.resolve([])]:[4,this.preSubmitting()];case 1:return l.sent(),[4,this._onSubmitting.dispatch(this,function(){}())];case 2:l.sent(),t=[],o=0,r=this._lineItems,l.label=3;case 3:return o<r.length?(a=r[o],0===a.quantity)?[3,5]:(i=(n=t).push,[4,a.submit(!0)]):[3,6];case 4:i.apply(n,[l.sent()]),l.label=5;case 5:return o++,[3,3];case 6:return[4,this._onSubmitted.dispatch(this,t)];case 7:return l.sent(),[2,t];}})})},t.prototype.save=function(){return l(this,void 0,void 0,function(){var e,t,o,r,a,n;return d(this,function(i){switch(i.label){case 0:return[4,this._onSaving.dispatch(this,function(){}())];case 1:i.sent(),e=[],t=0,o=this._lineItems,i.label=2;case 2:return t<o.length?(r=o[t],n=(a=e).push,[4,r.save()]):[3,5];case 3:n.apply(a,[i.sent()]),i.label=4;case 4:return t++,[3,2];case 5:return[4,this._onSaved.dispatch(this,e)];case 6:return i.sent(),[2,e];}})})},t.prototype.preSubmitting=function(){return l(this,void 0,void 0,function(){var e,t,o;return d(this,function(r){switch(r.label){case 0:e=0,t=this.lineItems,r.label=1;case 1:return e<t.length?(o=t[e],[4,o.preSubmitting()]):[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2];}})})},Object.defineProperty(t.prototype,'onSubmitting',{get:function(){return this._onSubmitting.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onSubmitted',{get:function(){return this._onSubmitted.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onPriceChanging',{get:function(){return this._onPriceChanging.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onPriceChanged',{get:function(){return this._onPriceChanged.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onSaving',{get:function(){return this._onSaving.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onSaved',{get:function(){return this._onSaved.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onError',{get:function(){return this._onError.asEvent()},enumerable:!1,configurable:!0}),t}()}).call(t,o(2).Promise)},function(e,t,o){'use strict';o.d(t,'a',function(){return r});var r=function(){return function(){this.new=null,this.newLocalized=''}}()},function(e,t,o){'use strict';var r=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var n=Array(e),r=0,t=0;t<o;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,r++)n[r]=i[a];return n};Object.defineProperty(t,'__esModule',{value:!0}),t.DispatcherWrapper=t.EventListBase=t.DispatcherBase=void 0;var a=o(25),n=o(12),i=function(){function e(){this._wrap=new d(this),this._subscriptions=[]}return Object.defineProperty(e.prototype,'count',{get:function(){return this._subscriptions.length},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){var t=this;return e&&this._subscriptions.push(new n.Subscription(e,!1)),function(){t.unsubscribe(e)}},e.prototype.sub=function(e){return this.subscribe(e)},e.prototype.one=function(e){var t=this;return e&&this._subscriptions.push(new n.Subscription(e,!0)),function(){t.unsubscribe(e)}},e.prototype.has=function(e){return!!e&&this._subscriptions.some(function(t){return t.handler==e})},e.prototype.unsubscribe=function(e){if(e)for(var t=0;t<this._subscriptions.length;t++)if(this._subscriptions[t].handler==e){this._subscriptions.splice(t,1);break}},e.prototype.unsub=function(e){this.unsubscribe(e)},e.prototype._dispatch=function(e,t,o){for(var n=this,i=function(r){var i=new a.EventManagement(function(){return n.unsub(r.handler)}),d=Array.prototype.slice.call(o);if(d.push(i),r.execute(e,t,d),l.cleanup(r),!e&&i.propagationStopped)return'break'},l=this,d=0,p=r(this._subscriptions);d<p.length;d++){var u=p[d],s=i(u);if('break'===s)break}},e.prototype.cleanup=function(e){if(e.isOnce&&e.isExecuted){var t=this._subscriptions.indexOf(e);-1<t&&this._subscriptions.splice(t,1)}},e.prototype.asEvent=function(){return this._wrap},e.prototype.clear=function(){this._subscriptions.splice(0,this._subscriptions.length)},e}();t.DispatcherBase=i;var l=function(){function e(){this._events={}}return e.prototype.get=function(e){var t=this._events[e];return t?t:(t=this.createDispatcher(),this._events[e]=t,t)},e.prototype.remove=function(e){delete this._events[e]},e}();t.EventListBase=l;var d=function(){function e(e){this._subscribe=function(t){return e.subscribe(t)},this._unsubscribe=function(t){return e.unsubscribe(t)},this._one=function(t){return e.one(t)},this._has=function(t){return e.has(t)},this._clear=function(){return e.clear()},this._count=function(){return e.count}}return Object.defineProperty(e.prototype,'count',{get:function(){return this._count()},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){return this._subscribe(e)},e.prototype.sub=function(e){return this.subscribe(e)},e.prototype.unsubscribe=function(e){this._unsubscribe(e)},e.prototype.unsub=function(e){this.unsubscribe(e)},e.prototype.one=function(e){return this._one(e)},e.prototype.has=function(e){return this._has(e)},e.prototype.clear=function(){this._clear()},e}();t.DispatcherWrapper=d},function(e,t){'use strict';Object.defineProperty(t,'__esModule',{value:!0}),t.EventManagement=void 0;var o=function(){function e(e){this.unsub=e,this.propagationStopped=!1}return e.prototype.stopPropagation=function(){this.propagationStopped=!0},e}();t.EventManagement=o},function(e,t,o){'use strict';Object.defineProperty(t,'__esModule',{value:!0});var r=o(27);Object.defineProperty(t,'EventDispatcher',{enumerable:!0,get:function(){return r.EventDispatcher}}),Object.defineProperty(t,'EventHandlingBase',{enumerable:!0,get:function(){return r.EventHandlingBase}}),Object.defineProperty(t,'EventList',{enumerable:!0,get:function(){return r.EventList}}),Object.defineProperty(t,'NonUniformEventList',{enumerable:!0,get:function(){return r.NonUniformEventList}})},function(e,t,o){'use strict';var r=function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}();Object.defineProperty(t,'__esModule',{value:!0}),t.EventHandlingBase=t.EventList=t.NonUniformEventList=t.EventDispatcher=void 0;var a=o(6),n=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.dispatch=function(){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(a.DispatcherBase);t.EventDispatcher=n;var i=function(){function e(){this._events={}}return e.prototype.get=function(e){if(this._events[e])return this._events[e];var t=this.createDispatcher();return this._events[e]=t,t},e.prototype.remove=function(e){delete this._events[e]},e.prototype.createDispatcher=function(){return new n},e}();t.NonUniformEventList=i;var l=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.createDispatcher=function(){return new n},t}(a.EventListBase);t.EventList=l;var d=function(){function e(){this._events=new l}return Object.defineProperty(e.prototype,'events',{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e,t){this._events.get(e).subscribe(t)},e.prototype.sub=function(e,t){this.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._events.get(e).unsubscribe(t)},e.prototype.unsub=function(e,t){this.unsubscribe(e,t)},e.prototype.one=function(e,t){this._events.get(e).one(t)},e.prototype.has=function(e,t){return this._events.get(e).has(t)},e}();t.EventHandlingBase=d},function(e,t,o){'use strict';Object.defineProperty(t,'__esModule',{value:!0});var r=o(29);Object.defineProperty(t,'SimpleEventDispatcher',{enumerable:!0,get:function(){return r.SimpleEventDispatcher}}),Object.defineProperty(t,'SimpleEventHandlingBase',{enumerable:!0,get:function(){return r.SimpleEventHandlingBase}}),Object.defineProperty(t,'SimpleEventList',{enumerable:!0,get:function(){return r.SimpleEventList}}),Object.defineProperty(t,'NonUniformSimpleEventList',{enumerable:!0,get:function(){return r.NonUniformSimpleEventList}})},function(e,t,o){'use strict';var r=function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}();Object.defineProperty(t,'__esModule',{value:!0}),t.SimpleEventHandlingBase=t.SimpleEventList=t.NonUniformSimpleEventList=t.SimpleEventDispatcher=void 0;var a=o(6),n=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.dispatch=function(){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(a.DispatcherBa