@getontime/cli
Version:
Time keeping for live events
3 lines (2 loc) • 5.84 kB
JavaScript
import{j as e,r as N,b2 as y,b3 as P,b4 as C,b5 as D,b6 as O,b7 as I,b8 as R}from"./vendor-DFNUfA2K.js";import{w,bj as j,y as $,j as f,i as r,H as F,a as G,r as S,bl as M,g as E,bm as _,s as v,b4 as U,T as b,bn as A}from"./index-BNit4nUw.js";import{T as d}from"./Tooltip-CMnbeNS3.js";import{m as k}from"./useRundown-DgZv-crd.js";import{a as H,g as W}from"./offset-DC4blUxG.js";import{i as q}from"./playbackstate-DRK4geZP.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="3d091fea-40e2-4d49-80f4-b7823f3b6e18",n._sentryDebugIdIdentifier="sentry-dbid-3d091fea-40e2-4d49-80f4-b7823f3b6e18")}catch{}})();function x(n,t=3,l){return w(n,{fallback:t===3?j:$,direction:l})}function g(n){return n!==null&&n>f?[n%f,Math.floor(n/f)]:[n,0]}const z="_label_1k32k_18",B="_clock_1k32k_23",J="_column_1k32k_35",K="_over_1k32k_50",L="_under_1k32k_56",u={label:z,clock:B,column:J,over:K,under:L};function T({label:n,value:t,state:l="active",className:a,testId:c}){return e.jsxs("div",{className:r([u.column,a]),"data-state":l,children:[e.jsx("span",{className:u.label,children:n}),e.jsx("span",{className:u.clock,"data-testid":c,children:t})]})}function Q({state:n,value:t,testId:l}){return e.jsxs("div",{className:u.column,"data-state":n,children:[e.jsxs("div",{className:u.label,children:[e.jsx("span",{className:u.over,children:"Over"}),e.jsx("span",{children:"/"}),e.jsx("span",{className:u.under,children:"Under"})]}),e.jsx("span",{className:u.clock,"data-testid":l,children:t})]})}const V="_column_xlrjj_17",X="_row_xlrjj_26",Y="_metadataRow_xlrjj_33",Z="_labelledElement_xlrjj_40",ee="_icon_xlrjj_46",se="_label_xlrjj_40",ne="_time_xlrjj_57",te="_daySpan_xlrjj_64",ae="_muted_xlrjj_71",le="_labelTitle_xlrjj_75",s={column:V,row:X,metadataRow:Y,labelledElement:Z,icon:ee,label:se,time:ne,daySpan:te,muted:ae,labelTitle:le};function pe(){const{plannedEnd:n,plannedStart:t,actualStart:l,expectedEnd:a}=M(),c=t===null?j:E(t),[o,p]=N.useMemo(()=>g(n),[n]),[m,i]=N.useMemo(()=>g(a),[a]),h=o===null?j:E(o);return e.jsxs("div",{className:s.column,children:[e.jsxs("div",{className:s.row,children:[e.jsx("span",{className:s.label,children:"Start"}),e.jsxs("div",{className:s.labelledElement,children:[e.jsx(d,{text:"Planned start time",render:e.jsx(y,{className:s.icon})}),e.jsx("span",{className:r([s.time,t===null&&s.muted]),children:c})]}),e.jsxs("div",{className:s.labelledElement,children:[e.jsx(d,{text:"Actual start time",render:e.jsx(P,{className:s.icon})}),e.jsx("span",{className:r([s.time,l===null&&s.muted]),children:x(l)})]})]}),e.jsxs("div",{className:s.row,children:[e.jsx("span",{className:s.label,children:"End"}),e.jsxs("div",{className:s.labelledElement,children:[e.jsx(d,{text:"Planned end time",render:e.jsx(y,{className:s.icon})}),p>0?e.jsx(d,{text:`Event spans over ${p+1} days`,render:e.jsx("span",{className:r([s.time,s.daySpan])}),children:h}):e.jsx("span",{className:r([s.time,n===null&&s.muted]),children:h})]}),e.jsxs("div",{className:s.labelledElement,children:[e.jsx(d,{text:"Expected end time",render:e.jsx(C,{className:s.icon})}),m!==null&&i>0?e.jsx(d,{text:`Event spans over ${i+1} days`,render:e.jsx("span",{className:r([s.time,s.daySpan])}),children:x(m)}):e.jsx("span",{className:r([s.time,m===null&&s.muted]),children:x(m)})]})]})]})}function je(){return e.jsxs("div",{className:s.column,children:[e.jsx(ce,{}),e.jsx(re,{})]})}function ce(){const{clock:n,groupExpectedEnd:t}=_(),{currentGroupId:l}=U(),a=k(l),c=a&&a.timeStart!==null?a.timeStart+a.duration-n:null,o=x(c,3,b.CountDown),p=t!==null?t-n:null,m=x(p,3,b.CountDown),i=(a==null?void 0:a.title)??null;return e.jsxs("div",{className:s.metadataRow,children:[e.jsx("span",{className:i?s.labelTitle:s.label,children:`${i||"Group"} `}),e.jsxs("div",{className:s.labelledElement,children:[e.jsx(d,{text:"Time to planned group end",render:e.jsx(D,{className:s.icon})}),e.jsx("span",{className:r([s.time,!a&&s.muted]),children:o})]}),e.jsxs("div",{className:s.labelledElement,children:[e.jsx(d,{text:"Time to expected group end",render:e.jsx(O,{className:s.icon})}),e.jsx("span",{className:r([s.time,t===null&&s.muted]),children:m})]})]})}function re(){const{clock:n}=S(),{id:t,expectedStart:l}=A(),a=k(t),c=a?a.timeStart-n:null,o=x(c,3,b.CountDown),p=l!==null?l-n:null,m=x(p,3,b.CountDown),i=(a==null?void 0:a.title)??null;return e.jsxs("div",{className:s.metadataRow,children:[e.jsx("span",{className:i?s.labelTitle:s.label,children:`${i||"Flag"} `}),e.jsxs("div",{className:s.labelledElement,children:[e.jsx(d,{text:"Time to next flag planned start",render:e.jsx(I,{className:s.icon})}),e.jsx("span",{"data-testid":"flag-plannedStart",className:r([s.time,!a&&s.muted]),children:o})]}),e.jsxs("div",{className:s.labelledElement,children:[e.jsx(d,{text:"Time to next flag expected start",render:e.jsx(R,{className:s.icon})}),e.jsx("span",{"data-testid":"flag-expectedStart",className:r([s.time,p===null&&s.muted]),children:m})]})]})}function be(){const{numEvents:n,selectedEventIndex:t}=_(),l=t!==null?t+1:v,a=n?`${l} of ${n||v}`:v;return e.jsx(T,{label:"Progress",value:a,state:t===null?"muted":"active"})}function fe(){const{offset:n,playback:t}=_(),l=q(t),a=W(l?n:null),c=H(l?n:null);return e.jsx(Q,{state:a,value:c,testId:"offset"})}function ve({className:n}){const{clock:t}=S();return e.jsx(T,{label:"Time now",value:x(t),className:n})}function _e({className:n}){const t=F(),l=t.phase===G.Pending,a=l?"Count to start":"Running timer",c=w(l?t.secondaryTimer:t.current,{fallback:j}),o=l?"waiting":t.current===null?"muted":"active";return e.jsx(T,{label:a,value:c,state:o,className:n})}export{ve as C,je as M,fe as O,be as P,pe as S,_e as T,x as f};
//# sourceMappingURL=TimeElements-DystPWQS.js.map