UNPKG

css-animator

Version:

Animate elements using CSS classes with support for Angular 2+

3 lines (2 loc) 21.7 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("css-animator/builder",[],e):"object"==typeof exports?exports["css-animator/builder"]=e():t["css-animator/builder"]=e()}(window,function(){return function(n){var i={};function o(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};n[t].call(e.exports,e,e.exports,o);e.l=!0;return e.exports}o.m=n;o.c=i;o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})};o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});Object.defineProperty(t,"__esModule",{value:!0})};o.t=function(e,t){1&t&&(e=o(e));if(8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);o.r(n);Object.defineProperty(n,"default",{enumerable:!0,value:e});if(2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n};o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};o.d(e,"a",e);return e};o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};o.p="";return o(o.s="./dist/builder/animation_builder.js")}({"./dist/builder/animation_builder.js":function(t,e,n){"use strict";n.r(e);n.d(e,"AnimationMode",function(){return l});n.d(e,"AnimationBuilder",function(){return i});var l,s=n("./node_modules/tslib/tslib.es6.js");!function(t){t[t.Animate=0]="Animate";t[t.Show=1]="Show";t[t.Hide=2]="Hide"}(l=l||{});var i=function(){function n(){this.animationOptions=Object.assign({},n.defaults);this.defaultOptions=Object.assign({},this.animationOptions);this.classes=[];this.activeClasses=new Map;this.listeners=new Map;this.timeouts=new Map;this.styles=new Map;this.log("AnimationBuilder created.")}n.prototype.show=function(t){return this.animate(t,l.Show)};n.prototype.hide=function(t){return this.animate(t,l.Hide)};n.prototype.stop=function(t,e){void 0===e&&(e=!0);this.removeTimeouts(t);this.removeListeners(t);e&&this.reset(t,!1);return Promise.resolve(t)};n.prototype.animate=function(i,o){var r=this;void 0===o&&(o=l.Animate);if(n.disabled||this.animationOptions.disabled)return this.animateDisabled(i,o);o===l.Show&&this.hideElement(i);return new Promise(function(t,e){r.removeTimeouts(i);var n=setTimeout(function(){r.reset(i,!0,!1,!0);r.registerAnimationListeners(i,o,t,e);r.saveStyle(i);r.saveClasses(i,o);r.pinElement(i,o);r.nextFrame(function(){r.showElement(i,o);r.applyProperties(i,o)})},r.animationOptions.delay);r.addTimeout(i,n,e);r.log("Timeout "+n+" registered for element",i)})};n.prototype.reset=function(t,e,n,i){void 0===n&&(n=!1);void 0===i&&(i=!1);if(e=void 0===e?!0:e){this.removeTimeouts(t,n);this.removeListeners(t,i)}this.removeStyles(t);this.removeClasses(t)};n.prototype.dispose=function(){this.timeouts.forEach(function(t){var e,n;try{for(var i=Object(s.__values)(t),o=i.next();!o.done;o=i.next()){var r=o.value;clearTimeout(r.timeout)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}});this.listeners.forEach(function(t,e){var n,i;try{for(var o=Object(s.__values)(t),r=o.next();!r.done;r=o.next()){var a=r.value;e.removeEventListener(a.eventName,a.handler)}}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}});this.classes=[];this.styles=new Map;this.timeouts=new Map;this.listeners=new Map};n.prototype.addAnimationClass=function(t){-1===this.classes.indexOf(t)&&this.classes.push(t);return this};n.prototype.removeAnimationClass=function(t){t=this.classes.indexOf(t);-1!==t&&this.classes.splice(t,1);return this};Object.defineProperty(n,"DEBUG",{get:function(){return n._DEBUG},set:function(t){n._DEBUG=t},enumerable:!1,configurable:!0});Object.defineProperty(n,"disabled",{get:function(){return n._disabled},set:function(t){n._disabled=t},enumerable:!1,configurable:!0});Object.defineProperty(n,"defaults",{get:function(){return n._defaults},enumerable:!1,configurable:!0});n.prototype.animateDisabled=function(t,e){e===l.Show?this.showElement(t,e):e===l.Hide&&this.hideElement(t,e);return Promise.resolve(t)};n.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n.DEBUG&&console.log.apply(console,Object(s.__spreadArray)(["css-animator:"],Object(s.__read)(t)))};n.prototype.nextFrame=function(t){n.raf(function(){n.raf(t)})};n.prototype.camelCase=function(t){return t.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()})};n.prototype.hideElement=function(t,e){this.animationOptions.useVisibility?t.style.visibility="hidden":t.setAttribute("hidden","")};n.prototype.showElement=function(t,e){this.animationOptions.pin&&e===l.Show&&(t.style.visibility="visible");this.animationOptions.useVisibility?t.style.visibility="visible":t.removeAttribute("hidden")};n.prototype.pinElement=function(t,e){if(this.animationOptions.pin){e===l.Show&&(t.style.visibility="hidden");this.animationOptions.useVisibility||this.showElement(t);e=this.getPosition(t);t.style.position=this.animationOptions.fixed?"fixed":"absolute";t.style.top=e.top+"px";t.style.left=e.left+"px";t.style.width=e.width+"px";t.style.height=e.height+"px";t.style.margin="0px"}};n.prototype.getPosition=function(t){var e=t.getBoundingClientRect(),n=window.getComputedStyle(t),i=t.offsetLeft,o=t.offsetTop,t=e.width-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderLeftWidth)-parseFloat(n.borderRightWidth),n=e.height-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderTopWidth)-parseFloat(n.borderBottomWidth);if(this.animationOptions.fixed){i=e.left+window.scrollX;o=e.top+window.scrollY}return{left:i,top:o,width:t,height:n}};n.prototype.registerAnimationListeners=function(t,e,n,i){var o,r,a=this,s=this.animationStartEvent(t),u=this.animationEndEvent(t);t.addEventListener(s,o=function(){a.log("Animation start handler fired for element",t);t.removeEventListener(s,o);return o});this.log("Registered animation start listener for element",t);t.addEventListener(u,r=function(){a.log("Animation end handler fired for element",t);t.removeEventListener(u,r);a.removeListeners(t,!1);a.reset(t,!0,!1,!1);e===l.Hide&&a.hideElement(t);e===l.Show&&a.showElement(t);n(t);return r});this.log("Registered animation end listener for element",t);this.addListener(t,s,o);this.addListener(t,u,r,i)};n.prototype.addTimeout=function(t,e,n){this.timeouts.has(t)||this.timeouts.set(t,[]);this.timeouts.get(t).push({timeout:e,reject:n})};n.prototype.addListener=function(t,e,n,i){this.listeners.has(t)||this.listeners.set(t,[]);var o=Object.assign({},this.classes);this.listeners.get(t).push({eventName:e,handler:n,reject:i,classes:o})};n.prototype.removeListeners=function(e,n){var i=this;void 0===n&&(n=!1);if(this.listeners.has(e)){this.listeners.get(e).forEach(function(t){e.removeEventListener(t.eventName,t.handler);i.log("Listener "+t.eventName+" removed for element",e);n&&i.animationOptions.reject&&t.reject&&t.reject("animation_aborted")});this.listeners.delete(e)}};n.prototype.removeTimeouts=function(e,n){var i=this;void 0===n&&(n=!1);if(this.timeouts.has(e)){this.timeouts.get(e).forEach(function(t){clearTimeout(t.timeout);i.log("Timeout "+t.timeout+" removed for element",e);n&&i.animationOptions.reject&&t.reject&&t.reject("animation_aborted")});this.timeouts.delete(e)}};n.prototype.animationEndEvent=function(t){var e,n=document.createElement("endAnimationElement"),i={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(e in i)if(void 0!==n.style[e])return i[e];return null};n.prototype.animationStartEvent=function(t){var e,n=document.createElement("startAnimationElement"),i={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"animationstart",WebkitAnimation:"webkitAnimationStart"};for(e in i)if(void 0!==n.style[e])return i[e];return null};n.prototype.applyProperties=function(t,e){this.applyClasses(t,e);this.applyStyles(t,e)};n.prototype.saveStyle=function(t){var e,n={};for(e in t.style)n[e]=t.style.getPropertyValue(e);this.styles.set(t,n)};n.prototype.applyStyles=function(t,e){this.applyFillMode(t);this.applyTimingFunction(t);this.applyPlayState(t);this.applyDirection(t);this.applyDuration(t);this.applyIterationCount(t)};n.prototype.removeStyles=function(t){if(this.styles.has(t)){var e,n=this.styles.get(t);t.removeAttribute("style");for(e in n)t.style.setProperty(e,n[e]);this.styles.delete(t)}};n.prototype.saveClasses=function(t,e){var n=this.classes.slice(0);switch(e){case l.Show:n.push("animated-show");break;case l.Hide:n.push("animated-hide")}n.push("animated",this.animationOptions.type);this.activeClasses.set(t,n)};n.prototype.applyClasses=function(t,e){var n=this.activeClasses.get(t)||[];(t=t.classList).add.apply(t,Object(s.__spreadArray)(["animated"],Object(s.__read)(n)))};n.prototype.removeClasses=function(t){var e,n=this.activeClasses.get(t)||[];(e=t.classList).remove.apply(e,Object(s.__spreadArray)(["animated","animated-show","animated-hide"],Object(s.__read)(n)));this.activeClasses.delete(t)};n.prototype.applyStyle=function(t,e,n){var i,o=document.createElement("checkStyle"),r={standard:this.camelCase(e),webkit:this.camelCase("-webkit-"+e),mozilla:this.camelCase("-moz-"+e),opera:this.camelCase("-o-"+e),explorer:this.camelCase("-ie-"+e)};for(i in r)if(r.hasOwnProperty(i)&&void 0!==o.style[r[i]]){t.style[r[i]]=null==n?null:n;break}return this};Object.defineProperty(n.prototype,"defaults",{get:function(){return this.defaultOptions},set:function(t){this.defaultOptions=t},enumerable:!1,configurable:!0});n.prototype.setDefaults=function(t){this.defaults=t;return this};Object.defineProperty(n.prototype,"options",{get:function(){return this.animationOptions},set:function(t){this.animationOptions=t},enumerable:!1,configurable:!0});n.prototype.setOptions=function(t){Object.assign(this.options,t);return this};Object.defineProperty(n.prototype,"disabled",{get:function(){return this.animationOptions.disabled},set:function(t){this.animationOptions.disabled=t},enumerable:!1,configurable:!0});Object.defineProperty(n.prototype,"reject",{get:function(){return this.animationOptions.reject},set:function(t){this.animationOptions.reject=t},enumerable:!1,configurable:!0});Object.defineProperty(n.prototype,"pin",{get:function(){return this.animationOptions.pin},set:function(t){this.animationOptions.pin=t},enumerable:!1,configurable:!0});n.prototype.setPin=function(t){this.pin=t;return this};Object.defineProperty(n.prototype,"useVisibility",{get:function(){return this.animationOptions.useVisibility},set:function(t){this.animationOptions.useVisibility=t},enumerable:!1,configurable:!0});n.prototype.setUseVisibility=function(t){this.useVisibility=t;return this};Object.defineProperty(n.prototype,"type",{get:function(){return this.animationOptions.type},set:function(t){this.animationOptions.type=t},enumerable:!1,configurable:!0});n.prototype.setType=function(t){this.type=t;return this};Object.defineProperty(n.prototype,"fillMode",{get:function(){return this.animationOptions.fillMode},set:function(t){this.animationOptions.fillMode=t},enumerable:!1,configurable:!0});n.prototype.setFillMode=function(t){this.fillMode=t;return this};n.prototype.applyFillMode=function(t,e){this.applyStyle(t,"animation-fill-mode",e||this.animationOptions.fillMode);return this};Object.defineProperty(n.prototype,"timingFunction",{get:function(){return this.animationOptions.timingFunction},set:function(t){this.animationOptions.timingFunction=t},enumerable:!1,configurable:!0});n.prototype.setTimingFunction=function(t){this.timingFunction=t;return this};n.prototype.applyTimingFunction=function(t,e){this.applyStyle(t,"animation-timing-function",e||this.animationOptions.timingFunction);return this};Object.defineProperty(n.prototype,"playState",{get:function(){return this.animationOptions.playState},set:function(t){this.animationOptions.playState=t},enumerable:!1,configurable:!0});n.prototype.setPlayState=function(t){this.playState=t;return this};n.prototype.applyPlayState=function(t,e){this.applyStyle(t,"animation-play-state",e||this.animationOptions.playState);return this};Object.defineProperty(n.prototype,"direction",{get:function(){return this.animationOptions.direction},set:function(t){this.animationOptions.direction=t},enumerable:!1,configurable:!0});n.prototype.setDirection=function(t){this.direction=t;return this};n.prototype.applyDirection=function(t,e){this.applyStyle(t,"animation-direction",e||this.animationOptions.direction);return this};Object.defineProperty(n.prototype,"duration",{get:function(){return this.animationOptions.duration},set:function(t){this.animationOptions.duration=t},enumerable:!1,configurable:!0});n.prototype.setDuration=function(t){this.duration=t;return this};n.prototype.applyDuration=function(t,e){this.applyStyle(t,"animation-duration",(e||this.animationOptions.duration)+"ms");return this};Object.defineProperty(n.prototype,"delay",{get:function(){return this.animationOptions.delay},set:function(t){this.animationOptions.delay=t},enumerable:!1,configurable:!0});n.prototype.setDelay=function(t){this.delay=t;return this};n.prototype.applyDelayAsStyle=function(t,e){this.applyStyle(t,"animation-delay",(e||this.animationOptions.delay)+"ms");return this};Object.defineProperty(n.prototype,"iterationCount",{get:function(){return this.animationOptions.iterationCount},set:function(t){this.animationOptions.iterationCount=t},enumerable:!1,configurable:!0});n.prototype.setIterationCount=function(t){this.iterationCount=t;return this};n.prototype.applyIterationCount=function(t,e){this.applyStyle(t,"animation-iteration-count",e||this.animationOptions.iterationCount);return this};n._DEBUG=!1;n._disabled=!1;n._defaults={disabled:!1,fixed:!1,reject:!0,useVisibility:!1,pin:!0,type:"bounce",fillMode:"none",timingFunction:"ease",playState:"running",direction:"normal",duration:1e3,delay:0,iterationCount:1};n.raf=window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;return n}()},"./node_modules/tslib/tslib.es6.js":function(t,e,n){"use strict";n.r(e);n.d(e,"__extends",function(){return o});n.d(e,"__assign",function(){return r});n.d(e,"__rest",function(){return a});n.d(e,"__decorate",function(){return s});n.d(e,"__param",function(){return u});n.d(e,"__metadata",function(){return l});n.d(e,"__awaiter",function(){return c});n.d(e,"__generator",function(){return p});n.d(e,"__createBinding",function(){return f});n.d(e,"__exportStar",function(){return d});n.d(e,"__values",function(){return y});n.d(e,"__read",function(){return h});n.d(e,"__spread",function(){return m});n.d(e,"__spreadArrays",function(){return b});n.d(e,"__spreadArray",function(){return v});n.d(e,"__await",function(){return g});n.d(e,"__asyncGenerator",function(){return O});n.d(e,"__asyncDelegator",function(){return w});n.d(e,"__asyncValues",function(){return _});n.d(e,"__makeTemplateObject",function(){return j});n.d(e,"__importStar",function(){return P});n.d(e,"__importDefault",function(){return E});n.d(e,"__classPrivateFieldGet",function(){return x});n.d(e,"__classPrivateFieldSet",function(){return A});var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=function(){return(r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function a(t,e){var n={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]]);return n}function s(t,e,n,i){var o,r=arguments.length,a=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;0<=s;s--)(o=t[s])&&(a=(r<3?o(a):3<r?o(e,n,a):o(e,n))||a);return 3<r&&a&&Object.defineProperty(e,n,a),a}function u(n,i){return function(t,e){i(t,e,n)}}function l(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,a,s,u){return new(s=s||Promise)(function(n,e){function i(t){try{r(u.next(t))}catch(t){e(t)}}function o(t){try{r(u.throw(t))}catch(t){e(t)}}function r(t){t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(i,o);var e}r((u=u.apply(t,a||[])).next())})}function p(n,i){var o,r,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,r&&(a=2&e[0]?r.return:e[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,e[1])).done)return a;switch((e=(r=0,a)?[2&e[0],a.value]:e)[0]){case 0:case 1:a=e;break;case 4:s.label++;return{value:e[1],done:!1};case 5:s.label++;r=e[1];e=[0];continue;case 7:e=s.ops.pop();s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){s=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){s.label=e[1];break}if(6===e[0]&&s.label<a[1]){s.label=a[1];a=e;break}if(a&&s.label<a[2]){s.label=a[2];s.ops.push(e);break}a[2]&&s.ops.pop();s.trys.pop();continue}e=i.call(n,s)}catch(t){e=[6,t];r=0}finally{o=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var f=Object.create?function(t,e,n,i){void 0===i&&(i=n);Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]};function d(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||f(e,t,n)}function y(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&i>=t.length?void 0:t)&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(i=r.next()).done;)a.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t}function b(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),o=0,e=0;e<n;e++)for(var r=arguments[e],a=0,s=r.length;a<s;a++,o++)i[o]=r[a];return i}function v(t,e,n){if(n||2===arguments.length)for(var i,o=0,r=e.length;o<r;o++)!i&&o in e||((i=i||Array.prototype.slice.call(e,0,o))[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}function g(t){return this instanceof g?(this.v=t,this):new g(t)}function O(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n.apply(t,e||[]),r=[],a={};return i("next"),i("throw"),i("return"),a[Symbol.asyncIterator]=function(){return this},a;function i(i){o[i]&&(a[i]=function(n){return new Promise(function(t,e){1<r.push([i,n,t,e])||s(i,n)})})}function s(t,e){try{(n=o[t](e)).value instanceof g?Promise.resolve(n.value.v).then(u,l):c(r[0][2],n)}catch(t){c(r[0][3],t)}var n}function u(t){s("next",t)}function l(t){s("throw",t)}function c(t,e){(t(e),r.shift(),r.length)&&s(r[0][0],r[0][1])}}function w(i){var o,t={};return e("next"),e("throw",function(t){throw t}),e("return"),t[Symbol.iterator]=function(){return this},t;function e(e,n){t[e]=i[e]?function(t){return(o=!o)?{value:g(i[e](t)),done:"return"===e}:n?n(t):t}:n}}function _(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,e=a[Symbol.asyncIterator];return e?e.call(a):(a=y(a),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=a[r]&&function(o){return new Promise(function(t,e){o=a[r](o),n=t,t=e,i=o.done,e=o.value,Promise.resolve(e).then(function(t){n({value:t,done:i})},t);var n,i})}}}function j(t,e){Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e;return t}var S=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function P(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&f(e,t,n);S(e,t);return e}function E(t){return t&&t.__esModule?t:{default:t}}function x(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function A(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}}})}); //# sourceMappingURL=builder.min.js.map