Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
import{j as m,d as J,aA as de}from"./boot-gChjRm3a.js";import"./index-CVbgP2sZ.js";function Y(e){if(e instanceof Date)return e.getHours();if(typeof e=="string"){const n=e.split(":");if(n.length>=2){const t=n[0];if(t){const r=Number.parseInt(t,10);if(!Number.isNaN(r))return r}}}throw new Error(`Failed to get hours from date: ${e}.`)}function w(e){if(e instanceof Date)return e.getMinutes();if(typeof e=="string"){const n=e.split(":");if(n.length>=2){const t=n[1]||"0",r=Number.parseInt(t,10);if(!Number.isNaN(r))return r}}throw new Error(`Failed to get minutes from date: ${e}.`)}function y(e){if(e instanceof Date)return e.getSeconds();if(typeof e=="string"){const n=e.split(":");if(n.length>=2){const t=n[2]||"0",r=Number.parseInt(t,10);if(!Number.isNaN(r))return r}}throw new Error(`Failed to get seconds from date: ${e}.`)}function M(e){if(e instanceof Date)return e.getMilliseconds();if(typeof e=="string"){const n=e.split(":");if(n.length>=2){const r=(n[2]||"0").split(".")[1]||"0",o=Number.parseInt(r,10);if(!Number.isNaN(o))return o}}throw new Error(`Failed to get seconds from date: ${e}.`)}function S(e){var n=e.angle,t=n===void 0?0:n,r=e.name,o=e.length,i=o===void 0?100:o,c=e.oppositeLength,a=c===void 0?10:c,l=e.width,s=l===void 0?1:l;return m.jsx("div",{className:"react-clock__hand react-clock__".concat(r,"-hand"),style:{transform:"rotate(".concat(t,"deg)")},children:m.jsx("div",{className:"react-clock__hand__body react-clock__".concat(r,"-hand__body"),style:{width:"".concat(s,"px"),top:"".concat(50-i/2,"%"),bottom:"".concat(50-a/2,"%")}})})}var q=J.memo(function(n){var t=n.angle,r=t===void 0?0:t,o=n.length,i=o===void 0?10:o,c=n.name,a=n.width,l=a===void 0?1:a;return m.jsx("div",{className:"react-clock__mark react-clock__".concat(c,"-mark"),style:{transform:"rotate(".concat(r,"deg)")},children:m.jsx("div",{className:"react-clock__mark__body react-clock__".concat(c,"-mark__body"),style:{width:"".concat(l,"px"),top:0,bottom:"".concat(100-i/2,"%")}})})}),le=J.memo(function(n){var t=n.angle,r=t===void 0?0:t,o=n.length,i=o===void 0?10:o,c=n.name,a=n.number;return m.jsx("div",{className:"react-clock__mark react-clock__".concat(c,"-mark"),style:{transform:"rotate(".concat(r,"deg)")},children:m.jsx("div",{className:"react-clock__mark__number",style:{transform:"rotate(-".concat(r,"deg)"),top:"".concat(i/2,"%")},children:a})})});const fe=(e,n,t,r)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const o=Object.getOwnPropertyDescriptor(e,t),i=Object.getOwnPropertyDescriptor(n,t);!me(o,i)&&r||Object.defineProperty(e,t,i)},me=function(e,n){return e===void 0||e.configurable||e.writable===n.writable&&e.enumerable===n.enumerable&&e.configurable===n.configurable&&(e.writable||e.value===n.value)},ge=(e,n)=>{const t=Object.getPrototypeOf(n);t!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,t)},he=(e,n)=>`/* Wrapped ${e}*/
${n}`,pe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ve=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),be=(e,n,t)=>{const r=t===""?"":`with ${t.trim()}() `,o=he.bind(null,r,n.toString());Object.defineProperty(o,"name",ve);const{writable:i,enumerable:c,configurable:a}=pe;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:c,configurable:a})};function Ne(e,n,{ignoreNonConfigurable:t=!1}={}){const{name:r}=e;for(const o of Reflect.ownKeys(n))fe(e,n,o,t);return ge(e,n),be(e,n,r),e}const v=2147483647,ke=new WeakMap,H=new WeakMap,we=new WeakMap;function ye(e,n){const t=e.get(n);if(t){if(t.maxAge<=Date.now()){e.delete(n);return}return t}}function K(e,{cacheKey:n,cache:t=new Map,maxAge:r}={}){if(r===0)return e;if(typeof r=="number"&&Number.isFinite(r)){if(r>v)throw new TypeError(`The \`maxAge\` option cannot exceed ${v}.`);if(r<0)throw new TypeError("The `maxAge` option should not be a negative number.")}const o=function(...i){const c=n?n(i):i[0],a=ye(t,c);if(a)return a.data;const l=e.apply(this,i),s=typeof r=="function"?r(...i):r;if(s!==void 0&&s!==Number.POSITIVE_INFINITY){if(!Number.isFinite(s))throw new TypeError("The `maxAge` function must return a finite number, `0`, or `Infinity`.");if(s<=0)return l;if(s>v)throw new TypeError(`The \`maxAge\` function result cannot exceed ${v}.`)}if(t.set(c,{data:l,maxAge:s===void 0||s===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:Date.now()+s}),s!==void 0&&s!==Number.POSITIVE_INFINITY){const g=setTimeout(()=>{t.delete(c),H.get(o)?.delete(g)},s);g.unref?.();const h=H.get(o)??new Set;h.add(g),H.set(o,h)}return l};return Ne(o,e,{ignoreNonConfigurable:!0}),ke.set(o,t),we.set(o,n??(i=>i[0])),o}function Me(e){return typeof e=="string"}function Se(e,n,t){return t.indexOf(e)===n}function He(e){return e.toLowerCase()===e}function A(e){return e.indexOf(",")===-1?e:e.split(",")}function O(e){if(!e)return e;if(e==="C"||e==="posix"||e==="POSIX")return"en-US";if(e.indexOf(".")!==-1){var n=e.split(".")[0],t=n===void 0?"":n;return O(t)}if(e.indexOf("@")!==-1){var r=e.split("@")[0],t=r===void 0?"":r;return O(t)}if(e.indexOf("-")===-1||!He(e))return e;var o=e.split("-"),i=o[0],c=o[1],a=c===void 0?"":c;return"".concat(i,"-").concat(a.toUpperCase())}function Oe(e){var n=e===void 0?{}:e,t=n.useFallbackLocale,r=t===void 0?!0:t,o=n.fallbackLocale,i=o===void 0?"en-US":o,c=[];if(typeof navigator<"u"){for(var a=navigator.languages||[],l=[],s=0,g=a;s<g.length;s++){var h=g[s];l=l.concat(A(h))}var p=navigator.language,b=p&&A(p);c=c.concat(l,b)}return r&&c.push(i),c.filter(Me).map(O).filter(Se)}var xe=K(Oe,{cacheKey:JSON.stringify});function Le(e){return xe(e)[0]||null}var Ie=K(Le,{cacheKey:JSON.stringify});function je(e,n){return n.toLocaleString(e||Ie()||void 0)}function _e(e){return e!==null&&e!==!1&&!Number.isNaN(Number(e))}function Pe(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Math.max.apply(Math,e.filter(_e))}function We(e){var n=e.className,t=e.formatHour,r=t===void 0?je:t,o=e.hourHandLength,i=o===void 0?50:o,c=e.hourHandOppositeLength,a=e.hourHandWidth,l=a===void 0?4:a,s=e.hourMarksLength,g=s===void 0?10:s,h=e.hourMarksWidth,p=h===void 0?3:h,b=e.locale,x=e.minuteHandLength,R=x===void 0?70:x,X=e.minuteHandOppositeLength,L=e.minuteHandWidth,B=L===void 0?2:L,I=e.minuteMarksLength,j=I===void 0?6:I,_=e.minuteMarksWidth,G=_===void 0?1:_,P=e.renderHourMarks,N=P===void 0?!0:P,T=e.renderMinuteHand,F=T===void 0?!0:T,W=e.renderMinuteMarks,E=W===void 0?!0:W,Q=e.renderNumbers,C=e.renderSecondHand,$=C===void 0?!0:C,U=e.secondHandLength,Z=U===void 0?90:U,ee=e.secondHandOppositeLength,V=e.secondHandWidth,ne=V===void 0?1:V,z=e.size,D=z===void 0?150:z,k=e.useMillisecondPrecision,u=e.value;function te(){if(!E)return null;for(var f=[],d=1;d<=60;d+=1){var ue=N&&!(d%5);ue||f.push(m.jsx(q,{angle:d*6,length:j,name:"minute",width:G},"minute_".concat(d)))}return f}function re(){if(!N)return null;for(var f=[],d=1;d<=12;d+=1)f.push(m.jsx(q,{angle:d*30,length:g,name:"hour",width:p},"hour_".concat(d)));return f}function oe(){if(!Q)return null;for(var f=[],d=1;d<=12;d+=1)f.push(m.jsx(le,{angle:d*30,length:Pe(N&&g,E&&j,0),name:"number",number:r(b,d)},"number_".concat(d)));return f}function ie(){return m.jsxs("div",{className:"react-clock__face",children:[te(),re(),oe()]})}function ce(){var f=u?Y(u)*30+w(u)/2+y(u)/120+(k?M(u)/12e4:0):0;return m.jsx(S,{angle:f,length:i,name:"hour",oppositeLength:c,width:l})}function se(){if(!F)return null;var f=u?Y(u)*360+w(u)*6+y(u)/10+(k?M(u)/1e4:0):0;return m.jsx(S,{angle:f,length:R,name:"minute",oppositeLength:X,width:B})}function ae(){if(!$)return null;var f=u?w(u)*360+y(u)*6+(k?M(u)*.006:0):0;return m.jsx(S,{angle:f,length:Z,name:"second",oppositeLength:ee,width:ne})}return m.jsxs("time",{className:de("react-clock",n),dateTime:u instanceof Date?u.toLocaleTimeString("en",{hourCycle:"h23",hour:"2-digit",minute:F?"2-digit":void 0,second:$?"2-digit":void 0}):u||void 0,style:{width:D,height:D},children:[ie(),ce(),se(),ae()]})}export{We as Clock,We as default};