@getontime/cli
Version:
Time keeping for live events
2 lines • 11.4 kB
JavaScript
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./Tooltip-legacy-DEkL5laM.js","./constants-legacy-CvecvM28.js","./useRundown-legacy-zes2lKPp.js","./playbackstate-legacy-DgaX7fPF.js","./tb-legacy-C5yyMA4Y.js","./useAutoTickingClock-legacy-CkfIpBWe.js","./SuperscriptPeriod-legacy-NlsBX--E.js","./offset-legacy-DV3hCcrF.js"],function(e,t){var a,l,n,s,r,o,i,c,d,m,u,_,f,x,j,p,y,b,g,h,N,v,w,k,E,S,T,P,D,R,$,z,C,I,F,A,M,O,G,H,Q,U;function Y(e,t=3,a,l="due"){return null!==e&&e<=0?l:q(e,t,a)}function q(e,t=3,a){return f(e,{fallback:3===t?N:w,direction:a})}function J(e){return null!==e&&e>864e5?[e%u,Math.floor(e/u)]:[e,0]}function K({label:e,value:t,state:a="active",className:l,testId:n}){return(0,G.jsxs)("div",{className:v([O.column,l]),"data-state":a,children:[(0,G.jsx)("span",{className:O.label,children:e}),(0,G.jsx)("span",{className:O.clock,"data-testid":n,children:t})]})}function L({label:e,state:t="active",className:a,render:l}){return(0,G.jsxs)("div",{className:v([O.column,a]),"data-state":t,children:[(0,G.jsx)("span",{className:O.label,children:e}),l(O.clock)]})}function V({state:e,value:t,testId:a}){return(0,G.jsxs)("div",{className:O.column,"data-state":e,children:[(0,G.jsxs)("div",{className:O.label,children:[(0,G.jsx)("span",{className:O.over,children:"Over"}),(0,G.jsx)("span",{children:"/"}),(0,G.jsx)("span",{className:O.under,children:"Under"})]}),(0,G.jsx)("span",{className:O.clock,"data-testid":a,children:t})]})}function B(e,t){return null===e?N:t?s(e,U):f(e,{fallback:N})}function W({shouldFormat:e}){const t=c(),[a,l]=(0,Q.useMemo)(()=>J(t),[t]),n=B(a,e),s=null!==a&&l>0;return(0,G.jsx)(h,{text:s?`Expected end time (rundown spans over ${l+1} days)`:"Expected end time",render:(0,G.jsxs)("div",{className:H.labelledElement,children:[(0,G.jsx)(R,{className:H.icon}),(0,G.jsx)(I,{className:v([H.time,null===a&&H.muted]),time:n}),s&&(0,G.jsx)("span",{className:v([H.time,H.daySpan]),"data-day-offset":l})]})})}function X(){const{clock:e,mode:t,groupExpectedEnd:a,actualGroupStart:l,currentDay:n,playback:s,phase:r}=j(),o=k(x()),i=r!==m.Pending&&E(s),c=Y((()=>{if(!i)return null;if(!o||null===o.timeStart)return null;const a=e+n*u;return t===_.Absolute?o.timeStart+o.duration-a:null===l?null:l+o.duration-a})(),3,y.CountDown),d=i&&null!==a?a-e:null,f=Y(d,3,y.CountDown);return(0,G.jsxs)("div",{className:H.metadataRow,children:[(0,G.jsx)("span",{className:o?.title?H.labelTitle:H.label,children:`${o?.title||"Group"} `}),(0,G.jsxs)("div",{className:H.labelledElement,children:[(0,G.jsx)(h,{text:"Time to planned group end",render:(0,G.jsx)(S,{className:H.icon})}),(0,G.jsx)("span",{className:v([H.time,(!o||!i)&&H.muted,"due"===c&&H.dueTime]),children:c})]}),(0,G.jsxs)("div",{className:H.labelledElement,children:[(0,G.jsx)(h,{text:"Time to expected group end",render:(0,G.jsx)(T,{className:H.icon})}),(0,G.jsx)("span",{className:v([H.time,null===d&&H.muted,"due"===f&&H.dueTime]),children:f})]})]})}function Z(){const{clock:e,mode:t,actualStart:a,plannedStart:l,playback:n,currentDay:s,phase:r}=p(),{id:o,expectedStart:i}=g(),c=k(o),d=r!==m.Pending&&E(n),f=Y((()=>{if(!d)return null;if(!c)return null;const n=c.timeStart+c.dayOffset*u,r=e+s*u;return t===_.Absolute?n-r:null===a||null===l?null:n+a-l-r})(),3,y.CountDown),x=d&&null!==i?i-e:null,j=Y(x,3,y.CountDown),b=c?.title??null;return(0,G.jsxs)("div",{className:H.metadataRow,children:[(0,G.jsx)("span",{className:b?H.labelTitle:H.label,children:`${b||"Flag"} `}),(0,G.jsxs)("div",{className:H.labelledElement,children:[(0,G.jsx)(h,{text:"Time to next flag planned start",render:(0,G.jsx)(D,{className:H.icon})}),(0,G.jsx)("span",{"data-testid":"flag-plannedStart",className:v([H.time,(!c||!d)&&H.muted,"due"===f&&H.dueTime]),children:f})]}),(0,G.jsxs)("div",{className:H.labelledElement,children:[(0,G.jsx)(h,{text:"Time to next flag expected start",render:(0,G.jsx)($,{className:H.icon})}),(0,G.jsx)("span",{"data-testid":"flag-expectedStart",className:v([H.time,null===x&&H.muted,"due"===j&&H.dueTime]),children:j})]})]})}return e({a:function(){const{numEvents:e,selectedEventIndex:t}=o(),a=null!==t?t+1:"–";return(0,G.jsx)(K,{label:"Progress",value:e?`${a} of ${e||"–"}`:"–",state:null===t?"muted":"active"})},c:function({className:e}){const t=i(),a=t.phase===m.Pending,l=a?"Count to start":"Running timer",n=f(a?t.secondaryTimer:t.current,{fallback:N});return(0,G.jsx)(K,{label:l,value:n,state:a?"waiting":null===t.current?"muted":"active",className:e})},i:function(){const{numEvents:e}=o(),{plannedEnd:t,plannedStart:a}=r();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{label:"Total duration",value:null!==a&&null!==t?d(t-a):N}),(0,G.jsx)(K,{label:"Events",value:String(e)})]})},l:q,n:function(){return(0,G.jsxs)("div",{className:H.column,children:[(0,G.jsx)(X,{}),(0,G.jsx)(Z,{})]})},o:function({shouldFormat:e}){const{plannedEnd:t,plannedStart:a}=r(),l=B(a,e),[n,s]=(0,Q.useMemo)(()=>J(t),[t]),o=B(n,e),i=s>0,c=i?`Planned end time (rundown spans over ${s+1} days)`:"Planned end time";return(0,G.jsxs)("div",{className:H.column,children:[(0,G.jsxs)("div",{className:H.row2,children:[(0,G.jsx)("span",{className:H.label,children:"Start"}),(0,G.jsx)(h,{text:"Planned start time",render:(0,G.jsxs)("div",{className:H.labelledElement,children:[(0,G.jsx)(P,{className:H.icon}),(0,G.jsx)(I,{className:v([H.time,null===a&&H.muted]),time:l})]})})]}),(0,G.jsxs)("div",{className:H.row2,children:[(0,G.jsx)("span",{className:H.label,children:"End"}),(0,G.jsx)(h,{text:c,render:(0,G.jsxs)("div",{className:H.labelledElement,children:[(0,G.jsx)(P,{className:H.icon}),(0,G.jsx)(I,{className:v([H.time,null===t&&H.muted]),time:o}),i&&(0,G.jsx)("span",{className:v([H.time,H.daySpan]),"data-day-offset":s})]})})]})]})},r:function(){const{offset:e,playback:t}=b(),a=E(t);return(0,G.jsx)(V,{state:A(a?e:null),value:F(a?e:null),testId:"offset"})},s:function({shouldFormat:e}){const{plannedEnd:t,plannedStart:a,actualStart:l}=r(),n=B(a,e),s=B(l,e),[o,i]=(0,Q.useMemo)(()=>J(t),[t]),c=B(o,e),d=i>0,m=d?`Planned end time (rundown spans over ${i+1} days)`:"Planned end time";return(0,G.jsxs)("div",{className:H.column,children:[(0,G.jsxs)("div",{className:H.row,children:[(0,G.jsx)("span",{className:H.label,children:"Start"}),(0,G.jsx)(h,{text:"Planned start time",render:(0,G.jsxs)("div",{className:H.labelledElement,children:[(0,G.jsx)(P,{className:H.icon}),(0,G.jsx)(I,{className:v([H.time,null===a&&H.muted]),time:n})]})}),(0,G.jsx)(h,{text:"Actual start time",render:(0,G.jsxs)("div",{className:H.labelledElement,"data-testid":"actual-start-time",children:[(0,G.jsx)(z,{className:H.icon}),(0,G.jsx)(I,{className:v([H.time,null===l&&H.muted]),time:s})]})})]}),(0,G.jsxs)("div",{className:H.row,children:[(0,G.jsx)("span",{className:H.label,children:"End"}),(0,G.jsx)(h,{text:m,render:(0,G.jsxs)("div",{className:H.labelledElement,children:[(0,G.jsx)(P,{className:H.icon}),(0,G.jsx)(I,{className:v([H.time,null===t&&H.muted]),time:c}),d&&(0,G.jsx)("span",{className:v([H.time,H.daySpan]),"data-day-offset":i})]})}),(0,G.jsx)(W,{shouldFormat:e})]})]})},t:function({shouldFormat:e,className:t}){const a=C(),l=e?s(a):f(a);return(0,G.jsx)(L,{label:"Time now",className:t,render:e=>(0,G.jsx)(I,{className:e,time:l})})}}),{setters:[function(e){a=e.a,l=e.n,n=e.t},function(e){s=e.$,r=e.A,o=e.E,i=e.N,c=e.O,d=e.Q,m=e.Rt,u=e.Tt,_=e.Vt,f=e._t,x=e.f,j=e.g,p=e.h,y=e.qt,b=e.x,g=e.y},function(e){h=e.t},function(e){N=e.J,v=e.K,w=e.Y},function(e){k=e.t},function(e){E=e.t},function(e){S=e.c,T=e.l,P=e.n,D=e.o,R=e.r,$=e.s,z=e.t},function(e){C=e.t},function(e){I=e.t},function(e){F=e.n,A=e.t}],execute:function(){(M=document.createElement("style")).textContent='._blink_f1yts_2{animation:1s step-start infinite _blink_f1yts_2}@keyframes _blink_f1yts_2{0%{opacity:1}50%{opacity:.2}}._fourtyfive_f1yts_14{transform:rotate(45deg)}._label_f1yts_18{color:#8a8a8a;font-size:calc(1rem - 3px)}._clock_f1yts_23{text-align:left;letter-spacing:.5px;font-variant-numeric:tabular-nums;color:#f6f6f6;min-width:5em;font-size:1.5rem}._clock_f1yts_23:after{content:""}._column_f1yts_35{flex-direction:column;justify-content:end;height:100%;display:flex}._column_f1yts_35 ._label_f1yts_18{gap:.25rem;width:7em;line-height:.9em;display:flex}._column_f1yts_35 ._over_f1yts_47,._column_f1yts_35 ._under_f1yts_48{transition:color .2s}._column_f1yts_35[data-state=waiting] ._label_f1yts_18{color:#22a0e9}._column_f1yts_35[data-state=over] ._label_f1yts_18 ._over_f1yts_47{color:#f57c13;font-weight:600}._column_f1yts_35[data-state=over] ._clock_f1yts_23{color:#f57c13}._column_f1yts_35[data-state=under] ._label_f1yts_18 ._under_f1yts_48{color:#55b469;font-weight:600}._column_f1yts_35[data-state=under] ._clock_f1yts_23{color:#55b469}._column_f1yts_35[data-state=muted] ._clock_f1yts_23{color:#8a8a8a}._blink_1rjoo_1{animation:1s step-start infinite _blink_1rjoo_1}@keyframes _blink_1rjoo_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1rjoo_13{transform:rotate(45deg)}._column_1rjoo_17{flex-direction:column;justify-content:center;align-items:end;gap:2px;height:100%;display:flex}._row_1rjoo_26{grid-template-columns:3rem 9rem 9rem;align-items:center;gap:.5rem;display:grid}._row2_1rjoo_33{grid-template-columns:3rem 9rem;align-items:center;gap:.5rem;display:grid}._metadataRow_1rjoo_40{grid-template-columns:minmax(3rem,10rem) 8rem 8rem;align-items:center;gap:.5rem;display:grid}._labelledElement_1rjoo_47{align-items:center;gap:.25rem;display:flex}._icon_1rjoo_53{color:#b1b1b1;flex-shrink:0;font-size:1rem}._label_1rjoo_47{color:#8a8a8a;text-align:right;font-size:calc(1rem - 2px)}._time_1rjoo_65{letter-spacing:.25px;font-variant-numeric:tabular-nums;font-size:1.25rem;line-height:1.1}._daySpan_1rjoo_72{align-items:center;margin-left:.25rem;display:inline-flex}._daySpan_1rjoo_72:after{content:"+" attr(data-day-offset);color:#f6f6f6;background:#4c4c4c;border-radius:2px;padding:.125rem .25rem;font-size:.75rem;font-weight:400}._muted_1rjoo_87{color:#8a8a8a}._labelTitle_1rjoo_91{white-space:nowrap;text-overflow:ellipsis;color:#77c785;text-align:right;font-size:calc(1rem - 2px);overflow:hidden}._dueTime_1rjoo_100{text-transform:capitalize;letter-spacing:0;color:#f57c13;border-left:3px solid #f57c13;padding-left:.375rem;font-size:1rem;display:inline-block}\n/*$vite$:1*/',document.head.appendChild(M),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"f14ad0099eab1969fdd065b56af5fdd3cf530de6"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="87a106e0-885c-40ef-98be-12f73c31a31e",e._sentryDebugIdIdentifier="sentry-dbid-87a106e0-885c-40ef-98be-12f73c31a31e")}catch(e){}}(),O={blink:"_blink_f1yts_2",fourtyfive:"_fourtyfive_f1yts_14",label:"_label_f1yts_18",clock:"_clock_f1yts_23",column:"_column_f1yts_35",over:"_over_f1yts_47",under:"_under_f1yts_48"},G=n(),H={blink:"_blink_1rjoo_1",fourtyfive:"_fourtyfive_1rjoo_13",column:"_column_1rjoo_17",row:"_row_1rjoo_26",row2:"_row2_1rjoo_33",metadataRow:"_metadataRow_1rjoo_40",labelledElement:"_labelledElement_1rjoo_47",icon:"_icon_1rjoo_53",label:"_label_1rjoo_47",time:"_time_1rjoo_65",daySpan:"_daySpan_1rjoo_72",muted:"_muted_1rjoo_87",labelTitle:"_labelTitle_1rjoo_91",dueTime:"_dueTime_1rjoo_100"},Q=a(l(),1),U={format12:"hh:mm:ss a",format24:"HH:mm:ss"}}}});
//# sourceMappingURL=TimeElements-legacy-WdUHx7La.js.map