Files
alrahma_sunday_school_api/apps/admin/.next/static/chunks/3t7upkfpy4qk3.js
T
2026-06-11 03:22:12 -04:00

1 line
15 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return i}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function s(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,s(e));else t.set(r,s(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return j},NormalizeError:function(){return b},PageNotFoundError:function(){return y},SP:function(){return m},ST:function(){return x},WEB_VITALS:function(){return a},execOnce:function(){return s},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return N}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function s(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>i.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,x=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class b extends Error{}class y extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class j extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function N(e){return JSON.stringify({message:e.message,stack:e.stack})}},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},6655,e=>{"use strict";let t=e.i(47167).default.env.NEXT_PUBLIC_API_URL??"/admin/api/v1";e.s(["ADMIN_API_BASE",0,t])},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(51836)._(e.r(98183)),s=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==u?(u="//"+(u||""),o&&"/"!==o[0]&&(o="/"+o)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${o}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(71645);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=a(e,n)),t&&(o.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),o=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return y}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(51836),s=e.r(43476),i=a._(e.r(71645)),l=e.r(95057),u=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550);e.r(33525);let p=e.r(88540),h=e.r(91949),m=e.r(73668),x=e.r(9396);function g(t){var r,n;let o,a,g,[y,j]=(0,i.useOptimistic)(h.IDLE_LINK_STATUS),v=(0,i.useRef)(null),{href:N,as:k,children:_,prefetch:P=null,passHref:w,replace:S,shallow:E,scroll:O,onClick:C,onMouseEnter:L,onTouchStart:A,legacyBehavior:T=!1,onNavigate:R,transitionTypes:I,ref:M,unstable_dynamicOnHover:U,...$}=t;o=_,T&&("string"==typeof o||"number"==typeof o)&&(o=(0,s.jsx)("a",{children:o}));let B=i.default.useContext(u.AppRouterContext),D=!1!==P,F=!1!==P?null===(n=P)||"auto"===n?x.FetchStrategy.PPR:x.FetchStrategy.Full:x.FetchStrategy.PPR,z="string"==typeof(r=k||N)?r:(0,l.formatUrl)(r);if(T){if(o?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=i.default.Children.only(o)}let K=T?a&&"object"==typeof a&&a.ref:M,W=i.default.useCallback(e=>(null!==B&&(v.current=(0,h.mountLinkInstance)(e,z,B,F,D,j)),()=>{v.current&&((0,h.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,h.unmountPrefetchableInstance)(e)}),[D,z,B,F,j]),X={ref:(0,c.useMergedRef)(W,K),onClick(t){T||"function"!=typeof C||C(t),T&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!B||t.defaultPrevented||function(t,r,n,o,a,s,l){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(99781);i.default.startTransition(()=>{d(r,o?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,l)})}}(t,z,v,S,O,R,I)},onMouseEnter(e){T||"function"!=typeof L||L(e),T&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),B&&D&&(0,h.onNavigationIntent)(e.currentTarget,!0===U)},onTouchStart:function(e){T||"function"!=typeof A||A(e),T&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),B&&D&&(0,h.onNavigationIntent)(e.currentTarget,!0===U)}};return(0,d.isAbsoluteUrl)(z)?X.href=z:T&&!w&&("a"!==a.type||"href"in a.props)||(X.href=(0,f.addBasePath)(z)),g=T?i.default.cloneElement(a,X):(0,s.jsx)("a",{...$,...X,children:o}),(0,s.jsx)(b.Provider,{value:y,children:g})}e.r(84508);let b=(0,i.createContext)(h.IDLE_LINK_STATUS),y=()=>(0,i.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},13460,e=>{"use strict";var t=e.i(43476),r=e.i(51224);let n={en:{flag:"🇺🇸",shortLabel:"EN"},fr:{flag:"🇫🇷",shortLabel:"FR"},ar:{flag:"🇲🇦",shortLabel:"AR"}};function o(){let{language:e}=(0,r.useAdminI18n)(),o=n[e];return(0,t.jsx)("footer",{className:"border-t border-stone-200/80 bg-white/72 px-4 py-4 backdrop-blur-xl transition-colors dark:border-blue-900 dark:bg-[#07101e]/72",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-3 lg:flex-row",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs font-medium uppercase tracking-[0.16em] text-stone-400 dark:text-stone-500",children:[(0,t.jsx)("p",{children:{en:{preferences:"Admin preferences"},fr:{preferences:"Préférences dadministration"},ar:{preferences:"تفضيلات الإدارة"}}[e].preferences}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-stone-200/80 bg-white/95 px-2.5 py-1 text-stone-700 dark:border-blue-800 dark:bg-[#0d1b38]/85 dark:text-stone-200",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:o.flag}),(0,t.jsx)("span",{children:o.shortLabel})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 sm:flex-row",children:[(0,t.jsx)(r.AdminLanguageSwitcher,{}),(0,t.jsx)(r.AdminThemeSwitcher,{})]})]})})}var a=e.i(22016);let s={en:{flag:"🇺🇸",shortLabel:"EN"},fr:{flag:"🇫🇷",shortLabel:"FR"},ar:{flag:"🇲🇦",shortLabel:"AR"}};function i(){let{language:e}=(0,r.useAdminI18n)(),n=s[e],o={en:{admin:"Admin Console",signIn:"Sign in"},fr:{admin:"Console admin",signIn:"Connexion"},ar:{admin:"لوحة الإدارة",signIn:"تسجيل الدخول"}}[e];return(0,t.jsx)("header",{className:"sticky top-0 z-30 border-b border-stone-200/80 bg-white/78 backdrop-blur-xl transition-colors dark:border-blue-900 dark:bg-[#07101e]/76",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-4 px-4 py-4",children:[(0,t.jsxs)(a.default,{href:"/",className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-orange-700 dark:text-orange-300",children:"RentalDriveGo"}),(0,t.jsx)("span",{className:"hidden text-sm font-semibold text-stone-500 dark:text-stone-400 sm:inline",children:o.admin})]}),(0,t.jsxs)("nav",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex min-w-[3.5rem] items-center justify-center gap-1 rounded-full border border-stone-200/80 bg-white/95 px-2.5 py-2 text-xs font-semibold text-stone-700 dark:border-blue-800 dark:bg-[#0d1b38]/85 dark:text-stone-200",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:n.flag}),(0,t.jsx)("span",{children:n.shortLabel})]}),(0,t.jsx)(a.default,{href:"/login",className:"rounded-full bg-blue-900 px-4 py-2 text-sm font-semibold text-white transition hover:bg-orange-700 dark:bg-orange-400 dark:text-white dark:hover:bg-orange-300",children:o.signIn})]})]})})}e.s(["default",0,function({children:e}){return(0,t.jsxs)("div",{className:"flex min-h-screen flex-col bg-[linear-gradient(180deg,#ffffff_0%,#f5f8ff_28%,#eef4ff_58%,#ffffff_100%)] text-blue-950 transition-colors dark:bg-[linear-gradient(180deg,#0a1128_0%,#0d1b38_35%,#07101e_100%)] dark:text-slate-100",children:[(0,t.jsx)(i,{}),(0,t.jsx)("div",{className:"flex flex-1 flex-col",children:e}),(0,t.jsx)(o,{})]})}],13460)},29797,e=>{"use strict";var t=e.i(43476),r=e.i(22016),n=e.i(71645),o=e.i(13460),a=e.i(6655);e.s(["default",0,function(){let[e,s]=(0,n.useState)(""),[i,l]=(0,n.useState)(!1),[u,c]=(0,n.useState)(!1),[d,f]=(0,n.useState)(null);async function p(t){t.preventDefault(),l(!0),f(null);try{if(!(await fetch(`${a.ADMIN_API_BASE}/admin/auth/forgot-password`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:e})})).ok)throw Error();c(!0)}catch{f("Something went wrong. Please try again.")}finally{l(!1)}}return(0,t.jsx)(o.default,{children:(0,t.jsx)("main",{className:"flex flex-1 items-center justify-center px-4",children:(0,t.jsxs)("div",{className:"w-full max-w-md",children:[(0,t.jsxs)("div",{className:"mb-8 text-center",children:[(0,t.jsx)(r.default,{href:"/",className:"text-xs font-semibold uppercase tracking-[0.2em] text-orange-700 dark:text-orange-300",children:"RentalDriveGo"}),(0,t.jsx)("h1",{className:"mt-3 text-3xl font-black tracking-tight",children:"Forgot password"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-zinc-400",children:"Enter your admin email to receive a reset link."})]}),(0,t.jsxs)("div",{className:"panel p-8",children:[u?(0,t.jsxs)("div",{className:"space-y-3 text-center",children:[(0,t.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-emerald-900/40",children:(0,t.jsx)("svg",{className:"h-6 w-6 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,t.jsx)("p",{className:"text-sm text-zinc-300",children:"Check your email"}),(0,t.jsx)("p",{className:"text-xs text-zinc-500",children:"If that email is registered, a reset link has been sent. It expires in 60 minutes."})]}):(0,t.jsxs)("form",{onSubmit:p,className:"space-y-5",children:[d&&(0,t.jsx)("div",{className:"rounded-xl border border-red-900/50 bg-red-950/50 px-4 py-3 text-sm text-red-400",children:d}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1.5 block text-sm font-medium text-zinc-300",children:"Email"}),(0,t.jsx)("input",{type:"email",required:!0,value:e,onChange:e=>s(e.target.value),placeholder:"admin@rentaldrivego.com",className:"w-full rounded-2xl border border-stone-200 bg-white px-4 py-3 text-sm text-stone-900 placeholder:text-stone-400 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-orange-500 dark:border-blue-800 dark:bg-[#07101e]/80 dark:text-stone-100 dark:placeholder:text-stone-500"})]}),(0,t.jsx)("button",{type:"submit",disabled:i,className:"inline-flex w-full justify-center rounded-full bg-stone-900 px-6 py-3 text-sm font-semibold text-white transition hover:bg-orange-700 disabled:opacity-50 dark:bg-orange-400 dark:text-white dark:hover:bg-orange-300",children:i?"Sending…":"Send reset link"})]}),(0,t.jsx)("div",{className:"mt-6 text-center",children:(0,t.jsx)(r.default,{href:"/login",className:"text-sm text-zinc-500 hover:text-zinc-300 transition-colors",children:"Back to sign in"})})]})]})})})}])}]);