1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{6882:function(e,t,s){Promise.resolve().then(s.t.bind(s,8877,23)),Promise.resolve().then(s.bind(s,3462)),Promise.resolve().then(s.bind(s,4524)),Promise.resolve().then(s.bind(s,8775)),Promise.resolve().then(s.bind(s,1164)),Promise.resolve().then(s.t.bind(s,3247,23))},3462:function(e,t,s){"use strict";s.d(t,{SettingsMenu:function(){return et}});var a=s(7437),r=s(2265),n=s(7776),l=s(9512),i=s(4697),d=s(4258),o=s(8296),c=s(2699),m=s(1077),u=s(4122),p=s(8184),x=s(7164),f=s(7390),h=s(6162),j=s(9538),g=s(6234),N=s(495),y=s(1622),b=s(7592),v=s(2468),w=s(8165),k=s(7440);let C=y.fC,S=y.xz,R=y.ZA;y.Uv,y.Tr,y.Ee,r.forwardRef((e,t)=>{let{className:s,inset:r,children:n,...l}=e;return(0,a.jsxs)(y.fF,{ref:t,className:(0,k.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",r&&"pl-8",s),...l,children:[n,(0,a.jsx)(b.Z,{className:"ml-auto h-4 w-4"})]})}).displayName=y.fF.displayName,r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(y.tu,{ref:t,className:(0,k.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...r})}).displayName=y.tu.displayName;let A=r.forwardRef((e,t)=>{let{className:s,sideOffset:r=4,...n}=e;return(0,a.jsx)(y.Uv,{children:(0,a.jsx)(y.VY,{ref:t,sideOffset:r,className:(0,k.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...n})})});A.displayName=y.VY.displayName;let _=r.forwardRef((e,t)=>{let{className:s,inset:r,...n}=e;return(0,a.jsx)(y.ck,{ref:t,className:(0,k.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r&&"pl-8",s),...n})});_.displayName=y.ck.displayName,r.forwardRef((e,t)=>{let{className:s,children:r,checked:n,...l}=e;return(0,a.jsxs)(y.oC,{ref:t,className:(0,k.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:n,...l,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(y.wU,{children:(0,a.jsx)(v.Z,{className:"h-4 w-4"})})}),r]})}).displayName=y.oC.displayName,r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(y.Rk,{ref:t,className:(0,k.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(y.wU,{children:(0,a.jsx)(w.Z,{className:"h-2 w-2 fill-current"})})}),r]})}).displayName=y.Rk.displayName;let z=r.forwardRef((e,t)=>{let{className:s,inset:r,...n}=e;return(0,a.jsx)(y.__,{ref:t,className:(0,k.cn)("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",s),...n})});z.displayName=y.__.displayName;let Z=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(y.Z0,{ref:t,className:(0,k.cn)("-mx-1 my-1 h-px bg-muted",s),...r})});Z.displayName=y.Z0.displayName;let E=e=>{let{className:t,...s}=e;return(0,a.jsx)("span",{className:(0,k.cn)("ml-auto text-xs tracking-widest opacity-60",t),...s})};E.displayName="DropdownMenuShortcut";var I=s(837);let O=e=>{let{keys:t}=e,s=(0,g.i)(),n="macos"===s||"ios"===s,[l,i]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{i(!0)},[]),!l)return null;let d=t.map(e=>{switch(e){case"mod":return n?(0,a.jsx)("p",{className:"text-sm",children:"â"}):(0,a.jsx)("p",{className:"text-sm",children:"Ctrl"});case"shift":return(0,a.jsx)("span",{children:"â"});case"ArrowRight":return(0,a.jsx)("span",{children:"â"});case"ArrowLeft":return(0,a.jsx)("span",{children:"â"});case"alt":return n?(0,a.jsx)("span",{children:"â¥"}):(0,a.jsx)("span",{children:"Alt"});default:return e}});return(0,a.jsx)("div",{className:"p-1 flex itesm-center gap-0.5 rounded-md bg-muted border border-foreground
1/10 text-sm",children:d})},Y=e=>{let{open:t,setOpen:s}=e;return(0,a.jsx)(I.Vq,{open:t,onOpenChange:s,children:(0,a.jsxs)(I.cZ,{children:[(0,a.jsxs)(I.fK,{children:[(0,a.jsx)(I.$N,{children:"Keyboard shortcuts"}),(0,a.jsx)(I.Be,{children:"Here are all the keyboard shortcuts for the app."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 py-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("p",{className:"font-medium",children:"Add subscription"}),(0,a.jsx)(O,{keys:["mod","A"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("p",{className:"font-medium",children:"Previous month"}),(0,a.jsx)(O,{keys:["ArrowLeft"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("p",{className:"font-medium",children:"Next month"}),(0,a.jsx)(O,{keys:["ArrowRight"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("p",{className:"font-medium",children:"Go to current month"}),(0,a.jsx)(O,{keys:["M"]})]})]})]})})},P=e=>{let{open:t,setOpen:s}=e;return(0,a.jsx)(I.Vq,{open:t,onOpenChange:s,children:(0,a.jsxs)(I.cZ,{children:[(0,a.jsxs)(I.fK,{children:[(0,a.jsx)(I.$N,{children:"Credits"}),(0,a.jsx)(I.Be,{children:"This app would not be possible without the people that ideated and designed it."})]}),(0,a.jsxs)("div",{className:"py-4 flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("a",{href:"https://x.com/dana_daniellaa",target:"_blank",className:"underline",children:"Daniella"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"The entire idea behind this app was originally conceptualized and designed by Daniella."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("a",{href:"https://x.com/KumailNanji",target:"_blank",className:"underline",children:"Kumail Nanji"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Kumail prototyped the animations and added more interactions and UI elements to Daniella's design."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("a",{href:"https://x.com/iamnitinr",target:"_blank",className:"underline",children:"Nitin Ranganath"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"That's me! With all the design and interactions laid out from Daniella and Kumail, I did my part in making this app a reality."})]})]})]})})};var D=s(6466);let T=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("textarea",{className:(0,k.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...r})});T.displayName="Textarea";var F=s(3102);let K=e=>{let{open:t,setOpen:s}=e,[l,i]=(0,r.useState)(""),[d,o]=(0,r.useState)(!1),[c,m]=(0,r.useState)(""),u=async e=>{if(e.preventDefault(),!l.trim()){n.Am.error("Please enter your feedback");return}(await fetch("/api/feedback",{method:"POST",body:JSON.stringify({feedback:l,shouldContact:d,contactInfo:c})})).ok?(s(!1),n.Am.success("Feedback submitted")):n.Am.error("Failed to submit feedback",{description:"Please try again later"})};return(0,a.jsx)(I.Vq,{open:t,onOpenChange:s,children:(0,a.jsx)(I.cZ,{children:(0,a.jsxs)("form",{onSubmit:u,children:[(0,a.jsxs)(I.fK,{children:[(0,a.jsx)(I.$N,{children:"Feedback / Feature Requests"}),(0,a.jsx)(I.Be,{children:"If you have any feedback or feature requests, please let me know!"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-4",children:[(0,a.jsx)(T,{placeholder:"Your feedback...",value:l,onChange:e=>i(e.target.value)}),(0,a.jsxs)("div",{className:"flex flex-row items-start space-x-3 space-y-0 rounded-md border p-4",children:[(0,a.jsx)(D.X,{checked:d,onCheckedChange:e=>o(e)}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 leading-none",children:[(0,a.jsx)("p",{className:"text-sm",children:"Update me once the feedback is implemented"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"If you would like to be notified once the feedback is implemented, please enter your email address or Twitter handle."}),(0,a.jsx)(F.I,{placeholder:"Your email address or Twitter handle",value:c,onChange:e=>m(e.target.value),className:"mt-2",disabled:!d})]})]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Alternately, you can also reach out to me on"," ",(0,a.jsx)("a",{href:"https://x.com/iamnitinr",target:"_blank",className:"underline",children:"Twitter"})," "]})]}),(0,a.jsx)(I.cN,{children:(0,a.jsx)(N.z,{children:"Submit"})})]})})})};var B=s(22),q=s(6729),U=s(9573),V=s(4261),J=s(4817);let L=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(V.mY,{ref:t,className:(0,k.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s),...r})});L.displayName=V.mY.displayName;let M=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,a.jsx)(J.Z,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)(V.mY.Input,{ref:t,className:(0,k.cn)("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",s),...r})]})});M.displayName=V.mY.Input.displayName;let $=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(V.mY.List,{ref:t,className:(0,k.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden",s),...r})});$.displayName=V.mY.List.displayName;let G=r.forwardRef((e,t)=>(0,a.jsx)(V.mY.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));G.displayName=V.mY.Empty.displayName;let H=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(V.mY.Group,{ref:t,className:(0,k.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",s),...r})});H.displayName=V.mY.Group.displayName,r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(V.mY.Separator,{ref:t,className:(0,k.cn)("-mx-1 h-px bg-border",s),...r})}).displayName=V.mY.Separator.displayName;let W=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(V.mY.Item,{ref:t,className:(0,k.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",s),...r})});W.displayName=V.mY.Item.displayName;var X=s(4880),Q=s(1282);let ee=e=>{var t;let{open:s,setOpen:n}=e,[l,i]=(0,r.useState)(!1),[d,o]=(0,r.useState)((0,q.zC)()),c=Array.from(new Set(Object.values(q.m6))).map(e=>({label:"".concat(q.Jv[e]," (").concat(e,")"),value:e}));return(0,a.jsx)(I.Vq,{open:s,onOpenChange:n,children:(0,a.jsxs)(I.cZ,{children:[(0,a.jsxs)(I.fK,{children:[(0,a.jsx)(I.$N,{children:"Change currency"}),(0,a.jsx)(I.Be,{children:"Pick a currency to use for your subscriptions"})]}),(0,a.jsxs)(U.J2,{open:l,onOpenChange:i,modal:!0,children:[(0,a.jsx)(U.xo,{children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(N.z,{variant:"outline","aria-expanded":s,onClick:()=>{i(!0)},className:"w-full justify-between",children:[d?null===(t=c.find(e=>e.value===d))||void 0===t?void 0:t.label:"Select currency",(0,a.jsx)(Q.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground text-left mt-2",children:"A refresh is required for the changes to take effect."})]})}),(0,a.jsx)(U.yk,{className:"w-full p-0",children:(0,a.jsxs)(L,{children:[(0,a.jsx)(M,{placeholder:"Search currency..."}),(0,a.jsxs)($,{className:"h-40",children:[(0,a.jsx)(G,{children:"No currency foun
1d."}),(0,a.jsx)(X.x,{className:"h-64",children:(0,a.jsx)(H,{children:c.map(e=>(0,a.jsxs)(W,{value:e.value,onSelect:e=>{o(e===d?"":e)},children:[(0,a.jsx)(v.Z,{className:(0,k.cn)("mr-2 h-4 w-4",d===e.value?"opacity-100":"opacity-0")}),e.label]},e.value))})})]})]})})]}),(0,a.jsx)(I.cN,{children:(0,a.jsx)(N.z,{onClick:()=>{localStorage.setItem("CURRENCY_PREFERENCE",d),n(!1)},children:"Save"})})]})})},et=()=>{let{theme:e,setTheme:t}=(0,l.F)(),{exportSubscriptions:s,importSubscriptions:y}=(0,B.P)(),b=()=>{t("light"===e?"dark":"light")};(0,j.A)([["alt+t",b]]);let v=(0,g.i)(),[w,k]=(0,r.useState)(!1),[I,O]=(0,r.useState)(!1),D=async e=>{var t;let s=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!s)return;let a=await s.text();try{let e=JSON.parse(a);if(!Array.isArray(e)){n.Am.error("Imported data is invalid",{description:"Please ensure the data is in the correct format"});return}let t=e.filter(e=>e.id&&e.name&&void 0!==e.price&&null!==e.price&&e.startDate&&e.interval?"string"!=typeof e.id||"string"!=typeof e.name||"number"!=typeof e.price||isNaN(new Date(e.startDate).getTime())||!["monthly","quarterly","yearly"].includes(e.interval)?(n.Am.error("Invalid data types in subscription: ".concat(e.name)),!1):!(e.endDate&&isNaN(new Date(e.endDate).getTime()))||(n.Am.error("Invalid end date in subscription: ".concat(e.name)),!1):(n.Am.error("".concat(e.name," is missing required fields"),{description:"Please ensure all fields are present"}),!1));y(t)}catch(e){n.Am.error("Error importing data: "+e.message)}y(JSON.parse(a))},T=(0,r.useRef)(null),[F,q]=(0,r.useState)(!1),[U,V]=(0,r.useState)(!1),[J,L]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{V("true"!==localStorage.getItem("DISMISS_FEEDBACK_BANNER"))},[]),(0,a.jsxs)(a.Fragment,{children:[U&&(0,a.jsxs)("div",{className:"fixed text-sm top-0 bg-emerald-300/50 dark:bg-emerald-400/20 p-3 px-8 cursor-pointer w-full left-0 text-emerald-900 dark:text-emerald-400 text-center",onClick:()=>q(!0),children:["Subtrackt is looking for your feedback & feature requests. Click here to share your thoughts.",(0,a.jsx)(i.Z,{className:"size-5 absolute right-2 top-1/2 -translate-y-1/2 cursor-pointer",onClick:e=>{e.stopPropagation(),localStorage.setItem("DISMISS_FEEDBACK_BANNER","true"),V(!1)}})]}),(0,a.jsx)("input",{type:"file",onChange:D,hidden:!0,accept:"application/json",ref:T}),(0,a.jsxs)(C,{children:[(0,a.jsx)(S,{asChild:!0,children:(0,a.jsx)(N.z,{size:"icon",variant:"outline",children:(0,a.jsx)(d.Z,{className:"size-5 text-muted-foreground"})})}),(0,a.jsxs)(A,{className:"w-56",align:"end",sideOffset:10,children:[(0,a.jsxs)(z,{children:["Subtrackt",(0,a.jsx)("span",{className:"bg-muted ml-1 text-muted-foreground text-[8px] uppercase px-1 py-0.5 rounded",children:"Beta"})]}),(0,a.jsx)(Z,{}),(0,a.jsxs)(R,{children:[(0,a.jsxs)(_,{onClick:b,children:["light"===e?(0,a.jsx)(o.Z,{className:"size-4 mr-2"}):(0,a.jsx)(c.Z,{className:"size-4 mr-2"}),(0,a.jsx)("span",{children:"Toggle theme"}),(0,a.jsx)(E,{children:"macos"===v||"ios"===v?"â¥T":"Alt+T"})]}),(0,a.jsxs)(_,{onClick:()=>L(!0),children:[(0,a.jsx)(m.Z,{className:"size-4 mr-2"}),(0,a.jsx)("span",{children:"Change currency"})]}),(0,a.jsxs)(_,{onClick:()=>k(!0),children:[(0,a.jsx)(u.Z,{className:"size-4 mr-2"}),(0,a.jsx)("span",{children:"Keyboard shortcuts"})]})]}),(0,a.jsx)(Z,{}),(0,a.jsxs)(R,{children:[(0,a.jsxs)(_,{onClick:()=>{var e;return null===(e=T.current)||void 0===e?void 0:e.click()},children:[(0,a.jsx)(p.Z,{className:"size-4 mr-2"}),(0,a.jsx)("span",{children:"Import data"})]}),(0,a.jsxs)(_,{onClick:s,children:[(0,a.jsx)(x.Z,{className:"size-4 mr-2"}),(0,a.jsx)("span",{children:"Export data"})]})]}),(0,a.jsx)(Z,{}),(0,a.jsxs)(R,{children:[(0,a.jsxs)(_,{onClick:()=>q(!0),children:[(0,a.jsx)(f.Z,{className:"size-4 mr-2"}),(0,a.jsx)("span",{children:"Leave feedback"})]}),(0,a.jsxs)(_,{onClick:()=>O(!0),children:[(0,a.jsx)(h.Z,{className:"size-3 mr-2"}),(0,a.jsx)("span",{children:"Credits"})]})]})]})]}),(0,a.jsx)(Y,{open:w,setOpen:k}),(0,a.jsx)(P,{open:I,setOpen:O}),(0,a.jsx)(K,{open:F,setOpen:q}),(0,a.jsx)(ee,{open:J,setOpen:L})]})}},4524:function(e,t,s){"use strict";s.d(t,{ThemeProvider:function(){return n}});var a=s(7437),r=s(9512);function n(e){let{children:t,...s}=e;return(0,a.jsx)(r.f,{...s,children:t})}},8775:function(e,t,s){"use strict";s.d(t,{Toaster:function(){return l}});var a=s(7437),r=s(9512),n=s(7776);let l=e=>{let{...t}=e,{theme:s="system"}=(0,r.F)();return(0,a.jsx)(n.x7,{theme:s,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})}},8877:function(){}},function(e){e.O(0,[569,62,361,967,971,23,744],function(){return e(e.s=6882)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.