1import{u as Q}from"./ekSX7_HF.js";import{M as ee}from"./DKNgDMmf.js";import{bd as j,an as B,i as G}from"./app-BAclpbpz.js";import{d as W,t as P,M as te}from"./CaG3_tWT.js";import{b as U,c as M,a as u,e as ae,Y as oe,l as f,h as r,A as T,s as H,M as R,N as $,B as F,p as le,i as J,g as q,j as ne,q as s,C as se}from"./BI8qgwQJ.js";import"./BTqQ_sdn.js";const ie=["cx","cy","fill","opacity"],ue=["x","y","font-size","font-weight","fill","opacity"],re=["x1","y1","x2","y2","stroke","stroke-width"],ce=["x1","y1","x2","y2","stroke","stroke-width"],de=["x1","y1","x2","y2","stroke","stroke-width"],Y=.5,Z=.6,v=1,k=.7,_=.75,E=1,S=1,K=.35,me=U({__name:"MkAnalogClock",props:{thickness:{default:.1},offset:{default:0-new Date().getTimezoneOffset()},twentyfour:{type:Boolean,default:!1},graduations:{default:"dots"},fadeGraduations:{type:Boolean,default:!0},sAnimation:{default:"elastic"},now:{type:Function,default:()=>new Date}},setup(I){const C=(t,i)=>{const o=Math.abs(t-i);return Math.abs((o+Math.PI)%(Math.PI*2)-Math.PI)},l=I,L=M(()=>{const t=[],i=l.twentyfour?24:12;for(let o=0;o<i;o++){const n=Math.PI*o/(i/2);t.push(n)}return t}),p=M(()=>{const t=[],i=l.twentyfour?24:12;for(let o=0;o<i;o++){const n=Math.PI*o/(i/2);t.push(n)}return t});let w=!0;const a=u(),A=u(),z=u(),c=u(),h=u(),e=u(0),g=u(0),d=u(0),m=u(0),y=u(0),x=u(0),N=u(!1);let V=!1;const O=u();function b(){const t=l.now();t.setMinutes(t.getMinutes()+t.getTimezoneOffset()+l.offset);const i=d.value,o=g.value,n=e.value;d.value=t.getSeconds(),g.value=t.getMinutes(),e.value=t.getHours(),!(i===d.value&&o===g.value&&n===e.value)&&(m.value=Math.PI*(e.value%(l.twentyfour?24:12)+(g.value+d.value/60)/60)/(l.twentyfour?12:6),y.value=Math.PI*(g.value+d.value/60)/30,V&&O.value?(x.value=Math.PI*60/30,W.delete(b),O.value.addEventListener("transitionend",()=>{N.value=!0,requestAnimationFrame(()=>{x.value=0,requestAnimationFrame(()=>{N.value=!1,w&&W.add(b)})})},{once:!0})):x.value=Math.PI*d.value/30,V=d.value===59)}b();function D(){const t=getComputedStyle(window.document.documentElement),i=B(t.getPropertyValue("--MI_THEME-bg")).isDark(),o=B(t.getPropertyValue("--MI_THEME-accent")).toHexString();a.value=i?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)",A.value=i?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.3)",z.value=B(t.getPropertyValue("--MI_THEME-fg")).toHexString(),c.value=o,h.value=o}return D(),ae(()=>{W.add(b),j.on("themeChanged",D)}),oe(()=>{w=!1,W.delete(b),j.off("themeChanged",D)}),(t,i)=>(r(),f("svg",{class:"MkAnalogClock-root-rjeD",viewBox:"0 0 10 10",preserveAspectRatio:"none"},[l.graduations==="dots"?(r(!0),f(R,{key:0},$(L.value,(o,n)=>(r(),f("circle",{cx:5+Math.sin(o)*(5-Y),cy:5-Math.cos(o)*(5-Y),r:.125,fill:(l.twentyfour?e.value:e.value%12)===n?h.value:a.value,opacity:!l.fadeGraduations||(l.twentyfour?e.value:e.value%12)===n?1:Math.max(0,1-C(m.value,o)/Math.PI-K)},null,8,ie))),256)):l.graduations==="numbers"?(r(!0),f(R,{key:1},$(p.value,(o,n)=>(r(),f("text",{x:5+Math.sin(o)*(5-Z),y:5-Math.cos(o)*(5-Z),"text-anchor":"middle","dominant-baseline":"middle","font-size":(l.twentyfour?e.value:e.value%12)===n?1:.7,"font-weight":(l.twentyfour?e.value:e.value%12)===n?"bold":"normal",fill:(l.twentyfour?e.value:e.value%12)===n?h.value:"currentColor",opacity:!l.fadeGraduations||(l.twentyfour?e.value:e.value%12)===n?1:Math.max(0,1-C(m.value,o)/Math.PI-K)},F(n===0?l.twentyfour?"24":"12":n),9,ue))),256)):T("",!0),H("line",{ref_key:"sLine",ref:O,class:J(["MkAnalogClock-s-zyu8",{"MkAnalogClock-animate-q32K":!N.value&&t.sAnimation!=="none","MkAnalogClock-elastic-znai":t.sAnimation==="elastic","MkAnalogClock-easeOut-Cu8a":t.sAnimation==="easeOut"}]),x1:5-0*(S*k),y1:5+1*(S*k),x2:5+0*(S*5-v),y2:5-1*(S*5-v),stroke:A.value,"stroke-width":t.thickness/2,style:le(`transform: rotateZ(${x.value}rad)`),"stroke-linecap":"round"},null,14,re),H("line",{x1:5-Math.sin(y.value)*(E*k),y1:5+Math.cos(y.value)*(E*k),x2:5+Math.sin(y.value)*(E*5-v),y2:5-Math.cos(y.value)*(E*5-v),stroke:z.value,"stroke-width":t.thickness,"stroke-linecap":"round"},null,8,ce),H("line",{x1:5-Math.sin(m.value)*(_*k),y1:5+Math.cos(m.value)*(_*k),x2:5+Math.sin(m.value)*(_*5-v),y2:5-Math.cos(m.value)*(_*5-v),stroke:c.value,"stroke-width":t.thickness,"stroke-linecap":"round"},null,8,de)],2))}});const X="clock",be=U({__name:"WidgetClock",props:{widget:{}},emits:["updateProps"],setup(I,{expose:C,emit:l}){const L={transparent:{type:"boolean",default:!1},size:{type:"radio",default:"medium",options:[{value:"small",label:G.ts.small},{value:"medium",label:G.ts.medium},{value:"large",label:G.ts.large}]},thickness:{type:"radio",default:.2,options:[{value:.1,label:"thin"},{value:.2,label:"medium"},{value:.3,label:"thick"}]},graduations:{type:"radio",default:"numbers",options:[{value:"none",label:"None"},{value:"dots",label:"Dots"},{value:"numbers",label:"Numbers"}]},fadeGraduations:{type:"boolean",default:!0},sAnimation:{type:"radio",default:"elastic",options:[{value:"none",label:"None"},{value:"elastic",label:"Elastic"},{value:"easeOut",label:"Ease out"}]},twentyFour:{type:"boolean",default:!1},label:{type:"radio",default:"none",options:[{value:"none",label:"None"},{value:"time",label:"Time"},{value:"tz",label:"TZ"},{value:"timeAndTz",label:"Time + TZ"}]},timezone:{type:"enum",default:null,enum:[...P.map(e=>({label:e.name,value:e.name.toLowerCase()})),{label:"(auto)",value:null}]}},p=I,w=l,{widgetProps:a,configure:A}=Q(X,L,p,w),z=M(()=>(a.timezone===null?P.find(e=>e.name.toLowerCase()===Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase())?.abbrev:P.find(e=>e.name.toLowerCase()===a.timezone)?.abbrev)??"?"),c=M(()=>a.timezone===null?0-new Date().getTimezoneOffset():P.find(e=>e.name.toLowerCase()===a.timezone)?.offset??0),h=M(()=>(c.value>=0?"+":"-")+Math.floor(c.value/60).toString().padStart(2,"0")+":"+(c.value%60).toString().padStart(2,"0"));return C({name:X,configure:A,id:p.widget?p.widget.id:null}),(e,g)=>(r(),q(ee,{naked:s(a).transparent,showHeader:!1,"data-cy-mkw-clock":""},{default:ne(()=>[H("div",{class:J(["WidgetClock-root-tNeE",{"WidgetClock-small-mABV":s(a).size==="small","WidgetClock-medium-1Scx":s(a).size==="medium","WidgetClock-large-pPXc":s(a).size==="large"}])}
1,[s(a).label==="tz"||s(a).label==="timeAndTz"?(r(),f("div",{key:0,class:"_monospace WidgetClock-label-4NYE WidgetClock-a-bGsr"},F(z.value),3)):T("",!0),se(me,{class:"WidgetClock-clock-bwb7",thickness:s(a).thickness,offset:c.value,graduations:s(a).graduations,fadeGraduations:s(a).fadeGraduations,twentyfour:s(a).twentyFour,sAnimation:s(a).sAnimation},null,8,["class","thickness","offset","graduations","fadeGraduations","twentyfour","sAnimation"]),s(a).label==="time"||s(a).label==="timeAndTz"?(r(),q(te,{key:1,class:"WidgetClock-label-4NYE WidgetClock-c-3teH _monospace",showS:!1,offset:c.value},null,8,["class","offset"])):T("",!0),s(a).label==="tz"||s(a).label==="timeAndTz"?(r(),f("div",{key:2,class:"_monospace WidgetClock-label-4NYE WidgetClock-d-EzLW"},F(h.value),3)):T("",!0)],2)]),_:1},8,["naked"]))}});export{be as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.