PageSourceSearch

https://ross146.com/frontend_latest/16754.308a09c0ecef6be9.js

js ross146.com collected 2026-09-28 01:53:31 UTC 11,580 bytes, 22 lines download raw bytes

1export const __webpack_ids__=["16754"];export const __webpack_modules__={97297:function(t,e,i){i.a(t,async function(t,e){try{i(81738),i(6989);var s=i(73742),a=i(59048),o=i(26292),r=i(20480),l=i(28598),n=i(24481),d=i(65863),c=i(83533),h=t([l]);l=(h.then?(await h)():h)[0];const u=(t,e,i)=>180*(0,c.Ff)((0,c.Fv)(t,e,i),e,i)/100;class _ extends a.oi{firstUpdated(t){super.firstUpdated(t),(0,d.T)(()=>{this._updated=!0,this._angle=u(this.value,this.min,this.max),this._segment_label=this._getSegmentLabel(),this._rescaleSvg()})}updated(t){super.updated(t),this._updated&&(t.has("value")||t.has("valueText")||t.has("label")||t.has("_segment_label"))&&(this._angle=u(this.value,this.min,this.max),this._segment_label=this._getSegmentLabel(),this._rescaleSvg())}render(){return a.YP` <svg viewBox="-50 -50 100 50" class="gauge"> ${this.needle&&this.levels?"":a.YP`<path class="dial" d="M -40 0 A 40 40 0 0 1 40 0"></path>`} ${this.levels?this.levels.sort((t,e)=>t.level-e.level).map((t,e)=>{let i;if(0===e&&t.level!==this.min){const t=u(this.min,this.min,this.max);i=a.YP`<path stroke="var(--info-color)" class="level" d="M
2                          ${0-40*Math.cos(t*Math.PI/180)}
3                          ${0-40*Math.sin(t*Math.PI/180)}
4                         A 40 40 0 0 1 40 0
5                        "></path>`}const s=u(t.level,this.min,this.max);return a.YP`${i}<path stroke="${t.stroke}" class="level" d="M
6                        ${0-40*Math.cos(s*Math.PI/180)}
7                        ${0-40*Math.sin(s*Math.PI/180)}
8                       A 40 40 0 0 1 40 0
9                      "></path>`}):""} ${this.needle?a.YP`<path class="needle" d="M -25 -2.5 L -47.5 0 L -25 2.5 z" style="${(0,r.V)({transform:`rotate(${this._angle}deg)`})}"> </path>`:a.YP`<path class="value" d="M -40 0 A 40 40 0 1 0 40 0" style="${(0,r.V)({transform:`rotate(${this._angle}deg)`})}"></path>`}  </svg> <svg class="text"> <text class="value-text"> ${this._segment_label?this._segment_label:this.valueText||(0,l.uf)(this.value,this.locale,this.formatOptions)}${this._segment_label?"":"%"===this.label?(0,n.K)(this.locale)+"%":` ${this.label}`} </text> </svg>`}_rescaleSvg(){const t=this.shadowRoot.querySelector(".text"),e=t.querySelector("text").getBBox();t.setAttribute("viewBox",`${e.x} ${e.y} ${e.width} ${e.height}`)}_getSegmentLabel(){if(this.levels){this.levels.sort((t,e)=>t.level-e.level);for(let t=this.levels.length-1;t>=0;t--)if(this.value>=this.levels[t].level)return this.levels[t].label}return""}constructor(...t){super(...t),this.min=0,this.max=100,this.value=0,this.needle=!1,this.label="",this._angle=0,this._updated=!1,this._segment_label=""}}_.styles=a.iv`:host{position:relative}.dial{fill:none;stroke:var(--primary-background-color);stroke-width:15}.value{fill:none;stroke-width:15;stroke:var(--gauge-color);transition:all 1s ease 0s}.needle{fill:var(--primary-text-color);transition:all 1s ease 0s}.level{fill:none;stroke-width:15}.gauge{display:block}.text{position:absolute;max-height:40%;max-width:55%;left:50%;bottom:-6%;transform:translate(-50%,0%)}.value-text{font-size:50px;fill:var(--primary-text-color);text-anchor:middle;direction:ltr}`,(0,s.__decorate)([(0,o.Cb)({type:Number})],_.prototype,"min",void 0),(0,s.__decorate)([(0,o.Cb)({type:Number})],_.prototype,"max",void 0),(0,s.__decorate)([(0,o.Cb)({type:Number})],_.prototype,"value",void 0),(0,s.__decorate)([(0,o.Cb)({attribute:!1})],_.prototype,"formatOptions",void 0),(0,s.__decorate)([(0,o.Cb)({attribute:!1,type:String})],_.prototype,"valueText",void 0),(0,s.__decorate)([(0,o.Cb)({attribute:!1})],_.prototype,"locale",void 0),(0,s.__decorate)([(0,o.Cb)({type:Boolean})],_.prototype,"needle",void 0),(0,s.__decorate)([(0,o.Cb)({type:Array})],_.prototype,"levels",void 0),(0,s.__decorate)([(0,o.Cb)()],_.prototype,"label",void 0),(0,s.__decorate)([(0,o.SB)()],_.prototype,"_angle",void 0),(0,s.__decorate)([(0,o.SB)()],_.prototype,"_updated",void 0),(0,s.__decorate)([(0,o.SB)()],_.prototype,"_segment_label",void 0),_=(0,s.__decorate)([(0,o.Mo)("ha-gauge")],_),e()}catch(t){e(t)}})},80298:function(t,e,i){i.a(t,async function(t,e){try{var s=i(73742),a=i(52634),o=i(62685),r=i(59048),l=i(26292),n=i(75535),d=t([a]);a=(d.then?(await d)():d)[0],(0,n.jx)("tooltip.show",{keyframes:[{opacity:0}
9,{opacity:1}],options:{duration:150,easing:"ease"}}),(0,n.jx)("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:400,easing:"ease"}});class c extends a.Z{}c.styles=[o.Z,r.iv`:host{--sl-tooltip-background-color:var(--secondary-background-color);--sl-tooltip-color:var(--primary-text-color);--sl-tooltip-font-family:var(
10          --ha-tooltip-font-family,
11          var(--ha-font-family-body)
12        );--sl-tooltip-font-size:var(
13          --ha-tooltip-font-size,
14          var(--ha-font-size-s)
15        );--sl-tooltip-font-weight:var(
16          --ha-tooltip-font-weight,
17          var(--ha-font-weight-normal)
18        );--sl-tooltip-line-height:var(
19          --ha-tooltip-line-height,
20          var(--ha-line-height-condensed)
21        );--sl-tooltip-padding:8px;--sl-tooltip-border-radius:var(--ha-tooltip-border-radius, 4px);--sl-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--sl-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`],c=(0,s.__decorate)([(0,l.Mo)("ha-tooltip")],c),e()}catch(t){e(t)}})},7214:function(t,e,i){i.d(e,{Cj:()=>u,F7:()=>a,Hs:()=>k,Kd:()=>x,Kj:()=>p,Nw:()=>v,PA:()=>o,Py:()=>n,Qm:()=>$,Z0:()=>f,_Y:()=>c,_m:()=>r,dL:()=>d,dO:()=>S,hN:()=>_,h_:()=>h,j2:()=>b,q6:()=>g,uR:()=>l});i(81738),i(72489);var s=i(15459),a=function(t){return t[t.NONE=0]="NONE",t[t.ARITHMETIC=1]="ARITHMETIC",t[t.CIRCULAR=2]="CIRCULAR",t}({});const o=99387==i.j?["entity_not_recorded","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed","no_state"]:null,r=t=>t.sendMessagePromise({type:"recorder/info"}),l=(t,e)=>t.callWS({type:"recorder/list_statistic_ids",statistic_type:e}),n=(t,e)=>t.callWS({type:"recorder/get_statistics_metadata",statistic_ids:e}),d=(t,e,i,s,a="hour",o,r)=>t.callWS({type:"recorder/statistics_during_period",start_time:e.toISOString(),end_time:i?.toISOString(),statistic_ids:s,period:a,units:o,types:r}),c=(t,e,i,s)=>t.callWS({type:"recorder/statistic_during_period",statistic_id:e,units:s,fixed_period:i.fixed_period?{start_time:i.fixed_period.start instanceof Date?i.fixed_period.start.toISOString():i.fixed_period.start,end_time:i.fixed_period.end instanceof Date?i.fixed_period.end.toISOString():i.fixed_period.end}:void 0,calendar:i.calendar,rolling_window:i.rolling_window}),h=t=>t.callWS({type:"recorder/validate_statistics"}),u=(t,e,i)=>t.callWS({type:"recorder/update_statistics_metadata",statistic_id:e,unit_of_measurement:i}),_=(t,e)=>t.callWS({type:"recorder/clear_statistics",statistic_ids:e}),p=t=>{let e=null;if(!t)return null;for(const i of t)null!==i.change&&void 0!==i.change&&(null===e?e=i.change:e+=i.change);return e},g=(t,e)=>{let i=null;for(const s of e){if(!(s in t))continue;const e=p(t[s]);null!==e&&(null===i?i=e:i+=e)}return i},v=(t,e)=>t.some(t=>void 0!==t[e]&&null!==t[e]),m=["mean","min","max"],y=["sum","state","change"],f=(t,e)=>!(!m.includes(e)||0===t.mean_type)||!(!y.includes(e)||!t.has_sum),b=(t,e,i,s,a)=>{const o=new Date(i).toISOString();return t.callWS({type:"recorder/adjust_sum_statistics",statistic_id:e,start_time:o,adjustment:s,adjustment_unit_of_measurement:a})},x=(t,e,i)=>{const a=t.states[e];return a?(0,s.C)(a):i?.name||e},S=(t,e,i)=>{let s;return e&&(s=t.states[e]?.attributes.unit_of_measurement),void 0===s?i?.statistics_unit_of_measurement:s},k=t=>t.includes(":"),$=t=>t.callWS({type:"recorder/update_statistics_issues"})},6291:function(t,e,i){i.d(e,{f:()=>o});i(81738),i(72489);var s=i(73742),a=i(26292);const o=t=>{class e extends t{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const t=this.__unsubs.pop();t instanceof Promise?t.then(t=>t()):t()}this.__unsubs=void 0}}updated(t){if(super.updated(t),t.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const e of t.keys())if(this.hassSubscribeRequiredHostProps.includes(e))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){void 0===this.__unsubs&&this.isConnected&&void 0!==this.hass&&!this.hassSubscribeRequiredHostProps?.some(t=>void 0===this[t])&&(this.__unsubs=this.hassSubscribe())}}return(0,s.__decorate)([(0,a.Cb)({attribute:!1})],e.prototype,"hass",void 0),e}}
21,74314:function(t,e,i){i.a(t,async function(t,s){try{i.r(e);var a=i(73742),o=i(59048),r=i(26292),l=i(28598),n=(i(31138),i(97297)),d=(i(993),i(80298)),c=i(6640),h=i(6291),u=i(93647),_=t([n,d,c,l]);[n,d,c,l]=_.then?(await _)():_;const p="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",g=[{level:-1,stroke:"var(--energy-grid-consumption-color)"},{level:0,stroke:"var(--energy-grid-return-color)"}];class v extends((0,h.f)(o.oi)){hassSubscribe(){return[(0,c.UB)(this.hass,{key:this._config?.collection_key}).subscribe(t=>{this._data=t})]}getCardSize(){return 4}setConfig(t){this._config=t}shouldUpdate(t){return(0,u.SN)(this,t)||t.size>1||!t.has("hass")}render(){if(!this._config||!this.hass)return o.Ld;if(!this._data)return o.dy`${this.hass.localize("ui.panel.lovelace.cards.energy.loading")}`;const{summedData:t,compareSummedData:e}=(0,c.EH)(this._data);let i;if(!("from_grid"in t.total))return o.Ld;const s=t.total.from_grid??0,a=t.total.to_grid??0;return null!==s&&null!==a&&(i=a>s?1-s/a:a<s?-1*(1-a/s):0),o.dy` <ha-card> ${void 0!==i?o.dy` <ha-gauge min="-1" max="1" .value="${i}" .valueText="${(0,l.uf)(Math.abs(a-s),this.hass.locale,{maximumFractionDigits:2})}" .locale="${this.hass.locale}" .levels="${g}" label="kWh" needle></ha-gauge> <ha-tooltip placement="left" hoist> <span slot="content"> ${this.hass.localize("ui.panel.lovelace.cards.energy.grid_neutrality_gauge.energy_dependency")} <br><br> ${this.hass.localize("ui.panel.lovelace.cards.energy.grid_neutrality_gauge.color_explain")} </span> <ha-svg-icon .path="${p}"></ha-svg-icon> </ha-tooltip> <div class="name"> ${a>=s?this.hass.localize("ui.panel.lovelace.cards.energy.grid_neutrality_gauge.net_returned_grid"):this.hass.localize("ui.panel.lovelace.cards.energy.grid_neutrality_gauge.net_consumed_grid")} </div> `:this.hass.localize("ui.panel.lovelace.cards.energy.grid_neutrality_gauge.grid_neutrality_n
21ot_calculated")} </ha-card> `}constructor(...t){super(...t),this.hassSubscribeRequiredHostProps=["_config"]}}v.styles=o.iv`ha-card{height:100%;overflow:hidden;padding:16px;display:flex;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}ha-gauge{width:100%;max-width:250px;direction:ltr}.name{text-align:center;line-height:initial;color:var(--primary-text-color);width:100%;font-size:var(--ha-font-size-m);margin-top:8px}ha-svg-icon{position:absolute;right:4px;inset-inline-end:4px;inset-inline-start:initial;top:4px;color:var(--secondary-text-color)}ha-tooltip::part(base__popup){margin-top:4px}`,(0,a.__decorate)([(0,r.Cb)({attribute:!1})],v.prototype,"hass",void 0),(0,a.__decorate)([(0,r.SB)()],v.prototype,"_config",void 0),(0,a.__decorate)([(0,r.SB)()],v.prototype,"_data",void 0),v=(0,a.__decorate)([(0,r.Mo)("hui-energy-grid-neutrality-gauge-card")],v),s()}catch(t){s(t)}})},83533:function(t,e,i){i.d(e,{Ff:()=>a,Fv:()=>s,IU:()=>o});const s=(t,e,i)=>isNaN(t)||isNaN(e)||isNaN(i)?0:t>i?i:t<e?e:t,a=(t,e,i)=>100*(t-e)/(i-e),o=t=>Math.round(10*t)/10}};
22//# sourceMappingURL=16754.308a09c0ecef6be9.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.