@getontime/cli
Version:
Time keeping for live events
2 lines • 13.6 kB
JavaScript
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./Button-legacy-DpgzgT04.js","./useIsSmallScreen-legacy-DavgXfPB.js","./Select-legacy-DHLEukf3.js","./constants-legacy-CvecvM28.js","./SwatchPicker-legacy-DpR2sNl5.js","./viewParamsEditor.store-legacy-BGER9MKV.js","./useSettings-legacy-CmEM1qbK.js","./Input-legacy-CNt711cd.js","./PresetContext-legacy-DMyxIOHO.js","./viewOptions-legacy-C48HYPwV.js","./assets-legacy-CsCyioqi.js","./index-legacy-NWDCUII5.js","./Info-legacy-6yM0-oGU.js","./Empty-legacy-ZRfHevNV.js","./ViewParamsEditor-legacy-5MW9MZnc.js","./viewUtils-legacy-djI28uVO.js","./useWindowTitle-legacy-2YHQ5qMQ.js","./useAutoTickingClock-legacy-CkfIpBWe.js","./common.options-legacy-BserooSS.js","./offset-legacy-DV3hCcrF.js","./useCustomFields-legacy-B9FQxHWS.js","./viewLoader.utils-legacy-ydrboL-R.js","./ViewLogo-legacy-BZNOVq3q.js","./SuperscriptTime-legacy-DRiHY36H.js","./useProjectData-legacy-BeF8hAuC.js","./presentation.utils-legacy-Cz-JncTB.js"],function(e,t){var i,s,a,n,r,o,c,d,l,m,u,x,h,v,f,p,g,j,_,y,b,w,N,k,S,z,E,A,C,I,M,P,D,O,R,T,V,F,L,U,W,$,H,K,B,Y,q;function J(){const[e]=f(),t=(0,$.use)(j);return(0,$.useMemo)(()=>function(e,t){const i=i=>t?.get(i)??e.get(i);return{mainSource:i("main"),hideCards:E(i("hideCards")),timeformat:M(e,t)}}(e,t?new URLSearchParams(t.search):void 0),[t,e])}function X({hideCards:e}){const{timeformat:t}=J(),i=v(),s=I(),{playback:a}=x(),o=a!==l.Stop;if(i&&!e)return(0,K.jsx)(G,{clock:s,onAir:o,timeformat:t});const{seconds:c,display:d,meridian:m}=function(e,t){const[i,s]=(()=>{const i=n(e,{override:t});return i.endsWith("AM")?[i.slice(0,-2),"AM"]:i.endsWith("PM")?[i.slice(0,-2),"PM"]:[i,void 0]})();return{seconds:r(e),display:i,meridian:s}}(s,t);return(0,K.jsx)("div",{className:"studio__clock",children:(0,K.jsxs)("div",{className:"clock-container",children:[Y.map(e=>(0,K.jsx)("div",{className:p(["tick",e<=c&&"tick--active"]),style:{transform:`rotate(${180+6*e}deg) translateY(var(--half-size))`}},e)),B.map(e=>(0,K.jsx)("div",{className:"tick tick--active",style:{transform:`rotate(${180+30*e}deg) translateX(var(--smaller-half-size))`}},e)),(0,K.jsx)("div",{className:p(["ampm",Boolean(m)&&"ampm--active"]),children:m}),(0,K.jsx)("div",{className:"time time--large",children:d}),(0,K.jsx)("div",{className:p(["on-air",o&&"on-air--active"]),children:"ON AIR"})]})})}function G({clock:e,onAir:t,timeformat:i}){return(0,K.jsxs)("div",{className:"studio__clock studio__clock--small",children:[(0,K.jsx)(F,{className:"time time--small",time:n(e,{override:i})}),(0,K.jsx)("div",{className:p(["on-air",t&&"on-air--active"]),children:"ON AIR"})]})}function Q({viewSettings:e}){const{getLocalizedString:t}=w(),{mainSource:i}=J(),{eventNow:s,eventNext:a,message:r,time:o,offset:u,rundown:x,expectedRundownEnd:h}=c(),v=(f={offset:u,actualStart:x.actualStart,expectedEnd:h},{actualStart:n(f.actualStart,q),expectedEnd:n(f.expectedEnd,q),offset:D(f.offset)});var f;const g=function(e,t,i){return{title:e?.[i??"title"]||"-",startedAt:n(t.startedAt,q),expectedEnd:n(t.expectedFinish,q),timer:m(t.current)}}(s,o,i),j=A(a,i??"title")||"-",_=r.timer.visible&&r.timer.text||"-",y="secondary"===r.timer.secondarySource&&r.secondary||"-",b=U(e,void 0,o.phase===d.Warning,o.phase===d.Danger),N=O(u);return(0,K.jsxs)("div",{className:"studio__timers",children:[(0,K.jsx)("div",{className:"card",id:"card-schedule",children:(0,K.jsxs)("div",{className:"card__row",children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label",children:t("common.started_at")}),(0,K.jsx)("div",{className:"runtime-timer",children:v.actualStart})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label center",children:"Over / under"}),(0,K.jsx)("div",{className:p(["runtime-timer","center",!s&&"muted",N]),children:v.offset})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label right",children:t("common.expected_end")}),(0,K.jsx)("div",{className:"runtime-timer right",children:v.expectedEnd})]})]})}),(0,K.jsxs)("div",{className:"card",id:"card-event-now",children:[(0,K.jsxs)("div",{className:"card__row",children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label",children:t("common.now")}),(0,K.jsx)("div",{className:"title",children:g.title})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label right",children:t("common.next")}),(0,K.jsx)("div",{className:"title right",children:j})]})]}),(0,K.jsxs)("div",{className:"card__row",children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label",children:t("common.started_at")}),(0,K.jsx)("div",{className:"runtime-timer",children:g.startedAt})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label"}),(0,K.jsx)("div",{className:p(["event-timer",o.phase===d.Overtime&&"event-timer--finished",o.playback===l.Pause&&"event-timer--paused"]),style:{"--phase-color":b},"data-phase":o.phase,children:g.timer})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label right",children:t("common.expected_end")}),(0,K.jsx)("div",{className:"runtime-timer right",children:g.expectedEnd})]})]})]}),(0,K.jsx)(Z,{}),(0,K.jsx)("div",{className:"card",id:"card-timer-message",children:(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label",children:t("common.timer_message")}),(0,K.jsx)("div",{className:p(["extra",!_&&"muted"]),children:_})]})}),(0,K.jsx)("div",{className:"card",id:"card-secondary-message",children:(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label",children:t("common.secondary_message")}),(0,K.jsx)("div",{className:p(["extra",!y&&"muted"]),children:y})]})})]})}function Z(){const e=h();return(0,K.jsx)("div",{className:"card",id:"card-aux",children:(0,K.jsxs)("div",{className:"card__row",children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label",children:"Aux 1"}),(0,K.jsx)("div",{className:"extra",children:m(e.aux1)})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label center",children:"Aux 2"}),(0,K.jsx)("div",{className:"extra center",children:m(e.aux2)})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("div",{className:"label right",children:"Aux 3"}),(0,K.jsx)("div",{className:"extra right",children:m(e.aux3)})]})]})})}function ee({customFields:e,projectData:t,isMirrored:i,settings:s,viewSettings:a}){const{hideCards:n}=J(),r=u(s?.timeFormat),c=(0,$.useMemo)(()=>H(r,e),[r,e]);return(0,K.jsxs)("div",{className:p(["studio",i&&"mirror"]),"data-testid":"studio-view",children:[(0,K.jsx)(z,{target:o.StudioClock,viewOptions:c}),(0,K.jsx)("div",{className:"project-header",children:(0,K.jsxs)("div",{className:p(["project-header__brand",!t?.logo&&"project-header__brand--without-logo"]),children:[t?.logo&&(0,K.jsx)(V,{name:t.logo,className:"logo"}),(0,K.jsx)("div",{className:"title",children:t.title})]})}),(0,K.jsxs)("div",{className:p(["studio-contents",n&&"studio-contents--onecol"]),children:[(0,K.jsx)(X,{hideCards:n}),!n&&(0,K.jsx)(Q,{viewSettings:a})]})]})}return e("default",function(){const{data:e,status:t}=function(){const e=_(e=>e.mirror),{data:t,status:i}=L(),{data:s,status:a}=y(),{data:n,status:r}=g(),{data:o,status:c}=R();return{data:{customFields:o,projectData:t,isMirrored:e,settings:n,viewSettings:s},status:T([i,a,r,c])}}();return C("Studio Clock"),"pending"===t?(0,K.jsx)(b,{}):"error"===t?(0,K.jsx)(S,{variant:"error",text:"There was an error fetching data, please refresh the page."}):(0,K.jsx)(ee,{...e})}),{setters:[function(e){i=e.a,s=e.n,a=e.t},function(e){n=e.$,r=e.Et,o=e.Kt,c=e.M,d=e.Rt,l=e.Ut,m=e._t,u=e.et,x=e.j,h=e.l},function(e){},function(e){v=e.t,f=e.y},function(e){},function(e){p=e.K},function(e){},function(e){},function(e){g=e.t},function(e){},function(e){j=e.t},function(e){_=e.t},function(e){},function(e){y=e.i,b=e.s,w=e.t},function(e){},function(e){},function(e){N=e.i,k=e.n,S=e.o,z=e.t},function(e){E=e.i,A=e.n},function(e){C=e.t},function(e){I=e.t},function(e){M=e.n,P=e.t},function(e){D=e.n,O=e.t},function(e){R=e.t},function(e){T=e.t},function(e){V=e.t},function(e){F=e.t},function(e){L=e.t},function(e){U=e.t}],execute:function(){(W=document.createElement("style")).textContent='@keyframes blink{0%{opacity:1}50%{opacity:.2}}.studio__clock{--full-size:min(75vh, 45vw);--half-size:calc(var(--full-size) / 2);--smaller-half-size:calc(var(--half-size) - 2rem);--timer-font-size:calc(var(--half-size) / 2.5);--small-font-size:calc(var(--half-size) / 10);margin:auto}.studio__clock .clock-container{width:max-content;min-height:var(--full-size);flex-direction:column;justify-content:space-between;padding:10vh;display:flex;position:relative}.studio__clock .time{color:#ed3333;font-size:var(--timer-font-size);place-content:center;display:grid}.studio__clock .time--small{text-align:center;display:block;position:relative}.studio__clock .tick{background:#400;border-radius:99px;width:1rem;height:1rem;margin-top:-.5rem;margin-left:-.5rem;position:absolute;top:50%;left:50%}.studio__clock .tick--active{background:#ed3333}.studio__clock .ampm,.studio__clock .on-air{text-align:center;letter-spacing:.05em;font-weight:600;line-height:1em;font-size:var(--small-font-size);border-radius:3px;margin:0 auto;padding:.125em .25em}.studio__clock .ampm{color:#ed3333}.studio__clock .on-air{opacity:0}.studio__clock .on-air--active{color:#f6f6f6;opacity:1;background:#ed3333}@media screen and (max-width:800px){.studio__clock{--full-size:min(75vh, 75vw)}}@media (min-width:800px) and (max-width:1440px){.studio__clock{margin-top:0;margin-bottom:0;padding-top:2.5vh;padding-bottom:2.5vh}}.studio__clock--small{margin:0}.studio__timers{flex-direction:column;gap:min(2vh,16px);margin-top:auto;margin-bottom:auto;font-size:max(15px,min(1.5vw,28px));display:flex}.studio__timers .card{background-color:var(--card-background-color-override,rgba(255,255,255,.05));border-radius:8px;flex-direction:column;gap:1rem;padding:min(2vh,8px) max(16px,min(2vw,24px));display:flex}.studio__timers .card__row{justify-content:space-between;align-items:center;display:flex}.studio__timers .label{color:var(--label-color-override,rgba(255,255,255,.25));text-transform:uppercase;font-size:max(12px,min(1.25vw,20px))}.studio__timers .label:after{content:""}.studio__timers .runtime-timer{font-size:max(15px,min(1.5vw,28px));line-height:1}.studio__timers .event-timer{opacity:1;text-align:center;letter-spacing:.05em;color:var(--timer-color-override,var(--phase-color));font-size:max(24px,min(2.5vw,48px));line-height:1}.studio__timers .event-timer--paused{opacity:.6;transition:all .5s}.studio__timers .event-timer--finished{color:var(--timer-overtime-color-override,#fa5656)}.studio__timers .event-timer[data-phase=warning]{color:var(--timer-warning-color-override,var(--phase-color))}.studio__timers .event-timer[data-phase=danger]{color:var(--timer-danger-color-override,var(--phase-color))}.studio__timers .over{color:#f57c13}.studio__timers .under{color:#55b469}.studio__timers .muted{color:#8a8a8a}.studio__timers .extra{font-size:max(15px,min(1.5vw,28px));line-height:1}.studio__timers .title{margin-bottom:.25em}.studio__timers .right{text-align:right}.studio__timers .center{text-align:center}@media screen and (max-width:1300px){.studio__timers{margin:0}}.blink{animation:1s step-start infinite blink}.fourtyfive{transform:rotate(45deg)}.mirror{transform:rotate(180deg)}.studio{box-sizing:border-box;width:100%;height:100vh;font-family:var(--font-family-override,"Open Sans", "Segoe UI", sans-serif);background:var(--background-color-override,#000);color:var(--color-override,rgba(255,255,255,.8));flex-direction:column;margin:0;padding:min(2vh,16px) max(16px,min(2vw,24px));font-size:max(15px,min(1.5vw,28px));display:flex;overflow:hidden}.studio .studio-contents{flex:1;grid-template-columns:1fr 1fr;place-content:center;display:grid}.studio .studio-contents--onecol{grid-template-columns:1fr;place-content:center;height:100%}.studio .project-header{grid-area:header;align-items:center;gap:1rem;font-size:max(24px,min(2.5vw,48px));font-weight:600;display:flex}.studio .project-header__brand{align-items:center;gap:1rem;min-width:0;display:flex}.studio .project-header__brand--without-logo{align-self:baseline}.studio .logo{max-width:min(200px,20vw)}.studio .title{line-height:1.1em}@media screen and (max-width:800px){.studio .logo img{height:min(50px,10vh)}.studio .studio-contents{gap:min(2vh,16px);margin-top:min(2vh,16px)}}@media screen and (max-width:1300px){.studio .studio-contents{flex-direction:column;justify-content:start;display:flex}.studio .studio-contents--onecol{justify-content:center}}\n/*$vite$:1*/',document.head.appendChild(W),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]="bd8b8b89-5017-47b1-8afa-1ac5ecb461e2",e._sentryDebugIdIdentifier="sentry-dbid-bd8b8b89-5017-47b1-8afa-1ac5ecb461e2")}catch(e){}}(),$=i(s(),1),H=(e,t)=>{const i=N(t,[{value:"title",label:"Title"}]);return[{title:k.ClockOptions,collapsible:!0,options:[P(e)]},{title:k.DataSources,collapsible:!0,options:[{id:"main",title:"Main text",description:"Select the data source for the main text",type:"option",values:i,defaultValue:"title"}]},{title:k.ElementVisibility,collapsible:!0,options:[{id:"hideCards",title:"Hide cards section",description:"Hides the card section with the timers",type:"boolean",defaultValue:!1}]}]},K=a(),B=[...Array(12).keys()],Y=[...Array(60).keys()],q={format12:"h:mm a",format24:"HH:mm"}}}});
//# sourceMappingURL=Studio-legacy-lCKDSdPA.js.map