2020-06-03 20:36:46 +00: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
* /
2021-07-13 16:16:02 +00:00
const t = "undefined" != typeof window && null != window . customElements && void 0 !== window . customElements . polyfillWrapFlushCallback , e = ( t , e , a = null ) => { for ( ; e !== a ; ) { const a = e . nextSibling ; t . removeChild ( e ) , e = a } } , a = ` {{lit- ${ String ( Math . random ( ) ) . slice ( 2 ) } }} ` , o = ` \x 3c!-- ${ a } -- \x 3e ` , n = new RegExp ( ` ${ a } | ${ o } ` ) ; class r { constructor ( t , e ) { this . parts = [ ] , this . element = e ; const o = [ ] , r = [ ] , s = document . createTreeWalker ( e . content , 133 , null , ! 1 ) ; let u = 0 , d = - 1 , p = 0 ; const { strings : h , values : { length : m } } = t ; for ( ; p < m ; ) { const t = s . nextNode ( ) ; if ( null !== t ) { if ( d ++ , 1 === t . nodeType ) { if ( t . hasAttributes ( ) ) { const e = t . attributes , { length : a } = e ; let o = 0 ; for ( let t = 0 ; t < a ; t ++ ) i ( e [ t ] . name , "$lit$" ) && o ++ ; for ( ; o -- > 0 ; ) { const e = h [ p ] , a = c . exec ( e ) [ 2 ] , o = a . toLowerCase ( ) + "$lit$" , r = t . getAttribute ( o ) ; t . removeAttribute ( o ) ; const i = r . split ( n ) ; this . parts . push ( { type : "attribute" , index : d , name : a , strings : i } ) , p += i . length - 1 } } "TEMPLATE" === t . tagName && ( r . push ( t ) , s . currentNode = t . content ) } else if ( 3 === t . nodeType ) { const e = t . data ; if ( e . indexOf ( a ) >= 0 ) { const a = t . parentNode , r = e . split ( n ) , s = r . length - 1 ; for ( let e = 0 ; e < s ; e ++ ) { let o , n = r [ e ] ; if ( "" === n ) o = l ( ) ; else { const t = c . exec ( n ) ; null !== t && i ( t [ 2 ] , "$lit$" ) && ( n = n . slice ( 0 , t . index ) + t [ 1 ] + t [ 2 ] . slice ( 0 , - "$lit$" . length ) + t [ 3 ] ) , o = document . createTextNode ( n ) } a . insertBefore ( o , t ) , this . parts . push ( { type : "node" , index : ++ d } ) } "" === r [ s ] ? ( a . insertBefore ( l ( ) , t ) , o . push ( t ) ) : t . data = r [ s ] , p += s } } else if ( 8 === t . nodeType ) if ( t . data === a ) { const e = t . parentNode ; null !== t . previousSibling && d !== u || ( d ++ , e . insertBefore ( l ( ) , t ) ) , u = d , this . parts . push ( { type : "node" , index : d } ) , null === t . nextSibling ? t . data = "" : ( o . push ( t ) , d -- ) , p ++ } else { let e = - 1 ; for ( ; - 1 !== ( e = t . data . indexOf ( a , e + 1 ) ) ; ) this . parts . push ( { type : "node" , index : - 1 } ) , p ++ } } else s . currentNode = r . pop ( ) } for ( const t of o ) t . parentNode . removeChild ( t ) } } const i = ( t , e ) => { const a = t . length - e . length ; return a >= 0 && t . slice ( a ) === e } , s = t => - 1 !== t . index , l = ( ) => document . createComment ( "" ) , c = /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/ ; function u ( t , e ) { const { element : { content : a } , parts : o } = t , n = document . createTreeWalker ( a , 133 , null , ! 1 ) ; let r = p ( o ) , i = o [ r ] , s = - 1 , l = 0 ; const c = [ ] ; let u = null ; for ( ; n . nextNode ( ) ; ) { s ++ ; const t = n . currentNode ; for ( t . previousSibling === u && ( u = null ) , e . has ( t ) && ( c . push ( t ) , null === u && ( u = t ) ) , null !== u && l ++ ; void 0 !== i && i . index === s ; ) i . index = null !== u ? - 1 : i . index - l , r = p ( o , r ) , i = o [ r ] } c . forEach ( t => t . parentNode . removeChild ( t ) ) } const d = t => { let e = 11 === t . nodeType ? 0 : 1 ; const a = document . createTreeWalker ( t , 133 , null , ! 1 ) ; for ( ; a . nextNode ( ) ; ) e ++ ; return e } , p = ( t , e = - 1 ) => { for ( let a = e + 1 ; a < t . length ; a ++ ) { const e = t [ a ] ; if ( s ( e ) ) return a } return - 1 } ;
2020-06-03 20:36:46 +00: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
* /
2021-07-12 04:33:18 +00:00
const h = new WeakMap , m = t => "function" == typeof t && h . has ( t ) , _ = { } , g = { } ;
2020-06-03 20:36:46 +00: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
* /
2021-07-13 16:16:02 +00:00
class f { constructor ( t , e , a ) { this . _ _parts = [ ] , this . template = t , this . processor = e , this . options = a } update ( t ) { let e = 0 ; for ( const a of this . _ _parts ) void 0 !== a && a . setValue ( t [ e ] ) , e ++ ; for ( const t of this . _ _parts ) void 0 !== t && t . commit ( ) } _clone ( ) { const e = t ? this . template . element . content . cloneNode ( ! 0 ) : document . importNode ( this . template . element . content , ! 0 ) , a = [ ] , o = this . template . parts , n = document . createTreeWalker ( e , 133 , null , ! 1 ) ; let r , i = 0 , l = 0 , c = n . nextNode ( ) ; for ( ; i < o . length ; ) if ( r = o [ i ] , s ( r ) ) { for ( ; l < r . index ; ) l ++ , "TEMPLATE" === c . nodeName && ( a . push ( c ) , n . currentNode = c . content ) , null === ( c = n . nextNode ( ) ) && ( n . currentNode = a . pop ( ) , c = n . nextNode ( ) ) ; if ( "node" === r . type ) { const t = this . processor . handleTextExpression ( this . options ) ; t . insertAfterNode ( c . previousSibling ) , this . _ _parts . push ( t ) } else this . _ _parts . push ( ... this . processor . handleAttributeExpressions ( c , r . name , r . strings , this . options ) ) ; i ++ } else this . _ _parts . push ( void 0 ) , i ++ ; return t && ( document . adoptNode ( e ) , customElements . upgrade ( e ) ) , e } }
2020-06-03 20:36:46 +00: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
2021-07-13 16:16:02 +00:00
* / c o n s t b = ` $ { a } ` ; c l a s s v { c o n s t r u c t o r ( t , e , a , o ) { 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 = a , t h i s . p r o c e s s o r = o } 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 = " " , n = ! 1 ; f o r ( l e t r = 0 ; r < t ; r + + ) { c o n s t t = t h i s . s t r i n g s [ r ] , i = t . l a s t I n d e x O f ( " \ x 3 c ! - - " ) ; n = ( i > - 1 | | n ) & & - 1 = = = t . i n d e x O f ( " - - \ x 3 e " , i + 1 ) ; c o n s t s = c . e x e c ( t ) ; e + = n u l l = = = s ? t + ( n ? b : o ) : t . s u b s t r ( 0 , s . i n d e x ) + s [ 1 ] + s [ 2 ] + " $ l i t $ " + s [ 3 ] + a } r e t u r n e + = t h i s . s t r i n g s [ t ] , e } 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 } }
2020-06-03 20:36:46 +00: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
2022-01-21 16:41:52 +00:00
* / c o n s t y = t = > n u l l = = = t | | ! ( " o b j e c t " = = t y p e o f t | | " f u n c t i o n " = = t y p e o f t ) , w = t = > A r r a y . i s A r r a y ( t ) | | ! ( ! t | | ! t [ S y m b o l . i t e r a t o r ] ) ; c l a s s S { c o n s t r u c t o r ( t , e , a ) { t h i s . d i r t y = ! 0 , t h i s . e l e m e n t = t , t h i s . n a m e = e , t h i s . s t r i n g s = a , t h i s . p a r t s = [ ] ; f o r ( l e t t = 0 ; t < a . l e n g t h - 1 ; t + + ) t h i s . p a r t s [ t ] = t h i s . _ c r e a t e P a r t ( ) } _ c r e a t e P a r t ( ) { r e t u r n n e w k ( t h i s ) } _ g e t V a l u e ( ) { c o n s t t = t h i s . s t r i n g s , e = t . l e n g t h - 1 ; l e t a = " " ; f o r ( l e t o = 0 ; o < e ; o + + ) { a + = t [ o ] ; c o n s t e = t h i s . p a r t s [ o ] ; i f ( v o i d 0 ! = = e ) { c o n s t t = e . v a l u e ; i f ( y ( t ) | | ! w ( t ) ) a + = " s t r i n g " = = t y p e o f t ? t : S t r i n g ( t ) ; e l s e f o r ( c o n s t e o f t ) a + = " s t r i n g " = = t y p e o f e ? e : S t r i n g ( e ) } } r e t u r n a + = t [ e ] , a } c o m m i t ( ) { t h i s . d i r t y & & ( t h i s . d i r t y = ! 1 , t h i s . e l e m e n t . s e t A t t r i b u t e ( t h i s . n a m e , t h i s . _ g e t V a l u e ( ) ) ) } } c l a s s k { c o n s t r u c t o r ( t ) { t h i s . v a l u e = v o i d 0 , t h i s . c o m m i t t e r = t } s e t V a l u e ( t ) { t = = = _ | | y ( t ) & & t = = = t h i s . v a l u e | | ( t h i s . v a l u e = t , m ( t ) | | ( t h i s . c o m m i t t e r . d i r t y = ! 0 ) ) } c o m m i t ( ) { f o r ( ; m ( t h i s . v a l u e ) ; ) { c o n s t t = t h i s . v a l u e ; t h i s . v a l u e = _ , t ( t h i s ) } t h i s . v a l u e ! = = _ & & t h i s . c o m m i t t e r . c o m m i t ( ) } } c l a s s V { c o n s t r u c t o r ( t ) { t h i s . v a l u e = v o i d 0 , t h i s . _ _ p e n d i n g V a l u e = v o i d 0 , t h i s . o p t i o n s = t } a p p e n d I n t o ( t ) { t h i s . s t a r t N o d e = t . a p p e n d C h i l d ( l ( ) ) , t h i s . e n d N o d e = t . a p p e n d C h i l d ( l ( ) ) } i n s e r t A f t e r N o d e ( t ) { t h i s . s t a r t N o d e = t , t h i s . e n d N o d e = t . n e x t S i b l i n g } a p p e n d I n t o P a r t ( t ) { t . _ _ i n s e r t ( t h i s . s t a r t N o d e = l ( ) ) , t . _ _ i n s e r t ( t h i s . e n d N o d e = l ( ) ) } i n s e r t A f t e r P a r t ( t ) { t . _ _ i n s e r t ( t h i s . s t a r t N o d e = l ( ) ) , t h i s . e n d N o d e = t . e n d N o d e , t . e n d N o d e = t h i s . s t a r t N o d e } s e t V a l u e ( t ) { t h i s . _ _ p e n d i n g V a l u e = t } c o m m i t ( ) { i f ( n u l l = = = t h i s . s t a r t N o d e . p a r e n t N o d e ) r e t u r n ; f o r ( ; m ( t h i s . _ _ p e n d i n g V a l u e ) ; ) { c o n s t t = t h i s . _ _ p e n d i n g V a l u e ; t h i s . _ _ p e n d i n g V a l u e = _ , t ( t h i s ) } c o n s t t = t h i s . _ _ p e n d i n g V a l u e ; t ! = = _ & & ( y ( t ) ? t ! = = t h i s . v a l u e & & t h i s . _ _ c o m m i t T e x t ( t ) : t i n s t a n c e o f v ? t h i s . _ _ c o m m i t T e m p l a t e R e s u l t ( t ) : t i n s t a n c e o f N o d e ? t h i s . _ _ c o m m i t N o d e ( t ) : w ( t ) ? t h i s . _ _ c o m m i t I t e r a b l e ( t ) : t = = = g ? ( t h i s . v a l u e = g , t h i s . c l e a r ( ) ) : t h i s . _ _ c o m m i t T e x t ( t ) ) } _ _ i n s e r t ( t ) { t h i s . e n d N o d e . p a r e n t N o d e . i n s e r t B e f o r e ( t , t h i s . e n d N o d e ) } _ _ c o m m i t N o d e ( t ) { t h i s . v a l u e ! = = t & & ( t h i s . c l e a r ( ) , t h i s . _ _ i n s e r t ( t ) , t h i s . v a l u e = t ) } _ _ c o m m i t T e x t ( t ) { c o n s t e = t h i s . s t a r t N o d e . n e x t S i b l i n g , a = " s t r i n g " = = t y p e o f ( t = n u l l = = t ? " " : t ) ? t : S t r i n g ( t ) ; e = = = t h i s . e n d N o d e . p r e v i o u s S i b l i n g & & 3 = = = e . n o d e T y p e ? e . d a t a = a : t h i s . _ _ c o m m i t N o d e ( d o c u m e n t . c r e a t e T e x t N o d e ( a ) ) , t h i s . v a l u e = t } _ _ c o m m i t T e m p l a t e R e s u l t ( t ) { c o n s t e = t h i s . o p t i o n s . t e m p l a t e F a c t o r y ( t ) ; i f ( t h i s . v a l u e i n s t a n c e o f f & & t h i s . v a l u e . t e m p l a t e = = = e ) t h i s . v a l u e . u p d a t e ( t . v a l u e s ) ; e l s e { c o n s t a = n e w f ( e , t . p r o c e s s o r , t h i s . o p t i o n s ) , o = a . _ c l o n e ( ) ; a . u p d a t e ( t . v a l u e s ) , t h i s . _ _ c o m m i t N o d e ( o ) , t h i s . v a l u e = a } } _ _ c o m m i t I t e r a b l e ( t ) { A r r a y . i s A r r a y ( t h i s . v a l u e ) | | ( t h i s . v a l u e = [ ] , t h i s . c l e a r ( ) ) ; c o n s t e = t h i s . v a l u e ; l e t a , o = 0 ; f o r ( c o n s t n o f t ) a = e [ o ] , v o i d 0 = = = a & & ( a = n e w V ( t h i s . o p t i o n s ) , e . p u s h ( a ) , 0 = = = o ? a . a p p e n d I n t o P a r t ( t h i s ) : a . i n s e r t A f t e r P a r t ( e [ o - 1 ] ) ) , a . s e t V a l u e ( n ) , a . c o m m i t ( ) , o + + ; o < e . l e n g t h & & ( e . l e n g t h = o , t h i s . c l e a r ( a & & a . e n d N o d e ) ) } c l e a r ( t = t h i s . s t a r t N o d e ) { e ( t h i s . s t a r t N o d e . p a r e n t N o d e , t . n e x t S i b l i n g , t h i s . e n d N o d e ) } } c l a s s z { c o n s t r u c t o r ( t , e , a ) { i f ( t h i s . v a l u e = v o i d 0 , t h i s . _ _ p e n d i n g V a l u e = v o i d 0 , 2 ! = = a . l e n g t h | | " " ! = = a [ 0 ] | | " " ! = = a [ 1 ] ) t h r o w n e w E r r o r ( " B o o l e a n a t t r i b u t e s c a n o n l y c o n t a i n a s i n g l e e x p r e s s i o n " ) ; t h i s . e l e m e n t = t , t h i s . n a m e = e , t h i s . s t r i n g s = a } s e t V a l u e ( t ) { t h i s . _ _ p e n d i n g V a l u e = t } c o m m i t ( ) { f o r ( ; m ( t h i s . _ _ p e n d i n g V a l u e ) ; ) { c o n s t t = t h i s . _ _ p e n d i n g V a l u e ; t h i s . _ _ p e n d i n g V a l u e = _ , t ( t h i s ) } i f ( t h i s . _ _ p e n d i n g V a l u e = = = _ ) r e t u r n ; c o n s t t = ! ! t h i s . _ _ p e n d i n g V a l u e ; t h i s . v a l u e ! = = t & & ( t ? t h i s . e l e m e n t . s e t A t t r i b u t e ( t h i s . n a m e , " " ) : t h i s . e l e m e n t . r e m o v e A t t r i b u t e ( t h i s . n a m e ) , t h i s . v a l u e = t ) , t h i s . _ _ p e n d i n g V a l u e = _ } } c l a s s N e x t e n d s S { c o n s t r u c t o r ( t , e , a ) { s u p e r ( t , e , a ) , t h i s . s i n g l e = 2 = = = a . l e n g t h & & " " = = = a [ 0 ] & & " " = = = a [ 1 ] } _ c r e a t e P a r t ( ) { r e t u r n n e w j ( t h i s ) } _ g e t V a l u e ( ) { r e t u r n t h i s . s i n g l e ? t h i s . p a r t s [ 0 ] . v a l u e : s u p e r . _ g e t V a l u e ( ) } c o m m i t ( ) { t h i s . d i r t y & & ( t h i s . d i r t y = ! 1 , t h i s . e l e m e n t [ t h i s . n a m e ] = t h i s . _ g e t V a l u e ( ) ) } } c l a s s j e x t e n d s k { } l e t E = ! 1 ; ( ( ) = > { t r y { c o n s t t = { g e t c a p t u r e ( ) { r e t u r n E = ! 0 , ! 1 } } ; w i n d o w . a d d E v e n t L i s t e n e r ( " t e s t " , t , t ) , w i n d o w . r e m o v e E v e n t L i s t e n e r ( " t e s t " , t , t ) } c a t c h ( t ) { } } ) ( ) ; c l a s s x { c o n s t r u c t o r ( t , e , a ) { t h i s . v a l u e = v o i d 0 , t h i s . _ _ p e n d i n g V a l u e = v o i d 0 , t h i s . e l e m e n t = t , t h i s . e v e n t N a m e = e , t h i s . e v e n t C o n t e x t = a , t h i s . _ _ b o u n d H a n d l e E v e n t = t = > t h i s . h a n d l e E v e n t ( t ) } s e t V a l u e ( t ) { t h i s . _ _ p e n d i n g V a l u e = t } c o m m i t ( ) { f o r ( ; m ( t h i s . _ _ p e n d i n g V a l u e ) ; ) { c o n s t t = t h i s . _ _ p e n d i n g V a l u e ; t h i s . _ _ p e n d i n g V a l u e = _ , t ( t h i s ) } i f ( t h i s . _ _ p e n d i n g V a l u e = = = _ ) r e t u r n ; c o n s
2020-06-03 20:36:46 +00: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
2021-07-13 16:16:02 +00:00
* / ; f u n c t i o n M ( t ) { l e t e = W . 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 } , W . s e t ( t . t y p e , e ) ) ; l e t o = 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 ! = = o ) r e t u r n o ; c o n s t n = t . s t r i n g s . j o i n ( a ) ; r e t u r n o = e . k e y S t r i n g . g e t ( n ) , v o i d 0 = = = o & & ( o = n e w r ( 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 ( n , o ) ) , e . s t r i n g s A r r a y . s e t ( t . s t r i n g s , o ) , o } c o n s t W = n e w M a p , P = n e w W e a k M a p ;
2020-06-03 20:36:46 +00: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
2021-11-09 20:21:52 +00:00
* / c o n s t A = n e w
2020-06-03 20:36:46 +00: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
* /
2022-01-21 16:41:52 +00:00
class { handleAttributeExpressions ( t , e , a , o ) { const n = e [ 0 ] ; if ( "." === n ) { return new N ( t , e . slice ( 1 ) , a ) . parts } return "@" === n ? [ new x ( t , e . slice ( 1 ) , o . eventContext ) ] : "?" === n ? [ new z ( t , e . slice ( 1 ) , a ) ] : new S ( t , e , a ) . parts } handleTextExpression ( t ) { return new V ( t ) } } ;
2020-06-03 20:36:46 +00: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
2021-11-09 20:21:52 +00:00
* / " u n d e f i n e d " ! = t y p e o f w i n d o w & & ( w i n d o w . l i t H t m l V e r s i o n s | | ( w i n d o w . l i t H t m l V e r s i o n s = [ ] ) ) . p u s h ( " 1 . 2 . 1 " ) ; c o n s t O = ( t , . . . e ) = > n e w v ( t , e , " h t m l " , A )
2020-06-03 20:36:46 +00: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
2022-01-21 16:41:52 +00:00
* / , T = ( t , e ) = > ` $ { t } - - $ { e } ` ; l e t R = ! 0 ; v o i d 0 = = = w i n d o w . S h a d y C S S ? R = ! 1 : v o i d 0 = = = w i n d o w . S h a d y C S S . p r e p a r e T e m p l a t e D o m & & ( c o n s o l e . w a r n ( " I n c o m p a t i b l e S h a d y C S S v e r s i o n d e t e c t e d . P l e a s e u p d a t e t o a t l e a s t @ w e b c o m p o n e n t s / w e b c o m p o n e n t s j s @ 2 . 0 . 2 a n d @ w e b c o m p o n e n t s / s h a d y c s s @ 1 . 3 . 1 . " ) , R = ! 1 ) ; c o n s t I = t = > e = > { c o n s t o = T ( e . t y p e , t ) ; l e t n = W . g e t ( o ) ; v o i d 0 = = = n & & ( n = { 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 } , W . s e t ( o , n ) ) ; l e t i = n . 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 ! = = i ) r e t u r n i ; c o n s t s = e . s t r i n g s . j o i n ( a ) ; i f ( i = n . k e y S t r i n g . g e t ( s ) , v o i d 0 = = = i ) { c o n s t a = e . g e t T e m p l a t e E l e m e n t ( ) ; R & & w i n d o w . S h a d y C S S . p r e p a r e T e m p l a t e D o m ( a , t ) , i = n e w r ( e , a ) , n . k e y S t r i n g . s e t ( s , i ) } r e t u r n n . s t r i n g s A r r a y . s e t ( e . s t r i n g s , i ) , i } , q = [ " h t m l " , " s v g " ] , K = n e w S e t , U = ( t , e , a ) = > { K . a d d ( t ) ; c o n s t o = a ? a . e l e m e n 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 " ) , n = e . q u e r y S e l e c t o r A l l ( " s t y l e " ) , { l e n g t h : r } = n ; i f ( 0 = = = r ) r e t u r n v o i d w i n d o w . S h a d y C S S . p r e p a r e T e m p l a t e S t y l e s ( o , t ) ; c o n s t i = d o c u m e n t . c r e a t e E l e m e n t ( " s t y l e " ) ; f o r ( l e t t = 0 ; t < r ; t + + ) { c o n s t e = n [ t ] ; e . p a r e n t N o d e . r e m o v e C h i l d ( e ) , i . t e x t C o n t e n t + = e . t e x t C o n t e n t } ( t = > { q . f o r E a c h ( e = > { c o n s t a = W . g e t ( T ( e , t ) ) ; v o i d 0 ! = = a & & a . k e y S t r i n g . f o r E a c h ( t = > { c o n s t { e l e m e n t : { c o n t e n t : e } } = t , a = n e w S e t ; A r r a y . f r o m ( e . q u e r y S e l e c t o r A l l ( " s t y l e " ) ) . f o r E a c h ( t = > { a . a d d ( t ) } ) , u ( t , a ) } ) } ) } ) ( t ) ; c o n s t s = o . c o n t e n t ; a ? f u n c t i o n ( t , e , a = n u l l ) { c o n s t { e l e m e n t : { c o n t e n t : o } , p a r t s : n } = t ; i f ( n u l l = = a ) r e t u r n v o i d o . a p p e n d C h i l d ( e ) ; c o n s t r = d o c u m e n t . c r e a t e T r e e W a l k e r ( o , 1 3 3 , n u l l , ! 1 ) ; l e t i = p ( n ) , s = 0 , l = - 1 ; f o r ( ; r . n e x t N o d e ( ) ; ) { f o r ( l + + , r . c u r r e n t N o d e = = = a & & ( s = d ( e ) , a . p a r e n t N o d e . i n s e r t B e f o r e ( e , a ) ) ; - 1 ! = = i & & n [ i ] . i n d e x = = = l ; ) { i f ( s > 0 ) { f o r ( ; - 1 ! = = i ; ) n [ i ] . i n d e x + = s , i = p ( n , i ) ; r e t u r n } i = p ( n , i ) } } } ( a , i , s . f i r s t C h i l d ) : s . i n s e r t B e f o r e ( i , s . f i r s t C h i l d ) , w i n d o w . S h a d y C S S . p r e p a r e T e m p l a t e S t y l e s ( o , t ) ; c o n s t l = s . q u e r y S e l e c t o r ( " s t y l e " ) ; i f ( w i n d o w . S h a d y C S S . n a t i v e S h a d o w & & n u l l ! = = l ) e . i n s e r t B e f o r e ( l . c l o n e N o d e ( ! 0 ) , e . f i r s t C h i l d ) ; e l s e i f ( a ) { s . i n s e r t B e f o r e ( i , s . f i r s t C h i l d ) ; c o n s t t = n e w S e t ; t . a d d ( i ) , u ( a , t ) } } ; w i n d o w . J S C o m p i l e r _ r e n a m e P r o p e r t y = ( t , e ) = > t ; c o n s t Z = { t o A t t r i b u t e ( t , e ) { s w i t c h ( e ) { c a s e B o o l e a n : r e t u r n t ? " " : n u l l ; c a s e O b j e c t : c a s e A r r a y : r e t u r n n u l l = = t ? t : J S O N . s t r i n g i f y ( t ) } r e t u r n t } , f r o m A t t r i b u t e ( t , e ) { s w i t c h ( e ) { c a s e B o o l e a n : r e t u r n n u l l ! = = t ; c a s e N u m b e r : r e t u r n n u l l = = = t ? n u l l : N u m b e r ( t ) ; c a s e O b j e c t : c a s e A r r a y : r e t u r n J S O N . p a r s e ( t ) } r e t u r n t } } , J = ( t , e ) = > e ! = = t & & ( e = = e | | t = = t ) , G = { a t t r i b u t e : ! 0 , t y p e : S t r i n g , c o n v e r t e r : Z , r e f l e c t : ! 1 , h a s C h a n g e d : J } ; c l a s s Y e x t e n d s H T M L E l e m e n t { c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . _ u p d a t e S t a t e = 0 , t h i s . _ i n s t a n c e P r o p e r t i e s = v o i d 0 , t h i s . _ u p d a t e P r o m i s e = n e w P r o m i s e ( t = > t h i s . _ e n a b l e U p d a t i n g R e s o l v e r = t ) , t h i s . _ c h a n g e d P r o p e r t i e s = n e w M a p , t h i s . _ r e f l e c t i n g P r o p e r t i e s = v o i d 0 , t h i s . i n i t i a l i z e ( ) } s t a t i c g e t o b s e r v e d A t t r i b u t e s ( ) { t h i s . f i n a l i z e ( ) ; c o n s t t = [ ] ; r e t u r n t h i s . _ c l a s s P r o p e r t i e s . f o r E a c h ( ( e , a ) = > { c o n s t o = t h i s . _ a t t r i b u t e N a m e F o r P r o p e r t y ( a , e ) ; v o i d 0 ! = = o & & ( t h i s . _ a t t r i b u t e T o P r o p e r t y M a p . s e t ( o , a ) , t . p u s h ( o ) ) } ) , t } s t a t i c _ e n s u r e C l a s s P r o p e r t i e s ( ) { i f ( ! t h i s . h a s O w n P r o p e r t y ( J S C o m p i l e r _ r e n a m e P r o p e r t y ( " _ c l a s s P r o p e r t i e s " , t h i s ) ) ) { t h i s . _ c l a s s P r o p e r t i e s = n e w M a p ; c o n s t t = O b j e c t . g e t P r o t o t y p e O f ( t h i s ) . _ c l a s s P r o p e r t i e s ; v o i d 0 ! = = t & & t . f o r E a c h ( ( t , e ) = > t h i s . _ c l a s s P r o p e r t i e s . s e t ( e , t ) ) } } s t a t i c c r e a t e P r o p e r t y ( t , e = G ) { i f ( t h i s . _ e n s u r e C l a s s P r o p e r t i e s ( ) , t h i s . _ c l a s s P r o p e r t i e s . s e t ( t , e ) , e . n o A c c e s s o r | | t h i s . p r o t o t y p e . h a s O w n P r o p e r t y ( t ) ) r e t u r n ; c o n s t a = " s y m b o l " = = t y p e o f t ? S y m b o l ( ) : " _ _ " + t , o = t h i s . g e t P r o p e r t y D e s c r i p t o r ( t , a , e ) ; v o i d 0 ! = = o & & O b j e c t . d e f i n e P r o p e r t y ( t h i s . p r o t o t y p e , t , o ) } s t a t i c g e t P r o p e r t y D e s c r i p t o r ( t , e , a ) { r e t u r n { g e t ( ) { r e t u r n t h i s [ e ] } , s e t ( a ) { c o n s t o = t h i s [ t ] ; t h i s [ e ] = a , t h i s . _ r e q u e s t U p d a t e ( t , o ) } , c o n f i g u r a b l e : ! 0 , e n u m e r a b l e : ! 0 } } s t a t i c g e t P r o p e r t y O p t i o n s ( t ) { r e t u r n t h i s . _ c l a s s P r o p e r t i e s & & t h i s . _ c l a s s P r o p e r t i e s . g e t ( t ) | | G } s t a t i c f i n a l i z e ( ) { c o n s t t = O b j e c t . g e t P r o t o t y p e O f ( t h i s ) ; i f ( t . h a s O w n P r o p e r t y ( " f i n a l i z e d " ) | | t . f i n a l i z e ( ) , t h i s . f i n a l i z e d = ! 0 , t h i s . _ e n s u r e C l a s s P r o p e r t i e s ( ) , t h i s . _ a t t r i b u t e T o P r o p e r t y M a p = n e w M a p , t h i s . h a s O w n P r o p e r t y ( J S C o m p i l e r _ r e n a m e P r o p e r t y ( " p r o p e r t i e s " , t h i s ) ) ) { c o n s t t = t h i s . p r o p e r t i e s , e = [ . . . O b j e c t . g e t O w n P r o p e r t y N a m e s ( t ) , . . . " f u n c t i o n " = = t y p e o f O b j e c t . g e t O w n P r o p e r t y S y m b o l s ? O b j e c t . g e t O w n P r o p e r t y S y m b o l s ( t ) : [ ] ] ; f o r ( c o n s t a o f e ) t h i s . c r e a t e P r o p e r t y ( a , t [ a ] ) } } s t a t i c _ a t t r i b u t e N a m e F o r P r o p e r t y ( t , e ) { c o n s t a = e . a t t r i b u t e ; r e t u r n ! 1 = = = a ? v o i d 0 : " s t r i n g " = = t y p e o f a ? a : " s t r i n g " = = t y p e o f t ? t . t o L o w e
2020-06-03 20:36:46 +00:00
/ * *
@ license
Copyright ( c ) 2019 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
* /
2021-02-13 22:04:01 +00:00
const X = "adoptedStyleSheets" in Document . prototype && "replace" in CSSStyleSheet . prototype , D = Symbol ( ) ; class L { constructor ( t , e ) { if ( e !== D ) throw new Error ( "CSSResult is not constructable. Use `unsafeCSS` or `css` instead." ) ; this . cssText = t } get styleSheet ( ) { return void 0 === this . _styleSheet && ( X ? ( this . _styleSheet = new CSSStyleSheet , this . _styleSheet . replaceSync ( this . cssText ) ) : this . _styleSheet = null ) , this . _styleSheet } toString ( ) { return this . cssText } } const F = ( t , ... e ) => { const a = e . reduce ( ( e , a , o ) => e + ( t => { if ( t instanceof L ) 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. ` ) } ) ( a ) + t [ o + 1 ] , t [ 0 ] ) ; return new L ( a , D ) } ;
2020-06-03 20:36:46 +00: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
* /
2022-01-21 16:41:52 +00:00
( window . litElementVersions || ( window . litElementVersions = [ ] ) ) . push ( "2.3.1" ) ; const Q = { } ; class H extends Y { static getStyles ( ) { return this . styles } static _getUniqueStyles ( ) { if ( this . hasOwnProperty ( JSCompiler _renameProperty ( "_styles" , this ) ) ) return ; const t = this . getStyles ( ) ; if ( void 0 === t ) this . _styles = [ ] ; else if ( Array . isArray ( t ) ) { const e = ( t , a ) => t . reduceRight ( ( t , a ) => Array . isArray ( a ) ? e ( a , t ) : ( t . add ( a ) , t ) , a ) , a = e ( t , new Set ) , o = [ ] ; a . forEach ( t => o . unshift ( t ) ) , this . _styles = o } else this . _styles = [ t ] } initialize ( ) { super . initialize ( ) , this . constructor . _getUniqueStyles ( ) , 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 ? X ? 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 ) { const e = this . render ( ) ; super . update ( t ) , e !== Q && 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 ( ) { return Q } } H . finalized = ! 0 , H . render = ( t , a , o ) => { if ( ! o || "object" != typeof o || ! o . scopeName ) throw new Error ( "The `scopeName` option is required." ) ; const n = o . scopeName , r = P . has ( a ) , i = R && 11 === a . nodeType && ! ! a . host , s = i && ! K . has ( n ) , l = s ? document . createDocumentFragment ( ) : a ; if ( ( ( t , a , o ) => { let n = P . get ( a ) ; void 0 === n && ( e ( a , a . firstChild ) , P . set ( a , n = new V ( Object . assign ( { templateFactory : M } , o ) ) ) , n . appendInto ( a ) ) , n . setValue ( t ) , n . commit ( ) } ) ( t , l , Object . assign ( { templateFactory : I ( n ) } , o ) ) , s ) { const t = P . get ( l ) ; P . delete ( l ) ; const o = t . value instanceof f ? t . value . template : void 0 ; U ( n , l , o ) , e ( a , a . firstChild ) , a . appendChild ( l ) , P . set ( a , t ) } ! r && i && window . ShadyCSS . styleElement ( a . host ) } ; var B = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g , $ = "[^\\s]+" , tt = /\[([^]*?)\]/gm ; function et ( t , e ) { for ( var a = [ ] , o = 0 , n = t . length ; o < n ; o ++ ) a . push ( t [ o ] . substr ( 0 , e ) ) ; return a } var at = function ( t ) { return function ( e , a ) { var o = a [ t ] . map ( ( function ( t ) { return t . toLowerCase ( ) } ) ) . indexOf ( e . toLowerCase ( ) ) ; return o > - 1 ? o : null } } ; function ot ( t ) { for ( var e = [ ] , a = 1 ; a < arguments . length ; a ++ ) e [ a - 1 ] = arguments [ a ] ; for ( var o = 0 , n = e ; o < n . length ; o ++ ) { var r = n [ o ] ; for ( var i in r ) t [ i ] = r [ i ] } return t } var nt = [ "Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" ] , rt = [ "January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" ] , it = et ( rt , 3 ) , st = { dayNamesShort : et ( nt , 3 ) , dayNames : nt , monthNamesShort : it , monthNames : rt , amPm : [ "am" , "pm" ] , DoFn : function ( t ) { return t + [ "th" , "st" , "nd" , "rd" ] [ t % 10 > 3 ? 0 : ( t - t % 10 != 10 ? 1 : 0 ) * t % 10 ] } } , lt = ot ( { } , st ) , ct = function ( t , e ) { for ( void 0 === e && ( e = 2 ) , t = String ( t ) ; t . length < e ; ) t = "0" + t ; return t } , ut = { D : function ( t ) { return String ( t . getDate ( ) ) } , DD : function ( t ) { return ct ( t . getDate ( ) ) } , Do : function ( t , e ) { return e . DoFn ( t . getDate ( ) ) } , d : function ( t ) { return String ( t . getDay ( ) ) } , dd : function ( t ) { return ct ( t . getDay ( ) ) } , ddd : function ( t , e ) { return e . dayNamesShort [ t . getDay ( ) ] } , dddd : function ( t , e ) { return e . dayNames [ t . getDay ( ) ] } , M : function ( t ) { return String ( t . getMonth ( ) + 1 ) } , MM : function ( t ) { return ct ( t . getMonth ( ) + 1 ) } , MMM : function ( t , e ) { return e . monthNamesShort [ t . getMonth ( ) ] } , MMMM : function ( t , e ) { return e . monthNames [ t . getMonth ( ) ] } , YY : function ( t ) { return ct ( String ( t . getFullYear ( ) ) , 4 ) . substr ( 2 ) } , YYYY : function ( t ) { return ct ( t . getFullYear ( ) , 4 ) } , h : function ( t ) { return String ( t . getHours ( ) % 12 || 12 ) } , hh : function ( t ) { return ct ( t . getHours ( ) % 12 || 12 ) } , H : function ( t ) { return String ( t . getHours ( ) ) } , HH : function ( t ) { return ct ( t . getHours ( ) ) } , m : function ( t ) { return String ( t . getMinutes ( ) ) } , mm : function ( t ) { return ct ( t . getMinutes ( ) ) } , s : function ( t ) { return String ( t . getSeconds ( ) ) } , ss : function ( t ) { return ct ( t . getSeco
2020-06-03 20:36:46 +00:00
< div class = "card-config" >
< paper - dropdown - menu
2022-01-21 16:41:52 +00:00
label = "${rn(" editor . entity ")}"
2020-06-03 20:36:46 +00:00
@ value - changed = $ { this . _valueChanged }
. configValue = $ { "entity" }
>
< paper - listbox
slot = "dropdown-content"
. selected = $ { t . indexOf ( this . _entity ) }
>
2021-07-13 16:16:02 +00:00
$ { t . map ( t => O ` <paper-item> ${ t } </paper-item> ` ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - l i s t b o x >
< / p a p e r - d r o p d o w n - m e n u >
< paper - dropdown - menu
2022-01-21 16:41:52 +00:00
label = "${rn(" editor . entity ")}"
2020-06-03 20:36:46 +00:00
@ value - changed = $ { this . _valueChanged }
. configValue = $ { "map" }
>
< paper - listbox
slot = "dropdown-content"
. selected = $ { e . indexOf ( this . _map ) }
>
2021-07-13 16:16:02 +00:00
$ { e . map ( t => O ` <paper-item> ${ t } </paper-item> ` ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - l i s t b o x >
< / p a p e r - d r o p d o w n - m e n u >
< paper - input
2022-01-21 16:41:52 +00:00
label = "${rn(" editor . image ")}"
2020-06-03 20:36:46 +00:00
. value = $ { this . _image }
. configValue = $ { "image" }
@ value - changed = $ { this . _valueChanged }
> < / p a p e r - i n p u t >
2020-10-02 18:34:43 +00:00
< p class = "option" >
< ha - switch
2022-01-21 16:41:52 +00:00
aria - label = $ { rn ( this . _compact _view ? "editor.compact_view_aria_label_off" : "editor.compact_view_aria_label_on" ) }
2020-10-02 18:34:43 +00:00
. checked = $ { ! 1 !== this . _compact _view }
. configValue = $ { "compact_view" }
@ change = $ { this . _valueChanged }
>
< / h a - s w i t c h >
2022-01-21 16:41:52 +00:00
$ { rn ( "editor.compact_view" ) }
2020-10-02 18:34:43 +00:00
< / p >
< p class = "option" >
< ha - switch
2022-01-21 16:41:52 +00:00
aria - label = $ { rn ( this . _show _name ? "editor.show_name_aria_label_off" : "editor.show_name_aria_label_on" ) }
2020-10-02 18:34:43 +00:00
. checked = $ { ! 1 !== this . _show _name }
. configValue = $ { "show_name" }
@ change = $ { this . _valueChanged }
>
< / h a - s w i t c h >
2022-01-21 16:41:52 +00:00
$ { rn ( "editor.show_name" ) }
2020-10-02 18:34:43 +00:00
< / p >
< p class = "option" >
< ha - switch
2022-01-21 16:41:52 +00:00
aria - label = $ { rn ( this . _show _status ? "editor.show_status_aria_label_off" : "editor.show_status_aria_label_on" ) }
2020-10-02 18:34:43 +00:00
. checked = $ { ! 1 !== this . _show _status }
. configValue = $ { "show_status" }
@ change = $ { this . _valueChanged }
>
< / h a - s w i t c h >
2022-01-21 16:41:52 +00:00
$ { rn ( "editor.show_status" ) }
2020-10-02 18:34:43 +00:00
< / p >
< p class = "option" >
< ha - switch
2022-01-21 16:41:52 +00:00
aria - label = $ { rn ( this . _show _name ? "editor.show_toolbar_aria_label_off" : "editor.show_toolbar_aria_label_on" ) }
2020-10-02 18:34:43 +00:00
. checked = $ { ! 1 !== this . _show _toolbar }
. configValue = $ { "show_toolbar" }
@ change = $ { this . _valueChanged }
>
< / h a - s w i t c h >
2022-01-21 16:41:52 +00:00
$ { rn ( "editor.show_toolbar" ) }
2020-10-02 18:34:43 +00:00
< / p >
2020-06-03 20:36:46 +00:00
< strong >
2022-01-21 16:41:52 +00:00
$ { rn ( "editor.code_only_note" ) }
2020-06-03 20:36:46 +00:00
< / s t r o n g >
< / d i v >
2021-04-22 17:47:13 +00:00
` }_valueChanged(t){if(!this._config||!this.hass)return;const e=t.target;this["_"+e.configValue]!==e.value&&(e.configValue&&(""===e.value?delete this._config[e.configValue]:this._config={...this._config,[e.configValue]:void 0!==e.checked?e.checked:e.value}),bt(this,"config-changed",{config:this._config}))}static get styles(){return F `
2020-06-03 20:36:46 +00:00
. card - config paper - dropdown - menu {
width : 100 % ;
}
2020-10-02 18:34:43 +00:00
. option {
display : flex ;
align - items : center ;
}
. option ha - switch {
margin - right : 10 px ;
}
2022-01-21 16:41:52 +00:00
` }});var sn=F `
2020-06-03 20:36:46 +00:00
: host {
display : flex ;
flex : 1 ;
flex - direction : column ;
}
ha - card {
flex - direction : column ;
flex : 1 ;
position : relative ;
padding : 0 px ;
border - radius : 4 px ;
overflow : hidden ;
}
. preview {
background : var ( -- primary - color ) ;
cursor : pointer ;
overflow : hidden ;
position : relative ;
2020-10-07 18:14:05 +00:00
text - align : center ;
2020-06-03 20:36:46 +00:00
}
. preview . not - available {
filter : grayscale ( 1 ) ;
}
. map {
2020-10-07 18:14:05 +00:00
max - width : 95 % ;
2021-06-12 16:49:32 +00:00
image - rendering : - webkit - optimize - contrast ;
2020-06-03 20:36:46 +00:00
image - rendering : crisp - edges ;
}
@ keyframes cleaning {
0 % {
transform : rotate ( 0 ) translate ( 0 ) ;
}
5 % {
transform : rotate ( 0 ) translate ( 0 , - 10 px ) ;
}
10 % {
transform : rotate ( 0 ) translate ( 0 , 5 px ) ;
}
15 % {
transform : rotate ( 0 ) translate ( 0 ) ;
}
/* Turn left */
20 % {
transform : rotate ( 30 deg ) translate ( 0 ) ;
}
25 % {
transform : rotate ( 30 deg ) translate ( 0 , - 10 px ) ;
}
30 % {
transform : rotate ( 30 deg ) translate ( 0 , 5 px ) ;
}
35 % {
transform : rotate ( 30 deg ) translate ( 0 ) ;
}
40 % {
transform : rotate ( 0 ) translate ( 0 ) ;
}
/* Turn right */
45 % {
transform : rotate ( - 30 deg ) translate ( 0 ) ;
}
50 % {
transform : rotate ( - 30 deg ) translate ( 0 , - 10 px ) ;
}
55 % {
transform : rotate ( - 30 deg ) translate ( 0 , 5 px ) ;
}
60 % {
transform : rotate ( - 30 deg ) translate ( 0 ) ;
}
70 % {
transform : rotate ( 0 deg ) translate ( 0 ) ;
}
/* Staying still */
100 % {
transform : rotate ( 0 deg ) ;
}
}
@ keyframes returning {
0 % {
transform : rotate ( 0 ) ;
}
25 % {
transform : rotate ( 10 deg ) ;
}
50 % {
transform : rotate ( 0 ) ;
}
75 % {
transform : rotate ( - 10 deg ) ;
}
100 % {
transform : rotate ( 0 ) ;
}
}
. vacuum {
display : block ;
max - width : 90 % ;
max - height : 200 px ;
image - rendering : crisp - edges ;
margin : 30 px auto 20 px auto ;
}
2021-06-12 16:49:32 +00:00
. vacuum . on ,
2020-10-02 18:34:43 +00:00
. vacuum . cleaning ,
2021-06-12 16:49:32 +00:00
. vacuum . auto ,
. vacuum . spot ,
. vacuum . edge ,
. vacuum . single _room {
2020-06-03 20:36:46 +00:00
animation : cleaning 5 s linear infinite ;
}
. vacuum . returning {
animation : returning 2 s linear infinite ;
}
. vacuum . paused {
opacity : 100 % ;
}
. vacuum . docked {
opacity : 50 % ;
}
. fill - gap {
flex - grow : 1 ;
}
. header {
height : 40 px ;
display : flex ;
flex - direction : row ;
justify - content : space - between ;
align - items : center ;
color : var ( -- text - primary - color ) ;
}
. battery {
text - align : right ;
font - weight : bold ;
padding : 8 px ;
}
. source {
text - align : center ;
}
. status {
display : flex ;
align - items : center ;
justify - content : center ;
2021-07-12 04:33:18 +00:00
direction : ltr ;
2020-06-03 20:36:46 +00:00
}
. status - text {
color : var ( -- text - primary - color ) ;
white - space : nowrap ;
text - overflow : ellipsis ;
overflow : hidden ;
margin - left : calc ( 20 px + 9 px ) ; /* size + margin of spinner */
}
2020-10-02 18:34:43 +00:00
. status ha - circular - progress {
-- mdc - theme - primary : var (
-- card - background - color
) ; /* hack to override the color */
min - width : 24 px ;
width : 24 px ;
height : 24 px ;
2020-06-03 20:36:46 +00:00
margin - left : 9 px ;
}
. vacuum - name {
text - align : center ;
font - weight : bold ;
color : var ( -- text - primary - color ) ;
font - size : 16 px ;
}
2021-06-12 16:49:32 +00:00
. not - available . offline {
2020-06-03 20:36:46 +00:00
text - align : center ;
color : var ( -- text - primary - color ) ;
font - size : 16 px ;
}
. metadata {
margin : 10 px auto ;
}
. stats {
border - top : 1 px solid rgba ( 255 , 255 , 255 , 0.2 ) ;
display : flex ;
flex - direction : row ;
justify - content : space - evenly ;
color : var ( -- text - primary - color ) ;
}
. stats - block {
margin : 10 px 0 px ;
text - align : center ;
border - right : 1 px solid rgba ( 255 , 255 , 255 , 0.2 ) ;
flex - grow : 1 ;
}
. stats - block : last - child {
border : 0 px ;
}
2020-10-02 18:34:43 +00:00
. stats - value {
2020-06-03 20:36:46 +00:00
font - size : 20 px ;
font - weight : bold ;
}
ha - icon {
color : # fff ;
}
. toolbar {
background : var ( -- lovelace - background , var ( -- primary - background - color ) ) ;
min - height : 30 px ;
display : flex ;
flex - direction : row ;
2021-07-12 04:33:18 +00:00
flex - flow : row wrap ;
flex - wrap : wrap ;
2020-06-03 20:36:46 +00:00
justify - content : space - evenly ;
}
. toolbar ha - icon - button {
color : var ( -- primary - color ) ;
flex - direction : column ;
width : 44 px ;
height : 44 px ;
-- mdc - icon - button - size : 44 px ;
margin : 5 px 0 ;
}
. toolbar ha - icon - button : first - child {
margin - left : 5 px ;
}
. toolbar ha - icon - button : last - child {
margin - right : 5 px ;
}
. toolbar paper - button {
color : var ( -- primary - color ) ;
flex - direction : column ;
margin - right : 10 px ;
padding : 15 px 10 px ;
cursor : pointer ;
}
. toolbar ha - icon - button : active ,
. toolbar paper - button : active {
opacity : 0.4 ;
background : rgba ( 0 , 0 , 0 , 0.1 ) ;
}
. toolbar paper - button {
color : var ( -- primary - color ) ;
flex - direction : row ;
}
. toolbar ha - icon {
color : var ( -- primary - color ) ;
2021-11-10 20:39:55 +00:00
display : flex ;
2020-06-03 20:36:46 +00:00
}
2022-01-21 16:41:52 +00:00
` ;const ln="data:image/png;base64,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
2020-06-03 20:36:46 +00:00
< paper - menu - button
slot = "dropdown-trigger"
. horizontalAlign = $ { "right" }
. verticalAlign = $ { "top" }
. verticalOffset = $ { 40 }
. noAnimations = $ { ! 0 }
@ click = "${t=>t.stopPropagation()}"
>
< paper - button slot = "dropdown-trigger" >
< ha - icon icon = "mdi:fan" > < / h a - i c o n >
< span show = $ { ! 0 } >
2022-01-21 16:41:52 +00:00
$ { rn ( "source." + t ) || t }
2020-06-03 20:36:46 +00:00
< / s p a n >
< / p a p e r - b u t t o n >
< paper - listbox
slot = "dropdown-content"
selected = $ { a }
@ click = "${t=>this.handleSpeed(t)}"
>
2021-07-13 16:16:02 +00:00
$ { e . map ( t => O ` <paper-item value= ${ t }
2022-01-21 16:41:52 +00:00
> $ { rn ( "source." + t ) || t } < / p a p e r - i t e m
2020-06-03 20:36:46 +00:00
> ` )}
< / p a p e r - l i s t b o x >
< / p a p e r - m e n u - b u t t o n >
2021-07-13 16:16:02 +00:00
` }renderMapOrImage(t){return this.compactView?O ` ` :this.map?this.hass.states[this.config.map]&&this.hass.states[this.config.map].attributes.entity_picture?O ` < img
2021-04-19 13:24:44 +00:00
class = "map"
src = "${this.hass.states[this.config.map].attributes.entity_picture}&v=${+new Date}"
2021-07-13 16:16:02 +00:00
/>`:O``:this.image?O`<img class="vacuum ${t}" src="${this.image}" / > ` :O ` ` }renderStats(t){const{stats:e={}}=this.config;return(e[t]||e.default||[]).map(({entity_id:t,attribute:e,unit:a,subtitle:o})=>{if(!t&&!e)return O ` ` ;const n=t?this.hass.states[t].state:re(this.entity.attributes,e);return O `
2020-06-03 20:36:46 +00:00
< div class = "stats-block" >
2021-02-13 22:04:01 +00:00
< span class = "stats-value" > $ { n } < / s p a n >
2020-10-02 18:34:43 +00:00
$ { a }
2020-12-12 21:50:33 +00:00
< div class = "stats-subtitle" > $ { o } < / d i v >
2020-06-03 20:36:46 +00:00
< / d i v >
2021-07-13 16:16:02 +00:00
` })}renderName(){const{friendly_name:t}=this.getAttributes(this.entity);return this.showName?O `
2020-06-03 20:36:46 +00:00
< div class = "vacuum-name" >
$ { t }
< / d i v >
2022-01-21 16:41:52 +00:00
` :O ` ` }renderStatus(){const{status:t}=this.getAttributes(this.entity),e=rn("status."+t)||t;return this.showStatus?O `
2020-06-03 20:36:46 +00:00
< div class = "status" >
< span class = "status-text" alt = $ { e } >
$ { e }
< / s p a n >
2020-10-02 18:34:43 +00:00
< ha - circular - progress
. active = $ { this . requestInProgress }
size = "small"
> < / h a - c i r c u l a r - p r o g r e s s >
2020-06-03 20:36:46 +00:00
< / d i v >
2021-07-13 16:16:02 +00:00
` :O ` ` }renderToolbar(t){if(!this.showToolbar)return O ` ` ;switch(t){case"on":case"auto":case"spot":case"edge":case"single_room":case"cleaning":return O `
2020-06-03 20:36:46 +00:00
< div class = "toolbar" >
2021-11-09 20:21:52 +00:00
< paper - button @ click = "${this.handlePause}" >
2020-06-03 20:36:46 +00:00
< ha - icon icon = "hass:pause" > < / h a - i c o n >
2022-01-21 16:41:52 +00:00
$ { rn ( "common.pause" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
2021-11-09 20:21:52 +00:00
< paper - button @ click = "${this.handleStop}" >
2020-06-03 20:36:46 +00:00
< ha - icon icon = "hass:stop" > < / h a - i c o n >
2022-01-21 16:41:52 +00:00
$ { rn ( "common.stop" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
2021-11-09 20:21:52 +00:00
< paper - button @ click = "${this.handleReturnToBase}" >
2020-06-03 20:36:46 +00:00
< ha - icon icon = "hass:home-map-marker" > < / h a - i c o n >
2022-01-21 16:41:52 +00:00
$ { rn ( "common.return_to_base" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< / d i v >
2021-07-13 16:16:02 +00:00
` ;case"paused":return O `
2020-06-03 20:36:46 +00:00
< div class = "toolbar" >
2021-11-09 20:21:52 +00:00
< paper - button @ click = "${this.handleResume}" >
2020-06-03 20:36:46 +00:00
< ha - icon icon = "hass:play" > < / h a - i c o n >
2022-01-21 16:41:52 +00:00
$ { rn ( "common.continue" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
2021-11-09 20:21:52 +00:00
< paper - button @ click = "${this.handleReturnToBase}" >
2020-06-03 20:36:46 +00:00
< ha - icon icon = "hass:home-map-marker" > < / h a - i c o n >
2022-01-21 16:41:52 +00:00
$ { rn ( "common.return_to_base" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< / d i v >
2021-07-13 16:16:02 +00:00
` ;case"returning":return O `
2020-06-03 20:36:46 +00:00
< div class = "toolbar" >
2021-11-09 20:21:52 +00:00
< paper - button @ click = "${this.handleResume}" >
2020-06-03 20:36:46 +00:00
< ha - icon icon = "hass:play" > < / h a - i c o n >
2022-01-21 16:41:52 +00:00
$ { rn ( "common.continue" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
2021-11-09 20:21:52 +00:00
< paper - button @ click = "${this.handlePause}" >
2020-06-03 20:36:46 +00:00
< ha - icon icon = "hass:pause" > < / h a - i c o n >
2022-01-21 16:41:52 +00:00
$ { rn ( "common.pause" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< / d i v >
2021-11-09 20:21:52 +00:00
` ;case"docked":case"idle":default:{const{shortcuts:e=[]}=this.config,a=e.map(({name:t,service:e,icon:a,service_data:o})=>O ` < ha - icon - button title = "${t}" @ click = "${()=>{this.callAction({service:e,service_data:o})}}"
> < ha - icon icon = "${a}" > < / h a - i c o n
> < / h a - i c o n - b u t t o n > ` ) , o = O `
2020-06-03 20:36:46 +00:00
< ha - icon - button
2022-01-21 16:41:52 +00:00
title = "${rn(" common . return _to _base ")}"
2021-11-09 20:21:52 +00:00
@ click = "${this.handleReturnToBase}"
> < ha - icon icon = "hass:home-map-marker" > < / h a - i c o n >
2020-06-03 20:36:46 +00:00
< / h a - i c o n - b u t t o n >
2021-07-13 16:16:02 +00:00
` ;return O `
2020-06-03 20:36:46 +00:00
< div class = "toolbar" >
< ha - icon - button
2022-01-21 16:41:52 +00:00
title = "${rn(" common . start ")}"
2021-11-09 20:21:52 +00:00
@ click = "${this.handleStart}"
> < ha - icon icon = "hass:play" > < / h a - i c o n >
2020-06-03 20:36:46 +00:00
< / h a - i c o n - b u t t o n >
< ha - icon - button
2022-01-21 16:41:52 +00:00
title = "${rn(" common . locate ")}"
2021-11-09 20:21:52 +00:00
@ click = "${this.handleLocate}"
> < ha - icon icon = "mdi:map-marker" > < / h a - i c o n >
2020-06-03 20:36:46 +00:00
< / h a - i c o n - b u t t o n >
2020-12-12 21:50:33 +00:00
$ { "idle" === t ? o : "" }
2020-06-03 20:36:46 +00:00
< div class = "fill-gap" > < / d i v >
$ { a }
< / d i v >
2021-07-13 16:16:02 +00:00
` }}}render(){if(!this.entity)return O `
2020-06-03 20:36:46 +00:00
< ha - card >
< div class = "preview not-available" >
< div class = "metadata" >
< div class = "not-available" >
2022-01-21 16:41:52 +00:00
$ { rn ( "common.not_available" ) }
2020-06-03 20:36:46 +00:00
< / d i v >
< div >
< / d i v >
< / h a - c a r d >
2021-07-13 16:16:02 +00:00
` ;const{state:t}=this.entity,{battery_level:e,battery_icon:a}=this.getAttributes(this.entity);return O `
2020-06-03 20:36:46 +00:00
< ha - card >
2021-11-09 20:21:52 +00:00
< div class = "preview" @ click = "${this.handleMore}" ? more - info = "true" >
2020-06-03 20:36:46 +00:00
< div class = "header" >
< div class = "source" >
$ { this . renderSource ( ) }
< / d i v >
< div class = "battery" >
$ { e } % < ha - icon icon = "${a}" > < / h a - i c o n >
< / d i v >
< / d i v >
$ { this . renderMapOrImage ( t ) }
< div class = "metadata" >
$ { this . renderName ( ) } $ { this . renderStatus ( ) }
< / d i v >
< div class = "stats" >
$ { this . renderStats ( t ) }
< / d i v >
< / d i v >
$ { this . renderToolbar ( t ) }
< / h a - c a r d >
2022-01-21 16:41:52 +00:00
` }}),window.customCards=window.customCards||[],window.customCards.push({preview:!0,type:"vacuum-card",name:rn("common.name"),description:rn("common.description")});