217 files
This commit is contained in:
1 parent
40c604b6dd
commit
ef9868f192
217 files changed
+864
-34306
No files matched your search
@@ -1,9 +1,9 @@
|
||||
/*! maintenance_supporter frontend 2.87.0 */
|
||||
var Ai=Object.defineProperty;var Rs=Object.getOwnPropertyDescriptor;var w=(s,r,e)=>()=>{if(e)throw e[0];try{return s&&(r=s(s=0)),r}catch(t){throw e=[t],t}};var Ps=(s,r)=>{for(var e in r)Ai(s,e,{get:r[e],enumerable:!0})};var d=(s,r,e,t)=>{for(var i=t>1?void 0:t?Rs(r,e):r,a=s.length-1,l;a>=0;a--)(l=s[a])&&(i=(t?l(r,e,i):l(i))||i);return t&&i&&Ai(r,e,i),i};var st,nt,At,Ci,Oe,Ii,k,Ri,Ct,It=w(()=>{st=globalThis,nt=st.ShadowRoot&&(st.ShadyCSS===void 0||st.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Ci=new WeakMap,Oe=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==At)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o,e=this.t;if(nt&&r===void 0){let t=e!==void 0&&e.length===1;t&&(r=Ci.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&Ci.set(e,r))}return r}toString(){return this.cssText}},Ii=s=>new Oe(typeof s=="string"?s:s+"",void 0,At),k=(s,...r)=>{let e=s.length===1?s[0]:r.reduce((t,i,a)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[a+1],s[0]);return new Oe(e,s,At)},Ri=(s,r)=>{if(nt)s.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let t=document.createElement("style"),i=st.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,s.appendChild(t)}},Ct=nt?s=>s:s=>s instanceof CSSStyleSheet?(r=>{let e="";for(let t of r.cssRules)e+=t.cssText;return Ii(e)})(s):s});var Ls,Ns,js,Hs,Os,qs,at,Pi,Ds,Ms,qe,De,ot,Li,ee,Me=w(()=>{It();It();({is:Ls,defineProperty:Ns,getOwnPropertyDescriptor:js,getOwnPropertyNames:Hs,getOwnPropertySymbols:Os,getPrototypeOf:qs}=Object),at=globalThis,Pi=at.trustedTypes,Ds=Pi?Pi.emptyScript:"",Ms=at.reactiveElementPolyfillSupport,qe=(s,r)=>s,De={toAttribute(s,r){switch(r){case Boolean:s=s?Ds:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,r){let e=s;switch(r){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},ot=(s,r)=>!Ls(s,r),Li={attribute:!0,type:String,converter:De,reflect:!1,useDefault:!1,hasChanged:ot};Symbol.metadata??=Symbol("metadata"),at.litPropertyMetadata??=new WeakMap;ee=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=Li){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(r,t,e);i!==void 0&&Ns(this.prototype,r,i)}}static getPropertyDescriptor(r,e,t){let{get:i,set:a}=js(this.prototype,r)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let u=i?.call(this);a?.call(this,l),this.requestUpdate(r,u,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??Li}static _$Ei(){if(this.hasOwnProperty(qe("elementProperties")))return;let r=qs(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(qe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qe("properties"))){let e=this.properties,t=[...Hs(e),...Os(e)];for(let i of t)this.createProperty(i,e[i])}let r=this[Symbol.metadata];if(r!==null){let e=litPropertyMetadata.get(r);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){let e=[];if(Array.isArray(r)){let t=new Set(r.flat(1/0).reverse());for(let i of t)e.unshift(Ct(i))}else r!==void 0&&e.push(Ct(r));return e}static _$Eu(r,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){let r=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){let r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ri(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=tLine truncated
|
||||
/*! maintenance_supporter frontend 2.88.0 */
|
||||
var Ai=Object.defineProperty;var Rs=Object.getOwnPropertyDescriptor;var w=(s,r,e)=>()=>{if(e)throw e[0];try{return s&&(r=s(s=0)),r}catch(t){throw e=[t],t}};var Ps=(s,r)=>{for(var e in r)Ai(s,e,{get:r[e],enumerable:!0})};var d=(s,r,e,t)=>{for(var i=t>1?void 0:t?Rs(r,e):r,a=s.length-1,l;a>=0;a--)(l=s[a])&&(i=(t?l(r,e,i):l(i))||i);return t&&i&&Ai(r,e,i),i};var st,nt,At,Ci,Oe,Ii,k,Ri,Ct,It=w(()=>{st=globalThis,nt=st.ShadowRoot&&(st.ShadyCSS===void 0||st.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Ci=new WeakMap,Oe=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==At)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o,e=this.t;if(nt&&r===void 0){let t=e!==void 0&&e.length===1;t&&(r=Ci.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&Ci.set(e,r))}return r}toString(){return this.cssText}},Ii=s=>new Oe(typeof s=="string"?s:s+"",void 0,At),k=(s,...r)=>{let e=s.length===1?s[0]:r.reduce((t,i,a)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[a+1],s[0]);return new Oe(e,s,At)},Ri=(s,r)=>{if(nt)s.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let t=document.createElement("style"),i=st.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,s.appendChild(t)}},Ct=nt?s=>s:s=>s instanceof CSSStyleSheet?(r=>{let e="";for(let t of r.cssRules)e+=t.cssText;return Ii(e)})(s):s});var Ls,Ns,js,Hs,Os,qs,at,Pi,Ds,Ms,qe,De,ot,Li,ee,Me=w(()=>{It();It();({is:Ls,defineProperty:Ns,getOwnPropertyDescriptor:js,getOwnPropertyNames:Hs,getOwnPropertySymbols:Os,getPrototypeOf:qs}=Object),at=globalThis,Pi=at.trustedTypes,Ds=Pi?Pi.emptyScript:"",Ms=at.reactiveElementPolyfillSupport,qe=(s,r)=>s,De={toAttribute(s,r){switch(r){case Boolean:s=s?Ds:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,r){let e=s;switch(r){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},ot=(s,r)=>!Ls(s,r),Li={attribute:!0,type:String,converter:De,reflect:!1,useDefault:!1,hasChanged:ot};Symbol.metadata??=Symbol("metadata"),at.litPropertyMetadata??=new WeakMap;ee=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=Li){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(r,t,e);i!==void 0&&Ns(this.prototype,r,i)}}static getPropertyDescriptor(r,e,t){let{get:i,set:a}=js(this.prototype,r)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let u=i?.call(this);a?.call(this,l),this.requestUpdate(r,u,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??Li}static _$Ei(){if(this.hasOwnProperty(qe("elementProperties")))return;let r=qs(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(qe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qe("properties"))){let e=this.properties,t=[...Hs(e),...Os(e)];for(let i of t)this.createProperty(i,e[i])}let r=this[Symbol.metadata];if(r!==null){let e=litPropertyMetadata.get(r);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){let e=[];if(Array.isArray(r)){let t=new Set(r.flat(1/0).reverse());for(let i of t)e.unshift(Ct(i))}else r!==void 0&&e.push(Ct(r));return e}static _$Eu(r,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){let r=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){let r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ri(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=tLine truncated
|
||||
\f\r]`,ze=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Hi=/-->/g,Oi=/>/g,_e=RegExp(`>|${Rt}(?:([^\\s"'>=/]+)(${Rt}*=${Rt}*(?:[^
|
||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),qi=/'/g,Di=/"/g,Ui=/^(?:script|style|textarea|title)$/i,Dt=s=>(r,...e)=>({_$litType$:s,strings:r,values:e}),o=Dt(1),Ee=Dt(2),ba=Dt(3),fe=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Mi=new WeakMap,me=ge.createTreeWalker(ge,129);Us=(s,r)=>{let e=s.length-1,t=[],i,a=r===2?"<svg>":r===3?"<math>":"",l=ze;for(let u=0;u<e;u++){let h=s[u],_,m,b=-1,y=0;for(;y<h.length&&(l.lastIndex=y,m=l.exec(h),m!==null);)y=l.lastIndex,l===ze?m[1]==="!--"?l=Hi:m[1]!==void 0?l=Oi:m[2]!==void 0?(Ui.test(m[2])&&(i=RegExp("</"+m[2],"g")),l=_e):m[3]!==void 0&&(l=_e):l===_e?m[0]===">"?(l=i??ze,b=-1):m[1]===void 0?b=-2:(b=l.lastIndex-m[2].length,_=m[1],l=m[3]===void 0?_e:m[3]==='"'?Di:qi):l===Di||l===qi?l=_e:l===Hi||l===Oi?l=ze:(l=_e,i=void 0);let x=l===_e&&s[u+1].startsWith("/>")?" ":"";a+=l===ze?h+zs:b>=0?(t.push(_),h.slice(0,b)+zi+h.slice(b)+oe+x):h+oe+(b===-2?u:x)}return[Bi(s,a+(s[e]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),t]},Be=class s{constructor({strings:r,_$litType$:e},t){let i;this.parts=[];let a=0,l=0,u=r.length-1,h=this.parts,[_,m]=Us(r,e);if(this.el=s.createElement(_,t),me.currentNode=this.el.content,e===2||e===3){let b=this.el.content.firstChild;b.replaceWith(...b.childNodes)}for(;(i=me.nextNode())!==null&&h.length<u;){if(i.nodeType===1){if(i.hasAttributes())for(let b of i.getAttributeNames())if(b.endsWith(zi)){let y=m[l++],x=i.getAttribute(b).split(oe),g=/([.?@])?(.*)/.exec(y);h.push({type:1,index:a,name:g[2],strings:x,ctor:g[1]==="."?Lt:g[1]==="?"?Nt:g[1]==="@"?jt:ke}),i.removeAttribute(b)}else b.startsWith(oe)&&(h.push({type:6,index:a}),i.removeAttribute(b));if(Ui.test(i.tagName)){let b=i.textContent.split(oe),y=b.length-1;if(y>0){i.textContent=lt?lt.emptyScript:"";for(let x=0;x<y;x++)i.append(b[x],Fe()),me.nextNode(),h.push({type:2,index:++a});i.append(b[y],Fe())}}}else if(i.nodeType===8)if(i.data===Fi)h.push({type:2,index:a});else{let b=-1;for(;(b=i.data.indexOf(oe,b+1))!==-1;)h.push({type:7,index:a}),b+=oe.length-1}a++}}static createElement(r,e){let t=ge.createElement("template");return t.innerHTML=r,t}};Pt=class{constructor(r,e){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){let{el:{content:e},parts:t}=this._$AD,i=(r?.creationScope??ge).importNode(e,!0);me.currentNode=i;let a=me.nextNode(),l=0,u=0,h=t[0];for(;h!==void 0;){if(l===h.index){let _;h.type===2?_=new Ve(a,a.nextSibling,this,r):h.type===1?_=new h.ctor(a,h.name,h.strings,this,r):h.type===6&&(_=new Ht(a,this,r)),this._$AV.push(_),h=t[++u]}l!==h?.index&&(a=me.nextNode(),l++)}return me.currentNode=ge,i}p(r){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(r,t,e),e+=t.strings.length-2):t._$AI(r[e])),e++}},Ve=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(r,e,t,i){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=r,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let r=this._$AA.parentNode,e=this._$AM;return e!==void 0&&r?.nodeType===11&&(r=e.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,e=this){r=$e(this,r,e),Ue(r)?r===c||r==null||r===""?(this._$AH!==c&&this._$AR(),this._$AH=c):r!==this._$AH&&r!==fe&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):Fs(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==c&&Ue(this._$AH)?this._$AA.nextSibling.data=r:this.T(ge.createTextNode(r)),this._$AH=r}$(r){let{values:e,_$litType$:t}=r,i=typeof t=="number"?this._$AC(r):(t.el===void 0&&(t.el=Be.createElement(Bi(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let a=new Pt(i,this),l=a.u(this.options);a.p(e),this.T(l),this._$AH=a}}_$AC(r){let e=Mi.get(r.strings);return e===void 0&&Mi.set(r.strings,e=new Be(r)),e}k(r){qt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let a of r)i===e.length?e.push(t=new s(this.O(Fe()),this.O(Fe()),this,this.options)):t=e[i],t._$AI(a),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(r=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);r!==this._$AB;){let t=Ni(r).nextSibling;Ni(r).remove(),r=t}}setConnected(r){this._$AM===void 0&&(this._$Cv=r,this._$AP?.(r))}},ke=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,e,t,i,a){this.type=1,this._$AH=c,this._$AN=void 0,this.element=r,this.name=e,this._$AM=i,this.options=a,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=c}_$AI(r,e=this,t,i){let a=this.strings,l=!1;if(a===void 0)r=$e(this,r,e,0),l=!Ue(r)||r!==this._$AH&&r!==fe,l&&(this._$AH=r);else{let u=r,h,_;for(r=a[0],h=0;h<a.length-1;h++)_=$e(this,u[t+h],e,h),_===fe&&(_=this._$AH[h]),l||=!Ue(_)||_!==this._$AH[h],_===c?r=c:r!==c&&(r+=(_??"")+a[h+1]),this._$AH[h]=_}l&&!i&&this.j(r)}j(r){r===c?this.element.removeAttribute(this.naLine truncated
|
||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),qi=/'/g,Di=/"/g,Ui=/^(?:script|style|textarea|title)$/i,Dt=s=>(r,...e)=>({_$litType$:s,strings:r,values:e}),o=Dt(1),Ee=Dt(2),ba=Dt(3),fe=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Mi=new WeakMap,me=ge.createTreeWalker(ge,129);Us=(s,r)=>{let e=s.length-1,t=[],i,a=r===2?"<svg>":r===3?"<math>":"",l=ze;for(let u=0;u<e;u++){let h=s[u],_,m,b=-1,y=0;for(;y<h.length&&(l.lastIndex=y,m=l.exec(h),m!==null);)y=l.lastIndex,l===ze?m[1]==="!--"?l=Hi:m[1]!==void 0?l=Oi:m[2]!==void 0?(Ui.test(m[2])&&(i=RegExp("</"+m[2],"g")),l=_e):m[3]!==void 0&&(l=_e):l===_e?m[0]===">"?(l=i??ze,b=-1):m[1]===void 0?b=-2:(b=l.lastIndex-m[2].length,_=m[1],l=m[3]===void 0?_e:m[3]==='"'?Di:qi):l===Di||l===qi?l=_e:l===Hi||l===Oi?l=ze:(l=_e,i=void 0);let x=l===_e&&s[u+1].startsWith("/>")?" ":"";a+=l===ze?h+zs:b>=0?(t.push(_),h.slice(0,b)+zi+h.slice(b)+le+x):h+le+(b===-2?u:x)}return[Bi(s,a+(s[e]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),t]},Be=class s{constructor({strings:r,_$litType$:e},t){let i;this.parts=[];let a=0,l=0,u=r.length-1,h=this.parts,[_,m]=Us(r,e);if(this.el=s.createElement(_,t),me.currentNode=this.el.content,e===2||e===3){let b=this.el.content.firstChild;b.replaceWith(...b.childNodes)}for(;(i=me.nextNode())!==null&&h.length<u;){if(i.nodeType===1){if(i.hasAttributes())for(let b of i.getAttributeNames())if(b.endsWith(zi)){let y=m[l++],x=i.getAttribute(b).split(le),g=/([.?@])?(.*)/.exec(y);h.push({type:1,index:a,name:g[2],strings:x,ctor:g[1]==="."?Lt:g[1]==="?"?Nt:g[1]==="@"?jt:ke}),i.removeAttribute(b)}else b.startsWith(le)&&(h.push({type:6,index:a}),i.removeAttribute(b));if(Ui.test(i.tagName)){let b=i.textContent.split(le),y=b.length-1;if(y>0){i.textContent=lt?lt.emptyScript:"";for(let x=0;x<y;x++)i.append(b[x],Fe()),me.nextNode(),h.push({type:2,index:++a});i.append(b[y],Fe())}}}else if(i.nodeType===8)if(i.data===Fi)h.push({type:2,index:a});else{let b=-1;for(;(b=i.data.indexOf(le,b+1))!==-1;)h.push({type:7,index:a}),b+=le.length-1}a++}}static createElement(r,e){let t=ge.createElement("template");return t.innerHTML=r,t}};Pt=class{constructor(r,e){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){let{el:{content:e},parts:t}=this._$AD,i=(r?.creationScope??ge).importNode(e,!0);me.currentNode=i;let a=me.nextNode(),l=0,u=0,h=t[0];for(;h!==void 0;){if(l===h.index){let _;h.type===2?_=new Ve(a,a.nextSibling,this,r):h.type===1?_=new h.ctor(a,h.name,h.strings,this,r):h.type===6&&(_=new Ht(a,this,r)),this._$AV.push(_),h=t[++u]}l!==h?.index&&(a=me.nextNode(),l++)}return me.currentNode=ge,i}p(r){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(r,t,e),e+=t.strings.length-2):t._$AI(r[e])),e++}},Ve=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(r,e,t,i){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=r,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let r=this._$AA.parentNode,e=this._$AM;return e!==void 0&&r?.nodeType===11&&(r=e.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,e=this){r=$e(this,r,e),Ue(r)?r===c||r==null||r===""?(this._$AH!==c&&this._$AR(),this._$AH=c):r!==this._$AH&&r!==fe&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):Fs(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==c&&Ue(this._$AH)?this._$AA.nextSibling.data=r:this.T(ge.createTextNode(r)),this._$AH=r}$(r){let{values:e,_$litType$:t}=r,i=typeof t=="number"?this._$AC(r):(t.el===void 0&&(t.el=Be.createElement(Bi(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let a=new Pt(i,this),l=a.u(this.options);a.p(e),this.T(l),this._$AH=a}}_$AC(r){let e=Mi.get(r.strings);return e===void 0&&Mi.set(r.strings,e=new Be(r)),e}k(r){qt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let a of r)i===e.length?e.push(t=new s(this.O(Fe()),this.O(Fe()),this,this.options)):t=e[i],t._$AI(a),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(r=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);r!==this._$AB;){let t=Ni(r).nextSibling;Ni(r).remove(),r=t}}setConnected(r){this._$AM===void 0&&(this._$Cv=r,this._$AP?.(r))}},ke=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,e,t,i,a){this.type=1,this._$AH=c,this._$AN=void 0,this.element=r,this.name=e,this._$AM=i,this.options=a,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=c}_$AI(r,e=this,t,i){let a=this.strings,l=!1;if(a===void 0)r=$e(this,r,e,0),l=!Ue(r)||r!==this._$AH&&r!==fe,l&&(this._$AH=r);else{let u=r,h,_;for(r=a[0],h=0;h<a.length-1;h++)_=$e(this,u[t+h],e,h),_===fe&&(_=this._$AH[h]),l||=!Ue(_)||_!==this._$AH[h],_===c?r=c:r!==c&&(r+=(_??"")+a[h+1]),this._$AH[h]=_}l&&!i&&this.j(r)}j(r){r===c?this.element.removeAttribute(this.naLine truncated
|
||||
Replace seal
|
||||
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",ws_err_not_found:"Not found \u2014 it may have been deleted meanwhile",ws_err_invalid_input:"Invalid input",ws_err_invalid_date:"Invalid date",ws_err_invalid_format:"Invalid format",ws_err_invalid_url:"Invalid link",ws_err_invalid_mirror_todo:"Invalid to-do list",ws_err_not_configured:"Not set up yet",ws_err_not_loaded:"Not loaded yet \u2014 try again in a moment",ws_err_limit_reached:"Limit reached",ws_err_too_many:"Too many entries",ws_err_too_large:"Too large",ws_err_not_archived:"Not archived",ws_err_invalid_target:"Invalid target",ws_err_create_failed:"Could not be created",ws_err_archived:"Archived \u2014 restore it first",ws_err_already_archived:"Already archived",ws_err_unavailable:"Currently unavailable",ws_err_unauthorized:"Not permitted for your user",ws_err_too_many_views:"Too many saved views",ws_err_storage_unavailable:"Storage is not available",ws_err_replace_failed:"Replacement failed",ws_err_not_paused:"Not paused",ws_err_not_available:"Nothing available",ws_err_no_url:"No link given",ws_err_no_phases:"This task has no phases",ws_err_invalid_view:"Invalid view",ws_err_invalid_user:"Unknown user",ws_err_invalid_range:"Invalid range",ws_err_invalid_parent:"Invalid parent object",ws_err_invalid_device:"Unknown device",ws_err_empty_csv:"The CSV file is empty",ws_err_empty:"Nothing to import",ws_err_duplicate_failed:"Could not duplicate",ws_err_already_paused:"Already paused",ws_err_invalid_cursor:"Invalid phase position",ws_err_invalid_entity_slug:"Invalid entity name",ws_err_invalid_trigger_config:"Invalid trigger configuration",ws_err_no_defaults:"No quick-complete defaults set",ws_err_self_link_device:"An object cannot be linked to itself",ws_err_too_early:"Too early \u2014 this task can only be completed closer to its due date",ws_err_invalid_search_template:"The search link must be an http(s) URL containing {q}",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",task_mirror_todo:"Mirror into to-do lists",task_mirror_todo_hint:"The task appears in these lists while it is due; checking it off there completes it here.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",all_parts:"All parts",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all
Line truncated
|
||||
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",ws_err_not_found:"Not found \u2014 it may have been deleted meanwhile",ws_err_invalid_input:"Invalid input",ws_err_invalid_date:"Invalid date",ws_err_invalid_format:"Invalid format",ws_err_invalid_url:"Invalid link",ws_err_invalid_mirror_todo:"Invalid to-do list",ws_err_not_configured:"Not set up yet",ws_err_not_loaded:"Not loaded yet \u2014 try again in a moment",ws_err_limit_reached:"Limit reached",ws_err_too_many:"Too many entries",ws_err_too_large:"Too large",ws_err_not_archived:"Not archived",ws_err_invalid_target:"Invalid target",ws_err_create_failed:"Could not be created",ws_err_archived:"Archived \u2014 restore it first",ws_err_already_archived:"Already archived",ws_err_unavailable:"Currently unavailable",ws_err_unauthorized:"Not permitted for your user",ws_err_too_many_views:"Too many saved views",ws_err_storage_unavailable:"Storage is not available",ws_err_replace_failed:"Replacement failed",ws_err_not_paused:"Not paused",ws_err_not_available:"Nothing available",ws_err_no_url:"No link given",ws_err_no_phases:"This task has no phases",ws_err_invalid_view:"Invalid view",ws_err_invalid_user:"Unknown user",ws_err_invalid_range:"Invalid range",ws_err_invalid_parent:"Invalid parent object",ws_err_invalid_device:"Unknown device",ws_err_empty_csv:"The CSV file is empty",ws_err_empty:"Nothing to import",ws_err_duplicate_failed:"Could not duplicate",ws_err_already_paused:"Already paused",ws_err_invalid_cursor:"Invalid phase position",ws_err_invalid_entity_slug:"Invalid entity name",ws_err_invalid_trigger_config:"Invalid trigger configuration",ws_err_no_defaults:"No quick-complete defaults set",ws_err_self_link_device:"An object cannot be linked to itself",ws_err_too_early:"Too early \u2014 this task can only be completed closer to its due date",ws_err_invalid_search_template:"The search link must be an http(s) URL containing {q}",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",task_mirror_todo:"Mirror into to-do lists",task_mirror_todo_hint:"The task appears in these lists while it is due; checking it off there completes it here.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",all_parts:"All parts",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all
Line truncated
|
||||
.field { display: flex; flex-direction: column; gap: 4px; }
|
||||
.field-label { font-size: 12px; color: var(--secondary-text-color); }
|
||||
.field-input {
|
||||
@@ -1245,7 +1245,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
.stat-item .stat-label { font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
|
||||
.stat-value { font-size: 20px; }
|
||||
}
|
||||
`});function br(s,r,e){let t=new Blob([s],{type:e}),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=r,a.target="_blank",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(i),6e4)}var Yt=w(()=>{"use strict"});async function pn(s,r,e=300){return(await s.connection.sendMessagePromise({type:"auth/sign_path",path:r,expires:e})).path}async function Gt(s,r,e=300){return pn(s,`/api/maintenance_supporter/document/${r}`,e)}async function yr(s,r,e=""){let t=window.open("about:blank","_blank");try{let i=await Gt(s,r);t&&(t.location.href=new URL(i+e,window.location.origin).href)}catch(i){throw t&&t.close(),i}}var Qt=w(()=>{"use strict";Yt()});function mt(s){return!!s&&/^https?:\/\//i.test(s)}var Jt=w(()=>{"use strict"});function hn(s){let r=(s||"").split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function un(s){let r=0;for(let e of s)r=r*31+e.charCodeAt(0)>>>0;return xr[r%xr.length]}function gt(s){return s?{id:s.id,name:s.name,initials:s.initials||hn(s.name),color:s.color||un(s.id)}:null}function Zt(s){return s?o`<span class="person-avatar" style="--person-color: ${s.color}" title=${s.name}>${s.initials}</span>`:c}var xr,Xt=w(()=>{"use strict";I();xr=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"]});var Ie,ei=w(()=>{"use strict";Xt();Ie=class{constructor(r){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=r}updateHass(r){this.hass=r}async getUsers(r=!1){let e=Date.now();if(!r&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(r,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:r,task_id:e,user_id:t})}async getTasksByUser(r){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:r})).tasks}getUserName(r){return!r||!this.usersCache?null:this.usersCache.find(t=>t.id===r)?.name||null}getPerson(r){return gt(this.getUser(r))}getUser(r){return!r||!this.usersCache?null:this.usersCache.find(e=>e.id===r)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(r){return r?r===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function _n(s,r){if(r<=0)return 0;let e=typeof s=="number"&&Number.isFinite(s)?Math.trunc(s):0;return e<0?0:e%r}function mn(s){return!!(s?.phases&&s.phase_sequence&&s.phase_sequence.length>0)}function ti(s){if(!s||!mn(s))return null;let r=s.phase_sequence,e=_n(s.phase_cursor,r.length),t=r[e],i=s.phases?.[t];return i?{id:t,name:i.name,index:e,count:r.length,notes:i.notes,checklist:i.checklist!==void 0?i.checklist:s.checklist??[],consumesParts:i.consumes_parts!==void 0?i.consumes_parts:s.consumes_parts??[],requiredFields:i.required_completion_fields!==void 0?i.required_completion_fields:s.required_completion_fields??[]}:null}function de(s){let r=ti(s);return r?`${r.index+1}/${r.count} \xB7 ${r.name}`:""}var ft=w(()=>{"use strict"});function wr(){let s=new Uint8Array(4);return(globalThis.crypto??{getRandomValues:r=>r.map(()=>Math.floor(Math.random()*256))}).getRandomValues(s),Array.from(s,r=>r.toString(16).padStart(2,"0")).join("")}function ce(s){let r=s?.reading_values;if(!Array.isArray(r))return[];let e=[],t=new Set;for(let i of r){if(!i||typeof i!="object")continue;let a=i;typeof a.id!="string"||!a.id||t.has(a.id)||typeof a.value!="number"||!Number.isFinite(a.value)||(t.add(a.id),e.push({id:a.id,name:typeof a.name=="string"?a.name:a.id,unit:typeof a.unit=="string"?a.unit:null,value:a.value}))}return e}function $r(s){return s.filter(r=>r.type==="completed"&&(r.reading_value!=null||ce(r).length>0)).sort((r,e)=>r.timestamp.localeCompare(e.timestamp))}function kr(s){return $r(s??[]).map(r=>({timestamp:r.timestamp,values:ce(r)})).filter(r=>r.values.length>0)}function Er(s,r,e){let t;for(let i of s){if(e!==void 0){let l=new Date(i.timestamp).getTime();if(!isNaN(l)&&l>=e)break}let a=i.values.find(l=>l.id===r);a&&(t=a)}return t}function Sr(s,r,e){let t=ce(r).find(a=>a.id===e);if(!t)return null;let i=null;for(let a of $r(s)){if(a.timestamp>=r.timestamp)break;let l=ce(a).find(u=>u.id===e);l&&(i=l.value)}return i==null?null:t.value-i}function Tr(s){let r=new Set,e=new Set;for(let t of s){let i=(t.name||"").trim().toLowerCase();i&&(r.has(i)?e.add(t.id):r.add(i))}return e}function Ar(s){let r=[],e=new Set,t=new Set;for(let i of s){let a=(i.name||"").trim();if(!(!a||e.has(i.id)||t.has(a.toLowerCase()))&&(e.add(i.id),t.add(a.toLowerCase()),r.push({id:i.id,Line truncated
|
||||
`});function br(s,r,e){let t=new Blob([s],{type:e}),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=r,a.target="_blank",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(i),6e4)}var Yt=w(()=>{"use strict"});async function pn(s,r,e=300){return(await s.connection.sendMessagePromise({type:"auth/sign_path",path:r,expires:e})).path}async function Gt(s,r,e=300){return pn(s,`/api/maintenance_supporter/document/${r}`,e)}async function yr(s,r,e=""){let t=window.open("about:blank","_blank");try{let i=await Gt(s,r);t&&(t.location.href=new URL(i+e,window.location.origin).href)}catch(i){throw t&&t.close(),i}}var Qt=w(()=>{"use strict";Yt()});function mt(s){return!!s&&/^https?:\/\//i.test(s)}var Jt=w(()=>{"use strict"});function hn(s){let r=(s||"").split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function un(s){let r=0;for(let e of s)r=r*31+e.charCodeAt(0)>>>0;return xr[r%xr.length]}function gt(s){return s?{id:s.id,name:s.name,initials:s.initials||hn(s.name),color:s.color||un(s.id)}:null}function Zt(s){return s?o`<span class="person-avatar" style="--person-color: ${s.color}" title=${s.name}>${s.initials}</span>`:c}var xr,Xt=w(()=>{"use strict";I();xr=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"]});var Ie,ei=w(()=>{"use strict";Xt();Ie=class{constructor(r){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=r}updateHass(r){this.hass=r}async getUsers(r=!1){let e=Date.now();if(!r&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(r,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:r,task_id:e,user_id:t})}async getTasksByUser(r){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:r})).tasks}getUserName(r){return!r||!this.usersCache?null:this.usersCache.find(t=>t.id===r)?.name||null}getPerson(r){return gt(this.getUser(r))}getUser(r){return!r||!this.usersCache?null:this.usersCache.find(e=>e.id===r)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(r){return r?r===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function _n(s,r){if(r<=0)return 0;let e=typeof s=="number"&&Number.isFinite(s)?Math.trunc(s):0;return e<0?0:e%r}function mn(s){return!!(s?.phases&&s.phase_sequence&&s.phase_sequence.length>0)}function ti(s){if(!s||!mn(s))return null;let r=s.phase_sequence,e=_n(s.phase_cursor,r.length),t=r[e],i=s.phases?.[t];return i?{id:t,name:i.name,index:e,count:r.length,notes:i.notes,checklist:i.checklist!==void 0?i.checklist:s.checklist??[],consumesParts:i.consumes_parts!==void 0?i.consumes_parts:s.consumes_parts??[],requiredFields:i.required_completion_fields!==void 0?i.required_completion_fields:s.required_completion_fields??[]}:null}function ce(s){let r=ti(s);return r?`${r.index+1}/${r.count} \xB7 ${r.name}`:""}var ft=w(()=>{"use strict"});function wr(){let s=new Uint8Array(4);return(globalThis.crypto??{getRandomValues:r=>r.map(()=>Math.floor(Math.random()*256))}).getRandomValues(s),Array.from(s,r=>r.toString(16).padStart(2,"0")).join("")}function pe(s){let r=s?.reading_values;if(!Array.isArray(r))return[];let e=[],t=new Set;for(let i of r){if(!i||typeof i!="object")continue;let a=i;typeof a.id!="string"||!a.id||t.has(a.id)||typeof a.value!="number"||!Number.isFinite(a.value)||(t.add(a.id),e.push({id:a.id,name:typeof a.name=="string"?a.name:a.id,unit:typeof a.unit=="string"?a.unit:null,value:a.value}))}return e}function $r(s){return s.filter(r=>r.type==="completed"&&(r.reading_value!=null||pe(r).length>0)).sort((r,e)=>r.timestamp.localeCompare(e.timestamp))}function kr(s){return $r(s??[]).map(r=>({timestamp:r.timestamp,values:pe(r)})).filter(r=>r.values.length>0)}function Er(s,r,e){let t;for(let i of s){if(e!==void 0){let l=new Date(i.timestamp).getTime();if(!isNaN(l)&&l>=e)break}let a=i.values.find(l=>l.id===r);a&&(t=a)}return t}function Sr(s,r,e){let t=pe(r).find(a=>a.id===e);if(!t)return null;let i=null;for(let a of $r(s)){if(a.timestamp>=r.timestamp)break;let l=pe(a).find(u=>u.id===e);l&&(i=l.value)}return i==null?null:t.value-i}function Tr(s){let r=new Set,e=new Set;for(let t of s){let i=(t.name||"").trim().toLowerCase();i&&(r.has(i)?e.add(t.id):r.add(i))}return e}function Ar(s){let r=[],e=new Set,t=new Set;for(let i of s){let a=(i.name||"").trim();if(!(!a||e.has(i.id)||t.has(a.toLowerCase()))&&(e.add(i.id),t.add(a.toLowerCase()),r.push({id:i.id,Line truncated
|
||||
<div class="field">
|
||||
${this.label?o`<span class="label">${this.label}${this.required?o`<span class="req">*</span>`:c}</span>`:c}
|
||||
<div class="row">
|
||||
@@ -1331,20 +1331,21 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
}
|
||||
input.typed[aria-invalid="true"] { border-color: var(--error-color, #f44336); }
|
||||
input.typed:focus { outline: 2px solid var(--primary-color); outline-offset: -1px; }
|
||||
`,d([v({attribute:!1})],M.prototype,"hass",2),d([v()],M.prototype,"kind",2),d([v()],M.prototype,"label",2),d([v()],M.prototype,"value",2),d([v()],M.prototype,"helper",2),d([v({type:Boolean})],M.prototype,"clearable",2),d([v({type:Boolean})],M.prototype,"disabled",2),d([v({type:Boolean})],M.prototype,"required",2),d([v()],M.prototype,"lang",2),d([p()],M.prototype,"_typing",2),d([p()],M.prototype,"_typed",2),d([p()],M.prototype,"_typedInvalid",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",M)});function wt(){if(window.externalApp!==void 0)return!0;let r=typeof navigator<"u"&&navigator.userAgent||"";return/Home Assistant\//.test(r)&&/Android/.test(r)}var ai=w(()=>{"use strict"});function tt(s){try{return localStorage.getItem(s)}catch{return null}}function it(s,r){try{localStorage.setItem(s,r)}catch{}}var pe,oi=w(()=>{"use strict";pe={objectSections:"msp-object-sections",printOptions:"msp-print-options",batteryRosterOpen:"msp-bf-roster-open",docSort:"msp-doc-sort",cameraDevice:"msp-camera-device",overviewTab:"msp-overview-tab",collapsedSections:"msp-collapsed-sections",chartRange:"msp-chart-range",chartHideOutliers:"msp-chart-hide-outliers",taskSort:"maintenance_supporter_sort",objectSort:"maintenance_supporter_object_sort",groupBy:"maintenance_supporter_groupby",objectView:"maintenance_supporter_object_view",objectsCache:"msp-objects-cache",gettingStartedDismissed:"msp-gs-dismissed",batteryRosterSort:"ms_bf_roster_sort"}});function qr(){if(!wt())return!1;let s=typeof navigator<"u"?navigator.mediaDevices:void 0;return!!s&&typeof s.getUserMedia=="function"}var Tn,An,he,li=w(()=>{"use strict";I();q();C();ai();oi();Tn=1920,An=.88,he=class extends E{constructor(){super(...arguments);this.lang="en";this._open=!1;this._busy=!1;this._devices=[];this._stream=null}async open(){if(this._open)return;let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e||typeof e.getUserMedia!="function"){this._unavailable("no_media_devices");return}let t=tt(pe.cameraDevice),i=!1;if(t)try{this._stream=await e.getUserMedia({video:{deviceId:{exact:t}},audio:!1}),i=!0}catch{}if(!i){try{this._stream=await e.getUserMedia({video:{facingMode:{ideal:"environment"},advanced:[{zoom:1}]},audio:!1})}catch(l){this._unavailable(l instanceof Error?l.name||l.message:String(l));return}await this._preferMainBackCamera(e)}await this._applyZoomOne(),await this._listDevices(e),this._open=!0,await this.updateComplete;let a=this._video;if(a&&this._stream){a.srcObject=this._stream;try{await a.play()}catch{}}}async _preferMainBackCamera(e){if(typeof e.enumerateDevices!="function")return;let t=[];try{t=await e.enumerateDevices()}catch{return}let i=h=>{let _=/camera2?\s*(\d+)/i.exec(h.label);return _?Number(_[1]):Number.MAX_SAFE_INTEGER},a=t.filter(h=>h.kind==="videoinput"&&h.deviceId&&/back|rear|environment|rück|hinten/i.test(h.label)).sort((h,_)=>i(h)-i(_)),u=this._stream?.getVideoTracks()[0]?.getSettings().deviceId;if(a.length>1&&a[0].deviceId!==u)try{let h=await e.getUserMedia({video:{deviceId:{exact:a[0].deviceId}},audio:!1});for(let _ of this._stream?.getTracks()??[])_.stop();this._stream=h}catch{}}async _applyZoomOne(){let e=this._stream?.getVideoTracks()[0],t=e&&typeof e.getCapabilities=="function"?e.getCapabilities():void 0;if(t?.zoom&&typeof t.zoom.min=="number"&&t.zoom.min<1&&(t.zoom.max??1)>=1)try{await e.applyConstraints({advanced:[{zoom:1}]})}catch{}}async _listDevices(e){if(typeof e.enumerateDevices=="function")try{this._devices=(await e.enumerateDevices()).filter(t=>t.kind==="videoinput"&&!!t.deviceId)}catch{this._devices=[]}}get _currentDeviceId(){return this._stream?.getVideoTracks()[0]?.getSettings().deviceId}async _switchCamera(){let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e||this._devices.length<2||this._busy)return;let t=this._devices.map(l=>l.deviceId),i=t.indexOf(this._currentDeviceId??""),a=t[(i+1)%t.length];this._busy=!0;try{let l=await e.getUserMedia({video:{deviceId:{exact:a}},audio:!1});for(let h of this._stream?.getTracks()??[])h.stop();this._stream=l,await this._applyZoomOne(),it(pe.cameraDevice,a);let u=this._video;if(u){u.srcObject=l;try{await u.play()}catch{}}}catch{}finally{this._busy=!1}}close(){this._stopStream(),this._open=!1,this._busy=!1}disconnectedCallback(){super.disconnectedCallback(),this._stopStream()}get _video(){return this.shadowRoot?.querySelector("video")??null}_stopStream(){for(let t of this._stream?.getTracks()??[])t.stop();this._stream=null;let e=this._video;e&&(e.srcObject=null)}_unavailable(e){this._stopStream(),this._open=!1,this.dispatchEvent(new CustomEvent("capture-unavailable",{detail:{reason:e},bubbles:!0,composed:!0}))}async _shoot(){let e=this._video;if(!(!e||this._busy)){this._busy=!0;try{let t=e.videoWidth||640,i=e.videoHeight||480,a=Math.min(1,Tn/Math.max(t,i)),l=document.createElement("canvas");l.width=Math.round(t*a),l.height=Math.round(i*a);let u=l.getContext("2d");if(!u)throw new Error("no_canvas");u.drawImage(e,0,0,l.width,l.height);le
Line truncated
|
||||
`,d([v({attribute:!1})],M.prototype,"hass",2),d([v()],M.prototype,"kind",2),d([v()],M.prototype,"label",2),d([v()],M.prototype,"value",2),d([v()],M.prototype,"helper",2),d([v({type:Boolean})],M.prototype,"clearable",2),d([v({type:Boolean})],M.prototype,"disabled",2),d([v({type:Boolean})],M.prototype,"required",2),d([v()],M.prototype,"lang",2),d([p()],M.prototype,"_typing",2),d([p()],M.prototype,"_typed",2),d([p()],M.prototype,"_typedInvalid",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",M)});function wt(){if(window.externalApp!==void 0)return!0;let r=typeof navigator<"u"&&navigator.userAgent||"";return/Home Assistant\//.test(r)&&/Android/.test(r)}var ai=w(()=>{"use strict"});function tt(s){try{return localStorage.getItem(s)}catch{return null}}function it(s,r){try{localStorage.setItem(s,r)}catch{}}var he,oi=w(()=>{"use strict";he={objectSections:"msp-object-sections",printOptions:"msp-print-options",batteryRosterOpen:"msp-bf-roster-open",docSort:"msp-doc-sort",cameraDevice:"msp-camera-device",overviewTab:"msp-overview-tab",collapsedSections:"msp-collapsed-sections",chartRange:"msp-chart-range",chartHideOutliers:"msp-chart-hide-outliers",taskSort:"maintenance_supporter_sort",objectSort:"maintenance_supporter_object_sort",groupBy:"maintenance_supporter_groupby",objectView:"maintenance_supporter_object_view",objectsCache:"msp-objects-cache",gettingStartedDismissed:"msp-gs-dismissed",batteryRosterSort:"ms_bf_roster_sort"}});function qr(){if(!wt())return!1;let s=typeof navigator<"u"?navigator.mediaDevices:void 0;return!!s&&typeof s.getUserMedia=="function"}var Tn,An,re,li=w(()=>{"use strict";I();q();C();ai();oi();Tn=1920,An=.88,re=class extends E{constructor(){super(...arguments);this.lang="en";this._open=!1;this._busy=!1;this._devices=[];this._deviceIndex=-1;this._stream=null}async open(){if(this._open)return;let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e||typeof e.getUserMedia!="function"){this._unavailable("no_media_devices");return}let t=tt(he.cameraDevice),i=!1;if(t)try{this._stream=await e.getUserMedia({video:{deviceId:{exact:t}},audio:!1}),i=!0}catch{}if(!i){try{this._stream=await e.getUserMedia({video:{facingMode:{ideal:"environment"},zoom:1,advanced:[{zoom:1}]},audio:!1})}catch(l){this._unavailable(l instanceof Error?l.name||l.message:String(l));return}await this._preferMainBackCamera(e)}await this._applyZoomOne(),await this._listDevices(e),this._deviceIndex=this._indexOfCurrent(t&&i?t:null),this._open=!0,await this.updateComplete;let a=this._video;if(a&&this._stream){a.srcObject=this._stream;try{await a.play()}catch{}}}async _preferMainBackCamera(e){if(typeof e.enumerateDevices!="function")return;let t=[];try{t=await e.enumerateDevices()}catch{return}let i=h=>{let _=/camera2?\s*(\d+)/i.exec(h.label);return _?Number(_[1]):Number.MAX_SAFE_INTEGER},a=t.filter(h=>h.kind==="videoinput"&&h.deviceId&&/back|rear|environment|rück|hinten/i.test(h.label)).sort((h,_)=>i(h)-i(_)),u=this._stream?.getVideoTracks()[0]?.getSettings().deviceId;if(a.length>1&&a[0].deviceId!==u)try{let h=await e.getUserMedia({video:{deviceId:{exact:a[0].deviceId}},audio:!1});for(let _ of this._stream?.getTracks()??[])_.stop();this._stream=h}catch{}}async _applyZoomOne(){let e=this._stream?.getVideoTracks()[0],t=e&&typeof e.getCapabilities=="function"?e.getCapabilities():void 0;if(!(!t?.zoom||typeof t.zoom.min!="number"||t.zoom.min>=1||(t.zoom.max??1)<1))for(let i of[{zoom:1},{advanced:[{zoom:1}]}])try{await e.applyConstraints(i);return}catch{}}_indexOfCurrent(e){let t=this._devices.map(a=>a.deviceId),i=this._currentDeviceId;for(let a of[e,i])if(a){let l=t.indexOf(a);if(l>=0)return l}return-1}async _listDevices(e){if(typeof e.enumerateDevices=="function")try{this._devices=(await e.enumerateDevices()).filter(t=>t.kind==="videoinput"&&!!t.deviceId)}catch{this._devices=[]}}get _currentDeviceId(){return this._stream?.getVideoTracks()[0]?.getSettings().deviceId}async _switchCamera(){let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e||this._devices.length<2||this._busy)return;let t=this._devices.map(i=>i.deviceId);this._busy=!0;try{for(let i=1;i<t.length;i++){let a=(this._deviceIndex+i)%t.length,l=t[a];if(!(l===this._currentDeviceId&&this._deviceIndex<0))try{let u=await e.getUserMedia({video:{deviceId:{exact:l}},audio:!1});for(let _ of this._stream?.getTracks()??[])_.stop();this._stream=u,this._deviceIndex=a,await this._applyZoomOne(),it(he.cameraDevice,l);let h=this._video;if(h){h.srcObject=u;try{await h.play()}catch{}}return}catch{}}}finally{this._busy=!1}}close(){this._stopStream(),this._open=!1,this._busy=!1}disconnectedCallback(){super.disconnectedCallback(),this._stopStream()}get _video(){return this.shadowRoot?.querySelector("video")??null}_stopStream(){for(let t of this._stream?.getTracks()??[])t.stop();this._stream=null;let e=this._video;e&&(e.srcObject=null)}_unavailable(e){this._stopStream(),this._open=!1,this.dispatchEvent(new CustomEvent("capture-unavailable",{detail:{re
Line truncated
|
||||
<div class="overlay" role="dialog" aria-modal="true" aria-label=${n("doc_camera",e)}>
|
||||
<video autoplay playsinline muted></video>
|
||||
<div class="bar">
|
||||
<button type="button" class="cancel" @click=${this.close}>${n("cancel",e)}</button>
|
||||
${this._devices.length>1?o`<button type="button" class="switch" ?disabled=${this._busy} title=${n("camera_switch_lens",e)} aria-label=${n("camera_switch_lens",e)} @click=${this._switchCamera}>
|
||||
<ha-icon icon="mdi:camera-flip-outline"></ha-icon>
|
||||
<span class="switch-pos">${this._deviceIndex>=0?`${this._deviceIndex+1}/${this._devices.length}`:`?/${this._devices.length}`}</span>
|
||||
</button>`:c}
|
||||
<button type="button" class="shoot" ?disabled=${this._busy} @click=${this._shoot}>
|
||||
<ha-icon icon="mdi:camera"></ha-icon><span>${n("camera_capture_shoot",e)}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
`}};he.styles=k`
|
||||
`}};re.styles=k`
|
||||
:host { display: contents; }
|
||||
.overlay {
|
||||
position: fixed; inset: 0; z-index: 10000;
|
||||
@@ -1364,10 +1365,11 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
.cancel { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.6); }
|
||||
.switch { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.6); padding: 10px 12px; }
|
||||
.switch ha-icon { --mdc-icon-size: 22px; }
|
||||
.switch-pos { font-size: 12px; opacity: 0.85; }
|
||||
.shoot { background: var(--primary-color, #03a9f4); color: #fff; border: none; font-weight: 600; }
|
||||
.shoot[disabled] { opacity: 0.6; cursor: default; }
|
||||
.shoot ha-icon { --mdc-icon-size: 22px; }
|
||||
`,d([v({type:String})],he.prototype,"lang",2),d([p()],he.prototype,"_open",2),d([p()],he.prototype,"_busy",2),d([p()],he.prototype,"_devices",2);customElements.get("ms-camera-capture")||customElements.define("ms-camera-capture",he)});var $t,W,rt=w(()=>{"use strict";I();q();C();ai();li();li();$t=k`
|
||||
`,d([v({type:String})],re.prototype,"lang",2),d([p()],re.prototype,"_open",2),d([p()],re.prototype,"_busy",2),d([p()],re.prototype,"_devices",2),d([p()],re.prototype,"_deviceIndex",2);customElements.get("ms-camera-capture")||customElements.define("ms-camera-capture",re)});var $t,W,rt=w(()=>{"use strict";I();q();C();ai();li();li();$t=k`
|
||||
ms-photo-picker { display: contents; }
|
||||
.photo-pickers {
|
||||
display: flex;
|
||||
@@ -2005,9 +2007,9 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
color: var(--error-color, #f44336);
|
||||
font-size: 13px;
|
||||
}
|
||||
`,d([v({attribute:!1})],N.prototype,"hass",2),d([v({attribute:!1})],N.prototype,"objects",2),d([p()],N.prototype,"_open",2),d([p()],N.prototype,"_loading",2),d([p()],N.prototype,"_error",2),d([p()],N.prototype,"_name",2),d([p()],N.prototype,"_manufacturer",2),d([p()],N.prototype,"_model",2),d([p()],N.prototype,"_serialNumber",2),d([p()],N.prototype,"_areaId",2),d([p()],N.prototype,"_installationDate",2),d([p()],N.prototype,"_warrantyExpiry",2),d([p()],N.prototype,"_documentationUrl",2),d([p()],N.prototype,"_notes",2),d([p()],N.prototype,"_haDeviceId",2),d([p()],N.prototype,"_parentEntryId",2),d([p()],N.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",N)});var hi,Mr,zr,Fr=w(()=>{"use strict";hi=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],Mr=["sensor"],zr=["temperature","humidity","pressure"]});async function ui(s,r,e={}){e.busy?.(!0);try{return await s.hass.connection.sendMessagePromise(r)}catch(t){let i=P(s.hass);e.onError?.(R(t,i,e.fallbackKey?n(e.fallbackKey,i):void 0));return}finally{e.busy?.(!1)}}var Ur=w(()=>{"use strict";ie();C()});function Nn(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function Hn(s){return{entityIds:(s.entity_ids||(s.entity_id?[s.entity_id]:[])).join(", "),type:s.type||"threshold",attribute:s.attribute||"",above:s.trigger_above?.toString()??"",below:s.trigger_below?.toString()??"",equals:s.trigger_equals?.toString()??"",notEquals:s.trigger_not_equals?.toString()??"",forMinutes:s.trigger_for_minutes?.toString()??"0",targetValue:s.trigger_target_value?.toString()??"",deltaMode:s.trigger_delta_mode||!1,fromState:s.trigger_from_state||"",toState:s.trigger_to_state||"",targetChanges:s.trigger_target_changes?.toString()??"",runtimeHours:s.trigger_runtime_hours?.toString()??"",onStates:(s.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(s).filter(([e])=>!jn.has(e)&&!e.startsWith("_")))}}function On(s){let r=s.entityIds.split(",").map(t=>t.trim()).filter(Boolean);if(r.length===0)return null;let e={...s.carry||{},entity_id:r[0],entity_ids:r,type:s.type};if(s.attribute&&(e.attribute=s.attribute),s.type==="threshold"){let t=parseFloat(s.above);isNaN(t)||(e.trigger_above=t);let i=parseFloat(s.below);isNaN(i)||(e.trigger_below=i);let a=parseFloat(s.equals);isNaN(a)||(e.trigger_equals=a);let l=parseFloat(s.notEquals);isNaN(l)||(e.trigger_not_equals=l);let u=parseInt(s.forMinutes,10);isNaN(u)||(e.trigger_for_minutes=u)}else if(s.type==="counter"){let t=parseFloat(s.targetValue);isNaN(t)||(e.trigger_target_value=t),e.trigger_delta_mode=s.deltaMode}else if(s.type==="state_change"){s.fromState&&(e.trigger_from_state=s.fromState),s.toState&&(e.trigger_to_state=s.toState);let t=parseInt(s.targetChanges,10);isNaN(t)||(e.trigger_target_changes=t)}else if(s.type==="runtime"){let t=parseFloat(s.runtimeHours);isNaN(t)||(e.trigger_runtime_hours=t);let i=(s.onStates||"").split(",").map(a=>a.trim()).filter(Boolean);i.length>0&&(e.trigger_on_states=i)}return e}function qn(s){return Array.from({length:7},(r,e)=>Ge(e,s,"short"))}function Dn(s){return Array.from({length:12},(r,e)=>mr(e,s,"short"))}var In,Rn,Pn,Et,Br,Vr,Ln,re,jn,f,_i,Wr=w(()=>{"use strict";I();q();C();ei();vt();ye();Fr();ie();Ur();ri();pi();Le();In=["cleaning","inspection","replacement","calibration","service","reading","custom"],Rn=["low","normal","high"],Pn=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],Et=["weekdays","nth_weekday","day_of_month"],Br=["time_based","one_time",...Et],Vr=["threshold","counter","state_change","runtime"],Ln=[...Vr,"compound"],re={alpha:"0.3",min:"7",max:"365"};jn=new Set(["entity_id","entity_ids","type","attribute","trigger_above","trigger_below","trigger_equals","trigger_not_equals","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);f=class f extends E{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._entityPickerFallback=!1;this._pickerProbeStrikes=0;this._loading=!1;this._error="";this._warning="";this._entryId="";this._taskId=null;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this._domLastDay=!1;this._
Line truncated
|
||||
`,d([v({attribute:!1})],N.prototype,"hass",2),d([v({attribute:!1})],N.prototype,"objects",2),d([p()],N.prototype,"_open",2),d([p()],N.prototype,"_loading",2),d([p()],N.prototype,"_error",2),d([p()],N.prototype,"_name",2),d([p()],N.prototype,"_manufacturer",2),d([p()],N.prototype,"_model",2),d([p()],N.prototype,"_serialNumber",2),d([p()],N.prototype,"_areaId",2),d([p()],N.prototype,"_installationDate",2),d([p()],N.prototype,"_warrantyExpiry",2),d([p()],N.prototype,"_documentationUrl",2),d([p()],N.prototype,"_notes",2),d([p()],N.prototype,"_haDeviceId",2),d([p()],N.prototype,"_parentEntryId",2),d([p()],N.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",N)});var hi,Mr,zr,Fr=w(()=>{"use strict";hi=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],Mr=["sensor"],zr=["temperature","humidity","pressure"]});async function ui(s,r,e={}){e.busy?.(!0);try{return await s.hass.connection.sendMessagePromise(r)}catch(t){let i=P(s.hass);e.onError?.(R(t,i,e.fallbackKey?n(e.fallbackKey,i):void 0));return}finally{e.busy?.(!1)}}var Ur=w(()=>{"use strict";ie();C()});function Nn(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function Hn(s){return{entityIds:(s.entity_ids||(s.entity_id?[s.entity_id]:[])).join(", "),type:s.type||"threshold",attribute:s.attribute||"",above:s.trigger_above?.toString()??"",below:s.trigger_below?.toString()??"",equals:s.trigger_equals?.toString()??"",notEquals:s.trigger_not_equals?.toString()??"",forMinutes:s.trigger_for_minutes?.toString()??"0",targetValue:s.trigger_target_value?.toString()??"",deltaMode:s.trigger_delta_mode||!1,fromState:s.trigger_from_state||"",toState:s.trigger_to_state||"",targetChanges:s.trigger_target_changes?.toString()??"",runtimeHours:s.trigger_runtime_hours?.toString()??"",onStates:(s.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(s).filter(([e])=>!jn.has(e)&&!e.startsWith("_")))}}function On(s){let r=s.entityIds.split(",").map(t=>t.trim()).filter(Boolean);if(r.length===0)return null;let e={...s.carry||{},entity_id:r[0],entity_ids:r,type:s.type};if(s.attribute&&(e.attribute=s.attribute),s.type==="threshold"){let t=parseFloat(s.above);isNaN(t)||(e.trigger_above=t);let i=parseFloat(s.below);isNaN(i)||(e.trigger_below=i);let a=parseFloat(s.equals);isNaN(a)||(e.trigger_equals=a);let l=parseFloat(s.notEquals);isNaN(l)||(e.trigger_not_equals=l);let u=parseInt(s.forMinutes,10);isNaN(u)||(e.trigger_for_minutes=u)}else if(s.type==="counter"){let t=parseFloat(s.targetValue);isNaN(t)||(e.trigger_target_value=t),e.trigger_delta_mode=s.deltaMode}else if(s.type==="state_change"){s.fromState&&(e.trigger_from_state=s.fromState),s.toState&&(e.trigger_to_state=s.toState);let t=parseInt(s.targetChanges,10);isNaN(t)||(e.trigger_target_changes=t)}else if(s.type==="runtime"){let t=parseFloat(s.runtimeHours);isNaN(t)||(e.trigger_runtime_hours=t);let i=(s.onStates||"").split(",").map(a=>a.trim()).filter(Boolean);i.length>0&&(e.trigger_on_states=i)}return e}function qn(s){return Array.from({length:7},(r,e)=>Ge(e,s,"short"))}function Dn(s){return Array.from({length:12},(r,e)=>mr(e,s,"short"))}var In,Rn,Pn,Et,Br,Vr,Ln,se,jn,f,_i,Wr=w(()=>{"use strict";I();q();C();ei();vt();ye();Fr();ie();Ur();ri();pi();Le();In=["cleaning","inspection","replacement","calibration","service","reading","custom"],Rn=["low","normal","high"],Pn=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],Et=["weekdays","nth_weekday","day_of_month"],Br=["time_based","one_time",...Et],Vr=["threshold","counter","state_change","runtime"],Ln=[...Vr,"compound"],se={alpha:"0.3",min:"7",max:"365"};jn=new Set(["entity_id","entity_ids","type","attribute","trigger_above","trigger_below","trigger_equals","trigger_not_equals","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);f=class f extends E{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._entityPickerFallback=!1;this._pickerProbeStrikes=0;this._loading=!1;this._error="";this._warning="";this._entryId="";this._taskId=null;this._isFleetTask=!1;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this.
Line truncated
|
||||
`),this._phaseDefs=Object.entries(t.phases||{}).map(([_,m])=>{let{name:b,checklist:y,consumes_parts:x,required_completion_fields:g,...$}=m,z=m.consumes_parts||[],L=z.findIndex(H=>!H.entry_id),A=L>=0?z[L]:void 0;return{id:_,name:m.name||_,checklistText:(m.checklist||[]).join(`
|
||||
`),partId:A?.part_id||"",partQty:A?.quantity!=null?String(A.quantity):"",reqOverride:m.required_completion_fields!==void 0,reqFields:[...m.required_completion_fields||[]],extraParts:z.filter((H,we)=>we!==L).map(H=>({...H})),carry:$}}),this._phaseSeq=[...t.phase_sequence||[]],this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"",this._scheduleTimeOn=!!t.schedule_time;let l=t.on_complete_action;if(l&&l.service){this._actionService=l.service;let _=l.target?.entity_id;this._actionTargetEntity=Array.isArray(_)?_[0]||"":_||"",this._actionData=l.data&&typeof l.data=="object"?{...l.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let u=t.quick_complete_defaults;this._qcNotes=u?.notes||"",this._qcCost=u?.cost!=null?String(u.cost):"",this._qcDuration=u?.duration!=null?String(u.duration):"",this._qcFeedback=u?.feedback||"";let h=t.adaptive_config||{};if(this._environmentalEntity=h.environmental_entity||"",this._environmentalAttribute=h.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!h.enabled,this._adaptiveAlpha=h.ewa_alpha?.toString()??re.alpha,this._adaptiveMin=h.min_interval_days?.toString()??re.min,this._adaptiveMax=h.max_interval_days?.toString()??re.max,this._adaptiveSeasonal=h.seasonal_enabled!==!1,this._adaptivePrediction=h.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),t.trigger_config){let _=t.trigger_config;this._triggerEntityId=_.entity_id||_.entity_ids&&_.entity_ids[0]||"",this._triggerEntityIds=_.entity_ids||(_.entity_id?[_.entity_id]:[]),this._triggerEntityLogic=_.entity_logic||"any",this._triggerAttribute=_.attribute||"",this._triggerType=_.type||"threshold",this._triggerAbove=_.trigger_above?.toString()||"",this._triggerBelow=_.trigger_below?.toString()||"",this._triggerEquals=_.trigger_equals?.toString()||"",this._triggerNotEquals=_.trigger_not_equals?.toString()||"",this._triggerForMinutes=_.trigger_for_minutes?.toString()||"0",this._triggerCombinator=_.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=_.trigger_target_value?.toString()||"",this._triggerDeltaMode=_.trigger_delta_mode||!1,this._triggerBaselineValue=_.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=_.auto_complete_on_recovery||!1,this._triggerFromState=_.trigger_from_state||"",this._triggerToState=_.trigger_to_state||"",this._triggerTargetChanges=_.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=_.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=_.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(_.trigger_on_states||[]).join(", "),_.type==="compound"?(this._compoundLogic=_.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(_.conditions||[]).map(Hn)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._mirrorTodoEntities=[],this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=re.alpha,this._adaptiveMin=re.min,this._adaptiveMax=re.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute=
Line truncated
|
||||
`),partId:A?.part_id||"",partQty:A?.quantity!=null?String(A.quantity):"",reqOverride:m.required_completion_fields!==void 0,reqFields:[...m.required_completion_fields||[]],extraParts:z.filter((H,we)=>we!==L).map(H=>({...H})),carry:$}}),this._phaseSeq=[...t.phase_sequence||[]],this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"",this._scheduleTimeOn=!!t.schedule_time;let l=t.on_complete_action;if(l&&l.service){this._actionService=l.service;let _=l.target?.entity_id;this._actionTargetEntity=Array.isArray(_)?_[0]||"":_||"",this._actionData=l.data&&typeof l.data=="object"?{...l.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let u=t.quick_complete_defaults;this._qcNotes=u?.notes||"",this._qcCost=u?.cost!=null?String(u.cost):"",this._qcDuration=u?.duration!=null?String(u.duration):"",this._qcFeedback=u?.feedback||"";let h=t.adaptive_config||{};if(this._environmentalEntity=h.environmental_entity||"",this._environmentalAttribute=h.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!h.enabled,this._adaptiveAlpha=h.ewa_alpha?.toString()??se.alpha,this._adaptiveMin=h.min_interval_days?.toString()??se.min,this._adaptiveMax=h.max_interval_days?.toString()??se.max,this._adaptiveSeasonal=h.seasonal_enabled!==!1,this._adaptivePrediction=h.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),t.trigger_config){let _=t.trigger_config;this._triggerEntityId=_.entity_id||_.entity_ids&&_.entity_ids[0]||"",this._triggerEntityIds=_.entity_ids||(_.entity_id?[_.entity_id]:[]),this._triggerEntityLogic=_.entity_logic||"any",this._triggerAttribute=_.attribute||"",this._triggerType=_.type||"threshold",this._triggerAbove=_.trigger_above?.toString()||"",this._triggerBelow=_.trigger_below?.toString()||"",this._triggerEquals=_.trigger_equals?.toString()||"",this._triggerNotEquals=_.trigger_not_equals?.toString()||"",this._triggerForMinutes=_.trigger_for_minutes?.toString()||"0",this._triggerCombinator=_.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=_.trigger_target_value?.toString()||"",this._triggerDeltaMode=_.trigger_delta_mode||!1,this._triggerBaselineValue=_.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=_.auto_complete_on_recovery||!1,this._triggerFromState=_.trigger_from_state||"",this._triggerToState=_.trigger_to_state||"",this._triggerTargetChanges=_.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=_.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=_.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(_.trigger_on_states||[]).join(", "),_.type==="compound"?(this._compoundLogic=_.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(_.conditions||[]).map(Hn)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._mirrorTodoEntities=[],this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=se.alpha,this._adaptiveMin=se.min,this._adaptiveMax=se.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute=
Line truncated
|
||||
<details class="ca-section">
|
||||
<summary>${n("on_complete_action_title",e)}</summary>
|
||||
<p class="field-help">${n("on_complete_action_desc",e)}</p>
|
||||
@@ -2723,7 +2725,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
${this._renderReadingsEditor(e)}
|
||||
`:c}
|
||||
${this._partsLoadFailed?o`<div class="field-help parts-load-failed">${n("parts_load_failed",e)}</div>`:c}
|
||||
${this.parts.length||this._foreignOwners.length?o`
|
||||
${this._isFleetTask?o`<div class="field-help parts-fleet-hint">${n("task_parts_fleet_hint",e)}</div>`:this.parts.length||this._foreignOwners.length?o`
|
||||
<div class="field">
|
||||
<label>${n("consumes_parts_label",e)}</label>
|
||||
${this.parts.map(i=>this._renderConsumesRow(i))}
|
||||
@@ -3434,7 +3436,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
`,d([v({attribute:!1})],f.prototype,"hass",2),d([v({type:Boolean,attribute:"checklists-enabled"})],f.prototype,"checklistsEnabled",2),d([v({type:Boolean,attribute:"schedule-time-enabled"})],f.prototype,"scheduleTimeEnabled",2),d([v({type:Boolean,attribute:"completion-actions-enabled"})],f.prototype,"completionActionsEnabled",2),d([v({type:Number,attribute:"default-warning-days"})],f.prototype,"defaultWarningDays",2),d([p()],f.prototype,"parts",2),d([p()],f.prototype,"_foreignOwners",2),d([p()],f.prototype,"_open",2),d([p()],f.prototype,"_entityPickerFallback",2),d([p()],f.prototype,"_loading",2),d([p()],f.prototype,"_error",2),d([p()],f.prototype,"_warning",2),d([p()],f.prototype,"_entryId",2),d([p()],f.prototype,"_taskId",2),d([p()],f.prototype,"_objectChoices",2),d([p()],f.prototype,"_name",2),d([p()],f.prototype,"_type",2),d([p()],f.prototype,"_scheduleType",2),d([p()],f.prototype,"_intervalDays",2),d([p()],f.prototype,"_intervalUnit",2),d([p()],f.prototype,"_dueDate",2),d([p()],f.prototype,"_warningDays",2),d([p()],f.prototype,"_earliestCompletionDays",2),d([p()],f.prototype,"_intervalAnchor",2),d([p()],f.prototype,"_weekdays",2),d([p()],f.prototype,"_nth",2),d([p()],f.prototype,"_nthWeekday",2),d([p()],f.prototype,"_domDay",2),d([p()],f.prototype,"_domLastDay",2),d([p()],f.prototype,"_domBusiness",2),d([p()],f.prototype,"_calOffset",2),d([p()],f.prototype,"_seasonMonths",2),d([p()],f.prototype,"_endsMode",2),d([p()],f.prototype,"_endsCount",2),d([p()],f.prototype,"_endsUntil",2),d([p()],f.prototype,"_schedulePreview",2),d([p()],f.prototype,"_schedulePreviewEnded",2),d([p()],f.prototype,"_notes",2),d([p()],f.prototype,"_documentationUrl",2),d([p()],f.prototype,"_customIcon",2),d([p()],f.prototype,"_priority",2),d([p()],f.prototype,"_labels",2),d([p()],f.prototype,"_mirrorTodoEntities",2),d([p()],f.prototype,"_enabled",2),d([p()],f.prototype,"_triggerEntityId",2),d([p()],f.prototype,"_triggerEntityIds",2),d([p()],f.prototype,"_triggerEntityLogic",2),d([p()],f.prototype,"_triggerAttribute",2),d([p()],f.prototype,"_triggerType",2),d([p()],f.prototype,"_triggerAbove",2),d([p()],f.prototype,"_triggerBelow",2),d([p()],f.prototype,"_triggerEquals",2),d([p()],f.prototype,"_triggerNotEquals",2),d([p()],f.prototype,"_triggerForMinutes",2),d([p()],f.prototype,"_triggerCombinator",2),d([p()],f.prototype,"_triggerTargetValue",2),d([p()],f.prototype,"_triggerDeltaMode",2),d([p()],f.prototype,"_triggerBaselineValue",2),d([p()],f.prototype,"_liveBaselineValue",2),d([p()],f.prototype,"_autoCompleteOnRecovery",2),d([p()],f.prototype,"_triggerFromState",2),d([p()],f.prototype,"_triggerToState",2),d([p()],f.prototype,"_triggerTargetChanges",2),d([p()],f.prototype,"_triggerRuntimeHours",2),d([p()],f.prototype,"_triggerRuntimeMaxSession",2),d([p()],f.prototype,"_triggerOnStates",2),d([p()],f.prototype,"_compoundLogic",2),d([p()],f.prototype,"_compoundConditions",2),d([p()],f.prototype,"_suggestedAttributes",2),d([p()],f.prototype,"_availableAttributes",2),d([p()],f.prototype,"_entityDomain",2),d([p()],f.prototype,"_lastPerformed",2),d([p()],f.prototype,"_nfcTagId",2),d([p()],f.prototype,"_requireTagScan",2),d([p()],f.prototype,"_allowSkip",2),d([p()],f.prototype,"_notifyEnabled",2),d([p()],f.prototype,"_readingUnit",2),d([p()],f.prototype,"_readings",2),d([p()],f.prototype,"_consumesParts",2),d([p()],f.prototype,"_partsLoadFailed",2),d([p()],f.prototype,"_availableTags",2),d([p()],f.prototype,"_responsibleUserId",2),d([p()],f.prototype,"_assigneePool",2),d([p()],f.prototype,"_rotationStrategy",2),d([p()],f.prototype,"_availableUsers",2),d([p()],f.prototype,"_checklistText",2),d([p()],f.prototype,"_phaseDefs",2),d([p()],f.prototype,"_phaseSeq",2),d([p()],f.prototype,"_requiredCompletion",2),d([p()],f.prototype,"_scheduleTime",2),d([p()],f.prototype,"_scheduleTimeOn",2),d([p()],f.prototype,"_actionService",2),d([p()],f.prototype,"_actionTargetEntity",2),d([p()],f.prototype,"_actionData",2),d([p()],f.prototype,"_actionDataJsonFallback",2),d([p()],f.prototype,"_actionTesting",2),d([p()],f.prototype,"_actionTestResult",2),d([p()],f.prototype,"_actionTestError",2),d([p()],f.prototype,"_qcNotes",2),d([p()],f.prototype,"_qcCost",2),d([p()],f.prototype,"_qcDuration",2),d([p()],f.prototype,"_qcFeedback",2),d([p()],f.prototype,"_environmentalEntity",2),d([p()],f.prototype,"_environmentalAttribute",2),d([p()],f.prototype,"_adaptiveEnabled",2),d([p()],f.prototype,"_adaptiveAlpha",2),d([p()],f.prototype,"_adaptiveMin",2),d([p()],f.prototype,"_adaptiveMax",2),d([p()],f.prototype,"_adaptiveSeasonal",2),d([p()],f.prototype,"_adaptivePrediction",2),d([p()],f.prototype,"_conditionAttrOptions",2);_i=f;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",_i)});var ue,mi=w(()=>{"use strict";I();q();Qt();ue=class extends E{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!==this.docId&&(this._signedFor=this.do
Line truncated
|
||||
`,d([v({attribute:!1})],f.prototype,"hass",2),d([v({type:Boolean,attribute:"checklists-enabled"})],f.prototype,"checklistsEnabled",2),d([v({type:Boolean,attribute:"schedule-time-enabled"})],f.prototype,"scheduleTimeEnabled",2),d([v({type:Boolean,attribute:"completion-actions-enabled"})],f.prototype,"completionActionsEnabled",2),d([v({type:Number,attribute:"default-warning-days"})],f.prototype,"defaultWarningDays",2),d([p()],f.prototype,"parts",2),d([p()],f.prototype,"_foreignOwners",2),d([p()],f.prototype,"_open",2),d([p()],f.prototype,"_entityPickerFallback",2),d([p()],f.prototype,"_loading",2),d([p()],f.prototype,"_error",2),d([p()],f.prototype,"_warning",2),d([p()],f.prototype,"_entryId",2),d([p()],f.prototype,"_taskId",2),d([p()],f.prototype,"_isFleetTask",2),d([p()],f.prototype,"_objectChoices",2),d([p()],f.prototype,"_name",2),d([p()],f.prototype,"_type",2),d([p()],f.prototype,"_scheduleType",2),d([p()],f.prototype,"_intervalDays",2),d([p()],f.prototype,"_intervalUnit",2),d([p()],f.prototype,"_dueDate",2),d([p()],f.prototype,"_warningDays",2),d([p()],f.prototype,"_earliestCompletionDays",2),d([p()],f.prototype,"_intervalAnchor",2),d([p()],f.prototype,"_weekdays",2),d([p()],f.prototype,"_nth",2),d([p()],f.prototype,"_nthWeekday",2),d([p()],f.prototype,"_domDay",2),d([p()],f.prototype,"_domLastDay",2),d([p()],f.prototype,"_domBusiness",2),d([p()],f.prototype,"_calOffset",2),d([p()],f.prototype,"_seasonMonths",2),d([p()],f.prototype,"_endsMode",2),d([p()],f.prototype,"_endsCount",2),d([p()],f.prototype,"_endsUntil",2),d([p()],f.prototype,"_schedulePreview",2),d([p()],f.prototype,"_schedulePreviewEnded",2),d([p()],f.prototype,"_notes",2),d([p()],f.prototype,"_documentationUrl",2),d([p()],f.prototype,"_customIcon",2),d([p()],f.prototype,"_priority",2),d([p()],f.prototype,"_labels",2),d([p()],f.prototype,"_mirrorTodoEntities",2),d([p()],f.prototype,"_enabled",2),d([p()],f.prototype,"_triggerEntityId",2),d([p()],f.prototype,"_triggerEntityIds",2),d([p()],f.prototype,"_triggerEntityLogic",2),d([p()],f.prototype,"_triggerAttribute",2),d([p()],f.prototype,"_triggerType",2),d([p()],f.prototype,"_triggerAbove",2),d([p()],f.prototype,"_triggerBelow",2),d([p()],f.prototype,"_triggerEquals",2),d([p()],f.prototype,"_triggerNotEquals",2),d([p()],f.prototype,"_triggerForMinutes",2),d([p()],f.prototype,"_triggerCombinator",2),d([p()],f.prototype,"_triggerTargetValue",2),d([p()],f.prototype,"_triggerDeltaMode",2),d([p()],f.prototype,"_triggerBaselineValue",2),d([p()],f.prototype,"_liveBaselineValue",2),d([p()],f.prototype,"_autoCompleteOnRecovery",2),d([p()],f.prototype,"_triggerFromState",2),d([p()],f.prototype,"_triggerToState",2),d([p()],f.prototype,"_triggerTargetChanges",2),d([p()],f.prototype,"_triggerRuntimeHours",2),d([p()],f.prototype,"_triggerRuntimeMaxSession",2),d([p()],f.prototype,"_triggerOnStates",2),d([p()],f.prototype,"_compoundLogic",2),d([p()],f.prototype,"_compoundConditions",2),d([p()],f.prototype,"_suggestedAttributes",2),d([p()],f.prototype,"_availableAttributes",2),d([p()],f.prototype,"_entityDomain",2),d([p()],f.prototype,"_lastPerformed",2),d([p()],f.prototype,"_nfcTagId",2),d([p()],f.prototype,"_requireTagScan",2),d([p()],f.prototype,"_allowSkip",2),d([p()],f.prototype,"_notifyEnabled",2),d([p()],f.prototype,"_readingUnit",2),d([p()],f.prototype,"_readings",2),d([p()],f.prototype,"_consumesParts",2),d([p()],f.prototype,"_partsLoadFailed",2),d([p()],f.prototype,"_availableTags",2),d([p()],f.prototype,"_responsibleUserId",2),d([p()],f.prototype,"_assigneePool",2),d([p()],f.prototype,"_rotationStrategy",2),d([p()],f.prototype,"_availableUsers",2),d([p()],f.prototype,"_checklistText",2),d([p()],f.prototype,"_phaseDefs",2),d([p()],f.prototype,"_phaseSeq",2),d([p()],f.prototype,"_requiredCompletion",2),d([p()],f.prototype,"_scheduleTime",2),d([p()],f.prototype,"_scheduleTimeOn",2),d([p()],f.prototype,"_actionService",2),d([p()],f.prototype,"_actionTargetEntity",2),d([p()],f.prototype,"_actionData",2),d([p()],f.prototype,"_actionDataJsonFallback",2),d([p()],f.prototype,"_actionTesting",2),d([p()],f.prototype,"_actionTestResult",2),d([p()],f.prototype,"_actionTestError",2),d([p()],f.prototype,"_qcNotes",2),d([p()],f.prototype,"_qcCost",2),d([p()],f.prototype,"_qcDuration",2),d([p()],f.prototype,"_qcFeedback",2),d([p()],f.prototype,"_environmentalEntity",2),d([p()],f.prototype,"_environmentalAttribute",2),d([p()],f.prototype,"_adaptiveEnabled",2),d([p()],f.prototype,"_adaptiveAlpha",2),d([p()],f.prototype,"_adaptiveMin",2),d([p()],f.prototype,"_adaptiveMax",2),d([p()],f.prototype,"_adaptiveSeasonal",2),d([p()],f.prototype,"_adaptivePrediction",2),d([p()],f.prototype,"_conditionAttrOptions",2);_i=f;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",_i)});var ue,mi=w(()=>{"use strict";I();q();Qt();ue=class extends E{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!
Line truncated
|
||||
<a href=${this._url} target="_blank" rel="noopener" class="wrap">
|
||||
<img src=${this._url} alt="" loading="lazy"
|
||||
@error=${()=>this._failed=!0} />
|
||||
@@ -3877,9 +3879,9 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
color: var(--text-primary-color, #fff);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
`,d([v({attribute:!1})],K.prototype,"hass",2),d([v()],K.prototype,"lang",2),d([p()],K.prototype,"_open",2),d([p()],K.prototype,"_loading",2),d([p()],K.prototype,"_error",2),d([p()],K.prototype,"_viewResult",2),d([p()],K.prototype,"_completeResult",2),d([p()],K.prototype,"_urlMode",2);customElements.get("maintenance-qr-dialog")||customElements.define("maintenance-qr-dialog",K)});var Qr=w(()=>{"use strict"});function Jr(s){let r=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),t=String(s.getDate()).padStart(2,"0");return`${r}-${e}-${t}`}var Zr=w(()=>{"use strict";Qr()});function Xr(s,r,e,t){let i=e,a=h=>typeof h=="string"?h:null,l=h=>typeof h=="number"?h:null,u=a(i.timestamp)??"";return{entry_id:s,task_id:r,original_timestamp:u,type:a(i.type)||"completed",timestamp:u,notes:a(i.notes),cost:l(i.cost),duration:l(i.duration),completed_by:a(i.completed_by),used_parts:Array.isArray(i.used_parts)?i.used_parts:null,photo_doc_ids:yt(i),reading_value:l(i.reading_value),reading_values:ce(i),readings:t?.readings??[],task_type:t?.type??null,reading_unit:t?.reading_unit??null}}var es=w(()=>{"use strict";xt();ye()});function zn(s){return s&&ts(s.ref_no)?String(s.ref_no):null}function is(s,r){let e=zn(s);return e&&r&&ts(r.ref_no)?`${e}.${r.ref_no}`:null}function rs(s,r){return s?o`<span class="ref-chip" title=${r??""}>#${s}</span>`:c}var ts,gi=w(()=>{"use strict";I();ts=s=>typeof s=="number"&&Number.isInteger(s)&&s>0});var ss=w(()=>{"use strict"});function Un(s,r){return s.taskRef&&r.ref_no?`${s.taskRef}-${r.ref_no}`:null}function Bn(s,r){let e=yt(r);return e.length>0?o`<div class="history-photos">
|
||||
`,d([v({attribute:!1})],K.prototype,"hass",2),d([v()],K.prototype,"lang",2),d([p()],K.prototype,"_open",2),d([p()],K.prototype,"_loading",2),d([p()],K.prototype,"_error",2),d([p()],K.prototype,"_viewResult",2),d([p()],K.prototype,"_completeResult",2),d([p()],K.prototype,"_urlMode",2);customElements.get("maintenance-qr-dialog")||customElements.define("maintenance-qr-dialog",K)});var Qr=w(()=>{"use strict"});function Jr(s){let r=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),t=String(s.getDate()).padStart(2,"0");return`${r}-${e}-${t}`}var Zr=w(()=>{"use strict";Qr()});function Xr(s,r,e,t){let i=e,a=h=>typeof h=="string"?h:null,l=h=>typeof h=="number"?h:null,u=a(i.timestamp)??"";return{entry_id:s,task_id:r,original_timestamp:u,type:a(i.type)||"completed",timestamp:u,notes:a(i.notes),cost:l(i.cost),duration:l(i.duration),completed_by:a(i.completed_by),used_parts:Array.isArray(i.used_parts)?i.used_parts:null,photo_doc_ids:yt(i),reading_value:l(i.reading_value),reading_values:pe(i),readings:t?.readings??[],task_type:t?.type??null,reading_unit:t?.reading_unit??null}}var es=w(()=>{"use strict";xt();ye()});function zn(s){return s&&ts(s.ref_no)?String(s.ref_no):null}function is(s,r){let e=zn(s);return e&&r&&ts(r.ref_no)?`${e}.${r.ref_no}`:null}function rs(s,r){return s?o`<span class="ref-chip" title=${r??""}>#${s}</span>`:c}var ts,gi=w(()=>{"use strict";I();ts=s=>typeof s=="number"&&Number.isInteger(s)&&s>0});var ss=w(()=>{"use strict"});function Un(s,r){return s.taskRef&&r.ref_no?`${s.taskRef}-${r.ref_no}`:null}function Bn(s,r){let e=yt(r);return e.length>0?o`<div class="history-photos">
|
||||
${e.map(t=>o`<maintenance-history-photo .hass=${s} .docId=${t}></maintenance-history-photo>`)}
|
||||
</div>`:c}function Vn(s,r){let e=r.lang,t=l=>O(l,e,{maximumFractionDigits:3}),i=l=>l==null?"":` (${l>=0?"+":""}${t(l)})`,a=ce(s);return a.length>0?o`<div class="history-readings">
|
||||
</div>`:c}function Vn(s,r){let e=r.lang,t=l=>O(l,e,{maximumFractionDigits:3}),i=l=>l==null?"":` (${l>=0?"+":""}${t(l)})`,a=pe(s);return a.length>0?o`<div class="history-readings">
|
||||
${a.map(l=>o`<span class="history-reading">
|
||||
<span class="history-reading-name">${l.name}</span>
|
||||
<span class="history-reading-value">${t(l.value)}${l.unit?` ${l.unit}`:""}${i(r.readingSlotDelta?.(s,l.id))}</span>
|
||||
@@ -4098,7 +4100,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
${us.map((g,$)=>o`<span class="seasonal-label ${$===i?"active-month":""}">${n(g,r)}</span>`)}
|
||||
</div>
|
||||
</div>
|
||||
`}var us,gs=w(()=>{"use strict";I();C();kt();us=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"]});var j,fs=w(()=>{"use strict";I();q();C();ie();Zr();bt();ft();es();ye();gi();as();ls();cs();hs();Le();gs();j=class extends E{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._taskRef=null;this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return P(this.hass)}async openFor(e,t){this._entryId=e,this._taskId=t,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=Jr(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});e?.features&&(this._features={...this._features,...e.features}),this._currencySymbol=le(e?.budget),ht(e?.budget),this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=e.object?.name||"";let t=(e.tasks||[]).find(i=>i.id===this._taskId);this._task=t??null,this._taskRef=is(e.object,t)}catch(e){this._error=R(e,this._lang)}}async _runWs(e){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(e),this._busy=!1,!0}catch(t){return this._error=R(t,this._lang),this._busy=!1,!1}}_notifyChanged(e){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:e},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),se)).then(async({openCompleteDialog:e})=>{let t=this._task,i=[];try{i=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}e(Ze({entryId:this._entryId,taskId:this._taskId,taskName:t.name,task:t,objects:i,lang:this._lang,checklist:t.checklist||[],adaptiveEnabled:!!t.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||Promise.resolve().then(()=>(Z(),se)).then(({openEditTaskDialog:e})=>{e(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),se)).then(({openQrDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let e=n("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(e))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let e=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=n("suggestion_applied",this._lang),this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){i
Line truncated
|
||||
`}var us,gs=w(()=>{"use strict";I();C();kt();us=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"]});var j,fs=w(()=>{"use strict";I();q();C();ie();Zr();bt();ft();es();ye();gi();as();ls();cs();hs();Le();gs();j=class extends E{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._taskRef=null;this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1;this._currencySymbol=""}get _lang(){return P(this.hass)}async openFor(e,t){this._entryId=e,this._taskId=t,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=Jr(new Date),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});e?.features&&(this._features={...this._features,...e.features}),this._currencySymbol=de(e?.budget),ht(e?.budget),this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=e.object?.name||"";let t=(e.tasks||[]).find(i=>i.id===this._taskId);this._task=t??null,this._taskRef=is(e.object,t)}catch(e){this._error=R(e,this._lang)}}async _runWs(e){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(e),this._busy=!1,!0}catch(t){return this._error=R(t,this._lang),this._busy=!1,!1}}_notifyChanged(e){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:e},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),ne)).then(async({openCompleteDialog:e})=>{let t=this._task,i=[];try{i=(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects",compact:!0})).objects||[]}catch{}e(Ze({entryId:this._entryId,taskId:this._taskId,taskName:t.name,task:t,objects:i,lang:this._lang,checklist:t.checklist||[],adaptiveEnabled:!!t.adaptive_config?.enabled,currencySymbol:this._currencySymbol}))&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||Promise.resolve().then(()=>(Z(),ne)).then(({openEditTaskDialog:e})=>{e(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(Z(),ne)).then(({openQrDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let e=n("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(e))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let e=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=n("suggestion_applied",this._lang),this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){i
Line truncated
|
||||
<div class="recommendation-card">
|
||||
<h4>${n("suggested_interval",t)}</h4>
|
||||
${ps(e.interval_days,e.suggested_interval,e.interval_confidence||"medium",t)}
|
||||
@@ -4165,13 +4167,13 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
<span class="task-name">${t.name}</span>
|
||||
</div>
|
||||
<div class="object">
|
||||
<button class="link-inline" @click=${()=>{this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openObjectQuickActions:a})=>{a(this._entryId),this.close()})}}>${this._objectName}</button>
|
||||
<button class="link-inline" @click=${()=>{this._entryId&&Promise.resolve().then(()=>(Z(),ne)).then(({openObjectQuickActions:a})=>{a(this._entryId),this.close()})}}>${this._objectName}</button>
|
||||
</div>
|
||||
<div class="quick-info">
|
||||
${t.next_due?o`<span><strong>${n("next_due",e)}:</strong> ${F(t.next_due,e)}</span>`:c}
|
||||
${t.last_performed?o`<span><strong>${n("last_performed",e)}:</strong> ${F(t.last_performed,e)}</span>`:c}
|
||||
${t.schedule?.kind&&!["manual","one_time"].includes(t.schedule.kind)||t.interval_days!=null?o`<span><strong>${n("interval",e)}:</strong> ${gr(t,e)}</span>`:c}
|
||||
${de(t)?o`<span><strong>${n("phase_current",e)}:</strong> ${de(t)}</span>`:c}
|
||||
${ce(t)?o`<span><strong>${n("phase_current",e)}:</strong> ${ce(t)}</span>`:c}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4434,7 +4436,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
.weibull-section, .seasonal-card-compact { max-width: 100%; }
|
||||
.weibull-chart svg { max-width: 100%; height: auto; }
|
||||
.details-toggle { gap: 12px; flex-wrap: wrap; }
|
||||
`],d([v({attribute:!1})],j.prototype,"hass",2),d([p()],j.prototype,"_open",2),d([p()],j.prototype,"_entryId",2),d([p()],j.prototype,"_taskId",2),d([p()],j.prototype,"_task",2),d([p()],j.prototype,"_objectName",2),d([p()],j.prototype,"_taskRef",2),d([p()],j.prototype,"_busy",2),d([p()],j.prototype,"_error",2),d([p()],j.prototype,"_showSkip",2),d([p()],j.prototype,"_showReset",2),d([p()],j.prototype,"_showDetails",2),d([p()],j.prototype,"_showAdaptive",2),d([p()],j.prototype,"_skipReason",2),d([p()],j.prototype,"_resetDate",2),d([p()],j.prototype,"_features",2),d([p()],j.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",j)});function vs(s){return s?customElements.get("ha-markdown")?o`<ha-markdown class="notes-md" .content=${s} breaks></ha-markdown>`:o`${s}`:c}var bs=w(()=>{"use strict";I()});var X,ys=w(()=>{"use strict";I();Jt();bs();q();C();ie();X=class extends E{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return P(this.hass)}async openFor(e){this._entryId=e,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=e}catch(e){this._error=R(e,this._lang)}}_onEditObject(){!this._entryId||!this._data||Promise.resolve().then(()=>(Z(),se)).then(({openEditObjectDialog:e})=>{e(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openCreateTaskDialog:e})=>{e(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let e=n("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(e)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=R(t,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let e=!!this._data.object.archived;if(!e){let t=n("confirm_archive_object",this._lang);if(!window.confirm(t))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:e?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=R(t,this._lang)}finally{this._busy=!1}}_onTaskClick(e){this._entryId&&Promise.resolve().then(()=>(Z(),se)).then(({openTaskQuickActions:t})=>{t(this._entryId,e)})}render(){if(!this._open)return c;let e=this._lang,t=this._data,i=t?.object,a=t?.tasks||[],l=this.hass?.user?.is_admin??!0;return o`
|
||||
`],d([v({attribute:!1})],j.prototype,"hass",2),d([p()],j.prototype,"_open",2),d([p()],j.prototype,"_entryId",2),d([p()],j.prototype,"_taskId",2),d([p()],j.prototype,"_task",2),d([p()],j.prototype,"_objectName",2),d([p()],j.prototype,"_taskRef",2),d([p()],j.prototype,"_busy",2),d([p()],j.prototype,"_error",2),d([p()],j.prototype,"_showSkip",2),d([p()],j.prototype,"_showReset",2),d([p()],j.prototype,"_showDetails",2),d([p()],j.prototype,"_showAdaptive",2),d([p()],j.prototype,"_skipReason",2),d([p()],j.prototype,"_resetDate",2),d([p()],j.prototype,"_features",2),d([p()],j.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",j)});function vs(s){return s?customElements.get("ha-markdown")?o`<ha-markdown class="notes-md" .content=${s} breaks></ha-markdown>`:o`${s}`:c}var bs=w(()=>{"use strict";I()});var X,ys=w(()=>{"use strict";I();Jt();bs();q();C();ie();X=class extends E{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return P(this.hass)}async openFor(e){this._entryId=e,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=e}catch(e){this._error=R(e,this._lang)}}_onEditObject(){!this._entryId||!this._data||Promise.resolve().then(()=>(Z(),ne)).then(({openEditObjectDialog:e})=>{e(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&Promise.resolve().then(()=>(Z(),ne)).then(({openCreateTaskDialog:e})=>{e(this._entryId),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let e=n("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(e)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=R(t,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let e=!!this._data.object.archived;if(!e){let t=n("confirm_archive_object",this._lang);if(!window.confirm(t))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:e?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=R(t,this._lang)}finally{this._busy=!1}}_onTaskClick(e){this._entryId&&Promise.resolve().then(()=>(Z(),ne)).then(({openTaskQuickActions:t})=>{t(this._entryId,e)})}render(){if(!this._open)return c;let e=this._lang,t=this._data,i=t?.object,a=t?.tasks||[],l=this.hass?.user?.is_admin??!0;return o`
|
||||
<div class="backdrop" @click=${this.close}></div>
|
||||
<div class="dialog" role="dialog" aria-modal="true">
|
||||
${t&&i?o`
|
||||
@@ -4561,7 +4563,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
.btn ha-icon { --mdc-icon-size: 16px; }
|
||||
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
||||
.error { padding: 8px; border-radius: 6px; background: rgba(211,47,47,0.1); color: var(--error-color); font-size: 13px; }
|
||||
`,d([v({attribute:!1})],X.prototype,"hass",2),d([p()],X.prototype,"_open",2),d([p()],X.prototype,"_entryId",2),d([p()],X.prototype,"_data",2),d([p()],X.prototype,"_busy",2),d([p()],X.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",X)});function xs(){let s=window;return s.__msSettingsCache??={promise:null}}function St(s){let r=xs();if(r.promise)return r.promise;let e=s.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(t=>({features:t.features??fi.features,defaultWarningDays:t.general?.default_warning_days??7,rowActionStyle:t.general?.row_action_style??fi.rowActionStyle})).catch(()=>(r.promise===e&&(r.promise=null),fi));return r.promise=e,e}function ws(){xs().promise=null}var fi,$s=w(()=>{"use strict";fi={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"}});var se={};Ps(se,{__resetSettingsCacheForTests:()=>ra,getRowActionStyle:()=>vi,openCompleteDialog:()=>oa,openCreateObjectDialog:()=>bi,openCreateTaskDialog:()=>yi,openEditObjectDialog:()=>sa,openEditTaskDialog:()=>na,openHistoryEditDialog:()=>aa,openObjectQuickActions:()=>da,openQrDialog:()=>la,openTaskQuickActions:()=>xi});function Tt(){return document.querySelector("home-assistant")?.hass}function ia(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function ne(s){let r=ia(),e=r.querySelector(s)??document.body.querySelector(s);return e?e.parentNode!==r&&r.appendChild(e):(e=document.createElement(s),r.appendChild(e)),e}function ae(s){let r=Tt();if(!r)return!1;s.hass=r;let e=P(r);return Vt(e)||Je(e).then(()=>{s.requestUpdate?.()}),Wt(r.locale,r.config?.country),!0}function vi(s){return St(s).then(r=>r.rowActionStyle)}function ra(){ws()}function bi(){let s=ne(ks);return ae(s)?(s.openCreate(),!0):!1}function sa(s,r){let e=ne(ks);return ae(e)?(e.openEdit(s,r),!0):!1}function yi(s="",r){let e=ne(Es);if(!ae(e))return!1;let t=Tt();return t?((async()=>{let i=await St(t),a=e;a.checklistsEnabled=i.features.checklists,a.scheduleTimeEnabled=i.features.schedule_time,a.completionActionsEnabled=i.features.completion_actions,a.defaultWarningDays=i.defaultWarningDays,a.openCreate(s,r)})(),!0):!1}function na(s,r){let e=ne(Es);if(!ae(e))return!1;let t=Tt();return t?((async()=>{try{let[i,a]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:s}),St(t)]),l=(i.tasks||[]).find(h=>h.id===r);if(!l){console.warn(`openEditTaskDialog: task ${r} not found in entry ${s}`);return}let u=e;u.checklistsEnabled=a.features.checklists,u.scheduleTimeEnabled=a.features.schedule_time,u.completionActionsEnabled=a.features.completion_actions,u.defaultWarningDays=a.defaultWarningDays,await u.openEdit(s,l)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function aa(s){let r=ne(Jn);return ae(r)?(r.openEdit(s),!0):!1}function oa(s){let r=ne(Zn);return ae(r)?(Xe(r,s,P(Tt())),!0):!1}function la(s){let r=ne(Xn);return ae(r)?(r.openForTask(s.entry_id,s.task_id,s.object_name,s.task_name),!0):!1}function xi(s,r){let e=ne(ea);return ae(e)?(e.openFor(s,r),!0):!1}function da(s){let r=ne(ta);return ae(r)?(r.openFor(s),!0):!1}var ks,Es,Jn,Zn,Xn,ea,ta,Z=w(()=>{"use strict";Dr();Wr();di();Kr();Gr();fs();ys();C();bt();$s();ks="maintenance-object-dialog",Es="maintenance-task-dialog",Jn="maintenance-history-edit-dialog",Zn="maintenance-complete-dialog",Xn="maintenance-qr-dialog",ea="maintenance-task-quick-actions-dialog",ta="maintenance-object-quick-actions-dialog"});I();var Ws=["assignee_pool","required_completion_fields","checklist","labels","mirror_todo_entities","history","readings"],Ks=["checklist_progress"],Ys=["tasks","parts"],Gs=["manual_docs","battery_fleet_excluded"];function zt(s,r,e=[]){for(let t of r)s[t]===void 0&&(s[t]=[]);for(let t of e)s[t]===void 0&&(s[t]={})}function Qs(s){let r=s;zt(r,Ys),r.object&&typeof r.object=="object"&&zt(r.object,Gs);for(let e of r.tasks)zt(e,Ws,Ks);return s}function We(s){for(let r of s)Qs(r);return s}function Js(s,r){if(r.objects)return r.objects;let e=r.delta||[],t=r.removed||[];if(!e.length&&!t.length)return null;let i=new Map(s.map(a=>[a.entry_id,a]));for(let a of e)i.set(a.entry_id,a);for(let a of t)i.delete(a);return[...i.values()]}function Yi(s,r){return r.objects&&We(r.objects),r.delta&&We(r.delta),Js(s,r)}q();C();Qt();Jt();function Ce(s){let r=window;r.customCards=r.customCards||[],r.customCards.some(e=>e.type===s.type)||r.customCards.push(s)}ei();Xt();ft();bt();I();q();C();var gn=["overdue","triggered","due_soon","ok"],J=class extends E{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._loadingObjects=!0;this._loadError=!1;this._views=[];this._objectsLoaded=!1;this._onEntitiesChanged=e=>{this._valueChanged("entity_ids",e.de
Line truncated
|
||||
`,d([v({attribute:!1})],X.prototype,"hass",2),d([p()],X.prototype,"_open",2),d([p()],X.prototype,"_entryId",2),d([p()],X.prototype,"_data",2),d([p()],X.prototype,"_busy",2),d([p()],X.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",X)});function xs(){let s=window;return s.__msSettingsCache??={promise:null}}function St(s){let r=xs();if(r.promise)return r.promise;let e=s.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(t=>({features:t.features??fi.features,defaultWarningDays:t.general?.default_warning_days??7,rowActionStyle:t.general?.row_action_style??fi.rowActionStyle})).catch(()=>(r.promise===e&&(r.promise=null),fi));return r.promise=e,e}function ws(){xs().promise=null}var fi,$s=w(()=>{"use strict";fi={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"}});var ne={};Ps(ne,{__resetSettingsCacheForTests:()=>ra,getRowActionStyle:()=>vi,openCompleteDialog:()=>oa,openCreateObjectDialog:()=>bi,openCreateTaskDialog:()=>yi,openEditObjectDialog:()=>sa,openEditTaskDialog:()=>na,openHistoryEditDialog:()=>aa,openObjectQuickActions:()=>da,openQrDialog:()=>la,openTaskQuickActions:()=>xi});function Tt(){return document.querySelector("home-assistant")?.hass}function ia(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function ae(s){let r=ia(),e=r.querySelector(s)??document.body.querySelector(s);return e?e.parentNode!==r&&r.appendChild(e):(e=document.createElement(s),r.appendChild(e)),e}function oe(s){let r=Tt();if(!r)return!1;s.hass=r;let e=P(r);return Vt(e)||Je(e).then(()=>{s.requestUpdate?.()}),Wt(r.locale,r.config?.country),!0}function vi(s){return St(s).then(r=>r.rowActionStyle)}function ra(){ws()}function bi(){let s=ae(ks);return oe(s)?(s.openCreate(),!0):!1}function sa(s,r){let e=ae(ks);return oe(e)?(e.openEdit(s,r),!0):!1}function yi(s="",r){let e=ae(Es);if(!oe(e))return!1;let t=Tt();return t?((async()=>{let i=await St(t),a=e;a.checklistsEnabled=i.features.checklists,a.scheduleTimeEnabled=i.features.schedule_time,a.completionActionsEnabled=i.features.completion_actions,a.defaultWarningDays=i.defaultWarningDays,a.openCreate(s,r)})(),!0):!1}function na(s,r){let e=ae(Es);if(!oe(e))return!1;let t=Tt();return t?((async()=>{try{let[i,a]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:s}),St(t)]),l=(i.tasks||[]).find(h=>h.id===r);if(!l){console.warn(`openEditTaskDialog: task ${r} not found in entry ${s}`);return}let u=e;u.checklistsEnabled=a.features.checklists,u.scheduleTimeEnabled=a.features.schedule_time,u.completionActionsEnabled=a.features.completion_actions,u.defaultWarningDays=a.defaultWarningDays,await u.openEdit(s,l)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function aa(s){let r=ae(Jn);return oe(r)?(r.openEdit(s),!0):!1}function oa(s){let r=ae(Zn);return oe(r)?(Xe(r,s,P(Tt())),!0):!1}function la(s){let r=ae(Xn);return oe(r)?(r.openForTask(s.entry_id,s.task_id,s.object_name,s.task_name),!0):!1}function xi(s,r){let e=ae(ea);return oe(e)?(e.openFor(s,r),!0):!1}function da(s){let r=ae(ta);return oe(r)?(r.openFor(s),!0):!1}var ks,Es,Jn,Zn,Xn,ea,ta,Z=w(()=>{"use strict";Dr();Wr();di();Kr();Gr();fs();ys();C();bt();$s();ks="maintenance-object-dialog",Es="maintenance-task-dialog",Jn="maintenance-history-edit-dialog",Zn="maintenance-complete-dialog",Xn="maintenance-qr-dialog",ea="maintenance-task-quick-actions-dialog",ta="maintenance-object-quick-actions-dialog"});I();var Ws=["assignee_pool","required_completion_fields","checklist","labels","mirror_todo_entities","history","readings"],Ks=["checklist_progress"],Ys=["tasks","parts"],Gs=["manual_docs","battery_fleet_excluded"];function zt(s,r,e=[]){for(let t of r)s[t]===void 0&&(s[t]=[]);for(let t of e)s[t]===void 0&&(s[t]={})}function Qs(s){let r=s;zt(r,Ys),r.object&&typeof r.object=="object"&&zt(r.object,Gs);for(let e of r.tasks)zt(e,Ws,Ks);return s}function We(s){for(let r of s)Qs(r);return s}function Js(s,r){if(r.objects)return r.objects;let e=r.delta||[],t=r.removed||[];if(!e.length&&!t.length)return null;let i=new Map(s.map(a=>[a.entry_id,a]));for(let a of e)i.set(a.entry_id,a);for(let a of t)i.delete(a);return[...i.values()]}function Yi(s,r){return r.objects&&We(r.objects),r.delta&&We(r.delta),Js(s,r)}q();C();Qt();Jt();function Ce(s){let r=window;r.customCards=r.customCards||[],r.customCards.some(e=>e.type===s.type)||r.customCards.push(s)}ei();Xt();ft();bt();I();q();C();var gn=["overdue","triggered","due_soon","ok"],J=class extends E{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._loadingObjects=!0;this._loadError=!1;this._views=[];this._objectsLoaded=!1;this._onEntitiesChanged=e=>{this._valueChanged("entity_ids",e.de
Line truncated
|
||||
<div class="editor">
|
||||
<ha-textfield
|
||||
label="${n("card_title",e)}"
|
||||
@@ -4820,7 +4822,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
font-size: 14px;
|
||||
max-width: 320px;
|
||||
}
|
||||
`,d([v({attribute:!1})],J.prototype,"hass",2),d([p()],J.prototype,"_config",2),d([p()],J.prototype,"_objects",2),d([p()],J.prototype,"_loadingObjects",2),d([p()],J.prototype,"_loadError",2),d([p()],J.prototype,"_views",2);customElements.get("maintenance-supporter-card-editor")||customElements.define("maintenance-supporter-card-editor",J);di();I();q();I();q();C();oi();ie();kt();var U=class U extends E{constructor(){super(...arguments);this.flat=!1;this._ov=null;this._loading=!1;this._marking=!1;this._error="";this._history=null;this._rosterSort=U._storedSort();this._typeFilter=null;this._recorded=[];this._historyRequested=!1;this._localeReady=!1;this._markAll=async()=>{await this._mark(void 0)};this._repair=async()=>{if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/setup",language:this._lang}),await this._load()}catch(e){this._error=R(e,this._lang)}finally{this._marking=!1}}};this._loadHistory=async e=>{let t=e.target.open;if(it(pe.batteryRosterOpen,t?"1":"0"),!(!t||this._historyRequested)){this._historyRequested=!0;try{let i=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/overview_history"});this._history=i.series}catch{this._history=null}}}}get _lang(){return P(this.hass)}connectedCallback(){super.connectedCallback(),this.hass&&this._load()}updated(e){pt(this,e),e.has("hass")&&this.hass&&!this._localeReady&&(this._localeReady=!0,Je(this._lang).then(()=>this.requestUpdate()),this._ov===null&&!this._loading&&this._load())}async _load(){this._loading=!0,this._error="";try{this._ov=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/overview"})}catch(e){this._error=R(e,this._lang)}finally{this._loading=!1}}async _mark(e){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/mark_replaced",...e?{entity_ids:e}:{}}),await this._load()}catch(t){this._error=R(t,this._lang)}finally{this._marking=!1}}}async _setExcluded(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/set_excluded",entity_id:e,excluded:t}),await this._load()}catch(i){this._error=R(i,this._lang)}finally{this._marking=!1}}}async _addBattery(e){let t=e.detail?.value;if(!(!t||this._marking)){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/set_included",entity_id:t,included:!0}),await this._load()}catch(i){this._error=R(i,this._lang)}finally{this._marking=!1}}}async _setTrackSelf(e){await this._setFleetOption("set_track_self_charging",e.target.checked)}async _setDueWithoutSensor(e){await this._setFleetOption("set_due_without_sensor",e.target.checked)}async _setFleetOption(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:`maintenance_supporter/battery_fleet/${e}`,enabled:t}),await this._load()}catch(i){this._error=R(i,this._lang)}finally{this._marking=!1}}}_rosterOpen(){return tt(pe.batteryRosterOpen)!=="0"}_predictedTitle(e,t){if(e.forecast_overdue)return n("battery_fleet_forecast_overdue",t);let i=this._predictedDate(e.days_until??0);if(e.predicted_source==="trend")return n("battery_fleet_predicted_trend",t).replace("{date}",i).replace("{confidence}",n("cal_confidence_"+(e.prediction_confidence||"medium"),t));if(e.lifetime_months!=null&&e.lifetime_source){let a=n("lifetime_source_"+e.lifetime_source,t).replace("{n}",String(e.lifetime_samples??0));return n("battery_fleet_predicted_typical",t).replace("{date}",i).replace("{months}",String(e.lifetime_months)).replace("{type}",e.battery_type).replace("{source}",a)}return n("battery_fleet_predicted_on",t).replace("{date}",i)}_sparkline(e){let t=this._history?.[e.entity_id];if(!t||t.points.length<2)return c;let i=110,a=24,l=2,u=t.points[0][0],h=t.points[t.points.length-1][0],_=Date.now()/1e3,m=e.status!=="low"&&e.predicted_source==="trend"&&e.days_until!=null?_+e.days_until*86400:null,b=Math.max(h,m??h),y=L=>b===u?l:l+(L-u)/(b-u)*(i-2*l),x=L=>l+(1-Math.min(100,Math.max(0,L))/100)*(a-2*l),g=t.points.map(([L,A])=>`${T(y(L))},${T(x(A))}`).join(" "),$=t.points[t.points.length-1][1],z=T(x(t.threshold));return o`<svg
|
||||
`,d([v({attribute:!1})],J.prototype,"hass",2),d([p()],J.prototype,"_config",2),d([p()],J.prototype,"_objects",2),d([p()],J.prototype,"_loadingObjects",2),d([p()],J.prototype,"_loadError",2),d([p()],J.prototype,"_views",2);customElements.get("maintenance-supporter-card-editor")||customElements.define("maintenance-supporter-card-editor",J);di();I();q();I();q();C();oi();ie();kt();var U=class U extends E{constructor(){super(...arguments);this.flat=!1;this._ov=null;this._loading=!1;this._marking=!1;this._error="";this._history=null;this._rosterSort=U._storedSort();this._typeFilter=null;this._recorded=[];this._historyRequested=!1;this._localeReady=!1;this._markAll=async()=>{await this._mark(void 0)};this._repair=async()=>{if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/setup",language:this._lang}),await this._load()}catch(e){this._error=R(e,this._lang)}finally{this._marking=!1}}};this._loadHistory=async e=>{let t=e.target.open;if(it(he.batteryRosterOpen,t?"1":"0"),!(!t||this._historyRequested)){this._historyRequested=!0;try{let i=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/overview_history"});this._history=i.series}catch{this._history=null}}}}get _lang(){return P(this.hass)}connectedCallback(){super.connectedCallback(),this.hass&&this._load()}updated(e){pt(this,e),e.has("hass")&&this.hass&&!this._localeReady&&(this._localeReady=!0,Je(this._lang).then(()=>this.requestUpdate()),this._ov===null&&!this._loading&&this._load())}async _load(){this._loading=!0,this._error="";try{this._ov=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/overview"})}catch(e){this._error=R(e,this._lang)}finally{this._loading=!1}}async _mark(e){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/mark_replaced",...e?{entity_ids:e}:{}}),await this._load()}catch(t){this._error=R(t,this._lang)}finally{this._marking=!1}}}async _setExcluded(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/set_excluded",entity_id:e,excluded:t}),await this._load()}catch(i){this._error=R(i,this._lang)}finally{this._marking=!1}}}async _addBattery(e){let t=e.detail?.value;if(!(!t||this._marking)){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/set_included",entity_id:t,included:!0}),await this._load()}catch(i){this._error=R(i,this._lang)}finally{this._marking=!1}}}async _setTrackSelf(e){await this._setFleetOption("set_track_self_charging",e.target.checked)}async _setDueWithoutSensor(e){await this._setFleetOption("set_due_without_sensor",e.target.checked)}async _setFleetOption(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:`maintenance_supporter/battery_fleet/${e}`,enabled:t}),await this._load()}catch(i){this._error=R(i,this._lang)}finally{this._marking=!1}}}_rosterOpen(){return tt(he.batteryRosterOpen)!=="0"}_predictedTitle(e,t){if(e.forecast_overdue)return n("battery_fleet_forecast_overdue",t);let i=this._predictedDate(e.days_until??0);if(e.predicted_source==="trend")return n("battery_fleet_predicted_trend",t).replace("{date}",i).replace("{confidence}",n("cal_confidence_"+(e.prediction_confidence||"medium"),t));if(e.lifetime_months!=null&&e.lifetime_source){let a=n("lifetime_source_"+e.lifetime_source,t).replace("{n}",String(e.lifetime_samples??0));return n("battery_fleet_predicted_typical",t).replace("{date}",i).replace("{months}",String(e.lifetime_months)).replace("{type}",e.battery_type).replace("{source}",a)}return n("battery_fleet_predicted_on",t).replace("{date}",i)}_sparkline(e){let t=this._history?.[e.entity_id];if(!t||t.points.length<2)return c;let i=110,a=24,l=2,u=t.points[0][0],h=t.points[t.points.length-1][0],_=Date.now()/1e3,m=e.status!=="low"&&e.predicted_source==="trend"&&e.days_until!=null?_+e.days_until*86400:null,b=Math.max(h,m??h),y=L=>b===u?l:l+(L-u)/(b-u)*(i-2*l),x=L=>l+(1-Math.min(100,Math.max(0,L))/100)*(a-2*l),g=t.points.map(([L,A])=>`${T(y(L))},${T(x(A))}`).join(" "),$=t.points[t.points.length-1][1],z=T(x(t.threshold));return o`<svg
|
||||
class="bf-spark"
|
||||
viewBox="0 0 ${i} ${a}"
|
||||
role="img"
|
||||
@@ -4836,7 +4838,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
x2=${T(y(m))}
|
||||
y2=${z}
|
||||
></line>`:c}
|
||||
</svg>`}static _storedSort(){return tt(pe.batteryRosterSort)==="name"?"name":"urgency"}_setSort(e){this._rosterSort=e,it(pe.batteryRosterSort,e)}_sortedRoster(e){let t=this._typeFilter===null?e:e.filter(a=>a.battery_type===this._typeFilter);if(this._rosterSort==="name")return t;let i=a=>a.status==="low"?-1e3+(a.level??101)/101:a.days_until??1/0;return[...t].sort((a,l)=>i(a)-i(l)||a.device_name.localeCompare(l.device_name))}_predictedDate(e){return this._fmtDate(Date.now()+e*864e5)}_fmtDate(e){let t=new Date(e),i=a=>String(a).padStart(2,"0");return F(`${t.getFullYear()}-${i(t.getMonth()+1)}-${i(t.getDate())}`,this._lang)}_shoppingLine(e){return Object.entries(e).map(([t,i])=>o`<button
|
||||
</svg>`}static _storedSort(){return tt(he.batteryRosterSort)==="name"?"name":"urgency"}_setSort(e){this._rosterSort=e,it(he.batteryRosterSort,e)}_sortedRoster(e){let t=this._typeFilter===null?e:e.filter(a=>a.battery_type===this._typeFilter);if(this._rosterSort==="name")return t;let i=a=>a.status==="low"?-1e3+(a.level??101)/101:a.days_until??1/0;return[...t].sort((a,l)=>i(a)-i(l)||a.device_name.localeCompare(l.device_name))}_predictedDate(e){return this._fmtDate(Date.now()+e*864e5)}_fmtDate(e){let t=new Date(e),i=a=>String(a).padStart(2,"0");return F(`${t.getFullYear()}-${i(t.getMonth()+1)}-${i(t.getDate())}`,this._lang)}_shoppingLine(e){return Object.entries(e).map(([t,i])=>o`<button
|
||||
class="bf-type-chip ${this._typeFilter===t?"bf-type-chip-active":""}"
|
||||
title=${n("battery_fleet_filter_type",this._lang)}
|
||||
@click=${()=>this._toggleTypeFilter(t)}
|
||||
@@ -5550,7 +5552,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
${u?this._assigneeName(y)?o`<div class="task-meta compact-assignee" title="${this._assigneeName(y)}">
|
||||
${Zt(this._userPersons[y.responsible_user_id])}${this._assigneeName(y)}
|
||||
</div>`:c:o`<div class="task-meta">
|
||||
${b} · ${n(y.type,e)}${de(y)?o` · ${de(y)}`:c}${this._assigneeName(y)?o` · <span class="assignee"
|
||||
${b} · ${n(y.type,e)}${ce(y)?o` · ${ce(y)}`:c}${this._assigneeName(y)?o` · <span class="assignee"
|
||||
>${Zt(this._userPersons[y.responsible_user_id])}${this._assigneeName(y)}</span
|
||||
>`:c}
|
||||
</div>`}
|
||||
@@ -5578,7 +5580,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
variant="success"
|
||||
class="complete-btn-text"
|
||||
title="${n("complete",e)}"
|
||||
@click=${x=>{x.stopPropagation();let g=this.shadowRoot.querySelector("maintenance-complete-dialog");Xe(g,Ze({entryId:m,taskId:y.id,taskName:y.name,task:y,objects:this._objects,lang:e,checklist:y.checklist||[],adaptiveEnabled:!!y.adaptive_config?.enabled,currencySymbol:le(this._stats?.budget)}),e)}}
|
||||
@click=${x=>{x.stopPropagation();let g=this.shadowRoot.querySelector("maintenance-complete-dialog");Xe(g,Ze({entryId:m,taskId:y.id,taskName:y.name,task:y,objects:this._objects,lang:e,checklist:y.checklist||[],adaptiveEnabled:!!y.adaptive_config?.enabled,currencySymbol:de(this._stats?.budget)}),e)}}
|
||||
>
|
||||
<ha-icon slot="start" icon="mdi:check"></ha-icon>${n("complete",e)}
|
||||
</ha-button>
|
||||
@@ -5586,7 +5588,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
<mwc-icon-button
|
||||
class="complete-btn"
|
||||
title="${n("complete",e)}"
|
||||
@click=${x=>{x.stopPropagation();let g=this.shadowRoot.querySelector("maintenance-complete-dialog");Xe(g,Ze({entryId:m,taskId:y.id,taskName:y.name,task:y,objects:this._objects,lang:e,checklist:y.checklist||[],adaptiveEnabled:!!y.adaptive_config?.enabled,currencySymbol:le(this._stats?.budget)}),e)}}
|
||||
@click=${x=>{x.stopPropagation();let g=this.shadowRoot.querySelector("maintenance-complete-dialog");Xe(g,Ze({entryId:m,taskId:y.id,taskName:y.name,task:y,objects:this._objects,lang:e,checklist:y.checklist||[],adaptiveEnabled:!!y.adaptive_config?.enabled,currencySymbol:de(this._stats?.budget)}),e)}}
|
||||
>
|
||||
<ha-icon icon="mdi:check"></ha-icon>
|
||||
</mwc-icon-button>
|
||||
|
||||
Reference in new issue
Block a user