super-time-tracker-ui 0.1.24 → 0.1.29
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/app-path-routes-manifest.json +1 -0
- package/dist/standalone/next-output/build-manifest.json +3 -3
- package/dist/standalone/next-output/routes-manifest.json +6 -0
- 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 +2 -2
- 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 +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 +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/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 +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 +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/app-paths-manifest.json +3 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page/build-manifest.json +17 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page/next-font-manifest.json +11 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page/react-loadable-manifest.json +1 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page/server-reference-manifest.json +4 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page.js +16 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +3 -0
- package/dist/standalone/next-output/server/app/settings/page.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 +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/tags/page.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 +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 +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/app-paths-manifest.json +1 -0
- package/dist/standalone/next-output/server/chunks/_0y.amf.._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_09d~8qe.js +4 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0-0rjzr._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__01xqr3d._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__06o_2e_._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0_b2z9m._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0_wxrlk._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0dvku3t._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0gi2idc._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0hx9602._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0k~hq1g._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0wtu388._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__06tjg41._.js → [root-of-the-server]__0x6yv3u._.js} +2 -2
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0yrs18n._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0-hc~ba._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_002dssm._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_00aklen._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_00x~ete._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_08dnxqq._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0agxxbf._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0c0txs~._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0cm4hy2._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0l6-7m4._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0r_7~d.._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_0y3ypyx._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_13crob-._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_13y76jr._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_next-internal_server_app_settings_notifications_page_actions_0p_s-jo.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/components_today-focus-view_tsx_0~eac-w._.js +3 -0
- 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/next-font-manifest.js +1 -1
- package/dist/standalone/next-output/server/next-font-manifest.json +4 -0
- package/dist/standalone/next-output/server/pages/500.html +1 -1
- package/dist/standalone/next-output/static/chunks/00rjs5ywh4_np.css +3 -0
- package/dist/standalone/next-output/static/chunks/{0r_p~8b~slwz6.js → 03d24rbiv.lx7.js} +1 -1
- package/dist/standalone/next-output/static/chunks/041fttxys-zjw.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0uqa2icli2jfg.js → 055~9w5b9lao5.js} +1 -1
- package/dist/standalone/next-output/static/chunks/09mbpw08eiqwx.js +1 -0
- package/dist/standalone/next-output/static/chunks/0ate7k1rcitu0.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0jmzwpfmnsd3v.js → 0bw3uow4-~3fr.js} +1 -1
- package/dist/standalone/next-output/static/chunks/{0nkl588xh~5.i.js → 0d1dhitpe0ieo.js} +5 -5
- package/dist/standalone/next-output/static/chunks/0d2d-s..s8cfz.js +1 -0
- package/dist/standalone/next-output/static/chunks/{01f_tq~9x~8zv.js → 0h72~3~6gq3fn.js} +1 -1
- package/dist/standalone/next-output/static/chunks/{0p-_potvb-of4.js → 0hhu330gm_fnl.js} +1 -1
- package/dist/standalone/next-output/static/chunks/0ls_5qyf15z5_.js +1 -0
- package/dist/standalone/next-output/static/chunks/0n0.21h11yrv2.js +1 -0
- package/dist/standalone/next-output/static/chunks/0sywv5h95uodq.js +1 -0
- package/dist/standalone/next-output/static/chunks/0x5_m1_cuacap.js +1 -0
- package/dist/standalone/next-output/static/chunks/0xccil3r~k_7n.js +1 -0
- package/dist/standalone/next-output/static/chunks/0y8q3nm-aw7vw.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0lik.lmxlumgs.js → 0~z41.7~3tpw3.js} +1 -1
- package/dist/standalone/next-output/static/chunks/14oa3e0hktvxi.js +1 -0
- package/dist/standalone/package.json +1 -1
- package/package.json +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__08321hx._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0c.ljsw._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0d6d7oj._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0ddge-d._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0jx47wg._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0px9gk1._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0qfxx_p._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0v7ghh2._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0xenuid._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0~t0puh._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_08iak5j._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_09-_33p._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0a899fn._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0ceu~9f._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0i4.n_a._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0ks2fqx._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0n4osnj._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0st.s39._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0u8~h8i._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0ybsqe1._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_11d2qve._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_138a8mc._.js +0 -3
- package/dist/standalone/next-output/static/chunks/0.--_5xgw~jq3.js +0 -1
- package/dist/standalone/next-output/static/chunks/00~ilmka-h85i.js +0 -1
- package/dist/standalone/next-output/static/chunks/06u43x9tl391w.js +0 -1
- package/dist/standalone/next-output/static/chunks/0beicab6wjk6i.js +0 -1
- package/dist/standalone/next-output/static/chunks/0d_y_tcdl.atr.js +0 -1
- package/dist/standalone/next-output/static/chunks/0pad.4ycu.c9a.js +0 -1
- package/dist/standalone/next-output/static/chunks/0wwa4vyavaj9y.js +0 -1
- package/dist/standalone/next-output/static/chunks/145wpjuqytc0-.js +0 -1
- package/dist/standalone/next-output/static/chunks/16mdccb8.20ou.css +0 -3
- package/dist/standalone/next-output/static/chunks/16unuw80qbxmx.js +0 -1
- package/dist/standalone/next-output/static/chunks/170g.yxigj5~6.js +0 -1
- package/dist/standalone/next-output/static/chunks/18c9gg_1a7.0p.js +0 -1
- /package/dist/standalone/next-output/static/{wZOpAni2OS7_9AC_2kAVd → diBBBwr7OTHBo2aEw-WYC}/_buildManifest.js +0 -0
- /package/dist/standalone/next-output/static/{wZOpAni2OS7_9AC_2kAVd → diBBBwr7OTHBo2aEw-WYC}/_clientMiddlewareManifest.js +0 -0
- /package/dist/standalone/next-output/static/{wZOpAni2OS7_9AC_2kAVd → diBBBwr7OTHBo2aEw-WYC}/_ssgManifest.js +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},54508,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},59341,a=>{"use strict";var b=a.i(60526),c=a.i(50227);let d=c.default.join(b.default.homedir(),".super-time-tracker"),e=c.default.join(d,"db.json");a.s(["DB_PATH",0,e,"DB_VERSION",0,3,"DEFAULT_SHEET_NAME",0,"main"])},4813,92398,23761,a=>{"use strict";var b=a.i(50227),c=a.i(2157),d=a.i(59341);async function e(a){try{await c.promises.mkdir(a,{recursive:!0})}catch(a){if("EEXIST"!==(null!==a&&"object"==typeof a&&"code"in a&&"string"==typeof a.code?a.code:null))throw a}}function f(a,b=[],c=null){if(0===a.length)throw Error("New sheet name must not be empty");if(null!==c&&void 0===b.find(({id:a})=>a===c))throw Error("New sheet active entry does not exist");return{name:a,entries:b,activeEntryID:c}}function g(){return{version:d.DB_VERSION,sheets:[f(d.DEFAULT_SHEET_NAME)],activeSheetName:d.DEFAULT_SHEET_NAME}}a.s(["gen_db",0,g,"gen_sheet",0,f],92398);let h={2:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(1!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 2.`);return{version:2,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d})=>({tags:[],notes:[],id:a,end:c,start:b,description:d}))}))}},3:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(2!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 3.`);return{version:3,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e})=>({notes:[],tags:e,id:a,end:c,start:b,description:d}))}))}}};async function i(a,b=d.DB_PATH){let e,f=JSON.stringify((e=a.sheets.map(a=>({name:a.name,activeEntryID:a.activeEntryID,entries:a.entries.map(a=>({id:a.id,description:a.description,tags:a.tags,start:a.start.getTime(),end:null===a.end?null:a.end.getTime(),notes:a.notes.map(a=>({text:a.text,timestamp:a.timestamp.getTime()}))}))})),{version:a.version,activeSheetName:a.activeSheetName,sheets:e}));try{await c.promises.writeFile(b,f)}catch(a){throw Error(`Failed to save DB: ${String(a)}`,{cause:a})}}async function j(a=d.DB_PATH){let f,k=b.default.dirname(a);await e(k);try{await c.promises.access(a)}catch{let b=g();return await i(b,a),b}let l=await c.promises.readFile(a,"utf-8");try{f=JSON.parse(l)}catch(b){throw Error(`DB at ${a} is invalid JSON: ${String(b)}`,{cause:b})}let m=function(a){let b=a,c=!1,e=void 0===b.version?1:b.version;if(e>d.DB_VERSION||e<1)throw Error(`Unknown DB version ${b.version}, cannot load.`);for(;e<d.DB_VERSION;){let a=e+1,d=h[a];if(void 0===d)throw Error(`Missing migration from version ${e} to ${a}.`);if((b=d(b)).version!==a)throw Error(`Invalid migration output for version ${a}.`);e=a,c=!0}return{json_db:b,did_migrate:c}}(f),n=function(a){let{sheets:b,version:c,activeSheetName:d}=a;return{version:c,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e,notes:f})=>({id:a,description:d,tags:e,notes:f.map(({timestamp:a,text:b})=>({text:b,timestamp:new Date(a)})),start:new Date(b),end:null===c?null:new Date(c)}))}))}}(f=m.json_db);return m.did_migrate&&await i(n,a),n}async function k(a){return j(a)}a.s(["write_local_db",0,i],23761),a.s(["read_db",0,k],4813)},23750,a=>{"use strict";a.s(["collect_known_tags",0,function(a){let b=new Set;for(let c of a.sheets)for(let a of c.entries)for(let c of a.tags){let a=c.trim();a.length>0&&b.add(a)}return[...b].sort((a,b)=>a.localeCompare(b))}])},23035,a=>{"use strict";a.s(["get_clipped_entry_duration_ms",0,function(a,b,c,d=Date.now()){let e=+a.start;return Math.max(0,Math.min(null===a.end?d:+a.end,c)-Math.max(e,b))}])},2985,93835,12781,a=>{"use strict";let b=Symbol.for("constructDateFrom");function c(a,c){var d;return d=c||a,"function"==typeof d?d(a):d&&"object"==typeof d&&b in d?d[b](a):d instanceof Date?new d.constructor(a):new Date(a)}function d(a,b){let d=c(a,b?.in);return d.setHours(23,59,59,999),d}a.s(["endOfDay",0,d],93835);let e={};function f(a,b){let d=c(a,b?.in);return d.setHours(0,0,0,0),d}a.s(["startOfDay",0,f],12781),a.s(["get_period_range_ms",0,function(a,b=new Date,g=1){switch(a){case"week":var h,i;let j,k,l,m,n,o;return{startMs:+(h={weekStartsOn:g},j=h?.weekStartsOn??h?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,l=(k=c(b,h?.in)).getDay(),k.setDate(k.getDate()-(7*(l<j)+l-j)),k.setHours(0,0,0,0),k),endMs:+(i={weekStartsOn:g},m=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,o=(n=c(b,i?.in)).getDay(),n.setDate(n.getDate()+((o<m?-7:0)+6-(o-m))),n.setHours(23,59,59,999),n)};case"month":let p,q,r;return{startMs:+((p=c(b,void 0)).setDate(1),p.setHours(0,0,0,0),p),endMs:+(r=(q=c(b,void 0)).getMonth(),q.setFullYear(q.getFullYear(),r+1,0),q.setHours(23,59,59,999),q)};default:return{startMs:+f(b),endMs:+d(b)}}}],2985)},19045,a=>{"use strict";a.s(["serialize_entry",0,function(a,b,c){return{id:a.id,description:a.description,start:a.start.toISOString(),end:null===a.end?null:a.end.toISOString(),tags:a.tags,notes:a.notes.map(({timestamp:a,text:b})=>({timestamp:a.toISOString(),text:b})),sheetName:b,durationMs:function(a,b=Date.now()){let{end:c,start:d}=a;return Math.max(0,(null===c?b:+c)-d)}(a),isActive:c}}],19045)},80403,a=>{"use strict";var b=a.i(19045);a.s(["find_all_serialized_active_entries",0,function(a){let c=[];for(let d of a.sheets){let{activeEntryID:a,entries:e,name:f}=d;if(null===a)continue;let g=e.find(({id:b})=>b===a);void 0!==g&&null===g.end&&c.push((0,b.serialize_entry)(g,f,!0))}return c}])},26758,a=>{a.v("/_next/static/media/favicon.0x3dzn~oxb6tn.ico"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},38872,a=>{"use strict";let b={src:a.i(26758).default,width:256,height:256};a.s(["default",0,b])},5368,a=>{"use strict";a.s(["TodayFocusView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call TodayFocusView() from the server but TodayFocusView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/today-focus-view.tsx <module evaluation>","TodayFocusView")},24356,a=>{"use strict";a.s(["TodayFocusView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call TodayFocusView() from the server but TodayFocusView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/today-focus-view.tsx","TodayFocusView")},29387,a=>{"use strict";a.i(5368);var b=a.i(24356);a.n(b)},70146,a=>{"use strict";var b=a.i(46193),c=a.i(29387),d=a.i(23750),e=a.i(23035),f=a.i(2985),g=a.i(93835),h=a.i(12781),i=a.i(19045),j=a.i(80403),k=a.i(4813);async function l(){let a=await (0,k.read_db)(),b=function(a,b=Date.now()){let c=new Date(b),{endMs:d,startMs:j}=(0,f.get_period_range_ms)("today",c),k=[];for(let f of a)for(let a of f.entries){if(!function(a,b){let{end:c,start:d}=b,e=(0,h.startOfDay)(a),f=(0,g.endOfDay)(a),i=c??new Date;return+d<=+f&&+i>=+e}(c,a))continue;let l=(0,e.get_clipped_entry_duration_ms)(a,j,d,b);l<=0||k.push({...(0,i.serialize_entry)(a,f.name,f.activeEntryID===a.id&&null===a.end),todayDurationMs:l})}return k.sort((a,b)=>new Date(b.start)-new Date(a.start))}(a.sheets),c=b.reduce((a,b)=>a+b.todayDurationMs,0);return{runningEntries:(0,j.find_all_serialized_active_entries)(a),todayEntries:b,todayTotalMs:c,sheetNames:a.sheets.map(a=>a.name),sheets:a.sheets.map(b=>({name:b.name,activeEntryID:b.activeEntryID,entryCount:b.entries.length,isActive:b.name===a.activeSheetName,hasActiveEntry:null!==b.activeEntryID})),knownTags:(0,d.collect_known_tags)(a)}}async function m(){let a=await l();return(0,b.jsx)(c.TodayFocusView,{initial_data:a})}a.s(["default",0,m],70146)},257,a=>{a.n(a.i(70146))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0ddge-d._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},54508,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},59341,a=>{"use strict";var b=a.i(60526),c=a.i(50227);let d=c.default.join(b.default.homedir(),".super-time-tracker"),e=c.default.join(d,"db.json");a.s(["DB_PATH",0,e,"DB_VERSION",0,3,"DEFAULT_SHEET_NAME",0,"main"])},4813,92398,23761,a=>{"use strict";var b=a.i(50227),c=a.i(2157),d=a.i(59341);async function e(a){try{await c.promises.mkdir(a,{recursive:!0})}catch(a){if("EEXIST"!==(null!==a&&"object"==typeof a&&"code"in a&&"string"==typeof a.code?a.code:null))throw a}}function f(a,b=[],c=null){if(0===a.length)throw Error("New sheet name must not be empty");if(null!==c&&void 0===b.find(({id:a})=>a===c))throw Error("New sheet active entry does not exist");return{name:a,entries:b,activeEntryID:c}}function g(){return{version:d.DB_VERSION,sheets:[f(d.DEFAULT_SHEET_NAME)],activeSheetName:d.DEFAULT_SHEET_NAME}}a.s(["gen_db",0,g,"gen_sheet",0,f],92398);let h={2:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(1!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 2.`);return{version:2,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d})=>({tags:[],notes:[],id:a,end:c,start:b,description:d}))}))}},3:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(2!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 3.`);return{version:3,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e})=>({notes:[],tags:e,id:a,end:c,start:b,description:d}))}))}}};async function i(a,b=d.DB_PATH){let e,f=JSON.stringify((e=a.sheets.map(a=>({name:a.name,activeEntryID:a.activeEntryID,entries:a.entries.map(a=>({id:a.id,description:a.description,tags:a.tags,start:a.start.getTime(),end:null===a.end?null:a.end.getTime(),notes:a.notes.map(a=>({text:a.text,timestamp:a.timestamp.getTime()}))}))})),{version:a.version,activeSheetName:a.activeSheetName,sheets:e}));try{await c.promises.writeFile(b,f)}catch(a){throw Error(`Failed to save DB: ${String(a)}`,{cause:a})}}async function j(a=d.DB_PATH){let f,k=b.default.dirname(a);await e(k);try{await c.promises.access(a)}catch{let b=g();return await i(b,a),b}let l=await c.promises.readFile(a,"utf-8");try{f=JSON.parse(l)}catch(b){throw Error(`DB at ${a} is invalid JSON: ${String(b)}`,{cause:b})}let m=function(a){let b=a,c=!1,e=void 0===b.version?1:b.version;if(e>d.DB_VERSION||e<1)throw Error(`Unknown DB version ${b.version}, cannot load.`);for(;e<d.DB_VERSION;){let a=e+1,d=h[a];if(void 0===d)throw Error(`Missing migration from version ${e} to ${a}.`);if((b=d(b)).version!==a)throw Error(`Invalid migration output for version ${a}.`);e=a,c=!0}return{json_db:b,did_migrate:c}}(f),n=function(a){let{sheets:b,version:c,activeSheetName:d}=a;return{version:c,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e,notes:f})=>({id:a,description:d,tags:e,notes:f.map(({timestamp:a,text:b})=>({text:b,timestamp:new Date(a)})),start:new Date(b),end:null===c?null:new Date(c)}))}))}}(f=m.json_db);return m.did_migrate&&await i(n,a),n}async function k(a){return j(a)}a.s(["write_local_db",0,i],23761),a.s(["read_db",0,k],4813)},19045,a=>{"use strict";a.s(["serialize_entry",0,function(a,b,c){return{id:a.id,description:a.description,start:a.start.toISOString(),end:null===a.end?null:a.end.toISOString(),tags:a.tags,notes:a.notes.map(({timestamp:a,text:b})=>({timestamp:a.toISOString(),text:b})),sheetName:b,durationMs:function(a,b=Date.now()){let{end:c,start:d}=a;return Math.max(0,(null===c?b:+c)-d)}(a),isActive:c}}],19045)},67835,88028,a=>{"use strict";a.s(["get_serialized_entries_total_ms",0,function(a){return a.reduce((a,b)=>a+b.durationMs,0)}],67835);var b=a.i(19045);a.s(["serialize_sheet_entries",0,function(a){let{activeEntryID:c,entries:d,name:e}=a;return d.map(a=>(0,b.serialize_entry)(a,e,c===a.id&&null===a.end))}],88028)},2985,93835,12781,a=>{"use strict";let b=Symbol.for("constructDateFrom");function c(a,c){var d;return d=c||a,"function"==typeof d?d(a):d&&"object"==typeof d&&b in d?d[b](a):d instanceof Date?new d.constructor(a):new Date(a)}function d(a,b){let d=c(a,b?.in);return d.setHours(23,59,59,999),d}a.s(["endOfDay",0,d],93835);let e={};function f(a,b){let d=c(a,b?.in);return d.setHours(0,0,0,0),d}a.s(["startOfDay",0,f],12781),a.s(["get_period_range_ms",0,function(a,b=new Date,g=1){switch(a){case"week":var h,i;let j,k,l,m,n,o;return{startMs:+(h={weekStartsOn:g},j=h?.weekStartsOn??h?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,l=(k=c(b,h?.in)).getDay(),k.setDate(k.getDate()-(7*(l<j)+l-j)),k.setHours(0,0,0,0),k),endMs:+(i={weekStartsOn:g},m=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,o=(n=c(b,i?.in)).getDay(),n.setDate(n.getDate()+((o<m?-7:0)+6-(o-m))),n.setHours(23,59,59,999),n)};case"month":let p,q,r;return{startMs:+((p=c(b,void 0)).setDate(1),p.setHours(0,0,0,0),p),endMs:+(r=(q=c(b,void 0)).getMonth(),q.setFullYear(q.getFullYear(),r+1,0),q.setHours(23,59,59,999),q)};default:return{startMs:+f(b),endMs:+d(b)}}}],2985)},23035,a=>{"use strict";a.s(["get_clipped_entry_duration_ms",0,function(a,b,c,d=Date.now()){let e=+a.start;return Math.max(0,Math.min(null===a.end?d:+a.end,c)-Math.max(e,b))}])},2317,51196,a=>{"use strict";function b(a,b){return 0===b?0:a/b}a.s(["get_average_entry_ms",0,b],51196);var c=a.i(23035);a.s(["get_sheet_report_stats_for_range",0,function(a,d,e,f=Date.now()){let g=0,h=0,i=!1;for(let b of a.entries){let j=(0,c.get_clipped_entry_duration_ms)(b,d,e,f);j<=0||(g+=j,h+=1,a.activeEntryID===b.id&&null===b.end&&(i=!0))}return{sheetName:a.name,totalMs:g,entryCount:h,averageEntryMs:b(g,h),hasActiveEntry:i}}],2317)},26758,a=>{a.v("/_next/static/media/favicon.0x3dzn~oxb6tn.ico"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},38872,a=>{"use strict";let b={src:a.i(26758).default,width:256,height:256};a.s(["default",0,b])},13159,a=>{"use strict";a.s(["ReportingView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call ReportingView() from the server but ReportingView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/reporting-view.tsx <module evaluation>","ReportingView")},74088,a=>{"use strict";a.s(["ReportingView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call ReportingView() from the server but ReportingView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/reporting-view.tsx","ReportingView")},47613,a=>{"use strict";a.i(13159);var b=a.i(74088);a.n(b)},27001,a=>{"use strict";var b=a.i(46193),c=a.i(47613),d=a.i(51196),e=a.i(2985),f=a.i(23035);function g(a,b,c,d=Date.now()){let e=0;for(let g of a)for(let a of g.entries)e+=(0,f.get_clipped_entry_duration_ms)(a,b,c,d);return e}var h=a.i(67835),i=a.i(88028),j=a.i(2317),k=a.i(4813);async function l(){let a=await (0,k.read_db)();return{sourceSheets:a.sheets.map(a=>({name:a.name,activeEntryID:a.activeEntryID,entries:a.entries.map(a=>({id:a.id,start:a.start.toISOString(),end:null===a.end?null:a.end.toISOString(),tags:a.tags}))})),stats:function(a,b=null,c=Date.now(),f=1){let k=a.map(a=>{let e,f,g;return null===b?(e=(0,i.serialize_sheet_entries)(a),f=a.entries.length,g=(0,h.get_serialized_entries_total_ms)(e),{sheetName:a.name,totalMs:g,entryCount:f,averageEntryMs:(0,d.get_average_entry_ms)(g,f),hasActiveEntry:null!==a.activeEntryID}):(0,j.get_sheet_report_stats_for_range)(a,b.startMs,b.endMs,c)}),{activeSheets:l,idleSheets:m}=function(a){let b=[],c=[];for(let d of a)0===d.entryCount||0===d.totalMs?c.push(d):b.push(d);return{activeSheets:b,idleSheets:c}}(k),n=k.reduce((a,b)=>a+b.totalMs,0),o=k.reduce((a,b)=>a+b.entryCount,0);return{activeSheets:l,idleSheets:m,grandTotalMs:n,totalEntryCount:o,grandAverageEntryMs:(0,d.get_average_entry_ms)(n,o),periodTotals:null===b?function(a,b=new Date,c=Date.now(),d=1){let f=(0,e.get_period_range_ms)("today",b,d),h=(0,e.get_period_range_ms)("week",b,d),i=(0,e.get_period_range_ms)("month",b,d);return{todayMs:g(a,f.startMs,f.endMs,c),weekMs:g(a,h.startMs,h.endMs,c),monthMs:g(a,i.startMs,i.endMs,c)}}(a,new Date(c),c,f):{todayMs:0,weekMs:0,monthMs:0}}}(a.sheets)}}async function m(){let{sourceSheets:a}=await l(),d=Date.now();return(0,b.jsx)(c.ReportingView,{source_sheets:a,reference_now:d})}a.s(["default",0,m],27001)},76842,a=>{a.n(a.i(27001))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0jx47wg._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},54508,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},59341,a=>{"use strict";var b=a.i(60526),c=a.i(50227);let d=c.default.join(b.default.homedir(),".super-time-tracker"),e=c.default.join(d,"db.json");a.s(["DB_PATH",0,e,"DB_VERSION",0,3,"DEFAULT_SHEET_NAME",0,"main"])},4813,92398,23761,a=>{"use strict";var b=a.i(50227),c=a.i(2157),d=a.i(59341);async function e(a){try{await c.promises.mkdir(a,{recursive:!0})}catch(a){if("EEXIST"!==(null!==a&&"object"==typeof a&&"code"in a&&"string"==typeof a.code?a.code:null))throw a}}function f(a,b=[],c=null){if(0===a.length)throw Error("New sheet name must not be empty");if(null!==c&&void 0===b.find(({id:a})=>a===c))throw Error("New sheet active entry does not exist");return{name:a,entries:b,activeEntryID:c}}function g(){return{version:d.DB_VERSION,sheets:[f(d.DEFAULT_SHEET_NAME)],activeSheetName:d.DEFAULT_SHEET_NAME}}a.s(["gen_db",0,g,"gen_sheet",0,f],92398);let h={2:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(1!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 2.`);return{version:2,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d})=>({tags:[],notes:[],id:a,end:c,start:b,description:d}))}))}},3:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(2!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 3.`);return{version:3,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e})=>({notes:[],tags:e,id:a,end:c,start:b,description:d}))}))}}};async function i(a,b=d.DB_PATH){let e,f=JSON.stringify((e=a.sheets.map(a=>({name:a.name,activeEntryID:a.activeEntryID,entries:a.entries.map(a=>({id:a.id,description:a.description,tags:a.tags,start:a.start.getTime(),end:null===a.end?null:a.end.getTime(),notes:a.notes.map(a=>({text:a.text,timestamp:a.timestamp.getTime()}))}))})),{version:a.version,activeSheetName:a.activeSheetName,sheets:e}));try{await c.promises.writeFile(b,f)}catch(a){throw Error(`Failed to save DB: ${String(a)}`,{cause:a})}}async function j(a=d.DB_PATH){let f,k=b.default.dirname(a);await e(k);try{await c.promises.access(a)}catch{let b=g();return await i(b,a),b}let l=await c.promises.readFile(a,"utf-8");try{f=JSON.parse(l)}catch(b){throw Error(`DB at ${a} is invalid JSON: ${String(b)}`,{cause:b})}let m=function(a){let b=a,c=!1,e=void 0===b.version?1:b.version;if(e>d.DB_VERSION||e<1)throw Error(`Unknown DB version ${b.version}, cannot load.`);for(;e<d.DB_VERSION;){let a=e+1,d=h[a];if(void 0===d)throw Error(`Missing migration from version ${e} to ${a}.`);if((b=d(b)).version!==a)throw Error(`Invalid migration output for version ${a}.`);e=a,c=!0}return{json_db:b,did_migrate:c}}(f),n=function(a){let{sheets:b,version:c,activeSheetName:d}=a;return{version:c,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e,notes:f})=>({id:a,description:d,tags:e,notes:f.map(({timestamp:a,text:b})=>({text:b,timestamp:new Date(a)})),start:new Date(b),end:null===c?null:new Date(c)}))}))}}(f=m.json_db);return m.did_migrate&&await i(n,a),n}async function k(a){return j(a)}a.s(["write_local_db",0,i],23761),a.s(["read_db",0,k],4813)},26758,a=>{a.v("/_next/static/media/favicon.0x3dzn~oxb6tn.ico"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},38872,a=>{"use strict";let b={src:a.i(26758).default,width:256,height:256};a.s(["default",0,b])},25244,a=>{"use strict";a.s(["TagManagementView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call TagManagementView() from the server but TagManagementView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/tag-management-view.tsx <module evaluation>","TagManagementView")},6889,a=>{"use strict";a.s(["TagManagementView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call TagManagementView() from the server but TagManagementView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/tag-management-view.tsx","TagManagementView")},38116,a=>{"use strict";a.i(25244);var b=a.i(6889);a.n(b)},72299,a=>{"use strict";var b=a.i(46193),c=a.i(38116),d=a.i(4813);async function e(){let a=function(a){let b=new Map;for(let c of a.sheets)for(let a of c.entries)for(let c of a.tags)try{let a=function(a){let b=a.trim().replace(/^@+/,"");if(0===b.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(b))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${b}`}(c);b.set(a,(b.get(a)??0)+1)}catch{continue}return[...b.entries()].map(([a,b])=>({name:a,entryCount:b})).sort((a,b)=>a.name.localeCompare(b.name))}(await (0,d.read_db)());return(0,b.jsx)(c.TagManagementView,{initial_tags:a})}a.s(["default",0,e],72299)},83074,a=>{a.n(a.i(72299))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0px9gk1._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},54508,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},84245,a=>{"use strict";a.s(["TrackerTopbar",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call TrackerTopbar() from the server but TrackerTopbar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/tracker-topbar.tsx <module evaluation>","TrackerTopbar")},43680,a=>{"use strict";a.s(["TrackerTopbar",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call TrackerTopbar() from the server but TrackerTopbar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/tracker-topbar.tsx","TrackerTopbar")},54675,a=>{"use strict";a.i(84245);var b=a.i(43680);a.n(b)},85168,a=>{"use strict";a.s(["SettingsNav",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call SettingsNav() from the server but SettingsNav is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/settings-nav.tsx <module evaluation>","SettingsNav")},28678,a=>{"use strict";a.s(["SettingsNav",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call SettingsNav() from the server but SettingsNav is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/settings-nav.tsx","SettingsNav")},9615,a=>{"use strict";a.i(85168);var b=a.i(28678);a.n(b)},5894,a=>{"use strict";var b=a.i(46193),c=a.i(9615),d=a.i(54675);a.s(["SettingsPageLayout",0,function({breadcrumb:a,title:e,description:f,children:g}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.TrackerTopbar,{breadcrumb:a}),(0,b.jsxs)("main",{className:"mx-auto grid w-full max-w-[1120px] grid-cols-[minmax(12rem,16rem)_minmax(0,1fr)] gap-4 px-4 pb-10 pt-5 sm:gap-6 sm:px-5 sm:pt-6 max-[860px]:grid-cols-1",children:[(0,b.jsxs)("aside",{className:"flex flex-col gap-2",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Settings"}),(0,b.jsx)(c.SettingsNav,{})]}),(0,b.jsxs)("section",{className:"flex min-w-0 flex-col gap-4",children:[(0,b.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,b.jsx)("h1",{className:"m-0 text-[1.35rem] font-[650] tracking-tight",children:e}),void 0!==f?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:f}):null]}),g]})]})]})}])},59341,a=>{"use strict";var b=a.i(60526),c=a.i(50227);let d=c.default.join(b.default.homedir(),".super-time-tracker"),e=c.default.join(d,"db.json");a.s(["DB_PATH",0,e,"DB_VERSION",0,3,"DEFAULT_SHEET_NAME",0,"main"])},4813,92398,23761,a=>{"use strict";var b=a.i(50227),c=a.i(2157),d=a.i(59341);async function e(a){try{await c.promises.mkdir(a,{recursive:!0})}catch(a){if("EEXIST"!==(null!==a&&"object"==typeof a&&"code"in a&&"string"==typeof a.code?a.code:null))throw a}}function f(a,b=[],c=null){if(0===a.length)throw Error("New sheet name must not be empty");if(null!==c&&void 0===b.find(({id:a})=>a===c))throw Error("New sheet active entry does not exist");return{name:a,entries:b,activeEntryID:c}}function g(){return{version:d.DB_VERSION,sheets:[f(d.DEFAULT_SHEET_NAME)],activeSheetName:d.DEFAULT_SHEET_NAME}}a.s(["gen_db",0,g,"gen_sheet",0,f],92398);let h={2:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(1!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 2.`);return{version:2,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d})=>({tags:[],notes:[],id:a,end:c,start:b,description:d}))}))}},3:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(2!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 3.`);return{version:3,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e})=>({notes:[],tags:e,id:a,end:c,start:b,description:d}))}))}}};async function i(a,b=d.DB_PATH){let e,f=JSON.stringify((e=a.sheets.map(a=>({name:a.name,activeEntryID:a.activeEntryID,entries:a.entries.map(a=>({id:a.id,description:a.description,tags:a.tags,start:a.start.getTime(),end:null===a.end?null:a.end.getTime(),notes:a.notes.map(a=>({text:a.text,timestamp:a.timestamp.getTime()}))}))})),{version:a.version,activeSheetName:a.activeSheetName,sheets:e}));try{await c.promises.writeFile(b,f)}catch(a){throw Error(`Failed to save DB: ${String(a)}`,{cause:a})}}async function j(a=d.DB_PATH){let f,k=b.default.dirname(a);await e(k);try{await c.promises.access(a)}catch{let b=g();return await i(b,a),b}let l=await c.promises.readFile(a,"utf-8");try{f=JSON.parse(l)}catch(b){throw Error(`DB at ${a} is invalid JSON: ${String(b)}`,{cause:b})}let m=function(a){let b=a,c=!1,e=void 0===b.version?1:b.version;if(e>d.DB_VERSION||e<1)throw Error(`Unknown DB version ${b.version}, cannot load.`);for(;e<d.DB_VERSION;){let a=e+1,d=h[a];if(void 0===d)throw Error(`Missing migration from version ${e} to ${a}.`);if((b=d(b)).version!==a)throw Error(`Invalid migration output for version ${a}.`);e=a,c=!0}return{json_db:b,did_migrate:c}}(f),n=function(a){let{sheets:b,version:c,activeSheetName:d}=a;return{version:c,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e,notes:f})=>({id:a,description:d,tags:e,notes:f.map(({timestamp:a,text:b})=>({text:b,timestamp:new Date(a)})),start:new Date(b),end:null===c?null:new Date(c)}))}))}}(f=m.json_db);return m.did_migrate&&await i(n,a),n}async function k(a){return j(a)}a.s(["write_local_db",0,i],23761),a.s(["read_db",0,k],4813)},23750,a=>{"use strict";a.s(["collect_known_tags",0,function(a){let b=new Set;for(let c of a.sheets)for(let a of c.entries)for(let c of a.tags){let a=c.trim();a.length>0&&b.add(a)}return[...b].sort((a,b)=>a.localeCompare(b))}])},26758,a=>{a.v("/_next/static/media/favicon.0x3dzn~oxb6tn.ico"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},38872,a=>{"use strict";let b={src:a.i(26758).default,width:256,height:256};a.s(["default",0,b])},10216,a=>{"use strict";a.s(["FocusGoalsNudgesSetting",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call FocusGoalsNudgesSetting() from the server but FocusGoalsNudgesSetting is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/focus-goals-nudges-setting.tsx <module evaluation>","FocusGoalsNudgesSetting")},98251,a=>{"use strict";a.s(["FocusGoalsNudgesSetting",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call FocusGoalsNudgesSetting() from the server but FocusGoalsNudgesSetting is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/focus-goals-nudges-setting.tsx","FocusGoalsNudgesSetting")},70023,a=>{"use strict";a.i(10216);var b=a.i(98251);a.n(b)},8235,a=>{"use strict";var b=a.i(46193),c=a.i(70023),d=a.i(5894);function e({sheet_names:a,tag_names:f}){return(0,b.jsx)(d.SettingsPageLayout,{breadcrumb:{current:"Goals",parent:{label:"Settings",href:"/settings"}},title:"Goals",description:"Configure focus targets globally, per-sheet, or per-tag.",children:(0,b.jsx)("ul",{className:"m-0 flex w-full list-none flex-col gap-2 p-0","aria-label":"Goal settings",children:(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,b.jsx)(c.FocusGoalsNudgesSetting,{sheet_names:a,tag_names:f})})})})}var f=a.i(23750),g=a.i(4813);async function h(){let a=await (0,g.read_db)(),c=a.sheets.map(a=>a.name),d=(0,f.collect_known_tags)(a);return(0,b.jsx)(e,{sheet_names:c,tag_names:d})}a.s(["default",0,h],8235)},98105,a=>{a.n(a.i(8235))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0qfxx_p._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},54508,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},59341,a=>{"use strict";var b=a.i(60526),c=a.i(50227);let d=c.default.join(b.default.homedir(),".super-time-tracker"),e=c.default.join(d,"db.json");a.s(["DB_PATH",0,e,"DB_VERSION",0,3,"DEFAULT_SHEET_NAME",0,"main"])},4813,92398,23761,a=>{"use strict";var b=a.i(50227),c=a.i(2157),d=a.i(59341);async function e(a){try{await c.promises.mkdir(a,{recursive:!0})}catch(a){if("EEXIST"!==(null!==a&&"object"==typeof a&&"code"in a&&"string"==typeof a.code?a.code:null))throw a}}function f(a,b=[],c=null){if(0===a.length)throw Error("New sheet name must not be empty");if(null!==c&&void 0===b.find(({id:a})=>a===c))throw Error("New sheet active entry does not exist");return{name:a,entries:b,activeEntryID:c}}function g(){return{version:d.DB_VERSION,sheets:[f(d.DEFAULT_SHEET_NAME)],activeSheetName:d.DEFAULT_SHEET_NAME}}a.s(["gen_db",0,g,"gen_sheet",0,f],92398);let h={2:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(1!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 2.`);return{version:2,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d})=>({tags:[],notes:[],id:a,end:c,start:b,description:d}))}))}},3:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(2!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 3.`);return{version:3,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e})=>({notes:[],tags:e,id:a,end:c,start:b,description:d}))}))}}};async function i(a,b=d.DB_PATH){let e,f=JSON.stringify((e=a.sheets.map(a=>({name:a.name,activeEntryID:a.activeEntryID,entries:a.entries.map(a=>({id:a.id,description:a.description,tags:a.tags,start:a.start.getTime(),end:null===a.end?null:a.end.getTime(),notes:a.notes.map(a=>({text:a.text,timestamp:a.timestamp.getTime()}))}))})),{version:a.version,activeSheetName:a.activeSheetName,sheets:e}));try{await c.promises.writeFile(b,f)}catch(a){throw Error(`Failed to save DB: ${String(a)}`,{cause:a})}}async function j(a=d.DB_PATH){let f,k=b.default.dirname(a);await e(k);try{await c.promises.access(a)}catch{let b=g();return await i(b,a),b}let l=await c.promises.readFile(a,"utf-8");try{f=JSON.parse(l)}catch(b){throw Error(`DB at ${a} is invalid JSON: ${String(b)}`,{cause:b})}let m=function(a){let b=a,c=!1,e=void 0===b.version?1:b.version;if(e>d.DB_VERSION||e<1)throw Error(`Unknown DB version ${b.version}, cannot load.`);for(;e<d.DB_VERSION;){let a=e+1,d=h[a];if(void 0===d)throw Error(`Missing migration from version ${e} to ${a}.`);if((b=d(b)).version!==a)throw Error(`Invalid migration output for version ${a}.`);e=a,c=!0}return{json_db:b,did_migrate:c}}(f),n=function(a){let{sheets:b,version:c,activeSheetName:d}=a;return{version:c,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e,notes:f})=>({id:a,description:d,tags:e,notes:f.map(({timestamp:a,text:b})=>({text:b,timestamp:new Date(a)})),start:new Date(b),end:null===c?null:new Date(c)}))}))}}(f=m.json_db);return m.did_migrate&&await i(n,a),n}async function k(a){return j(a)}a.s(["write_local_db",0,i],23761),a.s(["read_db",0,k],4813)},2985,93835,12781,a=>{"use strict";let b=Symbol.for("constructDateFrom");function c(a,c){var d;return d=c||a,"function"==typeof d?d(a):d&&"object"==typeof d&&b in d?d[b](a):d instanceof Date?new d.constructor(a):new Date(a)}function d(a,b){let d=c(a,b?.in);return d.setHours(23,59,59,999),d}a.s(["endOfDay",0,d],93835);let e={};function f(a,b){let d=c(a,b?.in);return d.setHours(0,0,0,0),d}a.s(["startOfDay",0,f],12781),a.s(["get_period_range_ms",0,function(a,b=new Date,g=1){switch(a){case"week":var h,i;let j,k,l,m,n,o;return{startMs:+(h={weekStartsOn:g},j=h?.weekStartsOn??h?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,l=(k=c(b,h?.in)).getDay(),k.setDate(k.getDate()-(7*(l<j)+l-j)),k.setHours(0,0,0,0),k),endMs:+(i={weekStartsOn:g},m=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,o=(n=c(b,i?.in)).getDay(),n.setDate(n.getDate()+((o<m?-7:0)+6-(o-m))),n.setHours(23,59,59,999),n)};case"month":let p,q,r;return{startMs:+((p=c(b,void 0)).setDate(1),p.setHours(0,0,0,0),p),endMs:+(r=(q=c(b,void 0)).getMonth(),q.setFullYear(q.getFullYear(),r+1,0),q.setHours(23,59,59,999),q)};default:return{startMs:+f(b),endMs:+d(b)}}}],2985)},23035,a=>{"use strict";a.s(["get_clipped_entry_duration_ms",0,function(a,b,c,d=Date.now()){let e=+a.start;return Math.max(0,Math.min(null===a.end?d:+a.end,c)-Math.max(e,b))}])},2317,51196,a=>{"use strict";function b(a,b){return 0===b?0:a/b}a.s(["get_average_entry_ms",0,b],51196);var c=a.i(23035);a.s(["get_sheet_report_stats_for_range",0,function(a,d,e,f=Date.now()){let g=0,h=0,i=!1;for(let b of a.entries){let j=(0,c.get_clipped_entry_duration_ms)(b,d,e,f);j<=0||(g+=j,h+=1,a.activeEntryID===b.id&&null===b.end&&(i=!0))}return{sheetName:a.name,totalMs:g,entryCount:h,averageEntryMs:b(g,h),hasActiveEntry:i}}],2317)},26758,a=>{a.v("/_next/static/media/favicon.0x3dzn~oxb6tn.ico"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},38872,a=>{"use strict";let b={src:a.i(26758).default,width:256,height:256};a.s(["default",0,b])},57577,a=>{"use strict";a.s(["SheetHubView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call SheetHubView() from the server but SheetHubView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/sheet-hub-view.tsx <module evaluation>","SheetHubView")},68434,a=>{"use strict";a.s(["SheetHubView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call SheetHubView() from the server but SheetHubView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/sheet-hub-view.tsx","SheetHubView")},14012,a=>{"use strict";a.i(57577);var b=a.i(68434);a.n(b)},23853,a=>{"use strict";var b=a.i(46193),c=a.i(14012),d=a.i(2985),e=a.i(2317),f=a.i(4813);async function g(){return{rows:function(a,b=Date.now(),c=1){let f=new Date(b),g=(0,d.get_period_range_ms)("week",f,c),h=(0,d.get_period_range_ms)("month",f);return a.map(a=>{let c=(0,e.get_sheet_report_stats_for_range)(a,g.startMs,g.endMs,b),d=(0,e.get_sheet_report_stats_for_range)(a,h.startMs,h.endMs,b),f=function(a,b=Date.now()){let c=null;for(let d of a.entries){let a=null===d.end?b:+d.end,e=Math.max(+d.start,a);(null===c||e>c)&&(c=e)}return c}(a,b);return{sheetName:a.name,entryCount:a.entries.length,hasActiveEntry:null!==a.activeEntryID,weekTotalMs:c.totalMs,monthTotalMs:d.totalMs,lastActivityAt:null===f?null:new Date(f).toISOString()}})}((await (0,f.read_db)()).sheets)}}async function h(){let{rows:a}=await g();return(0,b.jsx)(c.SheetHubView,{rows:a})}a.s(["default",0,h],23853)},12349,a=>{a.n(a.i(23853))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0v7ghh2._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},94877,(a,b,c)=>{"use strict";b.exports=a.r(85058).vendored.contexts.HooksClientContext},12273,(a,b,c)=>{"use strict";b.exports=a.r(85058).vendored.contexts.ServerInsertedHtml},85058,(a,b,c)=>{"use strict";b.exports=a.r(18622)},39752,(a,b,c)=>{"use strict";b.exports=a.r(85058).vendored["react-ssr"].ReactJsxRuntime},34542,(a,b,c)=>{"use strict";b.exports=a.r(85058).vendored["react-ssr"].React},72034,(a,b,c)=>{"use strict";b.exports=a.r(85058).vendored.contexts.AppRouterContext},71535,(a,b,c)=>{"use strict";b.exports=a.r(85058).vendored["react-ssr"].ReactServerDOMTurbopackClient},3988,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},38371,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DEFAULT_SEGMENT_KEY:function(){return l},NOT_FOUND_SEGMENT_KEY:function(){return m},PAGE_SEGMENT_KEY:function(){return k},addSearchParamsIfPageSegment:function(){return i},computeSelectedLayoutSegment:function(){return j},getSegmentValue:function(){return f},getSelectedLayoutSegmentPath:function(){return function a(b,c,d=!0,e=[]){let g;if(d)g=b[1][c];else{let a=b[1];g=a.children??Object.values(a)[0]}if(!g)return e;let h=f(g[0]);return!h||h.startsWith(k)?e:(e.push(h),a(g,c,!1,e))}},isGroupSegment:function(){return g},isParallelRouteSegment:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Array.isArray(a)?a[1]:a}function g(a){return"("===a[0]&&a.endsWith(")")}function h(a){return a.startsWith("@")&&"@children"!==a}function i(a,b){if(a.includes(k)){let a=JSON.stringify(b);return"{}"!==a?k+"?"+a:k}return a}function j(a,b){if(!a||0===a.length)return null;let c="children"===b?a[0]:a[a.length-1];return c===l?null:c}let k="__PAGE__",l="__DEFAULT__",m="/_not-found"},21154,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"InvariantError",{enumerable:!0,get:function(){return d}});class d extends Error{constructor(a,b){super(`Invariant: ${a.endsWith(".")?a:a+"."} This is a bug in Next.js.`,b),this.name="InvariantError"}}},40959,(a,b,c)=>{"use strict";function d(){let a,b,c=new Promise((c,d)=>{a=c,b=d});return{resolve:a,reject:b,promise:c}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createPromiseWithResolvers",{enumerable:!0,get:function(){return d}})},89969,a=>{"use strict";a.s(["get_button_class_name",0,function(a="ghost",b="default"){return`cursor-pointer appearance-none rounded-[0.65rem] border border-transparent font-inherit font-semibold disabled:cursor-not-allowed disabled:opacity-55 ${({default:"px-3.5 py-2.5",small:"px-2.5 py-1.5 text-xs"})[b]} ${({primary:"border-accent-border bg-[var(--accent)] text-[var(--accent-text-on)]",ghost:"border-panel-border bg-ghost-bg text-inherit",danger:"border-danger-border bg-danger-soft text-danger","danger-solid":"border-danger-border bg-[var(--danger-solid)] text-[var(--danger-text-on)]"})[a]}`}])},53030,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(89969);function e({options:a,on_confirm:f,on_cancel:g}){let h=(0,c.useId)(),i=(0,c.useRef)(null),{cancelLabel:j="Cancel",confirmLabel:k="Confirm",message:l,title:m,variant:n="default"}=a;return(0,c.useEffect)(()=>{i.current?.focus();let a=a=>{"Escape"===a.key&&g()};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[g]),(0,b.jsxs)("div",{className:"fixed inset-0 z-100 flex items-center justify-center p-5",role:"presentation",children:[(0,b.jsx)("button",{type:"button",className:"absolute inset-0 cursor-default border-0 bg-overlay p-0","aria-label":"Dismiss dialog",onClick:g}),(0,b.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":h,className:"relative z-1 w-full max-w-md rounded-lg border border-panel-border bg-panel p-5 shadow-md",children:[(0,b.jsx)("h2",{id:h,className:"m-0 text-[1.1rem] font-[650] tracking-tight",children:m}),(0,b.jsx)("p",{className:"m-0 mt-2 text-[0.9rem] leading-relaxed text-muted",children:l}),(0,b.jsxs)("div",{className:"mt-5 flex flex-wrap justify-end gap-2",children:[(0,b.jsx)("button",{type:"button",className:(0,d.get_button_class_name)("ghost"),onClick:g,children:j}),(0,b.jsx)("button",{ref:i,type:"button",className:(0,d.get_button_class_name)("danger"===n?"danger":"primary"),onClick:f,children:k})]})]})]})}let f=(0,c.createContext)(null);a.s(["ConfirmDialogProvider",0,function({children:a}){let[d,g]=(0,c.useState)(null),h=(0,c.useCallback)(a=>new Promise(b=>{g({options:a,resolve:b})}),[]),i=a=>{d?.resolve(a),g(null)};return(0,b.jsxs)(f.Provider,{value:{confirm:h},children:[a,null!==d?(0,b.jsx)(e,{options:d.options,on_confirm:()=>i(!0),on_cancel:()=>i(!1)}):null]})},"use_confirm_dialog",0,function(){let a=(0,c.useContext)(f);if(null===a)throw Error("use_confirm_dialog must be used within ConfirmDialogProvider");return a}],53030)},87281,a=>{"use strict";var b=a.i(49170);a.s(["is_greedy_cloud_sync_enabled",0,function(){return"true"===b.greedy_cloud_sync_preference.read()}])},72327,40395,76121,a=>{"use strict";var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_NUDGES_ENABLED_STORAGE_KEY,default_value:c.FOCUS_NUDGES_ENABLED_DEFAULT,is_valid:a=>"true"===a||"false"===a});a.s(["focus_nudges_enabled_preference",0,d],72327);let e=(0,b.create_ui_preference_store)({storage_key:c.NO_LOG_REMINDER_MINUTES_STORAGE_KEY,default_value:c.NO_LOG_REMINDER_MINUTES_DEFAULT,is_valid:a=>{if(!/^\d+$/.test(a))return!1;let b=Number.parseInt(a,10);return b>=5&&b<=240}});a.s(["no_log_reminder_minutes_preference",0,e],40395);let f=(0,b.create_ui_preference_store)({storage_key:c.OVERWORK_ALERT_HOURS_STORAGE_KEY,default_value:c.OVERWORK_ALERT_HOURS_DEFAULT,is_valid:a=>{if(!/^\d+$/.test(a))return!1;let b=Number.parseInt(a,10);return b>=1&&b<=16}});a.s(["overwork_alert_hours_preference",0,f],76121)},22496,43329,a=>{"use strict";var b=a.i(52345),c=a.i(70827);let d=/^([01]\d|2[0-3]):[0-5]\d$/,e=(0,b.create_ui_preference_store)({storage_key:c.WORK_HOURS_END_STORAGE_KEY,default_value:c.WORK_HOURS_END_DEFAULT,is_valid:a=>d.test(a)});a.s(["work_hours_end_preference",0,e],22496);let f=/^([01]\d|2[0-3]):[0-5]\d$/,g=(0,b.create_ui_preference_store)({storage_key:c.WORK_HOURS_START_STORAGE_KEY,default_value:c.WORK_HOURS_START_DEFAULT,is_valid:a=>f.test(a)});a.s(["work_hours_start_preference",0,g],43329)},7386,89711,89184,a=>{"use strict";var b=a.i(39752),c=a.i(34542);function d({label:a,description:c,compact:e}){return(0,b.jsxs)("div",{className:"contents",children:[(0,b.jsx)("dt",{className:"m-0",children:(0,b.jsx)("kbd",{className:`inline-block min-w-7 rounded border border-panel-border bg-surface text-center font-mono font-semibold text-foreground ${e?"px-1 py-0.5 text-[0.7rem]":"px-1.5 py-0.5 text-[0.78rem]"}`,children:a})}),(0,b.jsx)("dd",{className:`m-0 self-center leading-snug text-muted ${e?"text-[0.8rem]":"text-[0.9rem]"}`,children:c})]})}function e({sections:a,compact:c=!1}){return(0,b.jsx)("div",{className:`flex flex-col ${c?"gap-2.5":"gap-4"}`,children:a.map(a=>(0,b.jsxs)("section",{children:[(0,b.jsx)("h3",{className:`m-0 font-semibold uppercase tracking-[0.04em] text-muted ${c?"text-[0.65rem]":"text-[0.72rem]"}`,children:a.title}),(0,b.jsx)("dl",{className:`m-0 grid grid-cols-[auto_minmax(0,1fr)] ${c?"mt-1.5 gap-x-3 gap-y-1.5":"mt-2 gap-x-4 gap-y-2"}`,children:a.entries.map(e=>(0,b.jsx)(d,{label:e.label,description:e.description,compact:c},`${a.title}-${e.label}-${e.description}`))})]},a.title))})}var f=a.i(89969);a.s(["KeyboardShortcutsDialog",0,function({sections:a,on_close:d}){let g=(0,c.useId)(),h=(0,c.useRef)(null);return(0,c.useEffect)(()=>{h.current?.focus();let a=a=>{"Escape"===a.key&&d()};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[d]),(0,b.jsxs)("div",{className:"fixed inset-0 z-100 flex items-center justify-center p-5",role:"presentation",children:[(0,b.jsx)("button",{type:"button",className:"absolute inset-0 cursor-default border-0 bg-overlay p-0","aria-label":"Dismiss dialog",onClick:d}),(0,b.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":g,className:"relative z-1 w-full max-w-lg rounded-lg border border-panel-border bg-panel p-5 shadow-md",children:[(0,b.jsx)("h2",{id:g,className:"m-0 text-[1.1rem] font-[650] tracking-tight",children:"Keyboard shortcuts"}),(0,b.jsx)("div",{className:"mt-4 max-h-[min(28rem,70vh)] overflow-y-auto pr-1",children:(0,b.jsx)(e,{sections:a})}),(0,b.jsx)("div",{className:"mt-5 flex justify-end",children:(0,b.jsx)("button",{ref:h,type:"button",className:(0,f.get_button_class_name)("primary"),onClick:d,children:"Close"})})]})]})}],7386),a.s(["get_app_keyboard_shortcut_sections",0,function(){return[{title:"General",entries:[{label:"?",description:"Show keyboard shortcuts"}]}]}],89711);var g=a.i(46299);a.s(["use_document_keyboard_shortcuts",0,function(a){let b=(0,c.useRef)(a);b.current=a,(0,c.useEffect)(()=>{let a=a=>{if(!function(a){let b=a.target;if(!(b instanceof HTMLElement))return!1;if(b.isContentEditable)return!0;let c=b.tagName;return"INPUT"===c||"TEXTAREA"===c||"SELECT"===c}(a)&&!(0,g.is_modal_dialog_open)()){for(let c of b.current)if(c.is_available?.()!==!1&&function(a,b){let c=b.modifiers??[],d=c.includes("alt"),e=c.includes("ctrl"),f=c.includes("meta"),g=c.includes("shift");return a.altKey===d&&a.ctrlKey===e&&a.metaKey===f&&a.shiftKey===g&&(1===a.key.length?a.key.toLowerCase():a.key)===(1===b.key.length?b.key.toLowerCase():b.key)}(a,c)){a.preventDefault(),c.action();return}}};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[])}],89184)},17037,a=>{"use strict";var b=a.i(39752),c=a.i(82508),d=a.i(34542),e=a.i(7386),f=a.i(89711),g=a.i(89184);a.s(["AppKeyboardShortcuts",0,function(){let a=(0,c.usePathname)(),[h,i]=(0,d.useState)(!1),j="/"===a,k=(0,d.useMemo)(()=>j?[]:[{id:"help",label:"?",description:"Show keyboard shortcuts",key:"?",modifiers:["shift"],action:()=>{i(a=>!a)}}],[j]);return((0,g.use_document_keyboard_shortcuts)(k),!h||j)?null:(0,b.jsx)(e.KeyboardShortcutsDialog,{sections:(0,f.get_app_keyboard_shortcut_sections)(),on_close:()=>i(!1)})}])},24480,a=>{"use strict";var b=a.i(39752),c=a.i(82508),d=a.i(34542),e=a.i(9301),f=a.i(19519),g=a.i(64169),h=a.i(17465);async function i(){await (0,h.with_ui_preferences_merge_guard)(async()=>{let a=(0,g.collect_ui_preferences_from_window)(),b=await fetch("/api/ui-preferences/merge-on-load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:a})});if(!b.ok)throw Error((await b.json()).error??"UI preferences merge on load failed");let c=await b.json();(0,f.apply_ui_preferences_from_record)(c.preferences??{})})}var j=a.i(80097),k=a.i(51652),l=a.i(63577),m=a.i(74365),n=a.i(87281);function o(){return(0,n.is_greedy_cloud_sync_enabled)()}a.s(["CloudSyncProvider",0,function({children:a}){let f=(0,c.useRouter)(),g=(0,c.usePathname)(),h=(0,d.useRef)(null),n=(0,d.useRef)(!0);return(0,d.useEffect)(()=>{if(!(0,l.is_supabase_configured)()||!(0,k.is_cloud_sync_enabled)())return;let a=(0,e.create_browser_supabase_client)(),b=a=>{!o()&&(0,j.has_tracker_db_merged_this_browser_session)()?i().catch(()=>{}):(0,m.run_tracker_db_cloud_sync)({merge_on_load:!0,on_complete:a?()=>{f.refresh()}:void 0}).catch(()=>{})};a.auth.getSession().then(({data:{session:a}})=>{null!==a&&b(!1)});let{data:{subscription:c}}=a.auth.onAuthStateChange(a=>{if("SIGNED_IN"===a){(0,j.clear_tracker_db_merged_this_browser_session)(),h.current=null,n.current=!0,b(!0);return}"SIGNED_OUT"===a&&((0,j.clear_tracker_db_merged_this_browser_session)(),h.current=null,n.current=!0,f.refresh())});return()=>{c.unsubscribe()}},[f]),(0,d.useEffect)(()=>{if((0,l.is_supabase_configured)()&&(0,k.is_cloud_sync_enabled)()&&o()){if(n.current){n.current=!1,h.current=g;return}h.current!==g&&(h.current=g,(0,m.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{}))}},[g]),(0,b.jsx)(b.Fragment,{children:a})}],24480)},48889,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(14676);function e(){let[a,e]=(0,c.useState)(null);if((0,c.useEffect)(()=>{let a=null,b=(0,d.subscribe_cloud_db_sync)(b=>{e(b),null!==a&&(clearTimeout(a),a=null),(b?.phase==="success"||b?.phase==="error")&&(a=setTimeout(()=>{e(null),a=null},2800))});return()=>{b(),null!==a&&clearTimeout(a)}},[]),null===a)return null;let f="syncing"===a.phase,g="error"===a.phase,h="success"===a.phase?100:"error"===a.phase?0:null;return(0,b.jsxs)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"w-full rounded-md border border-accent-border bg-panel px-4 py-3 text-[0.88rem] font-medium text-foreground shadow-md",children:[(0,b.jsx)("p",{className:"m-0 mb-2.5 leading-snug",children:a.message}),(0,b.jsx)("div",{className:"h-1 overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--accent)_22%,var(--panel-border))]","aria-hidden":"true",children:f?(0,b.jsx)("div",{className:"cloud-db-sync-progress-indeterminate h-full w-1/3 rounded-full bg-accent"}):(0,b.jsx)("div",{className:`h-full rounded-full transition-[width] duration-300 ease-out ${g?"bg-danger":"bg-accent"}`,style:{width:`${h??0}%`}})})]})}var f=a.i(7048);function g(){let[a,d]=(0,c.useState)(null);return((0,c.useEffect)(()=>{let a=null,b=(0,f.subscribe_settings_saved)(b=>{d(b),null!==a&&clearTimeout(a),a=setTimeout(()=>{d(null),a=null},2800)});return()=>{b(),null!==a&&clearTimeout(a)}},[]),null===a)?null:(0,b.jsx)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"w-full rounded-md border border-accent-border bg-panel px-4 py-2.5 text-[0.88rem] font-medium text-foreground shadow-md transition-[opacity,transform] duration-200",children:a||f.SETTINGS_SAVED_DEFAULT_MESSAGE})}a.s(["ToastNotifications",0,function(){return(0,b.jsxs)("div",{className:"pointer-events-none fixed z-50 flex w-[min(22rem,calc(100vw-2rem))] flex-col items-end gap-2 right-[max(1rem,env(safe-area-inset-right,0px))] bottom-[max(1rem,env(safe-area-inset-bottom,0px))]",children:[(0,b.jsx)(e,{}),(0,b.jsx)(g,{})]})}],48889)},70648,a=>{"use strict";var b=a.i(34542),c=a.i(37183);a.s(["DocumentPreferencesInit",0,function(){return(0,b.useLayoutEffect)(()=>{(0,c.apply_ui_preferences_dom_from_window)()},[]),null}])},34174,a=>{"use strict";var b=a.i(34542),c=a.i(72327),d=a.i(40395),e=a.i(76121),f=a.i(22496),g=a.i(43329);a.s(["NotificationRulesRunner",0,function(){let a=(0,b.useSyncExternalStore)(c.focus_nudges_enabled_preference.subscribe,c.focus_nudges_enabled_preference.get_snapshot,c.focus_nudges_enabled_preference.get_server_snapshot),h=(0,b.useSyncExternalStore)(d.no_log_reminder_minutes_preference.subscribe,d.no_log_reminder_minutes_preference.get_snapshot,d.no_log_reminder_minutes_preference.get_server_snapshot),i=(0,b.useSyncExternalStore)(e.overwork_alert_hours_preference.subscribe,e.overwork_alert_hours_preference.get_snapshot,e.overwork_alert_hours_preference.get_server_snapshot),j=(0,b.useSyncExternalStore)(g.work_hours_start_preference.subscribe,g.work_hours_start_preference.get_snapshot,g.work_hours_start_preference.get_server_snapshot),k=(0,b.useSyncExternalStore)(f.work_hours_end_preference.subscribe,f.work_hours_end_preference.get_snapshot,f.work_hours_end_preference.get_server_snapshot);return(0,b.useRef)(0),(0,b.useRef)(null),(0,b.useEffect)(()=>{},[a]),(0,b.useEffect)(()=>{},[a,h,i,k,j]),null}])},19494,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(89969);let e="super-time-tracker-pwa-install-notice-dismissed";a.s(["PwaInstallNotice",0,function(){let[a,f]=(0,c.useState)(null),[g,h]=(0,c.useState)(!0),[i,j]=(0,c.useState)(!1);return((0,c.useEffect)(()=>{},[]),g)?null:(0,b.jsxs)("aside",{className:"fixed right-4 bottom-4 z-50 w-[min(22rem,calc(100vw-2rem))] rounded-md border border-accent-border bg-panel p-3.5 shadow-md",children:[(0,b.jsx)("p",{className:"m-0 text-[0.9rem] font-semibold",children:"Install app"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.82rem] leading-snug text-muted",children:null!==a?"Install Super Time Tracker for offline use and a faster startup.":"Install from your browser menu to enable app-style launch and offline support."}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[null!==a?(0,b.jsx)("button",{type:"button",className:(0,d.get_button_class_name)("primary","small"),disabled:i,onClick:()=>{j(!0),a.prompt().then(async()=>{"accepted"===(await a.userChoice).outcome&&(window.localStorage.setItem(e,"true"),h(!0))}).finally(()=>{j(!1),f(null)})},children:i?"Opening…":"Install"}):null,(0,b.jsx)("button",{type:"button",className:(0,d.get_button_class_name)("ghost","small"),onClick:()=>{window.localStorage.setItem(e,"true"),h(!0)},children:"Dismiss"})]})]})}])},82429,a=>{"use strict";var b=a.i(34542);a.s(["PwaRegister",0,function(){return(0,b.useEffect)(()=>{},[]),null}])},97658,a=>{"use strict";var b=a.i(34542);a.i(29698),a.s(["ThemeModeSystemListener",0,function(){return(0,b.useEffect)(()=>{},[]),null}])},16081,a=>{"use strict";var b=a.i(34542),c=a.i(37183),d=a.i(17310);a.s(["UiPreferencesDocumentSync",0,function(){return(0,b.useEffect)(()=>{let a=()=>{(0,c.apply_ui_preferences_dom_from_window)()};return window.addEventListener(d.UI_PREFERENCES_APPLIED_EVENT,a),()=>{window.removeEventListener(d.UI_PREFERENCES_APPLIED_EVENT,a)}},[]),null}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0xenuid._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},54508,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},59341,a=>{"use strict";var b=a.i(60526),c=a.i(50227);let d=c.default.join(b.default.homedir(),".super-time-tracker"),e=c.default.join(d,"db.json");a.s(["DB_PATH",0,e,"DB_VERSION",0,3,"DEFAULT_SHEET_NAME",0,"main"])},4813,92398,23761,a=>{"use strict";var b=a.i(50227),c=a.i(2157),d=a.i(59341);async function e(a){try{await c.promises.mkdir(a,{recursive:!0})}catch(a){if("EEXIST"!==(null!==a&&"object"==typeof a&&"code"in a&&"string"==typeof a.code?a.code:null))throw a}}function f(a,b=[],c=null){if(0===a.length)throw Error("New sheet name must not be empty");if(null!==c&&void 0===b.find(({id:a})=>a===c))throw Error("New sheet active entry does not exist");return{name:a,entries:b,activeEntryID:c}}function g(){return{version:d.DB_VERSION,sheets:[f(d.DEFAULT_SHEET_NAME)],activeSheetName:d.DEFAULT_SHEET_NAME}}a.s(["gen_db",0,g,"gen_sheet",0,f],92398);let h={2:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(1!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 2.`);return{version:2,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d})=>({tags:[],notes:[],id:a,end:c,start:b,description:d}))}))}},3:function(a){let{sheets:b,version:c,activeSheetName:d}=a;if(2!==c&&void 0!==c)throw Error(`DB is version ${c}, cannot migrate to version 3.`);return{version:3,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e})=>({notes:[],tags:e,id:a,end:c,start:b,description:d}))}))}}};async function i(a,b=d.DB_PATH){let e,f=JSON.stringify((e=a.sheets.map(a=>({name:a.name,activeEntryID:a.activeEntryID,entries:a.entries.map(a=>({id:a.id,description:a.description,tags:a.tags,start:a.start.getTime(),end:null===a.end?null:a.end.getTime(),notes:a.notes.map(a=>({text:a.text,timestamp:a.timestamp.getTime()}))}))})),{version:a.version,activeSheetName:a.activeSheetName,sheets:e}));try{await c.promises.writeFile(b,f)}catch(a){throw Error(`Failed to save DB: ${String(a)}`,{cause:a})}}async function j(a=d.DB_PATH){let f,k=b.default.dirname(a);await e(k);try{await c.promises.access(a)}catch{let b=g();return await i(b,a),b}let l=await c.promises.readFile(a,"utf-8");try{f=JSON.parse(l)}catch(b){throw Error(`DB at ${a} is invalid JSON: ${String(b)}`,{cause:b})}let m=function(a){let b=a,c=!1,e=void 0===b.version?1:b.version;if(e>d.DB_VERSION||e<1)throw Error(`Unknown DB version ${b.version}, cannot load.`);for(;e<d.DB_VERSION;){let a=e+1,d=h[a];if(void 0===d)throw Error(`Missing migration from version ${e} to ${a}.`);if((b=d(b)).version!==a)throw Error(`Invalid migration output for version ${a}.`);e=a,c=!0}return{json_db:b,did_migrate:c}}(f),n=function(a){let{sheets:b,version:c,activeSheetName:d}=a;return{version:c,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e,notes:f})=>({id:a,description:d,tags:e,notes:f.map(({timestamp:a,text:b})=>({text:b,timestamp:new Date(a)})),start:new Date(b),end:null===c?null:new Date(c)}))}))}}(f=m.json_db);return m.did_migrate&&await i(n,a),n}async function k(a){return j(a)}a.s(["write_local_db",0,i],23761),a.s(["read_db",0,k],4813)},23750,a=>{"use strict";a.s(["collect_known_tags",0,function(a){let b=new Set;for(let c of a.sheets)for(let a of c.entries)for(let c of a.tags){let a=c.trim();a.length>0&&b.add(a)}return[...b].sort((a,b)=>a.localeCompare(b))}])},26758,a=>{a.v("/_next/static/media/favicon.0x3dzn~oxb6tn.ico"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},38872,a=>{"use strict";let b={src:a.i(26758).default,width:256,height:256};a.s(["default",0,b])},28157,a=>{"use strict";a.s(["PomodoroSettingsView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call PomodoroSettingsView() from the server but PomodoroSettingsView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/pomodoro-settings-view.tsx <module evaluation>","PomodoroSettingsView")},7372,a=>{"use strict";a.s(["PomodoroSettingsView",()=>b]);let b=(0,a.i(41445).registerClientReference)(function(){throw Error("Attempted to call PomodoroSettingsView() from the server but PomodoroSettingsView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/components/pomodoro-settings-view.tsx","PomodoroSettingsView")},17330,a=>{"use strict";a.i(28157);var b=a.i(7372);a.n(b)},47420,a=>{"use strict";var b=a.i(46193),c=a.i(17330),d=a.i(23750),e=a.i(4813);async function f(){let a=await (0,e.read_db)(),f=(0,d.collect_known_tags)(a);return(0,b.jsx)(c.PomodoroSettingsView,{known_tags:f})}a.s(["default",0,f])},93954,a=>{a.n(a.i(47420))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0~t0puh._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[85393,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/settings",label:"General",match:a=>"/settings"===a},{href:"/settings/display",label:"Display & layout",match:a=>a.startsWith("/settings/display")},{href:"/settings/goals",label:"Goals",match:a=>a.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:a=>a.startsWith("/settings/pomodoro")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:a=>a.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:a=>a.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:a=>a.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:a=>a.startsWith("/settings/tags")}];a.s(["SettingsNav",0,function(){let a=(0,d.usePathname)()??"/settings";return(0,b.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,b.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:e.map(d=>{let e=d.match(a);return(0,b.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,b.jsx)(c.default,{href:d.href,"aria-current":e?"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 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:d.label})},d.href)})})})}])},69749,a=>{"use strict";a.s(["get_input_class_name",0,function(a="default"){let b="box-border max-w-full min-w-0 w-full rounded-[0.65rem] border border-panel-border bg-input-bg px-3 py-2.5 font-inherit text-inherit transition-[background-color,border-color] duration-200 focus:border-input-focus-border focus:outline-none";return"compact"===a?`${b} px-2.5 py-2`:b}])},56924,a=>{"use strict";a.s(["normalize_stored_tag",0,function(a){let b=a.trim().replace(/^@+/,"");if(0===b.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(b))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${b}`}])},30354,48174,a=>{"use strict";var b=a.i(39752),c=a.i(34542);function d(a){return a.startsWith("@")?a:`@${a}`}a.s(["format_display_tag",0,d],48174);var e=a.i(69749),f=a.i(56924);a.s(["TagAutocompleteInput",0,function({id:a,value:g,known_tags:h,placeholder:i,disabled:j=!1,autoFocus:k=!1,on_change:l}){let m=(0,c.useRef)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null),[p,q]=(0,c.useState)(0),[r,s]=(0,c.useState)(0),t=function(a,b){let c=a.slice(0,b),d=c.lastIndexOf("@");if(-1===d)return null;let e=c.slice(d+1);return/\s/.test(e)?null:{query:e,start_index:d,end_index:b}}(g,p),u=null===t?[]:function(a,b,c=10){let d=b.toLowerCase();return a.filter(a=>{let b=a.replace(/^@/,"").toLowerCase();return 0===d.length||b.startsWith(d)}).slice(0,c)}(h,t.query),v=null!==t&&function(a,b){if(!/^\w+$/.test(a))return!1;let c=a.toLowerCase();return b.some(a=>{try{return(0,f.normalize_stored_tag)(a).slice(1).toLowerCase()===c}catch{return!1}})}(t.query,h),w=null!==t&&u.length>0&&!v&&!j;(0,c.useLayoutEffect)(()=>{null!==o.current&&null!==m.current&&(m.current.setSelectionRange(o.current,o.current),q(o.current),o.current=null)},[g]),(0,c.useEffect)(()=>{s(0)},[g,p,u.length]);let x=()=>{q(m.current?.selectionStart??g.length)},y=()=>{s(0)},z=a=>{let b,c,e;if(null===t)return;let{next_text:f,next_cursor:h}=(b=d(a),c=g.slice(0,t.start_index),e=g.slice(t.end_index),{next_text:`${c}${b}${e}`,next_cursor:c.length+b.length});o.current=h,l(f),y()};return(0,b.jsxs)("div",{className:"relative min-w-0",children:[(0,b.jsx)("input",{ref:m,id:a,type:"text",className:(0,e.get_input_class_name)(),value:g,placeholder:i,disabled:j,autoFocus:k,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${a}-tag-suggestions`:void 0,onChange:a=>{l(a.target.value),q(a.target.selectionStart??a.target.value.length)},onClick:x,onKeyUp:x,onKeyDown:a=>{if(w){if("ArrowDown"===a.key){a.preventDefault(),s(a=>(a+1)%u.length);return}if("ArrowUp"===a.key){a.preventDefault(),s(a=>(a-1+u.length)%u.length);return}if("Enter"===a.key||"Tab"===a.key){a.preventDefault();let b=u[r];void 0!==b&&z(b);return}"Escape"===a.key&&(a.preventDefault(),y())}},onBlur:()=>{window.setTimeout(y,120)}}),w?(0,b.jsx)("ul",{ref:n,id:`${a}-tag-suggestions`,role:"listbox",className:"absolute left-0 right-0 top-full z-20 mt-1 max-h-48 list-none overflow-y-auto rounded-md border border-panel-border bg-panel p-1.5 shadow-md",children:u.map((a,c)=>(0,b.jsx)("li",{role:"option","aria-selected":c===r,children:(0,b.jsx)("button",{type:"button",className:`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 hover:bg-surface-hover ${c===r?"bg-surface-hover":""}`,onMouseDown:b=>{b.preventDefault(),z(a)},children:d(a)})},a))}):null]})}],30354)},59659,5796,a=>{"use strict";var b=a.i(87281);function c(){}function d(){(0,b.is_greedy_cloud_sync_enabled)()&&c()}a.i(63577),a.i(51652),a.i(74365),Promise.resolve(),a.s(["schedule_tracker_db_cloud_sync",0,d],5796),a.s(["push_tracker_db_cloud_after_change",0,function(){(0,b.is_greedy_cloud_sync_enabled)()?d():c()}],59659)},85930,a=>{"use strict";var b=a.i(39752),c=a.i(85393),d=a.i(98790);a.s(["SettingsPageLayout",0,function({breadcrumb:a,title:e,description:f,children:g}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.TrackerTopbar,{breadcrumb:a}),(0,b.jsxs)("main",{className:"mx-auto grid w-full max-w-[1120px] grid-cols-[minmax(12rem,16rem)_minmax(0,1fr)] gap-4 px-4 pb-10 pt-5 sm:gap-6 sm:px-5 sm:pt-6 max-[860px]:grid-cols-1",children:[(0,b.jsxs)("aside",{className:"flex flex-col gap-2",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Settings"}),(0,b.jsx)(c.SettingsNav,{})]}),(0,b.jsxs)("section",{className:"flex min-w-0 flex-col gap-4",children:[(0,b.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,b.jsx)("h1",{className:"m-0 text-[1.35rem] font-[650] tracking-tight",children:e}),void 0!==f?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:f}):null]}),g]})]})]})}])},53372,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(53030),e=a.i(85930),f=a.i(30354),g=a.i(48174),h=a.i(89969),i=a.i(69749);function j(a,b,c){let d=a.map(a=>(0,g.format_display_tag)(a)).join(", "),e=(0,g.format_display_tag)(b),f=1===c?"1 entry will be updated.":`${c} entries will be updated.`;return{title:"Merge tags?",message:`Merge ${d} into ${e}? ${f}`,confirmLabel:"Merge tags",variant:"danger"}}var k=a.i(59659);a.s(["TagManagementView",0,function({initial_tags:a}){let{confirm:l}=(0,d.use_confirm_dialog)(),[m,n]=(0,c.useState)(a),[o,p]=(0,c.useState)(()=>new Set),[q,r]=(0,c.useState)({}),[s,t]=(0,c.useState)(""),[u,v]=(0,c.useState)(null),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!1),A=(0,c.useMemo)(()=>m.map(a=>a.name),[m]),B=m.filter(a=>o.has(a.name)).reduce((a,b)=>a+b.entryCount,0),C=async a=>{let b=await fetch("/api/tags",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!b.ok)throw Error((await b.json()).error??"Tag update failed");let c=await b.json();n(c.tags),p(new Set),x(1===c.entries_updated?"Updated 1 entry.":`Updated ${c.entries_updated} entries.`),(0,k.push_tracker_db_cloud_after_change)()},D=async a=>{let b=q[a]?.trim()??"";if(0===b.length)return void v("Enter a new tag name.");let c=m.find(b=>b.name===a);if(void 0===c)return;let d=m.find(a=>(0,g.format_display_tag)(a.name)===(0,g.format_display_tag)(b)),e=void 0!==d&&d.name!==a?c.entryCount+d.entryCount:c.entryCount;if(await l(j([a],b,e))){z(!0),v(null),x(null);try{await C({action:"rename",fromTag:a,toTag:b}),r(b=>{let c={...b};return delete c[a],c})}catch(a){v(a instanceof Error?a.message:String(a))}finally{z(!1)}}},E=async()=>{let a=[...o];if(a.length<2)return void v("Select at least two tags to merge.");if(0===s.trim().length)return void v("Enter a target tag for the merge.");if(await l(j(a,s,B))){z(!0),v(null),x(null);try{await C({action:"merge",sourceTags:a,targetTag:s}),t("")}catch(a){v(a instanceof Error?a.message:String(a))}finally{z(!1)}}};return(0,b.jsxs)(e.SettingsPageLayout,{breadcrumb:{current:"Tag management",parent:{label:"Settings",href:"/settings"}},title:"Tag management",description:"Rename or merge tags across every entry in your database.",children:[(0,b.jsxs)("section",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Merge tags"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.8rem] leading-snug text-muted",children:"Select two or more tags below, then choose the tag they should become."}),(0,b.jsxs)("label",{className:"mt-3 flex flex-col gap-1 text-[0.82rem] text-muted",children:["Target tag",(0,b.jsx)(f.TagAutocompleteInput,{id:"merge-target-tag",value:s,known_tags:A,placeholder:"e.g. @project",disabled:y,on_change:t})]}),(0,b.jsxs)("button",{type:"button",className:`${(0,h.get_button_class_name)("primary","small")} mt-3`,disabled:y||o.size<2,onClick:()=>void E(),children:["Merge ",o.size," tags"]})]}),0===m.length?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"No tags yet. Add @tags when you check in to an entry."}):(0,b.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Tags",children:m.map(a=>(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-2.5 shadow-sm",children:(0,b.jsxs)("form",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",onSubmit:b=>{b.preventDefault(),D(a.name)},children:[(0,b.jsx)("input",{type:"checkbox",className:"shrink-0",checked:o.has(a.name),disabled:y,"aria-label":`Select ${(0,g.format_display_tag)(a.name)}`,onChange:()=>{var b;return b=a.name,void p(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}}),(0,b.jsxs)("div",{className:"flex min-w-0 shrink-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[(0,b.jsx)("span",{className:"font-semibold leading-tight",children:(0,g.format_display_tag)(a.name)}),(0,b.jsxs)("span",{className:"text-[0.82rem] text-muted",children:[a.entryCount," ",1===a.entryCount?"entry":"entries"]})]}),(0,b.jsxs)("div",{className:"ml-auto flex min-w-[min(100%,14rem)] flex-1 basis-56 items-center justify-end gap-2 sm:max-w-xs",children:[(0,b.jsx)("input",{className:(0,i.get_input_class_name)("compact"),value:q[a.name]??"",placeholder:"Rename to…","aria-label":`Rename ${(0,g.format_display_tag)(a.name)}`,disabled:y,onChange:b=>r(c=>({...c,[a.name]:b.target.value}))}),(0,b.jsx)("button",{type:"submit",className:`${(0,h.get_button_class_name)("ghost","small")} shrink-0`,disabled:y||(q[a.name]?.trim().length??0)===0,children:"Rename"})]})]})},a.name))}),null!==w?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] text-accent",children:w}):null,null!==u?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] text-danger",children:u}):null]})}],53372)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_08iak5j._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[69749,a=>{"use strict";a.s(["get_input_class_name",0,function(a="default"){let b="box-border max-w-full min-w-0 w-full rounded-[0.65rem] border border-panel-border bg-input-bg px-3 py-2.5 font-inherit text-inherit transition-[background-color,border-color] duration-200 focus:border-input-focus-border focus:outline-none";return"compact"===a?`${b} px-2.5 py-2`:b}])},85393,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/settings",label:"General",match:a=>"/settings"===a},{href:"/settings/display",label:"Display & layout",match:a=>a.startsWith("/settings/display")},{href:"/settings/goals",label:"Goals",match:a=>a.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:a=>a.startsWith("/settings/pomodoro")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:a=>a.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:a=>a.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:a=>a.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:a=>a.startsWith("/settings/tags")}];a.s(["SettingsNav",0,function(){let a=(0,d.usePathname)()??"/settings";return(0,b.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,b.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:e.map(d=>{let e=d.match(a);return(0,b.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,b.jsx)(c.default,{href:d.href,"aria-current":e?"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 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:d.label})},d.href)})})})}])},57077,a=>{"use strict";var b=a.i(7048);a.s(["persist_ui_preference",0,function(a,c){a.read()!==c&&(a.write(c),a.notify(),(0,b.notify_settings_saved)())}])},19702,a=>{"use strict";a.s(["ACTIVE_SHEET_COOKIE_NAME",0,"stt-active-sheet","ACTIVE_SHEET_STORAGE_KEY",0,"super-time-tracker-active-sheet","COMPACT_LISTS_STORAGE_KEY",0,"super-time-tracker-compact-lists","DEFAULT_SHEET_FIXED_NAME_COOKIE_NAME",0,"stt-default-sheet-fixed-name","DEFAULT_SHEET_FIXED_NAME_STORAGE_KEY",0,"super-time-tracker-default-sheet-fixed-name","DEFAULT_SHEET_SESSION_MODE_COOKIE_NAME",0,"stt-default-sheet-session-mode","DEFAULT_SHEET_SESSION_MODE_DEFAULT",0,"last_viewed","DEFAULT_SHEET_SESSION_MODE_STORAGE_KEY",0,"super-time-tracker-default-sheet-session-mode","SHEET_TAG_FILTERS_STORAGE_KEY",0,"super-time-tracker-sheet-tag-filters"])},30004,a=>{"use strict";var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.DEBUG_LOGGING_STORAGE_KEY,default_value:c.DEBUG_LOGGING_DEFAULT,is_valid:a=>"true"===a||"false"===a});a.s(["debug_logging_preference",0,d])},73271,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(35822),e=a.i(57077);a.s(["ClearTagFiltersOnSheetChangeSetting",0,function(){let a=(0,c.useSyncExternalStore)(d.clear_tag_filters_on_sheet_change_preference.subscribe,d.clear_tag_filters_on_sheet_change_preference.get_snapshot,d.clear_tag_filters_on_sheet_change_preference.get_server_snapshot);return(0,b.jsxs)("label",{className:"flex w-full cursor-pointer items-center gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",className:"shrink-0",checked:"true"===a,onChange:a=>{var b;return b=a.target.checked,void(0,e.persist_ui_preference)(d.clear_tag_filters_on_sheet_change_preference,b?"true":"false")}}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Clear tag filters on sheet change"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Remove tag filters when you switch to another sheet."})]})]})}])},80587,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(40947),e=a.i(57077);a.s(["ConfirmBeforeCheckoutSetting",0,function(){let a=(0,c.useSyncExternalStore)(d.confirm_before_checkout_preference.subscribe,d.confirm_before_checkout_preference.get_snapshot,d.confirm_before_checkout_preference.get_server_snapshot);return(0,b.jsxs)("label",{className:"flex w-full cursor-pointer items-center gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",className:"shrink-0",checked:"true"===a,onChange:a=>{var b;return b=a.target.checked,void(0,e.persist_ui_preference)(d.confirm_before_checkout_preference,b?"true":"false")}}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Confirm before checkout"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Show a confirmation dialog when you stop the active timer."})]})]})}])},89365,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(32297),e=a.i(57077);a.s(["ConfirmDestructiveActionsSetting",0,function(){let a=(0,c.useSyncExternalStore)(d.confirm_destructive_actions_preference.subscribe,d.confirm_destructive_actions_preference.get_snapshot,d.confirm_destructive_actions_preference.get_server_snapshot);return(0,b.jsxs)("label",{className:"flex w-full cursor-pointer items-center gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",className:"shrink-0",checked:"true"===a,onChange:a=>{var b;return b=a.target.checked,void(0,e.persist_ui_preference)(d.confirm_destructive_actions_preference,b?"true":"false")}}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Confirm destructive actions"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Ask before deleting entries or sheets. Turn off for fast mode."})]})]})}])},68682,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(30004),e=a.i(57077);a.s(["DebugLoggingSetting",0,function(){let a=(0,c.useSyncExternalStore)(d.debug_logging_preference.subscribe,d.debug_logging_preference.get_snapshot,d.debug_logging_preference.get_server_snapshot);return(0,b.jsxs)("label",{className:"flex w-full cursor-pointer items-center gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",className:"shrink-0",checked:"true"===a,onChange:a=>{var b;return b=a.target.checked,void(0,e.persist_ui_preference)(d.debug_logging_preference,b?"true":"false")}}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Debug logging"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Log outgoing AI suggestion queries in the console for troubleshooting."})]})]})}])},46914,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(69749),e=a.i(19702);function f(a){return"last_viewed"===a||"active_timer"===a||"fixed"===a?a:e.DEFAULT_SHEET_SESSION_MODE_DEFAULT}var g=a.i(7048),h=a.i(72958);function i(a){let b=a.trim();if(0!==b.length){try{window.localStorage.setItem(e.DEFAULT_SHEET_FIXED_NAME_STORAGE_KEY,b),(0,h.schedule_ui_preferences_cloud_sync)()}catch{}try{let a=encodeURIComponent(b);document.cookie=`${e.DEFAULT_SHEET_FIXED_NAME_COOKIE_NAME}=${a}; Path=/; Max-Age=31536000; SameSite=Lax`}catch{}}}let j=[{value:"last_viewed",label:"Last viewed",description:"Open the sheet you were viewing when you last used the tracker."},{value:"active_timer",label:"Sheet with active timer",description:"Open the sheet that has a running timer, when one exists."},{value:"fixed",label:"Specific sheet",description:"Always open a chosen sheet when you start a new session."}];a.s(["DefaultSheetSessionSetting",0,function({sheet_names:a}){let[k,l]=(0,c.useState)("last_viewed"),[m,n]=(0,c.useState)("");return(0,c.useEffect)(()=>{l(function(){try{let a=window.localStorage.getItem(e.DEFAULT_SHEET_SESSION_MODE_STORAGE_KEY);return f(a)}catch{return f(null)}}());let b=function(){try{let a=window.localStorage.getItem(e.DEFAULT_SHEET_FIXED_NAME_STORAGE_KEY)?.trim()??"";return a.length>0?a:null}catch{return null}}(),c=a[0]??"";n(b??c)},[a]),(0,b.jsxs)("fieldset",{className:"m-0 flex w-full flex-col gap-3 border-0 p-0",children:[(0,b.jsx)("legend",{className:"mb-2 text-[0.95rem] font-semibold",children:"Default sheet on new session"}),(0,b.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:j.map(a=>(0,b.jsx)("li",{children:(0,b.jsxs)("label",{className:"flex w-full cursor-pointer items-start gap-2.5",children:[(0,b.jsx)("input",{type:"radio",name:"default-sheet-session-mode",className:"mt-0.5 shrink-0",checked:k===a.value,onChange:()=>(a=>{l(a);try{window.localStorage.setItem(e.DEFAULT_SHEET_SESSION_MODE_STORAGE_KEY,a),(0,h.schedule_ui_preferences_cloud_sync)()}catch{}try{document.cookie=`${e.DEFAULT_SHEET_SESSION_MODE_COOKIE_NAME}=${a}; Path=/; Max-Age=31536000; SameSite=Lax`}catch{}"fixed"===a&&m.length>0&&i(m),(0,g.notify_settings_saved)()})(a.value)}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-[0.9rem] font-semibold",children:a.label}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:a.description})]})]})},a.value))}),"fixed"===k?(0,b.jsxs)("label",{className:"flex flex-col gap-1 text-[0.82rem] text-muted",children:["Sheet",(0,b.jsx)("select",{className:(0,d.get_input_class_name)("compact"),value:m,disabled:0===a.length,onChange:a=>{var b;n(b=a.target.value),i(b),(0,g.notify_settings_saved)()},children:a.map(a=>(0,b.jsx)("option",{value:a,children:a},a))})]}):null]})}],46914)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_09-_33p._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[85393,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/settings",label:"General",match:a=>"/settings"===a},{href:"/settings/display",label:"Display & layout",match:a=>a.startsWith("/settings/display")},{href:"/settings/goals",label:"Goals",match:a=>a.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:a=>a.startsWith("/settings/pomodoro")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:a=>a.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:a=>a.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:a=>a.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:a=>a.startsWith("/settings/tags")}];a.s(["SettingsNav",0,function(){let a=(0,d.usePathname)()??"/settings";return(0,b.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,b.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:e.map(d=>{let e=d.match(a);return(0,b.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,b.jsx)(c.default,{href:d.href,"aria-current":e?"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 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:d.label})},d.href)})})})}])},57077,a=>{"use strict";var b=a.i(7048);a.s(["persist_ui_preference",0,function(a,c){a.read()!==c&&(a.write(c),a.notify(),(0,b.notify_settings_saved)())}])},50762,39744,13870,16777,18558,80805,9818,62082,a=>{"use strict";a.s(["parse_focus_goals_by_name",0,function(a){if(0===a.length)return{};try{let b=JSON.parse(a);if(null===b||"object"!=typeof b||Array.isArray(b))return{};let c={};for(let[a,d]of Object.entries(b)){if(null===d||"object"!=typeof d)continue;let b={};"string"==typeof d.daily&&d.daily.length>0&&(b.daily=d.daily),"string"==typeof d.weekly&&d.weekly.length>0&&(b.weekly=d.weekly),(void 0!==b.daily||void 0!==b.weekly)&&(c[a]=b)}return c}catch{return{}}}],50762);var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.DAILY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:c.DAILY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:a=>{if(!/^\d+$/.test(a))return!1;let b=Number.parseInt(a,10);return b>=30&&b<=720}});a.s(["daily_focus_target_minutes_preference",0,d],39744);let e=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOAL_SCOPE_STORAGE_KEY,default_value:c.FOCUS_GOAL_SCOPE_DEFAULT,is_valid:a=>"global"===a||"sheet"===a||"tag"===a});a.s(["focus_goal_scope_preference",0,e],13870);let f=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOAL_SHEET_NAME_STORAGE_KEY,default_value:c.FOCUS_GOAL_SHEET_NAME_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["focus_goal_sheet_name_preference",0,f],16777);let g=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOAL_TAG_NAME_STORAGE_KEY,default_value:c.FOCUS_GOAL_TAG_NAME_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["focus_goal_tag_name_preference",0,g],18558);let h=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOALS_PER_SHEET_STORAGE_KEY,default_value:c.FOCUS_GOALS_PER_SHEET_DEFAULT,is_valid:a=>{if(0===a.length)return!1;try{let b=JSON.parse(a);return null!==b&&"object"==typeof b&&!Array.isArray(b)}catch{return!1}}});a.s(["focus_goals_per_sheet_preference",0,h],80805);let i=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOALS_PER_TAG_STORAGE_KEY,default_value:c.FOCUS_GOALS_PER_TAG_DEFAULT,is_valid:a=>{if(0===a.length)return!1;try{let b=JSON.parse(a);return null!==b&&"object"==typeof b&&!Array.isArray(b)}catch{return!1}}});a.s(["focus_goals_per_tag_preference",0,i],9818);let j=(0,b.create_ui_preference_store)({storage_key:c.WEEKLY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:c.WEEKLY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:a=>{if(!/^\d+$/.test(a))return!1;let b=Number.parseInt(a,10);return b>=60&&b<=4200}});a.s(["weekly_focus_target_minutes_preference",0,j],62082)},38296,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(50762);function e(a,b,c,e){if(0===b.length)return a;let f=(0,d.parse_focus_goals_by_name)(a),g=f[b]??{};if(0===e.length){let a={...g};delete a[c],void 0===a.daily&&void 0===a.weekly?delete f[b]:f[b]=a}else f[b]={...g,[c]:e};return JSON.stringify(f)}var f=a.i(39744),g=a.i(13870),h=a.i(16777),i=a.i(18558),j=a.i(80805),k=a.i(9818),l=a.i(72327),m=a.i(40395),n=a.i(76121),o=a.i(22496),p=a.i(43329),q=a.i(62082),r=a.i(57077);let s=[120,180,240,300,360,420,480],t=[600,900,1200,1500,1800,2100,2400],u=[15,30,45,60,90,120],v=[6,8,10,12,14],w=[{value:"global",label:"Global"},{value:"sheet",label:"Per-sheet"},{value:"tag",label:"Per-tag"}];function x({disabled:a,daily_target_minutes:c,weekly_target_minutes:d}){return(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Global targets"}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[(0,b.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Daily target"}),(0,b.jsx)("select",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:c,disabled:a,onChange:a=>(0,r.persist_ui_preference)(f.daily_focus_target_minutes_preference,a.target.value),children:s.map(a=>(0,b.jsxs)("option",{value:String(a),children:[a," min"]},a))})]}),(0,b.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Weekly target"}),(0,b.jsx)("select",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:d,disabled:a,onChange:a=>(0,r.persist_ui_preference)(q.weekly_focus_target_minutes_preference,a.target.value),children:t.map(a=>(0,b.jsxs)("option",{value:String(a),children:[a," min"]},a))})]})]})]})}function y({kind:a,names:c,disabled:d,active_name:f,map:g,json:l}){let m="sheet"===a?"Per-sheet targets":"Per-tag targets";if(0===c.length)return(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:m}),(0,b.jsx)("p",{className:"m-0 text-[0.85rem] text-muted",children:"sheet"===a?"Create a sheet to configure per-sheet goals.":"Add a tag to a time entry to configure per-tag goals."})]});let n=`focus-goal-active-${a}`;return(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,b.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:m}),(0,b.jsxs)("span",{className:"text-[0.75rem] text-muted",children:["Pick the ",a," shown in the focus banner."]})]}),(0,b.jsx)("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(c=>{let m=g[c]??{},o=m.daily??"",p=m.weekly??"",q=f===c;return(0,b.jsxs)("li",{className:`grid items-center gap-2 rounded-md border bg-panel px-3 py-2.5 transition-colors md:grid-cols-[auto_minmax(0,1fr)_minmax(0,11rem)_minmax(0,11rem)] grid-cols-[auto_minmax(0,1fr)] ${q?"border-accent-border bg-accent-soft":"border-panel-border"}`,children:[(0,b.jsx)("label",{className:"flex shrink-0 cursor-pointer items-center justify-center",children:(0,b.jsx)("input",{type:"radio",name:n,className:"cursor-pointer",checked:q,disabled:d,"aria-label":`Show ${c} in focus banner`,onChange:()=>(0,r.persist_ui_preference)("sheet"===a?h.focus_goal_sheet_name_preference:i.focus_goal_tag_name_preference,c)})}),(0,b.jsx)("span",{className:"truncate text-[0.9rem] font-medium",title:c,children:"tag"!==a||c.startsWith("@")?c:`@${c}`}),(0,b.jsxs)("label",{className:"flex items-center gap-2 md:col-start-3",children:[(0,b.jsx)("span",{className:"text-[0.75rem] text-muted",children:"Daily"}),(0,b.jsxs)("select",{className:"flex-1 rounded-md border border-panel-border bg-panel px-2 py-1.5 text-[0.85rem]",value:o,disabled:d,onChange:b=>(0,r.persist_ui_preference)("sheet"===a?j.focus_goals_per_sheet_preference:k.focus_goals_per_tag_preference,e(l,c,"daily",b.target.value)),children:[(0,b.jsx)("option",{value:"",children:"Not set"}),s.map(a=>(0,b.jsxs)("option",{value:String(a),children:[a," min"]},a))]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 md:col-start-4",children:[(0,b.jsx)("span",{className:"text-[0.75rem] text-muted",children:"Weekly"}),(0,b.jsxs)("select",{className:"flex-1 rounded-md border border-panel-border bg-panel px-2 py-1.5 text-[0.85rem]",value:p,disabled:d,onChange:b=>(0,r.persist_ui_preference)("sheet"===a?j.focus_goals_per_sheet_preference:k.focus_goals_per_tag_preference,e(l,c,"weekly",b.target.value)),children:[(0,b.jsx)("option",{value:"",children:"Not set"}),t.map(a=>(0,b.jsxs)("option",{value:String(a),children:[a," min"]},a))]})]})]},c)})})]})}a.s(["FocusGoalsNudgesSetting",0,function({sheet_names:a,tag_names:e}){let s=(0,c.useSyncExternalStore)(l.focus_nudges_enabled_preference.subscribe,l.focus_nudges_enabled_preference.get_snapshot,l.focus_nudges_enabled_preference.get_server_snapshot),t=(0,c.useSyncExternalStore)(f.daily_focus_target_minutes_preference.subscribe,f.daily_focus_target_minutes_preference.get_snapshot,f.daily_focus_target_minutes_preference.get_server_snapshot),z=(0,c.useSyncExternalStore)(q.weekly_focus_target_minutes_preference.subscribe,q.weekly_focus_target_minutes_preference.get_snapshot,q.weekly_focus_target_minutes_preference.get_server_snapshot),A=(0,c.useSyncExternalStore)(m.no_log_reminder_minutes_preference.subscribe,m.no_log_reminder_minutes_preference.get_snapshot,m.no_log_reminder_minutes_preference.get_server_snapshot),B=(0,c.useSyncExternalStore)(n.overwork_alert_hours_preference.subscribe,n.overwork_alert_hours_preference.get_snapshot,n.overwork_alert_hours_preference.get_server_snapshot),C=(0,c.useSyncExternalStore)(p.work_hours_start_preference.subscribe,p.work_hours_start_preference.get_snapshot,p.work_hours_start_preference.get_server_snapshot),D=(0,c.useSyncExternalStore)(o.work_hours_end_preference.subscribe,o.work_hours_end_preference.get_snapshot,o.work_hours_end_preference.get_server_snapshot),E=(0,c.useSyncExternalStore)(g.focus_goal_scope_preference.subscribe,g.focus_goal_scope_preference.get_snapshot,g.focus_goal_scope_preference.get_server_snapshot),F=(0,c.useSyncExternalStore)(h.focus_goal_sheet_name_preference.subscribe,h.focus_goal_sheet_name_preference.get_snapshot,h.focus_goal_sheet_name_preference.get_server_snapshot),G=(0,c.useSyncExternalStore)(i.focus_goal_tag_name_preference.subscribe,i.focus_goal_tag_name_preference.get_snapshot,i.focus_goal_tag_name_preference.get_server_snapshot),H=(0,c.useSyncExternalStore)(j.focus_goals_per_sheet_preference.subscribe,j.focus_goals_per_sheet_preference.get_snapshot,j.focus_goals_per_sheet_preference.get_server_snapshot),I=(0,c.useSyncExternalStore)(k.focus_goals_per_tag_preference.subscribe,k.focus_goals_per_tag_preference.get_snapshot,k.focus_goals_per_tag_preference.get_server_snapshot),J=(0,d.parse_focus_goals_by_name)(H),K=(0,d.parse_focus_goals_by_name)(I);(0,c.useEffect)(()=>{"sheet"===E&&0===F.length&&a.length>0&&(0,r.persist_ui_preference)(h.focus_goal_sheet_name_preference,a[0])},[E,F,a]),(0,c.useEffect)(()=>{"tag"===E&&0===G.length&&e.length>0&&(0,r.persist_ui_preference)(i.focus_goal_tag_name_preference,e[0])},[E,G,e]);let L="true"!==s;return(0,b.jsxs)("div",{id:"focus-goals-nudges",className:"flex w-full flex-col gap-4",children:[(0,b.jsxs)("label",{className:"flex w-full cursor-pointer items-center gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",className:"shrink-0",checked:"true"===s,onChange:a=>(0,r.persist_ui_preference)(l.focus_nudges_enabled_preference,a.target.checked?"true":"false")}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Goals + nudges"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Track daily/weekly focus goals, overwork alerts, and no-log reminders."})]})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Focus goal scope"}),(0,b.jsx)("div",{role:"radiogroup","aria-label":"Focus goal scope",className:"inline-flex w-full flex-wrap gap-1 rounded-md border border-panel-border bg-panel p-0.5",children:w.map(a=>{let c=E===a.value;return(0,b.jsx)("button",{type:"button",role:"radio","aria-checked":c,disabled:L,className:`flex-1 min-w-24 cursor-pointer rounded px-3 py-1.5 text-[0.85rem] font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-55 ${c?"bg-accent-soft text-foreground":"bg-transparent text-muted hover:bg-surface-hover hover:text-foreground"}`,onClick:()=>(0,r.persist_ui_preference)(g.focus_goal_scope_preference,a.value),children:a.label},a.value)})})]}),"global"===E?(0,b.jsx)(x,{disabled:L,daily_target_minutes:t,weekly_target_minutes:z}):null,"sheet"===E?(0,b.jsx)(y,{kind:"sheet",names:a,disabled:L,active_name:F,map:J,json:H}):null,"tag"===E?(0,b.jsx)(y,{kind:"tag",names:e,disabled:L,active_name:G,map:K,json:I}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Behavior nudges"}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[(0,b.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Work hours start"}),(0,b.jsx)("input",{type:"time",className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:C,disabled:L,onChange:a=>(0,r.persist_ui_preference)(p.work_hours_start_preference,a.target.value)})]}),(0,b.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Work hours end"}),(0,b.jsx)("input",{type:"time",className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:D,disabled:L,onChange:a=>(0,r.persist_ui_preference)(o.work_hours_end_preference,a.target.value)})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[(0,b.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:"No-log reminder"}),(0,b.jsx)("select",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:A,disabled:L,onChange:a=>(0,r.persist_ui_preference)(m.no_log_reminder_minutes_preference,a.target.value),children:u.map(a=>(0,b.jsxs)("option",{value:String(a),children:[a," min"]},a))})]}),(0,b.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:"Overwork alert"}),(0,b.jsx)("select",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-2 text-[0.85rem]",value:B,disabled:L,onChange:a=>(0,r.persist_ui_preference)(n.overwork_alert_hours_preference,a.target.value),children:v.map(a=>(0,b.jsxs)("option",{value:String(a),children:[a," hours"]},a))})]})]}),(0,b.jsx)("p",{className:"m-0 text-[0.78rem] leading-snug text-muted",children:"Rule reminders: notify when no active timer during work hours, and alert when an active timer runs longer than the overwork threshold."})]})]})}],38296)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0a899fn._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[69749,a=>{"use strict";a.s(["get_input_class_name",0,function(a="default"){let b="box-border max-w-full min-w-0 w-full rounded-[0.65rem] border border-panel-border bg-input-bg px-3 py-2.5 font-inherit text-inherit transition-[background-color,border-color] duration-200 focus:border-input-focus-border focus:outline-none";return"compact"===a?`${b} px-2.5 py-2`:b}])},85393,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/settings",label:"General",match:a=>"/settings"===a},{href:"/settings/display",label:"Display & layout",match:a=>a.startsWith("/settings/display")},{href:"/settings/goals",label:"Goals",match:a=>a.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:a=>a.startsWith("/settings/pomodoro")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:a=>a.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:a=>a.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:a=>a.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:a=>a.startsWith("/settings/tags")}];a.s(["SettingsNav",0,function(){let a=(0,d.usePathname)()??"/settings";return(0,b.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,b.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:e.map(d=>{let e=d.match(a);return(0,b.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,b.jsx)(c.default,{href:d.href,"aria-current":e?"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 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:d.label})},d.href)})})})}])},57077,a=>{"use strict";var b=a.i(7048);a.s(["persist_ui_preference",0,function(a,c){a.read()!==c&&(a.write(c),a.notify(),(0,b.notify_settings_saved)())}])},85930,a=>{"use strict";var b=a.i(39752),c=a.i(85393),d=a.i(98790);a.s(["SettingsPageLayout",0,function({breadcrumb:a,title:e,description:f,children:g}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.TrackerTopbar,{breadcrumb:a}),(0,b.jsxs)("main",{className:"mx-auto grid w-full max-w-[1120px] grid-cols-[minmax(12rem,16rem)_minmax(0,1fr)] gap-4 px-4 pb-10 pt-5 sm:gap-6 sm:px-5 sm:pt-6 max-[860px]:grid-cols-1",children:[(0,b.jsxs)("aside",{className:"flex flex-col gap-2",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Settings"}),(0,b.jsx)(c.SettingsNav,{})]}),(0,b.jsxs)("section",{className:"flex min-w-0 flex-col gap-4",children:[(0,b.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,b.jsx)("h1",{className:"m-0 text-[1.35rem] font-[650] tracking-tight",children:e}),void 0!==f?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:f}):null]}),g]})]})]})}])},98831,40420,6962,45273,a=>{"use strict";var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.CLAUDE_API_KEY_STORAGE_KEY,default_value:c.CLAUDE_API_KEY_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["claude_api_key_preference",0,d],98831);let e=(0,b.create_ui_preference_store)({storage_key:c.ENTRY_SUGGESTION_PROVIDER_STORAGE_KEY,default_value:c.ENTRY_SUGGESTION_PROVIDER_DEFAULT,is_valid:a=>"none"===a||"openai"===a||"claude"===a||"google_ai"===a});a.s(["entry_suggestion_provider_preference",0,e],40420);let f=(0,b.create_ui_preference_store)({storage_key:c.GOOGLE_AI_API_KEY_STORAGE_KEY,default_value:c.GOOGLE_AI_API_KEY_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["google_ai_api_key_preference",0,f],6962);let g=(0,b.create_ui_preference_store)({storage_key:c.OPENAI_API_KEY_STORAGE_KEY,default_value:c.OPENAI_API_KEY_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["openai_api_key_preference",0,g],45273)},27623,a=>{"use strict";var b=a.i(39752);a.s(["SettingRadioGroup",0,function({name:a,legend:c,description:d,value:e,options:f,disabled:g=!1,on_change:h}){var i;return(0,b.jsxs)("fieldset",{className:"m-0 border-0 p-0",children:[(0,b.jsx)("legend",{className:"m-0 mb-1 text-[0.95rem] font-semibold",children:c}),void 0!==d?(0,b.jsx)("p",{className:"m-0 mb-2 text-[0.8rem] leading-snug text-muted",children:d}):null,(0,b.jsx)("div",{className:(i=f.length)<=2||i<=4?"grid grid-cols-1 gap-1.5 sm:grid-cols-2":"grid grid-cols-1 gap-1.5 sm:grid-cols-2 lg:grid-cols-3",children:f.map(c=>{let d=c.value===e;return(0,b.jsxs)("label",{className:`flex h-full cursor-pointer flex-col gap-2 rounded-md border px-2.5 py-2 transition-colors duration-150 ${d?"border-accent-border bg-accent-soft":"border-panel-border hover:bg-surface-hover"}`,children:[(0,b.jsxs)("span",{className:"flex items-start gap-2",children:[(0,b.jsx)("input",{type:"radio",className:"mt-0.5 shrink-0",name:a,value:c.value,checked:d,disabled:g,onChange:()=>h(c.value)}),(0,b.jsx)("span",{className:"text-[0.9rem] font-semibold leading-snug",children:c.label})]}),void 0!==c.description?(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:c.description}):null]},c.value)})})]})}],27623)},56280,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(27623),e=a.i(85930),f=a.i(69749),g=a.i(98831),h=a.i(40420),i=a.i(6962),j=a.i(45273),k=a.i(57077);let l=[{value:"none",label:"Disabled",description:"Do not call any AI provider."},{value:"openai",label:"OpenAI",description:"Use OpenAI for suggestions."},{value:"claude",label:"Claude",description:"Use Claude for suggestions."},{value:"google_ai",label:"Google AI",description:"Use Gemini for suggestions."}],m=a=>{(0,k.persist_ui_preference)(h.entry_suggestion_provider_preference,a)};a.s(["EntrySuggestionsSettingsView",0,function(){let a=(0,c.useSyncExternalStore)(h.entry_suggestion_provider_preference.subscribe,h.entry_suggestion_provider_preference.get_snapshot,h.entry_suggestion_provider_preference.get_server_snapshot),k=(0,c.useSyncExternalStore)(j.openai_api_key_preference.subscribe,j.openai_api_key_preference.get_snapshot,j.openai_api_key_preference.get_server_snapshot),n=(0,c.useSyncExternalStore)(g.claude_api_key_preference.subscribe,g.claude_api_key_preference.get_snapshot,g.claude_api_key_preference.get_server_snapshot),o=(0,c.useSyncExternalStore)(i.google_ai_api_key_preference.subscribe,i.google_ai_api_key_preference.get_snapshot,i.google_ai_api_key_preference.get_server_snapshot);return(0,b.jsx)(e.SettingsPageLayout,{breadcrumb:{current:"AI suggestions",parent:{label:"Settings",href:"/settings"}},title:"AI suggestions",description:"Choose an LLM provider and API key for entry description suggestions.",children:(0,b.jsxs)("ul",{className:"m-0 flex w-full list-none flex-col gap-2 p-0","aria-label":"AI suggestion settings",children:[(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,b.jsx)(d.SettingRadioGroup,{name:"entry-suggestion-provider",legend:"Suggestion provider",description:"The check-in form uses this provider when Suggest is clicked.",value:a,options:l,on_change:m})}),(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,b.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"OpenAI API key"}),(0,b.jsx)("input",{type:"password",className:(0,f.get_input_class_name)(),value:k,onChange:a=>{var b;return b=a.target.value,void(j.openai_api_key_preference.write(b.trim()),j.openai_api_key_preference.notify())},placeholder:"sk-...",autoComplete:"off"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Stored locally in your browser. Used only for suggestion requests."})]})}),(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,b.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Claude API key"}),(0,b.jsx)("input",{type:"password",className:(0,f.get_input_class_name)(),value:n,onChange:a=>{var b;return b=a.target.value,void(g.claude_api_key_preference.write(b.trim()),g.claude_api_key_preference.notify())},placeholder:"sk-ant-...",autoComplete:"off"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Stored locally in your browser. Used only for suggestion requests."})]})}),(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,b.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Google AI API key"}),(0,b.jsx)("input",{type:"password",className:(0,f.get_input_class_name)(),value:o,onChange:a=>{var b;return b=a.target.value,void(i.google_ai_api_key_preference.write(b.trim()),i.google_ai_api_key_preference.notify())},placeholder:"AIza...",autoComplete:"off"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Stored locally in your browser. Used only for suggestion requests."})]})})]})})}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0ceu~9f._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[69749,a=>{"use strict";a.s(["get_input_class_name",0,function(a="default"){let b="box-border max-w-full min-w-0 w-full rounded-[0.65rem] border border-panel-border bg-input-bg px-3 py-2.5 font-inherit text-inherit transition-[background-color,border-color] duration-200 focus:border-input-focus-border focus:outline-none";return"compact"===a?`${b} px-2.5 py-2`:b}])},56924,a=>{"use strict";a.s(["normalize_stored_tag",0,function(a){let b=a.trim().replace(/^@+/,"");if(0===b.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(b))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${b}`}])},30354,48174,a=>{"use strict";var b=a.i(39752),c=a.i(34542);function d(a){return a.startsWith("@")?a:`@${a}`}a.s(["format_display_tag",0,d],48174);var e=a.i(69749),f=a.i(56924);a.s(["TagAutocompleteInput",0,function({id:a,value:g,known_tags:h,placeholder:i,disabled:j=!1,autoFocus:k=!1,on_change:l}){let m=(0,c.useRef)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null),[p,q]=(0,c.useState)(0),[r,s]=(0,c.useState)(0),t=function(a,b){let c=a.slice(0,b),d=c.lastIndexOf("@");if(-1===d)return null;let e=c.slice(d+1);return/\s/.test(e)?null:{query:e,start_index:d,end_index:b}}(g,p),u=null===t?[]:function(a,b,c=10){let d=b.toLowerCase();return a.filter(a=>{let b=a.replace(/^@/,"").toLowerCase();return 0===d.length||b.startsWith(d)}).slice(0,c)}(h,t.query),v=null!==t&&function(a,b){if(!/^\w+$/.test(a))return!1;let c=a.toLowerCase();return b.some(a=>{try{return(0,f.normalize_stored_tag)(a).slice(1).toLowerCase()===c}catch{return!1}})}(t.query,h),w=null!==t&&u.length>0&&!v&&!j;(0,c.useLayoutEffect)(()=>{null!==o.current&&null!==m.current&&(m.current.setSelectionRange(o.current,o.current),q(o.current),o.current=null)},[g]),(0,c.useEffect)(()=>{s(0)},[g,p,u.length]);let x=()=>{q(m.current?.selectionStart??g.length)},y=()=>{s(0)},z=a=>{let b,c,e;if(null===t)return;let{next_text:f,next_cursor:h}=(b=d(a),c=g.slice(0,t.start_index),e=g.slice(t.end_index),{next_text:`${c}${b}${e}`,next_cursor:c.length+b.length});o.current=h,l(f),y()};return(0,b.jsxs)("div",{className:"relative min-w-0",children:[(0,b.jsx)("input",{ref:m,id:a,type:"text",className:(0,e.get_input_class_name)(),value:g,placeholder:i,disabled:j,autoFocus:k,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${a}-tag-suggestions`:void 0,onChange:a=>{l(a.target.value),q(a.target.selectionStart??a.target.value.length)},onClick:x,onKeyUp:x,onKeyDown:a=>{if(w){if("ArrowDown"===a.key){a.preventDefault(),s(a=>(a+1)%u.length);return}if("ArrowUp"===a.key){a.preventDefault(),s(a=>(a-1+u.length)%u.length);return}if("Enter"===a.key||"Tab"===a.key){a.preventDefault();let b=u[r];void 0!==b&&z(b);return}"Escape"===a.key&&(a.preventDefault(),y())}},onBlur:()=>{window.setTimeout(y,120)}}),w?(0,b.jsx)("ul",{ref:n,id:`${a}-tag-suggestions`,role:"listbox",className:"absolute left-0 right-0 top-full z-20 mt-1 max-h-48 list-none overflow-y-auto rounded-md border border-panel-border bg-panel p-1.5 shadow-md",children:u.map((a,c)=>(0,b.jsx)("li",{role:"option","aria-selected":c===r,children:(0,b.jsx)("button",{type:"button",className:`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 hover:bg-surface-hover ${c===r?"bg-surface-hover":""}`,onMouseDown:b=>{b.preventDefault(),z(a)},children:d(a)})},a))}):null]})}],30354)},59659,5796,a=>{"use strict";var b=a.i(87281);function c(){}function d(){(0,b.is_greedy_cloud_sync_enabled)()&&c()}a.i(63577),a.i(51652),a.i(74365),Promise.resolve(),a.s(["schedule_tracker_db_cloud_sync",0,d],5796),a.s(["push_tracker_db_cloud_after_change",0,function(){(0,b.is_greedy_cloud_sync_enabled)()?d():c()}],59659)},19702,a=>{"use strict";a.s(["ACTIVE_SHEET_COOKIE_NAME",0,"stt-active-sheet","ACTIVE_SHEET_STORAGE_KEY",0,"super-time-tracker-active-sheet","COMPACT_LISTS_STORAGE_KEY",0,"super-time-tracker-compact-lists","DEFAULT_SHEET_FIXED_NAME_COOKIE_NAME",0,"stt-default-sheet-fixed-name","DEFAULT_SHEET_FIXED_NAME_STORAGE_KEY",0,"super-time-tracker-default-sheet-fixed-name","DEFAULT_SHEET_SESSION_MODE_COOKIE_NAME",0,"stt-default-sheet-session-mode","DEFAULT_SHEET_SESSION_MODE_DEFAULT",0,"last_viewed","DEFAULT_SHEET_SESSION_MODE_STORAGE_KEY",0,"super-time-tracker-default-sheet-session-mode","SHEET_TAG_FILTERS_STORAGE_KEY",0,"super-time-tracker-sheet-tag-filters"])},30004,a=>{"use strict";var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.DEBUG_LOGGING_STORAGE_KEY,default_value:c.DEBUG_LOGGING_DEFAULT,is_valid:a=>"true"===a||"false"===a});a.s(["debug_logging_preference",0,d])},98831,40420,6962,45273,a=>{"use strict";var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.CLAUDE_API_KEY_STORAGE_KEY,default_value:c.CLAUDE_API_KEY_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["claude_api_key_preference",0,d],98831);let e=(0,b.create_ui_preference_store)({storage_key:c.ENTRY_SUGGESTION_PROVIDER_STORAGE_KEY,default_value:c.ENTRY_SUGGESTION_PROVIDER_DEFAULT,is_valid:a=>"none"===a||"openai"===a||"claude"===a||"google_ai"===a});a.s(["entry_suggestion_provider_preference",0,e],40420);let f=(0,b.create_ui_preference_store)({storage_key:c.GOOGLE_AI_API_KEY_STORAGE_KEY,default_value:c.GOOGLE_AI_API_KEY_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["google_ai_api_key_preference",0,f],6962);let g=(0,b.create_ui_preference_store)({storage_key:c.OPENAI_API_KEY_STORAGE_KEY,default_value:c.OPENAI_API_KEY_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["openai_api_key_preference",0,g],45273)},86663,a=>{"use strict";let b=new Set,c=[],d=null;function e(){return[]}a.s(["get_pinned_sheet_names_server_snapshot",0,function(){return c},"get_pinned_sheet_names_snapshot",0,function(){var a=e();if(0===a.length)return c;let b=a.join("\0");if(null!==d&&d.key===b)return d.snapshot;let f=Object.freeze([...a]);return d={key:b,snapshot:f},f},"read_pinned_sheet_names",0,e,"subscribe_pinned_sheet_names",0,function(a){return b.add(a),()=>{b.delete(a)}},"write_pinned_sheet_names",0,function(a){}])},14679,a=>{"use strict";var b=a.i(72958),c=a.i(19702);a.s(["navigate_to_tracker_sheet",0,function(a){let d=a.trim();if(0!==d.length){try{window.localStorage.setItem(c.ACTIVE_SHEET_STORAGE_KEY,d),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}try{let a=encodeURIComponent(d);document.cookie=`${c.ACTIVE_SHEET_COOKIE_NAME}=${a}; Path=/; Max-Age=31536000; SameSite=Lax`}catch{}}}],14679)},17603,a=>{"use strict";var b=a.i(86663);a.s(["toggle_pinned_sheet_name",0,function(a){let c=a.trim();if(0===c.length)return;let d=(0,b.read_pinned_sheet_names)(),e=d.indexOf(c);e>=0?(0,b.write_pinned_sheet_names)([...d.slice(0,e),...d.slice(e+1)]):(0,b.write_pinned_sheet_names)([...d,c])}])},85133,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508),e=a.i(34542),f=a.i(78509),g=a.i(76767),h=a.i(33664),i=a.i(86663);let j=[{value:"all",label:"All sheets"},{value:"pinned",label:"Pinned"}];function k({sheet_names:a,on_toggle_pin:c}){let d=(0,e.useSyncExternalStore)(h.today_scope_preference.subscribe,h.today_scope_preference.get_snapshot,h.today_scope_preference.get_server_snapshot),f=(0,e.useSyncExternalStore)(i.subscribe_pinned_sheet_names,i.get_pinned_sheet_names_snapshot,i.get_pinned_sheet_names_server_snapshot),g=new Set(f);return(0,b.jsxs)("div",{className:"flex w-full max-w-2xl flex-col gap-3",children:[(0,b.jsx)("div",{role:"group","aria-label":"Today scope",className:"flex flex-wrap gap-2",children:j.map(a=>{let c=d===a.value;return(0,b.jsx)("button",{type:"button",className:`cursor-pointer rounded-full border px-3 py-1.5 text-[0.85rem] font-semibold transition-colors duration-150 ${c?"border-accent bg-accent-soft text-foreground":"border-panel-border bg-panel text-muted hover:border-accent hover:text-foreground"}`,"aria-pressed":c,onClick:()=>{var b;return b=a.value,void(h.today_scope_preference.read()!==b&&(h.today_scope_preference.write(b),h.today_scope_preference.notify()))},children:a.label},a.value)})}),"pinned"===d?(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[0===f.length?(0,b.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,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-2 p-0","aria-label":"Pinned sheets",children:a.map(a=>{let d=g.has(a);return(0,b.jsx)("li",{children:(0,b.jsxs)("button",{type:"button",className:`cursor-pointer rounded-full border px-2.5 py-1 text-[0.8rem] font-medium transition-colors duration-150 ${d?"border-accent bg-accent-soft text-foreground":"border-panel-border bg-surface-raised text-muted hover:text-foreground"}`,"aria-pressed":d,onClick:()=>c(a),children:[d?"★ ":"☆ ",a]})},a)})})]}):null]})}var l=a.i(98790),m=a.i(73297),n=a.i(48174),o=a.i(85752),p=a.i(68225),q=a.i(14679),r=a.i(57377),s=a.i(115),t=a.i(17603),u=a.i(65162),v=a.i(20537);function w({entry:a,duration_format:d,time_format:e,show_sheet_name:f}){let h=(0,g.format_time)(a.start,e),i=null===a.end?"now":(0,g.format_time)(a.end,e);return(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-3 shadow-sm",children:(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[f?(0,b.jsx)("p",{className:"m-0 mb-1 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:a.sheetName}):null,(0,b.jsx)("p",{className:"m-0 text-[0.95rem] font-medium",children:a.description}),(0,b.jsxs)("p",{className:"m-0 mt-1 text-[0.8rem] text-muted",children:[h," → ",i]}),a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 mt-2 flex list-none flex-wrap gap-1.5 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,n.format_display_tag)(a)},a))}):null]}),(0,b.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[(0,b.jsx)("span",{className:"font-mono text-[0.9rem] font-semibold text-accent",children:(0,o.format_duration)(a.todayDurationMs,d)}),(0,b.jsx)(c.default,{href:"/",className:"text-[0.8rem] font-semibold text-accent no-underline hover:underline",onClick:()=>(0,q.navigate_to_tracker_sheet)(a.sheetName),children:"Open sheet"})]})]})})}a.s(["TodayFocusView",0,function({initial_data:a}){let c=(0,d.useRouter)(),g=(0,u.use_duration_format)(),j=(0,v.use_time_format)(),[n,q]=(0,e.useState)(a),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(!1);(0,e.useEffect)(()=>{q(a)},[a]);let B=(0,e.useSyncExternalStore)(h.today_scope_preference.subscribe,h.today_scope_preference.get_snapshot,h.today_scope_preference.get_server_snapshot),C=(0,e.useSyncExternalStore)(i.subscribe_pinned_sheet_names,i.get_pinned_sheet_names_snapshot,i.get_pinned_sheet_names_server_snapshot),D=(0,e.useMemo)(()=>"all"===B?null:new Set(C),[B,C]),E=(0,e.useMemo)(()=>null===D?n.runningEntries:n.runningEntries.filter(a=>D.has(a.sheetName)),[D,n.runningEntries]),F=(0,e.useMemo)(()=>{var a;return null===D?n.todayEntries:(a=n.todayEntries,a.filter(a=>D.has(a.sheetName)))},[D,n.todayEntries]),G=(0,e.useMemo)(()=>F.reduce((a,b)=>a+b.todayDurationMs,0),[F]),H=async a=>{A(!0),y(null);try{await a(),c.refresh()}catch(a){y(a instanceof Error?a.message:String(a))}finally{A(!1)}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.TrackerTopbar,{breadcrumb:{current:"Today"}}),(0,b.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,b.jsxs)("header",{className:"flex w-full flex-col gap-2 text-center",children:[(0,b.jsx)("h1",{className:"m-0 text-[1.5rem] font-[650] tracking-tight",children:"Today"}),(0,b.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:"Running timers and time logged today."})]}),null!==x?(0,b.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:x}):null,(0,b.jsx)(k,{sheet_names:n.sheetNames,on_toggle_pin:t.toggle_pinned_sheet_name}),(0,b.jsxs)("section",{className:"w-full rounded-md border border-panel-border bg-panel p-4 shadow-sm","aria-label":"Today total",children:[(0,b.jsxs)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:["Tracked today","pinned"===B?" (pinned)":""]}),(0,b.jsx)("p",{className:"m-0 mt-1 font-mono text-[1.75rem] font-semibold text-accent",children:(0,o.format_duration)(G,g)})]}),E.length>0?(0,b.jsxs)("section",{className:"flex w-full flex-col gap-3","aria-label":"Running timers",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Running"}),E.map(a=>(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel p-4 shadow-sm",children:[(0,b.jsx)("p",{className:"m-0 mb-2 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:a.sheetName}),(0,b.jsx)(f.ActiveEntryPanel,{entry:a,sheets:n.sheets,known_tags:n.knownTags,in_bar:!0,is_pending:z,on_check_out:b=>void H(async()=>{await (0,s.post_tracker_action)("/api/out",{sheetName:a.sheetName,...void 0!==b?{at:b}:{}}),(0,p.finish_running_pomodoro_timer)()}),on_delete:()=>void H(()=>(0,s.post_tracker_action)("/api/entry",{sheetName:a.sheetName,entryId:a.id})),on_edit:b=>void H(()=>{let c,d;return c=a.sheetName,d=a.id,(0,r.patch_tracker_action)("/api/entry",{sheetName:c,entryId:d,...b})}),on_move:b=>void H(()=>(0,s.post_tracker_action)("/api/entry/move",{sheetName:a.sheetName,entryId:a.id,targetSheetName:b})),on_add_note:(b,c)=>void H(()=>(0,s.post_tracker_action)("/api/note",{text:b,...void 0!==c?{at:c}:{},sheetName:a.sheetName,entryId:a.id})),on_edit_note:(b,c)=>void H(()=>(0,r.patch_tracker_action)("/api/note",{sheetName:a.sheetName,entryId:a.id,timestamp:b,text:c})),on_delete_note:b=>void H(()=>(0,m.delete_tracker_action)("/api/note",{sheetName:a.sheetName,entryId:a.id,timestamp:b}))})]},`${a.sheetName}-${a.id}`))]}):null,(0,b.jsxs)("section",{className:"flex w-full flex-col gap-3","aria-label":"Today's entries",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Today's entries"}),(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:0===F.length?"None":1===F.length?"1 entry":`${F.length} entries`})]}),0===F.length?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"pinned"===B&&0===C.length?"Pin at least one sheet to see today’s activity.":"No time logged today for the selected scope."}):(0,b.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:F.map(a=>(0,b.jsx)(w,{entry:a,duration_format:g,time_format:j,show_sheet_name:"all"===B||C.length>1},`${a.sheetName}-${a.id}`))})]})]})]})}],85133)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0i4.n_a._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[54393,a=>{"use strict";var b=a.i(30004);async function c(a){if("none"===a.provider)throw Error("AI suggestion provider is disabled");let c="true"===b.debug_logging_preference.read(),d=Date.now(),e={provider:a.provider,context:a.context,notes:a.notes,debug_logging:c};c&&console.info("[ai-suggestion] client request start",{provider:a.provider,context_length:a.context.length,notes_length:a.notes.length});try{let b=await fetch("/api/entry/suggest-description",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,api_key:a.api_key})});if(!b.ok){let e=await b.json().catch(()=>({}));throw c&&console.warn("[ai-suggestion] client request failed",{provider:a.provider,status:b.status,elapsed_ms:Date.now()-d,error:e.error??"Failed to suggest description"}),Error(e.error??"Failed to suggest description")}let f=await b.json(),g=f.description?.trim()??"";if(0===g.length)throw Error("Suggestion was empty");return c&&console.info("[ai-suggestion] client request success",{provider:a.provider,elapsed_ms:Date.now()-d,description_length:g.length}),g}catch(b){throw c&&console.error("[ai-suggestion] client request error",{provider:a.provider,elapsed_ms:Date.now()-d,error:b instanceof Error?b.message:String(b)}),b}}a.s(["request_ai_entry_description_suggestion",0,c])},26336,a=>{"use strict";var b=a.i(34542),c=a.i(53030),d=a.i(40947);a.s(["use_check_out_action",0,function(a){let{confirm:e}=(0,c.use_confirm_dialog)(),f="true"===(0,b.useSyncExternalStore)(d.confirm_before_checkout_preference.subscribe,d.confirm_before_checkout_preference.get_snapshot,d.confirm_before_checkout_preference.get_server_snapshot);return(0,b.useCallback)(async b=>{if(f){let a;if(!await e({title:"Check out?",message:(a=b?.trim()??"").length>0?`Stop the timer and check out at "${a}"?`:"Stop the active timer and save this entry?",confirmLabel:"Check out",variant:"danger"}))return}a(b)},[e,f,a])}],26336)},92558,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(34435),e=a.i(96359);let f="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 hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55";a.s(["EntryActionsMenu",0,function({current_sheet_name:a,sheets:g,is_pending:h,on_edit:i,on_add_note:j,on_show_add_note_form:k,on_revise_description_ai:l,can_revise_description_ai:m=!1,on_resume:n,entry_is_active:o=!1,on_delete:p,on_move:q}){let r=g.find(b=>b.name===a),s=o||r?.hasActiveEntry===!0&&!o,t=g.filter(b=>b.name!==a),[u,v]=(0,c.useState)(!1),w=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!u)return;let a=a=>{null===w.current||w.current.contains(a.target)||v(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[u]);let x=()=>{v(!1)};return(0,e.use_escape_to_cancel)(x,u),(0,b.jsxs)("div",{className:"relative shrink-0",ref:w,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex cursor-pointer appearance-none items-center justify-center rounded-none border-0 bg-transparent p-0.5 text-muted shadow-none hover:opacity-75 focus-visible:outline-2 focus-visible:outline-input-focus-border focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Entry actions","aria-expanded":u,"aria-haspopup":"menu",disabled:h,onClick:()=>v(a=>!a),children:(0,b.jsx)(d.HamburgerIcon,{})}),u?(0,b.jsxs)("ul",{className:"absolute right-0 top-full z-10 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:h,onClick:()=>{x(),i()},children:"Edit times"})}),void 0!==k||void 0!==j?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:h,onClick:()=>{if(x(),void 0!==k)return void k();let a=function(){let a=window.prompt("Add note","");if(null===a)return null;let b=a.trim();return 0===b.length?null:b}();null!==a&&void 0!==j&&j(a)},children:"Add note"})}):null,void 0!==l?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:h||!m,title:m?"Revise with AI":"Configure provider and key in Settings → AI suggestions",onClick:()=>{x(),l()},children:"Revise description with AI"})}):null,void 0!==n?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:h||s,title:s?o?"This entry is already active":"Another entry is active on this sheet":void 0,onClick:()=>{x(),n()},children:"Resume"})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 px-2.5 py-0.5 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Move to sheet"})}),0===t.length?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:!0,children:"No other sheets"})}):t.map(a=>(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${f} pl-4`,role:"menuitem",disabled:h||a.hasActiveEntry,title:a.hasActiveEntry?"That sheet already has an active entry":void 0,onClick:()=>{x(),q(a.name)},children:a.name})},a.name)),(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${f} text-danger`,role:"menuitem",disabled:h,onClick:()=>{x(),p()},children:"Delete"})})]}):null]})}],92558)},56720,76767,61733,20537,a=>{"use strict";var b=a.i(39752),c=a.i(34542);function d({rotated:a=!1,className:c=""}){return(0,b.jsx)("svg",{className:`h-3 w-3 shrink-0 transition-transform duration-150 ${a?"rotate-90":""} ${c}`.trim(),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,b.jsx)("path",{d:"m9 18 6-6-6-6"})})}var e=a.i(93301);function f(a,b="12h"){return(0,e.format)(new Date(a),"24h"===b?"HH:mm":"h:mm a")}a.s(["format_time",0,f],76767);var g=a.i(89969),h=a.i(69749),i=a.i(96359);function j({initial_text:a,is_pending:d,inline:e=!1,on_save:f,on_cancel:k}){let[l,m]=(0,c.useState)(a);(0,i.use_escape_to_cancel)(k);let n=Math.min(6,Math.max(2,a.split("\n").length)),o=e?`${(0,h.get_input_class_name)()} min-h-10 w-full resize-y text-xs leading-snug`:`${(0,h.get_input_class_name)()} min-h-10 w-full resize-y text-[0.85rem] leading-snug`;return(0,b.jsxs)("form",{className:"flex w-full flex-col gap-1.5",onSubmit:a=>{a.preventDefault();let b=l.trim();0!==b.length&&f(b)},onClick:a=>a.stopPropagation(),children:[(0,b.jsx)("textarea",{className:o,value:l,rows:n,disabled:d,onChange:a=>m(a.target.value)}),(0,b.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("ghost"),disabled:d,onClick:k,children:"Cancel"}),(0,b.jsx)("button",{type:"submit",className:(0,g.get_button_class_name)("ghost"),disabled:d||0===l.trim().length,children:"Save"})]})]})}function k(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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,b.jsx)("path",{d:"M12 20h9"}),(0,b.jsx)("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function l(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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,b.jsx)("path",{d:"M3 6h18"}),(0,b.jsx)("path",{d:"M8 6V4h8v2"}),(0,b.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),(0,b.jsx)("path",{d:"M10 11v6"}),(0,b.jsx)("path",{d:"M14 11v6"})]})}a.s(["PencilIcon",0,k],61733);var m=a.i(50825);function n(){return(0,c.useSyncExternalStore)(m.time_format_preference.subscribe,m.time_format_preference.get_snapshot,m.time_format_preference.get_server_snapshot)}a.s(["use_time_format",0,n],20537);let o="inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55";a.s(["EntryNotesList",0,function({notes:a,variant:e="panel",in_bar:g=!1,is_pending:h=!1,on_edit_note:i,on_delete_note:m}){let p=n(),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)("panel"===e&&!g);if(0===a.length)return null;let u=[...a].sort((a,b)=>new Date(a.timestamp).getTime()-new Date(b.timestamp).getTime()),v="inline"===e,w="panel"===e&&g,x=s||null!==q,y=v?`${a.length} ${1===a.length?"note":"notes"}`:`Notes (${a.length})`,z=[v?"m-0 w-full p-0":"border-t border-accent-border pt-3.5",g&&!v?"border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))]":"",w&&x?"flex min-h-0 flex-1 flex-col":w?"flex shrink-0 flex-col":""].filter(Boolean).join(" "),A=x?"mt-1.5":"hidden",B=v?`m-0 flex list-none flex-col gap-1.5 overflow-visible p-0 compact:gap-0.5 ${A}`:w?`m-0 grid min-h-0 flex-1 list-none auto-rows-fr grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${A}`:`m-0 grid list-none grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${A}`,C=v?"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-ghost-bg px-2 py-1.5 compact:rounded-none compact:px-1.5 compact:py-1":w?"flex min-h-0 flex-col justify-center gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2":"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2",D=a=>void 0===i&&void 0===m?null:(0,b.jsxs)("div",{className:"flex shrink-0 gap-0.5",children:[void 0!==i?(0,b.jsx)("button",{type:"button",className:o,"aria-label":"Edit note",title:"Edit note",disabled:h,onClick:b=>{var c;b.stopPropagation(),c=a.timestamp,t(!0),r(c)},children:(0,b.jsx)(k,{})}):null,void 0!==m?(0,b.jsx)("button",{type:"button",className:`${o} hover:text-danger`,"aria-label":"Delete note",title:"Delete note",disabled:h,onClick:b=>{var c;b.stopPropagation(),q===(c=a.timestamp)&&r(null),m?.(c)},children:(0,b.jsx)(l,{})}):null]});return(0,b.jsxs)("section",{className:z,"aria-label":"Entry notes",children:[(0,b.jsxs)("button",{type:"button",className:v?"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-inherit text-xs font-medium normal-case tracking-normal text-muted hover:text-foreground":"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0 py-0.5 font-inherit text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted hover:text-foreground","aria-expanded":x,onClick:a=>{a.stopPropagation(),null===q&&t(a=>!a)},children:[(0,b.jsx)(d,{rotated:x}),(0,b.jsx)("span",{children:y})]}),(0,b.jsx)("ul",{className:B,children:u.map((a,c)=>{let d=q===a.timestamp;return(0,b.jsx)("li",{className:C,children:d?(0,b.jsx)(j,{initial_text:a.text,inline:v,is_pending:h,on_cancel:()=>r(null),on_save:b=>{var c;return c=a.timestamp,void(i?.(c,b),r(null))}}):v?(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsxs)("p",{className:"m-0 flex min-w-0 flex-1 items-baseline gap-1.5 text-xs leading-snug text-foreground compact:text-[0.72rem]",children:[(0,b.jsx)("time",{className:"shrink-0 font-mono text-[0.68rem] text-muted",dateTime:a.timestamp,children:f(a.timestamp,p)}),(0,b.jsx)("span",{className:"min-w-0 overflow-wrap-anywhere whitespace-pre-wrap",children:a.text})]}),D(a)]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsx)("time",{className:"font-mono text-[0.72rem] text-muted",dateTime:a.timestamp,children:f(a.timestamp,p)}),D(a)]}),(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere text-[0.9rem] leading-snug whitespace-pre-wrap",children:a.text})]})},`${a.timestamp}-${c}`)})})]})}],56720)},49656,a=>{"use strict";var b=a.i(93301);a.s(["format_datetime_hint",0,function(a){return(0,b.format)(new Date(a),"MMM d, h:mm a")}])},50803,a=>{"use strict";var b=a.i(48174);a.s(["build_resume_description",0,function(a,c){let d=a.trim(),e=d.length>0?d:"Untitled entry",f=c.map(a=>(0,b.format_display_tag)(a)).join(" ");return f.length>0?`${e} ${f}`.trim():e}])},51934,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(49656),e=a.i(30354),f=a.i(50803),g=a.i(89969),h=a.i(69749),i=a.i(96359);a.s(["EntryEditForm",0,function({entry:a,known_tags:j,is_pending:k,initial_description_override:l,in_active_panel:m=!1,times_only:n=!1,on_save:o,on_cancel:p}){let q=(0,c.useMemo)(()=>l??(0,f.build_resume_description)(a.description,a.tags),[a.description,a.id,a.tags,l]),[r,s]=(0,c.useState)(q),[t,u]=(0,c.useState)(""),[v,w]=(0,c.useState)("");(0,c.useEffect)(()=>{s(l??(0,f.build_resume_description)(a.description,a.tags)),u(""),w("")},[a.description,a.id,a.sheetName,a.tags,l]),(0,i.use_escape_to_cancel)(p);let x=a.isActive?"still running":(0,d.format_datetime_hint)(a.end??a.start),y=n?t.trim().length>0||v.trim().length>0:r.trim()!==q.trim()||t.trim().length>0||v.trim().length>0;return(0,b.jsxs)("form",{className:`flex flex-col gap-3 rounded-[0.65rem] border border-panel-border bg-input-bg p-3 ${m?"mt-2":""}`,onSubmit:a=>{a.preventDefault();let b=r.trim(),c=t.trim(),d=v.trim(),e={};n||b===q.trim()||(e.description=b),c.length>0&&(e.start=c),d.length>0&&(e.end=d),(void 0!==e.description||void 0!==e.start||void 0!==e.end)&&o(e)},children:[(0,b.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:n?"Edit times":"Edit entry"}),n?null:(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-description-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Description"}),(0,b.jsx)(e.TagAutocompleteInput,{id:`entry-description-${a.id}`,value:r,known_tags:j,placeholder:"e.g. crafting something @design",disabled:k,autoFocus:m,on_change:s})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("p",{className:"m-0 text-[0.8rem] font-semibold text-muted",children:"Times (optional)"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2.5 max-[860px]:grid-cols-1",children:[(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-start-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Start"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",(0,d.format_datetime_hint)(a.start)]}),(0,b.jsx)("input",{id:`entry-start-${a.id}`,className:(0,h.get_input_class_name)("compact"),value:t,onChange:a=>u(a.target.value),placeholder:"e.g. 10am, 30 minutes ago",disabled:k,autoFocus:n&&m})]}),(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-end-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"End"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",x]}),(0,b.jsx)("input",{id:`entry-end-${a.id}`,className:(0,h.get_input_class_name)("compact"),value:v,onChange:a=>w(a.target.value),placeholder:a.isActive?"e.g. now, 5 minutes ago":"e.g. 11:30am",disabled:k})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"submit",className:(0,g.get_button_class_name)("primary","small"),disabled:k||!y,children:"Save"}),(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("ghost","small"),disabled:k,onClick:p,children:"Cancel"})]})]})}])},20872,a=>{"use strict";a.s(["get_delete_entry_confirm_dialog",0,function(a){let b=a.description.trim()||"Untitled entry",c=a.isActive?" This will stop the active timer.":"";return{title:"Delete entry?",message:`Delete "${b}" on sheet "${a.sheetName}"?${c}`,confirmLabel:"Delete",variant:"danger"}}])},28339,a=>{"use strict";var b=a.i(34542),c=a.i(32297);a.s(["use_confirm_destructive_actions",0,function(){return"true"===(0,b.useSyncExternalStore)(c.confirm_destructive_actions_preference.subscribe,c.confirm_destructive_actions_preference.get_snapshot,c.confirm_destructive_actions_preference.get_server_snapshot)}])},15611,a=>{"use strict";var b=a.i(39752);a.s(["AiSparklesIcon",0,function(){return(0,b.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",role:"presentation","aria-hidden":"true",focusable:"false",children:(0,b.jsx)("path",{d:"M12 3l1.7 4.3L18 9l-4.3 1.7L12 15l-1.7-4.3L6 9l4.3-1.7L12 3zM19 14l.9 2.1L22 17l-2.1.9L19 20l-.9-2.1L16 17l2.1-.9L19 14zM5 15l.9 2.1L8 18l-2.1.9L5 21l-.9-2.1L2 18l2.1-.9L5 15z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}])},23187,61566,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(15611),e=a.i(30354),f=a.i(50803),g=a.i(89969),h=a.i(98831),i=a.i(40420),j=a.i(6962),k=a.i(45273),l=a.i(54393),m=a.i(96359);a.s(["ActiveEntryDescriptionInline",0,function({entry:a,known_tags:n,is_pending:o,on_save:p,on_cancel:q}){let r=(0,c.useMemo)(()=>(0,f.build_resume_description)(a.description,a.tags),[a.description,a.id,a.tags]),[s,t]=(0,c.useState)(r),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(null),y=(0,c.useSyncExternalStore)(i.entry_suggestion_provider_preference.subscribe,i.entry_suggestion_provider_preference.get_snapshot,i.entry_suggestion_provider_preference.get_server_snapshot),z=(0,c.useSyncExternalStore)(k.openai_api_key_preference.subscribe,k.openai_api_key_preference.get_snapshot,k.openai_api_key_preference.get_server_snapshot),A=(0,c.useSyncExternalStore)(h.claude_api_key_preference.subscribe,h.claude_api_key_preference.get_snapshot,h.claude_api_key_preference.get_server_snapshot),B=(0,c.useSyncExternalStore)(j.google_ai_api_key_preference.subscribe,j.google_ai_api_key_preference.get_snapshot,j.google_ai_api_key_preference.get_server_snapshot),C="openai"===y?z:"claude"===y?A:"google_ai"===y?B:"",D="none"!==y&&C.trim().length>0;(0,c.useEffect)(()=>{t((0,f.build_resume_description)(a.description,a.tags))},[a.description,a.id,a.sheetName,a.tags]),(0,m.use_escape_to_cancel)(q);let E=async()=>{if(D){v(!0),x(null);try{let b=a.notes.map(a=>a.text).join("\n"),c=await (0,l.request_ai_entry_description_suggestion)({provider:y,api_key:C,context:s,notes:b});t(c)}catch(a){x(a instanceof Error?a.message:String(a))}finally{v(!1)}}};return(0,b.jsxs)("form",{className:"flex min-w-0 flex-1 flex-col gap-2",onSubmit:a=>{a.preventDefault();let b=s.trim();b===r.trim()?q():p(b)},children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-start gap-2 max-[700px]:flex-col",children:[(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(e.TagAutocompleteInput,{id:`active-entry-description-${a.id}`,value:s,known_tags:n,placeholder:"e.g. crafting something @design",disabled:o,autoFocus:!0,on_change:t})}),(0,b.jsxs)("div",{className:"flex shrink-0 flex-wrap gap-2 max-[700px]:w-full",children:[D?(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("ghost","small"),disabled:o||u,title:"Revise description with AI","aria-label":"Revise description with AI",onClick:()=>void E(),children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,b.jsx)(d.AiSparklesIcon,{}),u?"Revising…":"Revise with AI"]})}):null,(0,b.jsx)("button",{type:"submit",className:(0,g.get_button_class_name)("primary","small"),disabled:o||s.trim()===r.trim(),children:"Save"}),(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("ghost","small"),disabled:o,onClick:q,children:"Cancel"})]})]}),null!==w?(0,b.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:w}):null]})}],23187),a.s(["prompt_check_out_at",0,function(){let a=window.prompt("Check out at what time?","30 minutes ago");if(null===a)return null;let b=a.trim();return 0===b.length?null:b}],61566)},40892,a=>{"use strict";var b=a.i(39752),c=a.i(89969),d=a.i(61566),e=a.i(26336);let f=`${(0,c.get_button_class_name)("danger-solid")} rounded-none first:rounded-l-[0.65rem] last:rounded-r-[0.65rem] not-first:-ml-px not-first:min-w-12 not-first:border-l not-first:border-l-[color-mix(in_srgb,#ffffff_30%,var(--danger-solid))] min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1 max-[560px]:basis-1/2`;a.s(["CheckoutButtonGroup",0,function({in_bar:a=!1,is_pending:c,on_check_out:g}){let h=(0,e.use_check_out_action)(g);return(0,b.jsxs)("div",{className:`inline-flex min-w-0 max-w-full ${a?"max-[560px]:w-full":"min-w-30 max-[560px]:w-full"}`,children:[(0,b.jsx)("button",{type:"button",className:f,disabled:c,onClick:()=>void h(),children:"Check out"}),(0,b.jsx)("button",{type:"button",className:f,disabled:c,title:"Check out at a specific time",onClick:()=>{let a=(0,d.prompt_check_out_at)();null!==a&&h(a)},children:"@"})]})}])},23541,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(89969),e=a.i(69749),f=a.i(96359);a.s(["NoteForm",0,function({on_submit:a,on_cancel:g,is_pending:h,in_active_panel:i=!1,in_bar:j=!1,allow_at:k=!1}){let[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)("");return(0,f.use_escape_to_cancel)(()=>g?.(),void 0!==g),(0,b.jsxs)("form",{className:`flex flex-col gap-2 ${i&&!j?"border-t border-accent-border pt-4":j?"border-t border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))] pt-3.5":""}`,onSubmit:b=>{b.preventDefault();let c=l.trim();if(0===c.length)return;let d=n.trim();a(c,d.length>0?d:void 0),m(""),o("")},children:[(0,b.jsx)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-text",children:"Add note"}),(0,b.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2 max-[860px]:grid-cols-1",children:[(0,b.jsx)("input",{id:"note-text",className:(0,e.get_input_class_name)(),value:l,onChange:a=>m(a.target.value),placeholder:"Pair with alice on the widget",disabled:h,autoFocus:!0}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 max-[860px]:w-full",children:[(0,b.jsx)("button",{type:"submit",className:(0,d.get_button_class_name)("ghost"),disabled:h||0===l.trim().length,children:"Save note"}),void 0!==g?(0,b.jsx)("button",{type:"button",className:(0,d.get_button_class_name)("ghost"),disabled:h,onClick:g,children:"Cancel"}):null]})]}),k?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-at",children:["Note time"," ",(0,b.jsx)("span",{className:"font-normal opacity-85",children:"(optional, natural language)"})]}),(0,b.jsx)("input",{id:"note-at",className:(0,e.get_input_class_name)(),value:n,onChange:a=>o(a.target.value),placeholder:"e.g. 30 minutes ago",disabled:h})]}):null]})}])},34747,a=>{"use strict";var b=a.i(34542),c=a.i(99751);a.s(["use_timer_show_seconds",0,function(){return"true"===(0,b.useSyncExternalStore)(c.timer_show_seconds_preference.subscribe,c.timer_show_seconds_preference.get_snapshot,c.timer_show_seconds_preference.get_server_snapshot)}])},78509,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(23187),e=a.i(40892),f=a.i(53030),g=a.i(92558),h=a.i(51934),i=a.i(56720),j=a.i(23541),k=a.i(61733),l=a.i(48174),m=a.i(85752),n=a.i(28339),o=a.i(65162),p=a.i(34747),q=a.i(89969),r=a.i(20872);let s=(0,c.forwardRef)(function({entry:a,sheets:s,known_tags:t,in_bar:u=!1,on_check_out:v,on_delete:w,on_edit:x,on_move:y,on_add_note:z,on_edit_note:A,on_delete_note:B,is_pending:C},D){var E;let F,{confirm:G}=(0,f.use_confirm_dialog)(),H=(0,n.use_confirm_destructive_actions)(),I=(0,o.use_duration_format)(),J=(0,p.use_timer_show_seconds)(),[K,L]=(0,c.useState)(a.durationMs),[M,N]=(0,c.useState)(!1),[O,P]=(0,c.useState)(!1),[Q,R]=(0,c.useState)(!1);(0,c.useImperativeHandle)(D,()=>({start_edit:()=>{M||O||N(!0)},start_add_note:()=>{M||O||Q||R(!0)}}),[Q,M,O]),(0,c.useEffect)(()=>{R(!1),N(!1),P(!1)},[a.id,a.sheetName]),(0,c.useEffect)(()=>{L(a.durationMs);let b=window.setInterval(()=>{L(Date.now()-new Date(a.start).getTime())},1e3);return()=>window.clearInterval(b)},[a.durationMs,a.start]);let S=(E=M||O,F="flex flex-col gap-4 rounded-lg border border-accent-border p-[1.1rem] shadow-sm",u?E?`${F} rounded-md border border-accent-border bg-[color-mix(in_srgb,var(--panel)_70%,var(--background))] p-3.5`:"flex flex-col gap-3 border-0 bg-transparent p-0 shadow-none":`${F} bg-[image:var(--active-panel-bg)]`),T=async b=>{let c,d,e=a.notes.find(a=>a.timestamp===b);(!H||await G({title:"Delete note?",message:(d=(c=(e?.text??"").trim()).length>80?`${c.slice(0,80)}…`:c).length>0?`Remove this note? "${d}"`:"Remove this note?",confirmLabel:"Delete",variant:"danger"}))&&B(b)},U=(0,b.jsx)(g.EntryActionsMenu,{current_sheet_name:a.sheetName,sheets:s,is_pending:C,on_edit:()=>P(!0),on_show_add_note_form:()=>R(!0),on_move:y,on_delete:async()=>{(!H||await G((0,r.get_delete_entry_confirm_dialog)(a)))&&w()}});return O?(0,b.jsx)("section",{className:S,children:(0,b.jsx)(h.EntryEditForm,{entry:a,known_tags:t,is_pending:C,in_active_panel:!0,times_only:!0,on_cancel:()=>P(!1),on_save:a=>{x(a),P(!1)}})}):(0,b.jsxs)("section",{className:S,children:[(0,b.jsxs)("div",{className:"flex min-w-0 shrink-0 items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[u?null:(0,b.jsx)("span",{className:"self-start rounded-full bg-accent px-2 py-0.5 text-[0.68rem] font-bold uppercase leading-none tracking-wider text-accent-text-on",children:"Tracking"}),M?(0,b.jsx)(d.ActiveEntryDescriptionInline,{entry:a,known_tags:t,is_pending:C,on_cancel:()=>N(!1),on_save:a=>{x({description:a}),N(!1)}}):(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,b.jsx)("h2",{className:"m-0 min-w-0 truncate text-[1.12rem] font-[650] leading-tight tracking-tight min-[560px]:text-xl",children:a.description||"Untitled entry"}),(0,b.jsx)("button",{type:"button",className:"inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Edit description",title:"Edit description",disabled:C||Q,onClick:()=>N(!0),children:(0,b.jsx)(k.PencilIcon,{})})]})]}),u?null:(0,b.jsx)("div",{className:"max-[560px]:self-end",children:U})]}),(0,b.jsxs)("div",{className:`flex shrink-0 items-end justify-between gap-4 max-[860px]:flex-col max-[860px]:items-stretch ${u?"px-3":""}`,children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,b.jsx)("p",{className:"m-0 whitespace-nowrap font-mono text-[1.65rem] font-medium leading-none tracking-tight text-accent min-[440px]:text-[1.85rem] min-[560px]:text-[2rem]",children:(0,m.format_duration)(K,I,J)}),!M&&a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,l.format_display_tag)(a)},a))}):null]}),(0,b.jsxs)("div",{className:`flex min-w-0 shrink-0 flex-wrap items-center justify-end gap-2 max-[560px]:flex-col max-[560px]:items-stretch ${u?"w-full":"min-w-30 max-[860px]:w-full max-[860px]:justify-stretch"}`,children:[Q?null:(0,b.jsx)("button",{type:"button",className:`${(0,q.get_button_class_name)("ghost")} min-w-0 min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1`,disabled:C||M,onClick:()=>R(!0),children:"Add note"}),(0,b.jsx)(e.CheckoutButtonGroup,{in_bar:u,is_pending:C,on_check_out:v})]})]}),(0,b.jsx)(i.EntryNotesList,{notes:a.notes,variant:"panel",in_bar:u,is_pending:C,on_edit_note:A,on_delete_note:T}),Q?(0,b.jsx)("div",{className:"shrink-0",children:(0,b.jsx)(j.NoteForm,{in_active_panel:!0,in_bar:u,allow_at:!0,is_pending:C,on_cancel:()=>R(!1),on_submit:(a,b)=>{z(a,b),R(!1)}})}):null]})});a.s(["ActiveEntryPanel",0,s],78509)},68225,a=>{"use strict";a.s(["finish_running_pomodoro_timer",0,function(){}])},73297,a=>{"use strict";async function b(a,b){let c=await fetch(a,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok)throw Error((await c.json()).error??"Request failed");return await c.json()}a.s(["delete_tracker_action",0,b])},57377,115,a=>{"use strict";var b=a.i(87281);async function c(a){let b=await fetch("/api/sheet/active",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})});if(!b.ok)throw Error((await b.json()).error??"Failed to update active sheet in cloud")}var d=a.i(59659),e=a.i(5796);function f(a,f){if("/api/sheet"===a&&"object"==typeof f&&null!==f&&!0!==f.delete&&!(0,b.is_greedy_cloud_sync_enabled)()){let a=f.name?.trim()??"";a.length>0&&c(a).catch(()=>{});return}(0,b.is_greedy_cloud_sync_enabled)()?(0,e.schedule_tracker_db_cloud_sync)():(0,d.push_tracker_db_cloud_after_change)()}let g=new Set(["/api/note"]);async function h(a,b){let c={method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)},d=await fetch(a,c);if(!d.ok){var e,h;let b,f=(await d.json()).error??"Request failed";if(e=a,h=f,g.has(e)&&((b=h.toLowerCase()).includes("duplicate key")||b.includes("unique constraint"))){if(await new Promise(a=>{setTimeout(a,25)}),!(d=await fetch(a,c)).ok)throw Error((await d.json()).error??f)}else throw Error(f)}let i=await d.json();return f(a,b),i}a.s(["patch_tracker_action",0,h],57377);let i=new Set(["/api/note"]);async function j(a,b){let c={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)},d=await fetch(a,c);if(!d.ok){var e,g;let b,f=(await d.json()).error??"Request failed";if(e=a,g=f,i.has(e)&&((b=g.toLowerCase()).includes("duplicate key")||b.includes("unique constraint"))){if(await new Promise(a=>{setTimeout(a,25)}),!(d=await fetch(a,c)).ok)throw Error((await d.json()).error??f)}else throw Error(f)}let h=await d.json();return f(a,b),h}a.s(["post_tracker_action",0,j],115)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0ks2fqx._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[15611,a=>{"use strict";var b=a.i(39752);a.s(["AiSparklesIcon",0,function(){return(0,b.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",role:"presentation","aria-hidden":"true",focusable:"false",children:(0,b.jsx)("path",{d:"M12 3l1.7 4.3L18 9l-4.3 1.7L12 15l-1.7-4.3L6 9l4.3-1.7L12 3zM19 14l.9 2.1L22 17l-2.1.9L19 20l-.9-2.1L16 17l2.1-.9L19 14zM5 15l.9 2.1L8 18l-2.1.9L5 21l-.9-2.1L2 18l2.1-.9L5 15z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}])},50803,a=>{"use strict";var b=a.i(48174);a.s(["build_resume_description",0,function(a,c){let d=a.trim(),e=d.length>0?d:"Untitled entry",f=c.map(a=>(0,b.format_display_tag)(a)).join(" ");return f.length>0?`${e} ${f}`.trim():e}])},54393,a=>{"use strict";var b=a.i(30004);async function c(a){if("none"===a.provider)throw Error("AI suggestion provider is disabled");let c="true"===b.debug_logging_preference.read(),d=Date.now(),e={provider:a.provider,context:a.context,notes:a.notes,debug_logging:c};c&&console.info("[ai-suggestion] client request start",{provider:a.provider,context_length:a.context.length,notes_length:a.notes.length});try{let b=await fetch("/api/entry/suggest-description",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,api_key:a.api_key})});if(!b.ok){let e=await b.json().catch(()=>({}));throw c&&console.warn("[ai-suggestion] client request failed",{provider:a.provider,status:b.status,elapsed_ms:Date.now()-d,error:e.error??"Failed to suggest description"}),Error(e.error??"Failed to suggest description")}let f=await b.json(),g=f.description?.trim()??"";if(0===g.length)throw Error("Suggestion was empty");return c&&console.info("[ai-suggestion] client request success",{provider:a.provider,elapsed_ms:Date.now()-d,description_length:g.length}),g}catch(b){throw c&&console.error("[ai-suggestion] client request error",{provider:a.provider,elapsed_ms:Date.now()-d,error:b instanceof Error?b.message:String(b)}),b}}a.s(["request_ai_entry_description_suggestion",0,c])},23187,61566,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(15611),e=a.i(30354),f=a.i(50803),g=a.i(89969),h=a.i(98831),i=a.i(40420),j=a.i(6962),k=a.i(45273),l=a.i(54393),m=a.i(96359);a.s(["ActiveEntryDescriptionInline",0,function({entry:a,known_tags:n,is_pending:o,on_save:p,on_cancel:q}){let r=(0,c.useMemo)(()=>(0,f.build_resume_description)(a.description,a.tags),[a.description,a.id,a.tags]),[s,t]=(0,c.useState)(r),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(null),y=(0,c.useSyncExternalStore)(i.entry_suggestion_provider_preference.subscribe,i.entry_suggestion_provider_preference.get_snapshot,i.entry_suggestion_provider_preference.get_server_snapshot),z=(0,c.useSyncExternalStore)(k.openai_api_key_preference.subscribe,k.openai_api_key_preference.get_snapshot,k.openai_api_key_preference.get_server_snapshot),A=(0,c.useSyncExternalStore)(h.claude_api_key_preference.subscribe,h.claude_api_key_preference.get_snapshot,h.claude_api_key_preference.get_server_snapshot),B=(0,c.useSyncExternalStore)(j.google_ai_api_key_preference.subscribe,j.google_ai_api_key_preference.get_snapshot,j.google_ai_api_key_preference.get_server_snapshot),C="openai"===y?z:"claude"===y?A:"google_ai"===y?B:"",D="none"!==y&&C.trim().length>0;(0,c.useEffect)(()=>{t((0,f.build_resume_description)(a.description,a.tags))},[a.description,a.id,a.sheetName,a.tags]),(0,m.use_escape_to_cancel)(q);let E=async()=>{if(D){v(!0),x(null);try{let b=a.notes.map(a=>a.text).join("\n"),c=await (0,l.request_ai_entry_description_suggestion)({provider:y,api_key:C,context:s,notes:b});t(c)}catch(a){x(a instanceof Error?a.message:String(a))}finally{v(!1)}}};return(0,b.jsxs)("form",{className:"flex min-w-0 flex-1 flex-col gap-2",onSubmit:a=>{a.preventDefault();let b=s.trim();b===r.trim()?q():p(b)},children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-start gap-2 max-[700px]:flex-col",children:[(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(e.TagAutocompleteInput,{id:`active-entry-description-${a.id}`,value:s,known_tags:n,placeholder:"e.g. crafting something @design",disabled:o,autoFocus:!0,on_change:t})}),(0,b.jsxs)("div",{className:"flex shrink-0 flex-wrap gap-2 max-[700px]:w-full",children:[D?(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("ghost","small"),disabled:o||u,title:"Revise description with AI","aria-label":"Revise description with AI",onClick:()=>void E(),children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,b.jsx)(d.AiSparklesIcon,{}),u?"Revising…":"Revise with AI"]})}):null,(0,b.jsx)("button",{type:"submit",className:(0,g.get_button_class_name)("primary","small"),disabled:o||s.trim()===r.trim(),children:"Save"}),(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("ghost","small"),disabled:o,onClick:q,children:"Cancel"})]})]}),null!==w?(0,b.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:w}):null]})}],23187),a.s(["prompt_check_out_at",0,function(){let a=window.prompt("Check out at what time?","30 minutes ago");if(null===a)return null;let b=a.trim();return 0===b.length?null:b}],61566)},26336,a=>{"use strict";var b=a.i(34542),c=a.i(53030),d=a.i(40947);a.s(["use_check_out_action",0,function(a){let{confirm:e}=(0,c.use_confirm_dialog)(),f="true"===(0,b.useSyncExternalStore)(d.confirm_before_checkout_preference.subscribe,d.confirm_before_checkout_preference.get_snapshot,d.confirm_before_checkout_preference.get_server_snapshot);return(0,b.useCallback)(async b=>{if(f){let a;if(!await e({title:"Check out?",message:(a=b?.trim()??"").length>0?`Stop the timer and check out at "${a}"?`:"Stop the active timer and save this entry?",confirmLabel:"Check out",variant:"danger"}))return}a(b)},[e,f,a])}],26336)},40892,a=>{"use strict";var b=a.i(39752),c=a.i(89969),d=a.i(61566),e=a.i(26336);let f=`${(0,c.get_button_class_name)("danger-solid")} rounded-none first:rounded-l-[0.65rem] last:rounded-r-[0.65rem] not-first:-ml-px not-first:min-w-12 not-first:border-l not-first:border-l-[color-mix(in_srgb,#ffffff_30%,var(--danger-solid))] min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1 max-[560px]:basis-1/2`;a.s(["CheckoutButtonGroup",0,function({in_bar:a=!1,is_pending:c,on_check_out:g}){let h=(0,e.use_check_out_action)(g);return(0,b.jsxs)("div",{className:`inline-flex min-w-0 max-w-full ${a?"max-[560px]:w-full":"min-w-30 max-[560px]:w-full"}`,children:[(0,b.jsx)("button",{type:"button",className:f,disabled:c,onClick:()=>void h(),children:"Check out"}),(0,b.jsx)("button",{type:"button",className:f,disabled:c,title:"Check out at a specific time",onClick:()=>{let a=(0,d.prompt_check_out_at)();null!==a&&h(a)},children:"@"})]})}])},92558,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(34435),e=a.i(96359);let f="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 hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55";a.s(["EntryActionsMenu",0,function({current_sheet_name:a,sheets:g,is_pending:h,on_edit:i,on_add_note:j,on_show_add_note_form:k,on_revise_description_ai:l,can_revise_description_ai:m=!1,on_resume:n,entry_is_active:o=!1,on_delete:p,on_move:q}){let r=g.find(b=>b.name===a),s=o||r?.hasActiveEntry===!0&&!o,t=g.filter(b=>b.name!==a),[u,v]=(0,c.useState)(!1),w=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!u)return;let a=a=>{null===w.current||w.current.contains(a.target)||v(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[u]);let x=()=>{v(!1)};return(0,e.use_escape_to_cancel)(x,u),(0,b.jsxs)("div",{className:"relative shrink-0",ref:w,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex cursor-pointer appearance-none items-center justify-center rounded-none border-0 bg-transparent p-0.5 text-muted shadow-none hover:opacity-75 focus-visible:outline-2 focus-visible:outline-input-focus-border focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Entry actions","aria-expanded":u,"aria-haspopup":"menu",disabled:h,onClick:()=>v(a=>!a),children:(0,b.jsx)(d.HamburgerIcon,{})}),u?(0,b.jsxs)("ul",{className:"absolute right-0 top-full z-10 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:h,onClick:()=>{x(),i()},children:"Edit times"})}),void 0!==k||void 0!==j?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:h,onClick:()=>{if(x(),void 0!==k)return void k();let a=function(){let a=window.prompt("Add note","");if(null===a)return null;let b=a.trim();return 0===b.length?null:b}();null!==a&&void 0!==j&&j(a)},children:"Add note"})}):null,void 0!==l?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:h||!m,title:m?"Revise with AI":"Configure provider and key in Settings → AI suggestions",onClick:()=>{x(),l()},children:"Revise description with AI"})}):null,void 0!==n?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:h||s,title:s?o?"This entry is already active":"Another entry is active on this sheet":void 0,onClick:()=>{x(),n()},children:"Resume"})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 px-2.5 py-0.5 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Move to sheet"})}),0===t.length?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:f,role:"menuitem",disabled:!0,children:"No other sheets"})}):t.map(a=>(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${f} pl-4`,role:"menuitem",disabled:h||a.hasActiveEntry,title:a.hasActiveEntry?"That sheet already has an active entry":void 0,onClick:()=>{x(),q(a.name)},children:a.name})},a.name)),(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${f} text-danger`,role:"menuitem",disabled:h,onClick:()=>{x(),p()},children:"Delete"})})]}):null]})}],92558)},49656,a=>{"use strict";var b=a.i(93301);a.s(["format_datetime_hint",0,function(a){return(0,b.format)(new Date(a),"MMM d, h:mm a")}])},51934,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(49656),e=a.i(30354),f=a.i(50803),g=a.i(89969),h=a.i(69749),i=a.i(96359);a.s(["EntryEditForm",0,function({entry:a,known_tags:j,is_pending:k,initial_description_override:l,in_active_panel:m=!1,times_only:n=!1,on_save:o,on_cancel:p}){let q=(0,c.useMemo)(()=>l??(0,f.build_resume_description)(a.description,a.tags),[a.description,a.id,a.tags,l]),[r,s]=(0,c.useState)(q),[t,u]=(0,c.useState)(""),[v,w]=(0,c.useState)("");(0,c.useEffect)(()=>{s(l??(0,f.build_resume_description)(a.description,a.tags)),u(""),w("")},[a.description,a.id,a.sheetName,a.tags,l]),(0,i.use_escape_to_cancel)(p);let x=a.isActive?"still running":(0,d.format_datetime_hint)(a.end??a.start),y=n?t.trim().length>0||v.trim().length>0:r.trim()!==q.trim()||t.trim().length>0||v.trim().length>0;return(0,b.jsxs)("form",{className:`flex flex-col gap-3 rounded-[0.65rem] border border-panel-border bg-input-bg p-3 ${m?"mt-2":""}`,onSubmit:a=>{a.preventDefault();let b=r.trim(),c=t.trim(),d=v.trim(),e={};n||b===q.trim()||(e.description=b),c.length>0&&(e.start=c),d.length>0&&(e.end=d),(void 0!==e.description||void 0!==e.start||void 0!==e.end)&&o(e)},children:[(0,b.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:n?"Edit times":"Edit entry"}),n?null:(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-description-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Description"}),(0,b.jsx)(e.TagAutocompleteInput,{id:`entry-description-${a.id}`,value:r,known_tags:j,placeholder:"e.g. crafting something @design",disabled:k,autoFocus:m,on_change:s})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("p",{className:"m-0 text-[0.8rem] font-semibold text-muted",children:"Times (optional)"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2.5 max-[860px]:grid-cols-1",children:[(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-start-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Start"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",(0,d.format_datetime_hint)(a.start)]}),(0,b.jsx)("input",{id:`entry-start-${a.id}`,className:(0,h.get_input_class_name)("compact"),value:t,onChange:a=>u(a.target.value),placeholder:"e.g. 10am, 30 minutes ago",disabled:k,autoFocus:n&&m})]}),(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-end-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"End"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",x]}),(0,b.jsx)("input",{id:`entry-end-${a.id}`,className:(0,h.get_input_class_name)("compact"),value:v,onChange:a=>w(a.target.value),placeholder:a.isActive?"e.g. now, 5 minutes ago":"e.g. 11:30am",disabled:k})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"submit",className:(0,g.get_button_class_name)("primary","small"),disabled:k||!y,children:"Save"}),(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("ghost","small"),disabled:k,onClick:p,children:"Cancel"})]})]})}])},56720,76767,61733,20537,a=>{"use strict";var b=a.i(39752),c=a.i(34542);function d({rotated:a=!1,className:c=""}){return(0,b.jsx)("svg",{className:`h-3 w-3 shrink-0 transition-transform duration-150 ${a?"rotate-90":""} ${c}`.trim(),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,b.jsx)("path",{d:"m9 18 6-6-6-6"})})}var e=a.i(93301);function f(a,b="12h"){return(0,e.format)(new Date(a),"24h"===b?"HH:mm":"h:mm a")}a.s(["format_time",0,f],76767);var g=a.i(89969),h=a.i(69749),i=a.i(96359);function j({initial_text:a,is_pending:d,inline:e=!1,on_save:f,on_cancel:k}){let[l,m]=(0,c.useState)(a);(0,i.use_escape_to_cancel)(k);let n=Math.min(6,Math.max(2,a.split("\n").length)),o=e?`${(0,h.get_input_class_name)()} min-h-10 w-full resize-y text-xs leading-snug`:`${(0,h.get_input_class_name)()} min-h-10 w-full resize-y text-[0.85rem] leading-snug`;return(0,b.jsxs)("form",{className:"flex w-full flex-col gap-1.5",onSubmit:a=>{a.preventDefault();let b=l.trim();0!==b.length&&f(b)},onClick:a=>a.stopPropagation(),children:[(0,b.jsx)("textarea",{className:o,value:l,rows:n,disabled:d,onChange:a=>m(a.target.value)}),(0,b.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("ghost"),disabled:d,onClick:k,children:"Cancel"}),(0,b.jsx)("button",{type:"submit",className:(0,g.get_button_class_name)("ghost"),disabled:d||0===l.trim().length,children:"Save"})]})]})}function k(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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,b.jsx)("path",{d:"M12 20h9"}),(0,b.jsx)("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function l(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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,b.jsx)("path",{d:"M3 6h18"}),(0,b.jsx)("path",{d:"M8 6V4h8v2"}),(0,b.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),(0,b.jsx)("path",{d:"M10 11v6"}),(0,b.jsx)("path",{d:"M14 11v6"})]})}a.s(["PencilIcon",0,k],61733);var m=a.i(50825);function n(){return(0,c.useSyncExternalStore)(m.time_format_preference.subscribe,m.time_format_preference.get_snapshot,m.time_format_preference.get_server_snapshot)}a.s(["use_time_format",0,n],20537);let o="inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55";a.s(["EntryNotesList",0,function({notes:a,variant:e="panel",in_bar:g=!1,is_pending:h=!1,on_edit_note:i,on_delete_note:m}){let p=n(),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)("panel"===e&&!g);if(0===a.length)return null;let u=[...a].sort((a,b)=>new Date(a.timestamp).getTime()-new Date(b.timestamp).getTime()),v="inline"===e,w="panel"===e&&g,x=s||null!==q,y=v?`${a.length} ${1===a.length?"note":"notes"}`:`Notes (${a.length})`,z=[v?"m-0 w-full p-0":"border-t border-accent-border pt-3.5",g&&!v?"border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))]":"",w&&x?"flex min-h-0 flex-1 flex-col":w?"flex shrink-0 flex-col":""].filter(Boolean).join(" "),A=x?"mt-1.5":"hidden",B=v?`m-0 flex list-none flex-col gap-1.5 overflow-visible p-0 compact:gap-0.5 ${A}`:w?`m-0 grid min-h-0 flex-1 list-none auto-rows-fr grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${A}`:`m-0 grid list-none grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${A}`,C=v?"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-ghost-bg px-2 py-1.5 compact:rounded-none compact:px-1.5 compact:py-1":w?"flex min-h-0 flex-col justify-center gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2":"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2",D=a=>void 0===i&&void 0===m?null:(0,b.jsxs)("div",{className:"flex shrink-0 gap-0.5",children:[void 0!==i?(0,b.jsx)("button",{type:"button",className:o,"aria-label":"Edit note",title:"Edit note",disabled:h,onClick:b=>{var c;b.stopPropagation(),c=a.timestamp,t(!0),r(c)},children:(0,b.jsx)(k,{})}):null,void 0!==m?(0,b.jsx)("button",{type:"button",className:`${o} hover:text-danger`,"aria-label":"Delete note",title:"Delete note",disabled:h,onClick:b=>{var c;b.stopPropagation(),q===(c=a.timestamp)&&r(null),m?.(c)},children:(0,b.jsx)(l,{})}):null]});return(0,b.jsxs)("section",{className:z,"aria-label":"Entry notes",children:[(0,b.jsxs)("button",{type:"button",className:v?"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-inherit text-xs font-medium normal-case tracking-normal text-muted hover:text-foreground":"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0 py-0.5 font-inherit text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted hover:text-foreground","aria-expanded":x,onClick:a=>{a.stopPropagation(),null===q&&t(a=>!a)},children:[(0,b.jsx)(d,{rotated:x}),(0,b.jsx)("span",{children:y})]}),(0,b.jsx)("ul",{className:B,children:u.map((a,c)=>{let d=q===a.timestamp;return(0,b.jsx)("li",{className:C,children:d?(0,b.jsx)(j,{initial_text:a.text,inline:v,is_pending:h,on_cancel:()=>r(null),on_save:b=>{var c;return c=a.timestamp,void(i?.(c,b),r(null))}}):v?(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsxs)("p",{className:"m-0 flex min-w-0 flex-1 items-baseline gap-1.5 text-xs leading-snug text-foreground compact:text-[0.72rem]",children:[(0,b.jsx)("time",{className:"shrink-0 font-mono text-[0.68rem] text-muted",dateTime:a.timestamp,children:f(a.timestamp,p)}),(0,b.jsx)("span",{className:"min-w-0 overflow-wrap-anywhere whitespace-pre-wrap",children:a.text})]}),D(a)]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsx)("time",{className:"font-mono text-[0.72rem] text-muted",dateTime:a.timestamp,children:f(a.timestamp,p)}),D(a)]}),(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere text-[0.9rem] leading-snug whitespace-pre-wrap",children:a.text})]})},`${a.timestamp}-${c}`)})})]})}],56720)},23541,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(89969),e=a.i(69749),f=a.i(96359);a.s(["NoteForm",0,function({on_submit:a,on_cancel:g,is_pending:h,in_active_panel:i=!1,in_bar:j=!1,allow_at:k=!1}){let[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)("");return(0,f.use_escape_to_cancel)(()=>g?.(),void 0!==g),(0,b.jsxs)("form",{className:`flex flex-col gap-2 ${i&&!j?"border-t border-accent-border pt-4":j?"border-t border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))] pt-3.5":""}`,onSubmit:b=>{b.preventDefault();let c=l.trim();if(0===c.length)return;let d=n.trim();a(c,d.length>0?d:void 0),m(""),o("")},children:[(0,b.jsx)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-text",children:"Add note"}),(0,b.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2 max-[860px]:grid-cols-1",children:[(0,b.jsx)("input",{id:"note-text",className:(0,e.get_input_class_name)(),value:l,onChange:a=>m(a.target.value),placeholder:"Pair with alice on the widget",disabled:h,autoFocus:!0}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 max-[860px]:w-full",children:[(0,b.jsx)("button",{type:"submit",className:(0,d.get_button_class_name)("ghost"),disabled:h||0===l.trim().length,children:"Save note"}),void 0!==g?(0,b.jsx)("button",{type:"button",className:(0,d.get_button_class_name)("ghost"),disabled:h,onClick:g,children:"Cancel"}):null]})]}),k?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-at",children:["Note time"," ",(0,b.jsx)("span",{className:"font-normal opacity-85",children:"(optional, natural language)"})]}),(0,b.jsx)("input",{id:"note-at",className:(0,e.get_input_class_name)(),value:n,onChange:a=>o(a.target.value),placeholder:"e.g. 30 minutes ago",disabled:h})]}):null]})}])},28339,a=>{"use strict";var b=a.i(34542),c=a.i(32297);a.s(["use_confirm_destructive_actions",0,function(){return"true"===(0,b.useSyncExternalStore)(c.confirm_destructive_actions_preference.subscribe,c.confirm_destructive_actions_preference.get_snapshot,c.confirm_destructive_actions_preference.get_server_snapshot)}])},34747,a=>{"use strict";var b=a.i(34542),c=a.i(99751);a.s(["use_timer_show_seconds",0,function(){return"true"===(0,b.useSyncExternalStore)(c.timer_show_seconds_preference.subscribe,c.timer_show_seconds_preference.get_snapshot,c.timer_show_seconds_preference.get_server_snapshot)}])},20872,a=>{"use strict";a.s(["get_delete_entry_confirm_dialog",0,function(a){let b=a.description.trim()||"Untitled entry",c=a.isActive?" This will stop the active timer.":"";return{title:"Delete entry?",message:`Delete "${b}" on sheet "${a.sheetName}"?${c}`,confirmLabel:"Delete",variant:"danger"}}])},78509,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(23187),e=a.i(40892),f=a.i(53030),g=a.i(92558),h=a.i(51934),i=a.i(56720),j=a.i(23541),k=a.i(61733),l=a.i(48174),m=a.i(85752),n=a.i(28339),o=a.i(65162),p=a.i(34747),q=a.i(89969),r=a.i(20872);let s=(0,c.forwardRef)(function({entry:a,sheets:s,known_tags:t,in_bar:u=!1,on_check_out:v,on_delete:w,on_edit:x,on_move:y,on_add_note:z,on_edit_note:A,on_delete_note:B,is_pending:C},D){var E;let F,{confirm:G}=(0,f.use_confirm_dialog)(),H=(0,n.use_confirm_destructive_actions)(),I=(0,o.use_duration_format)(),J=(0,p.use_timer_show_seconds)(),[K,L]=(0,c.useState)(a.durationMs),[M,N]=(0,c.useState)(!1),[O,P]=(0,c.useState)(!1),[Q,R]=(0,c.useState)(!1);(0,c.useImperativeHandle)(D,()=>({start_edit:()=>{M||O||N(!0)},start_add_note:()=>{M||O||Q||R(!0)}}),[Q,M,O]),(0,c.useEffect)(()=>{R(!1),N(!1),P(!1)},[a.id,a.sheetName]),(0,c.useEffect)(()=>{L(a.durationMs);let b=window.setInterval(()=>{L(Date.now()-new Date(a.start).getTime())},1e3);return()=>window.clearInterval(b)},[a.durationMs,a.start]);let S=(E=M||O,F="flex flex-col gap-4 rounded-lg border border-accent-border p-[1.1rem] shadow-sm",u?E?`${F} rounded-md border border-accent-border bg-[color-mix(in_srgb,var(--panel)_70%,var(--background))] p-3.5`:"flex flex-col gap-3 border-0 bg-transparent p-0 shadow-none":`${F} bg-[image:var(--active-panel-bg)]`),T=async b=>{let c,d,e=a.notes.find(a=>a.timestamp===b);(!H||await G({title:"Delete note?",message:(d=(c=(e?.text??"").trim()).length>80?`${c.slice(0,80)}…`:c).length>0?`Remove this note? "${d}"`:"Remove this note?",confirmLabel:"Delete",variant:"danger"}))&&B(b)},U=(0,b.jsx)(g.EntryActionsMenu,{current_sheet_name:a.sheetName,sheets:s,is_pending:C,on_edit:()=>P(!0),on_show_add_note_form:()=>R(!0),on_move:y,on_delete:async()=>{(!H||await G((0,r.get_delete_entry_confirm_dialog)(a)))&&w()}});return O?(0,b.jsx)("section",{className:S,children:(0,b.jsx)(h.EntryEditForm,{entry:a,known_tags:t,is_pending:C,in_active_panel:!0,times_only:!0,on_cancel:()=>P(!1),on_save:a=>{x(a),P(!1)}})}):(0,b.jsxs)("section",{className:S,children:[(0,b.jsxs)("div",{className:"flex min-w-0 shrink-0 items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[u?null:(0,b.jsx)("span",{className:"self-start rounded-full bg-accent px-2 py-0.5 text-[0.68rem] font-bold uppercase leading-none tracking-wider text-accent-text-on",children:"Tracking"}),M?(0,b.jsx)(d.ActiveEntryDescriptionInline,{entry:a,known_tags:t,is_pending:C,on_cancel:()=>N(!1),on_save:a=>{x({description:a}),N(!1)}}):(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,b.jsx)("h2",{className:"m-0 min-w-0 truncate text-[1.12rem] font-[650] leading-tight tracking-tight min-[560px]:text-xl",children:a.description||"Untitled entry"}),(0,b.jsx)("button",{type:"button",className:"inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Edit description",title:"Edit description",disabled:C||Q,onClick:()=>N(!0),children:(0,b.jsx)(k.PencilIcon,{})})]})]}),u?null:(0,b.jsx)("div",{className:"max-[560px]:self-end",children:U})]}),(0,b.jsxs)("div",{className:`flex shrink-0 items-end justify-between gap-4 max-[860px]:flex-col max-[860px]:items-stretch ${u?"px-3":""}`,children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,b.jsx)("p",{className:"m-0 whitespace-nowrap font-mono text-[1.65rem] font-medium leading-none tracking-tight text-accent min-[440px]:text-[1.85rem] min-[560px]:text-[2rem]",children:(0,m.format_duration)(K,I,J)}),!M&&a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,l.format_display_tag)(a)},a))}):null]}),(0,b.jsxs)("div",{className:`flex min-w-0 shrink-0 flex-wrap items-center justify-end gap-2 max-[560px]:flex-col max-[560px]:items-stretch ${u?"w-full":"min-w-30 max-[860px]:w-full max-[860px]:justify-stretch"}`,children:[Q?null:(0,b.jsx)("button",{type:"button",className:`${(0,q.get_button_class_name)("ghost")} min-w-0 min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1`,disabled:C||M,onClick:()=>R(!0),children:"Add note"}),(0,b.jsx)(e.CheckoutButtonGroup,{in_bar:u,is_pending:C,on_check_out:v})]})]}),(0,b.jsx)(i.EntryNotesList,{notes:a.notes,variant:"panel",in_bar:u,is_pending:C,on_edit_note:A,on_delete_note:T}),Q?(0,b.jsx)("div",{className:"shrink-0",children:(0,b.jsx)(j.NoteForm,{in_active_panel:!0,in_bar:u,allow_at:!0,is_pending:C,on_cancel:()=>R(!1),on_submit:(a,b)=>{z(a,b),R(!1)}})}):null]})});a.s(["ActiveEntryPanel",0,s],78509)},73297,a=>{"use strict";async function b(a,b){let c=await fetch(a,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok)throw Error((await c.json()).error??"Request failed");return await c.json()}a.s(["delete_tracker_action",0,b])},68225,a=>{"use strict";a.s(["finish_running_pomodoro_timer",0,function(){}])},57377,115,a=>{"use strict";var b=a.i(87281);async function c(a){let b=await fetch("/api/sheet/active",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})});if(!b.ok)throw Error((await b.json()).error??"Failed to update active sheet in cloud")}var d=a.i(59659),e=a.i(5796);function f(a,f){if("/api/sheet"===a&&"object"==typeof f&&null!==f&&!0!==f.delete&&!(0,b.is_greedy_cloud_sync_enabled)()){let a=f.name?.trim()??"";a.length>0&&c(a).catch(()=>{});return}(0,b.is_greedy_cloud_sync_enabled)()?(0,e.schedule_tracker_db_cloud_sync)():(0,d.push_tracker_db_cloud_after_change)()}let g=new Set(["/api/note"]);async function h(a,b){let c={method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)},d=await fetch(a,c);if(!d.ok){var e,h;let b,f=(await d.json()).error??"Request failed";if(e=a,h=f,g.has(e)&&((b=h.toLowerCase()).includes("duplicate key")||b.includes("unique constraint"))){if(await new Promise(a=>{setTimeout(a,25)}),!(d=await fetch(a,c)).ok)throw Error((await d.json()).error??f)}else throw Error(f)}let i=await d.json();return f(a,b),i}a.s(["patch_tracker_action",0,h],57377);let i=new Set(["/api/note"]);async function j(a,b){let c={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)},d=await fetch(a,c);if(!d.ok){var e,g;let b,f=(await d.json()).error??"Request failed";if(e=a,g=f,i.has(e)&&((b=g.toLowerCase()).includes("duplicate key")||b.includes("unique constraint"))){if(await new Promise(a=>{setTimeout(a,25)}),!(d=await fetch(a,c)).ok)throw Error((await d.json()).error??f)}else throw Error(f)}let h=await d.json();return f(a,b),h}a.s(["post_tracker_action",0,j],115)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0n4osnj._.js.map
|