PageSourceSearch

https://crmandgo.com.au/static/js/3358.c6e97bae.chunk.js

js crmandgo.com.au collected 2026-10-04 01:54:53 UTC 10,344 bytes, 3 lines download raw bytes

1/*! For license information please see 3358.c6e97bae.chunk.js.LICENSE.txt */
2"use strict";(globalThis.webpackChunkfrontend=globalThis.webpackChunkfrontend||[]).push([[3358],{14224(e,t,s){s.d(t,{Gq:()=>i,VR:()=>c,bv:()=>n,e7:()=>r,n_:()=>l,vd:()=>o});var a=s(30112);const i=()=>a.default.get("/api/auth/2fa/status"),n=()=>a.default.post("/api/auth/2fa/setup"),o=e=>a.default.post("/api/auth/2fa/enable",{code:e}),l=e=>a.default.post("/api/auth/2fa/verify",{code:e}),r=e=>a.default.post("/api/auth/2fa/disable",{code:e}),c=()=>a.default.post("/api/auth/revoke-sessions")},55830(e,t,s){s.d(t,{dj:()=>u});var a=s(65043);let i=0;const n=new Map,o=e=>{if(n.has(e))return;const t=setTimeout(()=>{n.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);n.set(e,t)},l=[];let r={toasts:[]};function c(e){r=((e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{const{toastId:s}=t;return s?o(s):e.toasts.forEach(e=>{o(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===s||void 0===s?{...e,open:!1}:e)}}case"REMOVE_TOAST":return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}})(r,e),l.forEach(e=>{e(r)})}function d(e){let{...t}=e;const s=(i=(i+1)%Number.MAX_SAFE_INTEGER,i.toString()),a=()=>c({type:"DISMISS_TOAST",toastId:s});return c({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:e=>{e||a()}}}),{id:s,dismiss:a,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function u(){const[e,t]=a.useState(r);return a.useEffect(()=>(l.push(t),()=>{const e=l.indexOf(t);e>-1&&l.splice(e,1)}),[e]),{...e,toast:d,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},43358(e,t,s){s.d(t,{SecuritySettings:()=>g});var a=s(65043),i=s(36210),n=s(72313),o=s(3308),l=s(9493),r=s(42489),c=s(13390),d=s(5949),u=s(65598),h=s(55830),x=s(14224),m=s(70579);function p(e){return(e||"").replace(/(.{4})/g,"$1 ").trim()}function v(){const{toast:e}=(0,h.dj)(),[t,s]=(0,a.useState)(!0),[o,l]=(0,a.useState)(!1),[r,v]=(0,a.useState)(!1),[f,g]=(0,a.useState)(""),[b,j]=(0,a.useState)(""),[y,w]=(0,a.useState)(""),[N,S]=(0,a.useState)(!1),[k,T]=(0,a.useState)(!1),[A,C]=(0,a.useState)(null),[E,O]=(0,a.useState)(!1),[I,_]=(0,a.useState)("");(0,a.useEffect)(()=>{(async()=>{try{var e;const t=await(0,x.Gq)();l(!(null===(e=t.data)||void 0===e||!e.enabled))}catch{}finally{s(!1)}})()},[]);const D=()=>{v(!1),g(""),j(""),w(""),C(null)};return(0,m.jsxs)("div",{className:"rounded-xl border border-slate-200 bg-white shadow-sm",children:[(0,m.jsxs)("div",{className:"px-6 py-5",children:[(0,m.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,m.jsxs)("div",{className:"space-y-1",children:[(0,m.jsx)("h3",{className:"font-heading text-base font-semibold text-slate-900",children:"Two-Factor Authentication"}),(0,m.jsx)("p",{className:"text-sm text-slate-500",children:"Protect your account with a time-based code from an authenticator app (Google Authenticator, Authy, 1Password and others)."})]}),(0,m.jsx)(d.E,{variant:"outline",className:o?"border-green-200 bg-green-50 text-green-700 shrink-0":"border-slate-200 bg-slate-50 text-slate-600 shrink-0",children:t?"...":o?"Enabled":"Disabled"})]}),(0,m.jsx)("div",{className:"mt-4",children:o?(0,m.jsx)(c.$,{variant:"outline",size:"sm",className:"border-red-200 text-red-600 hover:bg-red-50 hover:text-red-700",onClick:()=>O(!0),children:"Turn off two-factor authentication"}):(0,m.jsx)(c.$,{variant:"outline",size:"sm",className:"text-slate-700 border-slate-200",onClick:async()=>{S(!0);try{const e=await(0,x.bv)();g(e.data.secret),j(e.data.otpauth_uri),w(""),C(null),v(!0)}catch(a){var t,s;e({title:"Could not start setup",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.detail)||"Please try again.",variant:"destructive"})}finally{S(!1)}},disabled:N||t,children:"Set up two-factor authentication"})})]}),(0,m.jsx)(u.lG,{open:r,onOpenChange:e=>e?null:D(),children:(0,m.jsx)(u.Cf,{className:"max-w-md",children:A?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(u.c7,{children:[(0,m.jsx)(u.L3,{className:"font-heading",children:"Save your backup codes"}),(0,m.jsx)(u.rr,{children:"Store these somewhere safe. Each code works once if you lose access to your authenticator. They will not be shown again."})]}),(0,m.jsx)("div",{className:"grid grid-cols-2 gap-2 bg-slate-50 border border-slate-200 rounded-lg p-3",children:A.map(e=>(0,m.jsx)("code",{className:"font-mono text-sm text-slate-800 text-center py-1",children:e},e))}),(0,m.jsxs)(u.Es,{children:[(0,m.jsxs)(c.$,{variant:"outline",onClick:()=>{var t;null===(t=navigator.clipboard)||void 0===t||t.writeText(A.join("\n")),e({title:"Backup codes copied"})},children:[(0,m.jsx)(n.A,{size:14,className:"mr-1.5"})," Copy codes"]}),(0,m.jsx)(c.$,{className:"bg-slate-900 text-white hover:bg-slate-800",onClick:D,children:"Done"})]})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(u.c7,{children:[(0,m.jsx)(u.L3,{className:"font-heading",children:"Set up two-factor authentication"}),(0,m.jsx)(u.rr,{children:"Add this key to your authenticator app, then enter the 6-digit code it shows."})]}),(0,m.jsxs)("div",{className:"space-y-4",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("p",{className:"text-xs font-medium text-slate-500 mb-1",children:"Setup key"}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("code",{className:"flex-1 font-mono text-sm bg-slate-50 border border-slate-200 rounded-lg px-3 py-2 tracking-wider break-all",children:p(f)}),(0,m.jsx)(c.$,{variant:"outline",size:"icon",onClick:()=>{var e;
2null===(e=navigator.clipboard)||void 0===e||e.writeText(f),T(!0),setTimeout(()=>T(!1),1500)},"aria-label":"Copy key",children:k?(0,m.jsx)(i.A,{size:15,className:"text-green-600"}):(0,m.jsx)(n.A,{size:15})})]}),b&&(0,m.jsx)("a",{href:b,className:"inline-block mt-2 text-xs text-blue-600 hover:underline",children:"Open in authenticator app"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("p",{className:"text-xs font-medium text-slate-500 mb-1",children:"6-digit code"}),(0,m.jsx)("input",{value:y,onChange:e=>w(e.target.value.replace(/\D/g,"").slice(0,6)),inputMode:"numeric",placeholder:"000000",className:"w-full h-10 px-3 font-mono text-lg tracking-widest rounded-lg border border-slate-200 focus:border-slate-400 focus:outline-none"})]})]}),(0,m.jsxs)(u.Es,{children:[(0,m.jsx)(c.$,{variant:"outline",onClick:D,children:"Cancel"}),(0,m.jsx)(c.$,{className:"bg-slate-900 text-white hover:bg-slate-800",onClick:async()=>{S(!0);try{const t=await(0,x.vd)(y.trim());C(t.data.backup_codes||[]),l(!0),e({title:"Two-factor authentication enabled"})}catch(a){var t,s;e({title:"Incorrect code",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.detail)||"Check the 6-digit code and try again.",variant:"destructive"})}finally{S(!1)}},disabled:N||6!==y.length,children:"Verify & enable"})]})]})})}),(0,m.jsx)(u.lG,{open:E,onOpenChange:O,children:(0,m.jsxs)(u.Cf,{className:"max-w-sm",children:[(0,m.jsxs)(u.c7,{children:[(0,m.jsx)(u.L3,{className:"font-heading",children:"Turn off two-factor authentication?"}),(0,m.jsx)(u.rr,{children:"Enter a current 6-digit code (or a backup code) to confirm. This makes your account less secure."})]}),(0,m.jsx)("input",{value:I,onChange:e=>_(e.target.value.slice(0,9)),placeholder:"Code",className:"w-full h-10 px-3 font-mono tracking-widest rounded-lg border border-slate-200 focus:border-slate-400 focus:outline-none"}),(0,m.jsxs)(u.Es,{children:[(0,m.jsx)(c.$,{variant:"outline",onClick:()=>O(!1),children:"Cancel"}),(0,m.jsx)(c.$,{className:"bg-red-600 text-white hover:bg-red-700",onClick:async()=>{S(!0);try{await(0,x.e7)(I.trim()),l(!1),O(!1),_(""),e({title:"Two-factor authentication disabled"})}catch(a){var t,s;e({title:"Incorrect code",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.detail)||"Enter a current code or a backup code.",variant:"destructive"})}finally{S(!1)}},disabled:N||I.length<6,children:"Turn off"})]})]})})]})}function f(){const{toast:e}=(0,h.dj)(),[t,s]=(0,a.useState)(!1);return(0,m.jsx)("div",{className:"rounded-xl border border-slate-200 bg-white shadow-sm",children:(0,m.jsx)("div",{className:"px-6 py-5",children:(0,m.jsxs)("div",{className:"flex items-start gap-3",children:[(0,m.jsx)(o.A,{className:"w-5 h-5 text-slate-400 mt-0.5"}),(0,m.jsxs)("div",{className:"flex-1",children:[(0,m.jsx)("h3",{className:"font-heading text-base font-semibold text-slate-900 mb-1",children:"Active sessions"}),(0,m.jsx)("p",{className:"text-sm text-slate-500 mb-4",children:"Sign out of CRMandGo on every device. Use this if you have lost a device or think someone else may have access."}),(0,m.jsxs)(c.$,{variant:"outline",size:"sm",className:"border-slate-200 text-slate-700",onClick:async()=>{s(!0);try{await(0,x.VR)(),e({title:"Signed out on all devices"}),setTimeout(()=>{window.location.href="/login"},800)}catch(i){var t,a;e({title:"Could not sign out everywhere",description:(null===i||void 0===i||null===(t=i.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.detail)||"Please try again.",variant:"destructive"}),s(!1)}},disabled:t,children:[(0,m.jsx)(l.A,{size:14,className:"mr-1.5"}),"Sign out everywhere"]})]})]})})})}function g(){return(0,m.jsxs)("div",{className:"max-w-2xl space-y-6",children:[(0,m.jsxs)("div",{className:"flex items-center gap-3",children:[(0,m.jsx)(r.A,{className:"w-5 h-5 text-slate-400"}),(0,m.jsx)("h2",{className:"font-heading text-lg font-semibold text-slate-900 tracking-tight",children:"Security"})]}),(0,m.jsx)(v,{}),(0,m.jsx)(f,{})]})}},72313(e,t,s){s.d(t,{A:()=>a});
2const a=(0,s(77784).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3308(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])}}]);
3//# sourceMappingURL=3358.c6e97bae.chunk.js.map

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.