/*! For license information please see ae08cc6b.js.LICENSE.txt */
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[8611],{62744:(t,e,r)=>{"use strict";var n=r(87480),i=r(26767),a=r(38103),o=r(7599),s=r(67352),l=r(5701),u=r(17717),c=r(228),p=r(48399),f=r(47501);class d extends o.oi{constructor(){super(...arguments),this.indeterminate=!1,this.progress=0,this.buffer=1,this.reverse=!1,this.closed=!1,this.stylePrimaryHalf="",this.stylePrimaryFull="",this.styleSecondaryQuarter="",this.styleSecondaryHalf="",this.styleSecondaryFull="",this.animationReady=!0,this.closedAnimationOff=!1,this.resizeObserver=null}connectedCallback(){super.connectedCallback(),this.rootEl&&this.attachResizeObserver()}render(){const t={"mdc-linear-progress--closed":this.closed,"mdc-linear-progress--closed-animation-off":this.closedAnimationOff,"mdc-linear-progress--indeterminate":this.indeterminate,"mdc-linear-progress--animation-ready":this.animationReady},e={"--mdc-linear-progress-primary-half":this.stylePrimaryHalf,"--mdc-linear-progress-primary-half-neg":""!==this.stylePrimaryHalf?`-${this.stylePrimaryHalf}`:"","--mdc-linear-progress-primary-full":this.stylePrimaryFull,"--mdc-linear-progress-primary-full-neg":""!==this.stylePrimaryFull?`-${this.stylePrimaryFull}`:"","--mdc-linear-progress-secondary-quarter":this.styleSecondaryQuarter,"--mdc-linear-progress-secondary-quarter-neg":""!==this.styleSecondaryQuarter?`-${this.styleSecondaryQuarter}`:"","--mdc-linear-progress-secondary-half":this.styleSecondaryHalf,"--mdc-linear-progress-secondary-half-neg":""!==this.styleSecondaryHalf?`-${this.styleSecondaryHalf}`:"","--mdc-linear-progress-secondary-full":this.styleSecondaryFull,"--mdc-linear-progress-secondary-full-neg":""!==this.styleSecondaryFull?`-${this.styleSecondaryFull}`:""},r={"flex-basis":this.indeterminate?"100%":100*this.buffer+"%"},n={transform:this.indeterminate?"scaleX(1)":`scaleX(${this.progress})`};return o.dy`
      <div
          role="progressbar"
          class="mdc-linear-progress ${(0,c.$)(t)}"
          style="${(0,f.V)(e)}"
          dir="${(0,p.o)(this.reverse?"rtl":void 0)}"
          aria-label="${(0,p.o)(this.ariaLabel)}"
          aria-valuemin="0"
          aria-valuemax="1"
          aria-valuenow="${(0,p.o)(this.indeterminate?void 0:this.progress)}"
        @transitionend="${this.syncClosedState}">
        <div class="mdc-linear-progress__buffer">
          <div
            class="mdc-linear-progress__buffer-bar"
            style=${(0,f.V)(r)}>
          </div>
          <div class="mdc-linear-progress__buffer-dots"></div>
        </div>
        <div
            class="mdc-linear-progress__bar mdc-linear-progress__primary-bar"
            style=${(0,f.V)(n)}>
          <span class="mdc-linear-progress__bar-inner"></span>
        </div>
        <div class="mdc-linear-progress__bar mdc-linear-progress__secondary-bar">
          <span class="mdc-linear-progress__bar-inner"></span>
        </div>
      </div>`}update(t){!t.has("closed")||this.closed&&void 0!==t.get("closed")||this.syncClosedState(),super.update(t)}async firstUpdated(t){super.firstUpdated(t),this.attachResizeObserver()}syncClosedState(){this.closedAnimationOff=this.closed}updated(t){!t.has("indeterminate")&&t.has("reverse")&&this.indeterminate&&this.restartAnimation(),t.has("indeterminate")&&void 0!==t.get("indeterminate")&&this.indeterminate&&window.ResizeObserver&&this.calculateAndSetAnimationDimensions(this.rootEl.offsetWidth),super.updated(t)}disconnectedCallback(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),super.disconnectedCallback()}attachResizeObserver(){if(window.ResizeObserver)return this.resizeObserver=new window.ResizeObserver((t=>{if(this.indeterminate)for(const e of t)if(e.contentRect){const t=e.contentRect.width;this.calculateAndSetAnimationDimensions(t)}})),void this.resizeObserver.observe(this.rootEl);this.resizeObserver=null}calculateAndSetAnimationDimensions(t){const e=.8367142*t,r=2.00611057*t,n=.37651913*t,i=.84386165*t,a=1.60277782*t;this.stylePrimaryHalf=`${e}px`,this.stylePrimaryFull=`${r}px`,this.styleSecondaryQuarter=`${n}px`,this.styleSecondaryHalf=`${i}px`,this.styleSecondaryFull=`${a}px`,this.restartAnimation()}async restartAnimation(){this.animationReady=!1,await this.updateComplete,await new Promise(requestAnimationFrame),this.animationReady=!0,await this.updateComplete}open(){this.closed=!1}close(){this.closed=!0}}(0,n.__decorate)([(0,s.I)(".mdc-linear-progress")],d.prototype,"rootEl",void 0),(0,n.__decorate)([(0,l.C)({type:Boolean,reflect:!0})],d.prototype,"indeterminate",void 0),(0,n.__decorate)([(0,l.C)({type:Number})],d.prototype,"progress",void 0),(0,n.__decorate)([(0,l.C)({type:Number})],d.prototype,"buffer",void 0),(0,n.__decorate)([(0,l.C)({type:Boolean,reflect:!0})],d.prototype,"reverse",void 0),(0,n.__decorate)([(0,l.C)({type:Boolean,reflect:!0})],d.prototype,"closed",void 0),(0,n.__decorate)([a.L,(0,l.C)({attribute:"aria-label"})],d.prototype,"ariaLabel",void 0),(0,n.__decorate)([(0,u.S)()],d.prototype,"stylePrimaryHalf",void 0),(0,n.__decorate)([(0,u.S)()],d.prototype,"stylePrimaryFull",void 0),(0,n.__decorate)([(0,u.S)()],d.prototype,"styleSecondaryQuarter",void 0),(0,n.__decorate)([(0,u.S)()],d.prototype,"styleSecondaryHalf",void 0),(0,n.__decorate)([(0,u.S)()],d.prototype,"styleSecondaryFull",void 0),(0,n.__decorate)([(0,u.S)()],d.prototype,"animationReady",void 0),(0,n.__decorate)([(0,u.S)()],d.prototype,"closedAnimationOff",void 0);const m=r(32207).iv`@keyframes mdc-linear-progress-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%);transform:translateX(var(--mdc-linear-progress-primary-half, 83.67142%))}100%{transform:translateX(200.611057%);transform:translateX(var(--mdc-linear-progress-primary-full, 200.611057%))}}@keyframes mdc-linear-progress-primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%);transform:translateX(var(--mdc-linear-progress-secondary-quarter, 37.651913%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%);transform:translateX(var(--mdc-linear-progress-secondary-half, 84.386165%))}100%{transform:translateX(160.277782%);transform:translateX(var(--mdc-linear-progress-secondary-full, 160.277782%))}}@keyframes mdc-linear-progress-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-buffering{from{transform:rotate(180deg) translateX(-10px)}}@keyframes mdc-linear-progress-primary-indeterminate-translate-reverse{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(-83.67142%);transform:translateX(var(--mdc-linear-progress-primary-half-neg, -83.67142%))}100%{transform:translateX(-200.611057%);transform:translateX(var(--mdc-linear-progress-primary-full-neg, -200.611057%))}}@keyframes mdc-linear-progress-secondary-indeterminate-translate-reverse{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(-37.651913%);transform:translateX(var(--mdc-linear-progress-secondary-quarter-neg, -37.651913%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(-84.386165%);transform:translateX(var(--mdc-linear-progress-secondary-half-neg, -84.386165%))}100%{transform:translateX(-160.277782%);transform:translateX(var(--mdc-linear-progress-secondary-full-neg, -160.277782%))}}@keyframes mdc-linear-progress-buffering-reverse{from{transform:translateX(-10px)}}.mdc-linear-progress{position:relative;width:100%;height:4px;transform:translateZ(0);outline:1px solid transparent;overflow:hidden;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__bar{position:absolute;width:100%;height:100%;animation:none;transform-origin:top left;transition:transform 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__bar-inner{display:inline-block;position:absolute;width:100%;animation:none;border-top:4px solid}.mdc-linear-progress__buffer{display:flex;position:absolute;width:100%;height:100%}.mdc-linear-progress__buffer-dots{background-repeat:repeat-x;background-size:10px 4px;flex:auto;transform:rotate(180deg);animation:mdc-linear-progress-buffering 250ms infinite linear}.mdc-linear-progress__buffer-bar{flex:0 1 100%;transition:flex-basis 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__primary-bar{transform:scaleX(0)}.mdc-linear-progress__secondary-bar{display:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__bar{transition:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{left:-145.166611%}.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{left:-54.888891%;display:block}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation:mdc-linear-progress-primary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-primary-indeterminate-scale 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation:mdc-linear-progress-secondary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-secondary-indeterminate-scale 2s infinite linear}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__bar{right:0;-webkit-transform-origin:center right;transform-origin:center right}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation-name:mdc-linear-progress-primary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation-name:mdc-linear-progress-secondary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__buffer-dots,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__buffer-dots{animation:mdc-linear-progress-buffering-reverse 250ms infinite linear;transform:rotate(0)}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{right:-145.166611%;left:auto}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{right:-54.888891%;left:auto}.mdc-linear-progress--closed{opacity:0}.mdc-linear-progress--closed-animation-off .mdc-linear-progress__buffer-dots{animation:none}.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar,.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar .mdc-linear-progress__bar-inner{animation:none}.mdc-linear-progress__bar-inner{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-linear-progress__buffer-dots{background-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E")}.mdc-linear-progress__buffer-bar{background-color:#e6e6e6}:host{display:block}.mdc-linear-progress__buffer-bar{background-color:#e6e6e6;background-color:var(--mdc-linear-progress-buffer-color, #e6e6e6)}.mdc-linear-progress__buffer-dots{background-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E");background-image:var(--mdc-linear-progress-buffering-dots-image, url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E"))}`;let h=class extends d{};h.styles=[m],h=(0,n.__decorate)([(0,i.M)("mwc-linear-progress")],h)},67794:t=>{var e;window,e=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.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 i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assignDeep=e.mapValues=void 0,e.mapValues=function(t,e){var r={};for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];r[n]=e(i)}return r},e.assignDeep=function t(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return r.forEach((function(r){if(r)for(var n in r)if(r.hasOwnProperty(n)){var i=r[n];Array.isArray(i)?e[n]=i.slice(0):"object"==typeof i?(e[n]||(e[n]={}),t(e[n],i)):e[n]=i}})),e}},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 i=r(7),a=n(r(8)),o=r(0),s=function(){function t(e,r){this._src=e,this.opts=o.assignDeep({},t.DefaultOpts,r)}return t.use=function(t){this._pipeline=t},t.from=function(t){return new a.default(t)},Object.defineProperty(t.prototype,"result",{get:function(){return this._result},enumerable:!1,configurable:!0}),t.prototype._process=function(e,r){this.opts.quantizer,e.scaleDown(this.opts);var n=i.buildProcessOptions(this.opts,r);return t._pipeline.process(e.getImageData(),n)},t.prototype.palette=function(){return this.swatches()},t.prototype.swatches=function(){throw new Error("Method deprecated. Use `Vibrant.result.palettes[name]` instead")},t.prototype.getPalette=function(){var t=this,e=arguments[0],r=arguments[1],n="string"==typeof e?e:"default",i="string"==typeof e?r:e,a=new this.opts.ImageClass;return a.load(this._src).then((function(e){return t._process(e,{generators:[n]})})).then((function(e){return t._result=e,e.palettes[n]})).then((function(t){return a.remove(),i&&i(void 0,t),t})).catch((function(t){return a.remove(),i&&i(t),Promise.reject(t)}))},t.prototype.getPalettes=function(){var t=this,e=arguments[0],r=arguments[1],n=Array.isArray(e)?e:["*"],i=Array.isArray(e)?r:e,a=new this.opts.ImageClass;return a.load(this._src).then((function(e){return t._process(e,{generators:n})})).then((function(e){return t._result=e,e.palettes})).then((function(t){return a.remove(),i&&i(void 0,t),t})).catch((function(t){return a.remove(),i&&i(t),Promise.reject(t)}))},t.DefaultOpts={colorCount:64,quality:5,filters:[]},t}();e.default=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilters=e.ImageBase=void 0;var n=function(){function t(){}return t.prototype.scaleDown=function(t){var e=this.getWidth(),r=this.getHeight(),n=1;if(t.maxDimension>0){var i=Math.max(e,r);i>t.maxDimension&&(n=t.maxDimension/i)}else n=1/t.quality;n<1&&this.resize(e*n,r*n,n)},t}();e.ImageBase=n,e.applyFilters=function(t,e){if(e.length>0)for(var r=t.data,n=r.length/4,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=0;u<n;u++){a=r[0+(i=4*u)],o=r[i+1],s=r[i+2],l=r[i+3];for(var c=0;c<e.length;c++)if(!e[c](a,o,s,l)){r[i+3]=0;break}}return t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Swatch=void 0;var n=r(4),i=function(){function t(t,e){this._rgb=t,this._population=e}return t.applyFilters=function(t,e){return e.length>0?t.filter((function(t){for(var r=t.r,n=t.g,i=t.b,a=0;a<e.length;a++)if(!e[a](r,n,i,255))return!1;return!0})):t},t.clone=function(e){return new t(e._rgb,e._population)},Object.defineProperty(t.prototype,"r",{get:function(){return this._rgb[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._rgb[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._rgb[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._rgb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hsl",{get:function(){if(!this._hsl){var t=this._rgb,e=t[0],r=t[1],i=t[2];this._hsl=n.rgbToHsl(e,r,i)}return this._hsl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hex",{get:function(){if(!this._hex){var t=this._rgb,e=t[0],r=t[1],i=t[2];this._hex=n.rgbToHex(e,r,i)}return this._hex},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"population",{get:function(){return this._population},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return{rgb:this.rgb,population:this.population}},t.prototype.getRgb=function(){return this._rgb},t.prototype.getHsl=function(){return this.hsl},t.prototype.getPopulation=function(){return this._population},t.prototype.getHex=function(){return this.hex},t.prototype.getYiq=function(){if(!this._yiq){var t=this._rgb;this._yiq=(299*t[0]+587*t[1]+114*t[2])/1e3}return this._yiq},Object.defineProperty(t.prototype,"titleTextColor",{get:function(){return this._titleTextColor&&(this._titleTextColor=this.getYiq()<200?"#fff":"#000"),this._titleTextColor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bodyTextColor",{get:function(){return this._bodyTextColor&&(this._bodyTextColor=this.getYiq()<150?"#fff":"#000"),this._bodyTextColor},enumerable:!1,configurable:!0}),t.prototype.getTitleTextColor=function(){return this.titleTextColor},t.prototype.getBodyTextColor=function(){return this.bodyTextColor},t}();e.Swatch=i},function(t,e,r){"use strict";function n(t){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(!e)throw new RangeError("'"+t+"' is not a valid hex color");return[e[1],e[2],e[3]].map((function(t){return parseInt(t,16)}))}function i(t,e,r){return e/=255,r/=255,t=(t/=255)>.04045?Math.pow((t+.005)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.005)/1.055,2.4):e/12.92,r=r>.04045?Math.pow((r+.005)/1.055,2.4):r/12.92,[.4124*(t*=100)+.3576*(e*=100)+.1805*(r*=100),.2126*t+.7152*e+.0722*r,.0193*t+.1192*e+.9505*r]}function a(t,e,r){return e/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116)-16,500*(t-e),200*(e-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]}function o(t,e,r){var n=i(t,e,r);return a(n[0],n[1],n[2])}function s(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],o=e[1],s=e[2],l=r-a,u=n-o,c=i-s,p=Math.sqrt(n*n+i*i),f=a-r,d=Math.sqrt(o*o+s*s)-p,m=Math.sqrt(l*l+u*u+c*c),h=Math.sqrt(m)>Math.sqrt(Math.abs(f))+Math.sqrt(Math.abs(d))?Math.sqrt(m*m-f*f-d*d):0;return f/=1,d/=1*(1+.045*p),h/=1*(1+.015*p),Math.sqrt(f*f+d*d+h*h)}function l(t,e){return s(o.apply(void 0,t),o.apply(void 0,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.getColorDiffStatus=e.hexDiff=e.rgbDiff=e.deltaE94=e.rgbToCIELab=e.xyzToCIELab=e.rgbToXyz=e.hslToRgb=e.rgbToHsl=e.rgbToHex=e.hexToRgb=e.DELTAE94_DIFF_STATUS=void 0,e.DELTAE94_DIFF_STATUS={NA:0,PERFECT:1,CLOSE:2,GOOD:10,SIMILAR:50},e.hexToRgb=n,e.rgbToHex=function(t,e,r){return"#"+((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1,7)},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;var n=Math.max(t,e,r),i=Math.min(t,e,r),a=0,o=0,s=(n+i)/2;if(n!==i){var l=n-i;switch(o=s>.5?l/(2-n-i):l/(n+i),n){case t:a=(e-r)/l+(e<r?6:0);break;case e:a=(r-t)/l+2;break;case r:a=(t-e)/l+4}a/=6}return[a,o,s]},e.hslToRgb=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return[255*n,255*i,255*a]},e.rgbToXyz=i,e.xyzToCIELab=a,e.rgbToCIELab=o,e.deltaE94=s,e.rgbDiff=l,e.hexDiff=function(t,e){return l(n(t),n(e))},e.getColorDiffStatus=function(t){return t<e.DELTAE94_DIFF_STATUS.NA?"N/A":t<=e.DELTAE94_DIFF_STATUS.PERFECT?"Perfect":t<=e.DELTAE94_DIFF_STATUS.CLOSE?"Close":t<=e.DELTAE94_DIFF_STATUS.GOOD?"Good":t<e.DELTAE94_DIFF_STATUS.SIMILAR?"Similar":"Wrong"}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=n(r(6)),a=n(r(9));i.default.DefaultOpts.ImageClass=a.default,t.exports=i.default},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 i=n(r(1));i.default.DefaultOpts.quantizer="mmcq",i.default.DefaultOpts.generators=["default"],i.default.DefaultOpts.filters=["default"],e.default=i.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildProcessOptions=void 0;var n=r(0);e.buildProcessOptions=function(t,e){var r=t.colorCount,i=t.quantizer,a=t.generators,o=t.filters,s={colorCount:r},l="string"==typeof i?{name:i,options:{}}:i;return l.options=n.assignDeep({},s,l.options),n.assignDeep({},{quantizer:l,generators:a,filters:o},e)}},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 i=n(r(1)),a=r(0),o=function(){function t(t,e){void 0===e&&(e={}),this._src=t,this._opts=a.assignDeep({},i.default.DefaultOpts,e)}return t.prototype.maxColorCount=function(t){return this._opts.colorCount=t,this},t.prototype.maxDimension=function(t){return this._opts.maxDimension=t,this},t.prototype.addFilter=function(t){return this._opts.filters?this._opts.filters.push(t):this._opts.filters=[t],this},t.prototype.removeFilter=function(t){if(this._opts.filters){var e=this._opts.filters.indexOf(t);e>0&&this._opts.filters.splice(e)}return this},t.prototype.clearFilters=function(){return this._opts.filters=[],this},t.prototype.quality=function(t){return this._opts.quality=t,this},t.prototype.useImageClass=function(t){return this._opts.ImageClass=t,this},t.prototype.useGenerator=function(t,e){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(e?{name:t,options:e}:t),this},t.prototype.useQuantizer=function(t,e){return this._opts.quantizer=e?{name:t,options:e}:t,this},t.prototype.build=function(){return new i.default(this._src,this._opts)},t.prototype.getPalette=function(t){return this.build().getPalette(t)},t.prototype.getSwatches=function(t){return this.build().getPalette(t)},t}();e.default=o},function(t,e,r){"use strict";var n,i=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)e.hasOwnProperty(r)&&(t[r]=e[r])},n(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype._initCanvas=function(){var t=this.image,e=this._canvas=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new ReferenceError("Failed to create canvas context");this._context=r,e.className="@vibrant/canvas",e.style.display="none",this._width=e.width=t.width,this._height=e.height=t.height,r.drawImage(t,0,0),document.body.appendChild(e)},e.prototype.load=function(t){var e,r,n,i,a,o,s,l=this;if("string"==typeof t)e=document.createElement("img"),r=t,(s=new URL(r,location.href)).protocol===location.protocol&&s.host===location.host&&s.port===location.port||(n=window.location.href,i=r,a=new URL(n),o=new URL(i),a.protocol===o.protocol&&a.hostname===o.hostname&&a.port===o.port)||(e.crossOrigin="anonymous"),e.src=r;else{if(!(t instanceof HTMLImageElement))return Promise.reject(new Error("Cannot load buffer as an image in browser"));e=t,r=t.src}return this.image=e,new Promise((function(t,n){var i=function(){l._initCanvas(),t(l)};e.complete?i():(e.onload=i,e.onerror=function(t){return n(new Error("Fail to load image: "+r))})}))},e.prototype.clear=function(){this._context.clearRect(0,0,this._width,this._height)},e.prototype.update=function(t){this._context.putImageData(t,0,0)},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.resize=function(t,e,r){var n=this,i=n._canvas,a=n._context,o=n.image;this._width=i.width=t,this._height=i.height=e,a.scale(r,r),a.drawImage(o,0,0)},e.prototype.getPixelCount=function(){return this._width*this._height},e.prototype.getImageData=function(){return this._context.getImageData(0,0,this._width,this._height)},e.prototype.remove=function(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)},e}(r(2).ImageBase);e.default=a},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=r(5),a=n(r(11));i.use(a.default),t.exports=i},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 i=n(r(12)),a=n(r(16)),o=(new(r(17).BasicPipeline)).filter.register("default",(function(t,e,r,n){return n>=125&&!(t>250&&e>250&&r>250)})).quantizer.register("mmcq",i.default).generator.register("default",a.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 i=r(3),a=n(r(13)),o=n(r(15));function s(t,e){for(var r=t.size();t.size()<e;){var n=t.pop();if(!(n&&n.count()>0))break;var i=n.split(),a=i[0],o=i[1];if(t.push(a),o&&o.count()>0&&t.push(o),t.size()===r)break;r=t.size()}}e.default=function(t,e){if(0===t.length||e.colorCount<2||e.colorCount>256)throw new Error("Wrong MMCQ parameters");var r=a.default.build(t),n=(r.histogram.colorCount,new o.default((function(t,e){return t.count()-e.count()})));n.push(r),s(n,.75*e.colorCount);var l=new o.default((function(t,e){return t.count()*t.volume()-e.count()*e.volume()}));return l.contents=n.contents,s(l,e.colorCount-l.size()),function(t){for(var e=[];t.size();){var r=t.pop(),n=r.avg();n[0],n[1],n[2],e.push(new i.Swatch(n,r.count()))}return e}(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 i=n(r(14)),a=function(){function t(t,e,r,n,i,a,o){this.histogram=o,this._volume=-1,this._count=-1,this.dimension={r1:t,r2:e,g1:r,g2:n,b1:i,b2:a}}return t.build=function(e){var r=new i.default(e,{sigBits:5});return new t(r.rmin,r.rmax,r.gmin,r.gmax,r.bmin,r.bmax,r)},t.prototype.invalidate=function(){this._volume=this._count=-1,this._avg=null},t.prototype.volume=function(){if(this._volume<0){var t=this.dimension,e=t.r1,r=t.r2,n=t.g1,i=t.g2,a=t.b1,o=t.b2;this._volume=(r-e+1)*(i-n+1)*(o-a+1)}return this._volume},t.prototype.count=function(){if(this._count<0){for(var t=this.histogram,e=t.hist,r=t.getColorIndex,n=this.dimension,i=n.r1,a=n.r2,o=n.g1,s=n.g2,l=n.b1,u=n.b2,c=0,p=i;p<=a;p++)for(var f=o;f<=s;f++)for(var d=l;d<=u;d++)c+=e[r(p,f,d)];this._count=c}return this._count},t.prototype.clone=function(){var e=this.histogram,r=this.dimension;return new t(r.r1,r.r2,r.g1,r.g2,r.b1,r.b2,e)},t.prototype.avg=function(){if(!this._avg){var t=this.histogram,e=t.hist,r=t.getColorIndex,n=this.dimension,i=n.r1,a=n.r2,o=n.g1,s=n.g2,l=n.b1,u=n.b2,c=0,p=void 0,f=void 0,d=void 0;p=f=d=0;for(var m=i;m<=a;m++)for(var h=o;h<=s;h++)for(var g=l;g<=u;g++){var b=e[r(m,h,g)];c+=b,p+=b*(m+.5)*8,f+=b*(h+.5)*8,d+=b*(g+.5)*8}this._avg=c?[~~(p/c),~~(f/c),~~(d/c)]:[~~(8*(i+a+1)/2),~~(8*(o+s+1)/2),~~(8*(l+u+1)/2)]}return this._avg},t.prototype.contains=function(t){var e=t[0],r=t[1],n=t[2],i=this.dimension,a=i.r1,o=i.r2,s=i.g1,l=i.g2,u=i.b1,c=i.b2;return r>>=3,n>>=3,(e>>=3)>=a&&e<=o&&r>=s&&r<=l&&n>=u&&n<=c},t.prototype.split=function(){var t=this.histogram,e=t.hist,r=t.getColorIndex,n=this.dimension,i=n.r1,a=n.r2,o=n.g1,s=n.g2,l=n.b1,u=n.b2,c=this.count();if(!c)return[];if(1===c)return[this.clone()];var p,f,d=a-i+1,m=s-o+1,h=u-l+1,g=Math.max(d,m,h),b=null;p=f=0;var y=null;if(g===d){y="r",b=new Uint32Array(a+1);for(var _=i;_<=a;_++){p=0;for(var v=o;v<=s;v++)for(var w=l;w<=u;w++)p+=e[r(_,v,w)];f+=p,b[_]=f}}else if(g===m)for(y="g",b=new Uint32Array(s+1),v=o;v<=s;v++){for(p=0,_=i;_<=a;_++)for(w=l;w<=u;w++)p+=e[r(_,v,w)];f+=p,b[v]=f}else for(y="b",b=new Uint32Array(u+1),w=l;w<=u;w++){for(p=0,_=i;_<=a;_++)for(v=o;v<=s;v++)p+=e[r(_,v,w)];f+=p,b[w]=f}for(var x=-1,S=new Uint32Array(b.length),M=0;M<b.length;M++){var D=b[M];x<0&&D>f/2&&(x=M),S[M]=f-D}var C=this;return function(t){var e=t+"1",r=t+"2",n=C.dimension[e],i=C.dimension[r],a=C.clone(),o=C.clone(),s=x-n,l=i-x;for(s<=l?(i=Math.min(i-1,~~(x+l/2)),i=Math.max(0,i)):(i=Math.max(n,~~(x-1-s/2)),i=Math.min(C.dimension[r],i));!b[i];)i++;for(var u=S[i];!u&&b[i-1];)u=S[--i];return a.dimension[r]=i,o.dimension[e]=i+1,[a,o]}(y)},t}();e.default=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this.pixels=t,this.opts=e;var r=e.sigBits,n=function(t,e,n){return(t<<2*r)+(e<<r)+n};this.getColorIndex=n;var i,a,o,s,l,u,c,p,f,d=8-r,m=new Uint32Array(1<<3*r);i=o=l=0,a=s=u=Number.MAX_VALUE;for(var h=t.length/4,g=0;g<h;){var b=4*g;g++,c=t[b+0],p=t[b+1],f=t[b+2],0!==t[b+3]&&(m[n(c>>=d,p>>=d,f>>=d)]+=1,c>i&&(i=c),c<a&&(a=c),p>o&&(o=p),p<s&&(s=p),f>l&&(l=f),f<u&&(u=f))}this._colorCount=m.reduce((function(t,e){return e>0?t+1:t}),0),this.hist=m,this.rmax=i,this.rmin=a,this.gmax=o,this.gmin=s,this.bmax=l,this.bmin=u}return Object.defineProperty(t.prototype,"colorCount",{get:function(){return this._colorCount},enumerable:!1,configurable:!0}),t}();e.default=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this._comparator=t,this.contents=[],this._sorted=!1}return t.prototype._sort=function(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)},t.prototype.push=function(t){this.contents.push(t),this._sorted=!1},t.prototype.peek=function(t){return this._sort(),t="number"==typeof t?t:this.contents.length-1,this.contents[t]},t.prototype.pop=function(){return this._sort(),this.contents.pop()},t.prototype.size=function(){return this.contents.length},t.prototype.map=function(t){return this._sort(),this.contents.map(t)},t}();e.default=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3),i=r(4),a={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function o(t,e,r,n,i,a,o,s,l,u){var c=null,p=0;return e.forEach((function(e){var f=e.hsl,d=f[1],m=f[2];if(d>=s&&d<=l&&m>=i&&m<=a&&!function(t,e){return t.Vibrant===e||t.DarkVibrant===e||t.LightVibrant===e||t.Muted===e||t.DarkMuted===e||t.LightMuted===e}(t,e)){var h=function(t,e,r,n,i,a,o){function s(t,e){return 1-Math.abs(t-e)}return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,n=0,i=0;i<t.length;i+=2){var a=t[i],o=t[i+1];r+=a*o,n+=o}return r/n}(s(t,e),o.weightSaturation,s(r,n),o.weightLuma,i/a,o.weightPopulation)}(d,o,m,n,e.population,r,u);(null===c||h>p)&&(c=e,p=h)}})),c}e.default=function(t,e){e=Object.assign({},a,e);var r=function(t){var e=0;return t.forEach((function(t){e=Math.max(e,t.population)})),e}(t),s=function(t,e,r){var n={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return n.Vibrant=o(n,t,e,r.targetNormalLuma,r.minNormalLuma,r.maxNormalLuma,r.targetVibrantSaturation,r.minVibrantSaturation,1,r),n.LightVibrant=o(n,t,e,r.targetLightLuma,r.minLightLuma,1,r.targetVibrantSaturation,r.minVibrantSaturation,1,r),n.DarkVibrant=o(n,t,e,r.targetDarkLuma,0,r.maxDarkLuma,r.targetVibrantSaturation,r.minVibrantSaturation,1,r),n.Muted=o(n,t,e,r.targetNormalLuma,r.minNormalLuma,r.maxNormalLuma,r.targetMutesSaturation,0,r.maxMutesSaturation,r),n.LightMuted=o(n,t,e,r.targetLightLuma,r.minLightLuma,1,r.targetMutesSaturation,0,r.maxMutesSaturation,r),n.DarkMuted=o(n,t,e,r.targetDarkLuma,0,r.maxDarkLuma,r.targetMutesSaturation,0,r.maxMutesSaturation,r),n}(t,r,e);return function(t,e,r){if(!t.Vibrant&&!t.DarkVibrant&&!t.LightVibrant){if(!t.DarkVibrant&&t.DarkMuted){var a=t.DarkMuted.hsl,o=a[0],s=a[1],l=a[2];l=r.targetDarkLuma,t.DarkVibrant=new n.Swatch(i.hslToRgb(o,s,l),0)}if(!t.LightVibrant&&t.LightMuted){var u=t.LightMuted.hsl;o=u[0],s=u[1],l=u[2],l=r.targetDarkLuma,t.DarkVibrant=new n.Swatch(i.hslToRgb(o,s,l),0)}}if(!t.Vibrant&&t.DarkVibrant){var c=t.DarkVibrant.hsl;o=c[0],s=c[1],l=c[2],l=r.targetNormalLuma,t.Vibrant=new n.Swatch(i.hslToRgb(o,s,l),0)}else if(!t.Vibrant&&t.LightVibrant){var p=t.LightVibrant.hsl;o=p[0],s=p[1],l=p[2],l=r.targetNormalLuma,t.Vibrant=new n.Swatch(i.hslToRgb(o,s,l),0)}if(!t.DarkVibrant&&t.Vibrant){var f=t.Vibrant.hsl;o=f[0],s=f[1],l=f[2],l=r.targetDarkLuma,t.DarkVibrant=new n.Swatch(i.hslToRgb(o,s,l),0)}if(!t.LightVibrant&&t.Vibrant){var d=t.Vibrant.hsl;o=d[0],s=d[1],l=d[2],l=r.targetLightLuma,t.LightVibrant=new n.Swatch(i.hslToRgb(o,s,l),0)}if(!t.Muted&&t.Vibrant){var m=t.Vibrant.hsl;o=m[0],s=m[1],l=m[2],l=r.targetMutesSaturation,t.Muted=new n.Swatch(i.hslToRgb(o,s,l),0)}if(!t.DarkMuted&&t.DarkVibrant){var h=t.DarkVibrant.hsl;o=h[0],s=h[1],l=h[2],l=r.targetMutesSaturation,t.DarkMuted=new n.Swatch(i.hslToRgb(o,s,l),0)}if(!t.LightMuted&&t.LightVibrant){var g=t.LightVibrant.hsl;o=g[0],s=g[1],l=g[2],l=r.targetMutesSaturation,t.LightMuted=new n.Swatch(i.hslToRgb(o,s,l),0)}}(s,0,e),s}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,s)}l((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.BasicPipeline=e.Stage=void 0;var a=r(2),o=function(){function t(t){this.pipeline=t,this._map={}}return t.prototype.names=function(){return Object.keys(this._map)},t.prototype.has=function(t){return!!this._map[t]},t.prototype.get=function(t){return this._map[t]},t.prototype.register=function(t,e){return this._map[t]=e,this.pipeline},t}();e.Stage=o;var s=function(){function t(){this.filter=new o(this),this.quantizer=new o(this),this.generator=new o(this)}return t.prototype._buildProcessTasks=function(t){var e=this,r=t.filters,n=t.quantizer,i=t.generators;return 1===i.length&&"*"===i[0]&&(i=this.generator.names()),{filters:r.map((function(t){return a(e.filter,t)})),quantizer:a(this.quantizer,n),generators:i.map((function(t){return a(e.generator,t)}))};function a(t,e){var r,n;return"string"==typeof e?r=e:(r=e.name,n=e.options),{name:r,fn:t.get(r),options:n}}},t.prototype.process=function(t,e){return n(this,void 0,void 0,(function(){var r,n,a,o,s,l,u;return i(this,(function(i){switch(i.label){case 0:return r=this._buildProcessTasks(e),n=r.filters,a=r.quantizer,o=r.generators,[4,this._filterColors(n,t)];case 1:return s=i.sent(),[4,this._generateColors(a,s)];case 2:return l=i.sent(),[4,this._generatePalettes(o,l)];case 3:return u=i.sent(),[2,{colors:l,palettes:u}]}}))}))},t.prototype._filterColors=function(t,e){return Promise.resolve(a.applyFilters(e,t.map((function(t){return t.fn}))))},t.prototype._generateColors=function(t,e){return Promise.resolve(t.fn(e.data,t.options))},t.prototype._generatePalettes=function(t,e){return n(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){var r=t.fn,n=t.options;return Promise.resolve(r(e,n))})))];case 1:return r=n.sent(),[2,Promise.resolve(r.reduce((function(e,r,n){return e[t[n].name]=r,e}),{}))]}}))}))},t}();e.BasicPipeline=s}])},t.exports=e()}}]);
//# sourceMappingURL=ae08cc6b.js.map