2020-07-14 15:42:58 +02:00
! function ( t ) { var e = { } ; function s ( i ) { if ( e [ i ] ) return e [ i ] . exports ; var n = e [ i ] = { i : i , l : ! 1 , exports : { } } ; return t [ i ] . call ( n . exports , n , n . exports , s ) , n . l = ! 0 , n . exports } s . m = t , s . c = e , s . d = function ( t , e , i ) { s . o ( t , e ) || Object . defineProperty ( t , e , { enumerable : ! 0 , get : i } ) } , s . r = function ( t ) { "undefined" != typeof Symbol && Symbol . toStringTag && Object . defineProperty ( t , Symbol . toStringTag , { value : "Module" } ) , Object . defineProperty ( t , "__esModule" , { value : ! 0 } ) } , s . t = function ( t , e ) { if ( 1 & e && ( t = s ( t ) ) , 8 & e ) return t ; if ( 4 & e && "object" == typeof t && t && t . _ _esModule ) return t ; var i = Object . create ( null ) ; if ( s . r ( i ) , Object . defineProperty ( i , "default" , { enumerable : ! 0 , value : t } ) , 2 & e && "string" != typeof t ) for ( var n in t ) s . d ( i , n , function ( e ) { return t [ e ] } . bind ( null , n ) ) ; return i } , s . n = function ( t ) { var e = t && t . _ _esModule ? function ( ) { return t . default } : function ( ) { return t } ; return s . d ( e , "a" , e ) , e } , s . o = function ( t , e ) { return Object . prototype . hasOwnProperty . call ( t , e ) } , s . p = "" , s ( s . s = 0 ) } ( [ function ( t , e , s ) { "use strict" ; s . r ( 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-07-14 15:42:58 +02:00
const i = new WeakMap , n = t => "function" == typeof t && i . has ( t ) , o = void 0 !== window . customElements && void 0 !== window . customElements . polyfillWrapFlushCallback , r = ( t , e , s = null ) => { for ( ; e !== s ; ) { const s = e . nextSibling ; t . removeChild ( e ) , e = s } } , a = { } , l = { } , c = ` {{lit- ${ String ( Math . random ( ) ) . slice ( 2 ) } }} ` , h = ` \x 3c!-- ${ c } -- \x 3e ` , d = new RegExp ( ` ${ c } | ${ h } ` ) , p = "$lit$" ; class u { constructor ( t , e ) { this . parts = [ ] , this . element = e ; const s = [ ] , i = [ ] , n = document . createTreeWalker ( e . content , 133 , null , ! 1 ) ; let o = 0 , r = - 1 , a = 0 ; const { strings : l , values : { length : h } } = t ; for ( ; a < h ; ) { const t = n . nextNode ( ) ; if ( null !== t ) { if ( r ++ , 1 === t . nodeType ) { if ( t . hasAttributes ( ) ) { const e = t . attributes , { length : s } = e ; let i = 0 ; for ( let t = 0 ; t < s ; t ++ ) f ( e [ t ] . name , p ) && i ++ ; for ( ; i -- > 0 ; ) { const e = l [ a ] , s = g . exec ( e ) [ 2 ] , i = s . toLowerCase ( ) + p , n = t . getAttribute ( i ) ; t . removeAttribute ( i ) ; const o = n . split ( d ) ; this . parts . push ( { type : "attribute" , index : r , name : s , strings : o } ) , a += o . length - 1 } } "TEMPLATE" === t . tagName && ( i . push ( t ) , n . currentNode = t . content ) } else if ( 3 === t . nodeType ) { const e = t . data ; if ( e . indexOf ( c ) >= 0 ) { const i = t . parentNode , n = e . split ( d ) , o = n . length - 1 ; for ( let e = 0 ; e < o ; e ++ ) { let s , o = n [ e ] ; if ( "" === o ) s = _ ( ) ; else { const t = g . exec ( o ) ; null !== t && f ( t [ 2 ] , p ) && ( o = o . slice ( 0 , t . index ) + t [ 1 ] + t [ 2 ] . slice ( 0 , - p . length ) + t [ 3 ] ) , s = document . createTextNode ( o ) } i . insertBefore ( s , t ) , this . parts . push ( { type : "node" , index : ++ r } ) } "" === n [ o ] ? ( i . insertBefore ( _ ( ) , t ) , s . push ( t ) ) : t . data = n [ o ] , a += o } } else if ( 8 === t . nodeType ) if ( t . data === c ) { const e = t . parentNode ; null !== t . previousSibling && r !== o || ( r ++ , e . insertBefore ( _ ( ) , t ) ) , o = r , this . parts . push ( { type : "node" , index : r } ) , null === t . nextSibling ? t . data = "" : ( s . push ( t ) , r -- ) , a ++ } else { let e = - 1 ; for ( ; - 1 !== ( e = t . data . indexOf ( c , e + 1 ) ) ; ) this . parts . push ( { type : "node" , index : - 1 } ) , a ++ } } else n . currentNode = i . pop ( ) } for ( const t of s ) t . parentNode . removeChild ( t ) } } const f = ( t , e ) => { const s = t . length - e . length ; return s >= 0 && t . slice ( s ) === e } , m = t => - 1 !== t . 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-07-14 15:42:58 +02:00
class v { constructor ( t , e , s ) { this . _ _parts = [ ] , this . template = t , this . processor = e , this . options = s } update ( t ) { let e = 0 ; for ( const s of this . _ _parts ) void 0 !== s && s . setValue ( t [ e ] ) , e ++ ; for ( const t of this . _ _parts ) void 0 !== t && t . commit ( ) } _clone ( ) { const t = o ? this . template . element . content . cloneNode ( ! 0 ) : document . importNode ( this . template . element . content , ! 0 ) , e = [ ] , s = this . template . parts , i = document . createTreeWalker ( t , 133 , null , ! 1 ) ; let n , r = 0 , a = 0 , l = i . nextNode ( ) ; for ( ; r < s . length ; ) if ( n = s [ r ] , m ( n ) ) { for ( ; a < n . index ; ) a ++ , "TEMPLATE" === l . nodeName && ( e . push ( l ) , i . currentNode = l . content ) , null === ( l = i . nextNode ( ) ) && ( i . currentNode = e . pop ( ) , l = i . nextNode ( ) ) ; if ( "node" === n . type ) { const t = this . processor . handleTextExpression ( this . options ) ; t . insertAfterNode ( l . previousSibling ) , this . _ _parts . push ( t ) } else this . _ _parts . push ( ... this . processor . handleAttributeExpressions ( l , n . name , n . strings , this . options ) ) ; r ++ } else this . _ _parts . push ( void 0 ) , r ++ ; return o && ( document . adoptNode ( t ) , customElements . upgrade ( t ) ) , t } }
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-07-14 15:42:58 +02:00
* / c l a s s y { c o n s t r u c t o r ( t , e , s , i ) { t h i s . s t r i n g s = t , t h i s . v a l u e s = e , 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 t = t h i s . s t r i n g s . l e n g t h - 1 ; l e t e = " " , s = ! 1 ; f o r ( l e t i = 0 ; i < t ; i + + ) { c o n s t t = t h i s . s t r i n g s [ i ] , n = t . l a s t I n d e x O f ( " \ x 3 c ! - - " ) ; s = ( n > - 1 | | s ) & & - 1 = = = t . i n d e x O f ( " - - \ x 3 e " , n + 1 ) ; c o n s t o = g . e x e c ( t ) ; e + = n u l l = = = o ? t + ( s ? c : h ) : t . s u b s t r ( 0 , o . i n d e x ) + o [ 1 ] + o [ 2 ] + p + o [ 3 ] + c } r e t u r n e + = t h i s . s t r i n g s [ t ] } g e t T e m p l a t e E l e m e n t ( ) { c o n s t t = 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 t . i n n e r H T M L = t h i s . g e t H T M L ( ) , t } }
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:33:04 +02:00
* /
2020-07-14 15:42:58 +02:00
const S = t => null === t || ! ( "object" == typeof t || "function" == typeof t ) , b = t => Array . isArray ( t ) || ! ( ! t || ! t [ Symbol . iterator ] ) ; class w { constructor ( t , e , s ) { this . dirty = ! 0 , this . element = t , this . name = e , this . strings = s , this . parts = [ ] ; for ( let t = 0 ; t < s . length - 1 ; t ++ ) this . parts [ t ] = this . _createPart ( ) } _createPart ( ) { return new x ( this ) } _getValue ( ) { const t = this . strings , e = t . length - 1 ; let s = "" ; for ( let i = 0 ; i < e ; i ++ ) { s += t [ i ] ; const e = this . parts [ i ] ; if ( void 0 !== e ) { const t = e . value ; if ( S ( t ) || ! b ( t ) ) s += "string" == typeof t ? t : String ( t ) ; else for ( const e of t ) s += "string" == typeof e ? e : String ( e ) } } return s += t [ e ] } commit ( ) { this . dirty && ( this . dirty = ! 1 , this . element . setAttribute ( this . name , this . _getValue ( ) ) ) } } class x { constructor ( t ) { this . value = void 0 , this . committer = t } setValue ( t ) { t === a || S ( t ) && t === this . value || ( this . value = t , n ( t ) || ( this . committer . dirty = ! 0 ) ) } commit ( ) { for ( ; n ( this . value ) ; ) { const t = this . value ; this . value = a , t ( this ) } this . value !== a && this . committer . commit ( ) } } class P { constructor ( t ) { this . value = void 0 , this . _ _pendingValue = void 0 , this . options = t } appendInto ( t ) { this . startNode = t . appendChild ( _ ( ) ) , this . endNode = t . appendChild ( _ ( ) ) } insertAfterNode ( t ) { this . startNode = t , this . endNode = t . nextSibling } appendIntoPart ( t ) { t . _ _insert ( this . startNode = _ ( ) ) , t . _ _insert ( this . endNode = _ ( ) ) } insertAfterPart ( t ) { t . _ _insert ( this . startNode = _ ( ) ) , this . endNode = t . endNode , t . endNode = this . startNode } setValue ( t ) { this . _ _pendingValue = t } commit ( ) { for ( ; n ( this . _ _pendingValue ) ; ) { const t = this . _ _pendingValue ; this . _ _pendingValue = a , t ( this ) } const t = this . _ _pendingValue ; t !== a && ( S ( t ) ? t !== this . value && this . _ _commitText ( t ) : t instanceof y ? this . _ _commitTemplateResult ( t ) : t instanceof Node ? this . _ _commitNode ( t ) : b ( t ) ? this . _ _commitIterable ( t ) : t === l ? ( this . value = l , this . clear ( ) ) : this . _ _commitText ( t ) ) } _ _insert ( t ) { this . endNode . parentNode . insertBefore ( t , this . endNode ) } _ _commitNode ( t ) { this . value !== t && ( this . clear ( ) , this . _ _insert ( t ) , this . value = t ) } _ _commitText ( t ) { const e = this . startNode . nextSibling ; t = null == t ? "" : t , e === this . endNode . previousSibling && 3 === e . nodeType ? e . data = t : this . _ _commitNode ( document . createTextNode ( "string" == typeof t ? t : String ( t ) ) ) , this . value = t } _ _commitTemplateResult ( t ) { const e = this . options . templateFactory ( t ) ; if ( this . value instanceof v && this . value . template === e ) this . value . update ( t . values ) ; else { const s = new v ( e , t . processor , this . options ) , i = s . _clone ( ) ; s . update ( t . values ) , this . _ _commitNode ( i ) , this . value = s } } _ _commitIterable ( t ) { Array . isArray ( this . value ) || ( this . value = [ ] , this . clear ( ) ) ; const e = this . value ; let s , i = 0 ; for ( const n of t ) void 0 === ( s = e [ i ] ) && ( s = new P ( this . options ) , e . push ( s ) , 0 === i ? s . appendIntoPart ( this ) : s . insertAfterPart ( e [ i - 1 ] ) ) , s . setValue ( n ) , s . commit ( ) , i ++ ; i < e . length && ( e . length = i , this . clear ( s && s . endNode ) ) } clear ( t = this . startNode ) { r ( this . startNode . parentNode , t . nextSibling , this . endNode ) } } class C { constructor ( t , e , 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 = t , this . name = e , this . strings = s } setValue ( t ) { this . _ _pendingValue = t } commit ( ) { for ( ; n ( this . _ _pendingValue ) ; ) { const t = this . _ _pendingValue ; this . _ _pendingValue = a , t ( this ) } if ( this . _ _pendingValue === a ) return ; const t = ! ! this . _ _pendingValue ; this . value !== t && ( t ? this . element . setAttribute ( this . name , "" ) : this . element . removeAttribute ( this . name ) , this . value = t ) , this . _ _pendingValue = a } } class N extends w { constructor ( t , e , s ) { super ( t , e , 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 t = { get capture ( ) { return T = ! 0 , ! 1 } } ; window . addEventListener ( "test" , t , t ) , window . removeEventListener ( "test" , t , t ) } catch ( t ) { } class E { constructor ( t , e , s ) { this . value = void 0 , this . _ _pendingValue = void 0 , this . element = t , this . eventName = e , this . eventContext = s , this . _ _boundHandleEvent = t => this . handleEvent ( t ) } setValue ( t ) { this . _ _pendingValue = t } commit ( ) { for ( ; n ( this . _ _pendingValue ) ; ) { const t = this . _ _pendingValue ; this . _ _pendingValue = a , t ( this ) } if ( this . _ _pendingValue === a ) return ; const t = this . _ _pendingValue , e = this . value , s = null == t || null != e && ( t . 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
2020-07-14 15:42:58 +02:00
* / 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 ( t , e , s , i ) { c o n s t n = e [ 0 ] ; r e t u r n " . " = = = n ? n e w N ( t , e . s l i c e ( 1 ) , s ) . p a r t s : " @ " = = = n ? [ n e w E ( t , e . s l i c e ( 1 ) , i . e v e n t C o n t e x t ) ] : " ? " = = = n ? [ n e w C ( t , e . s l i c e ( 1 ) , s ) ] : n e w w ( t , e , 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 ( t ) { r e t u r n n e w P ( t ) } } ;
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-07-14 15:42:58 +02:00
* / f u n c t i o n O ( t ) { l e t e = $ . g e t ( t . t y p e ) ; v o i d 0 = = = e & & ( e = { 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 ( t . t y p e , e ) ) ; l e t s = e . s t r i n g s A r r a y . g e t ( t . 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 = t . s t r i n g s . j o i n ( c ) ; r e t u r n v o i d 0 = = = ( s = e . k e y S t r i n g . g e t ( i ) ) & & ( s = n e w u ( t , t . g e t T e m p l a t e E l e m e n t ( ) ) , e . k e y S t r i n g . s e t ( i , s ) ) , e . s t r i n g s A r r a y . s e t ( t . 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
2020-05-03 22:33:04 +02:00
* /
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-07-14 15:42:58 +02:00
( window . litHtmlVersions || ( window . litHtmlVersions = [ ] ) ) . push ( "1.0.0" ) ; const M = ( t , ... e ) => new y ( t , e , "html" , V ) , j = 133 ; function U ( t , e ) { const { element : { content : s } , parts : i } = t , n = document . createTreeWalker ( s , j , null , ! 1 ) ; let o = z ( i ) , r = i [ o ] , a = - 1 , l = 0 ; const c = [ ] ; let h = null ; for ( ; n . nextNode ( ) ; ) { a ++ ; const t = n . currentNode ; for ( t . previousSibling === h && ( h = null ) , e . has ( t ) && ( c . push ( t ) , null === h && ( h = t ) ) , null !== h && l ++ ; void 0 !== r && r . index === a ; ) r . index = null !== h ? - 1 : r . index - l , r = i [ o = z ( i , o ) ] } c . forEach ( t => t . parentNode . removeChild ( t ) ) } const H = t => { let e = 11 === t . nodeType ? 0 : 1 ; const s = document . createTreeWalker ( t , j , null , ! 1 ) ; for ( ; s . nextNode ( ) ; ) e ++ ; return e } , z = ( t , e = - 1 ) => { for ( let s = e + 1 ; s < t . length ; s ++ ) { const e = t [ s ] ; if ( m ( e ) ) 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:33:04 +02:00
* /
2020-07-14 15:42:58 +02:00
const q = ( t , e ) => ` ${ t } -- ${ e } ` ; 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 = t => e => { const s = q ( e . type , t ) ; let i = $ . get ( s ) ; void 0 === i && ( i = { stringsArray : new WeakMap , keyString : new Map } , $ . set ( s , i ) ) ; let n = i . stringsArray . get ( e . strings ) ; if ( void 0 !== n ) return n ; const o = e . strings . join ( c ) ; if ( void 0 === ( n = i . keyString . get ( o ) ) ) { const s = e . getTemplateElement ( ) ; F && window . ShadyCSS . prepareTemplateDom ( s , t ) , n = new u ( e , s ) , i . keyString . set ( o , n ) } return i . stringsArray . set ( e . strings , n ) , n } , I = [ "html" , "svg" ] , B = new Set , W = ( t , e , s ) => { B . add ( s ) ; const i = t . querySelectorAll ( "style" ) , { length : n } = i ; if ( 0 === n ) return void window . ShadyCSS . prepareTemplateStyles ( e . element , s ) ; const o = document . createElement ( "style" ) ; for ( let t = 0 ; t < n ; t ++ ) { const e = i [ t ] ; e . parentNode . removeChild ( e ) , o . textContent += e . textContent } ( t => { I . forEach ( e => { const s = $ . get ( q ( e , t ) ) ; void 0 !== s && s . keyString . forEach ( t => { const { element : { content : e } } = t , s = new Set ; Array . from ( e . querySelectorAll ( "style" ) ) . forEach ( t => { s . add ( t ) } ) , U ( t , s ) } ) } ) } ) ( s ) ; const r = e . element . content ; ! function ( t , e , s = null ) { const { element : { content : i } , parts : n } = t ; if ( null == s ) return void i . appendChild ( e ) ; const o = document . createTreeWalker ( i , j , null , ! 1 ) ; let r = z ( n ) , a = 0 , l = - 1 ; for ( ; o . nextNode ( ) ; ) for ( l ++ , o . currentNode === s && ( a = H ( e ) , s . parentNode . insertBefore ( e , s ) ) ; - 1 !== r && n [ r ] . index === l ; ) { if ( a > 0 ) { for ( ; - 1 !== r ; ) n [ r ] . index += a , r = z ( n , r ) ; return } r = z ( n , r ) } } ( e , o , r . firstChild ) , window . ShadyCSS . prepareTemplateStyles ( e . element , s ) ; const a = r . querySelector ( "style" ) ; if ( window . ShadyCSS . nativeShadow && null !== a ) t . insertBefore ( a . cloneNode ( ! 0 ) , t . firstChild ) ; else { r . insertBefore ( o , r . firstChild ) ; const t = new Set ; t . add ( o ) , U ( e , t ) } } ;
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-07-14 15:42:58 +02:00
window . JSCompiler _renameProperty = ( t , e ) => t ; const J = { toAttribute ( t , e ) { switch ( e ) { case Boolean : return t ? "" : null ; case Object : case Array : return null == t ? t : JSON . stringify ( t ) } return t } , fromAttribute ( t , e ) { switch ( e ) { case Boolean : return null !== t ; case Number : return null === t ? null : Number ( t ) ; case Object : case Array : return JSON . parse ( t ) } return t } } , D = ( t , e ) => e !== t && ( e == e || t == t ) , G = { attribute : ! 0 , type : String , converter : J , reflect : ! 1 , hasChanged : D } , K = Promise . resolve ( ! 0 ) , Q = 1 , X = 4 , Y = 8 , Z = 16 , tt = 32 ; class et 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 t = [ ] ; return this . _classProperties . forEach ( ( e , s ) => { const i = this . _attributeNameForProperty ( s , e ) ; void 0 !== i && ( this . _attributeToPropertyMap . set ( i , s ) , t . push ( i ) ) } ) , t } static _ensureClassProperties ( ) { if ( ! this . hasOwnProperty ( JSCompiler _renameProperty ( "_classProperties" , this ) ) ) { this . _classProperties = new Map ; const t = Object . getPrototypeOf ( this ) . _classProperties ; void 0 !== t && t . forEach ( ( t , e ) => this . _classProperties . set ( e , t ) ) } } static createProperty ( t , e = G ) { if ( this . _ensureClassProperties ( ) , this . _classProperties . set ( t , e ) , e . noAccessor || this . prototype . hasOwnProperty ( t ) ) return ; const s = "symbol" == typeof t ? Symbol ( ) : ` __ ${ t } ` ; Object . defineProperty ( this . prototype , t , { get ( ) { return this [ s ] } , set ( e ) { const i = this [ t ] ; this [ s ] = e , this . _requestUpdate ( t , i ) } , configurable : ! 0 , enumerable : ! 0 } ) } static finalize ( ) { if ( this . hasOwnProperty ( JSCompiler _renameProperty ( "finalized" , this ) ) && this . finalized ) return ; const t = Object . getPrototypeOf ( this ) ; if ( "function" == typeof t . finalize && t . finalize ( ) , this . finalized = ! 0 , this . _ensureClassProperties ( ) , this . _attributeToPropertyMap = new Map , this . hasOwnProperty ( JSCompiler _renameProperty ( "properties" , this ) ) ) { const t = this . properties , e = [ ... Object . getOwnPropertyNames ( t ) , ... "function" == typeof Object . getOwnPropertySymbols ? Object . getOwnPropertySymbols ( t ) : [ ] ] ; for ( const s of e ) this . createProperty ( s , t [ s ] ) } } static _attributeNameForProperty ( t , e ) { const s = e . attribute ; return ! 1 === s ? void 0 : "string" == typeof s ? s : "string" == typeof t ? t . toLowerCase ( ) : void 0 } static _valueHasChanged ( t , e , s = D ) { return s ( t , e ) } static _propertyValueFromAttribute ( t , e ) { const s = e . type , i = e . converter || J , n = "function" == typeof i ? i : i . fromAttribute ; return n ? n ( t , s ) : t } static _propertyValueToAttribute ( t , e ) { if ( void 0 === e . reflect ) return ; const s = e . type , i = e . converter ; return ( i && i . toAttribute || J . toAttribute ) ( t , s ) } initialize ( ) { this . _saveInstanceProperties ( ) , this . _requestUpdate ( ) } _saveInstanceProperties ( ) { this . constructor . _classProperties . forEach ( ( t , e ) => { if ( this . hasOwnProperty ( e ) ) { const t = this [ e ] ; delete this [ e ] , this . _instanceProperties || ( this . _instanceProperties = new Map ) , this . _instanceProperties . set ( e , t ) } } ) } _applyInstanceProperties ( ) { this . _instanceProperties . forEach ( ( t , e ) => this [ e ] = t ) , this . _instanceProperties = void 0 } connectedCallback ( ) { this . _updateState = this . _updateState | tt , this . _hasConnectedResolver && ( this . _hasConnectedResolver ( ) , this . _hasConnectedResolver = void 0 ) } disconnectedCallback ( ) { } attributeChangedCallback ( t , e , s ) { e !== s && this . _attributeToProperty ( t , s ) } _propertyToAttribute ( t , e , s = G ) { const i = this . constructor , n = i . _attributeNameForProperty ( t , s ) ; if ( void 0 !== n ) { const t = i . _propertyValueToAttribute ( e , s ) ; if ( void 0 === t ) return ; this . _updateState = this . _updateState | Y , null == t ? this . removeAttribute ( n ) : this . setAttribute ( n , t ) , this . _updateState = this . _updateState & ~ Y } } _attributeToProperty ( t , e ) { if ( this . _updateState & Y ) return ; const s = this . constructor , i = s . _attributeToPropertyMap . get ( t ) ; if ( void 0 !== i ) { const t = s . _classProperties . get ( i ) || G ; this . _updateState = this . _updateState | Z , this [ i ] = s . _propertyValueFromAttribute ( e , t ) , this . _updateState = this . _updateState & ~ Z } } _requestUpdate ( t , e ) { let s = ! 0 ; if ( void 0 !== t ) { const i = this . constructor , n = i . _classProperties . get ( t ) || G ; i . _valueHasChanged ( this [ t ] , e , n . hasChanged ) ? ( this . _changedProperties . has ( t ) || this . _changedProperties . set ( t , e ) , ! 0 !== n . reflect || this . _updateState & Z || ( void 0 === this . _reflectingProperties && ( this . _reflectingProperties = new Map ) , this . _r
2020-04-19 10:52:45 +02:00
/ * *
2020-05-03 22:33:04 +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-07-14 15:42:58 +02:00
const st = ( t , e ) => "method" !== e . kind || ! e . descriptor || "value" in e . descriptor ? { kind : "field" , key : Symbol ( ) , placement : "own" , descriptor : { } , initializer ( ) { "function" == typeof e . initializer && ( this [ e . key ] = e . initializer . call ( this ) ) } , finisher ( s ) { s . createProperty ( e . key , t ) } } : Object . assign ( { } , e , { finisher ( s ) { s . createProperty ( e . key , t ) } } ) , it = ( t , e , s ) => { e . constructor . createProperty ( s , t ) } ; function nt ( t ) { return ( e , s ) => void 0 !== s ? it ( t , e , s ) : st ( t , e ) } const ot = "adoptedStyleSheets" in Document . prototype && "replace" in CSSStyleSheet . prototype , rt = Symbol ( ) ; class at { constructor ( t , e ) { if ( e !== rt ) throw new Error ( "CSSResult is not constructable. Use `unsafeCSS` or `css` instead." ) ; this . cssText = t } get styleSheet ( ) { return void 0 === this . _styleSheet && ( ot ? ( this . _styleSheet = new CSSStyleSheet , this . _styleSheet . replaceSync ( this . cssText ) ) : this . _styleSheet = null ) , this . _styleSheet } toString ( ) { return this . cssText } } const lt = ( t , ... e ) => { const s = e . reduce ( ( e , s , i ) => e + ( t => { if ( t instanceof at ) return t . cssText ; if ( "number" == typeof t ) return t ; throw new Error ( ` Value passed to 'css' function must be a 'css' function result: ${ t } . Use 'unsafeCSS' to pass non-literal values, but \n take care to ensure page security. ` ) } ) ( s ) + t [ i + 1 ] , t [ 0 ] ) ; return new at ( s , rt ) } ;
2019-06-30 19:37:32 +02:00
/ * *
* @ license
2020-04-19 10:52:45 +02:00
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
2019-06-30 19:37:32 +02:00
* 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-07-14 15:42:58 +02:00
( window . litElementVersions || ( window . litElementVersions = [ ] ) ) . push ( "2.2.0" ) ; const ct = t => t . flat ? t . flat ( 1 / 0 ) : function t ( e , s = [ ] ) { for ( let i = 0 , n = e . length ; i < n ; i ++ ) { const n = e [ i ] ; Array . isArray ( n ) ? t ( n , s ) : s . push ( n ) } return s } ( t ) ; class ht extends et { static finalize ( ) { super . finalize ( ) , this . _styles = this . hasOwnProperty ( JSCompiler _renameProperty ( "styles" , this ) ) ? this . _getUniqueStyles ( ) : this . _styles || [ ] } static _getUniqueStyles ( ) { const t = this . styles , e = [ ] ; if ( Array . isArray ( t ) ) { ct ( t ) . reduceRight ( ( t , e ) => ( t . add ( e ) , t ) , new Set ) . forEach ( t => e . unshift ( t ) ) } else t && e . push ( t ) ; return e } initialize ( ) { super . initialize ( ) , this . renderRoot = this . createRenderRoot ( ) , window . ShadowRoot && this . renderRoot instanceof window . ShadowRoot && this . adoptStyles ( ) } createRenderRoot ( ) { return this . attachShadow ( { mode : "open" } ) } adoptStyles ( ) { const t = this . constructor . _styles ; 0 !== t . length && ( void 0 === window . ShadyCSS || window . ShadyCSS . nativeShadow ? ot ? this . renderRoot . adoptedStyleSheets = t . map ( t => t . styleSheet ) : this . _needsShimAdoptedStyleSheets = ! 0 : window . ShadyCSS . ScopingShim . prepareAdoptedCssText ( t . map ( t => t . cssText ) , this . localName ) ) } connectedCallback ( ) { super . connectedCallback ( ) , this . hasUpdated && void 0 !== window . ShadyCSS && window . ShadyCSS . styleElement ( this ) } update ( t ) { super . update ( t ) ; const e = this . render ( ) ; e instanceof y && this . constructor . render ( e , this . renderRoot , { scopeName : this . localName , eventContext : this } ) , this . _needsShimAdoptedStyleSheets && ( this . _needsShimAdoptedStyleSheets = ! 1 , this . constructor . _styles . forEach ( t => { const e = document . createElement ( "style" ) ; e . textContent = t . cssText , this . renderRoot . appendChild ( e ) } ) ) } render ( ) { } } ht . finalized = ! 0 , ht . render = ( t , e , s ) => { const i = s . scopeName , n = R . has ( e ) , o = F && 11 === e . nodeType && ! ! e . host && t instanceof y , a = o && ! B . has ( i ) , l = a ? document . createDocumentFragment ( ) : e ; if ( ( ( t , e , s ) => { let i = R . get ( e ) ; void 0 === i && ( r ( e , e . firstChild ) , R . set ( e , i = new P ( Object . assign ( { templateFactory : O } , s ) ) ) , i . appendInto ( e ) ) , i . setValue ( t ) , i . commit ( ) } ) ( t , l , Object . assign ( { templateFactory : L ( i ) } , s ) ) , a ) { const t = R . get ( l ) ; R . delete ( l ) , t . value instanceof v && W ( l , t . value . template , i ) , r ( e , e . firstChild ) , e . appendChild ( l ) , R . set ( e , t ) } ! n && o && window . ShadyCSS . styleElement ( e . host ) } , s . d ( e , "RoomGlanceCard" , function ( ) { return pt } ) ; var dt = function ( t , e , s , i ) { var n , o = arguments . length , r = o < 3 ? e : null === i ? i = Object . getOwnPropertyDescriptor ( e , s ) : i ; if ( "object" == typeof Reflect && "function" == typeof Reflect . decorate ) r = Reflect . decorate ( t , e , s , i ) ; else for ( var a = t . length - 1 ; a >= 0 ; a -- ) ( n = t [ a ] ) && ( r = ( o < 3 ? n ( r ) : o > 3 ? n ( e , s , r ) : n ( e , s ) ) || r ) ; return o > 3 && r && Object . defineProperty ( e , s , r ) , r } ; let pt = class extends ht { setConfig ( t ) { console . log ( "Setting config" , t ) , this . _config = t } static getCardSize ( ) { return 3 } render ( ) { return this . _config . scenes . length >= 5 ? M `
2020-04-19 11:20:24 +02:00
< ha - card >
< img style = "width: 100%; display: block" src = "${this._config.image}" >
2019-06-30 19:37:32 +02:00
2020-04-19 11:20:24 +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 >
2020-07-14 15:42:58 +02:00
$ { this . _config . scenes . map ( t => this . renderSceneButton ( t ) ) }
2020-04-19 11:20:24 +02:00
< / d i v >
< / d i v >
< / h a - c a r d >
2020-05-03 22:33:04 +02:00
` :M `
2020-04-19 11:20:24 +02:00
< 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 >
2020-07-14 15:42:58 +02:00
$ { this . _config . scenes . map ( t => this . renderSceneButton ( t ) ) }
2020-04-19 11:20:24 +02:00
$ { this . renderLightControl ( ) }
< / d i v >
< / d i v >
< / h a - c a r d >
2020-07-14 15:42:58 +02:00
` }renderSceneButton(t){return M `
< ha - icon - button
icon = "${t.icon||" mdi : checkbox - blank "}"
style = "color: ${t.color||" "};"
title = "${t.name}"
@ click = $ { this . serviceHandler ( "scene" , "turn_on" , { entity _id : t . scene } ) }
> < / h a - i c o n - b u t t o n >
2020-05-03 22:33:04 +02:00
` }renderLightControl(){return M `
2020-07-14 15:42:58 +02:00
< ha - icon - button
2020-04-19 11:20:24 +02:00
icon = "mdi:close-circle"
@ click = $ { this . serviceHandler ( "light" , "turn_off" ) }
2020-07-14 15:42:58 +02:00
> < / h a - i c o n - b u t t o n >
2020-04-19 11:20:24 +02:00
2020-07-14 15:42:58 +02:00
< ha - icon - button
2020-04-19 11:20:24 +02:00
icon = "mdi:chevron-up"
title = "Heller"
@ click = $ { this . serviceHandler ( "dimmer" , "dim" , { offset : 30 } ) }
2020-07-14 15:42:58 +02:00
> < / h a - i c o n - b u t t o n >
< ha - icon - button
2020-04-19 11:20:24 +02:00
icon = "mdi:chevron-down"
title = "Dunkler"
@ click = $ { this . serviceHandler ( "dimmer" , "dim" , { offset : - 30 } ) }
2020-07-14 15:42:58 +02:00
> < / h a - 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 `
< ha - icon - button
2019-06-30 19:37:32 +02:00
icon = "hass:menu"
@ click = $ { this . serviceHandler ( "cover_half" , "set_half" ) }
2020-07-14 15:42:58 +02:00
> < / h a - i c o n - b u t t o n >
< ha - icon - button
2019-06-30 19:37:32 +02:00
icon = "hass:arrow-up"
@ click = $ { this . serviceHandler ( "cover" , "open_cover" ) }
2020-07-14 15:42:58 +02:00
> < / h a - i c o n - b u t t o n >
< ha - icon - button
2019-06-30 19:37:32 +02:00
icon = "hass:stop"
@ click = $ { this . serviceHandler ( "cover" , "stop_cover" ) }
2020-07-14 15:42:58 +02:00
> < / h a - i c o n - b u t t o n >
< ha - icon - button
2019-06-30 19:37:32 +02:00
icon = "hass:arrow-down"
@ click = $ { this . serviceHandler ( "cover" , "close_cover" ) }
2020-07-14 15:42:58 +02:00
> < / h a - i c o n - b u t t o n >
` }serviceHandler(t,e,s={}){const i=this;return function(n){n.stopPropagation(),i.callServiceForAllEntities(t,e,s)}}callServiceForAllEntities(t,e,s={}){if(s.hasOwnProperty("entity_id"))console.log("Calling service with given entity_id",t,e,s),this.hass.callService(t,e,s);else for(let i of this._config.entities)s.entity_id=i,console.log("Calling service",t,e,s),this.hass.callService(t,e,s)}_handleTap(){console.log("Image tap")}_handleHold(){console.log("Image hold")}static get styles(){return lt `
2019-06-30 19:37:32 +02:00
ha - card {
position : relative ;
min - height : 48 px ;
overflow : hidden ;
}
2020-04-19 10:52:45 +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-04-19 10:52:45 +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-04-19 10:52:45 +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-04-19 11:20:24 +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-04-19 11:20:24 +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-07-14 15:42:58 +02:00
` }};dt([nt()],pt.prototype,"hass",void 0),dt([nt()],pt.prototype,"_config",void 0),pt=dt([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){window.customElements.define(t,e)}}})(t,e))("room-glance-card")],pt)}]);