UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

309 lines (263 loc) 25.7 kB
/*! For license information please see chunk.3beab570eb6c7c909d4f.js.LICENSE.txt */ (self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[47,1578,4570,2132,1223],{35854:(e,t,i)=>{"use strict";i.d(t,{G:()=>a,R:()=>r});i(65233);var n=i(21006),o=i(98235);const a={properties:{checked:{type:Boolean,value:!1,reflectToAttribute:!0,notify:!0,observer:"_checkedChanged"},toggles:{type:Boolean,value:!0,reflectToAttribute:!0},value:{type:String,value:"on",observer:"_valueChanged"}},observers:["_requiredChanged(required)"],created:function(){this._hasIronCheckedElementBehavior=!0},_getValidity:function(e){return this.disabled||!this.required||this.checked},_requiredChanged:function(){this.required?this.setAttribute("aria-required","true"):this.removeAttribute("aria-required")},_checkedChanged:function(){this.active=this.checked,this.fire("iron-change")},_valueChanged:function(){void 0!==this.value&&null!==this.value||(this.value="on")}},r=[n.V,o.x,a]},99257:(e,t,i)=>{"use strict";i(65233);var n=i(15112),o=i(9672),a=i(87156);(0,o.k)({is:"iron-iconset-svg",properties:{name:{type:String,observer:"_nameChanged"},size:{type:Number,value:24},rtlMirroring:{type:Boolean,value:!1},useGlobalRtlAttribute:{type:Boolean,value:!1}},created:function(){this._meta=new n.P({type:"iconset",key:null,value:null})},attached:function(){this.style.display="none"},getIconNames:function(){return this._icons=this._createIconMap(),Object.keys(this._icons).map((function(e){return this.name+":"+e}),this)},applyIcon:function(e,t){this.removeIcon(e);var i=this._cloneIcon(t,this.rtlMirroring&&this._targetIsRTL(e));if(i){var n=(0,a.vz)(e.root||e);return n.insertBefore(i,n.childNodes[0]),e._svgIcon=i}return null},removeIcon:function(e){e._svgIcon&&((0,a.vz)(e.root||e).removeChild(e._svgIcon),e._svgIcon=null)},_targetIsRTL:function(e){if(null==this.__targetIsRTL)if(this.useGlobalRtlAttribute){var t=document.body&&document.body.hasAttribute("dir")?document.body:document.documentElement;this.__targetIsRTL="rtl"===t.getAttribute("dir")}else e&&e.nodeType!==Node.ELEMENT_NODE&&(e=e.host),this.__targetIsRTL=e&&"rtl"===window.getComputedStyle(e).direction;return this.__targetIsRTL},_nameChanged:function(){this._meta.value=null,this._meta.key=this.name,this._meta.value=this,this.async((function(){this.fire("iron-iconset-added",this,{node:window})}))},_createIconMap:function(){var e=Object.create(null);return(0,a.vz)(this).querySelectorAll("[id]").forEach((function(t){e[t.id]=t})),e},_cloneIcon:function(e,t){return this._icons=this._icons||this._createIconMap(),this._prepareSvgClone(this._icons[e],this.size,t)},_prepareSvgClone:function(e,t,i){if(e){var n=e.cloneNode(!0),o=document.createElementNS("http://www.w3.org/2000/svg","svg"),a=n.getAttribute("viewBox")||"0 0 "+t+" "+t,r="pointer-events: none; display: block; width: 100%; height: 100%;";return i&&n.hasAttribute("mirror-in-rtl")&&(r+="-webkit-transform:scale(-1,1);transform:scale(-1,1);transform-origin:center;"),o.setAttribute("viewBox",a),o.setAttribute("preserveAspectRatio","xMidYMid meet"),o.setAttribute("focusable","false"),o.style.cssText=r,o.appendChild(n).removeAttribute("id"),o}return null}})},62132:(e,t,i)=>{"use strict";i.d(t,{K:()=>s});i(65233);var n=i(35854),o=i(49075),a=i(84938);const r={_checkedChanged:function(){n.G._checkedChanged.call(this),this.hasRipple()&&(this.checked?this._ripple.setAttribute("checked",""):this._ripple.removeAttribute("checked"))},_buttonStateChanged:function(){a.o._buttonStateChanged.call(this),this.disabled||this.isAttached&&(this.checked=this.active)}},s=[o.B,n.R,r]},49075:(e,t,i)=>{"use strict";i.d(t,{S:()=>r,B:()=>s});i(65233);var n=i(51644),o=i(26110),a=i(84938);const r={observers:["_focusedChanged(receivedFocusFromKeyboard)"],_focusedChanged:function(e){e&&this.ensureRipple(),this.hasRipple()&&(this._ripple.holdDown=e)},_createRipple:function(){var e=a.o._createRipple();return e.id="ink",e.setAttribute("center",""),e.classList.add("circle"),e}},s=[n.P,o.a,a.o,r]},84938:(e,t,i)=>{"use strict";i.d(t,{o:()=>a});i(65233),i(60748);var n=i(51644),o=i(87156);const a={properties:{noink:{type:Boolean,observer:"_noinkChanged"},_rippleContainer:{type:Object}},_buttonStateChanged:function(){this.focused&&this.ensureRipple()},_downHandler:function(e){n.$._downHandler.call(this,e),this.pressed&&this.ensureRipple(e)},ensureRipple:function(e){if(!this.hasRipple()){this._ripple=this._createRipple(),this._ripple.noink=this.noink;var t=this._rippleContainer||this.root;if(t&&(0,o.vz)(t).appendChild(this._ripple),e){var i=(0,o.vz)(this._rippleContainer||this),n=(0,o.vz)(e).rootTarget;i.deepContains(n)&&this._ripple.uiDownAction(e)}}},getRipple:function(){return this.ensureRipple(),this._ripple},hasRipple:function(){return Boolean(this._ripple)},_createRipple:function(){return document.createElement("paper-ripple")},_noinkChanged:function(e){this.hasRipple()&&(this._ripple.noink=e)}}},32296:(e,t,i)=>{"use strict";i(65233),i(1656);var n=i(62132),o=i(49075),a=i(9672),r=i(50856),s=i(87529);const c=r.d`<style> :host { display: inline-block; white-space: nowrap; cursor: pointer; --calculated-paper-checkbox-size: var(--paper-checkbox-size, 18px); /* -1px is a sentinel for the default and is replaced in \`attached\`. */ --calculated-paper-checkbox-ink-size: var(--paper-checkbox-ink-size, -1px); @apply --paper-font-common-base; line-height: 0; -webkit-tap-highlight-color: transparent; } :host([hidden]) { display: none !important; } :host(:focus) { outline: none; } .hidden { display: none; } #checkboxContainer { display: inline-block; position: relative; width: var(--calculated-paper-checkbox-size); height: var(--calculated-paper-checkbox-size); min-width: var(--calculated-paper-checkbox-size); margin: var(--paper-checkbox-margin, initial); vertical-align: var(--paper-checkbox-vertical-align, middle); background-color: var(--paper-checkbox-unchecked-background-color, transparent); } #ink { position: absolute; /* Center the ripple in the checkbox by negative offsetting it by * (inkWidth - rippleWidth) / 2 */ top: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2); left: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2); width: var(--calculated-paper-checkbox-ink-size); height: var(--calculated-paper-checkbox-ink-size); color: var(--paper-checkbox-unchecked-ink-color, var(--primary-text-color)); opacity: 0.6; pointer-events: none; } #ink:dir(rtl) { right: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2); left: auto; } #ink[checked] { color: var(--paper-checkbox-checked-ink-color, var(--primary-color)); } #checkbox { position: relative; box-sizing: border-box; height: 100%; border: solid 2px; border-color: var(--paper-checkbox-unchecked-color, var(--primary-text-color)); border-radius: 2px; pointer-events: none; -webkit-transition: background-color 140ms, border-color 140ms; transition: background-color 140ms, border-color 140ms; -webkit-transition-duration: var(--paper-checkbox-animation-duration, 140ms); transition-duration: var(--paper-checkbox-animation-duration, 140ms); } /* checkbox checked animations */ #checkbox.checked #checkmark { -webkit-animation: checkmark-expand 140ms ease-out forwards; animation: checkmark-expand 140ms ease-out forwards; -webkit-animation-duration: var(--paper-checkbox-animation-duration, 140ms); animation-duration: var(--paper-checkbox-animation-duration, 140ms); } @-webkit-keyframes checkmark-expand { 0% { -webkit-transform: scale(0, 0) rotate(45deg); } 100% { -webkit-transform: scale(1, 1) rotate(45deg); } } @keyframes checkmark-expand { 0% { transform: scale(0, 0) rotate(45deg); } 100% { transform: scale(1, 1) rotate(45deg); } } #checkbox.checked { background-color: var(--paper-checkbox-checked-color, var(--primary-color)); border-color: var(--paper-checkbox-checked-color, var(--primary-color)); } #checkmark { position: absolute; width: 36%; height: 70%; border-style: solid; border-top: none; border-left: none; border-right-width: calc(2/15 * var(--calculated-paper-checkbox-size)); border-bottom-width: calc(2/15 * var(--calculated-paper-checkbox-size)); border-color: var(--paper-checkbox-checkmark-color, white); -webkit-transform-origin: 97% 86%; transform-origin: 97% 86%; box-sizing: content-box; /* protect against page-level box-sizing */ } #checkmark:dir(rtl) { -webkit-transform-origin: 50% 14%; transform-origin: 50% 14%; } /* label */ #checkboxLabel { position: relative; display: inline-block; vertical-align: middle; padding-left: var(--paper-checkbox-label-spacing, 8px); white-space: normal; line-height: normal; color: var(--paper-checkbox-label-color, var(--primary-text-color)); @apply --paper-checkbox-label; } :host([checked]) #checkboxLabel { color: var(--paper-checkbox-label-checked-color, var(--paper-checkbox-label-color, var(--primary-text-color))); @apply --paper-checkbox-label-checked; } #checkboxLabel:dir(rtl) { padding-right: var(--paper-checkbox-label-spacing, 8px); padding-left: 0; } #checkboxLabel[hidden] { display: none; } /* disabled state */ :host([disabled]) #checkbox { opacity: 0.5; border-color: var(--paper-checkbox-unchecked-color, var(--primary-text-color)); } :host([disabled][checked]) #checkbox { background-color: var(--paper-checkbox-unchecked-color, var(--primary-text-color)); opacity: 0.5; } :host([disabled]) #checkboxLabel { opacity: 0.65; } /* invalid state */ #checkbox.invalid:not(.checked) { border-color: var(--paper-checkbox-error-color, var(--error-color)); } </style> <div id="checkboxContainer"> <div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]"> <div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div> </div> </div> <div id="checkboxLabel"><slot></slot></div>`;c.setAttribute("strip-whitespace",""),(0,a.k)({_template:c,is:"paper-checkbox",behaviors:[n.K],hostAttributes:{role:"checkbox","aria-checked":!1,tabindex:0},properties:{ariaActiveAttribute:{type:String,value:"aria-checked"}},attached:function(){(0,s.T8)(this,(function(){if("-1px"===this.getComputedStyleValue("--calculated-paper-checkbox-ink-size").trim()){var e=this.getComputedStyleValue("--calculated-paper-checkbox-size").trim(),t="px",i=e.match(/[A-Za-z]+$/);null!==i&&(t=i[0]);var n=parseFloat(e),o=8/3*n;"px"===t&&(o=Math.floor(o))%2!=n%2&&o++,this.updateStyles({"--paper-checkbox-ink-size":o+t})}}))},_computeCheckboxClass:function(e,t){var i="";return e&&(i+="checked "),t&&(i+="invalid"),i},_computeCheckmarkClass:function(e){return e?"":"hidden"},_createRipple:function(){return this._rippleContainer=this.$.checkboxContainer,o.S._createRipple.call(this)}})},8878:(e,t,i)=>{"use strict";i(65233),i(8621),i(63207),i(30879),i(78814),i(60748),i(1656),i(57548),i(73962);var n=i(51644),o=i(26110),a=i(21006),r=i(98235),s=i(9672),c=i(87156),l=i(81668),h=i(50856);(0,s.k)({_template:h.d` <style include="paper-dropdown-menu-shared-styles"></style> <!-- this div fulfills an a11y requirement for combobox, do not remove --> <span role="button"></span> <paper-menu-button id="menuButton" vertical-align="[[verticalAlign]]" horizontal-align="[[horizontalAlign]]" dynamic-align="[[dynamicAlign]]" vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat, verticalOffset)]]" disabled="[[disabled]]" no-animations="[[noAnimations]]" on-iron-select="_onIronSelect" on-iron-deselect="_onIronDeselect" opened="{{opened}}" close-on-activate allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]"> <!-- support hybrid mode: user might be using paper-menu-button 1.x which distributes via <content> --> <div class="dropdown-trigger" slot="dropdown-trigger"> <paper-ripple></paper-ripple> <!-- paper-input has type="text" for a11y, do not remove --> <paper-input type="text" invalid="[[invalid]]" readonly disabled="[[disabled]]" value="[[value]]" placeholder="[[placeholder]]" error-message="[[errorMessage]]" always-float-label="[[alwaysFloatLabel]]" no-label-float="[[noLabelFloat]]" label="[[label]]"> <!-- support hybrid mode: user might be using paper-input 1.x which distributes via <content> --> <iron-icon icon="paper-dropdown-menu:arrow-drop-down" suffix slot="suffix"></iron-icon> </paper-input> </div> <slot id="content" name="dropdown-content" slot="dropdown-content"></slot> </paper-menu-button> `,is:"paper-dropdown-menu",behaviors:[n.P,o.a,a.V,r.x],properties:{selectedItemLabel:{type:String,notify:!0,readOnly:!0},selectedItem:{type:Object,notify:!0,readOnly:!0},value:{type:String,notify:!0},label:{type:String},placeholder:{type:String},errorMessage:{type:String},opened:{type:Boolean,notify:!0,value:!1,observer:"_openedChanged"},allowOutsideScroll:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1,reflectToAttribute:!0},alwaysFloatLabel:{type:Boolean,value:!1},noAnimations:{type:Boolean,value:!1},horizontalAlign:{type:String,value:"right"},verticalAlign:{type:String,value:"top"},verticalOffset:Number,dynamicAlign:{type:Boolean},restoreFocusOnClose:{type:Boolean,value:!0}},listeners:{tap:"_onTap"},keyBindings:{"up down":"open",esc:"close"},hostAttributes:{role:"combobox","aria-autocomplete":"none","aria-haspopup":"true"},observers:["_selectedItemChanged(selectedItem)"],attached:function(){var e=this.contentElement;e&&e.selectedItem&&this._setSelectedItem(e.selectedItem)},get contentElement(){for(var e=(0,c.vz)(this.$.content).getDistributedNodes(),t=0,i=e.length;t<i;t++)if(e[t].nodeType===Node.ELEMENT_NODE)return e[t]},open:function(){this.$.menuButton.open()},close:function(){this.$.menuButton.close()},_onIronSelect:function(e){this._setSelectedItem(e.detail.item)},_onIronDeselect:function(e){this._setSelectedItem(null)},_onTap:function(e){l.nJ(e)===this&&this.open()},_selectedItemChanged:function(e){var t="";t=e?e.label||e.getAttribute("label")||e.textContent.trim():"",this.value=t,this._setSelectedItemLabel(t)},_computeMenuVerticalOffset:function(e,t){return t||(e?-4:8)},_getValidity:function(e){return this.disabled||!this.required||this.required&&!!this.value},_openedChanged:function(){var e=this.opened?"true":"false",t=this.contentElement;t&&t.setAttribute("aria-expanded",e)}})},25782:(e,t,i)=>{"use strict";i(65233),i(65660),i(47686),i(97968);var n=i(9672),o=i(50856),a=i(33760);(0,n.k)({_template:o.d` <style include="paper-item-shared-styles"></style> <style> :host { @apply --layout-horizontal; @apply --layout-center; @apply --paper-font-subhead; @apply --paper-item; @apply --paper-icon-item; } .content-icon { @apply --layout-horizontal; @apply --layout-center; width: var(--paper-item-icon-width, 56px); @apply --paper-item-icon; } </style> <div id="contentIcon" class="content-icon"> <slot name="item-icon"></slot> </div> <slot></slot> `,is:"paper-icon-item",behaviors:[a.U]})},51095:(e,t,i)=>{"use strict";i(65233),i(1656);var n=i(78161),o=i(9672),a=i(50856);(0,o.k)({_template:a.d` <style> :host { display: block; padding: 8px 0; background: var(--paper-listbox-background-color, var(--primary-background-color)); color: var(--paper-listbox-color, var(--primary-text-color)); @apply --paper-listbox; } </style> <slot></slot> `,is:"paper-listbox",behaviors:[n.i],hostAttributes:{role:"listbox"}})},60748:(e,t,i)=>{"use strict";i(65233);var n=i(8621),o=i(9672),a=i(87156),r=i(50856),s={distance:function(e,t,i,n){var o=e-i,a=t-n;return Math.sqrt(o*o+a*a)},now:window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now};function c(e){this.element=e,this.width=this.boundingRect.width,this.height=this.boundingRect.height,this.size=Math.max(this.width,this.height)}function l(e){this.element=e,this.color=window.getComputedStyle(e).color,this.wave=document.createElement("div"),this.waveContainer=document.createElement("div"),this.wave.style.backgroundColor=this.color,this.wave.classList.add("wave"),this.waveContainer.classList.add("wave-container"),(0,a.vz)(this.waveContainer).appendChild(this.wave),this.resetInteractionState()}c.prototype={get boundingRect(){return this.element.getBoundingClientRect()},furthestCornerDistanceFrom:function(e,t){var i=s.distance(e,t,0,0),n=s.distance(e,t,this.width,0),o=s.distance(e,t,0,this.height),a=s.distance(e,t,this.width,this.height);return Math.max(i,n,o,a)}},l.MAX_RADIUS=300,l.prototype={get recenters(){return this.element.recenters},get center(){return this.element.center},get mouseDownElapsed(){var e;return this.mouseDownStart?(e=s.now()-this.mouseDownStart,this.mouseUpStart&&(e-=this.mouseUpElapsed),e):0},get mouseUpElapsed(){return this.mouseUpStart?s.now()-this.mouseUpStart:0},get mouseDownElapsedSeconds(){return this.mouseDownElapsed/1e3},get mouseUpElapsedSeconds(){return this.mouseUpElapsed/1e3},get mouseInteractionSeconds(){return this.mouseDownElapsedSeconds+this.mouseUpElapsedSeconds},get initialOpacity(){return this.element.initialOpacity},get opacityDecayVelocity(){return this.element.opacityDecayVelocity},get radius(){var e=this.containerMetrics.width*this.containerMetrics.width,t=this.containerMetrics.height*this.containerMetrics.height,i=1.1*Math.min(Math.sqrt(e+t),l.MAX_RADIUS)+5,n=1.1-i/l.MAX_RADIUS*.2,o=this.mouseInteractionSeconds/n,a=i*(1-Math.pow(80,-o));return Math.abs(a)},get opacity(){return this.mouseUpStart?Math.max(0,this.initialOpacity-this.mouseUpElapsedSeconds*this.opacityDecayVelocity):this.initialOpacity},get outerOpacity(){var e=.3*this.mouseUpElapsedSeconds,t=this.opacity;return Math.max(0,Math.min(e,t))},get isOpacityFullyDecayed(){return this.opacity<.01&&this.radius>=Math.min(this.maxRadius,l.MAX_RADIUS)},get isRestingAtMaxRadius(){return this.opacity>=this.initialOpacity&&this.radius>=Math.min(this.maxRadius,l.MAX_RADIUS)},get isAnimationComplete(){return this.mouseUpStart?this.isOpacityFullyDecayed:this.isRestingAtMaxRadius},get translationFraction(){return Math.min(1,this.radius/this.containerMetrics.size*2/Math.sqrt(2))},get xNow(){return this.xEnd?this.xStart+this.translationFraction*(this.xEnd-this.xStart):this.xStart},get yNow(){return this.yEnd?this.yStart+this.translationFraction*(this.yEnd-this.yStart):this.yStart},get isMouseDown(){return this.mouseDownStart&&!this.mouseUpStart},resetInteractionState:function(){this.maxRadius=0,this.mouseDownStart=0,this.mouseUpStart=0,this.xStart=0,this.yStart=0,this.xEnd=0,this.yEnd=0,this.slideDistance=0,this.containerMetrics=new c(this.element)},draw:function(){var e,t,i;this.wave.style.opacity=this.opacity,e=this.radius/(this.containerMetrics.size/2),t=this.xNow-this.containerMetrics.width/2,i=this.yNow-this.containerMetrics.height/2,this.waveContainer.style.webkitTransform="translate("+t+"px, "+i+"px)",this.waveContainer.style.transform="translate3d("+t+"px, "+i+"px, 0)",this.wave.style.webkitTransform="scale("+e+","+e+")",this.wave.style.transform="scale3d("+e+","+e+",1)"},downAction:function(e){var t=this.containerMetrics.width/2,i=this.containerMetrics.height/2;this.resetInteractionState(),this.mouseDownStart=s.now(),this.center?(this.xStart=t,this.yStart=i,this.slideDistance=s.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)):(this.xStart=e?e.detail.x-this.containerMetrics.boundingRect.left:this.containerMetrics.width/2,this.yStart=e?e.detail.y-this.containerMetrics.boundingRect.top:this.containerMetrics.height/2),this.recenters&&(this.xEnd=t,this.yEnd=i,this.slideDistance=s.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)),this.maxRadius=this.containerMetrics.furthestCornerDistanceFrom(this.xStart,this.yStart),this.waveContainer.style.top=(this.containerMetrics.height-this.containerMetrics.size)/2+"px",this.waveContainer.style.left=(this.containerMetrics.width-this.containerMetrics.size)/2+"px",this.waveContainer.style.width=this.containerMetrics.size+"px",this.waveContainer.style.height=this.containerMetrics.size+"px"},upAction:function(e){this.isMouseDown&&(this.mouseUpStart=s.now())},remove:function(){(0,a.vz)(this.waveContainer.parentNode).removeChild(this.waveContainer)}},(0,o.k)({_template:r.d` <style> :host { display: block; position: absolute; border-radius: inherit; overflow: hidden; top: 0; left: 0; right: 0; bottom: 0; /* See PolymerElements/paper-behaviors/issues/34. On non-Chrome browsers, * creating a node (with a position:absolute) in the middle of an event * handler "interrupts" that event handler (which happens when the * ripple is created on demand) */ pointer-events: none; } :host([animating]) { /* This resolves a rendering issue in Chrome (as of 40) where the ripple is not properly clipped by its parent (which may have rounded corners). See: http://jsbin.com/temexa/4 Note: We only apply this style conditionally. Otherwise, the browser will create a new compositing layer for every ripple element on the page, and that would be bad. */ -webkit-transform: translate(0, 0); transform: translate3d(0, 0, 0); } #background, #waves, .wave-container, .wave { pointer-events: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; } #background, .wave { opacity: 0; } #waves, .wave { overflow: hidden; } .wave-container, .wave { border-radius: 50%; } :host(.circle) #background, :host(.circle) #waves { border-radius: 50%; } :host(.circle) .wave-container { overflow: hidden; } </style> <div id="background"></div> <div id="waves"></div> `,is:"paper-ripple",behaviors:[n.G],properties:{initialOpacity:{type:Number,value:.25},opacityDecayVelocity:{type:Number,value:.8},recenters:{type:Boolean,value:!1},center:{type:Boolean,value:!1},ripples:{type:Array,value:function(){return[]}},animating:{type:Boolean,readOnly:!0,reflectToAttribute:!0,value:!1},holdDown:{type:Boolean,value:!1,observer:"_holdDownChanged"},noink:{type:Boolean,value:!1},_animating:{type:Boolean},_boundAnimate:{type:Function,value:function(){return this.animate.bind(this)}}},get target(){return this.keyEventTarget},keyBindings:{"enter:keydown":"_onEnterKeydown","space:keydown":"_onSpaceKeydown","space:keyup":"_onSpaceKeyup"},attached:function(){11==this.parentNode.nodeType?this.keyEventTarget=(0,a.vz)(this).getOwnerRoot().host:this.keyEventTarget=this.parentNode;var e=this.keyEventTarget;this.listen(e,"up","uiUpAction"),this.listen(e,"down","uiDownAction")},detached:function(){this.unlisten(this.keyEventTarget,"up","uiUpAction"),this.unlisten(this.keyEventTarget,"down","uiDownAction"),this.keyEventTarget=null},get shouldKeepAnimating(){for(var e=0;e<this.ripples.length;++e)if(!this.ripples[e].isAnimationComplete)return!0;return!1},simulatedRipple:function(){this.downAction(null),this.async((function(){this.upAction()}),1)},uiDownAction:function(e){this.noink||this.downAction(e)},downAction:function(e){this.holdDown&&this.ripples.length>0||(this.addRipple().downAction(e),this._animating||(this._animating=!0,this.animate()))},uiUpAction:function(e){this.noink||this.upAction(e)},upAction:function(e){this.holdDown||(this.ripples.forEach((function(t){t.upAction(e)})),this._animating=!0,this.animate())},onAnimationComplete:function(){this._animating=!1,this.$.background.style.backgroundColor=null,this.fire("transitionend")},addRipple:function(){var e=new l(this);return(0,a.vz)(this.$.waves).appendChild(e.waveContainer),this.$.background.style.backgroundColor=e.color,this.ripples.push(e),this._setAnimating(!0),e},removeRipple:function(e){var t=this.ripples.indexOf(e);t<0||(this.ripples.splice(t,1),e.remove(),this.ripples.length||this._setAnimating(!1))},animate:function(){if(this._animating){var e,t;for(e=0;e<this.ripples.length;++e)(t=this.ripples[e]).draw(),this.$.background.style.opacity=t.outerOpacity,t.isOpacityFullyDecayed&&!t.isRestingAtMaxRadius&&this.removeRipple(t);this.shouldKeepAnimating||0!==this.ripples.length?window.requestAnimationFrame(this._boundAnimate):this.onAnimationComplete()}},animateRipple:function(){return this.animate()},_onEnterKeydown:function(){this.uiDownAction(),this.async(this.uiUpAction,1)},_onSpaceKeydown:function(){this.uiDownAction()},_onSpaceKeyup:function(){this.uiUpAction()},_holdDownChanged:function(e,t){void 0!==t&&(e?this.downAction():this.upAction())}})}}]); //# sourceMappingURL=chunk.3beab570eb6c7c909d4f.js.map