2019-06-30 19:37:32 +02:00
! function ( e ) { var t = { } ; function s ( i ) { if ( t [ i ] ) return t [ i ] . exports ; var n = t [ i ] = { i : i , l : ! 1 , exports : { } } ; return e [ i ] . call ( n . exports , n , n . exports , s ) , n . l = ! 0 , n . exports } s . m = e , s . c = t , s . d = function ( e , t , i ) { s . o ( e , t ) || Object . defineProperty ( e , t , { enumerable : ! 0 , get : i } ) } , s . r = function ( e ) { "undefined" != typeof Symbol && Symbol . toStringTag && Object . defineProperty ( e , Symbol . toStringTag , { value : "Module" } ) , Object . defineProperty ( e , "__esModule" , { value : ! 0 } ) } , s . t = function ( e , t ) { if ( 1 & t && ( e = s ( e ) ) , 8 & t ) return e ; if ( 4 & t && "object" == typeof e && e && e . _ _esModule ) return e ; var i = Object . create ( null ) ; if ( s . r ( i ) , Object . defineProperty ( i , "default" , { enumerable : ! 0 , value : e } ) , 2 & t && "string" != typeof e ) for ( var n in e ) s . d ( i , n , function ( t ) { return e [ t ] } . bind ( null , n ) ) ; return i } , s . n = function ( e ) { var t = e && e . _ _esModule ? function ( ) { return e . default } : function ( ) { return e } ; return s . d ( t , "a" , t ) , t } , s . o = function ( e , t ) { return Object . prototype . hasOwnProperty . call ( e , t ) } , s . p = "" , s ( s . s = 0 ) } ( [ function ( e , t , s ) { "use strict" ; s . r ( t ) ;
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-05-03 22:23:53 +02:00
const i = new WeakMap , n = e => "function" == typeof e && i . has ( e ) , r = void 0 !== window . customElements && void 0 !== window . customElements . polyfillWrapFlushCallback , o = ( e , t , s = null ) => { for ( ; t !== s ; ) { const s = t . nextSibling ; e . removeChild ( t ) , t = s } } , a = { } , l = { } , c = ` {{lit- ${ String ( Math . random ( ) ) . slice ( 2 ) } }} ` , d = ` \x 3c!-- ${ c } -- \x 3e ` , h = new RegExp ( ` ${ c } | ${ d } ` ) , p = "$lit$" ; class u { constructor ( e , t ) { this . parts = [ ] , this . element = t ; const s = [ ] , i = [ ] , n = document . createTreeWalker ( t . content , 133 , null , ! 1 ) ; let r = 0 , o = - 1 , a = 0 ; const { strings : l , values : { length : d } } = e ; for ( ; a < d ; ) { const e = n . nextNode ( ) ; if ( null !== e ) { if ( o ++ , 1 === e . nodeType ) { if ( e . hasAttributes ( ) ) { const t = e . attributes , { length : s } = t ; let i = 0 ; for ( let e = 0 ; e < s ; e ++ ) f ( t [ e ] . name , p ) && i ++ ; for ( ; i -- > 0 ; ) { const t = l [ a ] , s = g . exec ( t ) [ 2 ] , i = s . toLowerCase ( ) + p , n = e . getAttribute ( i ) ; e . removeAttribute ( i ) ; const r = n . split ( h ) ; this . parts . push ( { type : "attribute" , index : o , name : s , strings : r } ) , a += r . length - 1 } } "TEMPLATE" === e . tagName && ( i . push ( e ) , n . currentNode = e . content ) } else if ( 3 === e . nodeType ) { const t = e . data ; if ( t . indexOf ( c ) >= 0 ) { const i = e . parentNode , n = t . split ( h ) , r = n . length - 1 ; for ( let t = 0 ; t < r ; t ++ ) { let s , r = n [ t ] ; if ( "" === r ) s = _ ( ) ; else { const e = g . exec ( r ) ; null !== e && f ( e [ 2 ] , p ) && ( r = r . slice ( 0 , e . index ) + e [ 1 ] + e [ 2 ] . slice ( 0 , - p . length ) + e [ 3 ] ) , s = document . createTextNode ( r ) } i . insertBefore ( s , e ) , this . parts . push ( { type : "node" , index : ++ o } ) } "" === n [ r ] ? ( i . insertBefore ( _ ( ) , e ) , s . push ( e ) ) : e . data = n [ r ] , a += r } } else if ( 8 === e . nodeType ) if ( e . data === c ) { const t = e . parentNode ; null !== e . previousSibling && o !== r || ( o ++ , t . insertBefore ( _ ( ) , e ) ) , r = o , this . parts . push ( { type : "node" , index : o } ) , null === e . nextSibling ? e . data = "" : ( s . push ( e ) , o -- ) , a ++ } else { let t = - 1 ; for ( ; - 1 !== ( t = e . data . indexOf ( c , t + 1 ) ) ; ) this . parts . push ( { type : "node" , index : - 1 } ) , a ++ } } else n . currentNode = i . pop ( ) } for ( const e of s ) e . parentNode . removeChild ( e ) } } const f = ( e , t ) => { const s = e . length - t . length ; return s >= 0 && e . slice ( s ) === t } , m = e => - 1 !== e . index , _ = ( ) => document . createComment ( "" ) , g = /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/ ;
2019-06-30 19:37:32 +02:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-05-03 22:23:53 +02:00
class v { constructor ( e , t , s ) { this . _ _parts = [ ] , this . template = e , this . processor = t , this . options = s } update ( e ) { let t = 0 ; for ( const s of this . _ _parts ) void 0 !== s && s . setValue ( e [ t ] ) , t ++ ; for ( const e of this . _ _parts ) void 0 !== e && e . commit ( ) } _clone ( ) { const e = r ? this . template . element . content . cloneNode ( ! 0 ) : document . importNode ( this . template . element . content , ! 0 ) , t = [ ] , s = this . template . parts , i = document . createTreeWalker ( e , 133 , null , ! 1 ) ; let n , o = 0 , a = 0 , l = i . nextNode ( ) ; for ( ; o < s . length ; ) if ( n = s [ o ] , m ( n ) ) { for ( ; a < n . index ; ) a ++ , "TEMPLATE" === l . nodeName && ( t . push ( l ) , i . currentNode = l . content ) , null === ( l = i . nextNode ( ) ) && ( i . currentNode = t . pop ( ) , l = i . nextNode ( ) ) ; if ( "node" === n . type ) { const e = this . processor . handleTextExpression ( this . options ) ; e . insertAfterNode ( l . previousSibling ) , this . _ _parts . push ( e ) } else this . _ _parts . push ( ... this . processor . handleAttributeExpressions ( l , n . name , n . strings , this . options ) ) ; o ++ } else this . _ _parts . push ( void 0 ) , o ++ ; return r && ( document . adoptNode ( e ) , customElements . upgrade ( e ) ) , e } }
2019-06-30 19:37:32 +02:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
2020-05-03 22:23:53 +02:00
* / c l a s s y { c o n s t r u c t o r ( e , t , s , i ) { t h i s . s t r i n g s = e , t h i s . v a l u e s = t , t h i s . t y p e = s , t h i s . p r o c e s s o r = i } g e t H T M L ( ) { c o n s t e = t h i s . s t r i n g s . l e n g t h - 1 ; l e t t = " " , s = ! 1 ; f o r ( l e t i = 0 ; i < e ; i + + ) { c o n s t e = t h i s . s t r i n g s [ i ] , n = e . l a s t I n d e x O f ( " \ x 3 c ! - - " ) ; s = ( n > - 1 | | s ) & & - 1 = = = e . i n d e x O f ( " - - \ x 3 e " , n + 1 ) ; c o n s t r = g . e x e c ( e ) ; t + = n u l l = = = r ? e + ( s ? c : d ) : e . s u b s t r ( 0 , r . i n d e x ) + r [ 1 ] + r [ 2 ] + p + r [ 3 ] + c } r e t u r n t + = t h i s . s t r i n g s [ e ] } g e t T e m p l a t e E l e m e n t ( ) { c o n s t e = d o c u m e n t . c r e a t e E l e m e n t ( " t e m p l a t e " ) ; r e t u r n e . i n n e r H T M L = t h i s . g e t H T M L ( ) , e } }
2019-06-30 19:37:32 +02:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-05-03 22:23:53 +02:00
const S = e => null === e || ! ( "object" == typeof e || "function" == typeof e ) , b = e => Array . isArray ( e ) || ! ( ! e || ! e [ Symbol . iterator ] ) ; class w { constructor ( e , t , s ) { this . dirty = ! 0 , this . element = e , this . name = t , this . strings = s , this . parts = [ ] ; for ( let e = 0 ; e < s . length - 1 ; e ++ ) this . parts [ e ] = this . _createPart ( ) } _createPart ( ) { return new x ( this ) } _getValue ( ) { const e = this . strings , t = e . length - 1 ; let s = "" ; for ( let i = 0 ; i < t ; i ++ ) { s += e [ i ] ; const t = this . parts [ i ] ; if ( void 0 !== t ) { const e = t . value ; if ( S ( e ) || ! b ( e ) ) s += "string" == typeof e ? e : String ( e ) ; else for ( const t of e ) s += "string" == typeof t ? t : String ( t ) } } return s += e [ t ] } commit ( ) { this . dirty && ( this . dirty = ! 1 , this . element . setAttribute ( this . name , this . _getValue ( ) ) ) } } class x { constructor ( e ) { this . value = void 0 , this . committer = e } setValue ( e ) { e === a || S ( e ) && e === this . value || ( this . value = e , n ( e ) || ( this . committer . dirty = ! 0 ) ) } commit ( ) { for ( ; n ( this . value ) ; ) { const e = this . value ; this . value = a , e ( this ) } this . value !== a && this . committer . commit ( ) } } class P { constructor ( e ) { this . value = void 0 , this . _ _pendingValue = void 0 , this . options = e } appendInto ( e ) { this . startNode = e . appendChild ( _ ( ) ) , this . endNode = e . appendChild ( _ ( ) ) } insertAfterNode ( e ) { this . startNode = e , this . endNode = e . nextSibling } appendIntoPart ( e ) { e . _ _insert ( this . startNode = _ ( ) ) , e . _ _insert ( this . endNode = _ ( ) ) } insertAfterPart ( e ) { e . _ _insert ( this . startNode = _ ( ) ) , this . endNode = e . endNode , e . endNode = this . startNode } setValue ( e ) { this . _ _pendingValue = e } commit ( ) { for ( ; n ( this . _ _pendingValue ) ; ) { const e = this . _ _pendingValue ; this . _ _pendingValue = a , e ( this ) } const e = this . _ _pendingValue ; e !== a && ( S ( e ) ? e !== this . value && this . _ _commitText ( e ) : e instanceof y ? this . _ _commitTemplateResult ( e ) : e instanceof Node ? this . _ _commitNode ( e ) : b ( e ) ? this . _ _commitIterable ( e ) : e === l ? ( this . value = l , this . clear ( ) ) : this . _ _commitText ( e ) ) } _ _insert ( e ) { this . endNode . parentNode . insertBefore ( e , this . endNode ) } _ _commitNode ( e ) { this . value !== e && ( this . clear ( ) , this . _ _insert ( e ) , this . value = e ) } _ _commitText ( e ) { const t = this . startNode . nextSibling ; e = null == e ? "" : e , t === this . endNode . previousSibling && 3 === t . nodeType ? t . data = e : this . _ _commitNode ( document . createTextNode ( "string" == typeof e ? e : String ( e ) ) ) , this . value = e } _ _commitTemplateResult ( e ) { const t = this . options . templateFactory ( e ) ; if ( this . value instanceof v && this . value . template === t ) this . value . update ( e . values ) ; else { const s = new v ( t , e . processor , this . options ) , i = s . _clone ( ) ; s . update ( e . values ) , this . _ _commitNode ( i ) , this . value = s } } _ _commitIterable ( e ) { Array . isArray ( this . value ) || ( this . value = [ ] , this . clear ( ) ) ; const t = this . value ; let s , i = 0 ; for ( const n of e ) void 0 === ( s = t [ i ] ) && ( s = new P ( this . options ) , t . push ( s ) , 0 === i ? s . appendIntoPart ( this ) : s . insertAfterPart ( t [ i - 1 ] ) ) , s . setValue ( n ) , s . commit ( ) , i ++ ; i < t . length && ( t . length = i , this . clear ( s && s . endNode ) ) } clear ( e = this . startNode ) { o ( this . startNode . parentNode , e . nextSibling , this . endNode ) } } class C { constructor ( e , t , s ) { if ( this . value = void 0 , this . _ _pendingValue = void 0 , 2 !== s . length || "" !== s [ 0 ] || "" !== s [ 1 ] ) throw new Error ( "Boolean attributes can only contain a single expression" ) ; this . element = e , this . name = t , this . strings = s } setValue ( e ) { this . _ _pendingValue = e } commit ( ) { for ( ; n ( this . _ _pendingValue ) ; ) { const e = this . _ _pendingValue ; this . _ _pendingValue = a , e ( this ) } if ( this . _ _pendingValue === a ) return ; const e = ! ! this . _ _pendingValue ; this . value !== e && ( e ? this . element . setAttribute ( this . name , "" ) : this . element . removeAttribute ( this . name ) , this . value = e ) , this . _ _pendingValue = a } } class N extends w { constructor ( e , t , s ) { super ( e , t , s ) , this . single = 2 === s . length && "" === s [ 0 ] && "" === s [ 1 ] } _createPart ( ) { return new A ( this ) } _getValue ( ) { return this . single ? this . parts [ 0 ] . value : super . _getValue ( ) } commit ( ) { this . dirty && ( this . dirty = ! 1 , this . element [ this . name ] = this . _getValue ( ) ) } } class A extends x { } let T = ! 1 ; try { const e = { get capture ( ) { return T = ! 0 , ! 1 } } ; window . addEventListener ( "test" , e , e ) , window . removeEventListener ( "test" , e , e ) } catch ( e ) { } class E { constructor ( e , t , s ) { this . value = void 0 , this . _ _pendingValue = void 0 , this . element = e , this . eventName = t , this . eventContext = s , this . _ _boundHandleEvent = e => this . handleEvent ( e ) } setValue ( e ) { this . _ _pendingValue = e } commit ( ) { for ( ; n ( this . _ _pendingValue ) ; ) { const e = this . _ _pendingValue ; this . _ _pendingValue = a , e ( this ) } if ( this . _ _pendingValue === a ) return ; const e = this . _ _pendingValue , t = this . value , s = null == e || null != t && ( e . ca
2019-06-30 19:37:32 +02:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* / c o n s t V = n e w c l a s s { h a n d l e A t t r i b u t e E x p r e s s i o n s ( e , t , s , i ) { c o n s t n = t [ 0 ] ; r e t u r n " . " = = = n ? n e w N ( e , t . s l i c e ( 1 ) , s ) . p a r t s : " @ " = = = n ? [ n e w E ( e , t . s l i c e ( 1 ) , i . e v e n t C o n t e x t ) ] : " ? " = = = n ? [ n e w C ( e , t . s l i c e ( 1 ) , s ) ] : n e w w ( e , t , s ) . p a r t s } h a n d l e T e x t E x p r e s s i o n ( e ) { r e t u r n n e w P ( e ) } } ;
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
2020-05-03 22:23:53 +02:00
* / f u n c t i o n O ( e ) { l e t t = $ . g e t ( e . t y p e ) ; v o i d 0 = = = t & & ( t = { s t r i n g s A r r a y : n e w W e a k M a p , k e y S t r i n g : n e w M a p } , $ . s e t ( e . t y p e , t ) ) ; l e t s = t . s t r i n g s A r r a y . g e t ( e . s t r i n g s ) ; i f ( v o i d 0 ! = = s ) r e t u r n s ; c o n s t i = e . s t r i n g s . j o i n ( c ) ; r e t u r n v o i d 0 = = = ( s = t . k e y S t r i n g . g e t ( i ) ) & & ( s = n e w u ( e , e . g e t T e m p l a t e E l e m e n t ( ) ) , t . k e y S t r i n g . s e t ( i , s ) ) , t . s t r i n g s A r r a y . s e t ( e . s t r i n g s , s ) , s } c o n s t $ = n e w M a p , R = n e w W e a k M a p ;
2019-06-30 19:37:32 +02:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-05-03 22:23:53 +02:00
( window . litHtmlVersions || ( window . litHtmlVersions = [ ] ) ) . push ( "1.0.0" ) ; const M = ( e , ... t ) => new y ( e , t , "html" , V ) , j = 133 ; function U ( e , t ) { const { element : { content : s } , parts : i } = e , n = document . createTreeWalker ( s , j , null , ! 1 ) ; let r = z ( i ) , o = i [ r ] , a = - 1 , l = 0 ; const c = [ ] ; let d = null ; for ( ; n . nextNode ( ) ; ) { a ++ ; const e = n . currentNode ; for ( e . previousSibling === d && ( d = null ) , t . has ( e ) && ( c . push ( e ) , null === d && ( d = e ) ) , null !== d && l ++ ; void 0 !== o && o . index === a ; ) o . index = null !== d ? - 1 : o . index - l , o = i [ r = z ( i , r ) ] } c . forEach ( e => e . parentNode . removeChild ( e ) ) } const H = e => { let t = 11 === e . nodeType ? 0 : 1 ; const s = document . createTreeWalker ( e , j , null , ! 1 ) ; for ( ; s . nextNode ( ) ; ) t ++ ; return t } , z = ( e , t = - 1 ) => { for ( let s = t + 1 ; s < e . length ; s ++ ) { const t = e [ s ] ; if ( m ( t ) ) return s } return - 1 } ;
2019-06-30 19:37:32 +02:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-05-03 22:23:53 +02:00
const q = ( e , t ) => ` ${ e } -- ${ t } ` ; let F = ! 0 ; void 0 === window . ShadyCSS ? F = ! 1 : void 0 === window . ShadyCSS . prepareTemplateDom && ( console . warn ( "Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1." ) , F = ! 1 ) ; const L = e => t => { const s = q ( t . type , e ) ; let i = $ . get ( s ) ; void 0 === i && ( i = { stringsArray : new WeakMap , keyString : new Map } , $ . set ( s , i ) ) ; let n = i . stringsArray . get ( t . strings ) ; if ( void 0 !== n ) return n ; const r = t . strings . join ( c ) ; if ( void 0 === ( n = i . keyString . get ( r ) ) ) { const s = t . getTemplateElement ( ) ; F && window . ShadyCSS . prepareTemplateDom ( s , e ) , n = new u ( t , s ) , i . keyString . set ( r , n ) } return i . stringsArray . set ( t . strings , n ) , n } , I = [ "html" , "svg" ] , B = new Set , W = ( e , t , s ) => { B . add ( s ) ; const i = e . querySelectorAll ( "style" ) , { length : n } = i ; if ( 0 === n ) return void window . ShadyCSS . prepareTemplateStyles ( t . element , s ) ; const r = document . createElement ( "style" ) ; for ( let e = 0 ; e < n ; e ++ ) { const t = i [ e ] ; t . parentNode . removeChild ( t ) , r . textContent += t . textContent } ( e => { I . forEach ( t => { const s = $ . get ( q ( t , e ) ) ; void 0 !== s && s . keyString . forEach ( e => { const { element : { content : t } } = e , s = new Set ; Array . from ( t . querySelectorAll ( "style" ) ) . forEach ( e => { s . add ( e ) } ) , U ( e , s ) } ) } ) } ) ( s ) ; const o = t . element . content ; ! function ( e , t , s = null ) { const { element : { content : i } , parts : n } = e ; if ( null == s ) return void i . appendChild ( t ) ; const r = document . createTreeWalker ( i , j , null , ! 1 ) ; let o = z ( n ) , a = 0 , l = - 1 ; for ( ; r . nextNode ( ) ; ) for ( l ++ , r . currentNode === s && ( a = H ( t ) , s . parentNode . insertBefore ( t , s ) ) ; - 1 !== o && n [ o ] . index === l ; ) { if ( a > 0 ) { for ( ; - 1 !== o ; ) n [ o ] . index += a , o = z ( n , o ) ; return } o = z ( n , o ) } } ( t , r , o . firstChild ) , window . ShadyCSS . prepareTemplateStyles ( t . element , s ) ; const a = o . querySelector ( "style" ) ; if ( window . ShadyCSS . nativeShadow && null !== a ) e . insertBefore ( a . cloneNode ( ! 0 ) , e . firstChild ) ; else { o . insertBefore ( r , o . firstChild ) ; const e = new Set ; e . add ( r ) , U ( t , e ) } } ;
2019-06-30 19:37:32 +02:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
window . JSCompiler _renameProperty = ( e , t ) => e ; const J = { toAttribute ( e , t ) { switch ( t ) { case Boolean : return e ? "" : null ; case Object : case Array : return null == e ? e : JSON . stringify ( e ) } return e } , fromAttribute ( e , t ) { switch ( t ) { case Boolean : return null !== e ; case Number : return null === e ? null : Number ( e ) ; case Object : case Array : return JSON . parse ( e ) } return e } } , D = ( e , t ) => t !== e && ( t == t || e == e ) , G = { attribute : ! 0 , type : String , converter : J , reflect : ! 1 , hasChanged : D } , K = Promise . resolve ( ! 0 ) , Q = 1 , X = 4 , Y = 8 , Z = 16 , ee = 32 ; class te extends HTMLElement { constructor ( ) { super ( ) , this . _updateState = 0 , this . _instanceProperties = void 0 , this . _updatePromise = K , this . _hasConnectedResolver = void 0 , this . _changedProperties = new Map , this . _reflectingProperties = void 0 , this . initialize ( ) } static get observedAttributes ( ) { this . finalize ( ) ; const e = [ ] ; return this . _classProperties . forEach ( ( t , s ) => { const i = this . _attributeNameForProperty ( s , t ) ; void 0 !== i && ( this . _attributeToPropertyMap . set ( i , s ) , e . push ( i ) ) } ) , e } static _ensureClassProperties ( ) { if ( ! this . hasOwnProperty ( JSCompiler _renameProperty ( "_classProperties" , this ) ) ) { this . _classProperties = new Map ; const e = Object . getPrototypeOf ( this ) . _classProperties ; void 0 !== e && e . forEach ( ( e , t ) => this . _classProperties . set ( t , e ) ) } } static createProperty ( e , t = G ) { if ( this . _ensureClassProperties ( ) , this . _classProperties . set ( e , t ) , t . noAccessor || this . prototype . hasOwnProperty ( e ) ) return ; const s = "symbol" == typeof e ? Symbol ( ) : ` __ ${ e } ` ; Object . defineProperty ( this . prototype , e , { get ( ) { return this [ s ] } , set ( t ) { const i = this [ e ] ; this [ s ] = t , this . _requestUpdate ( e , i ) } , configurable : ! 0 , enumerable : ! 0 } ) } static finalize ( ) { if ( this . hasOwnProperty ( JSCompiler _renameProperty ( "finalized" , this ) ) && this . finalized ) return ; const e = Object . getPrototypeOf ( this ) ; if ( "function" == typeof e . finalize && e . finalize ( ) , this . finalized = ! 0 , this . _ensureClassProperties ( ) , this . _attributeToPropertyMap = new Map , this . hasOwnProperty ( JSCompiler _renameProperty ( "properties" , this ) ) ) { const e = this . properties , t = [ ... Object . getOwnPropertyNames ( e ) , ... "function" == typeof Object . getOwnPropertySymbols ? Object . getOwnPropertySymbols ( e ) : [ ] ] ; for ( const s of t ) this . createProperty ( s , e [ s ] ) } } static _attributeNameForProperty ( e , t ) { const s = t . attribute ; return ! 1 === s ? void 0 : "string" == typeof s ? s : "string" == typeof e ? e . toLowerCase ( ) : void 0 } static _valueHasChanged ( e , t , s = D ) { return s ( e , t ) } static _propertyValueFromAttribute ( e , t ) { const s = t . type , i = t . converter || J , n = "function" == typeof i ? i : i . fromAttribute ; return n ? n ( e , s ) : e } static _propertyValueToAttribute ( e , t ) { if ( void 0 === t . reflect ) return ; const s = t . type , i = t . converter ; return ( i && i . toAttribute || J . toAttribute ) ( e , s ) } initialize ( ) { this . _saveInstanceProperties ( ) , this . _requestUpdate ( ) } _saveInstanceProperties ( ) { this . constructor . _classProperties . forEach ( ( e , t ) => { if ( this . hasOwnProperty ( t ) ) { const e = this [ t ] ; delete this [ t ] , this . _instanceProperties || ( this . _instanceProperties = new Map ) , this . _instanceProperties . set ( t , e ) } } ) } _applyInstanceProperties ( ) { this . _instanceProperties . forEach ( ( e , t ) => this [ t ] = e ) , this . _instanceProperties = void 0 } connectedCallback ( ) { this . _updateState = this . _updateState | ee , this . _hasConnectedResolver && ( this . _hasConnectedResolver ( ) , this . _hasConnectedResolver = void 0 ) } disconnectedCallback ( ) { } attributeChangedCallback ( e , t , s ) { t !== s && this . _attributeToProperty ( e , s ) } _propertyToAttribute ( e , t , s = G ) { const i = this . constructor , n = i . _attributeNameForProperty ( e , s ) ; if ( void 0 !== n ) { const e = i . _propertyValueToAttribute ( t , s ) ; if ( void 0 === e ) return ; this . _updateState = this . _updateState | Y , null == e ? this . removeAttribute ( n ) : this . setAttribute ( n , e ) , this . _updateState = this . _updateState & ~ Y } } _attributeToProperty ( e , t ) { if ( this . _updateState & Y ) return ; const s = this . constructor , i = s . _attributeToPropertyMap . get ( e ) ; if ( void 0 !== i ) { const e = s . _classProperties . get ( i ) || G ; this . _updateState = this . _updateState | Z , this [ i ] = s . _propertyValueFromAttribute ( t , e ) , this . _updateState = this . _updateState & ~ Z } } _requestUpdate ( e , t ) { let s = ! 0 ; if ( void 0 !== e ) { const i = this . constructor , n = i . _classProperties . get ( e ) || G ; i . _valueHasChanged ( this [ e ] , t , n . hasChanged ) ? ( this . _changedProperties . has ( e ) || this . _changedProperties . set ( e , t ) , ! 0 !== n . reflect || this . _updateState & Z || ( void 0 === this . _reflectingProperties && ( this . _reflectingProperties = new Map ) , this . _r
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
const se = ( e , t ) => "method" !== t . kind || ! t . descriptor || "value" in t . descriptor ? { kind : "field" , key : Symbol ( ) , placement : "own" , descriptor : { } , initializer ( ) { "function" == typeof t . initializer && ( this [ t . key ] = t . initializer . call ( this ) ) } , finisher ( s ) { s . createProperty ( t . key , e ) } } : Object . assign ( { } , t , { finisher ( s ) { s . createProperty ( t . key , e ) } } ) , ie = ( e , t , s ) => { t . constructor . createProperty ( s , e ) } ; function ne ( e ) { return ( t , s ) => void 0 !== s ? ie ( e , t , s ) : se ( e , t ) } const re = "adoptedStyleSheets" in Document . prototype && "replace" in CSSStyleSheet . prototype , oe = Symbol ( ) ; class ae { constructor ( e , t ) { if ( t !== oe ) throw new Error ( "CSSResult is not constructable. Use `unsafeCSS` or `css` instead." ) ; this . cssText = e } get styleSheet ( ) { return void 0 === this . _styleSheet && ( re ? ( this . _styleSheet = new CSSStyleSheet , this . _styleSheet . replaceSync ( this . cssText ) ) : this . _styleSheet = null ) , this . _styleSheet } toString ( ) { return this . cssText } } const le = ( e , ... t ) => { const s = t . reduce ( ( t , s , i ) => t + ( e => { if ( e instanceof ae ) return e . cssText ; if ( "number" == typeof e ) return e ; throw new Error ( ` Value passed to 'css' function must be a 'css' function result: ${ e } . Use 'unsafeCSS' to pass non-literal values, but \n take care to ensure page security. ` ) } ) ( s ) + e [ i + 1 ] , e [ 0 ] ) ; return new ae ( s , oe ) } ;
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-05-03 22:23:53 +02:00
( window . litElementVersions || ( window . litElementVersions = [ ] ) ) . push ( "2.2.0" ) ; const ce = e => e . flat ? e . flat ( 1 / 0 ) : function e ( t , s = [ ] ) { for ( let i = 0 , n = t . length ; i < n ; i ++ ) { const n = t [ i ] ; Array . isArray ( n ) ? e ( n , s ) : s . push ( n ) } return s } ( e ) ; class de extends te { static finalize ( ) { super . finalize ( ) , this . _styles = this . hasOwnProperty ( JSCompiler _renameProperty ( "styles" , this ) ) ? this . _getUniqueStyles ( ) : this . _styles || [ ] } static _getUniqueStyles ( ) { const e = this . styles , t = [ ] ; if ( Array . isArray ( e ) ) { ce ( e ) . reduceRight ( ( e , t ) => ( e . add ( t ) , e ) , new Set ) . forEach ( e => t . unshift ( e ) ) } else e && t . push ( e ) ; return t } initialize ( ) { super . initialize ( ) , this . renderRoot = this . createRenderRoot ( ) , window . ShadowRoot && this . renderRoot instanceof window . ShadowRoot && this . adoptStyles ( ) } createRenderRoot ( ) { return this . attachShadow ( { mode : "open" } ) } adoptStyles ( ) { const e = this . constructor . _styles ; 0 !== e . length && ( void 0 === window . ShadyCSS || window . ShadyCSS . nativeShadow ? re ? this . renderRoot . adoptedStyleSheets = e . map ( e => e . styleSheet ) : this . _needsShimAdoptedStyleSheets = ! 0 : window . ShadyCSS . ScopingShim . prepareAdoptedCssText ( e . map ( e => e . cssText ) , this . localName ) ) } connectedCallback ( ) { super . connectedCallback ( ) , this . hasUpdated && void 0 !== window . ShadyCSS && window . ShadyCSS . styleElement ( this ) } update ( e ) { super . update ( e ) ; const t = this . render ( ) ; t instanceof y && this . constructor . render ( t , this . renderRoot , { scopeName : this . localName , eventContext : this } ) , this . _needsShimAdoptedStyleSheets && ( this . _needsShimAdoptedStyleSheets = ! 1 , this . constructor . _styles . forEach ( e => { const t = document . createElement ( "style" ) ; t . textContent = e . cssText , this . renderRoot . appendChild ( t ) } ) ) } render ( ) { } } de . finalized = ! 0 , de . render = ( e , t , s ) => { const i = s . scopeName , n = R . has ( t ) , r = F && 11 === t . nodeType && ! ! t . host && e instanceof y , a = r && ! B . has ( i ) , l = a ? document . createDocumentFragment ( ) : t ; if ( ( ( e , t , s ) => { let i = R . get ( t ) ; void 0 === i && ( o ( t , t . firstChild ) , R . set ( t , i = new P ( Object . assign ( { templateFactory : O } , s ) ) ) , i . appendInto ( t ) ) , i . setValue ( e ) , i . commit ( ) } ) ( e , l , Object . assign ( { templateFactory : L ( i ) } , s ) ) , a ) { const e = R . get ( l ) ; R . delete ( l ) , e . value instanceof v && W ( l , e . value . template , i ) , o ( t , t . firstChild ) , t . appendChild ( l ) , R . set ( t , e ) } ! n && r && window . ShadyCSS . styleElement ( t . host ) } , s . d ( t , "RoomGlanceCard" , function ( ) { return pe } ) ; var he = function ( e , t , s , i ) { var n , r = arguments . length , o = r < 3 ? t : null === i ? i = Object . getOwnPropertyDescriptor ( t , s ) : i ; if ( "object" == typeof Reflect && "function" == typeof Reflect . decorate ) o = Reflect . decorate ( e , t , s , i ) ; else for ( var a = e . length - 1 ; a >= 0 ; a -- ) ( n = e [ a ] ) && ( o = ( r < 3 ? n ( o ) : r > 3 ? n ( t , s , o ) : n ( t , s ) ) || o ) ; return r > 3 && o && Object . defineProperty ( t , s , o ) , o } ; let pe = class extends de { setConfig ( e ) { console . log ( "Setting config" , e ) , this . _config = e } static getCardSize ( ) { return 3 } render ( ) { return this . _config . scenes . length >= 5 ? M `
< ha - card >
< img style = "width: 100%; display: block" src = "${this._config.image}" >
2019-06-30 19:37:32 +02:00
2020-05-03 22:23:53 +02:00
< div class = "box box-top" >
< div > $ { this . _config . name } < / d i v >
< div >
$ { this . renderCoverControl ( ) }
< / d i v >
< / d i v >
< div class = "box box-upper" >
< div class = "title" > < / d i v >
< div > $ { this . renderLightControl ( ) } < / d i v >
< / d i v >
< div class = "box box-lower" >
< div class = "title" > < / d i v >
< div >
$ { this . _config . scenes . map ( e => this . renderSceneButton ( e ) ) }
< / d i v >
< / d i v >
< / h a - c a r d >
` :M `
< ha - card >
< img style = "width: 100%; display: block" src = "${this._config.image}" >
< div class = "box box-upper" >
< div class = "title" > < / d i v >
< div > $ { this . _config . name } < / d i v >
< div >
$ { this . renderCoverControl ( ) }
< / d i v >
< / d i v >
< div class = "box box-lower" >
< div class = "title" > < / d i v >
< div >
$ { this . _config . scenes . map ( e => this . renderSceneButton ( e ) ) }
$ { this . renderLightControl ( ) }
< / d i v >
< / d i v >
< / h a - c a r d >
` }renderSceneButton(e){return M `
2019-06-30 19:37:32 +02:00
< paper - icon - button
icon = "${e.icon||" mdi : checkbox - blank "}"
style = "color: ${e.color||" "};"
title = "${e.name}"
@ click = $ { this . serviceHandler ( "scene" , "turn_on" , { entity _id : e . scene } ) }
> < / p a p e r - i c o n - b u t t o n >
2020-05-03 22:23:53 +02:00
` }renderLightControl(){return M `
2019-06-30 19:37:32 +02:00
< paper - icon - button
2020-05-03 22:23:53 +02:00
icon = "mdi:close-circle"
@ click = $ { this . serviceHandler ( "light" , "turn_off" ) }
> < / p a p e r - i c o n - b u t t o n >
< paper - icon - button
icon = "mdi:chevron-up"
title = "Heller"
@ click = $ { this . serviceHandler ( "dimmer" , "dim" , { offset : 30 } ) }
> < / p a p e r - i c o n - b u t t o n >
< paper - icon - button
icon = "mdi:chevron-down"
title = "Dunkler"
@ click = $ { this . serviceHandler ( "dimmer" , "dim" , { offset : - 30 } ) }
> < / p a p e r - i c o n - b u t t o n > ` } r e n d e r C o v e r C o n t r o l ( ) { r e t u r n M `
< paper - icon - button
2019-06-30 19:37:32 +02:00
icon = "hass:menu"
@ click = $ { this . serviceHandler ( "cover_half" , "set_half" ) }
> < / p a p e r - i c o n - b u t t o n >
< paper - icon - button
icon = "hass:arrow-up"
@ click = $ { this . serviceHandler ( "cover" , "open_cover" ) }
> < / p a p e r - i c o n - b u t t o n >
< paper - icon - button
icon = "hass:stop"
@ click = $ { this . serviceHandler ( "cover" , "stop_cover" ) }
> < / p a p e r - i c o n - b u t t o n >
< paper - icon - button
icon = "hass:arrow-down"
@ click = $ { this . serviceHandler ( "cover" , "close_cover" ) }
> < / p a p e r - i c o n - b u t t o n >
` }serviceHandler(e,t,s={}){const i=this;return function(n){n.stopPropagation(),i.callServiceForAllEntities(e,t,s)}}callServiceForAllEntities(e,t,s={}){if(s.hasOwnProperty("entity_id"))console.log("Calling service with given entity_id",e,t,s),this.hass.callService(e,t,s);else for(let i of this._config.entities)s.entity_id=i,console.log("Calling service",e,t,s),this.hass.callService(e,t,s)}_handleTap(){console.log("Image tap")}_handleHold(){console.log("Image hold")}static get styles(){return le `
ha - card {
position : relative ;
min - height : 48 px ;
overflow : hidden ;
}
2020-05-03 22:23:53 +02:00
my - image . clickable {
2019-06-30 19:37:32 +02:00
cursor : pointer ;
}
. box {
/* start paper-font-common-nowrap style */
white - space : nowrap ;
overflow : hidden ;
text - overflow : ellipsis ;
/* end paper-font-common-nowrap style */
position : absolute ;
left : 0 ;
right : 0 ;
2020-05-03 22:23:53 +02:00
bottom : 0 ;
2019-06-30 19:37:32 +02:00
padding - left : 8 px ;
padding - right : 8 px ;
font - size : 16 px ;
line - height : 40 px ;
color : white ;
display : flex ;
2020-05-03 22:23:53 +02:00
flex - direction : row ;
2019-06-30 19:37:32 +02:00
justify - content : space - between ;
background - color : rgba ( 0 , 0 , 0 , 0.3 ) ;
}
2020-05-03 22:23:53 +02:00
. box - top {
bottom : 90 px ;
height : 45 px ;
padding - top : 0 px ;
padding - bottom : 0 ;
}
2019-06-30 19:37:32 +02:00
. box - upper {
bottom : 45 px ;
2020-05-03 22:23:53 +02:00
height : 45 px ;
padding - top : 0 px ;
2019-06-30 19:37:32 +02:00
padding - bottom : 0 ;
}
. box - lower {
bottom : 0 ;
padding - top : 0 ;
padding - bottom : 0 px ;
height : 45 px ;
}
. box . title {
font - weight : 500 ;
margin - left : 8 px ;
}
ha - icon {
cursor : pointer ;
padding : 8 px ;
color : # a9a9a9 ;
}
ha - icon . state - on {
color : white ;
}
2020-05-03 22:23:53 +02:00
` }};he([ne()],pe.prototype,"hass",void 0),he([ne()],pe.prototype,"_config",void 0),pe=he([(e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:s,elements:i}=t;return{kind:s,elements:i,finisher(t){window.customElements.define(e,t)}}})(e,t))("room-glance-card")],pe)}]);