diff --git a/honeycomb-menu.js b/honeycomb-menu.js index 3273807..814a98a 100644 --- a/honeycomb-menu.js +++ b/honeycomb-menu.js @@ -1,4 +1,4 @@ -!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=179)}([function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var o=n(42),r="object"==typeof self&&self&&self.Object===Object&&self,i=o||r||Function("return this")();t.exports=i},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var o=n(10),r=n(86),i=n(87),s=o?o.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?r(t):i(t)}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var o=n(33),r=n(27);t.exports=function(t,e,n,i){var s=!n;n||(n={});for(var a=-1,c=e.length;++a1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(i--,s):void 0,a&&r(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++o-1&&t%1==0&&t<=9007199254740991}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e,n){var o=n(113),r=n(17),i=n(2),s=n(18),a=n(55),c=n(32),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),l=!n&&r(t),h=!n&&!l&&s(t),p=!n&&!l&&!h&&c(t),f=n||l||h||p,d=f?o(t.length,String):[],v=d.length;for(var y in t)!e&&!u.call(t,y)||f&&("length"==y||h&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,v))||d.push(y);return d}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var o=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==o||"symbol"!=o&&n.test(t))&&t>-1&&t%1==0&&tr?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(r);++o/g},function(t,e,n){var o=n(41),r=n(45),i=n(103),s=n(105),a=n(4),c=n(9),u=n(53);t.exports=function t(e,n,l,h,p){e!==n&&i(n,(function(i,c){if(p||(p=new o),a(i))s(e,n,c,l,t,h,p);else{var f=h?h(u(e,c),i,c+"",e,n,p):void 0;void 0===f&&(f=i),r(e,c,f)}}),c)}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var o=n(14),r=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=o(e,t);return!(n<0)&&(n==e.length-1?e.pop():r.call(e,n,1),--this.size,!0)}},function(t,e,n){var o=n(14);t.exports=function(t){var e=this.__data__,n=o(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var o=n(14);t.exports=function(t){return o(this.__data__,t)>-1}},function(t,e,n){var o=n(14);t.exports=function(t,e){var n=this.__data__,r=o(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}},function(t,e,n){var o=n(13);t.exports=function(){this.__data__=new o,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var o=n(13),r=n(25),i=n(44);t.exports=function(t,e){var n=this.__data__;if(n instanceof o){var s=n.__data__;if(!r||s.length<199)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var o=n(26),r=n(88),i=n(4),s=n(43),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,h=u.hasOwnProperty,p=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||r(t))&&(o(t)?p:a).test(s(t))}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var o=n(10),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,a=o?o.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),n=t[a];try{t[a]=void 0;var o=!0}catch(t){}var r=s.call(t);return o&&(e?t[a]=n:delete t[a]),r}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var o,r=n(89),i=(o=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var o=n(1)["__core-js_shared__"];t.exports=o},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var o=n(92),r=n(13),i=n(25);t.exports=function(){this.size=0,this.__data__={hash:new o,map:new(i||r),string:new o}}},function(t,e,n){var o=n(93),r=n(94),i=n(95),s=n(96),a=n(97);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var o=n(33),r=n(5),i=n(34),s=n(8),a=n(11),c=n(12),u=Object.prototype.hasOwnProperty,l=i((function(t,e){if(a(e)||s(e))r(e,c(e),t);else for(var n in e)u.call(e,n)&&o(t,n,e[n])}));t.exports=l},function(t,e,n){var o=n(51)(Object.keys,Object);t.exports=o},function(t,e,n){var o=n(6)(n(1),"DataView");t.exports=o},function(t,e,n){var o=n(6)(n(1),"Promise");t.exports=o},function(t,e,n){var o=n(6)(n(1),"Set");t.exports=o},function(t,e,n){var o=n(6)(n(1),"WeakMap");t.exports=o},function(t,e,n){var o=n(3),r=n(2),i=n(0);t.exports=function(t){return"string"==typeof t||!r(t)&&i(t)&&"[object String]"==o(t)}},function(t,e){t.exports=function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}},function(t,e,n){var o=n(4),r=n(23),i=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(i,"");var n=a.test(t);return n||c.test(t)?u(t.slice(2),n?2:8):s.test(t)?NaN:+t}},function(t,e,n){var o=n(36),r=n(129),i=n(146),s=n(39),a=n(5),c=n(154),u=n(155),l=n(66),h=u((function(t,e){var n={};if(null==t)return n;var u=!1;e=o(e,(function(e){return e=s(e,t),u||(u=e.length>1),e})),a(t,l(t),n),u&&(n=r(n,7,c));for(var h=e.length;h--;)i(n,e[h]);return n}));t.exports=h},function(t,e,n){var o=n(41),r=n(130),i=n(33),s=n(131),a=n(132),c=n(47),u=n(49),l=n(133),h=n(135),p=n(136),f=n(66),d=n(22),v=n(137),y=n(138),b=n(50),m=n(2),_=n(18),g=n(142),x=n(4),$=n(144),j=n(12),w={};w["[object Arguments]"]=w["[object Array]"]=w["[object ArrayBuffer]"]=w["[object DataView]"]=w["[object Boolean]"]=w["[object Date]"]=w["[object Float32Array]"]=w["[object Float64Array]"]=w["[object Int8Array]"]=w["[object Int16Array]"]=w["[object Int32Array]"]=w["[object Map]"]=w["[object Number]"]=w["[object Object]"]=w["[object RegExp]"]=w["[object Set]"]=w["[object String]"]=w["[object Symbol]"]=w["[object Uint8Array]"]=w["[object Uint8ClampedArray]"]=w["[object Uint16Array]"]=w["[object Uint32Array]"]=!0,w["[object Error]"]=w["[object Function]"]=w["[object WeakMap]"]=!1,t.exports=function t(e,n,A,S,E,O){var P,C=1&n,k=2&n,z=4&n;if(A&&(P=E?A(e,S,E,O):A(e)),void 0!==P)return P;if(!x(e))return e;var U=m(e);if(U){if(P=v(e),!C)return u(e,P)}else{var R=d(e),T="[object Function]"==R||"[object GeneratorFunction]"==R;if(_(e))return c(e,C);if("[object Object]"==R||"[object Arguments]"==R||T&&!E){if(P=k||T?{}:b(e),!C)return k?h(e,a(P,e)):l(e,s(P,e))}else{if(!w[R])return E?e:{};P=y(e,R,C)}}O||(O=new o);var N=O.get(e);if(N)return N;O.set(e,P),$(e)?e.forEach((function(o){P.add(t(o,n,A,o,e,O))})):g(e)&&e.forEach((function(o,r){P.set(r,t(o,n,A,r,e,O))}));var I=z?k?f:p:k?keysIn:j,M=U?void 0:I(e);return r(M||e,(function(o,r){M&&(o=e[r=o]),i(P,r,t(o,n,A,r,e,O))})),P}},function(t,e){t.exports=function(t,e){for(var n=-1,o=null==t?0:t.length;++n0&&i(l)?n>1?t(l,n-1,i,s,a):o(a,l):s||(a[a.length]=l)}return a}},function(t,e,n){var o=n(10),r=n(17),i=n(2),s=o?o.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||r(t)||!!(s&&t&&t[s])}},function(t,e,n){var o=n(67),r=n(160),i=n(70),s=n(21),a=n(161),c=n(163),u=n(24);t.exports=function(t,e,n){return n&&"number"!=typeof n&&s(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=u(t))&&("string"==typeof e||null!=e&&!a(e))&&!(e=o(e))&&i(t)?r(c(t),0,n):t.split(e,n):[]}},function(t,e,n){var o=n(69);t.exports=function(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:o(t,e,n)}},function(t,e,n){var o=n(162),r=n(19),i=n(20),s=i&&i.isRegExp,a=s?r(s):o;t.exports=a},function(t,e,n){var o=n(3),r=n(0);t.exports=function(t){return r(t)&&"[object RegExp]"==o(t)}},function(t,e,n){var o=n(164),r=n(70),i=n(165);t.exports=function(t){return r(t)?i(t):o(t)}},function(t,e){t.exports=function(t){return t.split("")}},function(t,e){var n="[\\ud800-\\udfff]",o="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:"+o+"|"+r+")"+"?",u="[\\ufe0e\\ufe0f]?"+c+("(?:\\u200d(?:"+[i,s,a].join("|")+")[\\ufe0e\\ufe0f]?"+c+")*"),l="(?:"+[i+o+"?",o,s,a,n].join("|")+")",h=RegExp(r+"(?="+r+")|"+l+u,"g");t.exports=function(t){return t.match(h)||[]}},function(t,e,n){var o=n(167),r=n(168),i=n(169),s=n(170),a=n(171),c=n(71),u=n(21),l=n(12),h=n(72),p=n(172),f=n(24),d=/\b__p \+= '';/g,v=/\b(__p \+=) '' \+/g,y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,b=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,m=/($^)/,_=/['\n\r\u2028\u2029\\]/g,g=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var x=p.imports._.templateSettings||p;n&&u(t,e,n)&&(e=void 0),t=f(t),e=o({},e,x,s);var $,j,w=o({},e.imports,x.imports,s),A=l(w),S=i(w,A),E=0,O=e.interpolate||m,P="__p += '",C=RegExp((e.escape||m).source+"|"+O.source+"|"+(O===h?b:m).source+"|"+(e.evaluate||m).source+"|$","g"),k=g.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/[\r\n]/g," ")+"\n":"";t.replace(C,(function(e,n,o,r,i,s){return o||(o=r),P+=t.slice(E,s).replace(_,a),n&&($=!0,P+="' +\n__e("+n+") +\n'"),i&&(j=!0,P+="';\n"+i+";\n__p += '"),o&&(P+="' +\n((__t = ("+o+")) == null ? '' : __t) +\n'"),E=s+e.length,e})),P+="';\n";var z=g.call(e,"variable")&&e.variable;z||(P="with (obj) {\n"+P+"\n}\n"),P=(j?P.replace(d,""):P).replace(v,"$1").replace(y,"$1;"),P="function("+(z||"obj")+") {\n"+(z?"":"obj || (obj = {});\n")+"var __t, __p = ''"+($?", __e = _.escape":"")+(j?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+P+"return __p\n}";var U=r((function(){return Function(A,k+"return "+P).apply(void 0,S)}));if(U.source=P,c(U))throw U;return U}},function(t,e,n){var o=n(5),r=n(34),i=n(9),s=r((function(t,e,n,r){o(e,i(e),t,r)}));t.exports=s},function(t,e,n){var o=n(58),r=n(35),i=n(71),s=r((function(t,e){try{return o(t,void 0,e)}catch(t){return i(t)?t:new Error(t)}}));t.exports=s},function(t,e,n){var o=n(36);t.exports=function(t,e){return o(e,(function(e){return t[e]}))}},function(t,e,n){var o=n(7),r=Object.prototype,i=r.hasOwnProperty;t.exports=function(t,e,n,s){return void 0===t||o(t,r[n])&&!i.call(s,n)?e:t}},function(t,e){var n={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};t.exports=function(t){return"\\"+n[t]}},function(t,e,n){var o=n(173),r={escape:n(176),evaluate:n(177),interpolate:n(72),variable:"",imports:{_:{escape:o}}};t.exports=r},function(t,e,n){var o=n(174),r=n(24),i=/[&<>"']/g,s=RegExp(i.source);t.exports=function(t){return(t=r(t))&&s.test(t)?t.replace(i,o):t}},function(t,e,n){var o=n(175)({"&":"&","<":"<",">":">",'"':""","'":"'"});t.exports=o},function(t,e){t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},function(t,e){t.exports=/<%-([\s\S]+?)%>/g},function(t,e){t.exports=/<%([\s\S]+?)%>/g},function(t,e,n){var o=n(35),r=n(7),i=n(21),s=n(9),a=Object.prototype,c=a.hasOwnProperty,u=o((function(t,e){t=Object(t);var n=-1,o=e.length,u=o>2?e[2]:void 0;for(u&&i(e[0],e[1],u)&&(o=1);++n1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(i--,s):void 0,a&&r(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++o-1&&t%1==0&&t<=9007199254740991}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e,n){var o=n(113),r=n(17),i=n(2),s=n(18),a=n(55),c=n(32),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),l=!n&&r(t),h=!n&&!l&&s(t),p=!n&&!l&&!h&&c(t),f=n||l||h||p,d=f?o(t.length,String):[],v=d.length;for(var y in t)!e&&!u.call(t,y)||f&&("length"==y||h&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,v))||d.push(y);return d}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var o=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==o||"symbol"!=o&&n.test(t))&&t>-1&&t%1==0&&tr?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(r);++o/g},function(t,e,n){var o=n(41),r=n(45),i=n(103),s=n(105),a=n(4),c=n(9),u=n(53);t.exports=function t(e,n,l,h,p){e!==n&&i(n,(function(i,c){if(p||(p=new o),a(i))s(e,n,c,l,t,h,p);else{var f=h?h(u(e,c),i,c+"",e,n,p):void 0;void 0===f&&(f=i),r(e,c,f)}}),c)}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var o=n(14),r=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=o(e,t);return!(n<0)&&(n==e.length-1?e.pop():r.call(e,n,1),--this.size,!0)}},function(t,e,n){var o=n(14);t.exports=function(t){var e=this.__data__,n=o(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var o=n(14);t.exports=function(t){return o(this.__data__,t)>-1}},function(t,e,n){var o=n(14);t.exports=function(t,e){var n=this.__data__,r=o(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}},function(t,e,n){var o=n(13);t.exports=function(){this.__data__=new o,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var o=n(13),r=n(25),i=n(44);t.exports=function(t,e){var n=this.__data__;if(n instanceof o){var s=n.__data__;if(!r||s.length<199)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var o=n(26),r=n(88),i=n(4),s=n(43),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,h=u.hasOwnProperty,p=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||r(t))&&(o(t)?p:a).test(s(t))}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var o=n(10),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,a=o?o.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),n=t[a];try{t[a]=void 0;var o=!0}catch(t){}var r=s.call(t);return o&&(e?t[a]=n:delete t[a]),r}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var o,r=n(89),i=(o=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var o=n(1)["__core-js_shared__"];t.exports=o},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var o=n(92),r=n(13),i=n(25);t.exports=function(){this.size=0,this.__data__={hash:new o,map:new(i||r),string:new o}}},function(t,e,n){var o=n(93),r=n(94),i=n(95),s=n(96),a=n(97);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var o=n(33),r=n(5),i=n(34),s=n(8),a=n(11),c=n(12),u=Object.prototype.hasOwnProperty,l=i((function(t,e){if(a(e)||s(e))r(e,c(e),t);else for(var n in e)u.call(e,n)&&o(t,n,e[n])}));t.exports=l},function(t,e,n){var o=n(51)(Object.keys,Object);t.exports=o},function(t,e,n){var o=n(6)(n(1),"DataView");t.exports=o},function(t,e,n){var o=n(6)(n(1),"Promise");t.exports=o},function(t,e,n){var o=n(6)(n(1),"Set");t.exports=o},function(t,e,n){var o=n(6)(n(1),"WeakMap");t.exports=o},function(t,e,n){var o=n(3),r=n(2),i=n(0);t.exports=function(t){return"string"==typeof t||!r(t)&&i(t)&&"[object String]"==o(t)}},function(t,e){t.exports=function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}},function(t,e,n){var o=n(4),r=n(23),i=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(i,"");var n=a.test(t);return n||c.test(t)?u(t.slice(2),n?2:8):s.test(t)?NaN:+t}},function(t,e,n){var o=n(36),r=n(129),i=n(146),s=n(39),a=n(5),c=n(154),u=n(155),l=n(66),h=u((function(t,e){var n={};if(null==t)return n;var u=!1;e=o(e,(function(e){return e=s(e,t),u||(u=e.length>1),e})),a(t,l(t),n),u&&(n=r(n,7,c));for(var h=e.length;h--;)i(n,e[h]);return n}));t.exports=h},function(t,e,n){var o=n(41),r=n(130),i=n(33),s=n(131),a=n(132),c=n(47),u=n(49),l=n(133),h=n(135),p=n(136),f=n(66),d=n(22),v=n(137),y=n(138),m=n(50),b=n(2),_=n(18),g=n(142),x=n(4),$=n(144),j=n(12),w={};w["[object Arguments]"]=w["[object Array]"]=w["[object ArrayBuffer]"]=w["[object DataView]"]=w["[object Boolean]"]=w["[object Date]"]=w["[object Float32Array]"]=w["[object Float64Array]"]=w["[object Int8Array]"]=w["[object Int16Array]"]=w["[object Int32Array]"]=w["[object Map]"]=w["[object Number]"]=w["[object Object]"]=w["[object RegExp]"]=w["[object Set]"]=w["[object String]"]=w["[object Symbol]"]=w["[object Uint8Array]"]=w["[object Uint8ClampedArray]"]=w["[object Uint16Array]"]=w["[object Uint32Array]"]=!0,w["[object Error]"]=w["[object Function]"]=w["[object WeakMap]"]=!1,t.exports=function t(e,n,A,S,E,O){var P,C=1&n,k=2&n,z=4&n;if(A&&(P=E?A(e,S,E,O):A(e)),void 0!==P)return P;if(!x(e))return e;var U=b(e);if(U){if(P=v(e),!C)return u(e,P)}else{var R=d(e),T="[object Function]"==R||"[object GeneratorFunction]"==R;if(_(e))return c(e,C);if("[object Object]"==R||"[object Arguments]"==R||T&&!E){if(P=k||T?{}:m(e),!C)return k?h(e,a(P,e)):l(e,s(P,e))}else{if(!w[R])return E?e:{};P=y(e,R,C)}}O||(O=new o);var N=O.get(e);if(N)return N;O.set(e,P),$(e)?e.forEach((function(o){P.add(t(o,n,A,o,e,O))})):g(e)&&e.forEach((function(o,r){P.set(r,t(o,n,A,r,e,O))}));var I=z?k?f:p:k?keysIn:j,M=U?void 0:I(e);return r(M||e,(function(o,r){M&&(o=e[r=o]),i(P,r,t(o,n,A,r,e,O))})),P}},function(t,e){t.exports=function(t,e){for(var n=-1,o=null==t?0:t.length;++n0&&i(l)?n>1?t(l,n-1,i,s,a):o(a,l):s||(a[a.length]=l)}return a}},function(t,e,n){var o=n(10),r=n(17),i=n(2),s=o?o.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||r(t)||!!(s&&t&&t[s])}},function(t,e,n){var o=n(67),r=n(160),i=n(70),s=n(21),a=n(161),c=n(163),u=n(24);t.exports=function(t,e,n){return n&&"number"!=typeof n&&s(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=u(t))&&("string"==typeof e||null!=e&&!a(e))&&!(e=o(e))&&i(t)?r(c(t),0,n):t.split(e,n):[]}},function(t,e,n){var o=n(69);t.exports=function(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:o(t,e,n)}},function(t,e,n){var o=n(162),r=n(19),i=n(20),s=i&&i.isRegExp,a=s?r(s):o;t.exports=a},function(t,e,n){var o=n(3),r=n(0);t.exports=function(t){return r(t)&&"[object RegExp]"==o(t)}},function(t,e,n){var o=n(164),r=n(70),i=n(165);t.exports=function(t){return r(t)?i(t):o(t)}},function(t,e){t.exports=function(t){return t.split("")}},function(t,e){var n="[\\ud800-\\udfff]",o="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:"+o+"|"+r+")"+"?",u="[\\ufe0e\\ufe0f]?"+c+("(?:\\u200d(?:"+[i,s,a].join("|")+")[\\ufe0e\\ufe0f]?"+c+")*"),l="(?:"+[i+o+"?",o,s,a,n].join("|")+")",h=RegExp(r+"(?="+r+")|"+l+u,"g");t.exports=function(t){return t.match(h)||[]}},function(t,e,n){var o=n(167),r=n(168),i=n(169),s=n(170),a=n(171),c=n(71),u=n(21),l=n(12),h=n(72),p=n(172),f=n(24),d=/\b__p \+= '';/g,v=/\b(__p \+=) '' \+/g,y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,b=/($^)/,_=/['\n\r\u2028\u2029\\]/g,g=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var x=p.imports._.templateSettings||p;n&&u(t,e,n)&&(e=void 0),t=f(t),e=o({},e,x,s);var $,j,w=o({},e.imports,x.imports,s),A=l(w),S=i(w,A),E=0,O=e.interpolate||b,P="__p += '",C=RegExp((e.escape||b).source+"|"+O.source+"|"+(O===h?m:b).source+"|"+(e.evaluate||b).source+"|$","g"),k=g.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/[\r\n]/g," ")+"\n":"";t.replace(C,(function(e,n,o,r,i,s){return o||(o=r),P+=t.slice(E,s).replace(_,a),n&&($=!0,P+="' +\n__e("+n+") +\n'"),i&&(j=!0,P+="';\n"+i+";\n__p += '"),o&&(P+="' +\n((__t = ("+o+")) == null ? '' : __t) +\n'"),E=s+e.length,e})),P+="';\n";var z=g.call(e,"variable")&&e.variable;z||(P="with (obj) {\n"+P+"\n}\n"),P=(j?P.replace(d,""):P).replace(v,"$1").replace(y,"$1;"),P="function("+(z||"obj")+") {\n"+(z?"":"obj || (obj = {});\n")+"var __t, __p = ''"+($?", __e = _.escape":"")+(j?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+P+"return __p\n}";var U=r((function(){return Function(A,k+"return "+P).apply(void 0,S)}));if(U.source=P,c(U))throw U;return U}},function(t,e,n){var o=n(5),r=n(34),i=n(9),s=r((function(t,e,n,r){o(e,i(e),t,r)}));t.exports=s},function(t,e,n){var o=n(58),r=n(35),i=n(71),s=r((function(t,e){try{return o(t,void 0,e)}catch(t){return i(t)?t:new Error(t)}}));t.exports=s},function(t,e,n){var o=n(36);t.exports=function(t,e){return o(e,(function(e){return t[e]}))}},function(t,e,n){var o=n(7),r=Object.prototype,i=r.hasOwnProperty;t.exports=function(t,e,n,s){return void 0===t||o(t,r[n])&&!i.call(s,n)?e:t}},function(t,e){var n={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};t.exports=function(t){return"\\"+n[t]}},function(t,e,n){var o=n(173),r={escape:n(176),evaluate:n(177),interpolate:n(72),variable:"",imports:{_:{escape:o}}};t.exports=r},function(t,e,n){var o=n(174),r=n(24),i=/[&<>"']/g,s=RegExp(i.source);t.exports=function(t){return(t=r(t))&&s.test(t)?t.replace(i,o):t}},function(t,e,n){var o=n(175)({"&":"&","<":"<",">":">",'"':""","'":"'"});t.exports=o},function(t,e){t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},function(t,e){t.exports=/<%-([\s\S]+?)%>/g},function(t,e){t.exports=/<%([\s\S]+?)%>/g},function(t,e,n){var o=n(35),r=n(7),i=n(21),s=n(9),a=Object.prototype,c=a.hasOwnProperty,u=o((function(t,e){t=Object(t);var n=-1,o=e.length,u=o>2?e[2]:void 0;for(u&&i(e[0],e[1],u)&&(o=1);++ne!==t&&(e==e||t==t),b={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y};class m extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,n)=>{const o=this._$Ep(n,e);void 0!==o&&(this._$Ev.set(o,n),t.push(o))}),t}static createProperty(t,e=b){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,n,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(o){const r=this[t];this[e]=o,this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||b}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach(t=>t(this))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{r?t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(e=>{const n=document.createElement("style"),r=o.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=e.cssText,t.appendChild(n)})})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)})}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=b){var o;const r=this.constructor._$Ep(t,n);if(void 0!==r&&!0===n.reflect){const i=(void 0!==(null===(o=n.converter)||void 0===o?void 0:o.toAttribute)?n.converter:v).toAttribute(e,n.type);this._$El=t,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$El=null}}_$AK(t,e){var n;const o=this.constructor,r=o._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=o.getPropertyOptions(r),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:v;this._$El=r,this[r]=i.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let o=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((t,e)=>this[e]=t),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)}),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach(t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach((t,e)=>this._$EO(e,this[e],t)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}} + */;var l;const h=window,p=h.trustedTypes,f=p?p.emptyScript:"",d=h.reactiveElementPolyfillSupport,v={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},y=(t,e)=>e!==t&&(e==e||t==t),m={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y};class b extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,n)=>{const o=this._$Ep(n,e);void 0!==o&&(this._$Ev.set(o,n),t.push(o))}),t}static createProperty(t,e=m){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,n,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(o){const r=this[t];this[e]=o,this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||m}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach(t=>t(this))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{r?t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(e=>{const n=document.createElement("style"),r=o.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=e.cssText,t.appendChild(n)})})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)})}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=m){var o;const r=this.constructor._$Ep(t,n);if(void 0!==r&&!0===n.reflect){const i=(void 0!==(null===(o=n.converter)||void 0===o?void 0:o.toAttribute)?n.converter:v).toAttribute(e,n.type);this._$El=t,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$El=null}}_$AK(t,e){var n;const o=this.constructor,r=o._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=o.getPropertyOptions(r),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:v;this._$El=r,this[r]=i.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let o=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((t,e)=>this[e]=t),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)}),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach(t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach((t,e)=>this._$EO(e,this[e],t)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var _;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:m}),(null!==(l=h.reactiveElementVersions)&&void 0!==l?l:h.reactiveElementVersions=[]).push("1.6.1");const g=window,x=g.trustedTypes,$=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,j=`lit$${(Math.random()+"").slice(9)}$`,w="?"+j,A=`<${w}>`,S=document,E=()=>S.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,C=t=>P(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,z=/-->/g,U=/>/g,R=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),T=/'/g,N=/"/g,I=/^(?:script|style|textarea|title)$/i,M=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),D=M(1),H=(M(2),Symbol.for("lit-noChange")),L=Symbol.for("lit-nothing"),B=new WeakMap,Y=S.createTreeWalker(S,129,null,!1),q=(t,e)=>{const n=t.length-1,o=[];let r,i=2===e?"":"",s=k;for(let e=0;e"===c[0]?(s=null!=r?r:k,u=-1):void 0===c[1]?u=-2:(u=s.lastIndex-c[2].length,a=c[1],s=void 0===c[3]?R:'"'===c[3]?N:T):s===N||s===T?s=R:s===z||s===U?s=k:(s=R,r=void 0);const h=s===R&&t[e+1].startsWith("/>")?" ":"";i+=s===k?n+A:u>=0?(o.push(a),n.slice(0,u)+"$lit$"+n.slice(u)+j+h):n+j+(-2===u?(o.push(void 0),e):h)}const a=i+(t[n]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==$?$.createHTML(a):a,o]};class V{constructor({strings:t,_$litType$:e},n){let o;this.parts=[];let r=0,i=0;const s=t.length-1,a=this.parts,[c,u]=q(t,e);if(this.el=V.createElement(c,n),Y.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Y.nextNode())&&a.length0){o.textContent=x?x.emptyScript:"";for(let n=0;n2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=L}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,o){const r=this.strings;let i=!1;if(void 0===r)t=X(this,t,e,0),i=!O(t)||t!==this._$AH&&t!==H,i&&(this._$AH=t);else{const o=t;let s,a;for(t=r[0],s=0;st}):void 0,j=`lit$${(Math.random()+"").slice(9)}$`,w="?"+j,A=`<${w}>`,S=document,E=()=>S.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,C=t=>P(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,z=/-->/g,U=/>/g,R=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),T=/'/g,N=/"/g,I=/^(?:script|style|textarea|title)$/i,M=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),D=M(1),H=(M(2),Symbol.for("lit-noChange")),L=Symbol.for("lit-nothing"),B=new WeakMap,Y=S.createTreeWalker(S,129,null,!1),q=(t,e)=>{const n=t.length-1,o=[];let r,i=2===e?"":"",s=k;for(let e=0;e"===c[0]?(s=null!=r?r:k,u=-1):void 0===c[1]?u=-2:(u=s.lastIndex-c[2].length,a=c[1],s=void 0===c[3]?R:'"'===c[3]?N:T):s===N||s===T?s=R:s===z||s===U?s=k:(s=R,r=void 0);const h=s===R&&t[e+1].startsWith("/>")?" ":"";i+=s===k?n+A:u>=0?(o.push(a),n.slice(0,u)+"$lit$"+n.slice(u)+j+h):n+j+(-2===u?(o.push(void 0),e):h)}const a=i+(t[n]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==$?$.createHTML(a):a,o]};class V{constructor({strings:t,_$litType$:e},n){let o;this.parts=[];let r=0,i=0;const s=t.length-1,a=this.parts,[c,u]=q(t,e);if(this.el=V.createElement(c,n),Y.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Y.nextNode())&&a.length0){o.textContent=x?x.emptyScript:"";for(let n=0;n2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=L}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,o){const r=this.strings;let i=!1;if(void 0===r)t=X(this,t,e,0),i=!O(t)||t!==this._$AH&&t!==H,i&&(this._$AH=t);else{const o=t;let s,a;for(t=r[0],s=0;s{var o,r;const i=null!==(o=null==n?void 0:n.renderBefore)&&void 0!==o?o:e;let s=i._$litPart$;if(void 0===s){const t=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:null;i._$litPart$=s=new W(e.insertBefore(E(),t),t,void 0,null!=n?n:{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return H}}rt.finalized=!0,rt._$litElement$=!0,null===(nt=globalThis.litElementHydrateSupport)||void 0===nt||nt.call(globalThis,{LitElement:rt});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:rt});(null!==(ot=globalThis.litElementVersions)&&void 0!==ot?ot:globalThis.litElementVersions=[]).push("3.3.1");function st(t,e,n={},o={}){const r=new Event(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0},o));return r.detail=n,t.dispatchEvent(r),r}function at(t,e,n,o,r){return ct(t,e,n,Object.assign({},o),r)}function ct(t,e,n,o,r){if(["number","boolean"].includes(typeof o))return o;if(!o)return o;if(["object"].includes(typeof o))return Object.keys(o).forEach(i=>{o[i]=ct(t,e,n,o[i],r)}),o;r&&(o=r(o));const i=o.trim();return"[[["===i.substring(0,3)&&"]]]"===i.slice(-3)?function(t,e,n,o){try{return new Function("states","entity","variables","user","hass","'use strict'; "+o).call(this,t.states,e,n,t.user,t)}catch(t){const e=o.length<=100?o.trim():o.trim().substring(0,98)+"...";throw t.message=`${t.name}: ${t.message} in '${e}'`,t.name="HoneyCombJSTemplateError",t}}(t,e,n,i.slice(3,-3)):o}function ut(t){if(document.querySelector("home-assistant"))return document.querySelector("home-assistant").provideHass(t)}function lt(t,e){const n={type:"error",error:t,origConfig:e},o=document.createElement("hui-error-card");return customElements.whenDefined("hui-error-card").then(()=>{const t=document.createElement("hui-error-card");t.setConfig(n),o.parentElement&&o.parentElement.replaceChild(t,o)}),o}function ht(t){if(!t||"object"!=typeof t||!t.type)return lt("No card type configured",t);let e=t.type;if(e=e.startsWith("custom:")?e.substr("custom:".length):`hui-${e}-card`,customElements.get(e))return function(t,e){let n=document.createElement(t);try{n.setConfig(JSON.parse(JSON.stringify(e)))}catch(t){n=lt(t,e)}return n}(e,t);const n=lt(`Custom element doesn't exist: ${e}.`,t);n.style.display="None";const o=setTimeout(()=>{n.style.display=""},2e3);return customElements.whenDefined(e).then(()=>{clearTimeout(o),st("ll-rebuild",{},n)}),n}const pt=n(40),ft=n(119),dt=n(61),vt=n(125);class yt extends rt{static get is(){return"honeycomb-menu-item"}static get properties(){return{hass:{type:Object},config:{type:Object},variables:{type:Object},size:{type:Number},color:{type:String},icon:{type:String},action:{type:Object},disabled:{type:Boolean,reflect:!0,attribute:!0},audio:{type:Boolean},autoclose:{type:Boolean},active:{type:Boolean,reflect:!0,attribute:!0}}}set hass(t){this._hass=t,this._computeIsActive()}get hass(){return this._hass}set config(t){"break"==t.type||dt(t)||t.disabled?this.disabled=!0:(this._config=ft({autoclose:!0,audio:!0,active:!1,variables:{}},t),vt(this._config.tap_action)&&(this._config.tap_action={action:this._config.tap_action}),vt(this._config.hold_action)&&(this._config.hold_action={action:this._config.hold_action}),vt(this._config.double_tap_action)&&(this._config.double_tap_action={action:this._config.double_tap_action}),this._config.active||this.style.setProperty("--paper-item-icon-active-color","var(--paper-item-icon-color)"),this._parseTemplates(),this._computeIsActive())}get config(){return this._config}static get styles(){return c` +var nt,ot;class rt extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const n=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=n.firstChild),n}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,n)=>{var o,r;const i=null!==(o=null==n?void 0:n.renderBefore)&&void 0!==o?o:e;let s=i._$litPart$;if(void 0===s){const t=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:null;i._$litPart$=s=new W(e.insertBefore(E(),t),t,void 0,null!=n?n:{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return H}}rt.finalized=!0,rt._$litElement$=!0,null===(nt=globalThis.litElementHydrateSupport)||void 0===nt||nt.call(globalThis,{LitElement:rt});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:rt});(null!==(ot=globalThis.litElementVersions)&&void 0!==ot?ot:globalThis.litElementVersions=[]).push("3.3.1");function st(t,e,n={},o={}){const r=new Event(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0},o));return r.detail=n,t.dispatchEvent(r),r}function at(t,e,n,o,r){return ct(t,e,n,Object.assign({},o),r)}function ct(t,e,n,o,r){if(["number","boolean"].includes(typeof o))return o;if(!o)return o;if(["object"].includes(typeof o))return Object.keys(o).forEach(i=>{o[i]=ct(t,e,n,o[i],r)}),o;r&&(o=r(o));const i=o.trim();return"[[["===i.substring(0,3)&&"]]]"===i.slice(-3)?function(t,e,n,o){try{return new Function("states","entity","variables","user","hass","'use strict'; "+o).call(this,t.states,e,n,t.user,t)}catch(t){const e=o.length<=100?o.trim():o.trim().substring(0,98)+"...";throw t.message=`${t.name}: ${t.message} in '${e}'`,t.name="HoneyCombJSTemplateError",t}}(t,e,n,i.slice(3,-3)):o}function ut(t){if(document.querySelector("home-assistant"))return document.querySelector("home-assistant").provideHass(t)}function lt(){if(window.honeycomb_menu_templates)return window.honeycomb_menu_templates;let t=function(){let t=document.querySelector("home-assistant");return t=t&&t.shadowRoot,t=t&&t.querySelector("home-assistant-main"),t=t&&t.shadowRoot,t=t&&t.querySelector("app-drawer-layout partial-panel-resolver")||t.querySelector("ha-drawer partial-panel-resolver"),t=t&&t.shadowRoot||t,t=t&&t.querySelector("ha-panel-lovelace"),t=t&&t.shadowRoot,t=t&&t.querySelector("hui-root"),t&&t.lovelace.config||null}();return t?(window.honeycomb_menu_templates=t.honeycomb_menu_templates||{},t.honeycomb_menu_templates?t.honeycomb_menu_templates:null):null}function ht(t,e){const n={type:"error",error:t,origConfig:e},o=document.createElement("hui-error-card");return customElements.whenDefined("hui-error-card").then(()=>{const t=document.createElement("hui-error-card");t.setConfig(n),o.parentElement&&o.parentElement.replaceChild(t,o)}),o}function pt(t){if(!t||"object"!=typeof t||!t.type)return ht("No card type configured",t);let e=t.type;if(e=e.startsWith("custom:")?e.substr("custom:".length):`hui-${e}-card`,customElements.get(e))return function(t,e){let n=document.createElement(t);try{n.setConfig(JSON.parse(JSON.stringify(e)))}catch(t){n=ht(t,e)}return n}(e,t);const n=ht(`Custom element doesn't exist: ${e}.`,t);n.style.display="None";const o=setTimeout(()=>{n.style.display=""},2e3);return customElements.whenDefined(e).then(()=>{clearTimeout(o),st("ll-rebuild",{},n)}),n}const ft=n(40),dt=n(119),vt=n(61),yt=n(125);class mt extends rt{static get is(){return"honeycomb-menu-item"}static get properties(){return{hass:{type:Object},config:{type:Object},variables:{type:Object},size:{type:Number},color:{type:String},icon:{type:String},action:{type:Object},disabled:{type:Boolean,reflect:!0,attribute:!0},audio:{type:Boolean},autoclose:{type:Boolean},active:{type:Boolean,reflect:!0,attribute:!0}}}set hass(t){this._hass=t,this._computeIsActive()}get hass(){return this._hass}set config(t){"break"==t.type||vt(t)||t.disabled?this.disabled=!0:(this._config=dt({autoclose:!0,audio:!0,active:!1,variables:{}},t),yt(this._config.tap_action)&&(this._config.tap_action={action:this._config.tap_action}),yt(this._config.hold_action)&&(this._config.hold_action={action:this._config.hold_action}),yt(this._config.double_tap_action)&&(this._config.double_tap_action={action:this._config.double_tap_action}),this._config.active||this.style.setProperty("--paper-item-icon-active-color","var(--paper-item-icon-color)"),this._parseTemplates(),this._computeIsActive())}get config(){return this._config}static get styles(){return c` :host { } :host([active]) { @@ -82,7 +82,7 @@ var nt,ot;class rt extends m{constructor(){super(...arguments),this.renderOption
- `}_computeIsActive(){this.config&&("boolean"==typeof this.config.active&&(this.active=this.config.active&&this.hass.states[this.config.entity]&&"on"==this.hass.states[this.config.entity].state),"string"==typeof this.config.active&&(this.active=ct(this.hass,this.hass.states[this.config.entity],this.config.variables,this.config.active)))}firstUpdated(){this.disabled||this.shadowRoot.querySelector("#item").append(this._createLovelaceCard())}_parseTemplates(){this.config.entity=ct(this.hass,null,this.config.variables,this.config.entity);for(let t in this.config)["tap_action","hold_action","double_tap_action"].indexOf(t)>-1&&(this.config[t]=at(this.hass,this.hass.states[this.config.entity],this.config.variables,this.config[t]))}_createLovelaceCard(){var t=ht(pt({},{type:"custom:button-card",size:"30px",show_name:!1},this.config));ut(t),t.addEventListener("action",t=>{t.detail.item=this,t.detail.autoclose=this.config.autoclose,t.detail.audio=this.config.audio});var e=new CSSStyleSheet;return e.replaceSync("ha-card { height: 100%; position: fixed !important; padding: 0 !important; }"),t.shadowRoot.adoptedStyleSheets=[...t.shadowRoot.adoptedStyleSheets,e],t}}customElements.define(yt.is,yt);const bt=n(62);class mt extends rt{static get is(){return"xy-pad"}static get properties(){return{hass:{type:Object},config:{type:Object},size:{type:Number},clampX:{type:Number},clampY:{type:Number},active:{type:Boolean,reflect:!0,attribute:!0},_current:{type:Object}}}static get styles(){return c` + `}_computeIsActive(){this.config&&("boolean"==typeof this.config.active&&(this.active=this.config.active&&this.hass.states[this.config.entity]&&"on"==this.hass.states[this.config.entity].state),"string"==typeof this.config.active&&(this.active=ct(this.hass,this.hass.states[this.config.entity],this.config.variables,this.config.active)))}firstUpdated(){this.disabled||this.shadowRoot.querySelector("#item").append(this._createLovelaceCard())}_parseTemplates(){this.config.entity=ct(this.hass,null,this.config.variables,this.config.entity);for(let t in this.config)["tap_action","hold_action","double_tap_action"].indexOf(t)>-1&&(this.config[t]=at(this.hass,this.hass.states[this.config.entity],this.config.variables,this.config[t]))}_createLovelaceCard(){var t=pt(ft({},{type:"custom:button-card",size:"30px",show_name:!1},this.config));ut(t),t.addEventListener("action",t=>{t.detail.item=this,t.detail.autoclose=this.config.autoclose,t.detail.audio=this.config.audio});var e=new CSSStyleSheet;return e.replaceSync("ha-card { height: 100%; position: fixed !important; padding: 0 !important; }"),t.shadowRoot.adoptedStyleSheets=[...t.shadowRoot.adoptedStyleSheets,e],t}}customElements.define(mt.is,mt);const bt=n(62);class _t extends rt{static get is(){return"xy-pad"}static get properties(){return{hass:{type:Object},config:{type:Object},size:{type:Number},clampX:{type:Number},clampY:{type:Number},active:{type:Boolean,reflect:!0,attribute:!0},_current:{type:Object}}}static get styles(){return c` :host { position: absolute; @@ -110,7 +110,7 @@ var nt,ot;class rt extends m{constructor(){super(...arguments),this.renderOption #joystick:active, :host([active]) #joystick { box-shadow: 0px 0px 2px 5px #fbfbfb; background: #c5c5c5; - }`}render(){return D`
`}get joystick(){return this.shadowRoot.querySelector("#joystick")}firstUpdated(){this.config.x||(this.clampX=0),this.config.y||(this.clampY=0),this._setInitCssPositions(),this._bindListeners(),this._reset()}_setInitCssPositions(){const t=this.joystick;t.style.width=this.size+"px",t.style.height=this.size+"px",t.style.left=`calc( 50% - (${this.size}px / 2) )`,t.style.top=`calc( 50% - (${this.size}px / 2) )`}_bindListeners(){this.addEventListener("touchstart",this._handleOnDragStart,!1),this.addEventListener("touchmove",this._handleOnDrag,!1),document.addEventListener("touchend",this._handleOnDragEnd.bind(this),!1),this.addEventListener("mousedown",this._handleOnDragStart,!1),this.addEventListener("mousemove",this._handleOnDrag,!1),document.addEventListener("mouseup",this._handleOnDragEnd.bind(this),!1)}_reset(){this.active=!1,this.style.zIndex=0,this.joystick.style.transform="translate3d(0, 0, 0)",this._current={x:0,y:0},this._interval&&(clearInterval(this._interval),this._interval=null)}_handleOnDragStart(t){this.active=!0,this.style.zIndex=100,this.dispatchEvent(this.__constructEvent("drag-start")),this.config.repeat&&(this._interval=setInterval(t=>{this.dispatchEvent(this.__constructEvent("drag-interval"))},this.config.repeat))}_setPosition(t,e){t=t-this.joystick.offsetLeft-this.size/2,e=e-this.joystick.offsetTop-this.size/2,this._current.x=bt(t,-this.clampX,this.clampX),this._current.y=bt(e,-this.clampY,this.clampY),this.joystick.style.transform=`translate3d(${this._current.x}px, ${this._current.y}px, 0)`,this.dispatchEvent(this.__constructEvent("drag"))}_handleOnDrag(t){if(this.active){if(t.cancelBubble=!0,"touchmove"===t.type){var e=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-e.left,t.offsetY=t.targetTouches[0].pageY-e.top}this._setPosition(t.offsetX,t.offsetY)}}_handleOnDragEnd(t){this.dispatchEvent(this.__constructEvent("drag-end")),this._reset()}__constructEvent(t){return new CustomEvent(t,this.__constructEventData())}__constructEventData(){let t=this.config.x&&this.config.x.invert?-this._current.x:this._current.x,e=this.config.y&&this.config.y.invert?-this._current.y:this._current.y;return{detail:{x:t,y:e,x_percentage:t/this.clampX*100,y_percentage:e/this.clampY*100}}}}customElements.define(mt.is,mt);const _t=function(){let t=document.querySelector("home-assistant");return t=t&&t.shadowRoot,t=t&&t.querySelector("home-assistant-main"),t=t&&t.shadowRoot,t=t&&t.querySelector("app-drawer-layout partial-panel-resolver")||t.querySelector("ha-drawer partial-panel-resolver"),t=t&&t.shadowRoot||t,t=t&&t.querySelector("ha-panel-lovelace"),t=t&&t.shadowRoot,t=t&&t.querySelector("hui-root"),t&&t.lovelace.config||null}().honeycomb_menu_templates||null,gt=document.querySelector("home-assistant").hass,xt=n(40),$t=n(128),jt=n(159),wt=n(62),At=n(166),St=n(61),Et=n(178),Ot=new function(){this.honeycomb=null,this.position={x:0,y:0},this.handleXYPosition=function(t){this.position.x="touchstart"===t.type?t.touches[0].clientX:t.clientX,this.position.y="touchstart"===t.type?t.touches[0].clientY:t.clientY}.bind(this)};function Pt(t){Ot.honeycomb&&Ot.honeycomb.close(),Ot.honeycomb=document.createElement("honeycomb-menu"),Ot.honeycomb.setConfig(t),Ot.honeycomb.display(function(){let t=document.querySelector("home-assistant");return t=t&&t.shadowRoot,t=t&&t.querySelector("home-assistant-main"),t=t&&t.shadowRoot,t=t&&t.querySelector("app-drawer-layout partial-panel-resolver")||t.querySelector("ha-drawer partial-panel-resolver"),t=t&&t.shadowRoot||t,t=t&&t.querySelector("ha-panel-lovelace"),t=t&&t.shadowRoot,t=t&&t.querySelector("hui-root"),t=t&&t.shadowRoot,t=t&&t.querySelector("ha-app-layout")||t,t=t&&t.querySelector("#view"),t=t&&t.firstElementChild,t}(),Ot.position.x,Ot.position.y),Ot.honeycomb.addEventListener("closing",t=>{Ot.honeycomb=null})}document.addEventListener("touchstart",Ot.handleXYPosition,!1),document.addEventListener("mousedown",Ot.handleXYPosition,!1),gt._callService=gt.callService,gt.callService=function(t,e,n,o){if("honeycomb"!=t)return gt._callService(t,e,n,o);var r=function t(e,n){if(!n){n=new Array(6);for(let t=0;t<6;t++)n[t]=new Array}function o(t){return t.buttons&&t.buttons.forEach((t,e)=>{t.position?n[t.position].unshift(t):n[e].unshift(t)}),{buttons:n}}if(!(e=xt({},e)).template||!_t||!_t[e.template])return Object.assign({},e,o(e));let r=t(_t[e.template],n);return delete e.template,Object.assign({},r,e,o(e))}(n);r.entity_id&&!r.entity&&(r.entity=r.entity_id),Pt(r)};class Ct extends rt{static get is(){return"honeycomb-menu"}static get properties(){return{hass:{type:Object},config:{type:Object},sizes:{type:Object,readonly:!0},variables:{type:Object},closing:{type:Boolean,attribute:!0,reflect:!0},view:{},buttons:{type:Array},_service:{type:Object}}}constructor(){super(),this.closing=!1,this.buttons=[],this._service={x:!1,y:!1}}static get styles(){return c` + }`}render(){return D`
`}get joystick(){return this.shadowRoot.querySelector("#joystick")}firstUpdated(){this.config.x||(this.clampX=0),this.config.y||(this.clampY=0),this._setInitCssPositions(),this._bindListeners(),this._reset()}_setInitCssPositions(){const t=this.joystick;t.style.width=this.size+"px",t.style.height=this.size+"px",t.style.left=`calc( 50% - (${this.size}px / 2) )`,t.style.top=`calc( 50% - (${this.size}px / 2) )`}_bindListeners(){this.addEventListener("touchstart",this._handleOnDragStart,!1),this.addEventListener("touchmove",this._handleOnDrag,!1),document.addEventListener("touchend",this._handleOnDragEnd.bind(this),!1),this.addEventListener("mousedown",this._handleOnDragStart,!1),this.addEventListener("mousemove",this._handleOnDrag,!1),document.addEventListener("mouseup",this._handleOnDragEnd.bind(this),!1)}_reset(){this.active=!1,this.style.zIndex=0,this.joystick.style.transform="translate3d(0, 0, 0)",this._current={x:0,y:0},this._interval&&(clearInterval(this._interval),this._interval=null)}_handleOnDragStart(t){this.active=!0,this.style.zIndex=100,this.dispatchEvent(this.__constructEvent("drag-start")),this.config.repeat&&(this._interval=setInterval(t=>{this.dispatchEvent(this.__constructEvent("drag-interval"))},this.config.repeat))}_setPosition(t,e){t=t-this.joystick.offsetLeft-this.size/2,e=e-this.joystick.offsetTop-this.size/2,this._current.x=bt(t,-this.clampX,this.clampX),this._current.y=bt(e,-this.clampY,this.clampY),this.joystick.style.transform=`translate3d(${this._current.x}px, ${this._current.y}px, 0)`,this.dispatchEvent(this.__constructEvent("drag"))}_handleOnDrag(t){if(this.active){if(t.cancelBubble=!0,"touchmove"===t.type){var e=t.target.getBoundingClientRect();t.offsetX=t.targetTouches[0].pageX-e.left,t.offsetY=t.targetTouches[0].pageY-e.top}this._setPosition(t.offsetX,t.offsetY)}}_handleOnDragEnd(t){this.dispatchEvent(this.__constructEvent("drag-end")),this._reset()}__constructEvent(t){return new CustomEvent(t,this.__constructEventData())}__constructEventData(){let t=this.config.x&&this.config.x.invert?-this._current.x:this._current.x,e=this.config.y&&this.config.y.invert?-this._current.y:this._current.y;return{detail:{x:t,y:e,x_percentage:t/this.clampX*100,y_percentage:e/this.clampY*100}}}}customElements.define(_t.is,_t);const gt=document.querySelector("home-assistant").hass,xt=n(40),$t=n(128),jt=n(159),wt=n(62),At=n(166),St=n(61),Et=n(178),Ot=new function(){this.honeycomb=null,this.position={x:0,y:0},this.handleXYPosition=function(t){this.position.x="touchstart"===t.type?t.touches[0].clientX:t.clientX,this.position.y="touchstart"===t.type?t.touches[0].clientY:t.clientY}.bind(this)};function Pt(t){Ot.honeycomb&&Ot.honeycomb.close(),Ot.honeycomb=document.createElement("honeycomb-menu"),Ot.honeycomb.setConfig(t),Ot.honeycomb.display(function(){let t=document.querySelector("home-assistant");return t=t&&t.shadowRoot,t=t&&t.querySelector("home-assistant-main"),t=t&&t.shadowRoot,t=t&&t.querySelector("app-drawer-layout partial-panel-resolver")||t.querySelector("ha-drawer partial-panel-resolver"),t=t&&t.shadowRoot||t,t=t&&t.querySelector("ha-panel-lovelace"),t=t&&t.shadowRoot,t=t&&t.querySelector("hui-root"),t=t&&t.shadowRoot,t=t&&t.querySelector("ha-app-layout")||t,t=t&&t.querySelector("#view"),t=t&&t.firstElementChild,t}(),Ot.position.x,Ot.position.y),Ot.honeycomb.addEventListener("closing",t=>{Ot.honeycomb=null})}document.addEventListener("touchstart",Ot.handleXYPosition,!1),document.addEventListener("mousedown",Ot.handleXYPosition,!1),gt._callService=gt.callService,gt.callService=function(t,e,n,o){if("honeycomb"!=t)return gt._callService(t,e,n,o);var r=function t(e,n){if(!n){n=new Array(6);for(let t=0;t<6;t++)n[t]=new Array}function o(t){return t.buttons&&t.buttons.forEach((t,e)=>{t.position?n[t.position].unshift(t):n[e].unshift(t)}),{buttons:n}}e=xt({},e);const r=lt();if(!e.template||!r||!r[e.template])return Object.assign({},e,o(e));let i=t(r[e.template],n);return delete e.template,Object.assign({},i,e,o(e))}(n);r.entity_id&&!r.entity&&(r.entity=r.entity_id),Pt(r)};class Ct extends rt{static get is(){return"honeycomb-menu"}static get properties(){return{hass:{type:Object},config:{type:Object},sizes:{type:Object,readonly:!0},variables:{type:Object},closing:{type:Boolean,attribute:!0,reflect:!0},view:{},buttons:{type:Array},_service:{type:Object}}}constructor(){super(),this.closing=!1,this.buttons=[],this._service={x:!1,y:!1}}static get styles(){return c` @keyframes fadeIn { from {opacity: 0; } to { opacity: 1; } } @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } } @keyframes zoomIn { diff --git a/src/helpers.js b/src/helpers.js index dbe18a3..229307e 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -104,6 +104,25 @@ export function lovelace_config() return null; } +export function honeycomb_menu_templates() +{ + // Store to a gloval variable to skip dom traversion + if( window.honeycomb_menu_templates ) + return window.honeycomb_menu_templates; + + let lconfig = lovelace_config(); + + if( ! lconfig ) + return null; + + window.honeycomb_menu_templates = lconfig.honeycomb_menu_templates || {}; + + if( ! lconfig.honeycomb_menu_templates ) + return null; + + return lconfig.honeycomb_menu_templates; +} + function _errorElement(error, origConfig) { const cfg = { diff --git a/src/honeycomb-menu.js b/src/honeycomb-menu.js index c6f5598..6bec760 100644 --- a/src/honeycomb-menu.js +++ b/src/honeycomb-menu.js @@ -1,9 +1,8 @@ import { LitElement, html, css } from 'lit'; import "./honeycomb-menu-item.js"; import "./xy-pad.js"; -import { objectEvalTemplate, getTemplateOrValue, fireEvent, lovelace_view, provideHass, lovelace_config } from "./helpers.js"; +import { objectEvalTemplate, getTemplateOrValue, fireEvent, lovelace_view, provideHass, honeycomb_menu_templates } from "./helpers.js"; -const honeycomb_templates = lovelace_config().honeycomb_menu_templates || null; const hass = document.querySelector('home-assistant').hass; const merge = require('lodash/merge'); @@ -72,7 +71,7 @@ function traverseConfigs( _config, _buttons ) // merge will also affect sub properties _config = merge({}, _config ); - + const honeycomb_templates = honeycomb_menu_templates(); if( ! _config.template || ! honeycomb_templates || ! honeycomb_templates[_config.template] ) return Object.assign({}, _config, bindButtons( _config ));