Files
boc/web/_next/static/chunks/3jegf_ml6hiei.js
T

1 line
8.9 KiB
JavaScript

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,143,e=>{"use strict";async function t(e,a={}){let s=localStorage.getItem("amos_token"),r=await fetch(`/api/v1${e}`,{...a,headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...a.headers}});if(!r.ok)throw Error((await r.json().catch(()=>({}))).error||`HTTP ${r.status}`);return r.json()}e.s(["api",0,{auth:{login:(e,a)=>t("/auth/login",{method:"POST",body:JSON.stringify({email:e,password:a})}),me:()=>t("/auth/me")},crm:{customers:()=>t("/crm/customers")},sales:{deals:()=>t("/sales/deals")},finance:{balance:()=>t("/finance/balance"),accounts:()=>t("/finance/accounts")},hr:{employees:()=>t("/hr/employees")},legal:{contracts:()=>t("/legal/contracts")}}])},78629,e=>{"use strict";let t=(0,e.i(64828).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,t],78629)},88767,e=>{"use strict";let t=(0,e.i(64828).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],88767)},45665,21806,e=>{"use strict";var t=e.i(1624),a=e.i(30573);e.s(["Label",0,function({className:e,...s}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,a.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...s})}],45665),e.i(59217);var s=e.i(62714),r=e.i(51385),i=e.i(46392);let n=s.forwardRef(function(e,t){let{render:a,className:s,disabled:n=!1,focusableWhenDisabled:o=!1,nativeButton:d=!0,style:l,...c}=e,{getButtonProps:u,buttonRef:m}=(0,r.useButton)({disabled:n,focusableWhenDisabled:o,native:d});return(0,i.useRenderElement)("button",e,{state:{disabled:n},ref:[t,m],props:[c,u]})}),o=(0,e.i(54044).cva)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:s="default",size:r="default",...i}){return(0,t.jsx)(n,{"data-slot":"button",className:(0,a.cn)(o({variant:s,size:r,className:e})),...i})}],21806)},21159,e=>{"use strict";var t=e.i(1624),a=e.i(62714),s=e.i(61268),r=e.i(91054),i=e.i(143),n=e.i(43673),o=e.i(1791),d=e.i(45665),l=e.i(21806),c=e.i(78629),u=e.i(88767);let m=(0,e.i(64828).default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["default",0,function(){let e=(0,s.useRouter)(),[x,p]=(0,a.useState)("erik@admin.amos.systems"),[h,g]=(0,a.useState)(""),[b,v]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),[j,k]=(0,a.useState)(""),N=async t=>{t.preventDefault(),y(!0),k("");try{let t=await i.api.auth.login(x,h);t.ok&&t.token&&(localStorage.setItem("amos_token",t.token),e.push("/dashboard"))}catch(e){k(e.message||"Login failed")}finally{y(!1)}};return(0,t.jsx)("div",{className:"min-h-screen bg-[#F7F9FC] flex items-center justify-center p-4",children:(0,t.jsxs)(r.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:"easeOut"},className:"w-full max-w-md",children:[(0,t.jsx)("div",{className:"flex items-center justify-center mb-8",children:(0,t.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-[#1E3A5F] flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-white font-bold text-xl",children:"A"})})}),(0,t.jsxs)(n.Card,{className:"p-8 bg-white rounded-2xl border border-[#E5E7EB] shadow-[0_8px_32px_rgba(0,0,0,0.08)]",children:[(0,t.jsxs)("div",{className:"text-center mb-6",children:[(0,t.jsx)("h1",{className:"text-xl font-bold text-[#111827]",children:"Welcome back"}),(0,t.jsx)("p",{className:"text-sm text-[#6B7280] mt-1",children:"Sign in to AMOS Financial Operating System"})]}),j&&(0,t.jsxs)(r.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"flex items-center gap-2 p-3 rounded-xl bg-red-50 text-red-700 text-sm mb-4",children:[(0,t.jsx)(c.AlertCircle,{className:"w-4 h-4 flex-shrink-0"}),j]}),(0,t.jsxs)("form",{onSubmit:N,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(d.Label,{className:"text-xs text-[#6B7280]",children:"Email"}),(0,t.jsx)(o.Input,{type:"email",value:x,onChange:e=>p(e.target.value),placeholder:"you@company.com",className:"h-11 rounded-xl border-[#E5E7EB] focus:ring-2 focus:ring-[#2563EB]/20",required:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(d.Label,{className:"text-xs text-[#6B7280]",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(o.Input,{type:b?"text":"password",value:h,onChange:e=>g(e.target.value),placeholder:"Enter your password",className:"h-11 rounded-xl border-[#E5E7EB] focus:ring-2 focus:ring-[#2563EB]/20 pr-10",required:!0}),(0,t.jsx)("button",{type:"button",onClick:()=>v(!b),className:"absolute right-3 top-1/2 -translate-y-1/2 text-[#9CA3AF] hover:text-[#6B7280] transition-colors",children:b?(0,t.jsx)(m,{className:"w-4 h-4"}):(0,t.jsx)(u.Eye,{className:"w-4 h-4"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",className:"w-4 h-4 rounded border-[#D1D5DB] text-[#2563EB] focus:ring-[#2563EB]"}),(0,t.jsx)("span",{className:"text-xs text-[#6B7280]",children:"Remember me"})]}),(0,t.jsx)("button",{type:"button",className:"text-xs text-[#2563EB] hover:text-[#1E3A5F] transition-colors font-medium",children:"Forgot password?"})]}),(0,t.jsx)(l.Button,{type:"submit",disabled:f,className:"w-full h-11 bg-[#1E3A5F] hover:bg-[#1E3A5F]/90 text-white rounded-xl font-medium transition-all",children:f?(0,t.jsx)("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}):"Sign In"})]}),(0,t.jsx)("div",{className:"mt-6 pt-4 border-t border-[#E5E7EB]",children:(0,t.jsxs)("p",{className:"text-center text-xs text-[#9CA3AF]",children:["Demo credentials: ",(0,t.jsx)("span",{className:"text-[#6B7280] font-medium",children:"erik@admin.amos.systems"})," / ",(0,t.jsx)("span",{className:"text-[#6B7280] font-medium",children:"Erik1987"})]})})]}),(0,t.jsx)("p",{className:"text-center text-xs text-[#9CA3AF] mt-6",children:"© 2024 AMOS Systems AB. All rights reserved."})]})})}],21159)}]);