@kosdev-code/kos-ddk-model-components 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ice-agitator/detail/agitator.d.ts +9 -0
- package/components/ice-agitator/detail/agitator.d.ts.map +1 -0
- package/components/ice-agitator/index.d.ts +3 -0
- package/components/ice-agitator/index.d.ts.map +1 -0
- package/components/ice-agitator/summary/agitator.d.ts +9 -0
- package/components/ice-agitator/summary/agitator.d.ts.map +1 -0
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.map +1 -1
- package/components/software/software.d.ts +3 -1
- package/components/software/software.d.ts.map +1 -1
- package/components/spm-field-calibration/index.d.ts +2 -0
- package/components/spm-field-calibration/index.d.ts.map +1 -0
- package/components/spm-field-calibration/spm-field-calibration-modal.d.ts +11 -0
- package/components/spm-field-calibration/spm-field-calibration-modal.d.ts.map +1 -0
- package/hooks/holder-experience/holder-experience.d.ts +2 -2
- package/hooks/holder-experience/holder-experience.d.ts.map +1 -1
- package/index.cjs +76 -48
- package/index.js +1605 -1265
- package/package.json +7 -7
- package/utils/companion-utils.d.ts.map +1 -1
package/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var So=Object.defineProperty;var ko=(e,t,o)=>t in e?So(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var I=(e,t,o)=>(ko(e,typeof t!="symbol"?t+"":t,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@kosdev-code/kos-ui-sdk"),n=require("@emotion/react/jsx-runtime"),v=require("@emotion/styled"),a=require("@kosdev-code/kos-ddk-components"),u=require("react"),j=require("@kosdev-code/kos-ddk-models"),H=require("@kosdev-code/kos-ddk-styles"),Ie=require("@kosdev-code/kos-dispense-sdk"),N=require("@kosdev-code/kos-ui-plugin"),L=require("@kosdev-code/kos-ui-plugin/utilities"),ht=require("react-router-dom"),To=require("@kosdev-code/kos-freestyle-sdk");class F{constructor(t,o){I(this,"future");I(this,"intentContainer");I(this,"title");I(this,"intent");I(this,"namespace");I(this,"successMessage");I(this,"failureMessage");I(this,"actionLabel");this.intentContainer=t,this.title=o.title,this.namespace=o.namespace,this.intent=o.intent,this.successMessage=o.successMessage,this.failureMessage=o.failureMessage,this.actionLabel=o.actionLabel}get type(){return"intentContainer"}async performAction(){const t=await this.intentContainer.performIntent(this.intent);t!=null&&t.tracker&&(this.future=l.FutureManager.getFuture(t.tracker))}}class ft extends F{constructor(t){super(t,{title:"Calibrate",intent:"CALIBRATE",successMessage:"Calibrate Complete",failureMessage:"Calibrate Failed"})}enabled(){return!0}}class bt extends F{constructor(t){super(t,{title:"45ml Flow Test",intent:"FIXED_45",successMessage:"45ml Flow Test Complete",failureMessage:"45ml Flow Test Failed"})}enabled(){return!0}}class Ct extends F{constructor(t){super(t,{title:"Flush",intent:"FLUSH",successMessage:"Flush Complete",failureMessage:"Flush Failed"})}enabled(){return!0}}class vt extends F{constructor(t){super(t,{title:"High Flow Test",intent:"HIGH_FLOW_TEST",successMessage:"High Flow Test Complete",failureMessage:"High Flow Test Failed"})}enabled(){return!0}}class yt extends F{constructor(t){super(t,{title:"Hold to Pour",intent:"HOLD_TO_POUR",successMessage:"Pour Complete",failureMessage:"Pour Failed"})}enabled(){return!0}}class wt extends F{constructor(t){super(t,{title:"Low Flow Test",intent:"LOW_FLOW_TEST",successMessage:"Low Flow Test Complete",failureMessage:"Low Flow Test Failed"})}enabled(){return!0}}class jt extends F{constructor(t){super(t,{title:"Manual Override",intent:"SOFT_START",successMessage:"Manual Override Complete",failureMessage:"Manual Override Failed"})}enabled(){return!0}}class St extends F{constructor(t){super(t,{title:"Reset",intent:"MSV_RESET",successMessage:"Reset Complete",failureMessage:"Reset Failed"})}enabled(){return!0}}class kt extends F{constructor(t){super(t,{title:"Prime",intent:"PRIME",successMessage:"Prime Complete",failureMessage:"Prime Failed"})}enabled(){return!0}}class Tt extends F{constructor(t){super(t,{title:"Purge",intent:"PURGE",successMessage:"Purge Complete",failureMessage:"Purge Failed"})}enabled(){return!0}}class Pt{constructor(t,o){I(this,"future");I(this,"troubleAware");I(this,"title");I(this,"troubleKey");I(this,"namespace");I(this,"successMessage");I(this,"failureMessage");I(this,"actionLabel");this.troubleAware=t,this.troubleKey=o.trouble,this.namespace=o.namespace||"troubles",this.title=o.title||`${this.namespace}:troubles.${this.troubleKey}.progress`,this.successMessage=o.successMessage||`${this.namespace}:troubles.${this.troubleKey}.success`,this.failureMessage=o.failureMessage||`${this.namespace}:troubles.${this.troubleKey}.error`,this.actionLabel=o.action||`${this.namespace}:troubles.${this.troubleKey}.action`}get type(){return"troubleAware"}async performAction(){const t=this.troubleAware.troublesByType[this.troubleKey];if(!t)return;const s=await t[0].resolve();s!=null&&s.tracker&&(this.future=l.FutureManager.getFuture(s.tracker))}}class It extends Pt{constructor(t,o){super(t,{trouble:o})}enabled(){return!0}}const Po="PrimeTrouble",Io="PurgeTrouble",Ao=v.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
overflow-y: auto;
|
|
5
5
|
overflow-x: hidden;
|
|
6
6
|
gap: 32px;
|
|
7
7
|
height: 100%;
|
|
8
|
-
`,
|
|
8
|
+
`,At=l.kosComponent(({holder:e,onComplete:t})=>{const[o,s]=u.useState(!1),{t:r}=l.useKosTranslation("common"),{componentModeOverride:c}=a.useComponentConfigurationContext(),d=e.data.agitated;return n.jsx(a.Modal,{contain:c!=="compact",onClosed:t,show:!o,children:n.jsxs(Ao,{children:[n.jsx(a.Header,{contain:c==="compact",showCloseButton:!0,title:r("shelf-agitator"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:c==="compact"?a.BackButton:void 0}),n.jsx(a.Content,{align:"top",children:n.jsx(a.InfoCard,{label:r("agitating"),padding:"x-large",value:r(d?"no":"yes")})}),n.jsx(a.Footer,{children:n.jsx(a.Button,{mode:"primary",disabled:d,onPointerDown:()=>console.log("agitate!"),children:r("test-shelf-agitator")})})]})})}),Ae=()=>{const e=j.AgitationControl.type;return l.useKosModel({modelId:e,modelType:j.AgitationControl.type,options:{}})},R=e=>{var d,i;const[t,o]=u.useState(e==null?void 0:e.futureHandler.future),[s,r]=u.useState((i=(d=e==null?void 0:e.futureHandler)==null?void 0:d.future)==null?void 0:i.endState);u.useEffect(()=>{const p=l.kosAutoEffect(()=>{const m=e==null?void 0:e.futureHandler.future;o(m),r(m==null?void 0:m.endState)});return()=>{p(),e==null||e.futureHandler.removeFuture()}},[e==null?void 0:e.futureHandler]);const c=u.useCallback(()=>{e==null||e.futureHandler.removeFuture()},[e==null?void 0:e.futureHandler]);return{future:t,clearFuture:c,success:s===l.FutureEndState.Success,failure:s&&s!==l.FutureEndState.Success}},Do=l.KosLog.createLogger({name:"future-progress-bar"}),Dt=v(a.CloseButton)`
|
|
9
9
|
--ddk-component-icon-button-icon-color-active: var(
|
|
10
10
|
--ddk-component-progress-bar-close-button-color-active
|
|
11
11
|
);
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
--ddk-component-icon-button-icon-color-hover: var(
|
|
19
19
|
--ddk-component-progress-bar-close-button-color-hover
|
|
20
20
|
);
|
|
21
|
-
`,
|
|
21
|
+
`,Eo=v.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
flex-direction: column;
|
|
24
24
|
width: 100%;
|
|
25
25
|
gap: 8px;
|
|
26
|
-
`,
|
|
26
|
+
`,Et=v.div`
|
|
27
27
|
align-items: var(--ddk-component-progress-bar-message-align-items);
|
|
28
28
|
color: var(--ddk-component-progress-bar-message-color);
|
|
29
29
|
display: flex;
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
gap: var(--ddk-component-progress-bar-message-gap);
|
|
32
32
|
justify-content: space-between;
|
|
33
33
|
width: 100%;
|
|
34
|
-
`,
|
|
34
|
+
`,Lt=v.div`
|
|
35
35
|
display: flex;
|
|
36
36
|
gap: var(--ddk-component-status-bar-gap);
|
|
37
37
|
align-items: center;
|
|
38
|
-
`,
|
|
38
|
+
`,Lo=v.div`
|
|
39
39
|
border-top: solid 1px #888888;
|
|
40
40
|
padding-top: 8px;
|
|
41
41
|
width: calc(100% - 10px);
|
|
42
|
-
`,
|
|
42
|
+
`,q=({children:e,onPointerDown:t,title:o,subtitle:s})=>{const{componentModeOverride:r}=a.useComponentConfigurationContext(),{t:c}=l.useKosTranslation("common"),d=o??e;return n.jsxs(Et,{children:[n.jsxs(Eo,{children:[n.jsxs(Lt,{style:{fontSize:"var(--ddk-component-progress-bar-message-font-size)"},children:[n.jsx(H.MessageErrorIcon,{style:{color:"var(--ddk-component-progress-bar-icon-color-failure)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),d]}),s&&n.jsx(Lo,{children:s})]}),r==="compact"?n.jsx(a.Button,{mode:"primary",onPointerDown:t,children:c("close","Close")}):n.jsx(Dt,{label:!1,size:"large",onPointerDown:t})]})},ge=({children:e,onPointerDown:t})=>{const{componentModeOverride:o}=a.useComponentConfigurationContext(),{t:s}=l.useKosTranslation("common");return n.jsxs(Et,{children:[n.jsxs(Lt,{children:[n.jsx(H.SuccessIcon,{style:{color:"var(--ddk-semantic-color-system-green)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),e]}),o==="compact"?n.jsx(a.Button,{mode:"primary",onPointerDown:t,children:s("close","Close")}):n.jsx(Dt,{label:!1,size:"large",onPointerDown:t})]})},lt=e=>(e==null?void 0:e.title)&&(e==null?void 0:e.subtitle),A=l.kosComponent(({title:e,future:t,failureMessage:o,successMessage:s,cancelMessage:r,isCancelable:c=!0,onSuccess:d,onClose:i})=>{const{t:p}=l.useKosTranslation("common"),[m,x]=u.useState(!0),[g,f]=u.useState(),h=`${t==null?void 0:t.timeRemaining} ${p("remaining","remaining")}`,w=u.useCallback(()=>{g!=="in-progress"&&(i==null||i(),x(!1))},[i,g]),S=u.useCallback(()=>{w(),d==null||d()},[w,d]);u.useEffect(()=>{(t==null?void 0:t.status)==="IN_PROGRESS"||(t==null?void 0:t.status)==="NOT_ACTIVE"?(f("in-progress"),x(!0)):(t==null?void 0:t.status)==="SUCCESS"?(f("success"),x(!!s),s||(w(),d==null||d())):(t==null?void 0:t.status)==="FAIL"||(t==null?void 0:t.status)==="ABORT"?(f("failure"),x(!!o)):(t==null?void 0:t.status)==="CANCEL"?(f("cancelled"),x(!!r)):t&&Do.error("unknown status",t==null?void 0:t.status)},[o,t,t==null?void 0:t.status,s,r,w,d]);const y=lt(o)?o.subtitle:void 0,k=lt(o)?o.title:o??p("something-went-wrong","Something went wrong");return t&&n.jsx(a.ProgressBar,{isCancelable:c,onCancel:()=>{t.cancelFuture()},blocked:g==="in-progress",onClose:w,renderFailure:o&&n.jsx(q,{subtitle:y,onPointerDown:w,children:k}),renderCancel:r&&n.jsx(q,{onPointerDown:w,children:r}),renderSuccess:s&&n.jsx(ge,{onPointerDown:S,children:s}),show:m,status:g,subtitle:h,title:e,value:t.progress})}),Fo=l.KosLog.createLogger({name:"agitation-control-view"});Fo.debug("agitation-control-view component loaded");const Mo=v.div``,Bo=l.kosComponent(()=>{const{model:e}=Ae(),{t,i18n:o}=l.useKosTranslation("troubles"),{future:s,failure:r}=R(e),c=u.useCallback(()=>{e&&e.clearAll()},[e]),d=s==null?void 0:s.reason,i=d?`__troubles.errors.${d}__`:void 0,p="troubles.agitation.error",m=o.exists(`troubles.errors.${d}`);return n.jsx(Mo,{children:n.jsx(A,{title:t("troubles.agitation.title"),future:s,isCancelable:!0,onClose:c,failureMessage:t(p,{context:i&&m?"reason":void 0,data:{reason:i}})})})}),Ft=l.kosComponent(({pump:e,onComplete:t})=>{const{t:o}=l.useKosTranslation("common",{keyPrefix:"fcm-calibration"}),[s,r]=u.useState("high-flow-test-idle"),[c,d]=u.useState(),[i,p]=u.useState(),[m,x]=u.useState(),{future:g}=R(e);u.useEffect(()=>{switch(g==null?void 0:g.endState){case"CANCEL":switch(s){case"high-flow-test-in-progress":r("high-flow-test-idle");break;default:d("calibration-canceled"),r("failure")}break;case"SUCCESS":switch(s){case"high-flow-test-in-progress":r("high-flow-test-success");break;case"calibration-in-progress":r("calibration-input");break;case"verification-in-progress":r("verification-input");break}break;case"FAIL":d(g==null?void 0:g.reason),r("failure");break}},[g==null?void 0:g.endState,g==null?void 0:g.reason,s]);const f=u.useMemo(()=>({"high-flow-test-idle":{information:n.jsx(a.LabelInformation,{children:o("high-flow-test-idle-information")}),footer:n.jsx(a.Button,{onPointerDown:()=>{e.performPreCalibrate(),r("high-flow-test-in-progress")},children:o("initiate-high-flow-test")}),status:"information"},"high-flow-test-in-progress":{information:n.jsx(a.LabelInformation,{children:o("high-flow-test-in-progress-information")}),footer:n.jsx(a.Button,{disabled:!0,children:o("initiate-high-flow-test")}),status:"loading"},"high-flow-test-success":{information:n.jsx(a.LabelInformation,{children:o("high-flow-test-success-information")}),footer:n.jsx(a.Button,{onPointerDown:()=>r("calibration-idle"),children:o("proceed")}),status:"success"},"calibration-idle":{information:n.jsx(a.BodyMediumInformation,{children:o("calibration-idle-information")}),footer:n.jsx(a.Button,{onPointerDown:()=>{e.performCalibrate(),r("calibration-in-progress")},children:o("calibrate")}),status:"information"},"calibration-in-progress":{information:n.jsx(a.LabelInformation,{children:o("calibration-in-progress-information")}),status:"loading"},"calibration-input":{information:n.jsxs(n.Fragment,{children:[n.jsx(a.BodyMediumInformation,{children:o("calibration-input-information")}),n.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:h=>{h!==void 0&&p(h)},value:i!==void 0?i:""})]}),footer:n.jsx(a.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&r("verification-idle")},children:o("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:n.jsx(a.BodyMediumInformation,{children:o("verification-idle-information")}),footer:n.jsx(a.Button,{onPointerDown:async()=>{i!==void 0&&(e.performVerify(i),r("verification-in-progress"))},children:o("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:n.jsx(a.LabelInformation,{children:o("verification-in-progress-information")}),status:"loading"},"verification-input":{information:n.jsxs(n.Fragment,{children:[n.jsx(a.BodyMediumInformation,{children:o("verification-input-information")}),n.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:h=>{h!==void 0&&x(h)},value:m!==void 0?m:""})]}),footer:n.jsx(a.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;const h=await e.performComplete(i,m);h==="success"?r("verification-success"):(d(h),r(h==="errBadPump"?"verification-failure":"failure"))},children:o("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:n.jsx(a.LabelInformation,{children:o("verification-success-information")}),footer:n.jsx(a.Button,{onPointerDown:t,children:o("exit-calibration")}),status:"success"},"verification-failure":{information:n.jsx(a.LabelInformation,{children:o(`error.${c}`)}),footer:n.jsx(a.Button,{onPointerDown:t,children:o("exit-calibration")}),status:"error"},failure:{information:n.jsxs(n.Fragment,{children:[n.jsx(a.LabelInformation,{children:o("calibration-failed")}),n.jsx(a.BodyMediumInformation,{children:o(`error.${c||"unknownError"}`)})]}),footer:n.jsx(a.Button,{onPointerDown:t,children:o("exit-calibration")}),status:"error"}}),[c,t,e,o,i,m]);return n.jsxs(n.Fragment,{children:[n.jsx(a.WorkflowModal,{title:o(e.name),...f[s],onClose:()=>t()}),g&&n.jsx(A,{title:o("initiating"),future:g})]})}),Ko=l.kosComponent(({cardModel:e})=>{l.KosLog.debug("Agitator",e.path);const{t}=l.useKosTranslation(["agitator","common"]),{future:o}=R(e),s=u.useCallback(r=>{r==="agitate"&&(e==null||e.testAgitate())},[e]);return n.jsxs(n.Fragment,{children:[n.jsx(a.Content,{children:n.jsx(a.InfoCard,{label:"Agitating",value:e.isAgitating?t("common:yes"):t("common:no")})}),n.jsx(a.Footer,{children:n.jsx(a.Button,{onPointerDown:()=>s("agitate"),children:t("action.label")})}),o&&n.jsx(A,{title:t("testing"),future:o})]})}),No=v.div`
|
|
43
43
|
font-size: var(--ddk-component-holder-card-footer-font-size);
|
|
44
44
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
45
|
-
`,
|
|
45
|
+
`,Ro=l.kosComponent(e=>{l.KosLog.debug(`summary component loaded for holder ${e}`),l.KosLog.info(`render agitator summary for holder ${e.cardModel.path}`);const{t}=l.useKosTranslation("common");return n.jsxs(n.Fragment,{children:[n.jsx(a.StatusIndicator,{size:"small",status:"completed"}),e.cardModel.isAgitating&&n.jsx(No,{children:t("agitating")})]})}),Oo={getStagedChange:void 0,updateStagedChange:void 0,saveChanges:void 0,clearStagedChanges:void 0},Mt=u.createContext(Oo),Bt=({children:e})=>{const[t,o]=u.useState({}),s=i=>t[i],r=(i,p)=>{o(m=>({...m,[i]:p}))},c=()=>o({}),d=async()=>{for(const i in t)t[i].configProperty.updateProperty(t[i].value);c()};return n.jsx(Mt.Provider,{value:{getStagedChange:s,updateStagedChange:r,saveChanges:d,clearStagedChanges:c},children:e})},De=()=>u.useContext(Mt),$o=e=>t=>n.jsx(Bt,{children:n.jsx(e,{...t})}),Kt=({label:e,configProperty:t})=>{const{value:o}=l.useConfigProperty({configProperty:t});return n.jsx(a.InfoCard,{label:e,value:o})},xe=({configProperty:e,hideUnits:t,isValid:o,...s})=>{var x,g;const{t:r}=l.useKosTranslation("common",{keyPrefix:"validation"}),{significantValue:c}=l.useConfigProperty({configProperty:e}),d=f=>{f||(f=""),e.updateProperty(f)},i=(x=e.displayOptions)==null?void 0:x.max,p=(g=e.displayOptions)==null?void 0:g.min,m=u.useCallback(f=>{const h=o==null?void 0:o(f);return h||(Number(f)<p?r("minValue",{data:{minValue:p}}):Number(f)>i?r("maxValue",{data:{maxValue:i}}):void 0)},[o,i,p,r]);return n.jsx(a.InputCard,{...s,isValid:m,onChange:d,unitValue:t?void 0:e.unit,value:c})},V=({configProperty:e,label:t,onChange:o,...s})=>{var d,i;const{t:r}=l.useKosTranslation(["config-properties","common"]),c=l.useConfigProperty({configProperty:e});return n.jsx(a.InputRangeCard,{...s,label:t??r(e.id),layout:"num",maxValue:(d=c.displayOptions)==null?void 0:d.max,minValue:(i=c.displayOptions)==null?void 0:i.min,onChange:p=>e.updateProperty(p),unitValue:c.unit,value:c.significantValue})},X=({configProperty:e,overrideChecked:t,...o})=>{var p;const{getStagedChange:s,updateStagedChange:r}=De(),{value:c}=l.useConfigProperty({configProperty:e}),d=((p=s==null?void 0:s(e.id))==null?void 0:p.value)??c,i=m=>{r?r(e.id,{configProperty:e,value:m}):e.updateProperty(m)};return n.jsx(a.ToggleCard,{toggleLabel:d==="true"?"Enabled":"Disabled",...o,onChange:i,checked:t!==void 0?t:d==="true"})},Vo=e=>(e==null?void 0:e.map(t=>({id:t.value,label:t.label})))||[],he=({collapse:e,cancelButtonLabel:t,configProperty:o,displayMode:s="raw",displayValue:r,float:c,items:d,label:i,onChange:p,onSave:m,proceedButtonLabel:x,selectedItemId:g,unitValue:f,...h})=>{const{t:w}=l.useKosTranslation(["config-properties","common"]),S=l.useConfigProperty({configProperty:o,optionsTransformer:Vo});return n.jsx(a.PickerCard,{...h,cancelButtonLabel:t??(w("discard-changes",{defaultValue:"Discard Changes",ns:"common"})||void 0),collapse:e,displayValue:r??s==="raw"?S.value:S.displayValue,float:c,items:d??S.mappedOptions,label:i??w(o.id),onSave:y=>m?m(y):o.updateProperty(y),proceedButtonLabel:x??(w("save",{defaultValue:"Save",ns:"common"})||void 0),selectedItemId:g??S.value,unitValue:f??S.unit})},Ho=v(xe)`
|
|
46
46
|
border-top: var(--ddk-component-input-enable-card-input-container-border);
|
|
47
47
|
border-radius: 0;
|
|
48
48
|
cursor: pointer;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
--ddk-component-input-enable-card-input-font-weight
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`,_o=v(he)`
|
|
82
82
|
border-top: var(--ddk-component-input-enable-card-input-container-border);
|
|
83
83
|
border-radius: 0;
|
|
84
84
|
cursor: pointer;
|
|
@@ -115,14 +115,14 @@
|
|
|
115
115
|
--ddk-component-input-enable-card-input-font-weight
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
`,Uo=(e,t,o,s,r)=>{let c;const d=r==="compact"?Ho:xe,i=r==="compact"?_o:he,p=s.label??o(e.id);switch(e.schemaType){case"boolean":c=n.jsx(X,{configProperty:e,...s,label:p});break;case"double":c=n.jsx(V,{configProperty:e,...s,label:p});break;case"int":c=n.jsx(V,{configProperty:e,...s,label:p});break;case"String":c=n.jsx(d,{configProperty:e,...s,label:p});break;case"enum":c=n.jsx(i,{configProperty:e,...s,label:p});break}return c},zo=e=>(e==null?void 0:e.map(t=>({id:t.value,label:t.label})))||[],Nt=({configProperty:e,factory:t,mappedOptions:o,t:s,...r})=>{const{t:c}=l.useKosTranslation(["config-properties","common"]),{componentModeOverride:d}=a.useComponentConfigurationContext(),i=l.useConfigProperty({configProperty:e,optionsTransformer:zo});return t=t??Uo,t(e,{...i,mappedOptions:o??i.mappedOptions},s??c,r,d)},Wo=v(a.Card)`
|
|
119
119
|
align-items: ${e=>e.mode==="compact"?"flex-start":void 0};
|
|
120
120
|
flex-direction: var(
|
|
121
121
|
--ddk-component-input-enable-card-container-flex-direction
|
|
122
122
|
);
|
|
123
123
|
padding: var(--ddk-component-input-enable-card-container-padding);
|
|
124
124
|
gap: var(--ddk-component-input-enable-card-container-gap);
|
|
125
|
-
`,
|
|
125
|
+
`,Go=v.div`
|
|
126
126
|
box-sizing: border-box;
|
|
127
127
|
display: flex;
|
|
128
128
|
flex-direction: var(
|
|
@@ -130,27 +130,27 @@
|
|
|
130
130
|
);
|
|
131
131
|
gap: var(--ddk-component-input-enable-card-input-container-gap);
|
|
132
132
|
width: 100%;
|
|
133
|
-
`,
|
|
133
|
+
`,qo=v(Nt)`
|
|
134
134
|
width: 100%;
|
|
135
|
-
`,
|
|
135
|
+
`,Xo=v.div`
|
|
136
136
|
box-sizing: border-box;
|
|
137
137
|
padding: ${e=>e.compact?"var(--ddk-component-input-enable-card-toggle-container-padding)":"0"};
|
|
138
138
|
width: var(--ddk-component-input-enable-card-toggle-container-width);
|
|
139
|
-
`,Bt=({configProperties:e,disabled:t,enabledConfigProperty:o})=>{const{value:s}=d.useConfigProperty({configProperty:o}),r=s==="true",{componentModeOverride:i}=c.useComponentConfigurationContext(),l=e.length===1,a=l?Uo:Ft;return n.jsxs(Ho,{disabled:!r||t,mode:i,children:[n.jsx(_o,{children:e.map(p=>n.jsx(a,{disabled:!r||t,label:p.options?p.options.label:void 0,configProperty:p.configProperty,collapse:!l&&i==="standard",layout:p.options?p.options.layout:void 0,float:!0,hideUnits:p.options?p.options.hideUnits:void 0},p.configProperty.id))}),n.jsx(zo,{compact:!l||i==="compact",children:n.jsx(q,{alwaysShowLabel:!0,collapse:!0,configProperty:o,disabled:t,stretch:i==="compact"})})]})},Wo=({configProperty:e,disabled:t,enabledConfigProperty:o,options:s})=>{const r=u.useMemo(()=>[{configProperty:e,options:s}],[e,s]);return n.jsx(Bt,{configProperties:r,disabled:t,enabledConfigProperty:o})},Kt=({configProperty:e,...t})=>{const{value:o}=d.useConfigProperty({configProperty:e}),s=r=>{r!==void 0&&(e==null||e.updateProperty(String(r)))};return n.jsx(c.SwitchCard,{...t,onChange:s,value:o})},Nt=({description:e,float:t,label:o,modalTitle:s,onSave:r,time:i,...l})=>{const{regionModel:a}=d.useKosRegions(),{t:p}=d.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:m,formattedTime:x,hourOptions:g,minuteOptions:h,setTime:f,time:y}=d.useRegionTimeProps({initialDate:i}),j=y.getHours(),v=u.useMemo(()=>[{id:"hr",items:g,selectedItemId:j<12?j:j-12,loop:!0},{id:"min",items:h,selectedItemId:y.getMinutes(),loop:!0},{id:"ampm",items:m,selectedItemId:j<12?"AM":"PM"}],[m,g,h,y,j]),T=u.useMemo(()=>[{id:"hr",items:g,selectedItemId:j,loop:!0},{id:"min",items:h,selectedItemId:y.getMinutes(),loop:!0}],[g,h,y,j]);return n.jsx(c.MultiPickerCard,{...l,cancelButtonLabel:p("discard-changes","Discard Changes")||void 0,closeButtonLabel:p("close","Close")||void 0,data:a!=null&&a.is12HourTimeFormat?v:T,description:e,displayValue:x,float:t,icon:V.TimeIcon,label:o,modalTitle:s,proceedButtonLabel:p("save","Save")||void 0,onSave:P=>{const k=a!=null&&a.is12HourTimeFormat?P.ampm==="AM"?P.hr:P.hr+12:P.hr,b=P.min,C=new Date(y);C.setHours(k),C.setMinutes(b),f(C),r==null||r({hours:k,minutes:b})}})},Rt=({configProperty:e,...t})=>{var x;const{getStagedChange:o,updateStagedChange:s}=Ie(),{value:r}=d.useConfigProperty({configProperty:e}),i=((x=o==null?void 0:o(e.id))==null?void 0:x.value)??r,{hours:l,minutes:a}=S.toTimeComponents(Number(i)),p=new Date;p.setHours(l),p.setMinutes(a);const m=g=>{const h=S.toSeconds(g.hours,g.minutes);s?s(e.id,{configProperty:e,value:h}):e.updateProperty(h)};return n.jsx(Nt,{...t,onSave:m,time:p})},Go=[0,6],Ot=({day:e=new Date().getDate(),month:t=new Date().getMonth(),onSave:o,year:s=new Date().getFullYear(),...r})=>{var f,y,j,v,T,P;const{t:i}=d.useKosTranslation("region"),{regionModel:l}=d.useKosRegions(),a=d.useDateProps({date:{year:s,month:t,day:e},formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(l==null?void 0:l.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:Go,yearsRange:[s-10,s+10]}}),p=u.useMemo(()=>{var k,b;return(b=(k=a==null?void 0:a.dateState)==null?void 0:k.yearsOptionsArray)==null?void 0:b.map(C=>({id:C.value,label:C.label}))},[(f=a==null?void 0:a.dateState)==null?void 0:f.yearsOptionsArray]),m=u.useMemo(()=>{var k,b;return(b=(k=a==null?void 0:a.dateState)==null?void 0:k.daysOptionsArray)==null?void 0:b.map(C=>({id:C.value,label:C.label}))},[(y=a==null?void 0:a.dateState)==null?void 0:y.daysOptionsArray]),x=u.useMemo(()=>{var k,b;return(b=(k=a==null?void 0:a.dateState)==null?void 0:k.monthsOptionsArray)==null?void 0:b.map(C=>({id:C.value,label:String(C.label)}))},[(j=a==null?void 0:a.dateState)==null?void 0:j.monthsOptionsArray]),g=u.useMemo(()=>{const k=[];return l==null||l.selectedDateOrder.split("").forEach(b=>{var C,A,D;b==="y"?k.push({id:"year",items:p,selectedItemId:(C=a==null?void 0:a.dateState)==null?void 0:C.year,loop:!1}):b==="m"?k.push({id:"month",items:x,selectedItemId:(A=a==null?void 0:a.dateState)==null?void 0:A.month}):b==="d"&&k.push({id:"day",items:m,selectedItemId:(D=a==null?void 0:a.dateState)==null?void 0:D.day,loop:!1})}),k},[(v=a==null?void 0:a.dateState)==null?void 0:v.day,(T=a==null?void 0:a.dateState)==null?void 0:T.month,(P=a==null?void 0:a.dateState)==null?void 0:P.year,m,x,l==null?void 0:l.selectedDateOrder,p]),h=u.useCallback(async k=>{const C=new Date(k.year,k.month+1,0).getDate(),A=k.day>C?1:k.day;o({day:A,month:k.month,year:k.year})},[o]);return n.jsx(c.MultiPickerCard,{cancelButtonLabel:i("discard-changes","Discard Changes")||void 0,closeButtonLabel:i("close","Close")||void 0,data:g,displayValue:a.dateState.formattedDate,icon:V.CalendarIcon,label:i("todays-date","Today's Date"),onSave:h,proceedButtonLabel:i("save","Save")||void 0,...r})},$t=d.kosComponent(({pump:e,onComplete:t})=>{const{t:o}=d.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,r]=u.useState("idle"),[i,l]=u.useState(),a=u.useCallback(async()=>{r("test"),l(void 0);const m=await e.performElectricalTest();m.error?(l(m.error),r("failure")):m.result==="errEEPROM"?(l("errEEPROM"),r("failure")):r("success")},[e]),p=u.useMemo(()=>({idle:{information:n.jsx(c.LabelInformation,{children:o("perform-electrical-test")}),footer:n.jsx(c.Button,{onPointerDown:a,children:o("electrical-test")})},test:{information:n.jsx(c.LabelInformation,{children:o("testing")}),footer:n.jsx(c.Button,{disabled:!0,children:o("electrical-test")}),status:"loading"},success:{information:n.jsx(c.LabelInformation,{children:o("electrical-test-success-header")}),footer:n.jsx(c.Button,{onPointerDown:a,children:o("electrical-test")}),status:"success"},failure:{information:n.jsxs(n.Fragment,{children:[n.jsx(c.LabelInformation,{children:o("electrical-test-failure-header")}),n.jsx(c.BodyMediumInformation,{children:o(`error.${i}`)})]}),footer:n.jsx(c.Button,{onPointerDown:a,children:o("electrical-test")}),status:"information"}}),[i,o,a]);return n.jsx(c.WorkflowModal,{title:o(e.name),...p[s],onClose:()=>t()})}),Te={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},qo=e=>{const[t,o]=u.useState(null),[s,r]=u.useState(Te),i=e.map(l=>{const[a,,p]=l;return[a==null?void 0:a.future,a,p]}).flat();return u.useEffect(()=>{const l=e.find(a=>{const[p]=a;return!!(p!=null&&p.future)});l?(o(l[0]),r(l[2])):(o(null),r(Te))},[...i,e]),[t,s]},Xo=e=>{switch(e){case"calibrate":return gt;case"fixed-45":return xt;case"flush":return ht;case"high-flow-test":return ft;case"hold-to-pour":return Ct;case"low-flow-test":return bt;case"manual-override":return vt;case"msv-reset":return yt;case"prime":return wt;case"purge":return jt;default:return}},Yo=e=>(t,o="intents")=>({title:e(`${o}:troubles.${t}.progress`),summary:e(`${o}:troubles.${t}.summary`),successMessage:e(`${o}:troubles.${t}.success`),failureMessage:e(`${o}:troubles.${t}.error`),actionLabel:e(`${o}:troubles.${t}.action`)}),X=(e,t=Xo)=>{const{t:o}=d.useKosTranslation("troubles"),[s,r]=u.useState(null),[i,l]=u.useState(Te),a=u.useCallback(async p=>{const m=t(p);if(m){const x=Yo(o)(p);l(x);const g=new m(e);await g.performAction(),r(g)}},[t,e,o]);return[s,a,i]},Zo=e=>(d.KosLog.debug(`pumpActionFactory: actionId=${e}`),Tt),Qo=e=>(t,o="troubles")=>({title:e(`${o}:troubles.${t}.progress`),summary:e(`${o}:troubles.${t}.summary`),successMessage:e(`${o}:troubles.${t}.success`),failureMessage:e(`${o}:troubles.${t}.error`),actionLabel:e(`${o}:troubles.${t}.action`)}),Jo=(e,t,o=Zo)=>{const{t:s}=d.useKosTranslation("troubles"),[r,i]=u.useState(null),[l]=u.useState(Qo(s)(t)),a=u.useCallback(async()=>{const p=o(t);if(p){const m=new p(e,t);await m.performAction(),i(m)}},[o,e,t]);return[r,a,l]};function en(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Pe();return n.jsx(r,{...s,children:n.jsx(e,{...t,agitationControl:o})})}}const Ae=()=>{const e=S.Animation.type;return d.useKosModel({modelId:e,modelType:S.Animation.type,options:{}})};function Vt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ae();return n.jsx(r,{...s,children:n.jsx(e,{...t,animation:o})})}}const Y=()=>{const e=S.Application.type;return d.useKosModel({modelId:e,modelType:S.Application.type,options:{}})};function tn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Y();return n.jsx(r,{...s,children:n.jsx(e,{...t,application:o})})}}const Ht=()=>{const e=S.CarbWater.type;return d.useKosModel({modelId:e,modelType:S.CarbWater.type,options:{}})};function on(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ht();return n.jsx(r,{...s,children:n.jsx(e,{...t,carbWater:o})})}}const _t=()=>{const e=S.CopyLogs.type;return d.useKosModel({modelId:e,modelType:S.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function nn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=_t();return n.jsx(r,{...s,children:n.jsx(e,{...t,copyLogs:o})})}}const De=()=>{const e=S.DashboardOperations.type;return d.useKosModel({modelId:e,modelType:S.DashboardOperations.type,options:{}})};function sn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=De();return n.jsx(r,{...s,children:n.jsx(e,{...t,dashboardOperations:o})})}}const Me=()=>{const e=S.DispenserInfo.type;return d.useKosModel({modelId:e,modelType:S.DispenserInfo.type,options:{}})};function Ut(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Me();return n.jsx(r,{...s,children:n.jsx(e,{...t,dispenserInfo:o})})}}const zt=e=>{const t=e;return d.useKosModel({modelId:t,modelType:S.Door.type,options:{}})};function rn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=zt(t.id);return n.jsx(r,{...s,children:n.jsx(e,{...t,door:o})})}}const ct={[M.EXTENSION_POINT_SETUP]:"setupDescriptor",[M.EXTENSION_POINT_CUI]:"cuiDescriptor",[M.EXTENSION_POINT_UTIL]:"utilDescriptor"},Wt=({defaultNamespace:e,extensionPoint:t})=>{const{getExtensions:o}=N.useKosPluginsContext(),s=o(t),r=s.map(p=>p.data.namespace)||[],{t:i}=d.useKosTranslation([e,...new Set(r)]),l=s.reduce((p,m)=>{const x=m;return p[x.data[ct[t]]]={extension:t,module:x.id,namespace:x.data.namespace,title:x.data.title},p},{}),a=s.reduce((p,m)=>{const x=m;return p[x.data[ct[t]]]=`${x.data.namespace}:${x.data.title}`,p},{});return{namespaces:r,t:i,labelMap:a,contributionMap:l}},xe=(e,t)=>{const o=u.useMemo(()=>({agitate:kt,calibrate:({holder:l,pump:a,onComplete:p})=>{const m=d.getKosCompanionModel(a??l.pumps.data[0],S.FcmPump.type);return n.jsx(Dt,{pump:m,onComplete:p})},diagnostics:({holder:l,pump:a,onComplete:p})=>{const m=d.getKosCompanionModel(a??l.pumps.data[0],S.FcmPump.type);return n.jsx($t,{pump:m,onComplete:p})},"replace-pump":({holder:l,pump:a,onComplete:p})=>n.jsx(lo,{pump:a??l.pumps.data[0],onComplete:p}),"rfid-override":uo,"replace-line":({holder:l,onComplete:a})=>n.jsx(co,{holder:l,onComplete:a})}),[]),[s,r]=u.useState(void 0),i=s?o[s]:void 0;return{holderExperience:i?n.jsx(i,{holder:e,pump:t,onComplete:()=>{console.log("onComplete"),r(void 0)}}):void 0,setHolderExperience:r,currentExperienceId:s}},Ee=u.createContext(void 0),an=({children:e,value:t})=>n.jsx(Ee.Provider,{value:t,children:e}),cn=e=>({HolderContent:void 0}),Le=(e,t=cn)=>{const o=u.useContext(Ee);return t=(o==null?void 0:o.actionFactory)||t,t(e)},Fe=()=>{const e=S.IngredientSummary.type;return d.useKosModel({modelId:e,modelType:S.IngredientSummary.type,options:{}})};function ln(e){return()=>t=>{const{model:o,status:s,KosModelLoader:r}=Fe();return n.jsx(r,{...s,children:n.jsx(e,{...t,ingredientSummary:o})})}}const Be=()=>{const e=S.MacroAssignment.type;return d.useKosModel({modelId:e,modelType:S.MacroAssignment.type,options:{}})};function Gt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Be();return n.jsx(r,{...s,children:n.jsx(e,{...t,macroAssignment:o})})}}const Ke=e=>{const t=e;return d.useKosModel({modelId:t,modelType:S.NetworkTest.type,options:{}})};function dn(e){return t=>o=>{const{model:s,status:r,KosModelLoader:i}=Ke(t);return n.jsx(i,{...r,children:n.jsx(e,{...o,networkTest:s})})}}const Ne=()=>{const e=S.NetworkTestContainer.type;return d.useKosModel({modelId:e,modelType:S.NetworkTestContainer.type,options:{}})};function qt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ne();return n.jsx(r,{...s,children:n.jsx(e,{...t,networkTestContainer:o})})}}const Xt=()=>{const e=S.NutritiveSweetener.type;return d.useKosModel({modelId:e,modelType:S.NutritiveSweetener.type,options:{}})};function un(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Xt();return n.jsx(r,{...s,children:n.jsx(e,{...t,nutritiveSweetener:o})})}}const Yt=()=>{const e=S.PlainWater.type;return d.useKosModel({modelId:e,modelType:S.PlainWater.type,options:{},destroyOnUnmount:!0})};function pn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Yt();return n.jsx(r,{...s,children:n.jsx(e,{...t,plainWater:o})})}}const mn=e=>{switch(e.type){case"fcm":return S.FcmPump.type;case"lfcv":return S.LfcvPump.type;default:return}},K="pluginVisibility",ue=new Map;d.registerExtensionPoint(K,{register:(e,t)=>{var o;ue.has(e)||ue.set(e,[]),(o=ue.get(e))==null||o.push(t)},execute:(e,t,o)=>{const s=ue.get(e);if(!s)return!0;const r=s.map(i=>i(t,o));return r.length===0?!0:!r.includes(!1)}});class Zt{constructor(t,o){I(this,"core");I(this,"dispense");this.core=t,this.dispense=o}registerDashboardVisibilityFilter(t){return d.ExtensionManager[K].register(K,t),this}registerNavVisibilityFilter(t){return d.ExtensionManager[K].register(K,t),this}}class gn{constructor(){I(this,"dispense");I(this,"core");I(this,"plugin");this.dispense=new ke.DispenseExtensionManager,this.core=new d.CoreExtensionManager,this.plugin=new Zt(this.core,this.dispense)}}const he=e=>e?Qt(e.type):{action:"",label:"",progress:"",summary:""},Qt=e=>{const t=`troubles:troubles.${e}`;return{action:`${t}.action`,label:`${t}.label`,progress:`${t}.progress`,summary:`${t}.summary`}},Z=e=>{const{getExtensions:t}=N.useKosPluginsContext();return{getExtensions:u.useCallback(s=>t(s).filter(l=>{const a=l.id;return d.ExtensionManager[K].execute(K,a,e)}),[t,e])}},fe=()=>{const e=S.Reboot.type;return d.useKosModel({modelId:e,modelType:S.Reboot.type,options:{}})};function xn(e){return()=>t=>{const{model:o,status:s,KosModelLoader:r}=fe();return n.jsx(r,{...s,children:n.jsx(e,{...t,reboot:o})})}}const Ce=()=>{const e=S.Settings.type;return d.useKosModel({modelId:e,modelType:S.Settings.type,options:{}})};function Re(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ce();return n.jsx(r,{...s,children:n.jsx(e,{...t,settings:o})})}}const Oe=e=>{const t=e;return d.useKosModel({modelId:t,modelType:S.SetupStep.type,options:{}})};function hn(e){return t=>o=>{const{model:s,status:r,KosModelLoader:i}=Oe(t);return n.jsx(i,{...r,children:n.jsx(e,{...o,setupStep:s})})}}const $e=()=>{const e=S.SetupStepContainer.type;return d.useKosModel({modelId:e,modelType:S.SetupStepContainer.type,options:{}})};function Jt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=$e();return n.jsx(r,{...s,children:n.jsx(e,{...t,setupStepContainer:o})})}}const eo=()=>{const e=S.Start.type;return d.useKosModel({modelId:e,modelType:S.Start.type,options:{}})};function fn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=eo();return n.jsx(r,{...s,children:n.jsx(e,{...t,start:o})})}}const Ve=()=>{const e=S.TroubleActionManager.type,{getExtensions:t}=Z(),o=t(M.EXTENSION_POINT_TROUBLE_ACTION).map(r=>r.data);return d.useKosModel({modelId:e,modelType:S.TroubleActionManager.type,options:{definitions:o}})};function Cn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ve();return n.jsx(r,{...s,children:n.jsx(e,{...t,troubleAction:o})})}}const bn=({troubleType:e,condition:t})=>{const{model:o}=d.useTroubleContainerModel(),[s,r]=u.useState(!1),[i,l]=u.useState([]);return u.useEffect(()=>d.kosAutoEffect(()=>{const p=(e?o==null?void 0:o.troubles.getIndexByKey("byType",e):o==null?void 0:o.troubles.data)||[],m=t?p.filter(t):p;r(m.length>0),l(m)}),[t,o,e]),[s,i.length>0?i[0]:void 0,i]},He=e=>{const t=e;return d.useKosModel({modelId:t,modelType:S.Utilities.type,options:{}})};function vn(e){return t=>o=>{const{model:s,status:r,KosModelLoader:i}=He(t);return n.jsx(i,{...r,children:n.jsx(e,{...o,utilities:s})})}}const _e=()=>{const e=S.UtilitiesContainer.type;return d.useKosModel({modelId:e,modelType:S.UtilitiesContainer.type,options:{}})};function yn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=_e();return n.jsx(r,{...s,children:n.jsx(e,{...t,utilitiesContainer:o})})}}const to=d.withDevice(d.kosComponent(({device:e})=>{const{t}=d.useKosTranslation("dispenser-profile"),s=e.serialNumber==="unassigned"?void 0:e.serialNumber;return n.jsx(c.InfoCard,{label:t("dispenser-serial"),value:s})})),wn=Ut(d.kosComponent(({dispenserInfo:e})=>{const{t}=d.useKosTranslation("dispenser-profile");return n.jsxs(n.Fragment,{children:[n.jsx(Lt,{label:t("dispenser-name","Dispenser Name"),configProperty:e.name}),n.jsx(to,{})]})})),jn=Re(d.kosComponent(({settings:e})=>{const{t}=d.useKosTranslation("dispenser-profile"),o=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return n.jsxs(n.Fragment,{children:[n.jsx(me,{closeButtonLabel:t("close","Close")||void 0,configProperty:e==null?void 0:e.name,isValid:o,label:t("dispenser-name","Dispenser Name"),layout:"alphanumeric",maxLength:25}),n.jsx(Rt,{label:t("activate-and-reboot-time"),configProperty:e.activateAndRebootTime})]})})),oo=w(c.LabelDate)`
|
|
139
|
+
`,Rt=({configProperties:e,disabled:t,enabledConfigProperty:o})=>{const{value:s}=l.useConfigProperty({configProperty:o}),r=s==="true",{componentModeOverride:c}=a.useComponentConfigurationContext(),d=e.length===1,i=d?qo:Nt;return n.jsxs(Wo,{disabled:!r||t,mode:c,children:[n.jsx(Go,{children:e.map(p=>n.jsx(i,{disabled:!r||t,label:p.options?p.options.label:void 0,configProperty:p.configProperty,collapse:!d&&c==="standard",layout:p.options?p.options.layout:void 0,float:!0,hideUnits:p.options?p.options.hideUnits:void 0},p.configProperty.id))}),n.jsx(Xo,{compact:!d||c==="compact",children:n.jsx(X,{alwaysShowLabel:!0,collapse:!0,configProperty:o,disabled:t,stretch:c==="compact"})})]})},Yo=({configProperty:e,disabled:t,enabledConfigProperty:o,options:s})=>{const r=u.useMemo(()=>[{configProperty:e,options:s}],[e,s]);return n.jsx(Rt,{configProperties:r,disabled:t,enabledConfigProperty:o})},Ot=({configProperty:e,...t})=>{const{value:o}=l.useConfigProperty({configProperty:e}),s=r=>{r!==void 0&&(e==null||e.updateProperty(String(r)))};return n.jsx(a.SwitchCard,{...t,onChange:s,value:o})},$t=({description:e,float:t,label:o,modalTitle:s,onSave:r,time:c,...d})=>{const{regionModel:i}=l.useKosRegions(),{t:p}=l.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:m,formattedTime:x,hourOptions:g,minuteOptions:f,setTime:h,time:w}=l.useRegionTimeProps({initialDate:c}),S=w.getHours(),y=u.useMemo(()=>[{id:"hr",items:g,selectedItemId:S<12?S:S-12,loop:!0},{id:"min",items:f,selectedItemId:w.getMinutes(),loop:!0},{id:"ampm",items:m,selectedItemId:S<12?"AM":"PM"}],[m,g,f,w,S]),k=u.useMemo(()=>[{id:"hr",items:g,selectedItemId:S,loop:!0},{id:"min",items:f,selectedItemId:w.getMinutes(),loop:!0}],[g,f,w,S]);return n.jsx(a.MultiPickerCard,{...d,cancelButtonLabel:p("discard-changes","Discard Changes")||void 0,closeButtonLabel:p("close","Close")||void 0,data:i!=null&&i.is12HourTimeFormat?y:k,description:e,displayValue:x,float:t,icon:H.TimeIcon,label:o,modalTitle:s,proceedButtonLabel:p("save","Save")||void 0,onSave:P=>{const T=i!=null&&i.is12HourTimeFormat?P.ampm==="AM"?P.hr:P.hr+12:P.hr,C=P.min,b=new Date(w);b.setHours(T),b.setMinutes(C),h(b),r==null||r({hours:T,minutes:C})}})},Vt=({configProperty:e,...t})=>{var x;const{getStagedChange:o,updateStagedChange:s}=De(),{value:r}=l.useConfigProperty({configProperty:e}),c=((x=o==null?void 0:o(e.id))==null?void 0:x.value)??r,{hours:d,minutes:i}=j.toTimeComponents(Number(c)),p=new Date;p.setHours(d),p.setMinutes(i);const m=g=>{const f=j.toSeconds(g.hours,g.minutes);s?s(e.id,{configProperty:e,value:f}):e.updateProperty(f)};return n.jsx($t,{...t,onSave:m,time:p})},Zo=[0,6],Ht=({day:e=new Date().getDate(),month:t=new Date().getMonth(),onSave:o,year:s=new Date().getFullYear(),...r})=>{var h,w,S,y,k,P;const{t:c}=l.useKosTranslation("region"),{regionModel:d}=l.useKosRegions(),i=l.useDateProps({date:{year:s,month:t,day:e},formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(d==null?void 0:d.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:Zo,yearsRange:[s-10,s+10]}}),p=u.useMemo(()=>{var T,C;return(C=(T=i==null?void 0:i.dateState)==null?void 0:T.yearsOptionsArray)==null?void 0:C.map(b=>({id:b.value,label:b.label}))},[(h=i==null?void 0:i.dateState)==null?void 0:h.yearsOptionsArray]),m=u.useMemo(()=>{var T,C;return(C=(T=i==null?void 0:i.dateState)==null?void 0:T.daysOptionsArray)==null?void 0:C.map(b=>({id:b.value,label:b.label}))},[(w=i==null?void 0:i.dateState)==null?void 0:w.daysOptionsArray]),x=u.useMemo(()=>{var T,C;return(C=(T=i==null?void 0:i.dateState)==null?void 0:T.monthsOptionsArray)==null?void 0:C.map(b=>({id:b.value,label:String(b.label)}))},[(S=i==null?void 0:i.dateState)==null?void 0:S.monthsOptionsArray]),g=u.useMemo(()=>{const T=[];return d==null||d.selectedDateOrder.split("").forEach(C=>{var b,D,E;C==="y"?T.push({id:"year",items:p,selectedItemId:(b=i==null?void 0:i.dateState)==null?void 0:b.year,loop:!1}):C==="m"?T.push({id:"month",items:x,selectedItemId:(D=i==null?void 0:i.dateState)==null?void 0:D.month}):C==="d"&&T.push({id:"day",items:m,selectedItemId:(E=i==null?void 0:i.dateState)==null?void 0:E.day,loop:!1})}),T},[(y=i==null?void 0:i.dateState)==null?void 0:y.day,(k=i==null?void 0:i.dateState)==null?void 0:k.month,(P=i==null?void 0:i.dateState)==null?void 0:P.year,m,x,d==null?void 0:d.selectedDateOrder,p]),f=u.useCallback(async T=>{const b=new Date(T.year,T.month+1,0).getDate(),D=T.day>b?1:T.day;o({day:D,month:T.month,year:T.year})},[o]);return n.jsx(a.MultiPickerCard,{cancelButtonLabel:c("discard-changes","Discard Changes")||void 0,closeButtonLabel:c("close","Close")||void 0,data:g,displayValue:i.dateState.formattedDate,icon:H.CalendarIcon,label:c("todays-date","Today's Date"),onSave:f,proceedButtonLabel:c("save","Save")||void 0,...r})},_t=l.kosComponent(({pump:e,onComplete:t})=>{const{t:o}=l.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,r]=u.useState("idle"),[c,d]=u.useState(),i=u.useCallback(async()=>{r("test"),d(void 0);const m=await e.performElectricalTest();m.error?(d(m.error),r("failure")):m.result==="errEEPROM"?(d("errEEPROM"),r("failure")):r("success")},[e]),p=u.useMemo(()=>({idle:{information:n.jsx(a.LabelInformation,{children:o("perform-electrical-test")}),footer:n.jsx(a.Button,{onPointerDown:i,children:o("electrical-test")})},test:{information:n.jsx(a.LabelInformation,{children:o("testing")}),footer:n.jsx(a.Button,{disabled:!0,children:o("electrical-test")}),status:"loading"},success:{information:n.jsx(a.LabelInformation,{children:o("electrical-test-success-header")}),footer:n.jsx(a.Button,{onPointerDown:i,children:o("electrical-test")}),status:"success"},failure:{information:n.jsxs(n.Fragment,{children:[n.jsx(a.LabelInformation,{children:o("electrical-test-failure-header")}),n.jsx(a.BodyMediumInformation,{children:o(`error.${c}`)})]}),footer:n.jsx(a.Button,{onPointerDown:i,children:o("electrical-test")}),status:"information"}}),[c,o,i]);return n.jsx(a.WorkflowModal,{title:o(e.name),...p[s],onClose:()=>t()})}),Pe={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},Qo=e=>{const[t,o]=u.useState(null),[s,r]=u.useState(Pe),c=e.map(d=>{const[i,,p]=d;return[i==null?void 0:i.future,i,p]}).flat();return u.useEffect(()=>{const d=e.find(i=>{const[p]=i;return!!(p!=null&&p.future)});d?(o(d[0]),r(d[2])):(o(null),r(Pe))},[...c,e]),[t,s]},Jo=e=>{switch(e){case"calibrate":return ft;case"fixed-45":return bt;case"flush":return Ct;case"high-flow-test":return vt;case"hold-to-pour":return yt;case"low-flow-test":return wt;case"manual-override":return jt;case"msv-reset":return St;case"prime":return kt;case"purge":return Tt;default:return}},en=e=>(t,o="intents")=>({title:e(`${o}:troubles.${t}.progress`),summary:e(`${o}:troubles.${t}.summary`),successMessage:e(`${o}:troubles.${t}.success`),failureMessage:e(`${o}:troubles.${t}.error`),actionLabel:e(`${o}:troubles.${t}.action`)}),Y=(e,t=Jo)=>{const{t:o}=l.useKosTranslation("troubles"),[s,r]=u.useState(null),[c,d]=u.useState(Pe),i=u.useCallback(async p=>{const m=t(p);if(m){const x=en(o)(p);d(x);const g=new m(e);await g.performAction(),r(g)}},[t,e,o]);return[s,i,c]},tn=e=>(l.KosLog.debug(`pumpActionFactory: actionId=${e}`),It),on=e=>(t,o="troubles")=>({title:e(`${o}:troubles.${t}.progress`),summary:e(`${o}:troubles.${t}.summary`),successMessage:e(`${o}:troubles.${t}.success`),failureMessage:e(`${o}:troubles.${t}.error`),actionLabel:e(`${o}:troubles.${t}.action`)}),nn=(e,t,o=tn)=>{const{t:s}=l.useKosTranslation("troubles"),[r,c]=u.useState(null),[d]=u.useState(on(s)(t)),i=u.useCallback(async()=>{const p=o(t);if(p){const m=new p(e,t);await m.performAction(),c(m)}},[o,e,t]);return[r,i,d]};function sn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ae();return n.jsx(r,{...s,children:n.jsx(e,{...t,agitationControl:o})})}}const Ee=()=>{const e=j.Animation.type;return l.useKosModel({modelId:e,modelType:j.Animation.type,options:{}})};function Ut(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ee();return n.jsx(r,{...s,children:n.jsx(e,{...t,animation:o})})}}const Z=()=>{const e=j.Application.type;return l.useKosModel({modelId:e,modelType:j.Application.type,options:{}})};function rn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Z();return n.jsx(r,{...s,children:n.jsx(e,{...t,application:o})})}}const zt=()=>{const e=j.CarbWater.type;return l.useKosModel({modelId:e,modelType:j.CarbWater.type,options:{}})};function an(e){return t=>{const{model:o,status:s,KosModelLoader:r}=zt();return n.jsx(r,{...s,children:n.jsx(e,{...t,carbWater:o})})}}const Wt=()=>{const e=j.CopyLogs.type;return l.useKosModel({modelId:e,modelType:j.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function cn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Wt();return n.jsx(r,{...s,children:n.jsx(e,{...t,copyLogs:o})})}}const Le=()=>{const e=j.DashboardOperations.type;return l.useKosModel({modelId:e,modelType:j.DashboardOperations.type,options:{}})};function ln(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Le();return n.jsx(r,{...s,children:n.jsx(e,{...t,dashboardOperations:o})})}}const Fe=()=>{const e=j.DispenserInfo.type;return l.useKosModel({modelId:e,modelType:j.DispenserInfo.type,options:{}})};function Gt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Fe();return n.jsx(r,{...s,children:n.jsx(e,{...t,dispenserInfo:o})})}}const qt=e=>{const t=e;return l.useKosModel({modelId:t,modelType:j.Door.type,options:{}})};function dn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=qt(t.id);return n.jsx(r,{...s,children:n.jsx(e,{...t,door:o})})}}const dt={[L.EXTENSION_POINT_SETUP]:"setupDescriptor",[L.EXTENSION_POINT_CUI]:"cuiDescriptor",[L.EXTENSION_POINT_UTIL]:"utilDescriptor"},Xt=({defaultNamespace:e,extensionPoint:t})=>{const{getExtensions:o}=N.useKosPluginsContext(),s=o(t),r=s.map(p=>p.data.namespace)||[],{t:c}=l.useKosTranslation([e,...new Set(r)]),d=s.reduce((p,m)=>{const x=m;return p[x.data[dt[t]]]={extension:t,module:x.id,namespace:x.data.namespace,title:x.data.title},p},{}),i=s.reduce((p,m)=>{const x=m;return p[x.data[dt[t]]]=`${x.data.namespace}:${x.data.title}`,p},{});return{namespaces:r,t:c,labelMap:i,contributionMap:d}},fe=(e,t)=>{const o=u.useMemo(()=>({agitate:At,calibrate:({holder:d,pump:i,onComplete:p})=>{const m=l.getKosCompanionModel(i??d.pumps.data[0],j.FcmPump.type);return n.jsx(Ft,{pump:m,onComplete:p})},calibrateSPM:({holder:d,pump:i,onComplete:p})=>{const m=l.getKosCompanionModel(i??d.pumps.data[0],j.SpmPump.type);return n.jsx(bo,{pump:m,onComplete:p})},diagnostics:({holder:d,pump:i,onComplete:p})=>{const m=l.getKosCompanionModel(i??d.pumps.data[0],j.FcmPump.type);return n.jsx(_t,{pump:m,onComplete:p})},"replace-pump":({holder:d,pump:i,onComplete:p})=>n.jsx(mo,{pump:i??d.pumps.data[0],onComplete:p}),"rfid-override":go,"replace-line":({holder:d,onComplete:i})=>n.jsx(po,{holder:d,onComplete:i})}),[]),[s,r]=u.useState(void 0),c=s?o[s]:void 0;return{holderExperience:c?n.jsx(c,{holder:e,pump:t,onComplete:()=>{console.log("onComplete"),r(void 0)}}):void 0,setHolderExperience:r,currentExperienceId:s}},Me=u.createContext(void 0),un=({children:e,value:t})=>n.jsx(Me.Provider,{value:t,children:e}),pn=e=>({HolderContent:void 0}),Be=(e,t=pn)=>{const o=u.useContext(Me);return t=(o==null?void 0:o.actionFactory)||t,t(e)},Ke=()=>{const e=j.IngredientSummary.type;return l.useKosModel({modelId:e,modelType:j.IngredientSummary.type,options:{}})};function mn(e){return()=>t=>{const{model:o,status:s,KosModelLoader:r}=Ke();return n.jsx(r,{...s,children:n.jsx(e,{...t,ingredientSummary:o})})}}const Ne=()=>{const e=j.MacroAssignment.type;return l.useKosModel({modelId:e,modelType:j.MacroAssignment.type,options:{}})};function Yt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ne();return n.jsx(r,{...s,children:n.jsx(e,{...t,macroAssignment:o})})}}const Re=e=>{const t=e;return l.useKosModel({modelId:t,modelType:j.NetworkTest.type,options:{}})};function gn(e){return t=>o=>{const{model:s,status:r,KosModelLoader:c}=Re(t);return n.jsx(c,{...r,children:n.jsx(e,{...o,networkTest:s})})}}const Oe=()=>{const e=j.NetworkTestContainer.type;return l.useKosModel({modelId:e,modelType:j.NetworkTestContainer.type,options:{}})};function Zt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Oe();return n.jsx(r,{...s,children:n.jsx(e,{...t,networkTestContainer:o})})}}const Qt=()=>{const e=j.NutritiveSweetener.type;return l.useKosModel({modelId:e,modelType:j.NutritiveSweetener.type,options:{}})};function xn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Qt();return n.jsx(r,{...s,children:n.jsx(e,{...t,nutritiveSweetener:o})})}}const Jt=()=>{const e=j.PlainWater.type;return l.useKosModel({modelId:e,modelType:j.PlainWater.type,options:{},destroyOnUnmount:!0})};function hn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Jt();return n.jsx(r,{...s,children:n.jsx(e,{...t,plainWater:o})})}}const fn=e=>{switch(e.type){case"fcm":return j.FcmPump.type;case"lfcv":return j.LfcvPump.type;case"micro":return j.SpmPump.type;default:return}},K="pluginVisibility",pe=new Map;l.registerExtensionPoint(K,{register:(e,t)=>{var o;pe.has(e)||pe.set(e,[]),(o=pe.get(e))==null||o.push(t)},execute:(e,t,o)=>{const s=pe.get(e);if(!s)return!0;const r=s.map(c=>c(t,o));return r.length===0?!0:!r.includes(!1)}});class eo{constructor(t,o){I(this,"core");I(this,"dispense");this.core=t,this.dispense=o}registerDashboardVisibilityFilter(t){return l.ExtensionManager[K].register(K,t),this}registerNavVisibilityFilter(t){return l.ExtensionManager[K].register(K,t),this}}class bn{constructor(){I(this,"dispense");I(this,"core");I(this,"plugin");this.dispense=new Ie.DispenseExtensionManager,this.core=new l.CoreExtensionManager,this.plugin=new eo(this.core,this.dispense)}}const be=e=>e?to(e.type):{action:"",label:"",progress:"",summary:""},to=e=>{const t=`troubles:troubles.${e}`;return{action:`${t}.action`,label:`${t}.label`,progress:`${t}.progress`,summary:`${t}.summary`}},Q=e=>{const{getExtensions:t}=N.useKosPluginsContext();return{getExtensions:u.useCallback(s=>t(s).filter(d=>{const i=d.id;return l.ExtensionManager[K].execute(K,i,e)}),[t,e])}},Ce=()=>{const e=j.Reboot.type;return l.useKosModel({modelId:e,modelType:j.Reboot.type,options:{}})};function Cn(e){return()=>t=>{const{model:o,status:s,KosModelLoader:r}=Ce();return n.jsx(r,{...s,children:n.jsx(e,{...t,reboot:o})})}}const ve=()=>{const e=j.Settings.type;return l.useKosModel({modelId:e,modelType:j.Settings.type,options:{}})};function $e(e){return t=>{const{model:o,status:s,KosModelLoader:r}=ve();return n.jsx(r,{...s,children:n.jsx(e,{...t,settings:o})})}}const Ve=e=>{const t=e;return l.useKosModel({modelId:t,modelType:j.SetupStep.type,options:{}})};function vn(e){return t=>o=>{const{model:s,status:r,KosModelLoader:c}=Ve(t);return n.jsx(c,{...r,children:n.jsx(e,{...o,setupStep:s})})}}const He=()=>{const e=j.SetupStepContainer.type;return l.useKosModel({modelId:e,modelType:j.SetupStepContainer.type,options:{}})};function oo(e){return t=>{const{model:o,status:s,KosModelLoader:r}=He();return n.jsx(r,{...s,children:n.jsx(e,{...t,setupStepContainer:o})})}}const no=()=>{const e=j.Start.type;return l.useKosModel({modelId:e,modelType:j.Start.type,options:{}})};function yn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=no();return n.jsx(r,{...s,children:n.jsx(e,{...t,start:o})})}}const _e=()=>{const e=j.TroubleActionManager.type,{getExtensions:t}=Q(),o=t(L.EXTENSION_POINT_TROUBLE_ACTION).map(r=>r.data);return l.useKosModel({modelId:e,modelType:j.TroubleActionManager.type,options:{definitions:o}})};function wn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=_e();return n.jsx(r,{...s,children:n.jsx(e,{...t,troubleAction:o})})}}const jn=({troubleType:e,condition:t})=>{const{model:o}=l.useTroubleContainerModel(),[s,r]=u.useState(!1),[c,d]=u.useState([]);return u.useEffect(()=>l.kosAutoEffect(()=>{const p=(e?o==null?void 0:o.troubles.getIndexByKey("byType",e):o==null?void 0:o.troubles.data)||[],m=t?p.filter(t):p;r(m.length>0),d(m)}),[t,o,e]),[s,c.length>0?c[0]:void 0,c]},Ue=e=>{const t=e;return l.useKosModel({modelId:t,modelType:j.Utilities.type,options:{}})};function Sn(e){return t=>o=>{const{model:s,status:r,KosModelLoader:c}=Ue(t);return n.jsx(c,{...r,children:n.jsx(e,{...o,utilities:s})})}}const ze=()=>{const e=j.UtilitiesContainer.type;return l.useKosModel({modelId:e,modelType:j.UtilitiesContainer.type,options:{}})};function kn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=ze();return n.jsx(r,{...s,children:n.jsx(e,{...t,utilitiesContainer:o})})}}const so=l.withDevice(l.kosComponent(({device:e})=>{const{t}=l.useKosTranslation("dispenser-profile"),s=e.serialNumber==="unassigned"?void 0:e.serialNumber;return n.jsx(a.InfoCard,{label:t("dispenser-serial"),value:s})})),Tn=Gt(l.kosComponent(({dispenserInfo:e})=>{const{t}=l.useKosTranslation("dispenser-profile");return n.jsxs(n.Fragment,{children:[n.jsx(Kt,{label:t("dispenser-name","Dispenser Name"),configProperty:e.name}),n.jsx(so,{})]})})),Pn=$e(l.kosComponent(({settings:e})=>{const{t}=l.useKosTranslation("dispenser-profile"),o=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return n.jsxs(n.Fragment,{children:[n.jsx(xe,{closeButtonLabel:t("close","Close")||void 0,configProperty:e==null?void 0:e.name,isValid:o,label:t("dispenser-name","Dispenser Name"),layout:"alphanumeric",maxLength:25}),n.jsx(Vt,{label:t("activate-and-reboot-time"),configProperty:e.activateAndRebootTime})]})})),ro=v(a.LabelDate)`
|
|
140
140
|
color: var(--ddk-generic-color-grey-60);
|
|
141
141
|
font-size: var(--ddk-component-enjoy-by-font-size-small);
|
|
142
142
|
font-weight: var(--ddk-component-enjoy-by-font-weight-small);
|
|
143
|
-
`,
|
|
143
|
+
`,In=v(a.LabelDate)`
|
|
144
144
|
color: var(--ddk-component-dashboard-enjoy-by-trouble-warning-color);
|
|
145
|
-
`,
|
|
145
|
+
`,An=v(ro)`
|
|
146
146
|
color: var(--ddk-component-dashboard-enjoy-by-trouble-warning-color);
|
|
147
|
-
`,
|
|
147
|
+
`,io=({holder:e,size:t})=>{const{t:o}=l.useKosTranslation("common"),{regionModel:s}=l.useKosRegions(),r=!!e.enjoyByDate,c=e.enjoyByDate??new Date,{formattedDate:d}=l.useFormattedDate({year:c.getFullYear(),month:c.getMonth(),day:c.getDay(),formatString:(s==null?void 0:s.selectedDateFormat)||""}),i=e.hasEnjoyByWarning?t==="small"?An:In:t==="small"?ro:a.LabelDate;return r&&n.jsx(i,{children:o("enjoy-by",{data:{date:d}})})},Dn=({item:e,valueKey:t})=>{const{t:o}=l.useKosTranslation("hardware-info"),{linked:s}=e;if(t==="link.serialNum"&&!s)return n.jsx(a.LabelInformationExtraSmall,{children:o("not-connected")});const r=a.getItemData(e,t);return r||"—"},En=v(a.Table)`
|
|
148
148
|
& ul {
|
|
149
149
|
list-style-type: none;
|
|
150
150
|
margin: 0;
|
|
151
151
|
padding: 0;
|
|
152
152
|
}
|
|
153
|
-
`,
|
|
153
|
+
`,Ln=l.kosComponent(()=>{const{model:e}=Ie.useBoardContainer(),{t}=l.useKosTranslation("hardware-info"),o=(e==null?void 0:e.boardList.map(s=>{var r,c,d;return{...s,link:{...s.link,firmwareVersions:(r=s.link)!=null&&r.firmwareVersions&&s.link.firmwareVersions.length>0?n.jsx("ul",{children:(d=(c=s.link)==null?void 0:c.firmwareVersions)==null?void 0:d.map((i,p)=>n.jsx("li",{children:i},p))}):"—"}}}))||[];return e&&e.boardList&&n.jsx(En,{CellRenderer:Dn,data:o,dataKeys:["name","type","link.hardwareVersion","link.serialNum","link.firmwareVersions"],headers:[t("name"),t("type"),t("revision"),t("serial-number"),t("firmware")],heading:t("tower")||void 0})}),J=({disabled:e,model:t,onPour:o,onPourCancel:s,...r})=>{const{t:c}=l.useKosTranslation("common"),[d,i]=u.useState(t.isPouring?"halt":"idle"),p=u.useRef(),m=u.useRef(!1),x=250;u.useEffect(()=>l.kosAutoEffect(()=>{t.isPouring||(m.current=!1,clearTimeout(p.current),p.current=void 0,i("idle"))}),[t]),u.useEffect(()=>()=>{t.isPouring&&t.cancelPour()},[t]);const g=u.useCallback(()=>{t&&(e||t.isPouring||(t.performIntent("HOLD_TO_POUR"),p.current=setTimeout(()=>{m.current=!0,p.current=void 0,i("run")},x)))},[e,t]),f=u.useCallback(()=>{t&&(m.current?(t.cancelPour(),m.current=!1,i("idle")):p.current?(clearTimeout(p.current),p.current=void 0,i("halt")):t.isPouring&&(t.cancelPour(),i("idle")))},[t]),h=u.useCallback(()=>{d!=="halt"&&f()},[f,d]);return n.jsx(a.TapAndHoldButton,{disabled:e,mode:"primary",onPointerCancel:f,onPointerDown:g,onPointerOut:h,onPointerUp:f,...r,state:d,children:c(c(d==="idle"?"tapOrHoldToPour":d==="run"?"releaseToStop":"stop"))})},We=u.createContext(void 0),Fn=({children:e})=>{const{model:t,ready:o}=Ee(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(We.Provider,{value:s,children:e})},Mn=()=>{const e=u.useContext(We);if(!e)throw new Error("useAnimationContext must be used within a AnimationProvider");return e},Bn=Ut(({animation:e,animationOverrides:t,children:o,componentModeOverride:s,modalModeOverride:r})=>{const[c,d]=u.useState(!0),[i,p]=u.useState(!0),[m,x]=u.useState(!0);return u.useEffect(()=>{const g=l.kosAutoEffect(()=>{const f=!!(!(t!=null&&t.disableAll)&&(t!=null&&t.enableDial))&&!!(!e.disableAll.value&&e.enableDial.value),h=!!(!(t!=null&&t.disableAll)&&(t!=null&&t.enableModal))&&!!(!e.disableAll.value&&e.enableModal.value),w=!!(!(t!=null&&t.disableAll)&&(t!=null&&t.enableSideBar))&&!!(!e.disableAll.value&&e.enableSideBar.value);d(f),p(h),x(w)});return()=>{g()}},[e,t==null?void 0:t.disableAll,t==null?void 0:t.enableDial,t==null?void 0:t.enableModal,t==null?void 0:t.enableSideBar]),n.jsx(a.ComponentConfigurationProvider,{value:{componentModeOverride:s,enableDialAnimation:c,enableModalAnimation:i,enableSidebarAnimation:m,modalModeOverride:r},children:o})}),Ge=u.createContext(void 0),Kn=({children:e})=>{const{model:t,ready:o}=Z(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(Ge.Provider,{value:s,children:e})},ye=()=>{const e=u.useContext(Ge);if(!e)throw new Error("useApplicationContext must be used within a ApplicationProvider");return e},qe=u.createContext(void 0),Nn=({children:e})=>{const{model:t,ready:o}=Le(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(qe.Provider,{value:s,children:e})},Rn=()=>{const e=u.useContext(qe);if(!e)throw new Error("useDashboardOperationsContext must be used within a DashboardOperationsProvider");return e},Xe=u.createContext(void 0),On=({children:e})=>{const{model:t,ready:o}=Fe(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(Xe.Provider,{value:s,children:e})},$n=()=>{const e=u.useContext(Xe);if(!e)throw new Error("useDispenserInfoContext must be used within a DispenserInfoProvider");return e},Ye=u.createContext(void 0),Vn=({children:e})=>{const{model:t,ready:o}=Ke(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(Ye.Provider,{value:s,children:e})},Hn=()=>{const e=u.useContext(Ye);if(!e)throw new Error("useIngredientSummaryContext must be used within a IngredientSummaryProvider");return e},Ze=u.createContext(void 0),_n=({children:e})=>{const{model:t,ready:o}=Ne(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(Ze.Provider,{value:s,children:e})},Un=()=>{const e=u.useContext(Ze);if(!e)throw new Error("useMacroAssignmentContext must be used within a MacroAssignmentProvider");return e},Qe=u.createContext(void 0),zn=({children:e,id:t})=>{const{model:o,ready:s}=Re(t),r=u.useMemo(()=>s&&o?{model:o}:{},[s,o]);return n.jsx(Qe.Provider,{value:r,children:e})},Wn=()=>{const e=u.useContext(Qe);if(!e)throw new Error("useNetworkTestContext must be used within a NetworkTestProvider");return e},Je=u.createContext(void 0),Gn=({children:e})=>{const{model:t,ready:o}=Oe(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(Je.Provider,{value:s,children:e})},qn=()=>{const e=u.useContext(Je);if(!e)throw new Error("useNetworkTestContainerContext must be used within a NetworkTestContainerProvider");return e},et=u.createContext(void 0),Xn=({children:e})=>{const{model:t,ready:o}=Ce(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(et.Provider,{value:s,children:e})},Yn=()=>{const e=u.useContext(et);if(!e)throw new Error("useRebootContext must be used within a RebootProvider");return e},tt=u.createContext(void 0),Zn=({children:e})=>{const{model:t,ready:o}=ve(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(tt.Provider,{value:s,children:e})},Qn=()=>{const e=u.useContext(tt);if(!e)throw new Error("useSettingsContext must be used within a SettingsProvider");return e},ot=u.createContext(void 0),Jn=({children:e,id:t})=>{const{model:o,ready:s}=Ve(t),r=u.useMemo(()=>s&&o?{model:o}:{},[s,o]);return n.jsx(ot.Provider,{value:r,children:e})},es=()=>{const e=u.useContext(ot);if(!e)throw new Error("useSetupStepContext must be used within a SetupStepProvider");return e},nt=u.createContext(void 0),ts=({children:e})=>{const{model:t,ready:o}=He(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(nt.Provider,{value:s,children:e})},os=()=>{const e=u.useContext(nt);if(!e)throw new Error("useSetupStepContainerContext must be used within a SetupStepContainerProvider");return e},st=u.createContext(void 0),ns=({children:e,id:t})=>{const{model:o,ready:s}=Ue(t),r=u.useMemo(()=>s&&o?{model:o}:{},[s,o]);return n.jsx(st.Provider,{value:r,children:e})},ss=()=>{const e=u.useContext(st);if(!e)throw new Error("useUtilitiesContext must be used within a UtilitiesProvider");return e},rt=u.createContext(void 0),rs=({children:e})=>{const{model:t,ready:o}=ze(),s=u.useMemo(()=>o&&t?{model:t}:{},[o,t]);return n.jsx(rt.Provider,{value:s,children:e})},is=()=>{const e=u.useContext(rt);if(!e)throw new Error("useUtilitiesContainerContext must be used within a UtilitiesContainerProvider");return e},ee=e=>{const{model:t}=ye(),[o,s]=u.useState(),r=t==null?void 0:t.currentRole,c=!!o;return u.useLayoutEffect(()=>{const d=l.kosAutoEffect(()=>{const i=e.troubles.filter(j.troubleVisibilityFilter(r));s(p=>{const m=p??[];return i.length!==m.length||i.some(x=>!m.includes(x))?i:m})});return()=>{d()}},[e,r]),{visibleTroubles:o,initialized:c}},as=l.KosLog.createLogger({name:"holder-group-view"});as.debug("holder-group-view component loaded");const ut=v.div`
|
|
154
154
|
align-items: start;
|
|
155
155
|
|
|
156
156
|
display: flex;
|
|
@@ -160,29 +160,29 @@
|
|
|
160
160
|
text-overflow: ellipsis;
|
|
161
161
|
width: 100%;
|
|
162
162
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
163
|
-
`,
|
|
163
|
+
`,cs=v.div`
|
|
164
164
|
display: flex;
|
|
165
165
|
align-items: center;
|
|
166
166
|
justify-content: center;
|
|
167
167
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
168
|
-
`,
|
|
168
|
+
`,ls=v.div`
|
|
169
169
|
font-size: var(--ddk-component-holder-card-footer-font-size);
|
|
170
170
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
171
|
-
`,
|
|
171
|
+
`,ds=e=>!e||e==="white",us=e=>e?void 0:"white",ps=(e,t)=>t&&t.hasEnjoyByWarning?"var(--ddk-component-dashboard-enjoy-by-trouble-warning-color)":e?void 0:"white",ao=l.kosComponent(({holder:e,onHolderSelect:t,showNavIcon:o,summaryBody:s})=>{const{model:r}=Z(),{visibleTroubles:c,initialized:d}=ee(e),i=r==null?void 0:r.currentRole,[p,m]=u.useState(),{t:x}=l.useKosTranslation("troubles"),{t:g}=l.useKosTranslation("common"),{componentModeOverride:f}=a.useComponentConfigurationContext(),h=f==="compact",{getExtensions:w}=Q(),[S,y]=u.useState(!1),k=!!e.ingredientId,P=u.useCallback(()=>{y(!1)},[]),T=(c==null?void 0:c.length)??0,C=c==null?void 0:c[0],b=T>0,D=e.hasFuelGuage,E=e.fillPercent,B=b?`${C==null?void 0:C.color}`:void 0,oe=ds(B),_=b?us(oe):k?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",je=b?ps(oe,e):k?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",ne=a.useAbbreviation(e.name,h),U=e.removed?g(e.previousIngredientName):e.unassigned?g("unassigned"):g(e.ingredientName),Se=n.jsx(ut,{color:_,children:U}),se=n.jsx(cs,{color:_,children:ne}),ke=n.jsxs(ut,{children:[e.name," ",U]}),re=k&&D&&!b&&d?s??n.jsx(a.FuelGauge,{color:b?"var(--ddk-generic-color-white)":void 0,size:"small",value:E}):null,Te=k&&D&&!b&&d&&a.getFillColor(E)||void 0,z=l.ExtensionManager.executeDashboardKeyFactory(e)||"",ie=u.useMemo(()=>w(L.EXTENSION_POINT_DASHBOARD),[w]),W=u.useMemo(()=>ie.filter(M=>!!M.data.pumpDetail).reduce((M,ue)=>(M[ue.data.pumpDetail.dashboardKey]=ue.data.pumpDetail,M),{}),[ie]),ae=!!W[z],{HolderContent:O,modalOptions:ce}=Be(e);u.useEffect(()=>{async function M(){if(C){const ue=await l.troubleDataFactory(C);m(ue)}}M()},[C]);const $=u.useMemo(()=>{var M;return O?n.jsx(O,{holder:e,onComplete:P}):ae?n.jsx(N.DynamicComponent,{extension:L.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL,module:(M=W[z])==null?void 0:M.id,props:{holder:e}}):void 0},[O,P,W,ae,e,z]),le=be(C),yo=n.jsx(ls,{color:b?_:je,children:b?x(le.summary,{context:C!=null&&C.deferred?"queued":void 0,data:p}):!h&&n.jsx(io,{size:"small",holder:e})}),{holderExperience:wo,setHolderExperience:ct}=fe(e),{future:de}=R(C),jo=u.useCallback(()=>{e.sortedPumps.length>0&&(i==="technician"?y(!0):e.unassigned||e.removed?ct("rfid-override"):b&&(t==null||t(e)))},[e,b,t,i,ct]);return n.jsxs(n.Fragment,{children:[n.jsxs(a.Modal,{contain:!h,...ce,show:S,onClose:P,children:[n.jsx(a.Header,{contain:h,showCloseButton:!0,title:ke,onClose:P,CloseButton:h?a.BackButton:void 0}),$]}),n.jsx(u.Suspense,{children:wo}),n.jsx(a.HolderDashboardCard,{avatar:se,color:B,footer:yo,cardId:e.path,errors:T,title:Se,indicatorColor:Te,body:re,showNavIcon:o,onCardSelect:jo},e.path),(C==null?void 0:C.future)&&n.jsx(A,{title:Se,future:de,failureMessage:x(`troubles.${C.type}.error`,{context:de==null?void 0:de.reason})})]})}),it=v.div`
|
|
172
172
|
display: flex;
|
|
173
173
|
flex-direction: var(--ddk-component-dashboard-card-flex-direction);
|
|
174
174
|
row-gap: var(--ddk-component-dashboard-row-gap);
|
|
175
175
|
column-gap: var(--ddk-component-dashboard-column-gap);
|
|
176
176
|
height: 100%;
|
|
177
177
|
user-select: none;
|
|
178
|
-
`,
|
|
178
|
+
`,ms=l.kosComponent(({holder:e,showNavIcons:t})=>{const o=e.troubles[0],s=()=>{o!=null&&o.resolvable&&o.resolve()};return n.jsx(ao,{holder:e,showNavIcon:t,onHolderSelect:s},e.id)}),gs=l.kosComponent(({holders:e,showNavIcons:t,...o})=>{const s=u.useMemo(()=>e.map(r=>n.jsx(ms,{holder:r,showNavIcons:!!t},r.id)),[e,t]);return n.jsx(it,{...o,children:s})}),xs=l.KosLog.createLogger({name:"holder-group-view"});xs.debug("holder-group-view component loaded");const pt=["water","carb","ns","nns"],hs=v.div`
|
|
179
179
|
display: flex;
|
|
180
180
|
flex-direction: column;
|
|
181
181
|
overflow-y: auto;
|
|
182
182
|
overflow-x: hidden;
|
|
183
183
|
justify-content: space-between;
|
|
184
184
|
height: 100%;
|
|
185
|
-
`,
|
|
185
|
+
`,mt=v.div`
|
|
186
186
|
align-items: start;
|
|
187
187
|
|
|
188
188
|
display: flex;
|
|
@@ -192,25 +192,25 @@
|
|
|
192
192
|
text-overflow: ellipsis;
|
|
193
193
|
width: 100%;
|
|
194
194
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
195
|
-
`,
|
|
195
|
+
`,fs=v.div`
|
|
196
196
|
display: flex;
|
|
197
197
|
align-items: center;
|
|
198
198
|
justify-content: center;
|
|
199
199
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
200
|
-
`,
|
|
200
|
+
`,bs=v.div`
|
|
201
201
|
font-size: var(--ddk-component-holder-card-footer-font-size);
|
|
202
202
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
203
|
-
`,
|
|
203
|
+
`,Cs=e=>!e||e==="white",vs=e=>e?void 0:"white",co=l.kosComponent(({holder:e,onHolderSelect:t,showNavIcon:o})=>{var O,ce;const{model:s}=Z(),{visibleTroubles:r,initialized:c}=ee(e),{t:d}=l.useKosTranslation(["troubles","common"]),{componentModeOverride:i}=a.useComponentConfigurationContext(),p=i==="compact",{getExtensions:m}=Q(),x=(O=s==null?void 0:s.currentRole)==null?void 0:O.toLowerCase(),[g,f]=u.useState(!1),h=!!e.ingredientId,w=(r==null?void 0:r.length)??0,S=r==null?void 0:r[0],y=r?r.length>0:!1,k=y?`${S==null?void 0:S.color}`:void 0,P=Cs(k),T=y?vs(P):h?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",C=a.useAbbreviation(e.name,i==="compact"),b=d(`common:macros.${e.name}`),D=d(`common:${e.ingredientName}`),E=h?pt.includes(e.name)?"":` ${D}`:` ${d("common:macros.unassigned")}`,B=`${b}${E}`,oe=p?pt.includes(e.name)?b:E:`${b} ${E}`,_=i==="compact"&&n.jsx(fs,{color:T,children:C}),je=n.jsx(mt,{color:T,children:oe}),ne=n.jsx(mt,{children:B}),U=l.ExtensionManager.executeDashboardKeyFactory(e)||"",se=m(L.EXTENSION_POINT_DASHBOARD).filter($=>!!$.data.pumpDetail).reduce(($,le)=>($[le.data.pumpDetail.dashboardKey]=le.data.pumpDetail,$),{}),ke=!!se[U],{HolderContent:re,modalOptions:Te}=Be(e),z=re?n.jsx(re,{holder:e,onComplete:()=>f(!1)}):ke?n.jsx(N.DynamicComponent,{extension:L.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL,module:(ce=se[U])==null?void 0:ce.id,props:{holder:e}}):null,ie=be(S),W=y?n.jsx(bs,{color:T,children:d(ie.summary)}):null,ae=u.useCallback(()=>{e.sortedPumps.length>0&&(x==="technician"?f(!0):y&&(t==null||t(e)))},[y,e,t,x]);return n.jsxs(n.Fragment,{children:[n.jsx(a.HolderDashboardCard,{avatar:_,color:k,body:y?null:n.jsx(a.StatusIndicator,{size:"small",status:y?"pending":"completed"}),footer:W,cardId:e.path,errors:w,title:je,showNavIcon:o,onCardSelect:ae},e.path),n.jsx(a.Modal,{contain:i!=="compact",...Te,show:g,onClose:()=>f(!1),children:n.jsxs(hs,{children:[n.jsx(a.Header,{contain:i==="compact",showCloseButton:!0,title:ne,onClose:()=>f(!1),CloseButton:i==="compact"?a.BackButton:void 0}),z]})}),(S==null?void 0:S.future)&&n.jsx(A,{title:ne,future:S==null?void 0:S.future})]})}),ys=l.kosComponent(({holders:e,showNavIcons:t,...o})=>n.jsx(it,{...o,children:e.map(s=>{const r=s.troubles[0];return n.jsx(co,{holder:s,showNavIcon:t,onHolderSelect:()=>{r.resolvable&&r.resolve()}},s.id)})})),ws=v(H.MessageInformationIconWithBackground)`
|
|
204
204
|
width: var(--ddk-component-macro-card-unavailable-icon-size);
|
|
205
205
|
height: var(--ddk-component-macro-card-unavailable-icon-size);
|
|
206
|
-
`,
|
|
206
|
+
`,js=v(a.UtilityModalHeading)`
|
|
207
207
|
text-align: center;
|
|
208
208
|
font-size: var(--ddk-component-sub-modal-heading-font-size-medium);
|
|
209
|
-
`,
|
|
209
|
+
`,Ss=v.div`
|
|
210
210
|
height: 100%;
|
|
211
211
|
overflow-y: auto;
|
|
212
212
|
width: 100%;
|
|
213
|
-
`,
|
|
213
|
+
`,ks=v.div`
|
|
214
214
|
display: grid;
|
|
215
215
|
gap: var(--ddk-component-macro-setup-card-gap);
|
|
216
216
|
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
justify-content: center;
|
|
221
221
|
width: 100%;
|
|
222
222
|
user-select: none;
|
|
223
|
-
`,
|
|
223
|
+
`,Ts=e=>{const{componentModeOverride:t}=a.useComponentConfigurationContext();return n.jsx(ks,{compact:t==="compact",...e})},Ps=v.div`
|
|
224
224
|
align-items: center;
|
|
225
225
|
|
|
226
226
|
background: ${e=>e.selected?"var(--ddk-generic-color-grey-5)":"var(--ddk-generic-color-white)"};
|
|
@@ -243,28 +243,56 @@
|
|
|
243
243
|
overflow-wrap: anywhere;
|
|
244
244
|
padding: var(--ddk-component-macro-setup-card-header-padding-md);
|
|
245
245
|
text-align: center;
|
|
246
|
-
`,
|
|
246
|
+
`,Is=v.div`
|
|
247
247
|
align-items: center;
|
|
248
248
|
display: flex;
|
|
249
249
|
flex-direction: column;
|
|
250
250
|
gap: 32px;
|
|
251
251
|
height: 100%;
|
|
252
252
|
justify-content: center;
|
|
253
|
-
`,
|
|
253
|
+
`,As=v.div`
|
|
254
254
|
color: var(--ddk-component-macro-card-unavailable-font-color);
|
|
255
255
|
font-size: var(--ddk-component-macro-card-unavailable-font-size);
|
|
256
256
|
font-weight: var(--ddk-component-macro-card-unavailable-font-weight);
|
|
257
|
-
`,
|
|
257
|
+
`,at=Yt(({holder:e,onComplete:t,macroAssignment:o,showCloseButton:s=!0})=>{const{t:r}=l.useKosTranslation("setup"),{t:c}=l.useKosTranslation("common"),{componentModeOverride:d}=a.useComponentConfigurationContext(),[i,p]=u.useState(e.ingredient),m=v.div`
|
|
258
258
|
display: flex;
|
|
259
259
|
flex-direction: column;
|
|
260
260
|
gap: 24px;
|
|
261
261
|
height: 100%;
|
|
262
|
-
`;return n.jsxs(m,{children:[n.jsx(
|
|
262
|
+
`;return n.jsxs(m,{children:[n.jsx(a.Content,{children:o.hasMacroIngredients?n.jsxs(n.Fragment,{children:[d==="standard"&&n.jsx(js,{children:r("select-and-assign-ingredients-for",{data:{name:c(`macros.${e.name}`)}})}),n.jsx(Ss,{children:n.jsx(Ts,{children:o.macroIngredients.map(x=>n.jsx(Ps,{selected:(i==null?void 0:i.id)===x.id,onPointerDown:()=>{i===x||p(x)},children:x.name},x.id))})})]}):n.jsxs(Is,{children:[n.jsx(ws,{}),n.jsx(As,{children:r("no-ingredients-available-for-assignment")})]})}),n.jsx(a.Footer,{children:o.hasMacroIngredients?n.jsxs(n.Fragment,{children:[d==="standard"&&s&&n.jsx(a.Button,{onPointerDown:()=>{t==null||t()},children:c("close")}),n.jsx(a.Button,{mode:"primary",disabled:!i||i.id===e.ingredientId,onPointerDown:async()=>{await e.assignIngredient(i==null?void 0:i.id),t==null||t()},children:c("assignIngredient")})]}):s!==!1&&n.jsx(a.Button,{mode:"primary",onPointerDown:()=>{t==null||t()},children:c("proceed")})})]})}),Ds=l.kosComponent(({cardModel:e})=>{l.KosLog.debug("Agitator",e.path);const{t}=l.useKosTranslation(["agitator","common"]),o=u.useCallback(r=>{r==="agitate"?e==null||e.testAgitate():r==="gate"?e==null||e.testGate():r==="pour"?e==null||e.pourIce():r==="cancelPour"&&(e==null||e.cancelIceDispense())},[e]),s=e.isAgitating||e.isIceChuteOpen;return n.jsxs(n.Fragment,{children:[n.jsxs(a.Content,{children:[n.jsx(a.FrameContainer,{name:"Ice Properties",children:n.jsxs(Es,{children:[n.jsxs(gt,{children:[n.jsxs(me,{children:[n.jsx(a.Label,{children:"Agitation Duration:"}),n.jsx(G,{children:e.durationSec.displayValue})]}),n.jsxs(me,{children:[n.jsx(a.Label,{children:"Ice Max Dispense:"}),n.jsx(G,{children:e.maxDispenseSec.displayValue})]}),n.jsxs(me,{children:[n.jsx(a.Label,{children:"Agitate After:"}),n.jsxs(G,{children:[e.inactivitySec.displayValue," Inactive"]}),n.jsxs(G,{children:[e.volWithoutIceMl.displayValue," Poured without ice"]})]})]}),n.jsx(gt,{children:n.jsxs(me,{children:[n.jsx(a.Label,{children:"Ice Type:"}),n.jsx(G,{children:e.type.displayValue})]})})]})}),n.jsx(a.InfoCard,{label:"Agitating",value:e.isAgitating?t("common:yes"):t("common:no")}),n.jsx(a.InfoCard,{label:"Ice Chute Open",value:e.isIceChuteOpen?t("common:yes"):t("common:no")})]}),n.jsxs(a.Footer,{children:[n.jsx(a.Button,{disabled:s,onPointerDown:()=>o("agitate"),children:t("action.label",{context:"agitator"})}),n.jsx(a.Button,{disabled:s,onPointerDown:()=>o("gate"),children:t("action.label",{context:"gate"})}),n.jsx(a.Button,{disabled:s,onPointerUp:()=>o("cancelPour"),onPointerDown:()=>o("pour"),children:t("action.label",{context:"pour"})})]}),e.agitateFuture&&n.jsx(A,{title:t("testing"),future:e.agitateFuture}),e.gateFuture&&n.jsx(A,{title:t("testing"),future:e.gateFuture})]})}),Es=v.div`
|
|
263
|
+
display: flex;
|
|
264
|
+
flex-direction: row;
|
|
265
|
+
align-items: center;
|
|
266
|
+
justify-content: space-between;
|
|
267
|
+
width: 100%;
|
|
268
|
+
height: 100%;
|
|
269
|
+
gap: 10px;
|
|
270
|
+
padding-block: 16px;
|
|
271
|
+
`,gt=v.div`
|
|
272
|
+
display: flex;
|
|
273
|
+
flex-direction: column;
|
|
274
|
+
align-items: flex-start;
|
|
275
|
+
justify-content: flex-start;
|
|
276
|
+
width: 100%;
|
|
277
|
+
height: 100%;
|
|
278
|
+
padding-inline: 16px;
|
|
279
|
+
|
|
280
|
+
gap: 10px;
|
|
281
|
+
`,me=v.div`
|
|
282
|
+
display: flex;
|
|
283
|
+
flex-direction: column;
|
|
284
|
+
width: 100%;
|
|
285
|
+
`,G=v(a.Text)`
|
|
286
|
+
color: var(--ddk-generic-color-grey-60);
|
|
287
|
+
`,Ls=v.div`
|
|
288
|
+
font-size: var(--ddk-component-holder-card-footer-font-size);
|
|
289
|
+
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
290
|
+
`,Fs=l.kosComponent(e=>{l.KosLog.debug(`summary component loaded for holder ${e}`),l.KosLog.info(`render agitator summary for holder ${e.cardModel.path}`);const{t}=l.useKosTranslation("common");return n.jsxs(n.Fragment,{children:[n.jsx(a.StatusIndicator,{size:"small",status:"completed"}),e.cardModel.isAgitating&&n.jsx(Ls,{children:t("agitating")})]})}),Ms=v.div`
|
|
263
291
|
display: flex;
|
|
264
292
|
flex-direction: column;
|
|
265
293
|
gap: 24px;
|
|
266
294
|
padding: 24px;
|
|
267
|
-
`,
|
|
295
|
+
`,Bs=Ie.withAssembly(({assembly:e,showHeading:t})=>n.jsx(lo,{iceAgitator:e.iceAgitator,showHeading:t})),lo=l.kosComponent(({iceAgitator:e,showHeading:t})=>{const{t:o}=l.useKosTranslation("about"),s=ht.useLocation(),{componentModeOverride:r}=a.useComponentConfigurationContext(),c=(e==null?void 0:e.iceTypes.map(i=>({id:i,label:i})))||[],d=u.useCallback(async()=>{(e==null?void 0:e.type.value)!==void 0&&(e==null||e.updateIceType(e.type.value))},[e]);return e?n.jsxs(a.TabContainer,{children:[t&&n.jsx(a.SettingsSubheading,{children:o("ice-settings","Ice Settings")}),r==="compact"?n.jsx(Ot,{configProperty:e.type,onChange:i=>e.updateIceType(i),options:c,label:o("ice-type","Ice Type")}):n.jsx(he,{configProperty:e.type,onSave:i=>e.updateIceType(i),items:c,label:o("ice-type","Ice Type")||void 0}),n.jsx(V,{configProperty:e.durationSec,label:o("agitation-duration","Agitation duration")||void 0}),n.jsx(V,{configProperty:e.inactivitySec,label:o("agitate-inactivity","Agitate after inactivity")||void 0}),n.jsx(V,{configProperty:e.volWithoutIceMl,label:o("agitate-without-ice","Agitate after poured without ice")||void 0}),r!=="compact"&&(s==null?void 0:s.pathname.includes("/settings"))&&n.jsx(a.Footer,{children:n.jsx(a.Button,{onPointerDown:d,children:o("reset")})})]}):"Ice model not loaded..."}),Ks=l.kosComponent(({showHeading:e})=>{var p,m,x,g,f,h,w,S;const{t}=l.useKosTranslation("region"),{model:o}=ve(),{regionModel:s}=l.useKosRegions(),r=u.useCallback(y=>({id:y,label:t(`locale.country.${y}`)}),[t]),{selectedRegion:c,updateRegion:d,regionSelectProps:i}=l.useKosRegions(r);return n.jsxs(a.TabContainer,{children:[e&&n.jsx(a.SettingsSubheading,{children:t("localization","Localization")}),n.jsx(a.PickerCard,{cancelButtonLabel:t("discard-changes","Discard Changes")||void 0,closeButtonLabel:t("close","Close")||void 0,displayValue:t(`locale.country.${c}`)||void 0,items:i.options,label:t("country","Country"),loop:!1,onSave:y=>d(y),proceedButtonLabel:t("save","Save")||void 0,selectedItemId:c}),((p=s==null?void 0:s.unitSystemOptions)==null?void 0:p.length)&&n.jsx(a.SwitchCard,{label:t("units-of-measurement","Units of Measurement"),options:(m=s==null?void 0:s.unitSystemOptions)==null?void 0:m.map(y=>({id:y.id,label:`${t(`locale.unit.${y.id}`)}/${t(`locale.units.${y.id}`)}`})),onChange:y=>s==null?void 0:s.setSelectedUnitSystem(String(y)),value:String(s==null?void 0:s.selectedUnitSystem).toLowerCase()}),n.jsx(a.PickerCard,{cancelButtonLabel:t("discard-changes","Discard Changes")||void 0,closeButtonLabel:t("close","Close")||void 0,displayValue:(x=o==null?void 0:o.ncuiLanguage)!=null&&x.displayValue?t(`locale-ncui-language.${(g=o==null?void 0:o.ncuiLanguage)==null?void 0:g.displayValue}`):void 0,items:(w=(h=(f=o==null?void 0:o.ncuiLanguageData)==null?void 0:f.data)==null?void 0:h.languages)==null?void 0:w.map(({locale:y,name:k})=>({id:y,label:k})),label:t("non-consumer-language","Non-Consumer Language"),loop:!1,onSave:y=>{var k;return(k=o==null?void 0:o.ncuiLanguage)==null?void 0:k.updateProperty(y)},proceedButtonLabel:t("save","Save")||void 0,selectedItemId:(S=o==null?void 0:o.ncuiLanguage)==null?void 0:S.displayValue})]})});v.div`
|
|
268
296
|
display: flex;
|
|
269
297
|
font-size: var(--ddk-generic-font-size-x-small);
|
|
270
298
|
font-weight: normal;
|
|
@@ -298,11 +326,11 @@
|
|
|
298
326
|
display: flex;
|
|
299
327
|
justify-content: flex-end;
|
|
300
328
|
}
|
|
301
|
-
`;const
|
|
329
|
+
`;const Ns=v.div`
|
|
302
330
|
display: flex;
|
|
303
331
|
align-items: center;
|
|
304
332
|
justify-content: flex-end;
|
|
305
|
-
`,
|
|
333
|
+
`,Rs=({item:e,valueKey:t})=>{const{label:o,value:s}=e;if(t==="label")return n.jsx("div",{children:n.jsx("b",{children:o})});if(t==="value")return n.jsx(Ns,{children:s})},Os=({groupName:e,networkTestContainer:t})=>{var s;const{t:o}=l.useKosTranslation("connectivity");return((s=t==null?void 0:t.models.getIndexByKey("group",e))==null?void 0:s.map(r=>{const c=e==="interface",d=c?r.results.map(i=>({label:i.name,value:i.val})):[];return c?n.jsx(a.Table,{CellRenderer:Rs,data:d,dataKeys:["label","value"],heading:r.name}):n.jsx(a.StatusCard,{leftLabel:o(`${r.name}`),rightLabel:r.inProgress?o("inProgress"):r.timestamp?r.passed?o("success"):o("Fail"):o("testNotRun"),type:r.inProgress?"InProgress":r.timestamp?r.passed?"Success":"Fail":"Default",failureMessage:o("failureMessage"),lastSuccess:r==null?void 0:r.timestamp,lastSuccessful:o("lastSuccessful")},r.id)}))||[]},$s=Zt(Os),Vs=v.div`
|
|
306
334
|
background-color: var(--ddk-generic-color-grey-80);
|
|
307
335
|
color: var(--ddk-generic-color-grey-5);
|
|
308
336
|
border-radius: 5px;
|
|
@@ -311,43 +339,43 @@
|
|
|
311
339
|
align-items: center;
|
|
312
340
|
justify-content: center;
|
|
313
341
|
font-size: var(--ddk-generic-font-size-xx-small);
|
|
314
|
-
`,
|
|
342
|
+
`,uo=l.kosComponent(({showAction:e=!0,trouble:t,showHolder:o})=>{var k;const{t:s}=l.useKosTranslation(["troubles"]),{model:r}=ye(),c=r==null?void 0:r.currentRole,[d,i]=u.useState({}),{action:p,label:m,progress:x}=be(t),g=t.resolvable??!1;u.useEffect(()=>{async function P(){if(t){const T=await l.troubleDataFactory(t);i(T)}}P()},[t]);const{future:f}=R(t),h=(k=t==null?void 0:t.data)!=null&&k.holderNames&&t.data.holderNames.length>0?n.jsx(Vs,{children:t.data.holderNames[0]}):null,w=(t==null?void 0:t.color)??"orange",S=(t==null?void 0:t.shouldDefer)??!1,y=(t==null?void 0:t.deferred)??!1;return n.jsxs(n.Fragment,{children:[n.jsx(a.NotificationCard,{label:s(m,{context:c==null?void 0:c.toLowerCase(),data:d}),indicatorColor:w,buttonLabel:e?y?"Queued":S?"Queue":s(p,{context:c,defaultValue:""}):void 0,date:t.createTime,prefix:o?h:void 0,onAction:e&&g&&!y?()=>{t.resolve()}:void 0}),f&&n.jsx(A,{title:s(x,{context:c}),future:y?void 0:f,failureMessage:s(`troubles.${t.type}.error`,{context:f!=null&&f.reason?"reason":void 0,data:{reason:f!=null&&f.reason?`__troubles.errors.${f==null?void 0:f.reason}__`:void 0}})})]})}),Hs=({viewContainerId:e,extensionPointId:t,tabs:o,...s})=>{const{getExtensions:r}=N.useKosPluginsContext(),c=r(e),d=r(t).reduce((g,f)=>(g[f.id]=f,g),{}),i=c.map(g=>g.data.namespace),{t:p}=l.useKosTranslation(["",...new Set(i)]),m=c.map(g=>{const f=[...g.data.settings].map(h=>{const w=d[h];return n.jsxs(a.TabContainer,{children:[n.jsx(a.SettingsSubheading,{children:p(`${w.data.namespace}:${w.data.title}`)}),n.jsx(N.DynamicComponent,{extension:t,module:h})]},w.id)});return{id:g.id,label:p(`${g.data.namespace}:${g.data.title}`),content:n.jsx(a.TabViewLayout,{children:f})}}),x=[...o,...m];return n.jsx(a.TabRouter,{...s,tabs:x})},we=l.kosComponent(({holder:e})=>{const{t}=l.useKosTranslation("common"),{componentModeOverride:o}=a.useComponentConfigurationContext(),s=o==="compact",{visibleTroubles:r,initialized:c}=ee(e),i=((r==null?void 0:r.length)??0)>0,p=!!e.troublesByType.FlushTrouble,m=!!e.troublesByType.PrimeTrouble,x=!!e.troublesByType.PurgeTrouble,g=p?e.troublesByType.FlushTrouble[0]:m?e.troublesByType.PrimeTrouble[0]:x?e.troublesByType.PurgeTrouble[0]:null,f=(g==null?void 0:g.shouldDefer)??!1,h=(g==null?void 0:g.deferred)??!1,[w,S]=Y(e),y=u.useCallback(k=>{f?g==null||g.resolve():S(k)},[S,f,g]);return i&&c&&s?n.jsxs(n.Fragment,{children:[p?n.jsx(a.Button,{disabled:h,mode:"primary",onPointerDown:()=>y("flush"),children:t("flush",{context:h?"queued":""})}):x?n.jsx(a.Button,{disabled:h,mode:"primary",onPointerDown:()=>y("purge"),children:t("purge",{context:h?"queued":""})}):m?n.jsx(a.Button,{disabled:h,mode:"primary",onPointerDown:()=>y("prime"),children:t("prime",{context:h?"queued":""})}):null,w&&n.jsx(A,{...w})]}):null}),te=({holder:e,filter:t})=>{const{componentModeOverride:o}=a.useComponentConfigurationContext(),s=o==="standard",{visibleTroubles:r,initialized:c}=ee(e),d=t?r==null?void 0:r.filter(t):r;return((d==null?void 0:d.length)??0)>0&&c&&(r==null?void 0:r.map(m=>n.jsx(uo,{showAction:s,trouble:m},m.id)))},_s=l.kosComponent(({holder:e})=>{const{t}=l.useKosTranslation("common"),[o,s]=Y(e),[r,c]=u.useState();u.useEffect(()=>{async function f(){if(e.ingredientId!==void 0){const h=await e.resolveIntentVolume("CALIBRATE");c(Math.round(h.volume))}}f()},[e,e.ingredientId]);const d=e.ingredientId!==void 0,i=r&&r>0,{holderExperience:p,setHolderExperience:m,currentExperienceId:x}=fe(e);return d||x==="replace-line"?n.jsxs(n.Fragment,{children:[n.jsx(a.Content,{contain:!0,children:n.jsx(te,{holder:e})}),n.jsxs(a.Footer,{children:[n.jsx(a.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?t("intentPour",{data:{volume:r}}):t("calibrate")}),n.jsx(a.Button,{onPointerDown:()=>m("replace-line"),children:t("replace-line")}),n.jsx(J,{disabled:!d,model:e}),n.jsx(we,{holder:e})]}),n.jsx(u.Suspense,{children:p}),o&&n.jsx(A,{...o})]}):n.jsx(at,{showCloseButton:!1,holder:e})}),Us=l.kosComponent(({holder:e})=>{const{t}=l.useKosTranslation("common"),[o,s]=Y(e),[r,c]=u.useState();u.useEffect(()=>{async function p(){if(e.ingredientId!==void 0){const m=await e.resolveIntentVolume("CALIBRATE");c(Math.round(m.volume))}}p()},[e,e.ingredientId]);const d=e.ingredientId!==void 0,i=r&&r>0;return d?n.jsxs(n.Fragment,{children:[n.jsx(a.Content,{contain:!0,children:n.jsx(te,{holder:e})}),n.jsxs(a.Footer,{children:[n.jsx(a.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?t("intentPour",{data:{volume:r}}):t("calibrate")}),n.jsx(J,{disabled:!d,model:e}),n.jsx(we,{holder:e})]}),o&&n.jsx(A,{...o})]}):n.jsx(at,{showCloseButton:!1,holder:e})}),zs=l.kosComponent(({holder:e})=>n.jsxs(n.Fragment,{children:[n.jsx(te,{holder:e}),n.jsxs(a.Footer,{children:[n.jsx(J,{model:e}),n.jsx(we,{holder:e})]})]})),Ws=l.kosComponent(({holder:e})=>{const{t}=l.useKosTranslation("common"),[o,s]=Y(e),{holderExperience:r,setHolderExperience:c}=fe(e);return n.jsxs(n.Fragment,{children:[n.jsx(te,{holder:e}),n.jsxs(a.Footer,{children:[n.jsx(J,{model:e}),n.jsx(a.Button,{onPointerDown:()=>s("high-flow-test"),children:t("high-flow-test")}),n.jsx(a.Button,{onPointerDown:()=>s("low-flow-test"),children:t("low-flow-test")}),n.jsx(a.Button,{onPointerDown:()=>c("diagnostics"),children:t("diagnostics")}),n.jsx(a.Button,{onPointerDown:()=>c("calibrate"),children:t("calibrate")})]}),n.jsx(u.Suspense,{children:r}),o&&n.jsx(A,{...o})]})}),Gs=v.section`
|
|
315
343
|
align-items: center;
|
|
316
344
|
display: flex;
|
|
317
345
|
flex-direction: column;
|
|
318
346
|
gap: 32px;
|
|
319
347
|
height: 100%;
|
|
320
348
|
justify-content: space-between;
|
|
321
|
-
|
|
349
|
+
`,qs=v.div`
|
|
322
350
|
display: flex;
|
|
323
351
|
gap: 32px;
|
|
324
352
|
flex-direction: column;
|
|
325
353
|
align-items: center;
|
|
326
354
|
padding: 32px;
|
|
327
|
-
`,
|
|
355
|
+
`,Xs=v.div`
|
|
328
356
|
display: flex;
|
|
329
357
|
flex-direction: column;
|
|
330
358
|
gap: 12px;
|
|
331
359
|
text-align: center;
|
|
332
|
-
`,
|
|
360
|
+
`,Ys=({onComplete:e})=>{const{t}=l.useKosTranslation("reboot"),[o,s]=u.useState(!1),{model:r}=Ce(),{componentModeOverride:c}=a.useComponentConfigurationContext();return n.jsxs(a.Modal,{show:!o,onClose:()=>s(!0),onClosed:e,contain:c!=="compact",children:[c==="compact"&&n.jsx(a.Header,{title:t("reboot"),showCloseButton:!0,onClose:()=>s(!0),CloseButton:a.CompactCloseButton}),n.jsxs(Gs,{children:[n.jsxs(qs,{children:[n.jsx(a.QuestionIconStyle,{}),n.jsx(Xs,{children:n.jsx(a.UtilityModalHeading,{children:t("modal-heading","Are you sure you want to reboot dispenser?")})})]}),n.jsx(a.CancelProceedFooter,{cancelLabel:`${t("cancel","Cancel")}`,proceedLabel:`${t("reboot","Reboot")}`,onCancel:()=>s(!0),onProceed:()=>r==null?void 0:r.completeReboot()})]})]})},po=l.kosComponent(({holder:e,onComplete:t})=>{const{t:o}=l.useKosTranslation("replace-line"),[s,r]=u.useState(),[c,d]=u.useState();u.useEffect(()=>{e.replaceLine().then(()=>{r("success")})},[e]);const i=()=>{if(c){r(void 0);return}t()};return n.jsx(a.StatusBar,{show:s!==void 0,onClose:i,children:s==="failure"?n.jsx(q,{children:o(c||"unknownError")}):s==="success"?n.jsx(ge,{children:o("success")}):null})}),Zs=v.div`
|
|
333
361
|
display: flex;
|
|
334
362
|
flex-direction: column;
|
|
335
363
|
overflow-y: auto;
|
|
336
364
|
overflow-x: hidden;
|
|
337
365
|
gap: 32px;
|
|
338
366
|
height: 100%;
|
|
339
|
-
`,
|
|
367
|
+
`,mo=l.kosComponent(({pump:e,onComplete:t})=>{const[o,s]=u.useState(!1),{t:r}=l.useKosTranslation("replace-pump"),{componentModeOverride:c}=a.useComponentConfigurationContext(),[d,i]=u.useState(),[p,m]=u.useState(),[x,g]=u.useState(),f=l.getKosCompanionModel(e,To.FreestylePump.type),h=e.name,w=u.useCallback(k=>{if(k!==void 0&&k.length===0)return r("pump-calibration-length-error")},[r]),S=u.useCallback(async()=>{if(d===void 0)return;const[k]=await f.replacePump(d);k?(m("failure"),g(k)):m("success")},[f,d]),y=()=>{if(x){m(void 0);return}s(!0)};return n.jsxs(n.Fragment,{children:[n.jsx(a.Modal,{contain:c!=="compact",onClosed:t,show:!o,children:n.jsxs(Zs,{children:[n.jsx(a.Header,{contain:c==="compact",showCloseButton:!0,title:h?r("label-replace-pump",{label:h}):r("replace-pump"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:c==="compact"?a.BackButton:void 0}),n.jsx(a.Content,{align:"top",children:n.jsx(a.InputCard,{isValid:w,label:r("enter-pump-calibration-code"),layout:"hex",value:d,onChange:k=>{g(void 0),i(k)}})}),n.jsx(a.Footer,{children:n.jsx(a.Button,{mode:"primary",disabled:!d||!!x,onPointerDown:S,children:r("replace-pump")})})]})}),n.jsx(a.StatusBar,{show:p!==void 0,onClose:y,children:p==="failure"?n.jsx(q,{children:r(x||"unknownError")}):p==="success"?n.jsx(ge,{children:r("success")}):null})]})}),Qs=/^[0-9a-fA-F]+$/,xt=e=>Qs.test(e),Js=v.div`
|
|
340
368
|
display: flex;
|
|
341
369
|
flex-direction: column;
|
|
342
370
|
overflow-y: auto;
|
|
343
371
|
overflow-x: hidden;
|
|
344
372
|
height: 100%;
|
|
345
|
-
`,
|
|
373
|
+
`,go=l.kosComponent(({holder:e,onComplete:t})=>{const o=e.name,[s,r]=u.useState(!1),{t:c}=l.useKosTranslation("rfid-override"),{componentModeOverride:d}=a.useComponentConfigurationContext(),[i,p]=u.useState(),[m,x]=u.useState(),[g,f]=u.useState(),[h,w]=u.useState(),[S,y]=u.useState(),k=C=>{if(C!==void 0&&C.length!==12)return c("errIdLen");if(!xt(C))return c("errIdFormat")},P=C=>{if(C!==void 0&&C.length!==8)return c("errCodeLen");if(!xt(C))return c("errCodeFormat")},T=async()=>{try{await e.overrideRfidCode({stickerId:i,stickerCode:m}),r(!0)}catch(C){switch(C.type){case"errIdLen":case"errIdFormat":w(C.type);break;case"errCodeLen":case"errCodeFormat":y(C.type);break;case"errVerify":case"errBadJson":f(C.type);break}}};return n.jsxs(a.Modal,{contain:d!=="compact",mode:"maximized",onClosed:t,show:!s,children:[n.jsx(a.Header,{contain:d==="compact",showCloseButton:!0,title:o?c("label-rfid-override",{label:o}):c("rfid-override"),showOpenButton:!1,onClose:()=>r(!0),CloseButton:d==="compact"?a.BackButton:void 0}),n.jsxs(Js,{children:[n.jsxs(a.Content,{align:"top",children:[n.jsx(a.InfoContainer,{children:c("info")}),n.jsx(a.ErrorInputCard,{isValid:k,description:h?c(h):void 0,label:c("enter-cartridge-id"),layout:"hex",value:i,onChange:C=>{w(void 0),p(C)}}),n.jsx(a.ErrorInputCard,{isValid:P,description:S?c(S):void 0,label:c("enter-code"),layout:"hex",value:m,onChange:C=>{y(void 0),x(C)}})]}),n.jsx(a.Footer,{children:n.jsx(a.Button,{mode:"primary",disabled:!i||!m,onPointerDown:T,children:c("override")})}),g&&n.jsx(a.ProgressBar,{onClose:()=>f(void 0),renderFailure:n.jsx(a.FailureCard,{heading:c("rfid-override"),message:c(g,{holder:e.name})}),show:!0,status:"failure",title:"",value:0})]})]})}),er=l.kosComponent(({setupPath:e})=>{const{model:t}=ye(),[o,s]=u.useState(!1),[r]=ht.useSearchParams(),c=!!r.get("skipSetup"),d=a.useNavigate();return u.useEffect(()=>{!o&&(t!=null&&t.setupRequired)&&(s(!0),c||d(e))},[t==null?void 0:t.setupRequired,o,d,e,c]),null}),xo=v.div`
|
|
346
374
|
cursor: pointer;
|
|
347
375
|
display: flex;
|
|
348
376
|
gap: 8px;
|
|
349
377
|
align-items: center;
|
|
350
|
-
`,
|
|
378
|
+
`,ho=v.div`
|
|
351
379
|
color: var(--ddk-generic-color-grey-100, #171717);
|
|
352
380
|
font-size: var(--ddk-component-sidebar-font-size-medium);
|
|
353
381
|
font-style: normal;
|
|
@@ -356,16 +384,16 @@
|
|
|
356
384
|
letter-spacing: 0.44px;
|
|
357
385
|
white-space: nowrap;
|
|
358
386
|
overflow: hidden;
|
|
359
|
-
`,
|
|
387
|
+
`,fo=l.kosComponent(({setupStepContainer:e,onStepSelected:t,...o})=>{const{t:s,labelMap:r}=Xt({defaultNamespace:"setup",extensionPoint:L.EXTENSION_POINT_SETUP}),c=e==null?void 0:e.currentStep,d=(e==null?void 0:e.data.map(i=>n.jsxs(xo,{onPointerDown:()=>{e.setCurrentStep(i.id),t(i.id)},children:[n.jsx(a.StatusIndicator,{size:"large",status:c===i?"active":i.complete?"completed":"pending"}),n.jsx(ho,{children:s(r[i.name]??i.titleKey)})]},i.id)))||[];return n.jsx(a.Sidebar,{...o,children:d})}),tr=oo(fo),or=l.kosComponent(()=>{const{model:e}=l.useSoftwareInfo();return(e==null?void 0:e.nodes)&&e.nodes.map((t,o)=>n.jsx(a.FrameContainer,{name:t.nodeName,children:Object.keys(t.group).map((s,r)=>n.jsx("div",{children:n.jsx(a.FrameBody,{keyList:["name","version"],tableHead:s==="undefined"?"":s,tableData:t.group[s]})},r))},o))}),bo=l.kosComponent(({pump:e,onComplete:t})=>{const{t:o}=l.useKosTranslation("common",{keyPrefix:"spm-field-calibration"}),[s,r]=u.useState("calibration-idle"),[c,d]=u.useState(),[i,p]=u.useState(),[m,x]=u.useState(),{future:g}=R(e);u.useEffect(()=>{switch(g==null?void 0:g.endState){case"CANCEL":switch(s){case"preparation-in-progress":r("preparation-idle");break;default:d("calibration-canceled"),r("failure")}break;case"SUCCESS":switch(s){case"preparation-in-progress":r("preparation-success");break;case"calibration-in-progress":r("calibration-input");break;case"verification-in-progress":r("verification-input");break}break;case"FAIL":case"ABORT":d(""),r("failure");break}},[g==null?void 0:g.endState,g==null?void 0:g.reason,s]);const f=u.useMemo(()=>({"preparation-idle":{information:n.jsx(a.LabelInformation,{children:o("preparation-idle-info")}),footer:n.jsx(a.Button,{onPointerDown:()=>{e.performPreCalibrate(),r("preparation-in-progress")},children:o("preparation-action")}),status:"information"},"preparation-in-progress":{information:n.jsx(a.LabelInformation,{children:o("preparation-progress-info")}),footer:n.jsx(a.Button,{disabled:!0,children:o("preparation-action")}),status:"loading"},"preparation-success":{information:n.jsx(a.LabelInformation,{children:o("preparation-success-info")}),footer:n.jsx(a.Button,{onPointerDown:()=>r("calibration-idle"),children:o("preparation-success-action")}),status:"success"},"preparation-failed":{},"calibration-idle":{information:n.jsx(a.BodyMediumInformation,{children:o("calibration-idle-info")}),footer:n.jsx(a.Button,{onPointerDown:()=>{e.performCalibrate(),r("calibration-in-progress")},children:o("calibrate")}),status:"information"},"calibration-in-progress":{information:n.jsx(a.LabelInformation,{children:o("calibration-progress-info")}),status:"loading"},"calibration-input":{information:n.jsxs(n.Fragment,{children:[n.jsx(a.BodyMediumInformation,{children:o("calibration-input-info")}),n.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:h=>{h!==void 0&&p(h)},value:i!==void 0?i:""})]}),footer:n.jsx(a.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&r("verification-idle")},children:o("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:n.jsx(a.BodyMediumInformation,{children:o("verification-idle-info")}),footer:n.jsx(a.Button,{onPointerDown:async()=>{i!==void 0&&(e.performVerify(i,g==null?void 0:g.clientData),r("verification-in-progress"))},children:o("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:n.jsx(a.LabelInformation,{children:o("verification-progress-info")}),status:"loading"},"verification-trouble":{},"verification-input":{information:n.jsxs(n.Fragment,{children:[n.jsx(a.BodyMediumInformation,{children:o("verification-input-info")}),n.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:h=>{h!==void 0&&x(h)},value:m!==void 0?m:""})]}),footer:n.jsx(a.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;const h=await e.performComplete(i,m,g==null?void 0:g.clientData);h==="success"?r("verification-success"):(d(h),r(h==="errBadPump"?"verification-failure":"failure"))},children:o("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:n.jsx(a.LabelInformation,{children:o("verification-success-info")}),footer:n.jsx(a.Button,{onPointerDown:t,children:o("exit-calibration")}),status:"success"},"verification-failure":{information:n.jsx(a.LabelInformation,{children:o(`error.${c||"unknownError"}`)}),footer:n.jsx(a.Button,{onPointerDown:t,children:o("exit-calibration")}),status:"error"},failure:{information:n.jsxs(n.Fragment,{children:[n.jsx(a.LabelInformation,{children:o("calibration-failed")}),n.jsx(a.BodyMediumInformation,{children:o(`error.${c||"unknownError"}`)})]}),footer:n.jsx(a.Button,{onPointerDown:t,children:o("exit-calibration")}),status:"error"}}),[c,t,e,o,i,m]);return n.jsxs(n.Fragment,{children:[n.jsx(a.WorkflowModal,{title:o("title"),...f[s],onClose:()=>t()}),g&&n.jsx(A,{title:o("initiating"),future:g})]})}),nr=l.KosLog.createLogger({name:"state-experience"});nr.debug("state-experience component loaded");const sr=v.div``,rr=l.kosComponent(()=>{const{getExtensions:e}=Q(),{model:t}=_e(),[o,s]=u.useState(null);return u.useEffect(()=>l.kosAutoEffect(()=>{const d=e(L.EXTENSION_POINT_TROUBLE_ACTION).reduce((g,f)=>{const h=f;return g[h.data.stateKey??h.data.troubleType]={extension:L.EXTENSION_POINT_TROUBLE_ACTION,module:h.id,namespace:h.data.namespace,title:h.data.title,stateValue:h.data.stateValue??h.data.troubleType},g},{}),i=t==null?void 0:t.activeTroubleType,p=t==null?void 0:t.activeTrouble,m=i?d[i]:void 0,x=m?n.jsx(N.DynamicComponent,{...m,props:{trouble:p}}):null;s(x)}),[e,t]),n.jsx(sr,{children:o})}),ir=[0,6],Co=()=>{const{regionModel:e}=l.useKosRegions(),{model:t}=l.useKosTime(),[o,s]=u.useState(new Date),r=o.getFullYear(),c=l.useDateProps({formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(e==null?void 0:e.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:ir,yearsRange:[r-10,r+10]}}),d=u.useCallback((m,x)=>{switch(m){case"year":c.dateActions.setYear(x.id);break;case"month":c.dateActions.setMonth(x.id);break;case"day":c.dateActions.setDay(x.id);break}},[c.dateActions]),i=u.useCallback(()=>{c.dateActions.setYear(o.getFullYear()),c.dateActions.setMonth(o.getMonth()),c.dateActions.setDay(o.getDate())},[o,c.dateActions]),p=u.useCallback(async({day:m,month:x,year:g})=>{c.dateActions.setYear(g),c.dateActions.setMonth(x),c.dateActions.setDay(m),await(t==null?void 0:t.updateSystemDate({day:m,month:x,year:g})),s(new Date)},[c.dateActions,t]);return n.jsx(Ht,{onDiscard:i,onChange:d,onSave:p})},vo=l.kosComponent(({...e})=>{var i;const{regionModel:t}=l.useKosRegions(),{model:o}=l.useKosTime(),{t:s}=l.useKosTranslation("common"),r=t==null?void 0:t.allTimeZones.map(p=>({id:p,label:p.replace(/_/g," ")})),c=(i=t==null?void 0:t.timeZones)==null?void 0:i.map(p=>({id:p,label:p.replace(/_/g," ")})),d=[{id:"region",label:s("suggested"),items:c||[]},{id:"all",label:s("all"),items:r||[]}];return n.jsx(a.SwitchPickerCard,{...e,label:s("time-zone"),data:d,displayValue:(o==null?void 0:o.timezone).replace("_"," "),loop:!1,selectedItemId:o==null?void 0:o.timezone,onSave:o==null?void 0:o.updateSystemTimezone,closeButtonLabel:s("close","Close")||void 0,cancelButtonLabel:s("discard-changes","Discard Changes")||void 0,proceedButtonLabel:s("save","Save")||void 0})}),ar=l.kosComponent(({showHeading:e})=>{var h,w,S,y,k,P,T,C;const{t}=l.useKosTranslation("region"),{regionModel:o}=l.useKosRegions(),{model:s}=l.useKosTime(),{amPmOptions:r,formattedTime:c,hourOptions:d,minuteOptions:i,setTime:p,time:m}=l.useRegionTimeProps(),x=m.getHours(),g=u.useMemo(()=>[{id:"hr",items:d,selectedItemId:x<12?x:x-12,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0},{id:"ampm",items:r,selectedItemId:x<12?"AM":"PM"}],[r,d,i,m,x]),f=u.useMemo(()=>[{id:"hr",items:d,selectedItemId:x,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0}],[d,i,m,x]);return u.useEffect(()=>{const b=setInterval(()=>{p(new Date)},3e4);return()=>{clearInterval(b)}},[p]),n.jsxs(a.TabContainer,{children:[e&&n.jsx(a.SettingsSubheading,{children:t("time-settings","Time Settings")}),((h=o==null?void 0:o.dateFormatOptions)==null?void 0:h.length)&&n.jsx(a.SwitchCard,{label:t("date-format","Date Format"),value:(S=(w=o==null?void 0:o.dateFormatOptions)==null?void 0:w.find(b=>b.format===o.selectedDateFormat))==null?void 0:S.id,options:(y=o==null?void 0:o.dateFormatOptions)==null?void 0:y.map(b=>({label:b.format.toUpperCase(),...b})),onChange:b=>b&&(o==null?void 0:o.setSelectedDateFormat(String(b)))}),n.jsx(Co,{}),n.jsx(vo,{}),((k=o==null?void 0:o.timeFormatOptions)==null?void 0:k.length)&&n.jsx(a.SwitchCard,{label:t("time-format","Time Format"),value:(T=(P=o==null?void 0:o.timeFormatOptions)==null?void 0:P.find(b=>b.format===o.selectedTimeFormat))==null?void 0:T.id,options:(C=o==null?void 0:o.timeFormatOptions)==null?void 0:C.map(b=>({label:b!=null&&b.ampm?"12 HR":"24 HR",...b})).reverse(),onChange:b=>b&&(o==null?void 0:o.setSelectedTimeFormat(String(b)))}),n.jsx(a.MultiPickerCard,{data:o!=null&&o.is12HourTimeFormat?g:f,icon:H.TimeIcon,displayValue:c,label:t("current-time","Current Time"),closeButtonLabel:t("close","Close")||void 0,cancelButtonLabel:t("discard-changes","Discard Changes")||void 0,proceedButtonLabel:t("save","Save")||void 0,onSave:b=>{const D=o!=null&&o.is12HourTimeFormat?b.ampm==="AM"?b.hr:b.hr+12:b.hr,E=b.min,B=new Date(m);B.setHours(D),B.setMinutes(E),p(B),s==null||s.updateSystemTime({hour:D,min:E,sec:0})}})]})}),cr=$e(l.kosComponent(({settings:e,showHeading:t})=>{const{t:o}=l.useKosTranslation("dispenser-profile");return n.jsxs(a.TabContainer,{children:[t&&n.jsx(a.SettingsSubheading,{children:o("water-settings","Water Settings")}),n.jsx(X,{label:o("plain-water","Plain Water"),configProperty:e.hidePlainWaterBev}),n.jsx(X,{label:o("carbonated-water","Carbonated Water"),configProperty:e.hideCarbWaterBev})]})})),lr=v.div`
|
|
360
388
|
display: flex;
|
|
361
389
|
flex-direction: column;
|
|
362
390
|
gap: 12px;
|
|
363
|
-
`,
|
|
391
|
+
`,dr=v.div`
|
|
364
392
|
display: flex;
|
|
365
393
|
flex-direction: row;
|
|
366
394
|
gap: 12px;
|
|
367
395
|
align-items: center;
|
|
368
396
|
justify-content: center;
|
|
369
|
-
`,
|
|
397
|
+
`,ur=v(a.Button)`
|
|
370
398
|
display: block;
|
|
371
|
-
`;exports.ActionButton=
|
|
399
|
+
`;exports.ActionButton=ur;exports.ActionContainer=lr;exports.ActionRow=dr;exports.AgitationControlView=Bo;exports.AgitatorDetail=Ko;exports.AgitatorModal=At;exports.AgitatorSummary=Ro;exports.AnimationContext=We;exports.AnimationProvider=Fn;exports.ApplicationComponentConfigurationProvider=Bn;exports.ApplicationContext=Ge;exports.ApplicationProvider=Kn;exports.CalibrateAction=ft;exports.CalibrateModal=Ft;exports.ConfigPropInfoCard=Kt;exports.ConfigPropInputCard=xe;exports.ConfigPropInputRangeCard=V;exports.ConfigPropMultiInputEnableCard=Rt;exports.ConfigPropPickerCard=he;exports.ConfigPropSingleInputEnableCard=Yo;exports.ConfigPropSwitchCard=Ot;exports.ConfigPropTimePickerCard=Vt;exports.ConfigPropToggleCard=X;exports.DashboardOperationsContext=qe;exports.DashboardOperationsProvider=Nn;exports.DatePickerCard=Ht;exports.DiagnosticsModal=_t;exports.DispenserInfoContext=Xe;exports.DispenserInfoProvider=On;exports.DispenserInfoSettings=Tn;exports.DispenserSerialNumber=so;exports.DispenserSettings=Pn;exports.EXTENSION_PLUGIN_VISIBILITY=K;exports.EnjoyByDate=io;exports.FailureMessage=q;exports.Fixed45FlowTestAction=bt;exports.FlushAction=Ct;exports.FutureProgressBar=A;exports.GenericTroubleAction=It;exports.HardwareInfo=Ln;exports.HighFlowTestAction=vt;exports.HoldToPourAction=yt;exports.HoldToPourButton=J;exports.HolderActions=we;exports.HolderCard=ao;exports.HolderContentContext=Me;exports.HolderContentProvider=un;exports.HolderGroup=it;exports.HolderGroupView=gs;exports.HolderNotifications=te;exports.IceAgitatorDetail=Ds;exports.IceAgitatorSettings=lo;exports.IceAgitatorSettingsContainer=Ms;exports.IceAgitatorSettingsView=Bs;exports.IceAgitatorSummary=Fs;exports.IngredientSummaryContext=Ye;exports.IngredientSummaryProvider=Vn;exports.IntentAction=F;exports.KosPluginExtensionManager=bn;exports.LFCVPumpCard=_s;exports.LocalizationSettings=Ks;exports.LowFlowTestAction=wt;exports.MSVPumpCard=Us;exports.MSVResetAction=St;exports.MacroAssignmentContext=Ze;exports.MacroAssignmentProvider=_n;exports.MacroHolderCard=co;exports.MacroHolderGroupView=ys;exports.MacroSetupStepCard=at;exports.ManualOverrideAction=jt;exports.NetworkTestContainerContext=Je;exports.NetworkTestContainerProvider=Gn;exports.NetworkTestContext=Qe;exports.NetworkTestProvider=zn;exports.NetworkTestResults=$s;exports.NotificationCardView=uo;exports.PluginExtensionManager=eo;exports.PluginTabs=Hs;exports.PrimeAction=kt;exports.PurgeAction=Tt;exports.RFIDOverride=go;exports.RebootContext=et;exports.RebootProvider=Xn;exports.RebootView=Ys;exports.ReplaceLine=po;exports.ReplacePump=mo;exports.SPMFieldCalibrationModal=bo;exports.SettingsContext=tt;exports.SettingsProvider=Zn;exports.SetupRequired=er;exports.SetupSidebar=tr;exports.SetupSidebarComp=fo;exports.SetupStepContainerContext=nt;exports.SetupStepContainerProvider=ts;exports.SetupStepContext=ot;exports.SetupStepProvider=Jn;exports.Software=or;exports.StagedChangesProvider=Bt;exports.StateExperience=rr;exports.StepItem=xo;exports.StepTitle=ho;exports.SuccessMessage=ge;exports.SystemDatePickerCard=Co;exports.TROUBLE_PRIME=Po;exports.TROUBLE_PURGE=Io;exports.TimePickerCard=$t;exports.TimeSettings=ar;exports.TimeZonePickerCard=vo;exports.TroubleAction=Pt;exports.UtilitiesContainerContext=rt;exports.UtilitiesContainerProvider=rs;exports.UtilitiesContext=st;exports.UtilitiesProvider=ns;exports.ValveCard=zs;exports.WaterPumpCard=Ws;exports.WaterSettings=cr;exports.pumpTypeFactory=fn;exports.troubleLabelByType=to;exports.troubleLabelFactory=be;exports.useAgitationControl=Ae;exports.useAnimation=Ee;exports.useAnimationContext=Mn;exports.useApplication=Z;exports.useApplicationContext=ye;exports.useCarbWater=zt;exports.useCombinedActions=Qo;exports.useCopyLogs=Wt;exports.useDashboardOperations=Le;exports.useDashboardOperationsContext=Rn;exports.useDispenserInfo=Fe;exports.useDispenserInfoContext=$n;exports.useDoor=qt;exports.useFutureContainer=R;exports.useHolderContent=Be;exports.useHolderExperience=fe;exports.useIngredientSummary=Ke;exports.useIngredientSummaryContext=Hn;exports.useMacroAssignment=Ne;exports.useMacroAssignmentContext=Un;exports.useNetworkTest=Re;exports.useNetworkTestContainer=Oe;exports.useNetworkTestContainerContext=qn;exports.useNetworkTestContext=Wn;exports.useNutritiveSweetener=Qt;exports.usePlainWater=Jt;exports.usePluginExtensions=Q;exports.usePumpAction=Y;exports.useReboot=Ce;exports.useRebootContext=Yn;exports.useSettings=ve;exports.useSettingsContext=Qn;exports.useSetupStep=Ve;exports.useSetupStepContainer=He;exports.useSetupStepContainerContext=os;exports.useSetupStepContext=es;exports.useStagedChanges=De;exports.useStart=no;exports.useTroubleAction=nn;exports.useTroubleActionState=_e;exports.useTroubleVisibility=jn;exports.useUtilities=Ue;exports.useUtilitiesContainer=ze;exports.useUtilitiesContainerContext=is;exports.useUtilitiesContext=ss;exports.useViewExtensions=Xt;exports.useVisibleTroubles=ee;exports.withAgitationControl=sn;exports.withAnimation=Ut;exports.withApplication=rn;exports.withCarbWater=an;exports.withCopyLogs=cn;exports.withDashboardOperations=ln;exports.withDispenserInfo=Gt;exports.withDoor=dn;exports.withIngredientSummary=mn;exports.withMacroAssignment=Yt;exports.withNetworkTest=gn;exports.withNetworkTestContainer=Zt;exports.withNutritiveSweetener=xn;exports.withPlainWater=hn;exports.withReboot=Cn;exports.withSettings=$e;exports.withSetupStep=vn;exports.withSetupStepContainer=oo;exports.withStagedChanges=$o;exports.withStart=yn;exports.withTroubleAction=wn;exports.withUtilities=Sn;exports.withUtilitiesContainer=kn;
|