1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6729],{120:(e,r,s)=>{s.d(r,{N_:()=>i,a8:()=>c,rd:()=>d});var a=s(5251),t=s(4497),l=s(242);let n=(0,t.A)({locales:[...l.FS],defaultLocale:l.Xn,localePrefix:"as-needed",localeDetection:l.pN,localeCookie:{name:"NEXT_LOCALE",sameSite:"lax",maxAge:31536e3}}),{Link:i,redirect:o,usePathname:c,useRouter:d,getPathname:u}=(0,a.A)(n)},3691:(e,r,s)=>{s.d(r,{A:()=>o,AuthProvider:()=>i});var a=s(5155),t=s(2115),l=s(901);let n=(0,t.createContext)(null);function i(e){let{children:r}=e,[s,i]=(0,t.useState)("loading"),[o,c]=(0,t.useState)(null),d=(0,t.useRef)(!1),u=(0,t.useCallback)(async()=>{try{let e=await (0,l.e)().me();e?(c(e),i("authed")):(c(null),i("anonymous"))}catch(e){c(null),i("anonymous")}},[]);(0,t.useEffect)(()=>{d.current||(d.current=!0,u())},[u]);let h=(0,t.useCallback)(e=>(0,l.e)().sendSmsCode(e,"login"),[]),m=(0,t.useCallback)(async(e,r)=>{let s=await (0,l.e)().login(e,r);return c(s),i("authed"),s},[]),x=(0,t.useCallback)((e,r)=>(0,l.e)().sendEmailCode(e,"login",r),[]),p=(0,t.useCallback)(async(e,r)=>{let s=await (0,l.e)().emailLogin(e,r);return c(s),i("authed"),s},[]),j=(0,t.useCallback)(()=>(0,l.e)().getWechatQrCode(),[]),f=(0,t.useCallback)(e=>(0,l.e)().checkWechatLogin(e),[]),v=(0,t.useCallback)(e=>{c(e),i("authed")},[]),g=(0,t.useCallback)(async()=>{await (0,l.e)().logout(),c(null),i("anonymous")},[]),b=(0,t.useMemo)(()=>({status:s,session:o,sendCode:h,login:m,sendEmailCode:x,emailLogin:p,logout:g,getWechatQrCode:j,checkWechatLogin:f,applyWechatSession:v,refresh:u}),[s,o,h,m,x,p,g,j,f,v,u]);return(0,a.jsx)(n.Provider,{value:b,children:r})}function o(){let e=(0,t.useContext)(n);if(!e)throw Error("useAuth å¿
é¡»å¨ <AuthProvider> å
使ç¨");return e}},3945:(e,r,s)=>{s.d(r,{ToastProvider:()=>c,d:()=>i});var a=s(5155),t=s(2115),l=s(5141);let n=(0,t.createContext)(()=>{});function i(){return(0,t.useContext)(n)}let o={success:(0,a.jsx)(l.iW,{size:20}),info:(0,a.jsx)(l.G_,{size:20}),warning:(0,a.jsx)(l.iQ,{size:20}),error:(0,a.jsx)(l.GB,{size:20})};function c(e){let{children:r}=e,[s,l]=(0,t.useState)([]),i=(0,t.useRef)(1),c=(0,t.useRef)(new Map),d=(0,t.useRef)(null),u=(0,t.useCallback)(e=>{l(r=>r.filter(r=>r.id!==e));let r=c.current.get(e);r&&clearTimeout(r),c.current.delete(e)},[]),h=(0,t.useCallback)(e=>{let r=setTimeout(()=>u(e),2e3);c.current.set(e,r)},[u]),m=(0,t.useCallback)(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=i.current++;l(a=>{let t=[...a,{id:s,type:r,message:e}];return t.length>3?t.slice(t.length-3):t}),h(s)},[h]);return(0,t.useEffect)(()=>{let e=d.current;if(e&&"function"==typeof e.showPopover)if(s.length>0){if(!e.matches(":popover-open"))try{e.showPopover()}catch(e){}}else e.matches(":popover-open")&&e.hidePopover()},[s]),(0,a.jsxs)(n.Provider,{value:m,children:[r,(0,a.jsx)("div",{ref:d,className:"toast-region",popover:"manual","aria-live":"polite",children:s.map(e=>(0,a.jsxs)("div",{className:"toast ".concat(e.type),role:"error"===e.type?"alert":void 0,onMouseEnter:()=>{let r=c.current.get(e.id);r&&clearTimeout(r)},onMouseLeave:()=>h(e.id),children:[o[e.type],(0,a.jsx)("span",{children:e.message})]},e.id))})]})}},6729:(e,r,s)=>{s.d(r,{LoginModalProvider:()=>P,G:()=>B});var a=s(5155),t=s(2115),l=s(5239),n=s(63),i=s(8955),o=s(5141),c=s(120),d=s(3945),u=s(3691),h=s(1906),m=s(242);function x(e){let{onBusyChange:r}=e,s=(0,i.c)("auth.form"),[l,n]=(0,t.useState)(null),o=e=>{if(!l){n(e),null==r||r(!0);let s=encodeURIComponent(window.location.pathname+window.location.search);window.location.href="/api/auth/oauth/".concat(e,"/start?next=").concat(s)}};return(0,a.jsxs)("div",{className:"lm-oauth","aria-busy":!!l||void 0,children:[(0,a.jsxs)("button",{type:"button",className:"oauth-btn",onClick:()=>o("google"),"aria-label":s("oauthGoogle"),"aria-busy":"google"===l||void 0,children:[(0,a.jsx)("span",{className:"oauth-ico",children:"google"===l?(0,a.jsx)(p,{}):(0,a.jsx)(j,{})}),(0,a.jsx)("span",{className:"oauth-label",children:s("google"===l?"oauthRedirecting":"oauthGoogle")})]}),(0,a.jsxs)("button",{type:"button",className:"oauth-btn",onClick:()=>o("github"),"aria-label":s("oauthGithub"),"aria-busy":"github"===l||void 0,children:[(0,a.jsx)("span",{className:"oauth-ico",children:"github"===l?(0,a.jsx)(p,{}):(0,a.jsx)(f,{})}),(0,a.jsx)("span",{className:"oauth-label",children:s("github"===l?"oauthRedirecting":"oauthGithub")})]}),(0,a.jsx)("div",{className:"lm-divider",children:(0,a.jsx)("span",{children:s("oauthDivider")})})]})}function p(){return(0,a.jsx)("span",{className:"spin","aria-hidden":"true"})}function j(){return(0,a.jsxs)("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":"true",children:[(0,a.jsx)("path",{fill:"#4285F4",d:"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84a4.14 4.14 0 0 1-1.8 2.72v2.26h2.92c1.7-1.57 2.68-3.88 2.68-6.62z"}),(0,a.jsx)("path",{fill:"#34A853",d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.81.54-1.84.86-3.04.86-2.34 0-4.32-1.58-5.03-3.7H.96v2.33A9 9 0 0 0 9 18z"}),(0,a.jsx)("path",{fill:"#FBBC05",d:"M3.97 10.72a5.4 5.4 0 0 1 0-3.44V4.95H.96a9 9 0 0 0 0 8.1l3.01-2.33z"}),(0,a.jsx)("path",{fill:"#EA4335",d:"M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.58C13.46.89 11.43 0 9 0A9 9 0 0 0 .96 4.95l3.01 2.33C4.68 5.16 6.66 3.58 9 3.58z"})]})}function f(){return(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:"18",height:"18",style:{fill:"var(--gh-fg)"},"aria-hidden":"true",children:(0,a.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}let v=/^1[3-9]\d{9}$/,g=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function b(e){let{next:r,onSuccess:s}=e,l=(0,i.c)("auth.form"),o=(0,d.d)(),p=(0,n.useRouter)(),{sendCode:j,login:f,sendEmailCode:b,emailLogin:N}=(0,u.A)(),y=m.P7,[k,w]=(0,t.useState)(""),[C,S]=(0,t.useState)(""),[L,M]=(0,t.useState)(!1),[E,T]=(0,t.useState)(0),[R,q]=(0,t.useState)(!1),[P,B]=(0,t.useState)(!1);(0,t.useEffect)(()=>
1{if(E<=0)return;let e=setTimeout(()=>T(e=>e-1),1e3);return()=>clearTimeout(e)},[E]);let A=y?g.test(k):v.test(k),D=async()=>{if(!A)return void M(!0);M(!1),q(!0);try{let e=y?await b(k):await j(k);T(e.retry_after||60),e.dev_code&&S(e.dev_code)}catch(e){o(function(e,r,s){if(e instanceof h.U){if("BadRequest"===e.code)return s(r?"errEmailSendBadRequest":"errSmsSendBadRequest");if("TooManyRequests"===e.code)return s("errSendTooManyRequests");if("ServiceUnavailable"===e.code)return s(r?"errEmailServiceUnavailable":"errSmsServiceUnavailable");if("NetworkError"===e.code)return s("errSendNetwork")}return s("errSendDefault")}(e,y,l),"error")}finally{q(!1)}},F=async e=>{if(e.preventDefault(),!A)return void M(!0);if(C.length<6)return void o(l("codeTooShort"),"error");B(!0);try{y?await N(k,C):await f(k,C),o(l("toastLoginSuccess"),"success"),s?s():p.push(r||"/console")}catch(e){o(function(e,r){if(e instanceof h.U){if("Unauthorized"===e.code)return r("errLoginUnauthorized");if("AccountSuspended"===e.code)return r("errLoginSuspended");if("TooManyRequests"===e.code)return r("errLoginTooManyRequests");if("NetworkError"===e.code)return r("errLoginNetwork")}return r("errLoginDefault")}(e,l),"error")}finally{B(!1)}};return(0,a.jsxs)("form",{className:"lm-form",onSubmit:F,noValidate:!0,children:[y&&(0,a.jsx)(x,{}),(0,a.jsxs)("label",{className:"field".concat(L?" is-error":""),children:[!y&&(0,a.jsxs)("span",{className:"field-prefix",children:["+86",(0,a.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M6 9l6 6 6-6"})})]}),(0,a.jsx)("input",{inputMode:y?"email":"numeric",type:y?"email":"text",autoComplete:y?"email":"tel",placeholder:y?l("emailPlaceholder"):l("phonePlaceholder"),"aria-label":y?l("emailLabel"):l("phoneLabel"),"aria-invalid":L||void 0,"aria-describedby":L?"lmIdError":void 0,value:k,onChange:e=>{let r=e.target.value;w(y?r.trimStart():r.replace(/\D/g,"").slice(0,11)),M(!1)}})]}),L&&(0,a.jsx)("p",{className:"lm-field-error",id:"lmIdError",children:y?l("emailError"):l("phoneError")}),(0,a.jsxs)("label",{className:"field",children:[(0,a.jsx)("input",{inputMode:"numeric",autoComplete:"one-time-code",placeholder:l("codePlaceholder"),"aria-label":y?l("codeLabelEmail"):l("codeLabelSms"),maxLength:6,value:C,onChange:e=>S(e.target.value.replace(/\D/g,""))}),(0,a.jsx)("button",{type:"button",className:"field-action",disabled:!A||E>0||R,onClick:D,children:E>0?(0,a.jsxs)("span",{className:"mono",children:[E,"s"]}):R?l("sending"):l("getCode")})]}),(0,a.jsx)("button",{type:"submit",className:"lm-submit",disabled:P,children:P?l("submitting"):l("submit")}),(0,a.jsxs)("p",{className:"lm-agree",children:[l("agreePre"),(0,a.jsx)(c.N_,{href:"/legal/terms",children:l("agreeTerms")}),l("agreeMid"),(0,a.jsx)(c.N_,{href:"/legal/privacy",children:l("agreePrivacy")})]})]})}var N=s(1567);function y(e){let{value:r,onChange:s,onComplete:l,invalid:n,disabled:i,groupLabel:o,digitLabel:c,autoFocus:d}=e,u=(0,t.useRef)([]);(0,t.useEffect)(()=>{var e;d&&(null==(e=u.current[0])||e.focus())},[d]);let h=Array.from({length:6},(e,s)=>{var a;return null!=(a=r[s])?a:""}),m=(e,r)=>{let s=h.slice();return s[e]=r,s.join("").slice(0,6)},x=e=>{var r;let a=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6);if(!a)return;e.preventDefault(),s(a);let t=Math.min(a.length,5);null==(r=u.current[t])||r.focus(),6===a.length&&(null==l||l(a))};return(0,a.jsx)("div",{className:"otp".concat(n?" is-error":""),role:"group","aria-label":o,children:h.map((e,r)=>(0,a.jsx)("input",{ref:e=>{u.current[r]=e},type:"text",inputMode:"numeric",autoComplete:0===r?"one-time-code":"off",maxLength:1,value:e,disabled:i,"aria-label":c(r+1),"aria-invalid":n||void 0,onChange:e=>((e,r)=>{let a=r.replace(/\D/g,"").slice(-1);if(!a)return void s(m(e,""));let t=m(e,a);if(s(t),e<5){var n;null==(n=u.current[e+1])||n.focus()}6===t.length&&(null==l||l(t))})(r,e.target.value),onKeyDown:e=>{var a,t,l;"Backspace"===e.key?h[r]?s(m(r,"")):r>0&&(e.preventDefault(),s(m(r-1,"")),null==(a=u.current[r-1])||a.focus()):"ArrowLeft"===e.key&&r>
10?(e.preventDefault(),null==(t=u.current[r-1])||t.focus()):"ArrowRight"===e.key&&r<5&&(e.preventDefault(),null==(l=u.current[r+1])||l.focus())},onPaste:x,onFocus:e=>e.currentTarget.select()},r))})}let k=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function w(e){let{fromLimit:r,onSuccess:s}=e,l=(0,i.c)("auth.form"),n=(0,N.Ym)(),o=(0,d.d)(),{sendEmailCode:m,emailLogin:p}=(0,u.A)(),[j,f]=(0,t.useState)("email"),[v,g]=(0,t.useState)(""),[b,w]=(0,t.useState)(""),[L,M]=(0,t.useState)(!1),[E,T]=(0,t.useState)(!1),[R,q]=(0,t.useState)(0),[P,B]=(0,t.useState)(!1),[A,D]=(0,t.useState)(!1),[F,_]=(0,t.useState)(!1),[U,z]=(0,t.useState)(!1);(0,t.useEffect)(()=>{r&&o(l("contextBody"),"info")},[]),(0,t.useEffect)(()=>{if(R<=0)return;let e=setTimeout(()=>q(e=>e-1),1e3);return()=>clearTimeout(e)},[R]);let W=k.test(v.trim()),G=async()=>{if(!W)return M(!0),!1;M(!1),B(!0);try{let e=await m(v.trim(),n);return q(e.retry_after||60),e.dev_code&&w(e.dev_code),!0}catch(e){return o(function(e,r){if(e instanceof h.U){if("BadRequest"===e.code)return r("errEmailSendBadRequest");if("TooManyRequests"===e.code)return r("errSendTooManyRequests");if("ServiceUnavailable"===e.code)return r("errEmailServiceUnavailable");if("NetworkError"===e.code)return r("errSendNetwork")}return r("errSendDefault")}(e,l),"error"),!1}finally{B(!1)}},I=async e=>{e.preventDefault(),await G()&&(w(e=>e),f("otp"))},Z=async e=>{if(!(e.length<6)&&!A){T(!1),D(!0);try{await p(v.trim(),e),z(!0),window.setTimeout(()=>{s&&s()},700)}catch(e){e instanceof h.U&&"Unauthorized"===e.code?T(!0):o(function(e,r){if(e instanceof h.U){if("AccountSuspended"===e.code)return r("errLoginSuspended");if("TooManyRequests"===e.code)return r("errLoginTooManyRequests");if("NetworkError"===e.code)return r("errLoginNetwork")}return r("errLoginDefault")}(e,l),"error")}finally{D(!1)}}},H=async()=>{w(""),T(!1),await G()};return U?(0,a.jsxs)("div",{className:"lm-success",role:"status",children:[(0,a.jsx)("div",{className:"lm-check","aria-hidden":"true",children:(0,a.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"m5 13 4 4L19 7"})})}),(0,a.jsx)("h2",{children:l("successTitle")}),(0,a.jsx)("p",{children:l("successSub")})]}):"otp"===j?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{className:"lm-sent-to",children:[l("sentToPre"),(0,a.jsx)("b",{children:v.trim()}),!A&&(0,a.jsx)("button",{type:"button",className:"change",onClick:()=>{f("email"),w(""),T(!1)},children:l("change")})]}),(0,a.jsxs)("form",{className:"lm-form lm-form-otp",onSubmit:e=>{e.preventDefault(),Z(b)},noValidate:!0,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"fld-label",children:l("codeLabel")}),(0,a.jsx)(y,{value:b,onChange:e=>{w(e),E&&T(!1)},onComplete:e=>void Z(e),invalid:E,disabled:A,groupLabel:l("codeLabel"),digitLabel:e=>l("digitLabel",{n:e}),autoFocus:!0}),E&&(0,a.jsxs)("p",{className:"fld-error",role:"alert",children:[(0,a.jsx)(S,{}),(0,a.jsx)("span",{children:l("errCodeInline")})]})]}),(0,a.jsx)("button",{type:"submit",className:"lm-submit",disabled:A||b.length<6,children:A?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"spin","aria-hidden":"true"}),l("verifying")]}):l("submitContinue")}),(0,a.jsx)("p",{className:"lm-agree",children:R>0?(0,a.jsxs)("span",{style:{color:"var(--mp-text-3)"},children:[l("resendIn")," ",(0,a.jsxs)("span",{className:"mono",children:[R,"s"]})]}):(0,a.jsx)("button",{type:"button",className:"field-action",style:{margin:0},onClick:H,children:l("resend")})})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x,{onBusyChange:_}),(0,a.jsxs)("form",{className:"lm-form",onSubmit:I,noValidate:!0,style:F?{opacity:.6,pointerEvents:"none"}:void 0,inert:F||void 0,children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"field".concat(L?" is-error":""),children:[(0,a.jsx)("span",{className:"fld-ico","aria-hidden":"true",children:(0,a.jsx)(C,{})}),(0,a.jsx)("input",{id:"lmEmail",type:"email",inputMode:"email",autoComplete:"email","aria-label":l("emailLabel"),placeholder:l("emailPlaceholder"),"aria-invalid":L||void 0,"aria-describedby":L?"lmEmailError":void 0,value:v,onCh
1ange:e=>{g(e.target.value.trimStart()),L&&M(!1)}})]}),L&&(0,a.jsxs)("p",{className:"fld-error",id:"lmEmailError",role:"alert",children:[(0,a.jsx)(S,{}),(0,a.jsx)("span",{children:l("errEmailInline")})]})]}),(0,a.jsx)("button",{type:"submit",className:"lm-submit",disabled:P,children:P?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"spin","aria-hidden":"true"}),l("sending")]}):l("submitContinue")})]}),(0,a.jsx)("p",{className:"lm-agree",children:l.rich("agree",{terms:e=>(0,a.jsx)(c.N_,{href:"/legal/terms",children:e}),privacy:e=>(0,a.jsx)(c.N_,{href:"/legal/privacy",children:e})})})]})}function C(){return(0,a.jsxs)("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,a.jsx)("path",{d:"m3 7 9 6 9-6"})]})}function S(){return(0,a.jsxs)("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,a.jsx)("path",{d:"M12 8v4.5M12 16h.01"})]})}function L(e){let{onSuccess:r}=e,s=(0,i.c)("auth.wechat"),{getWechatQrCode:l,checkWechatLogin:n,applyWechatSession:o}=(0,u.A)(),[c,d]=(0,t.useState)("loading"),[h,m]=(0,t.useState)(""),x=(0,t.useRef)(null),p=(0,t.useRef)(null),j=(0,t.useRef)(!1),f=(0,t.useCallback)(()=>{p.current&&(clearTimeout(p.current),p.current=null)},[]),v=(0,t.useCallback)(e=>{j.current=!0,f(),o(e),d("success"),setTimeout(()=>{r()},800)},[o,f,r]),g=(0,t.useCallback)(async()=>{let e=x.current;if(e&&!j.current)try{let r=await n(e);if(j.current||x.current!==e)return;if("success"===r.status)return void v({user:r.user,account:r.account});if("expired"===r.status){f(),d("expired");return}d("scanned"===r.status?"scanned":"pending"),p.current=setTimeout(()=>void g(),1500)}catch(e){if(j.current)return;p.current=setTimeout(()=>void g(),1500)}},[n,f,v]),b=(0,t.useCallback)(async()=>{f(),j.current=!1,x.current=null,d("loading");try{let{ticket:e,qrCodeUrl:r}=await l();if(j.current)return;x.current=e,m(r),d("pending"),p.current=setTimeout(()=>void g(),1500)}catch(e){if(j.current)return;d("error")}},[f,l,g]);(0,t.useEffect)(()=>(b(),()=>{j.current=!0,f()}),[]);let N="expired"===c,y="scanned"===c,k="success"===c,w="error"===c;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M,{state:c,qrUrl:h,onRefresh:()=>void b(),t:s}),"pending"===c||"loading"===c?(0,a.jsxs)("p",{className:"lm-wx-hint",children:[s("scanHintPre"),(0,a.jsx)("span",{className:"lm-wx-icon","aria-hidden":"true",children:(0,a.jsx)(E,{})}),s("scanHintPost")]}):w?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"lm-wx-hint",children:s("errorTitle")}),(0,a.jsx)("p",{className:"lm-wx-sub",children:s("errorSub")})]}):y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"lm-wx-hint",children:s("scannedTitle")}),(0,a.jsx)("p",{className:"lm-wx-sub",children:s("scannedSub")})]}):N?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"lm-wx-hint",children:s("expiredTitle")}),(0,a.jsx)("p",{className:"lm-wx-sub",children:s("expiredSub")})]}):k?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"lm-wx-hint",children:s("successTitle")}),(0,a.jsx)("p",{className:"lm-wx-sub",children:s("successSub")})]}):null]})}function M(e){let{state:r,qrUrl:s,onRefresh:t,t:n}=e,i=["qr-card","scanned"===r&&"is-scanned","expired"===r&&"is-expired","success"===r&&"is-success"].filter(Boolean).join(" ");return"error"===r?(0,a.jsx)("div",{className:"qr-card is-expired",children:(0,a.jsxs)("div",{className:"qr-overlay",role:"status",children:[(0,a.jsxs)("svg",{className:"ov-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8"}),(0,a.jsx)("path",{d:"M21 4v4h-4"}),(0,a.jsx)("path",{d:"M21 12a9 9 0 0 1-15 6.7L3 16"}),(0,a.jsx)("path",{d:"M3 20v-4h4"})]}),(0,a.jsx)("span",{className:"ov-text",children:n("overlayLoadFailed")}),(0,a.jsxs)("button",{type:"button",className:"qr-refresh",onClick:t,children:[(0,a.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8"}),(0,a.jsx)("path",{d:"M21 4v4h-4"}),(0,a.jsx)("path",{d:"M21 12a9 9 0 0 1-15 6.7L3 16"}),(0,a.jsx)("path",{d:"M3 20v-4h4"})]}),n("overlayRefresh")]})]})}):(0,a.jsxs)("div",{className:i,children:["loading"===r?(0,a.jsx)("div",{className:"qr-loading","aria-hidden":"true"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("img",{className:"qr-img",src:s,alt:n("qrImageAlt"),draggable:!1}),(0,a.jsx)("div",{className:"qr-logo","aria-hidden":"true",children:(0,a.jsx)(l.default,{className:"qr-logo-img",src:"/brand/minipic-logo-square.png",alt:"",width:56,height:56,priority:!0})})]}),"scanned"===r&&(0,a.jsxs)("div",{className:"qr-overlay",role:"status",children:[(0,a.jsxs)("svg",{className:"ov-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M8 12.5l2.5 2.5L16 9"})]}),(0,a.jsx)("span",{className:"ov-text",children:n("overlayScanned").split("\n").map((e,r)=>(0,a.jsxs)("span",{children:[r>0&&(0,a.jsx)("br",{}),e]},r))})]}),"expired"===r&&(0,a.jsxs)("div",{className:"qr-overlay",role:"status",children:[(0,a.jsxs)("svg",{className:"ov-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,a.jsx)("path",{d:"M12 7v5l3 2"})]}),(0,a.jsx)("span",{className:"ov-text",children:n("overlayExpired")}),(0,a.jsxs)("button",{type:"button",className:"qr-refresh",onClick:t,children:[(0,a.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8"}),(0,a.jsx)("path",{d:"M21 4v4h-4"}),(0,a.jsx)("path",{d:"M21 12a9 9 0 0 1-15 6.7L3 16"}),(0,a.jsx)("path",{d:"M3 20v-4h4"})]}),n("overlayRefresh")]})]}),"success"===r&&(0,a.jsxs)("div",{className:"qr-overlay",role:"status",children:[(0,a.jsx)("svg",{className:"ov-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M5 13l4 4L19 7"})}),(0,a.jsx)("span",{className:"ov-text",children:n("overlaySuccess")})]})]})}
1function E(){return(0,a.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.jsx)("path",{d:"M8.7 7.2c-3.9 0-7.1 2.6-7.1 5.9 0 1.9 1.1 3.6 2.8 4.7l-.6 2 2.4-1.2c.8.2 1.6.4 2.5.4h.5a4.6 4.6 0 0 1-.2-1.4c0-3 2.9-5.4 6.5-5.4h.5C15.3 9.2 12.3 7.2 8.7 7.2Zm-2.4 3.3a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8Zm4.8 0a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8Zm5 2.7c-3 0-5.5 2-5.5 4.5s2.5 4.5 5.5 4.5c.7 0 1.4-.1 2-.3l1.9 1-.5-1.6c1.3-.9 2.1-2.2 2.1-3.6 0-2.5-2.5-4.5-5.5-4.5Zm-1.8 3a.7.7 0 1 1 0 1.5.7.7 0 0 1 0-1.5Zm3.7 0a.7.7 0 1 1 0 1.5.7.7 0 0 1 0-1.5Z"})})}function T(){let{open:e,next:r,fromLimit:s,closeLogin:l}=B(),i=(0,n.useRouter)(),o=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let r=o.current;r&&(e&&!r.open&&r.showModal(),!e&&r.open&&r.close())},[e]),(0,a.jsx)("dialog",{ref:o,className:"login-modal".concat(m.P7?" is-global":""),"aria-labelledby":"loginModalTitle",onClose:l,onClick:e=>{e.target===o.current&&l()},children:e&&(0,a.jsx)(R,{fromLimit:s,next:r,onSuccess:()=>{l(),r&&i.push(r)},onClose:l})})}function R(e){let{fromLimit:r,next:s,onSuccess:n,onClose:c}=e,d=(0,i.c)("auth.modal"),u=function(){let[e,r]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{let e=window.matchMedia("(max-width: 640px)"),s=()=>r(e.matches);return s(),e.addEventListener("change",s),()=>e.removeEventListener("change",s)},[]),e}(),[h,x]=(0,t.useState)("wx");return m.P7?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"lm-atmos","aria-hidden":"true",children:[(0,a.jsx)("span",{className:"cloud c1"}),(0,a.jsx)("span",{className:"cloud c2"}),(0,a.jsx)("span",{className:"cloud c3"}),(0,a.jsx)("span",{className:"cloud c4"})]}),(0,a.jsx)("button",{type:"button",className:"lm-close","aria-label":d("close"),onClick:c,children:(0,a.jsx)(o.MR,{size:18})}),(0,a.jsxs)("div",{className:"lm-body",children:[(0,a.jsxs)("div",{className:"lm-head",children:[(0,a.jsx)(l.default,{className:"lm-logo",src:"/brand/minipic-wechat-mp-icon-300.png",alt:"MiniPic",width:56,height:56,priority:!0}),(0,a.jsx)("h2",{id:"loginModalTitle",className:"lm-title",children:d("title")}),(0,a.jsx)("p",{className:"lm-sub",children:d("sub")})]}),(0,a.jsx)(w,{fromLimit:r,onSuccess:n})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"lm-atmos","aria-hidden":"true",children:[(0,a.jsx)("span",{className:"cloud c1"}),(0,a.jsx)("span",{className:"cloud c2"}),(0,a.jsx)("span",{className:"cloud c3"}),(0,a.jsx)("span",{className:"cloud c4"})]}),(0,a.jsx)("button",{type:"button",className:"lm-close","aria-label":d("close"),onClick:c,children:(0,a.jsx)(o.MR,{size:18})}),(0,a.jsx)("div",{className:"lm-head",children:(0,a.jsx)("h2",{id:"loginModalTitle",className:"lm-title",children:d("title")})}),u?(0,a.jsxs)("div",{className:"lm-tabs",children:[(0,a.jsxs)("div",{className:"tabbar",role:"tablist","aria-label":d("tabsAria"),children:[(0,a.jsx)("button",{type:"button",className:"tab",role:"tab","aria-selected":"wx"===h,onClick:()=>x("wx"),children:d("tabWechat")}),(0,a.jsx)("button",{type:"button",className:"tab",role:"tab","aria-selected":"phone"===h,onClick:()=>x("phone"),children:d("tabPhone")})]}),"wx"===h?(0,a.jsx)("div",{className:"tabpane lm-wx",role:"tabpanel",children:(0,a.jsx)(L,{onSuccess:n})}):(0,a.jsx)("div",{className:"tabpane",role:"tabpanel",children:(0,a.jsx)(b,{fromLimit:r,next:s,onSuccess:n})})]}):(0,a.jsxs)("div",{className:"lm-cols",children:[(0,a.jsx)("div",{className:"lm-pane lm-wx",children:(0,a.jsx)(L,{onSuccess:n})}),(0,a.jsx)("div",{className:"lm-divider"}),(0,a.jsx)("div",{className:"lm-pane",children:(0,a.jsx)(b,{fromLimit:r,next:s,onSuccess:n})})]}),(0,a.jsx)("p",{className:"lm-foot",children:d("footAutoRegister")})]})}let q=(0,t.createContext)(null);function P(e){let{children:r}=e,[s,l]=(0,t.useState)(!1),[n,i]=(0,t.useState)(void 0),[o,c]=(0,t.useState)(void 0),d=(0,t.useCallback)(e=>{i(null==e?void 0:e.next),c(null==e?void 0:e.fromLimit),l(!0)},[]),u=(0,t.useCallback)(()=>{l(!1)},[]),h=(0,t.useMemo)(()=>({open:s,next:n,fromLimit:o,openLogin:d,closeLogin:u}),[s,n,o,d,u]);return(0,a.jsxs)(q.Provider,{value:h,children:[r,(0,a.jsx)(T,{})]})}function B(){let e=(0,t.useContext)(q);
1if(!e)throw Error("useLoginModal å¿
é¡»å¨ <LoginModalProvider> å
使ç¨");return e}}}]);
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.