super-time-tracker-ui 0.1.33 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/next-output/BUILD_ID +1 -1
- package/dist/standalone/next-output/build-manifest.json +3 -3
- package/dist/standalone/next-output/server/app/_global-error.html +1 -1
- package/dist/standalone/next-output/server/app/_global-error.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/login/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/offline/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/offline/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/pomodoro/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/pomodoro/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/register/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/register/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/reporting/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/reporting/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/search/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/search/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/ai-suggestions/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/cloud-sync/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/data/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/data/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/display/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/display/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/goals/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/goals/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/pomodoro/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/pomodoro/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/quick-actions/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/quick-actions/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/tags/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/tags/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/sheets/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/sheets/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/today/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/today/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0fzz02j._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0fzq9xc._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0hy_8.b._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0ntfdc9._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0p5_u-y._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_0q214m8._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/{_0-a9ia4._.js → _0syjj1b._.js} +2 -2
- package/dist/standalone/next-output/server/chunks/ssr/{_10c-dv7._.js → _0zfyg1r._.js} +2 -2
- package/dist/standalone/next-output/server/chunks/ssr/_11je2nt._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/components_0isp.qn._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/components_tracker-app_tsx_0qs9.7y._.js +1 -1
- package/dist/standalone/next-output/server/middleware-build-manifest.js +3 -3
- package/dist/standalone/next-output/server/middleware-manifest.json +1 -1
- package/dist/standalone/next-output/server/pages/500.html +1 -1
- package/dist/standalone/next-output/static/chunks/03dh~3.gq~kw7.js +1 -0
- package/dist/standalone/next-output/static/chunks/{049ufrw2rog87.js → 0aru5x_.qsjc3.js} +1 -1
- package/dist/standalone/next-output/static/chunks/0c0i5ey6h8qet.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0ufz8oxu3.gqp.js → 0c2088mpz.z.3.js} +1 -1
- package/dist/standalone/next-output/static/chunks/0jn1~13s4qy3c.js +1 -0
- package/dist/standalone/next-output/static/chunks/0jwrz3zhj9oat.js +1 -0
- package/dist/standalone/next-output/static/chunks/0mcmtes_owmfo.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0yd454vuc8vdt.js → 0njpt~3f0nhto.js} +1 -1
- package/dist/standalone/next-output/static/chunks/{03lov4c0_c3q~.js → 0s5i31vj2y6n7.js} +1 -1
- package/dist/standalone/package.json +1 -1
- package/package.json +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0qwn._e._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_00x~ete._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_01m_4io._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0l~yvzl._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0t2td71._.js +0 -3
- package/dist/standalone/next-output/static/chunks/0ahw3noqs1atp.js +0 -1
- package/dist/standalone/next-output/static/chunks/0hse41v5a2z.p.js +0 -1
- package/dist/standalone/next-output/static/chunks/0q1lqhczpaxed.js +0 -1
- package/dist/standalone/next-output/static/chunks/0xalmh45.srx..js +0 -1
- package/dist/standalone/next-output/static/chunks/0xeacy6yprulb.js +0 -1
- package/dist/standalone/next-output/static/chunks/10hpcjpra-dzn.js +0 -1
- /package/dist/standalone/next-output/static/{X1tXHWU8OQsHkaFGwq5aW → o0yrmO-jZI10Gicr4syI_}/_buildManifest.js +0 -0
- /package/dist/standalone/next-output/static/{X1tXHWU8OQsHkaFGwq5aW → o0yrmO-jZI10Gicr4syI_}/_clientMiddlewareManifest.js +0 -0
- /package/dist/standalone/next-output/static/{X1tXHWU8OQsHkaFGwq5aW → o0yrmO-jZI10Gicr4syI_}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return i}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066)._(e.r(78677)),o=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",l=e.hash||"",i=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),i&&"object"==typeof i&&(i=String(a.urlQueryToSearchParams(i)));let u=e.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),s=s.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${s}${u}${l}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(29158);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=a(e,n)),t&&(s.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(31047),s=e.r(63334);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return x},useLinkStatus:function(){return b}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066),o=e.r(54710),l=a._(e.r(29158)),i=e.r(42552),c=e.r(61717),u=e.r(37879),d=e.r(31047),m=e.r(20321);e.r(90503);let p=e.r(38520),f=e.r(19947),h=e.r(59246),_=e.r(99046);function x(t){var r,n;let s,a,x,[b,y]=(0,l.useOptimistic)(f.IDLE_LINK_STATUS),v=(0,l.useRef)(null),{href:j,as:N,children:w,prefetch:k=null,passHref:S,replace:E,shallow:T,scroll:O,onClick:C,onMouseEnter:A,onTouchStart:M,legacyBehavior:P=!1,onNavigate:R,transitionTypes:L,ref:I,unstable_dynamicOnHover:D,...U}=t;s=w,P&&("string"==typeof s||"number"==typeof s)&&(s=(0,o.jsx)("a",{children:s}));let $=l.default.useContext(c.AppRouterContext),F=!1!==k,K=!1!==k?null===(n=k)||"auto"===n?_.FetchStrategy.PPR:_.FetchStrategy.Full:_.FetchStrategy.PPR,q="string"==typeof(r=N||j)?r:(0,i.formatUrl)(r);if(P){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=l.default.Children.only(s)}let B=P?a&&"object"==typeof a&&a.ref:I,Y=l.default.useCallback(e=>(null!==$&&(v.current=(0,f.mountLinkInstance)(e,q,$,K,F,y)),()=>{v.current&&((0,f.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,f.unmountPrefetchableInstance)(e)}),[F,q,$,K,y]),W={ref:(0,u.useMergedRef)(Y,B),onClick(t){P||"function"!=typeof C||C(t),P&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!$||t.defaultPrevented||function(t,r,n,s,a,o,i){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);l.default.startTransition(()=>{d(r,s?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,i)})}}(t,q,v,E,O,R,L)},onMouseEnter(e){P||"function"!=typeof A||A(e),P&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),$&&F&&(0,f.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){P||"function"!=typeof M||M(e),P&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),$&&F&&(0,f.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,d.isAbsoluteUrl)(q)?W.href=q:P&&!S&&("a"!==a.type||"href"in a.props)||(W.href=(0,m.addBasePath)(q)),x=P?l.default.cloneElement(a,W):(0,o.jsx)("a",{...U,...W,children:s}),(0,o.jsx)(g.Provider,{value:b,children:x})}e.r(10364);let g=(0,l.createContext)(f.IDLE_LINK_STATUS),b=()=>(0,l.useContext)(g);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),s=e.i(32417),a=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[o,l]=(0,r.useState)(null),[i,c]=(0,r.useState)(!1),u=(0,s.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!u)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{l(e?.user.email??null)}).catch(()=>{l(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{l(t?.user.email??null)});return()=>{t.unsubscribe()}},[u]),{is_configured:u,email:o,is_pending:i,sign_out:(0,r.useCallback)(async()=>{c(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,a.notify_settings_saved)("Signed out"),e.refresh()}finally{c(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/",label:"Tracker",match:e=>"/"===e}];function a(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":s?"page":void 0,children:n.label},n.href)})})}],45200);var o=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,o.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(a,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","search","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let s=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(s))}catch{return r}}],73205);var n=e.i(34869),s=e.i(92629);let a=(0,n.create_ui_preference_store)({storage_key:s.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:s.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function o(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,a],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return o()}],76003);var l=e.i(17798),i=e.i(46549),c=e.i(10464),u=e.i(35434),d=e.i(61834),m=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===o()?"light":"dark";(0,l.apply_theme)(e),(0,m.write_stored_theme)(e),c.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),c.theme_mode_preference.notify(),(0,u.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let s=(0,t.useRef)(e);s.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),s.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),a=e.i(37399),o=e.i(90463),l=e.i(46549),i=e.i(73205),c=e.i(66295),u=e.i(2268),d=e.i(32792),m=e.i(90299),p=e.i(28274),f=e.i(76003),h=e.i(35434),_=e.i(38240),x=e.i(22373),g=e.i(25204),b=e.i(77882);let y="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},j=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),N=(0,n.usePathname)()??"/",w=(0,s.useSyncExternalStore)(h.subscribe_theme,f.get_theme_snapshot,f.get_theme_server_snapshot),k=(0,s.useSyncExternalStore)(u.cloud_sync_enabled_preference.subscribe,u.cloud_sync_enabled_preference.get_snapshot,u.cloud_sync_enabled_preference.get_server_snapshot),S=(0,s.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),E=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),T=(0,c.parse_tracker_shortcut_map)(S),O=new Set((0,i.parse_topbar_quick_actions)(E)),C=x.topbar_quick_action_ids.filter(e=>!O.has(e)),A=Array.from(new Set([...Array.from(j),...C])),{email:M,is_configured:P,is_pending:R,sign_out:L}=(0,b.use_supabase_auth_session)(),[I,D]=(0,s.useState)(!1),U=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!I)return;let e=e=>{null===U.current||U.current.contains(e.target)||D(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[I]);let $=()=>{D(!1)};return(0,g.use_escape_to_cancel)($,I),(0,t.jsxs)("div",{className:"relative shrink-0",ref:U,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":I,"aria-haspopup":"menu",onClick:()=>D(e=>!e),children:(0,t.jsx)(a.HamburgerIcon,{})}),I?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[P&&null!==M?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:M,children:M})}):null,A.map(e=>{let n=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:y,role:"menuitem",onClick:$,children:n.label})},e)}),P?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitemcheckbox","aria-checked":"true"===k,onClick:()=>{let e="true"===k?"false":"true";u.cloud_sync_enabled_preference.write(e),u.cloud_sync_enabled_preference.notify(),(0,l.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==M&&(0,p.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===k?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===k?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{$(),(0,_.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===w?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===w?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{let e;$(),e=T.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===M?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{$(),e.push((0,o.build_auth_page_href)("sign_in",N))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${y} text-danger`,role:"menuitem",disabled:R,onClick:()=>{$(),L()},children:R?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let N=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",a=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),o=(0,s.useMemo)(()=>(0,i.parse_topbar_quick_actions)(a),[a]);if(0===o.length)return null;let l=N.filter(e=>o.includes(e.id));return 0===l.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:l.map(n=>{let s=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":s?"page":void 0,children:n.label},n.id)})})}],76080)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),s=e.i(1976),a=e.i(76080),o=e.i(45958),l=e.i(71060),i=e.i(29539);function c(){let e=((0,l.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(o.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(i.SettingsIcon,{})})}function u({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(o.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(o.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(u,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(a.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(c,{}),(0,t.jsx)(s.TopbarOverflowMenu,{})]})]})]})})}],75404)},6690,93749,e=>{"use strict";let t="super-time-tracker-pinned-sheet-names",r=new Set,n=[],s=null;function a(){try{let e=window.localStorage.getItem(t);if(null===e)return[];let r=JSON.parse(e);if(!Array.isArray(r))return[];return r.filter(e=>"string"==typeof e)}catch{return[]}}function o(e){try{window.localStorage.setItem(t,JSON.stringify(e))}catch{}s=null,r.forEach(e=>{e()})}e.s(["get_pinned_sheet_names_server_snapshot",0,function(){return n},"get_pinned_sheet_names_snapshot",0,function(){var e=a();if(0===e.length)return n;let t=e.join("\0");if(null!==s&&s.key===t)return s.snapshot;let r=Object.freeze([...e]);return s={key:t,snapshot:r},r},"read_pinned_sheet_names",0,a,"subscribe_pinned_sheet_names",0,function(e){return r.add(e),()=>{r.delete(e)}},"write_pinned_sheet_names",0,o],6690),e.s(["toggle_pinned_sheet_name",0,function(e){let t=e.trim();if(0===t.length)return;let r=a(),n=r.indexOf(t);n>=0?o([...r.slice(0,n),...r.slice(n+1)]):o([...r,t])}],93749)},83821,60145,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.DAILY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.DAILY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=30&&t<=720}});e.s(["daily_focus_target_minutes_preference",0,n],83821);let s=(0,t.create_ui_preference_store)({storage_key:r.WEEKLY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.WEEKLY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=60&&t<=4200}});e.s(["weekly_focus_target_minutes_preference",0,s],60145)},15526,e=>{"use strict";let t="super-time-tracker-pomodoro-active-entry";e.s(["clear_pomodoro_task_entry_marker",0,function(){try{window.localStorage.removeItem(t)}catch{}},"is_pomodoro_task_entry",0,function(e){let r=(()=>{try{let e=window.localStorage.getItem(t);if(null===e)return null;try{let t=JSON.parse(e);if("string"==typeof t.sheetName&&t.sheetName.length>0&&"number"==typeof t.entryId&&Number.isInteger(t.entryId))return{sheetName:t.sheetName,entryId:t.entryId}}catch{}return null}catch{return null}})();return null!==r&&r.sheetName===e.sheetName&&r.entryId===e.id},"mark_pomodoro_task_entry",0,function(e){try{let r={sheetName:e.sheetName,entryId:e.id};window.localStorage.setItem(t,JSON.stringify(r))}catch{}}])},75899,e=>{"use strict";var t=e.i(39552);e.s(["format_time",0,function(e,r="12h"){return(0,t.format)(new Date(e),"24h"===r?"HH:mm":"h:mm a")}])},60529,e=>{"use strict";e.s(["format_entry_count_label",0,function(e){return 0===e?null:1===e?"1 entry":`${e} entries`}])},35923,e=>{"use strict";var t=e.i(29158),r=e.i(97891);e.s(["use_time_format",0,function(){return(0,t.useSyncExternalStore)(r.time_format_preference.subscribe,r.time_format_preference.get_snapshot,r.time_format_preference.get_server_snapshot)}])},36178,68713,e=>{"use strict";e.s(["build_check_out_request_payload",0,function(e,t){let r={sheetName:e},n=t?.at?.trim(),s=t?.note?.trim();return void 0!==n&&n.length>0&&(r.at=n),void 0!==s&&s.length>0&&(r.note=s),r}],36178);var t=e.i(26740),r=e.i(15526);e.s(["finish_running_pomodoro_timer",0,function(){try{let e=window.localStorage.getItem(t.POMODORO_STORAGE_KEY);if(null===e)return;let n=JSON.parse(e),s=n.state;if(s?.status!=="running")return;let a={settings:n.settings??t.POMODORO_DEFAULT_SETTINGS,state:t.POMODORO_DEFAULT_STATE};window.localStorage.setItem(t.POMODORO_STORAGE_KEY,JSON.stringify(a)),(0,r.clear_pomodoro_task_entry_marker)()}catch{}}],68713)},50459,e=>{"use strict";e.s(["prompt_check_out_at",0,function(){let e=window.prompt("Check out at what time?","30 minutes ago");if(null===e)return null;let t=e.trim();return 0===t.length?null:t}])},53754,7554,76379,e=>{"use strict";var t=e.i(29158),r=e.i(14974);function n(e){let t=e?.at?.trim()??"",r=e?.note?.trim()??"",n=t.length>0,s=r.length>0,a="Stop the active timer and save this entry?";return n&&s?a=`Stop the timer at "${t}" and save a checkout note?`:n?a=`Stop the timer and check out at "${t}"?`:s&&(a="Stop the timer and save this entry with your checkout note?"),{title:"Check out?",message:a,confirmLabel:"Check out",variant:"danger"}}e.s(["get_check_out_confirm_dialog",0,n],7554);var s=e.i(97026);function a(){return"true"===(0,t.useSyncExternalStore)(s.confirm_before_checkout_preference.subscribe,s.confirm_before_checkout_preference.get_snapshot,s.confirm_before_checkout_preference.get_server_snapshot)}e.s(["use_confirm_before_checkout",0,a],76379),e.s(["useCheckOutAction",0,function(e){let{confirm:s}=(0,r.useConfirmDialog)(),o=a();return(0,t.useCallback)(async t=>(!o||!!await s(n(t)))&&(e(t),!0),[s,o,e])}],53754)},81823,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),a=e.i(75899),o=e.i(56716),l=e.i(6690);let i=[{value:"all",label:"All sheets"},{value:"pinned",label:"Pinned"}];function c({sheet_names:e,on_toggle_pin:r}){let n=(0,s.useSyncExternalStore)(o.today_scope_preference.subscribe,o.today_scope_preference.get_snapshot,o.today_scope_preference.get_server_snapshot),a=(0,s.useSyncExternalStore)(l.subscribe_pinned_sheet_names,l.get_pinned_sheet_names_snapshot,l.get_pinned_sheet_names_server_snapshot),u=new Set(a);return(0,t.jsxs)("div",{className:"flex w-full max-w-2xl flex-col gap-3",children:[(0,t.jsx)("div",{role:"group","aria-label":"Today scope",className:"flex flex-wrap gap-2",children:i.map(e=>{let r=n===e.value;return(0,t.jsx)("button",{type:"button",className:`cursor-pointer rounded-full border px-3 py-1.5 text-[0.85rem] font-semibold transition-colors duration-150 ${r?"border-accent bg-accent-soft text-foreground":"border-panel-border bg-panel text-muted hover:border-accent hover:text-foreground"}`,"aria-pressed":r,onClick:()=>{var t;return t=e.value,void(o.today_scope_preference.read()!==t&&(o.today_scope_preference.write(t),o.today_scope_preference.notify()))},children:e.label},e.value)})}),"pinned"===n?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[0===a.length?(0,t.jsx)("p",{className:"m-0 text-[0.85rem] text-muted",children:"Pin sheets from the Sheets page or below to filter today's view."}):null,(0,t.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-2 p-0","aria-label":"Pinned sheets",children:e.map(e=>{let n=u.has(e);return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",className:`cursor-pointer rounded-full border px-2.5 py-1 text-[0.8rem] font-medium transition-colors duration-150 ${n?"border-accent bg-accent-soft text-foreground":"border-panel-border bg-surface-raised text-muted hover:text-foreground"}`,"aria-pressed":n,onClick:()=>r(e),children:[n?"★ ":"☆ ",e]})},e)})})]}):null]})}var u=e.i(75404),d=e.i(36178),m=e.i(44356),p=e.i(60529),f=e.i(18774),h=e.i(32584),_=e.i(68713);function x(e,t){return t<=0?0:Math.min(100,Math.round(e/t*100))}var g=e.i(37193),b=e.i(67321),y=e.i(51229),v=e.i(83821),j=e.i(60145),N=e.i(50459),w=e.i(93749),k=e.i(53754),S=e.i(1800),E=e.i(35923);let T="rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text";function O({label:e,tracked_ms:r,target_ms:n,progress_percent:s,duration_format:a}){return(0,t.jsxs)("article",{className:"rounded-md border border-panel-border bg-background px-3 py-2.5",children:[(0,t.jsx)("p",{className:"m-0 text-[0.75rem] font-semibold uppercase tracking-[0.04em] text-muted",children:e}),(0,t.jsxs)("p",{className:"m-0 mt-1 font-mono text-[0.95rem] font-semibold text-accent",children:[(0,h.format_duration)(r,a)," /"," ",(0,h.format_duration)(n,a)]}),(0,t.jsx)("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded-full bg-accent-soft",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-300",style:{width:`${s}%`}})})]})}function C({entry:e,is_pending:n,duration_format:o,time_format:l,on_check_out:i}){let[c,u]=(0,s.useState)(()=>Date.now()-new Date(e.start)),d=(0,k.useCheckOutAction)(e=>{i(e)});(0,s.useEffect)(()=>{u(Date.now()-new Date(e.start));let t=globalThis.setInterval(()=>{u(Date.now()-new Date(e.start))},1e3);return()=>{globalThis.clearInterval(t)}},[e.start]);let m=(0,a.format_time)(e.start,l);return(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-3 shadow-sm",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:e.sheetName}),(0,t.jsx)("p",{className:"m-0 mt-1 truncate text-[0.95rem] font-medium",children:e.description||"Untitled entry"}),(0,t.jsxs)("p",{className:"m-0 mt-1 text-[0.8rem] text-muted",children:["Since ",m]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-[0.92rem] font-semibold text-accent",children:(0,h.format_duration)(c,o)}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-danger-border bg-danger-soft px-2 py-1 text-[0.74rem] font-semibold text-danger disabled:cursor-not-allowed disabled:opacity-55",disabled:n,onClick:()=>{d()},children:"Check out"}),(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-danger-border bg-danger-soft px-2 py-1 text-[0.74rem] font-semibold text-danger disabled:cursor-not-allowed disabled:opacity-55",disabled:n,onClick:()=>{let e=(0,N.prompt_check_out_at)();null!==e&&d({at:e})},title:"Check out at specific time",children:"@"}),(0,t.jsx)(r.default,{href:"/",className:"text-[0.75rem] font-semibold text-accent no-underline hover:underline",onClick:()=>(0,b.navigate_to_tracker_sheet)(e.sheetName),children:"Open"})]})]})]})})}function A({suggestion:e,is_pending:r,is_pinned:n,time_format:s,on_toggle_pin:o,on_start:l}){return(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-3 shadow-sm",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:e.sheetName}),(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-panel-border bg-background px-1.5 py-0.5 text-[0.68rem] font-semibold text-muted hover:bg-surface-hover hover:text-foreground",onClick:()=>o(e.sheetName),title:n?"Unpin sheet":"Pin sheet",children:n?"Pinned":"Pin"})]}),(0,t.jsx)("p",{className:"m-0 mt-1 truncate text-[0.95rem] font-medium",children:e.suggestedDescription||"Untitled entry"}),(0,t.jsxs)("p",{className:"m-0 mt-1 text-[0.8rem] text-muted",children:["Yesterday at ",(0,a.format_time)(e.lastLoggedAt,s)]}),e.suggestedTags.length>0?(0,t.jsx)("ul",{className:"m-0 mt-2 flex list-none flex-wrap gap-1.5 p-0",children:e.suggestedTags.map(e=>(0,t.jsx)("li",{className:T,children:(0,f.format_display_tag)(e)},e))}):null]}),(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-accent-border bg-accent px-2.5 py-1.5 text-[0.76rem] font-semibold text-accent-text-on disabled:cursor-not-allowed disabled:opacity-55",disabled:r,onClick:()=>{l()},children:"Start task"})]})})}function M({entry:e,duration_format:n,time_format:s,show_sheet_name:o}){let l=(0,a.format_time)(e.start,s),i=null===e.end?"now":(0,a.format_time)(e.end,s);return(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-3 shadow-sm",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[o?(0,t.jsx)("p",{className:"m-0 mb-1 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:e.sheetName}):null,(0,t.jsx)("p",{className:"m-0 text-[0.95rem] font-medium",children:e.description}),(0,t.jsxs)("p",{className:"m-0 mt-1 text-[0.8rem] text-muted",children:[l," → ",i]}),e.tags.length>0?(0,t.jsx)("ul",{className:"m-0 mt-2 flex list-none flex-wrap gap-1.5 p-0",children:e.tags.map(e=>(0,t.jsx)("li",{className:T,children:(0,f.format_display_tag)(e)},e))}):null]}),(0,t.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[(0,t.jsx)("span",{className:"font-mono text-[0.9rem] font-semibold text-accent",children:(0,h.format_duration)(e.todayDurationMs,n)}),(0,t.jsx)(r.default,{href:"/",className:"text-[0.8rem] font-semibold text-accent no-underline hover:underline",onClick:()=>(0,b.navigate_to_tracker_sheet)(e.sheetName),children:"Open sheet"})]})]})})}e.s(["TodayFocusView",0,function({initial_data:e}){var a;let i=(0,n.useRouter)(),f=(0,S.use_duration_format)(),b=(0,E.use_time_format)(),N=(0,s.useSyncExternalStore)(v.daily_focus_target_minutes_preference.subscribe,v.daily_focus_target_minutes_preference.get_snapshot,v.daily_focus_target_minutes_preference.get_server_snapshot),k=(0,s.useSyncExternalStore)(j.weekly_focus_target_minutes_preference.subscribe,j.weekly_focus_target_minutes_preference.get_snapshot,j.weekly_focus_target_minutes_preference.get_server_snapshot),[T,P]=(0,s.useState)(e),[R,L]=(0,s.useState)(null),[I,D]=(0,s.useState)(!1);(0,s.useEffect)(()=>{P(e)},[e]);let U=(0,s.useSyncExternalStore)(o.today_scope_preference.subscribe,o.today_scope_preference.get_snapshot,o.today_scope_preference.get_server_snapshot),$=(0,s.useSyncExternalStore)(l.subscribe_pinned_sheet_names,l.get_pinned_sheet_names_snapshot,l.get_pinned_sheet_names_server_snapshot),F=(0,s.useMemo)(()=>"all"===U?null:new Set($),[U,$]),K=(0,s.useMemo)(()=>null===F?T.runningEntries:T.runningEntries.filter(e=>F.has(e.sheetName)),[F,T.runningEntries]),q=(0,s.useMemo)(()=>{var e;return null===F?T.todayEntries:(e=T.todayEntries,e.filter(e=>F.has(e.sheetName)))},[F,T.todayEntries]),B=(0,s.useMemo)(()=>null===F?T.startDaySuggestions:T.startDaySuggestions.filter(e=>F.has(e.sheetName)),[F,T.startDaySuggestions]),Y=(0,s.useMemo)(()=>q.reduce((e,t)=>e+t.todayDurationMs,0),[q]),W=async e=>{D(!0),L(null);try{await e(),i.refresh()}catch(e){L((0,g.message_from_unknown_error)(e,"Action failed"))}finally{D(!1)}},G=6e4*Number.parseInt(N,10),z=6e4*Number.parseInt(k,10),J=x(T.focusStatus.todayTrackedMs,G),H=x(T.focusStatus.weekTrackedMs,z);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.TrackerTopbar,{breadcrumb:{current:"Today"}}),(0,t.jsxs)("main",{className:"mx-auto flex w-full max-w-2xl flex-col items-center gap-6 px-5 pb-12 pt-6",children:[(0,t.jsxs)("header",{className:"flex w-full flex-col gap-2 text-center",children:[(0,t.jsx)("h1",{className:"m-0 text-[1.5rem] font-[650] tracking-tight",children:"Today"}),(0,t.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:"Running timers and time logged today."})]}),null===R?null:(0,t.jsx)("p",{className:"m-0 w-full rounded-md border border-danger-border bg-danger-soft px-3 py-2 text-[0.85rem] text-danger",children:R}),(0,t.jsx)(c,{sheet_names:T.sheetNames,on_toggle_pin:w.toggle_pinned_sheet_name}),(0,t.jsxs)("section",{className:"w-full rounded-md border border-panel-border bg-panel p-4 shadow-sm","aria-label":"Focus goals progress",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Focus goals"}),(0,t.jsx)(r.default,{href:"/settings/goals",className:"text-[0.78rem] font-semibold text-accent no-underline hover:underline",children:"Edit goals"})]}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-1 gap-2 min-[620px]:grid-cols-2",children:[(0,t.jsx)(O,{label:"Daily",tracked_ms:T.focusStatus.todayTrackedMs,target_ms:G,progress_percent:J,duration_format:f}),(0,t.jsx)(O,{label:"Weekly",tracked_ms:T.focusStatus.weekTrackedMs,target_ms:z,progress_percent:H,duration_format:f})]})]}),(0,t.jsxs)("section",{className:"w-full rounded-md border border-panel-border bg-panel p-4 shadow-sm","aria-label":"Today total",children:[(0,t.jsxs)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:["Tracked today","pinned"===U?" (pinned)":""]}),(0,t.jsx)("p",{className:"m-0 mt-1 font-mono text-[1.75rem] font-semibold text-accent",children:(0,h.format_duration)(Y,f)})]}),(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3","aria-label":"Running timers",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Running now"}),(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:0===(a=K.length)?"No active timers":1===a?"1 timer":`${a} timers`})]}),0===K.length?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"No running timers for the selected scope."}):(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:K.map(e=>(0,t.jsx)(C,{entry:e,is_pending:I,duration_format:f,time_format:b,on_check_out:t=>W(async()=>{await (0,y.post_tracker_action)("/api/out",(0,d.build_check_out_request_payload)(e.sheetName,t)),(0,_.finish_running_pomodoro_timer)()})},`${e.sheetName}-${e.id}`))})]}),(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3","aria-label":"Start day suggestions",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Start day"}),(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Suggested first task from yesterday"})]}),0===B.length?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"No yesterday history yet for the selected scope."}):(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:B.map(e=>(0,t.jsx)(A,{suggestion:e,is_pending:I,is_pinned:$.includes(e.sheetName),time_format:b,on_toggle_pin:w.toggle_pinned_sheet_name,on_start:()=>W(()=>(0,y.post_tracker_action)("/api/in",{sheetName:e.sheetName,description:(0,m.build_resume_description)(e.suggestedDescription,e.suggestedTags)}))},`${e.sheetName}-${e.lastLoggedAt}`))})]}),(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3","aria-label":"Today's entries",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Today's entries"}),(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:(0,p.format_entry_count_label)(q.length)??"None"})]}),0===q.length?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"pinned"===U&&0===$.length?"Pin at least one sheet to see today’s activity.":"No time logged today for the selected scope."}):(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:q.map(e=>(0,t.jsx)(M,{entry:e,duration_format:f,time_format:b,show_sheet_name:"all"===U||$.length>1},`${e.sheetName}-${e.id}`))})]})]})]})}],81823)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return i}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066)._(e.r(78677)),o=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",l=e.hash||"",i=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),i&&"object"==typeof i&&(i=String(a.urlQueryToSearchParams(i)));let u=e.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),s=s.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${s}${u}${l}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(29158);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=a(e,n)),t&&(s.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(31047),s=e.r(63334);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return x},useLinkStatus:function(){return b}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066),o=e.r(54710),l=a._(e.r(29158)),i=e.r(42552),c=e.r(61717),u=e.r(37879),d=e.r(31047),m=e.r(20321);e.r(90503);let p=e.r(38520),f=e.r(19947),h=e.r(59246),_=e.r(99046);function x(t){var r,n;let s,a,x,[b,y]=(0,l.useOptimistic)(f.IDLE_LINK_STATUS),v=(0,l.useRef)(null),{href:j,as:w,children:N,prefetch:k=null,passHref:S,replace:E,shallow:T,scroll:O,onClick:C,onMouseEnter:A,onTouchStart:M,legacyBehavior:P=!1,onNavigate:R,transitionTypes:L,ref:I,unstable_dynamicOnHover:D,...U}=t;s=N,P&&("string"==typeof s||"number"==typeof s)&&(s=(0,o.jsx)("a",{children:s}));let $=l.default.useContext(c.AppRouterContext),F=!1!==k,K=!1!==k?null===(n=k)||"auto"===n?_.FetchStrategy.PPR:_.FetchStrategy.Full:_.FetchStrategy.PPR,q="string"==typeof(r=w||j)?r:(0,i.formatUrl)(r);if(P){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=l.default.Children.only(s)}let B=P?a&&"object"==typeof a&&a.ref:I,Y=l.default.useCallback(e=>(null!==$&&(v.current=(0,f.mountLinkInstance)(e,q,$,K,F,y)),()=>{v.current&&((0,f.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,f.unmountPrefetchableInstance)(e)}),[F,q,$,K,y]),W={ref:(0,u.useMergedRef)(Y,B),onClick(t){P||"function"!=typeof C||C(t),P&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!$||t.defaultPrevented||function(t,r,n,s,a,o,i){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);l.default.startTransition(()=>{d(r,s?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,i)})}}(t,q,v,E,O,R,L)},onMouseEnter(e){P||"function"!=typeof A||A(e),P&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),$&&F&&(0,f.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){P||"function"!=typeof M||M(e),P&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),$&&F&&(0,f.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,d.isAbsoluteUrl)(q)?W.href=q:P&&!S&&("a"!==a.type||"href"in a.props)||(W.href=(0,m.addBasePath)(q)),x=P?l.default.cloneElement(a,W):(0,o.jsx)("a",{...U,...W,children:s}),(0,o.jsx)(g.Provider,{value:b,children:x})}e.r(10364);let g=(0,l.createContext)(f.IDLE_LINK_STATUS),b=()=>(0,l.useContext)(g);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),s=e.i(32417),a=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[o,l]=(0,r.useState)(null),[i,c]=(0,r.useState)(!1),u=(0,s.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!u)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{l(e?.user.email??null)}).catch(()=>{l(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{l(t?.user.email??null)});return()=>{t.unsubscribe()}},[u]),{is_configured:u,email:o,is_pending:i,sign_out:(0,r.useCallback)(async()=>{c(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,a.notify_settings_saved)("Signed out"),e.refresh()}finally{c(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/",label:"Tracker",match:e=>"/"===e}];function a(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":s?"page":void 0,children:n.label},n.href)})})}],45200);var o=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,o.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(a,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","search","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let s=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(s))}catch{return r}}],73205);var n=e.i(34869),s=e.i(92629);let a=(0,n.create_ui_preference_store)({storage_key:s.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:s.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function o(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,a],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return o()}],76003);var l=e.i(17798),i=e.i(46549),c=e.i(10464),u=e.i(35434),d=e.i(61834),m=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===o()?"light":"dark";(0,l.apply_theme)(e),(0,m.write_stored_theme)(e),c.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),c.theme_mode_preference.notify(),(0,u.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let s=(0,t.useRef)(e);s.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),s.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),a=e.i(37399),o=e.i(90463),l=e.i(46549),i=e.i(73205),c=e.i(66295),u=e.i(2268),d=e.i(32792),m=e.i(90299),p=e.i(28274),f=e.i(76003),h=e.i(35434),_=e.i(38240),x=e.i(22373),g=e.i(25204),b=e.i(77882);let y="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},j=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),w=(0,n.usePathname)()??"/",N=(0,s.useSyncExternalStore)(h.subscribe_theme,f.get_theme_snapshot,f.get_theme_server_snapshot),k=(0,s.useSyncExternalStore)(u.cloud_sync_enabled_preference.subscribe,u.cloud_sync_enabled_preference.get_snapshot,u.cloud_sync_enabled_preference.get_server_snapshot),S=(0,s.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),E=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),T=(0,c.parse_tracker_shortcut_map)(S),O=new Set((0,i.parse_topbar_quick_actions)(E)),C=x.topbar_quick_action_ids.filter(e=>!O.has(e)),A=Array.from(new Set([...Array.from(j),...C])),{email:M,is_configured:P,is_pending:R,sign_out:L}=(0,b.use_supabase_auth_session)(),[I,D]=(0,s.useState)(!1),U=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!I)return;let e=e=>{null===U.current||U.current.contains(e.target)||D(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[I]);let $=()=>{D(!1)};return(0,g.use_escape_to_cancel)($,I),(0,t.jsxs)("div",{className:"relative shrink-0",ref:U,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":I,"aria-haspopup":"menu",onClick:()=>D(e=>!e),children:(0,t.jsx)(a.HamburgerIcon,{})}),I?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[P&&null!==M?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:M,children:M})}):null,A.map(e=>{let n=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:y,role:"menuitem",onClick:$,children:n.label})},e)}),P?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitemcheckbox","aria-checked":"true"===k,onClick:()=>{let e="true"===k?"false":"true";u.cloud_sync_enabled_preference.write(e),u.cloud_sync_enabled_preference.notify(),(0,l.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==M&&(0,p.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===k?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===k?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{$(),(0,_.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===N?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===N?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{let e;$(),e=T.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===M?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{$(),e.push((0,o.build_auth_page_href)("sign_in",w))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${y} text-danger`,role:"menuitem",disabled:R,onClick:()=>{$(),L()},children:R?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let w=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",a=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),o=(0,s.useMemo)(()=>(0,i.parse_topbar_quick_actions)(a),[a]);if(0===o.length)return null;let l=w.filter(e=>o.includes(e.id));return 0===l.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:l.map(n=>{let s=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":s?"page":void 0,children:n.label},n.id)})})}],76080)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),s=e.i(1976),a=e.i(76080),o=e.i(45958),l=e.i(71060),i=e.i(29539);function c(){let e=((0,l.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(o.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(i.SettingsIcon,{})})}function u({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(o.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(o.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(u,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(a.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(c,{}),(0,t.jsx)(s.TopbarOverflowMenu,{})]})]})]})})}],75404)},6690,93749,e=>{"use strict";let t="super-time-tracker-pinned-sheet-names",r=new Set,n=[],s=null;function a(){try{let e=window.localStorage.getItem(t);if(null===e)return[];let r=JSON.parse(e);if(!Array.isArray(r))return[];return r.filter(e=>"string"==typeof e)}catch{return[]}}function o(e){try{window.localStorage.setItem(t,JSON.stringify(e))}catch{}s=null,r.forEach(e=>{e()})}e.s(["get_pinned_sheet_names_server_snapshot",0,function(){return n},"get_pinned_sheet_names_snapshot",0,function(){var e=a();if(0===e.length)return n;let t=e.join("\0");if(null!==s&&s.key===t)return s.snapshot;let r=Object.freeze([...e]);return s={key:t,snapshot:r},r},"read_pinned_sheet_names",0,a,"subscribe_pinned_sheet_names",0,function(e){return r.add(e),()=>{r.delete(e)}},"write_pinned_sheet_names",0,o],6690),e.s(["toggle_pinned_sheet_name",0,function(e){let t=e.trim();if(0===t.length)return;let r=a(),n=r.indexOf(t);n>=0?o([...r.slice(0,n),...r.slice(n+1)]):o([...r,t])}],93749)},19946,e=>{"use strict";var t=e.i(29158),r=e.i(72270),n=e.i(4572);e.s(["use_confirm_dialog",0,function(){let e=(0,t.useContext)(r.ConfirmDialogContext);if(null!==e)return e;let s=(0,n.get_registered_confirm_dialog)();if(null!==s)return{confirm:s};throw Error("use_confirm_dialog must be used within ConfirmDialogProvider")}])},75899,e=>{"use strict";var t=e.i(39552);e.s(["format_time",0,function(e,r="12h"){return(0,t.format)(new Date(e),"24h"===r?"HH:mm":"h:mm a")}])},60529,e=>{"use strict";e.s(["format_entry_count_label",0,function(e){return 0===e?null:1===e?"1 entry":`${e} entries`}])},35923,e=>{"use strict";var t=e.i(29158),r=e.i(97891);e.s(["use_time_format",0,function(){return(0,t.useSyncExternalStore)(r.time_format_preference.subscribe,r.time_format_preference.get_snapshot,r.time_format_preference.get_server_snapshot)}])},83821,60145,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.DAILY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.DAILY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=30&&t<=720}});e.s(["daily_focus_target_minutes_preference",0,n],83821);let s=(0,t.create_ui_preference_store)({storage_key:r.WEEKLY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.WEEKLY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=60&&t<=4200}});e.s(["weekly_focus_target_minutes_preference",0,s],60145)},15526,e=>{"use strict";let t="super-time-tracker-pomodoro-active-entry";e.s(["clear_pomodoro_task_entry_marker",0,function(){try{window.localStorage.removeItem(t)}catch{}},"is_pomodoro_task_entry",0,function(e){let r=(()=>{try{let e=window.localStorage.getItem(t);if(null===e)return null;try{let t=JSON.parse(e);if("string"==typeof t.sheetName&&t.sheetName.length>0&&"number"==typeof t.entryId&&Number.isInteger(t.entryId))return{sheetName:t.sheetName,entryId:t.entryId}}catch{}return null}catch{return null}})();return null!==r&&r.sheetName===e.sheetName&&r.entryId===e.id},"mark_pomodoro_task_entry",0,function(e){try{let r={sheetName:e.sheetName,entryId:e.id};window.localStorage.setItem(t,JSON.stringify(r))}catch{}}])},36178,68713,e=>{"use strict";e.s(["build_check_out_request_payload",0,function(e,t){let r={sheetName:e},n=t?.at?.trim(),s=t?.note?.trim();return void 0!==n&&n.length>0&&(r.at=n),void 0!==s&&s.length>0&&(r.note=s),r}],36178);var t=e.i(26740),r=e.i(15526);e.s(["finish_running_pomodoro_timer",0,function(){try{let e=window.localStorage.getItem(t.POMODORO_STORAGE_KEY);if(null===e)return;let n=JSON.parse(e),s=n.state;if(s?.status!=="running")return;let a={settings:n.settings??t.POMODORO_DEFAULT_SETTINGS,state:t.POMODORO_DEFAULT_STATE};window.localStorage.setItem(t.POMODORO_STORAGE_KEY,JSON.stringify(a)),(0,r.clear_pomodoro_task_entry_marker)()}catch{}}],68713)},50459,e=>{"use strict";e.s(["prompt_check_out_at",0,function(){let e=window.prompt("Check out at what time?","30 minutes ago");if(null===e)return null;let t=e.trim();return 0===t.length?null:t}])},53754,7554,76379,e=>{"use strict";var t=e.i(29158),r=e.i(19946);function n(e){let t=e?.at?.trim()??"",r=e?.note?.trim()??"",n=t.length>0,s=r.length>0,a="Stop the active timer and save this entry?";return n&&s?a=`Stop the timer at "${t}" and save a checkout note?`:n?a=`Stop the timer and check out at "${t}"?`:s&&(a="Stop the timer and save this entry with your checkout note?"),{title:"Check out?",message:a,confirmLabel:"Check out",variant:"danger"}}e.s(["get_check_out_confirm_dialog",0,n],7554);var s=e.i(97026);function a(){return"true"===(0,t.useSyncExternalStore)(s.confirm_before_checkout_preference.subscribe,s.confirm_before_checkout_preference.get_snapshot,s.confirm_before_checkout_preference.get_server_snapshot)}e.s(["use_confirm_before_checkout",0,a],76379),e.s(["useCheckOutAction",0,function(e){let{confirm:s}=(0,r.use_confirm_dialog)(),o=a();return(0,t.useCallback)(async t=>(!o||!!await s(n(t)))&&(e(t),!0),[s,o,e])}],53754)},81823,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),a=e.i(75899),o=e.i(56716),l=e.i(6690);let i=[{value:"all",label:"All sheets"},{value:"pinned",label:"Pinned"}];function c({sheet_names:e,on_toggle_pin:r}){let n=(0,s.useSyncExternalStore)(o.today_scope_preference.subscribe,o.today_scope_preference.get_snapshot,o.today_scope_preference.get_server_snapshot),a=(0,s.useSyncExternalStore)(l.subscribe_pinned_sheet_names,l.get_pinned_sheet_names_snapshot,l.get_pinned_sheet_names_server_snapshot),u=new Set(a);return(0,t.jsxs)("div",{className:"flex w-full max-w-2xl flex-col gap-3",children:[(0,t.jsx)("div",{role:"group","aria-label":"Today scope",className:"flex flex-wrap gap-2",children:i.map(e=>{let r=n===e.value;return(0,t.jsx)("button",{type:"button",className:`cursor-pointer rounded-full border px-3 py-1.5 text-[0.85rem] font-semibold transition-colors duration-150 ${r?"border-accent bg-accent-soft text-foreground":"border-panel-border bg-panel text-muted hover:border-accent hover:text-foreground"}`,"aria-pressed":r,onClick:()=>{var t;return t=e.value,void(o.today_scope_preference.read()!==t&&(o.today_scope_preference.write(t),o.today_scope_preference.notify()))},children:e.label},e.value)})}),"pinned"===n?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[0===a.length?(0,t.jsx)("p",{className:"m-0 text-[0.85rem] text-muted",children:"Pin sheets from the Sheets page or below to filter today's view."}):null,(0,t.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-2 p-0","aria-label":"Pinned sheets",children:e.map(e=>{let n=u.has(e);return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",className:`cursor-pointer rounded-full border px-2.5 py-1 text-[0.8rem] font-medium transition-colors duration-150 ${n?"border-accent bg-accent-soft text-foreground":"border-panel-border bg-surface-raised text-muted hover:text-foreground"}`,"aria-pressed":n,onClick:()=>r(e),children:[n?"★ ":"☆ ",e]})},e)})})]}):null]})}var u=e.i(75404),d=e.i(36178),m=e.i(44356),p=e.i(60529),f=e.i(18774),h=e.i(32584),_=e.i(68713);function x(e,t){return t<=0?0:Math.min(100,Math.round(e/t*100))}var g=e.i(37193),b=e.i(67321),y=e.i(51229),v=e.i(83821),j=e.i(60145),w=e.i(50459),N=e.i(93749),k=e.i(53754),S=e.i(1800),E=e.i(35923);let T="rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text";function O({label:e,tracked_ms:r,target_ms:n,progress_percent:s,duration_format:a}){return(0,t.jsxs)("article",{className:"rounded-md border border-panel-border bg-background px-3 py-2.5",children:[(0,t.jsx)("p",{className:"m-0 text-[0.75rem] font-semibold uppercase tracking-[0.04em] text-muted",children:e}),(0,t.jsxs)("p",{className:"m-0 mt-1 font-mono text-[0.95rem] font-semibold text-accent",children:[(0,h.format_duration)(r,a)," /"," ",(0,h.format_duration)(n,a)]}),(0,t.jsx)("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded-full bg-accent-soft",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-300",style:{width:`${s}%`}})})]})}function C({entry:e,is_pending:n,duration_format:o,time_format:l,on_check_out:i}){let[c,u]=(0,s.useState)(()=>Date.now()-new Date(e.start)),d=(0,k.useCheckOutAction)(e=>{i(e)});(0,s.useEffect)(()=>{u(Date.now()-new Date(e.start));let t=globalThis.setInterval(()=>{u(Date.now()-new Date(e.start))},1e3);return()=>{globalThis.clearInterval(t)}},[e.start]);let m=(0,a.format_time)(e.start,l);return(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-3 shadow-sm",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:e.sheetName}),(0,t.jsx)("p",{className:"m-0 mt-1 truncate text-[0.95rem] font-medium",children:e.description||"Untitled entry"}),(0,t.jsxs)("p",{className:"m-0 mt-1 text-[0.8rem] text-muted",children:["Since ",m]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-[0.92rem] font-semibold text-accent",children:(0,h.format_duration)(c,o)}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-danger-border bg-danger-soft px-2 py-1 text-[0.74rem] font-semibold text-danger disabled:cursor-not-allowed disabled:opacity-55",disabled:n,onClick:()=>{d()},children:"Check out"}),(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-danger-border bg-danger-soft px-2 py-1 text-[0.74rem] font-semibold text-danger disabled:cursor-not-allowed disabled:opacity-55",disabled:n,onClick:()=>{let e=(0,w.prompt_check_out_at)();null!==e&&d({at:e})},title:"Check out at specific time",children:"@"}),(0,t.jsx)(r.default,{href:"/",className:"text-[0.75rem] font-semibold text-accent no-underline hover:underline",onClick:()=>(0,b.navigate_to_tracker_sheet)(e.sheetName),children:"Open"})]})]})]})})}function A({suggestion:e,is_pending:r,is_pinned:n,time_format:s,on_toggle_pin:o,on_start:l}){return(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-3 shadow-sm",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:e.sheetName}),(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-panel-border bg-background px-1.5 py-0.5 text-[0.68rem] font-semibold text-muted hover:bg-surface-hover hover:text-foreground",onClick:()=>o(e.sheetName),title:n?"Unpin sheet":"Pin sheet",children:n?"Pinned":"Pin"})]}),(0,t.jsx)("p",{className:"m-0 mt-1 truncate text-[0.95rem] font-medium",children:e.suggestedDescription||"Untitled entry"}),(0,t.jsxs)("p",{className:"m-0 mt-1 text-[0.8rem] text-muted",children:["Yesterday at ",(0,a.format_time)(e.lastLoggedAt,s)]}),e.suggestedTags.length>0?(0,t.jsx)("ul",{className:"m-0 mt-2 flex list-none flex-wrap gap-1.5 p-0",children:e.suggestedTags.map(e=>(0,t.jsx)("li",{className:T,children:(0,f.format_display_tag)(e)},e))}):null]}),(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-accent-border bg-accent px-2.5 py-1.5 text-[0.76rem] font-semibold text-accent-text-on disabled:cursor-not-allowed disabled:opacity-55",disabled:r,onClick:()=>{l()},children:"Start task"})]})})}function M({entry:e,duration_format:n,time_format:s,show_sheet_name:o}){let l=(0,a.format_time)(e.start,s),i=null===e.end?"now":(0,a.format_time)(e.end,s);return(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-3 shadow-sm",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[o?(0,t.jsx)("p",{className:"m-0 mb-1 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:e.sheetName}):null,(0,t.jsx)("p",{className:"m-0 text-[0.95rem] font-medium",children:e.description}),(0,t.jsxs)("p",{className:"m-0 mt-1 text-[0.8rem] text-muted",children:[l," → ",i]}),e.tags.length>0?(0,t.jsx)("ul",{className:"m-0 mt-2 flex list-none flex-wrap gap-1.5 p-0",children:e.tags.map(e=>(0,t.jsx)("li",{className:T,children:(0,f.format_display_tag)(e)},e))}):null]}),(0,t.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[(0,t.jsx)("span",{className:"font-mono text-[0.9rem] font-semibold text-accent",children:(0,h.format_duration)(e.todayDurationMs,n)}),(0,t.jsx)(r.default,{href:"/",className:"text-[0.8rem] font-semibold text-accent no-underline hover:underline",onClick:()=>(0,b.navigate_to_tracker_sheet)(e.sheetName),children:"Open sheet"})]})]})})}e.s(["TodayFocusView",0,function({initial_data:e}){var a;let i=(0,n.useRouter)(),f=(0,S.use_duration_format)(),b=(0,E.use_time_format)(),w=(0,s.useSyncExternalStore)(v.daily_focus_target_minutes_preference.subscribe,v.daily_focus_target_minutes_preference.get_snapshot,v.daily_focus_target_minutes_preference.get_server_snapshot),k=(0,s.useSyncExternalStore)(j.weekly_focus_target_minutes_preference.subscribe,j.weekly_focus_target_minutes_preference.get_snapshot,j.weekly_focus_target_minutes_preference.get_server_snapshot),[T,P]=(0,s.useState)(e),[R,L]=(0,s.useState)(null),[I,D]=(0,s.useState)(!1);(0,s.useEffect)(()=>{P(e)},[e]);let U=(0,s.useSyncExternalStore)(o.today_scope_preference.subscribe,o.today_scope_preference.get_snapshot,o.today_scope_preference.get_server_snapshot),$=(0,s.useSyncExternalStore)(l.subscribe_pinned_sheet_names,l.get_pinned_sheet_names_snapshot,l.get_pinned_sheet_names_server_snapshot),F=(0,s.useMemo)(()=>"all"===U?null:new Set($),[U,$]),K=(0,s.useMemo)(()=>null===F?T.runningEntries:T.runningEntries.filter(e=>F.has(e.sheetName)),[F,T.runningEntries]),q=(0,s.useMemo)(()=>{var e;return null===F?T.todayEntries:(e=T.todayEntries,e.filter(e=>F.has(e.sheetName)))},[F,T.todayEntries]),B=(0,s.useMemo)(()=>null===F?T.startDaySuggestions:T.startDaySuggestions.filter(e=>F.has(e.sheetName)),[F,T.startDaySuggestions]),Y=(0,s.useMemo)(()=>q.reduce((e,t)=>e+t.todayDurationMs,0),[q]),W=async e=>{D(!0),L(null);try{await e(),i.refresh()}catch(e){L((0,g.message_from_unknown_error)(e,"Action failed"))}finally{D(!1)}},G=6e4*Number.parseInt(w,10),z=6e4*Number.parseInt(k,10),J=x(T.focusStatus.todayTrackedMs,G),H=x(T.focusStatus.weekTrackedMs,z);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.TrackerTopbar,{breadcrumb:{current:"Today"}}),(0,t.jsxs)("main",{className:"mx-auto flex w-full max-w-2xl flex-col items-center gap-6 px-5 pb-12 pt-6",children:[(0,t.jsxs)("header",{className:"flex w-full flex-col gap-2 text-center",children:[(0,t.jsx)("h1",{className:"m-0 text-[1.5rem] font-[650] tracking-tight",children:"Today"}),(0,t.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:"Running timers and time logged today."})]}),null===R?null:(0,t.jsx)("p",{className:"m-0 w-full rounded-md border border-danger-border bg-danger-soft px-3 py-2 text-[0.85rem] text-danger",children:R}),(0,t.jsx)(c,{sheet_names:T.sheetNames,on_toggle_pin:N.toggle_pinned_sheet_name}),(0,t.jsxs)("section",{className:"w-full rounded-md border border-panel-border bg-panel p-4 shadow-sm","aria-label":"Focus goals progress",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Focus goals"}),(0,t.jsx)(r.default,{href:"/settings/goals",className:"text-[0.78rem] font-semibold text-accent no-underline hover:underline",children:"Edit goals"})]}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-1 gap-2 min-[620px]:grid-cols-2",children:[(0,t.jsx)(O,{label:"Daily",tracked_ms:T.focusStatus.todayTrackedMs,target_ms:G,progress_percent:J,duration_format:f}),(0,t.jsx)(O,{label:"Weekly",tracked_ms:T.focusStatus.weekTrackedMs,target_ms:z,progress_percent:H,duration_format:f})]})]}),(0,t.jsxs)("section",{className:"w-full rounded-md border border-panel-border bg-panel p-4 shadow-sm","aria-label":"Today total",children:[(0,t.jsxs)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:["Tracked today","pinned"===U?" (pinned)":""]}),(0,t.jsx)("p",{className:"m-0 mt-1 font-mono text-[1.75rem] font-semibold text-accent",children:(0,h.format_duration)(Y,f)})]}),(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3","aria-label":"Running timers",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Running now"}),(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:0===(a=K.length)?"No active timers":1===a?"1 timer":`${a} timers`})]}),0===K.length?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"No running timers for the selected scope."}):(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:K.map(e=>(0,t.jsx)(C,{entry:e,is_pending:I,duration_format:f,time_format:b,on_check_out:t=>W(async()=>{await (0,y.post_tracker_action)("/api/out",(0,d.build_check_out_request_payload)(e.sheetName,t)),(0,_.finish_running_pomodoro_timer)()})},`${e.sheetName}-${e.id}`))})]}),(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3","aria-label":"Start day suggestions",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Start day"}),(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Suggested first task from yesterday"})]}),0===B.length?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"No yesterday history yet for the selected scope."}):(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:B.map(e=>(0,t.jsx)(A,{suggestion:e,is_pending:I,is_pinned:$.includes(e.sheetName),time_format:b,on_toggle_pin:N.toggle_pinned_sheet_name,on_start:()=>W(()=>(0,y.post_tracker_action)("/api/in",{sheetName:e.sheetName,description:(0,m.build_resume_description)(e.suggestedDescription,e.suggestedTags)}))},`${e.sheetName}-${e.lastLoggedAt}`))})]}),(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3","aria-label":"Today's entries",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Today's entries"}),(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:(0,p.format_entry_count_label)(q.length)??"None"})]}),0===q.length?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"pinned"===U&&0===$.length?"Pin at least one sheet to see today’s activity.":"No time logged today for the selected scope."}):(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:q.map(e=>(0,t.jsx)(M,{entry:e,duration_format:f,time_format:b,show_sheet_name:"all"===U||$.length>1},`${e.sheetName}-${e.id}`))})]})]})]})}],81823)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return o},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(44066)._(e.r(78677)),s=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",o=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(i.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),o&&"#"!==o[0]&&(o="#"+o),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${a}${c}${o}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return o(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(29158);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=i(e,n)),t&&(a.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(31047),a=e.r(63334);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return w},useLinkStatus:function(){return x}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(44066),s=e.r(54710),o=i._(e.r(29158)),l=e.r(42552),u=e.r(61717),c=e.r(37879),d=e.r(31047),h=e.r(20321);e.r(90503);let m=e.r(38520),f=e.r(19947),g=e.r(59246),p=e.r(99046);function w(t){var r,n;let a,i,w,[x,y]=(0,o.useOptimistic)(f.IDLE_LINK_STATUS),v=(0,o.useRef)(null),{href:_,as:k,children:D,prefetch:j=null,passHref:N,replace:S,shallow:T,scroll:M,onClick:O,onMouseEnter:P,onTouchStart:E,legacyBehavior:C=!1,onNavigate:Y,transitionTypes:W,ref:L,unstable_dynamicOnHover:q,...F}=t;a=D,C&&("string"==typeof a||"number"==typeof a)&&(a=(0,s.jsx)("a",{children:a}));let I=o.default.useContext(u.AppRouterContext),H=!1!==j,R=!1!==j?null===(n=j)||"auto"===n?p.FetchStrategy.PPR:p.FetchStrategy.Full:p.FetchStrategy.PPR,$="string"==typeof(r=k||_)?r:(0,l.formatUrl)(r);if(C){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=o.default.Children.only(a)}let A=C?i&&"object"==typeof i&&i.ref:L,B=o.default.useCallback(e=>(null!==I&&(v.current=(0,f.mountLinkInstance)(e,$,I,R,H,y)),()=>{v.current&&((0,f.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,f.unmountPrefetchableInstance)(e)}),[H,$,I,R,y]),Q={ref:(0,c.useMergedRef)(B,A),onClick(t){C||"function"!=typeof O||O(t),C&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,a,i,s,l){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);o.default.startTransition(()=>{d(r,a?"replace":"push",!1===i?m.ScrollBehavior.NoScroll:m.ScrollBehavior.Default,n.current,l)})}}(t,$,v,S,M,Y,W)},onMouseEnter(e){C||"function"!=typeof P||P(e),C&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),I&&H&&(0,f.onNavigationIntent)(e.currentTarget,!0===q)},onTouchStart:function(e){C||"function"!=typeof E||E(e),C&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),I&&H&&(0,f.onNavigationIntent)(e.currentTarget,!0===q)}};return(0,d.isAbsoluteUrl)($)?Q.href=$:C&&!N&&("a"!==i.type||"href"in i.props)||(Q.href=(0,h.addBasePath)($)),w=C?o.default.cloneElement(i,Q):(0,s.jsx)("a",{...F,...Q,children:a}),(0,s.jsx)(b.Provider,{value:x,children:w})}e.r(10364);let b=(0,o.createContext)(f.IDLE_LINK_STATUS),x=()=>(0,o.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),a=e.i(32417),i=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[s,o]=(0,r.useState)(null),[l,u]=(0,r.useState)(!1),c=(0,a.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!c)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{o(e?.user.email??null)}).catch(()=>{o(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{o(t?.user.email??null)});return()=>{t.unsubscribe()}},[c]),{is_configured:c,email:s,is_pending:l,sign_out:(0,r.useCallback)(async()=>{u(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,i.notify_settings_saved)("Signed out"),e.refresh()}finally{u(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let a=[{href:"/",label:"Tracker",match:e=>"/"===e}];function i(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:a.map(n=>{let a=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":a?"page":void 0,children:n.label},n.href)})})}],45200);var s=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,s.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(i,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","search","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let a=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(a))}catch{return r}}],73205);var n=e.i(34869),a=e.i(92629);let i=(0,n.create_ui_preference_store)({storage_key:a.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:a.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function s(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,i],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return s()}],76003);var o=e.i(17798),l=e.i(46549),u=e.i(10464),c=e.i(35434),d=e.i(61834),h=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===s()?"light":"dark";(0,o.apply_theme)(e),(0,h.write_stored_theme)(e),u.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),u.theme_mode_preference.notify(),(0,c.notify_theme_subscribers)(),(0,l.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let a=(0,t.useRef)(e);a.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),a.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),a=e.i(29158),i=e.i(37399),s=e.i(90463),o=e.i(46549),l=e.i(73205),u=e.i(66295),c=e.i(2268),d=e.i(32792),h=e.i(90299),m=e.i(28274),f=e.i(76003),g=e.i(35434),p=e.i(38240),w=e.i(22373),b=e.i(25204),x=e.i(77882);let y="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},_=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),k=(0,n.usePathname)()??"/",D=(0,a.useSyncExternalStore)(g.subscribe_theme,f.get_theme_snapshot,f.get_theme_server_snapshot),j=(0,a.useSyncExternalStore)(c.cloud_sync_enabled_preference.subscribe,c.cloud_sync_enabled_preference.get_snapshot,c.cloud_sync_enabled_preference.get_server_snapshot),N=(0,a.useSyncExternalStore)(h.tracker_shortcut_map_preference.subscribe,h.tracker_shortcut_map_preference.get_snapshot,h.tracker_shortcut_map_preference.get_server_snapshot),S=(0,a.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),T=(0,u.parse_tracker_shortcut_map)(N),M=new Set((0,l.parse_topbar_quick_actions)(S)),O=w.topbar_quick_action_ids.filter(e=>!M.has(e)),P=Array.from(new Set([...Array.from(_),...O])),{email:E,is_configured:C,is_pending:Y,sign_out:W}=(0,x.use_supabase_auth_session)(),[L,q]=(0,a.useState)(!1),F=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!L)return;let e=e=>{null===F.current||F.current.contains(e.target)||q(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[L]);let I=()=>{q(!1)};return(0,b.use_escape_to_cancel)(I,L),(0,t.jsxs)("div",{className:"relative shrink-0",ref:F,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":L,"aria-haspopup":"menu",onClick:()=>q(e=>!e),children:(0,t.jsx)(i.HamburgerIcon,{})}),L?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[C&&null!==E?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:E,children:E})}):null,P.map(e=>{let n=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:y,role:"menuitem",onClick:I,children:n.label})},e)}),C?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitemcheckbox","aria-checked":"true"===j,onClick:()=>{let e="true"===j?"false":"true";c.cloud_sync_enabled_preference.write(e),c.cloud_sync_enabled_preference.notify(),(0,o.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==E&&(0,m.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===j?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===j?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{I(),(0,p.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===D?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===D?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{let e;I(),e=T.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),C?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===E?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{I(),e.push((0,s.build_auth_page_href)("sign_in",k))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${y} text-danger`,role:"menuitem",disabled:Y,onClick:()=>{I(),W()},children:Y?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let k=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",i=(0,a.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),s=(0,a.useMemo)(()=>(0,l.parse_topbar_quick_actions)(i),[i]);if(0===s.length)return null;let o=k.filter(e=>s.includes(e.id));return 0===o.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:o.map(n=>{let a=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":a?"page":void 0,children:n.label},n.id)})})}],76080)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),a=e.i(1976),i=e.i(76080),s=e.i(45958),o=e.i(71060),l=e.i(29539);function u(){let e=((0,o.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(s.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(l.SettingsIcon,{})})}function c({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(s.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(s.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(c,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(i.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(u,{}),(0,t.jsx)(a.TopbarOverflowMenu,{})]})]})]})})}],75404)},42800,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let a=[{href:"/settings",label:"General",match:e=>"/settings"===e},{href:"/settings/display",label:"Display & layout",match:e=>e.startsWith("/settings/display")},{href:"/settings/quick-actions",label:"Quick actions",match:e=>e.startsWith("/settings/quick-actions")},{href:"/settings/goals",label:"Goals",match:e=>e.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:e=>e.startsWith("/settings/pomodoro")},{href:"/settings/notifications",label:"Notifications",match:e=>e.startsWith("/settings/notifications")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:e=>e.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:e=>e.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:e=>e.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:e=>e.startsWith("/settings/tags")}];e.s(["SettingsNav",0,function(){let e=(0,n.usePathname)()??"/settings";return(0,t.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,t.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:a.map(n=>{let a=n.match(e);return(0,t.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,t.jsx)(r.default,{href:n.href,"aria-current":a?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:n.label})},n.href)})})})}])},31113,e=>{"use strict";e.s(["normalize_stored_tag",0,function(e){let t=e.trim().replace(/^@+/,"");if(0===t.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(t))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${t}`}])},19946,e=>{"use strict";var t=e.i(29158),r=e.i(72270),n=e.i(4572);e.s(["use_confirm_dialog",0,function(){let e=(0,t.useContext)(r.ConfirmDialogContext);if(null!==e)return e;let a=(0,n.get_registered_confirm_dialog)();if(null!==a)return{confirm:a};throw Error("use_confirm_dialog must be used within ConfirmDialogProvider")}])},25402,8627,e=>{"use strict";let t=Symbol.for("constructDateFrom");e.s(["constructFromSymbol",0,t,"millisecondsInDay",0,864e5,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInSecond",0,1e3,"millisecondsInWeek",0,6048e5,"minutesInDay",0,1440,"minutesInMonth",0,43200,"minutesInYear",0,525600],8627),e.s(["constructFrom",0,function(e,r){return"function"==typeof e?e(r):e&&"object"==typeof e&&t in e?e[t](r):e instanceof Date?new e.constructor(r):new Date(r)}],25402)},29263,e=>{"use strict";var t=e.i(25402);e.s(["toDate",0,function(e,r){return(0,t.constructFrom)(r||e,e)}])},36145,e=>{"use strict";let t={};e.s(["getDefaultOptions",0,function(){return t}])},26313,e=>{"use strict";var t;let r={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function n(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let a={date:n({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:n({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:n({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},i={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function s(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,a=r?.width?String(r.width):t;n=e.formattingValues[a]||e.formattingValues[t]}else{let t=e.defaultWidth,a=r?.width?String(r.width):e.defaultWidth;n=e.values[a]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}let o={ordinalNumber:(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:s({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:s({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:s({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:s({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:s({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function l(e){return(t,r={})=>{let n,a=r.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;let o=s[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}(l,e=>e.test(o)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(l,e=>e.test(o));return n=e.valueCallback?e.valueCallback(u):u,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(o.length)}}}let u={ordinalNumber:(t={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,r={})=>{let n=e.match(t.matchPattern);if(!n)return null;let a=n[0],i=e.match(t.parsePattern);if(!i)return null;let s=t.valueCallback?t.valueCallback(i[0]):i[0];return{value:s=r.valueCallback?r.valueCallback(s):s,rest:e.slice(a.length)}}),era:l({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:l({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:l({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:l({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:l({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};e.s(["defaultLocale",0,{code:"en-US",formatDistance:(e,t,n)=>{let a,i=r[e];if(a="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),n?.addSuffix)if(n.comparison&&n.comparison>0)return"in "+a;else return a+" ago";return a},formatLong:a,formatRelative:(e,t,r,n)=>i[e],localize:o,match:u,options:{weekStartsOn:0,firstWeekContainsDate:1}}],26313)},72424,16913,e=>{"use strict";var t=e.i(29263);e.s(["getTimezoneOffsetInMilliseconds",0,function(e){let r=(0,t.toDate)(e),n=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return n.setUTCFullYear(r.getFullYear()),e-n}],72424);var r=e.i(25402);e.s(["normalizeDates",0,function(e,...t){let n=r.constructFrom.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}],16913)},39552,36519,35292,7312,43360,69978,42874,66852,16245,93415,e=>{"use strict";var t=e.i(26313),r=e.i(36145),n=e.i(72424),a=e.i(16913),i=e.i(8627),s=e.i(29263);function o(e,t){let r=(0,s.toDate)(e,t?.in);return r.setHours(0,0,0,0),r}function l(e,t){let r=(0,s.toDate)(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function u(e,t){let n=(0,r.getDefaultOptions)(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=(0,s.toDate)(e,t?.in),o=i.getDay();return i.setDate(i.getDate()-(7*(o<a)+o-a)),i.setHours(0,0,0,0),i}function c(e,t){return u(e,{...t,weekStartsOn:1})}e.s(["startOfDay",0,o],36519),e.s(["startOfYear",0,l],35292),e.s(["startOfWeek",0,u],7312),e.s(["startOfISOWeek",0,c],43360);var d=e.i(25402);function h(e,t){let r=(0,s.toDate)(e,t?.in),n=r.getFullYear(),a=(0,d.constructFrom)(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);let i=c(a),o=(0,d.constructFrom)(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);let l=c(o);return r.getTime()>=i.getTime()?n+1:r.getTime()>=l.getTime()?n:n-1}function m(e,t){let r,n,a=(0,s.toDate)(e,t?.in);return Math.round((c(a)-(r=h(a,void 0),(n=(0,d.constructFrom)(a,0)).setFullYear(r,0,4),n.setHours(0,0,0,0),c(n)))/i.millisecondsInWeek)+1}function f(e,t){let n=(0,s.toDate)(e,t?.in),a=n.getFullYear(),i=(0,r.getDefaultOptions)(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,l=(0,d.constructFrom)(t?.in||e,0);l.setFullYear(a+1,0,o),l.setHours(0,0,0,0);let c=u(l,t),h=(0,d.constructFrom)(t?.in||e,0);h.setFullYear(a,0,o),h.setHours(0,0,0,0);let m=u(h,t);return+n>=+c?a+1:+n>=+m?a:a-1}function g(e,t){let n,a,o,l,c=(0,s.toDate)(e,t?.in);return Math.round((u(c,t)-(n=(0,r.getDefaultOptions)(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=f(c,t),(l=(0,d.constructFrom)(t?.in||c,0)).setFullYear(o,0,a),l.setHours(0,0,0,0),u(l,t)))/i.millisecondsInWeek)+1}function p(e,t){let r=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+r}e.s(["getISOWeek",0,m],69978),e.s(["getWeekYear",0,f],42874),e.s(["getWeek",0,g],66852);let w={y(e,t){let r=e.getFullYear(),n=r>0?r:1-r;return p("yy"===t?n%100:n,t.length)},M(e,t){let r=e.getMonth();return"M"===t?String(r+1):p(r+1,2)},d:(e,t)=>p(e.getDate(),t.length),a(e,t){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>p(e.getHours()%12||12,t.length),H:(e,t)=>p(e.getHours(),t.length),m:(e,t)=>p(e.getMinutes(),t.length),s:(e,t)=>p(e.getSeconds(),t.length),S(e,t){let r=t.length;return p(Math.trunc(e.getMilliseconds()*Math.pow(10,r-3)),t.length)}},b={G:function(e,t,r){let n=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){let t=e.getFullYear();return r.ordinalNumber(t>0?t:1-t,{unit:"year"})}return w.y(e,t)},Y:function(e,t,r,n){let a=f(e,n),i=a>0?a:1-a;return"YY"===t?p(i%100,2):"Yo"===t?r.ordinalNumber(i,{unit:"year"}):p(i,t.length)},R:function(e,t){return p(h(e),t.length)},u:function(e,t){return p(e.getFullYear(),t.length)},Q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return p(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return p(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){let n=e.getMonth();switch(t){case"M":case"MM":return w.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){let n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return p(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){let a=g(e,n);return"wo"===t?r.ordinalNumber(a,{unit:"week"}):p(a,t.length)},I:function(e,t,r){let n=m(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):p(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):w.d(e,t)},D:function(e,t,r){let u,c=function(e,t){let[r,s]=(0,a.normalizeDates)(void 0,e,t),l=o(r),u=o(s);return Math.round((l-(0,n.getTimezoneOffsetInMilliseconds)(l)-(u-(0,n.getTimezoneOffsetInMilliseconds)(u)))/i.millisecondsInDay)}(u=(0,s.toDate)(e,void 0),l(u))+1;return"Do"===t?r.ordinalNumber(c,{unit:"dayOfYear"}):p(c,t.length)},E:function(e,t,r){let n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){let a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return p(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){let a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return p(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){let n=e.getDay(),a=0===n?7:n;switch(t){case"i":return String(a);case"ii":return p(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){let n,a=e.getHours();switch(n=12===a?"noon":0===a?"midnight":a/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){let n,a=e.getHours();switch(n=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return w.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):w.H(e,t)},K:function(e,t,r){let n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):p(n,t.length)},k:function(e,t,r){let n=e.getHours();return(0===n&&(n=24),"ko"===t)?r.ordinalNumber(n,{unit:"hour"}):p(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):w.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):w.s(e,t)},S:function(e,t){return w.S(e,t)},X:function(e,t,r){let n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return y(n);case"XXXX":case"XX":return v(n);default:return v(n,":")}},x:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"x":return y(n);case"xxxx":case"xx":return v(n);default:return v(n,":")}},O:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+x(n,":");default:return"GMT"+v(n,":")}},z:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+x(n,":");default:return"GMT"+v(n,":")}},t:function(e,t,r){return p(Math.trunc(e/1e3),t.length)},T:function(e,t,r){return p(+e,t.length)}};function x(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),i=n%60;return 0===i?r+String(a):r+String(a)+t+p(i,2)}function y(e,t){return e%60==0?(e>0?"-":"+")+p(Math.abs(e)/60,2):v(e,t)}function v(e,t=""){let r=Math.abs(e);return(e>0?"-":"+")+p(Math.trunc(r/60),2)+t+p(r%60,2)}let _=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},k=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},D={p:k,P:(e,t)=>{let r,n=e.match(/(P+)(p+)?/)||[],a=n[1],i=n[2];if(!i)return _(e,t);switch(a){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",_(a,t)).replace("{{time}}",k(i,t))}};e.s(["longFormatters",0,D],16245);let j=/^D+$/,N=/^Y+$/,S=["D","DD","YY","YYYY"];function T(e){return j.test(e)}function M(e){return N.test(e)}function O(e,t,r){var n,a,i;let s,o=(n=e,a=t,i=r,s="Y"===n[0]?"years":"days of the month",`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${a}\`) for formatting ${s} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(o),S.includes(e))throw RangeError(o)}e.s(["isProtectedDayOfYearToken",0,T,"isProtectedWeekYearToken",0,M,"warnOrThrowProtectedError",0,O],93415);let P=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,E=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,C=/^'([^]*?)'?$/,Y=/''/g,W=/[a-zA-Z]/;e.s(["format",0,function(e,n,a){let i=(0,r.getDefaultOptions)(),o=a?.locale??i.locale??t.defaultLocale,l=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,u=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=(0,s.toDate)(e,a?.in);if(!(c instanceof Date||"object"==typeof c&&"[object Date]"===Object.prototype.toString.call(c))&&"number"!=typeof c||isNaN(+(0,s.toDate)(c)))throw RangeError("Invalid time value");let d=n.match(E).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,D[t])(e,o.formatLong):e}).join("").match(P).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var r;let t;return{isToken:!1,value:(t=(r=e).match(C))?t[1].replace(Y,"'"):r}}if(b[t])return{isToken:!0,value:e};if(t.match(W))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});o.localize.preprocessor&&(d=o.localize.preprocessor(c,d));let h={firstWeekContainsDate:l,weekStartsOn:u,locale:o};return d.map(t=>{if(!t.isToken)return t.value;let r=t.value;return(!a?.useAdditionalWeekYearTokens&&M(r)||!a?.useAdditionalDayOfYearTokens&&T(r))&&O(r,n,String(e)),(0,b[r[0]])(c,r,o.localize,h)}).join("")}],39552)},47540,e=>{"use strict";var t=e.i(31113);e.s(["tags_are_equal",0,function(e,r){try{return(0,t.normalize_stored_tag)(e)===(0,t.normalize_stored_tag)(r)}catch{return!1}}])},46748,22106,67584,61837,98636,19402,78194,23633,12843,e=>{"use strict";var t=e.i(29263);function r(e,r){let n=(0,t.toDate)(e,r?.in),a=n.getMonth();return n.setFullYear(n.getFullYear(),a+1,0),n.setHours(23,59,59,999),n}e.s(["endOfMonth",0,r],22106);var n=e.i(36145);function a(e,r){let a=(0,n.getDefaultOptions)(),i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,s=(0,t.toDate)(e,r?.in),o=s.getDay();return s.setDate(s.getDate()+((o<i?-7:0)+6-(o-i))),s.setHours(23,59,59,999),s}function i(e,r){let n=(0,t.toDate)(e,r?.in),a=n.getFullYear();return n.setFullYear(a+1,0,0),n.setHours(23,59,59,999),n}e.s(["endOfWeek",0,a],67584);var s=e.i(39552),o=e.i(36519);function l(e,r){let n=(0,t.toDate)(e,r?.in);return n.setDate(1),n.setHours(0,0,0,0),n}e.s(["startOfMonth",0,l],61837);var u=e.i(7312),c=e.i(35292),d=e.i(25402);function h(e,r,n){let a=(0,t.toDate)(e,n?.in);return isNaN(r)?(0,d.constructFrom)(n?.in||e,NaN):(r&&a.setDate(a.getDate()+r),a)}function m(e,t,r){return h(e,-t,r)}function f(e,r,n){let a=(0,t.toDate)(e,n?.in);if(isNaN(r))return(0,d.constructFrom)(n?.in||e,NaN);if(!r)return a;let i=a.getDate(),s=(0,d.constructFrom)(n?.in||e,a.getTime());return(s.setMonth(a.getMonth()+r+1,0),i>=s.getDate())?s:(a.setFullYear(s.getFullYear(),s.getMonth(),i),a)}function g(e,t,r){return f(e,-t,r)}function p(e,t=new Date,n=1){let d=e=>(0,s.format)(e,"yyyy-MM-dd");switch(e){case"yesterday":{let e=m(t,1);return{from_date:d((0,o.startOfDay)(e)),to_date:d((0,o.startOfDay)(e))}}case"week":return{from_date:d((0,u.startOfWeek)(t,{weekStartsOn:n})),to_date:d(a(t,{weekStartsOn:n}))};case"month":return{from_date:d(l(t)),to_date:d(r(t))};case"last_month":{let e=g(t,1);return{from_date:d(l(e)),to_date:d(r(e))}}case"year":return{from_date:d((0,c.startOfYear)(t)),to_date:d(i(t))};case"last_year":{let e=f(t,-12,void 0);return{from_date:d((0,c.startOfYear)(e)),to_date:d(i(e))}}default:{let e=(0,o.startOfDay)(t);return{from_date:d(e),to_date:d(e)}}}}e.s(["addDays",0,h],98636),e.s(["subDays",0,m],19402),e.s(["subMonths",0,g],78194),e.s(["get_reporting_date_range_shortcut_inputs",0,p],46748),e.s(["matches_reporting_date_range_shortcut",0,function(e,t,r=new Date,n=1){if(0===e.from_date.length||0===e.to_date.length)return!1;let a=p(t,r,n);return e.from_date===a.from_date&&e.to_date===a.to_date}],23633);var w=e.i(29158),b=e.i(57853);e.s(["use_week_starts_on",0,function(){return(0,w.useSyncExternalStore)(b.week_starts_on_preference.subscribe,b.week_starts_on_preference.get_snapshot,b.week_starts_on_preference.get_server_snapshot)}],12843)},56812,e=>{"use strict";e.s(["week_starts_on_to_index",0,function(e){return+("sunday"!==e)}])},55437,43864,54873,e=>{"use strict";var t=e.i(54710),r=e.i(52663),n=e.i(52405),a=e.i(46748),i=e.i(23633),s=e.i(12843),o=e.i(56812);let l=[{value:"today",label:"Today"},{value:"yesterday",label:"Yesterday"},{value:"week",label:"This week"},{value:"month",label:"This month"},{value:"last_month",label:"Last month"},{value:"year",label:"This year"},{value:"last_year",label:"Last year"}];e.s(["ReportingDateRangePicker",0,function({range:e,is_invalid:u,on_range_change:c,on_clear:d}){let h=(0,s.use_week_starts_on)(),m=(0,o.week_starts_on_to_index)(h),f=e.from_date.length>0||e.to_date.length>0;return(0,t.jsxs)("fieldset",{className:"m-0 flex w-full max-w-2xl flex-col gap-2 rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:[(0,t.jsx)("legend",{className:"mb-2 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Date range"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"Date range shortcuts",children:l.map(n=>{let s=(0,i.matches_reporting_date_range_shortcut)(e,n.value,new Date,m);return(0,t.jsx)("button",{type:"button",className:s?(0,r.get_button_class_name)("primary","small"):(0,r.get_button_class_name)("ghost","small"),"aria-pressed":s,onClick:()=>c((0,a.get_reporting_date_range_shortcut_inputs)(n.value,new Date,m)),children:n.label},n.value)})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-[0.82rem] text-muted",children:["From",(0,t.jsx)("input",{type:"date",className:(0,n.get_input_class_name)("compact"),value:e.from_date,onChange:t=>c({...e,from_date:t.target.value})})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-[0.82rem] text-muted",children:["To",(0,t.jsx)("input",{type:"date",className:(0,n.get_input_class_name)("compact"),value:e.to_date,onChange:t=>c({...e,to_date:t.target.value})})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("button",{type:"button",className:(0,r.get_button_class_name)("ghost","small"),disabled:!f,onClick:d,children:"Clear"}),u?(0,t.jsx)("span",{className:"text-[0.82rem] text-danger",children:"Enter a valid from and to date."}):null]})]})}],55437);var u=e.i(29263);function c(e,t){let r=(0,u.toDate)(e,t?.in);return r.setHours(23,59,59,999),r}e.s(["endOfDay",0,c],43864);var d=e.i(26313),h=e.i(16245),m=e.i(93415),f=e.i(25402),g=e.i(36145);class p{subPriority=0;validate(e,t){return!0}}class w extends p{constructor(e,t,r,n,a){super(),this.value=e,this.validateValue=t,this.setValue=r,this.priority=n,a&&(this.subPriority=a)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,r){return this.setValue(e,t,this.value,r)}}class b extends p{priority=10;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>(0,f.constructFrom)(t,e))}set(e,t){var r,n;let a;if(t.timestampIsSet)return e;return(0,f.constructFrom)(e,((a="function"==typeof(n=r=this.context)&&n.prototype?.constructor===n?new r(0):(0,f.constructFrom)(r,0)).setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),a.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),a))}}class x{run(e,t,r,n){let a=this.parse(e,t,r,n);return a?{setter:new w(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(e,t,r){return!0}}var y=e.i(8627);let v=/^(1[0-2]|0?\d)/,_=/^(3[0-1]|[0-2]?\d)/,k=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,D=/^(5[0-3]|[0-4]?\d)/,j=/^(2[0-3]|[0-1]?\d)/,N=/^(2[0-4]|[0-1]?\d)/,S=/^(1[0-1]|0?\d)/,T=/^(1[0-2]|0?\d)/,M=/^[0-5]?\d/,O=/^[0-5]?\d/,P=/^\d/,E=/^\d{1,2}/,C=/^\d{1,3}/,Y=/^\d{1,4}/,W=/^-?\d+/,L=/^-?\d/,q=/^-?\d{1,2}/,F=/^-?\d{1,3}/,I=/^-?\d{1,4}/,H=/^([+-])(\d{2})(\d{2})?|Z/,R=/^([+-])(\d{2})(\d{2})|Z/,$=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,A=/^([+-])(\d{2}):(\d{2})|Z/,B=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function Q(e,t){return e?{value:t(e.value),rest:e.rest}:e}function z(e,t){let r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function G(e,t){let r=t.match(e);if(!r)return null;if("Z"===r[0])return{value:0,rest:t.slice(1)};let n="+"===r[1]?1:-1,a=r[2]?parseInt(r[2],10):0,i=r[3]?parseInt(r[3],10):0,s=r[5]?parseInt(r[5],10):0;return{value:n*(a*y.millisecondsInHour+i*y.millisecondsInMinute+s*y.millisecondsInSecond),rest:t.slice(r[0].length)}}function X(e,t){switch(e){case 1:return z(P,t);case 2:return z(E,t);case 3:return z(C,t);case 4:return z(Y,t);default:return z(RegExp("^\\d{1,"+e+"}"),t)}}function U(e,t){switch(e){case 1:return z(L,t);case 2:return z(q,t);case 3:return z(F,t);case 4:return z(I,t);default:return z(RegExp("^-?\\d{1,"+e+"}"),t)}}function K(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function J(e,t){let r,n=t>0,a=n?t:1-t;if(a<=50)r=e||100;else{let t=a+50;r=e+100*Math.trunc(t/100)-100*(e>=t%100)}return n?r:1-r}function V(e){return e%400==0||e%4==0&&e%100!=0}var Z=e.i(42874),ee=e.i(7312),et=e.i(43360),er=e.i(66852),en=e.i(69978);let ea=[31,28,31,30,31,30,31,31,30,31,30,31],ei=[31,29,31,30,31,30,31,31,30,31,30,31];var es=e.i(98636);function eo(e,t,r){let n=(0,g.getDefaultOptions)(),a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=(0,u.toDate)(e,r?.in),s=i.getDay(),o=7-a,l=t<0||t>6?t-(s+o)%7:((t%7+7)%7+o)%7-(s+o)%7;return(0,es.addDays)(i,l,r)}var el=e.i(72424);let eu={G:new class extends x{priority=140;parse(e,t,r){switch(t){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}}set(e,t,r){return t.era=r,e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends x{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,r){let n=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return Q(X(4,e),n);case"yo":return Q(r.ordinalNumber(e,{unit:"year"}),n);default:return Q(X(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r){let n=e.getFullYear();if(r.isTwoDigitYear){let t=J(r.year,n);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let a="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}},Y:new class extends x{priority=130;parse(e,t,r){let n=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return Q(X(4,e),n);case"Yo":return Q(r.ordinalNumber(e,{unit:"year"}),n);default:return Q(X(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r,n){let a=(0,Z.getWeekYear)(e,n);if(r.isTwoDigitYear){let t=J(r.year,a);return e.setFullYear(t,0,n.firstWeekContainsDate),e.setHours(0,0,0,0),(0,ee.startOfWeek)(e,n)}let i="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(i,0,n.firstWeekContainsDate),e.setHours(0,0,0,0),(0,ee.startOfWeek)(e,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends x{priority=130;parse(e,t){return"R"===t?U(4,e):U(t.length,e)}set(e,t,r){let n=(0,f.constructFrom)(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),(0,et.startOfISOWeek)(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends x{priority=130;parse(e,t){return"u"===t?U(4,e):U(t.length,e)}set(e,t,r){return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends x{priority=120;parse(e,t,r){switch(t){case"Q":case"QQ":return X(t.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth((r-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends x{priority=120;parse(e,t,r){switch(t){case"q":case"qq":return X(t.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth((r-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends x{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,r){let n=e=>e-1;switch(t){case"M":return Q(z(v,e),n);case"MM":return Q(X(2,e),n);case"Mo":return Q(r.ordinalNumber(e,{unit:"month"}),n);case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}},L:new class extends x{priority=110;parse(e,t,r){let n=e=>e-1;switch(t){case"L":return Q(z(v,e),n);case"LL":return Q(X(2,e),n);case"Lo":return Q(r.ordinalNumber(e,{unit:"month"}),n);case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends x{priority=100;parse(e,t,r){switch(t){case"w":return z(D,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return X(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r,n){let a,i;return(0,ee.startOfWeek)((a=(0,u.toDate)(e,n?.in),i=(0,er.getWeek)(a,n)-r,a.setDate(a.getDate()-7*i),(0,u.toDate)(a,n?.in)),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends x{priority=100;parse(e,t,r){switch(t){case"I":return z(D,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return X(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r){let n,a;return(0,et.startOfISOWeek)((n=(0,u.toDate)(e,void 0),a=(0,en.getISOWeek)(n,void 0)-r,n.setDate(n.getDate()-7*a),n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends x{priority=90;subPriority=1;parse(e,t,r){switch(t){case"d":return z(_,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return X(t.length,e)}}validate(e,t){let r=V(e.getFullYear()),n=e.getMonth();return r?t>=1&&t<=ei[n]:t>=1&&t<=ea[n]}set(e,t,r){return e.setDate(r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends x{priority=90;subpriority=1;parse(e,t,r){switch(t){case"D":case"DD":return z(k,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return X(t.length,e)}}validate(e,t){return V(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,r){return e.setMonth(0,r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends x{priority=90;parse(e,t,r){switch(t){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=eo(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends x{priority=90;parse(e,t,r,n){let a=e=>{let t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return Q(X(t.length,e),a);case"eo":return Q(r.ordinalNumber(e,{unit:"day"}),a);case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=eo(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends x{priority=90;parse(e,t,r,n){let a=e=>{let t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return Q(X(t.length,e),a);case"co":return Q(r.ordinalNumber(e,{unit:"day"}),a);case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=eo(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends x{priority=90;parse(e,t,r){let n=e=>0===e?7:e;switch(t){case"i":case"ii":return X(t.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return Q(r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiii":return Q(r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiiii":return Q(r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);default:return Q(r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n)}}validate(e,t){return t>=1&&t<=7}set(e,t,r){var n,a;let i,s,o;return n=e,i=(0,u.toDate)(n,void 0),a=void 0,o=0===(s=(0,u.toDate)(i,a?.in).getDay())?7:s,(e=(0,es.addDays)(i,r-o,void 0)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends x{priority=80;parse(e,t,r){switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(K(r),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends x{priority=80;parse(e,t,r){switch(t){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(K(r),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends x{priority=80;parse(e,t,r){switch(t){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(K(r),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends x{priority=70;parse(e,t,r){switch(t){case"h":return z(T,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return X(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,r){let n=e.getHours()>=12;return n&&r<12?e.setHours(r+12,0,0,0):n||12!==r?e.setHours(r,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends x{priority=70;parse(e,t,r){switch(t){case"H":return z(j,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return X(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,r){return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends x{priority=70;parse(e,t,r){switch(t){case"K":return z(S,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return X(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.getHours()>=12&&r<12?e.setHours(r+12,0,0,0):e.setHours(r,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends x{priority=70;parse(e,t,r){switch(t){case"k":return z(N,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return X(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,r){return e.setHours(r<=24?r%24:r,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends x{priority=60;parse(e,t,r){switch(t){case"m":return z(M,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return X(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setMinutes(r,0,0),e}incompatibleTokens=["t","T"]},s:new class extends x{priority=50;parse(e,t,r){switch(t){case"s":return z(O,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return X(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setSeconds(r,0),e}incompatibleTokens=["t","T"]},S:new class extends x{priority=30;parse(e,t){return Q(X(t.length,e),e=>Math.trunc(e*Math.pow(10,-t.length+3)))}set(e,t,r){return e.setMilliseconds(r),e}incompatibleTokens=["t","T"]},X:new class extends x{priority=10;parse(e,t){switch(t){case"X":return G(H,e);case"XX":return G(R,e);case"XXXX":return G($,e);case"XXXXX":return G(B,e);default:return G(A,e)}}set(e,t,r){return t.timestampIsSet?e:(0,f.constructFrom)(e,e.getTime()-(0,el.getTimezoneOffsetInMilliseconds)(e)-r)}incompatibleTokens=["t","T","x"]},x:new class extends x{priority=10;parse(e,t){switch(t){case"x":return G(H,e);case"xx":return G(R,e);case"xxxx":return G($,e);case"xxxxx":return G(B,e);default:return G(A,e)}}set(e,t,r){return t.timestampIsSet?e:(0,f.constructFrom)(e,e.getTime()-(0,el.getTimezoneOffsetInMilliseconds)(e)-r)}incompatibleTokens=["t","T","X"]},t:new class extends x{priority=40;parse(e){return z(W,e)}set(e,t,r){return[(0,f.constructFrom)(e,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends x{priority=20;parse(e){return z(W,e)}set(e,t,r){return[(0,f.constructFrom)(e,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},ec=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ed=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eh=/^'([^]*?)'?$/,em=/''/g,ef=/\S/,eg=/[a-zA-Z]/;function ep(e,t,r,n){let a=()=>(0,f.constructFrom)(n?.in||r,NaN),i=Object.assign({},(0,g.getDefaultOptions)()),s=n?.locale??i.locale??d.defaultLocale,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0;if(!t)return e?a():(0,u.toDate)(r,n?.in);let c={firstWeekContainsDate:o,weekStartsOn:l,locale:s},p=[new b(n?.in,r)],w=t.match(ed).map(e=>{let t=e[0];return t in h.longFormatters?(0,h.longFormatters[t])(e,s.formatLong):e}).join("").match(ec),x=[];for(let r of w){!n?.useAdditionalWeekYearTokens&&(0,m.isProtectedWeekYearToken)(r)&&(0,m.warnOrThrowProtectedError)(r,t,e),!n?.useAdditionalDayOfYearTokens&&(0,m.isProtectedDayOfYearToken)(r)&&(0,m.warnOrThrowProtectedError)(r,t,e);let i=r[0],o=eu[i];if(o){let{incompatibleTokens:t}=o;if(Array.isArray(t)){let e=x.find(e=>t.includes(e.token)||e.token===i);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${r}\` at the same time`)}else if("*"===o.incompatibleTokens&&x.length>0)throw RangeError(`The format string mustn't contain \`${r}\` and any other token at the same time`);x.push({token:i,fullToken:r});let n=o.run(e,r,s.match,c);if(!n)return a();p.push(n.setter),e=n.rest}else{if(i.match(eg))throw RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");if("''"===r?r="'":"'"===i&&(r=r.match(eh)[1].replace(em,"'")),0!==e.indexOf(r))return a();e=e.slice(r.length)}}if(e.length>0&&ef.test(e))return a();let y=p.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,r)=>r.indexOf(e)===t).map(e=>p.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),v=(0,u.toDate)(r,n?.in);if(isNaN(+v))return a();let _={};for(let e of y){if(!e.validate(v,c))return a();let t=e.set(v,_,c);Array.isArray(t)?(v=t[0],Object.assign(_,t[1])):v=t}return v}var ew=e.i(36519);e.s(["get_date_range_ms_from_inputs",0,function(e,t){if(0===e.length||0===t.length)return null;let r=ep(e,"yyyy-MM-dd",new Date),n=ep(t,"yyyy-MM-dd",new Date);return Number.isNaN(+r)||Number.isNaN(+n)||+r>+n?null:{startMs:+(0,ew.startOfDay)(r),endMs:+c(n)}}],54873)},90904,65604,e=>{"use strict";var t=e.i(54710),r=e.i(55437),n=e.i(18774),a=e.i(52663),i=e.i(52405),s=e.i(54873);function o(){return{sheetName:"",tag:"",fromDate:"",toDate:""}}e.s(["get_empty_entry_export_filters",0,o],65604),e.s(["EntryFacetFiltersPanel",0,function({filters:e,sheet_names:l,tag_names:u,is_pending:c=!1,clear_label:d="Clear filters",on_change:h,on_clear:m}){let f={from_date:e.fromDate,to_date:e.toDate},g=e.fromDate.length>0!=e.toDate.length>0||e.fromDate.length>0&&e.toDate.length>0&&null===(0,s.get_date_range_ms_from_inputs)(e.fromDate,e.toDate),p=e.sheetName.length>0||e.tag.length>0||e.fromDate.length>0||e.toDate.length>0;return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,t.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Sheet"}),(0,t.jsxs)("select",{className:(0,i.get_input_class_name)("compact"),value:e.sheetName,disabled:c,onChange:t=>h({...e,sheetName:t.target.value}),children:[(0,t.jsx)("option",{value:"",children:"All sheets"}),l.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]})]}),(0,t.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Tag"}),(0,t.jsxs)("select",{className:(0,i.get_input_class_name)("compact"),value:e.tag,disabled:c,onChange:t=>h({...e,tag:t.target.value}),children:[(0,t.jsx)("option",{value:"",children:"Any tag"}),u.map(e=>(0,t.jsx)("option",{value:e,children:(0,n.format_display_tag)(e)},e))]})]})]}),(0,t.jsx)(r.ReportingDateRangePicker,{range:f,is_invalid:g,on_range_change:t=>h({...e,fromDate:t.from_date,toDate:t.to_date}),on_clear:()=>h({...e,fromDate:"",toDate:""})}),p?(0,t.jsx)("div",{children:(0,t.jsx)("button",{type:"button",className:(0,a.get_button_class_name)("ghost","small"),disabled:c,onClick:()=>{void 0!==m?m():h(o())},children:d})}):null]})}],90904)},6216,e=>{"use strict";var t=e.i(54710),r=e.i(71060),n=e.i(29158),a=e.i(37193),i=e.i(39474),s=e.i(19946),o=e.i(52663);e.s(["BackupRestoreSetting",0,function({db_path:e}){let l=(0,r.useRouter)(),{confirm:u}=(0,s.use_confirm_dialog)(),c=(0,n.useRef)(null),[d,h]=(0,n.useState)(null),[m,f]=(0,n.useState)(null),[g,p]=(0,n.useState)(!1),[w,b]=(0,n.useState)(!1),x=async()=>{p(!0),h(null),f(null);try{let e=await fetch("/api/backup");if(!e.ok){let t=await e.json();throw Error(t.error??"Download failed")}let t=await e.blob(),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download="db.json",n.click(),URL.revokeObjectURL(r),f("Backup downloaded.")}catch(e){h((0,a.message_from_unknown_error)(e,"Backup download failed"))}finally{p(!1)}},y=async e=>{let t=e.target.files?.[0];if((e.target.value="",void 0!==t)&&await u({title:"Restore backup?",message:"This will replace your current time tracker data with the uploaded backup file. This cannot be undone.",confirmLabel:"Restore",variant:"danger"})){b(!0),h(null),f(null);try{let e,r=await t.text();try{e=JSON.parse(r)}catch{throw Error("Invalid backup file: file is not valid JSON.")}let n=await fetch("/api/backup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){let e=await n.json();throw Error(e.error??"Restore failed")}f("Backup restored. Opening tracker…"),(0,i.push_tracker_db_cloud_after_change)(),l.push("/"),l.refresh()}catch(e){h((0,a.message_from_unknown_error)(e,"Restore failed"))}finally{b(!1)}}},v=g||w;return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Backup and restore"}),(0,t.jsx)("p",{className:"m-0 text-[0.8rem] leading-snug text-muted",children:"Download a copy of your database or replace it with a previously saved backup file."})]}),(0,t.jsx)("p",{className:"m-0 overflow-wrap-anywhere font-mono text-[0.65rem] leading-snug text-muted",title:e,children:e}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:(0,o.get_button_class_name)("ghost","small"),disabled:v,onClick:()=>void x(),children:g?"Downloading…":"Download backup"}),(0,t.jsx)("button",{type:"button",className:(0,o.get_button_class_name)("danger","small"),disabled:v,onClick:()=>{c.current?.click()},children:w?"Restoring…":"Restore from file"}),(0,t.jsx)("input",{ref:c,type:"file",accept:"application/json,.json",className:"hidden",onChange:e=>void y(e)})]}),null===m?null:(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-accent",children:m}),null===d?null:(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:d})]})}],6216)},66764,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(90904);function a(e){let t=e.replaceAll('"','""');return`"${t}"`}function i(e){return e.sheetName.trim().length>0||e.tag.trim().length>0||e.fromDate.trim().length>0||e.toDate.trim().length>0}function s(e){return e.replaceAll("|","\\|").replaceAll("\n"," ")}function o(e){let t=e.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"");return t.length>0?t:"scope"}function l(e){return e.sheets.reduce((e,t)=>e+t.entries.length,0)}var u=e.i(54873),c=e.i(47540),d=e.i(52663),h=e.i(65604),m=e.i(37193);e.s(["DbExportSetting",0,function({db:e,sheet_names:f,tag_names:g}){let[p,w]=(0,r.useState)(()=>(0,h.get_empty_entry_export_filters)()),[b,x]=(0,r.useState)(null),[y,v]=(0,r.useState)(null),_=(0,r.useMemo)(()=>l(e),[e]),k=(0,r.useMemo)(()=>(function(e,t,r=Date.now()){var n;let a,i=function(e){let{sheets:t,version:r,activeSheetName:n}=e;return{version:r,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n,tags:a,notes:i})=>({id:e,description:n,tags:a,notes:i.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===r?null:new Date(r)}))}))}}(e),s={query:"",...t},o=t.sheetName.trim(),l=i.sheets.filter(e=>!(o.length>0)||e.name===o).map(e=>({...e,entries:e.entries.filter(t=>(function(e,t,r,n=Date.now()){let a=r.sheetName.trim();if(a.length>0&&t!==a)return!1;let i=r.tag.trim();if(i.length>0&&!e.tags.some(e=>(0,c.tags_are_equal)(e,i)))return!1;let s=(0,u.get_date_range_ms_from_inputs)(r.fromDate.trim(),r.toDate.trim());return null===s||function(e,t,r=Date.now()){let n=e.start.getTime(),a=null===e.end?r:e.end.getTime();return n<=t.endMs&&a>=t.startMs}(e,s,n)})(t,e.name,s,r))})).filter(e=>o.length>0||e.entries.length>0),d=null!==i.activeSheetName&&l.some(e=>e.name===i.activeSheetName)?i.activeSheetName:l[0]?.name??null;return a=(n={version:i.version,activeSheetName:d,sheets:l}).sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()}))}))})),{version:n.version,activeSheetName:n.activeSheetName,sheets:a}})(e,p),[e,p]),D=(0,r.useMemo)(()=>l(k),[k]),j=(0,r.useMemo)(()=>p.fromDate.length>0!=p.toDate.length>0||p.fromDate.length>0&&p.toDate.length>0&&null===(0,u.get_date_range_ms_from_inputs)(p.fromDate,p.toDate),[p.fromDate,p.toDate]),N=e=>{if(v(null),x(null),j)return void v("Choose a valid from and to date, or clear the date filter.");if(0===D)return void v("No entries match the current export filters.");try{let t,r,n,l,u,c=function(e,t,r){if("json"===e)return JSON.stringify(t,null,2);if("csv"===e){let e;return e=t.sheets.flatMap(e=>e.entries.map(t=>{let r=new Date(t.start).toISOString(),n=null===t.end?"":new Date(t.end).toISOString(),i=null===t.end?"":String(Math.max(0,t.end-t.start)/6e4),s=t.notes.map(e=>e.text).join(" | ");return[e.name,String(t.id),t.description,t.tags.join(" "),r,n,i,String(t.notes.length),s].map(a).join(",")})),["sheet_name,entry_id,description,tags,start_iso,end_iso,duration_minutes,note_count,notes",...e].join("\n")}return function(e,t={sheetName:"",tag:"",fromDate:"",toDate:""}){var r;let n,a=[],o=new Date().toISOString(),l=e.sheets.reduce((e,t)=>e+t.entries.length,0);for(let u of(a.push("# super-time-tracker export"),a.push(""),a.push(`- Exported at: ${o}`),a.push(`- Active sheet: ${e.activeSheetName??"none"}`),a.push(`- Sheets: ${e.sheets.length}`),a.push(`- Entries: ${l}`),i(t)&&a.push(`- Scope: ${(r=t,n=[],r.sheetName.trim().length>0&&n.push(`sheet "${r.sheetName.trim()}"`),r.tag.trim().length>0&&n.push(`tag @${r.tag.trim()}`),(r.fromDate.trim().length>0||r.toDate.trim().length>0)&&n.push(`dates ${r.fromDate.trim()||"…"} – ${r.toDate.trim()||"…"}`),n.join(", "))}`),a.push(""),e.sheets)){if(a.push(`## ${u.name}`),a.push(""),a.push(`- Active entry ID: ${u.activeEntryID??"none"}`),a.push(`- Entries: ${u.entries.length}`),a.push(""),0===u.entries.length){a.push("_No entries_"),a.push("");continue}for(let e of(a.push("| ID | Description | Tags | Start | End | Duration | Notes |"),a.push("| --- | --- | --- | --- | --- | --- | --- |"),u.entries)){let t=new Date(e.start).toISOString(),r=null===e.end?"running":new Date(e.end).toISOString(),n=null===e.end?"running":`${Math.max(0,e.end-e.start)/6e4} min`,i=0===e.tags.length?"-":e.tags.map(e=>`@${e}`).join(" "),o=0===e.notes.length?"-":e.notes.map(e=>e.text).join(" / ");a.push(`| ${e.id} | ${s(e.description)} | ${s(i)} | ${t} | ${r} | ${n} | ${s(o)} |`)}a.push("")}return a.join("\n")}(t,r)}(e,k,p),d=(t="json"===e?"json":"csv"===e?"csv":"md",r=function(e){if(!i(e))return"";let t=[];if(e.sheetName.trim().length>0&&t.push(o(e.sheetName)),e.tag.trim().length>0&&t.push(`tag-${o(e.tag)}`),e.fromDate.trim().length>0||e.toDate.trim().length>0){let r=e.fromDate.trim()||"start",n=e.toDate.trim()||"end";t.push(`${r}-to-${n}`)}return t.join("-").slice(0,80)}(p),0===r.length?`super-time-tracker-export.${t}`:`super-time-tracker-export-${r}.${t}`);n=new Blob([c],{type:"json"===e?"application/json":"csv"===e?"text/csv;charset=utf-8":"text/markdown;charset=utf-8"}),l=URL.createObjectURL(n),(u=document.createElement("a")).href=l,u.download=d,u.click(),URL.revokeObjectURL(l),x(`Downloaded ${d}`)}catch(e){v((0,m.message_from_unknown_error)(e,"Export failed"))}},S=i(p)?`${D} of ${_} entries in scope`:`${_} entries ready to export`;return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Database export"}),(0,t.jsxs)("p",{className:"m-0 text-[0.8rem] leading-snug text-muted",children:[e.sheets.length," sheets · ",S]})]}),(0,t.jsx)(n.EntryFacetFiltersPanel,{filters:p,sheet_names:f,tag_names:g,on_change:w}),j?(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:"Choose both from and to dates, or clear the date filter."}):null,(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:(0,d.get_button_class_name)("ghost","small"),disabled:j||0===D,onClick:()=>N("json"),children:"Export JSON"}),(0,t.jsx)("button",{type:"button",className:(0,d.get_button_class_name)("ghost","small"),disabled:j||0===D,onClick:()=>N("csv"),children:"Export CSV"}),(0,t.jsx)("button",{type:"button",className:(0,d.get_button_class_name)("ghost","small"),disabled:j||0===D,onClick:()=>N("markdown"),children:"Export Markdown"})]}),null===b?null:(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-accent",children:b}),null===y?null:(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:y})]})}],66764)}]);
|