1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2142],{26:(e,t,r)=>{r.d(t,{z:()=>n});var s=r(89935),a=r(42653);let n=(0,s.N2)(a.U)},3863:(e,t,r)=>{r.d(t,{Cf:()=>d,Es:()=>p,L3:()=>m,c7:()=>u,lG:()=>l,rr:()=>f});var s=r(40098),a=r(64603),n=r(78874),i=r(88692);r(73482);let l=a.bL;a.l9;let o=e=>{let{...t}=e;return(0,s.jsx)(a.ZL,{...t})},c=e=>{let{className:t,...r}=e;return(0,s.jsx)(a.hJ,{className:(0,n.cn)("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/80 backdrop-blur-xs data-[state=closed]:animate-out data-[state=open]:animate-in",t),...r})},d=e=>{let{className:t,children:r,...l}=e;return(0,s.jsxs)(o,{children:[(0,s.jsx)(c,{}),(0,s.jsxs)(a.UC,{className:(0,n.cn)("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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in rounded-lg md:w-full",t),...l,children:[r,(0,s.jsxs)(a.bm,{className:"absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,s.jsx)(i.A,{className:"size-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},u=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})},p=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})},m=e=>{let{className:t,...r}=e;return(0,s.jsx)(a.hE,{className:(0,n.cn)("font-semibold text-lg leading-none tracking-tight",t),...r})},f=e=>{let{className:t,...r}=e;return(0,s.jsx)(a.VY,{className:(0,n.cn)("text-muted-foreground text-sm",t),...r})}},8159:(e,t,r)=>{r.d(t,{r:()=>s.r});var s=r(63911)},9894:(e,t,r)=>{r.d(t,{P:()=>n});var s=r(22953),a=r(80086);function n(){var e,t;let r=(0,a.Ym)();return null!=(t=null==(e=Object.entries(s.$.i18n.locales).find(e=>{let[t]=e;return t===r}))?void 0:e[1].currency)?t:s.$.i18n.defaultCurrency}},12142:(e,t,r)=>{r.d(t,{PricingTable:()=>k});var s=r(40098),a=r(90254),n=r(22953),i=r(15277),l=r(9894),o=r(8159),c=r(26),d=r(65902),u=r(43531),p=r(90987),m=r(78874),f=r(98840),x=r(24824),g=r(58531),h=r(56280),y=r(99142),j=r(90826),v=r(33938),b=r(80086),N=r(73482),w=r(3863),z=r(61874),_=r(99115);function S(e){let{open:t,onOpenChange:r,productId:a,paymentType:n,organizationId:i}=e,[l,o]=(0,N.useState)(null),[p,m]=(0,N.useState)(null),[f,x]=(0,N.useState)("loading"),[g,h]=(0,N.useState)(300),[y,v]=(0,N.useState)(5),b=(0,N.useRef)(!1),S=(0,_.useRouter)(),C=(0,d.useMutation)(c.z.payments.createZpayOrder.mutationOptions()),k=(0,d.useMutation)(c.z.payments.checkZpayOrderStatus.mutationOptions());(0,N.useEffect)(()=>{!t||l||b.current||(async()=>{b.current=!0,x("loading");try{let e=await C.mutateAsync({productId:a,paymentType:n,organizationId:i});e.qrcode?(o(e.qrcode),m(e.out_trade_no),x("pending"),h(300)):x("error")}catch(e){console.error("Failed to create zpay order:",e),x("error")}finally{b.current=!1}})()},[t,l,a,n,i,C]),(0,N.useEffect)(()=>{if(!t||!p||"pending"!==f)return void console.log("[ZpayPaymentDialog] 轮询æ¡ä»¶ä¸æ»¡è¶³",{open:t,outTradeNo:p,status:f});console.log("[ZpayPaymentDialog] å¼å§è½®è¯¢è®¢åç¶æ",{outTradeNo:p});let e=async()=>{if(!p)return void console.log("[ZpayPaymentDialog] outTradeNo 为空ï¼è·³è¿æ£æ¥");try{console.log("[ZpayPaymentDialog] æ£æ¥è®¢åç¶æ",{outTradeNo:p,timestamp:new Date().toISOString()});let e=await k.mutateAsync({out_trade_no:p});console.log("[ZpayPaymentDialog] 订åç¶ææ¥è¯¢ç»æï¼å®æ´ï¼",{success:e.success,paid:e.paid,status:e.status,trade_no:e.trade_no,message:e.message,fullResult:JSON.stringify(e,null,2),timestamp:new Date().toISOString()}),e.success&&e.paid?(console.log("[ZpayPaymentDialog] æ¯ä»æåï¼æ´æ°ç¶æ",{outTradeNo:p,trade_no:e.trade_no}),x("success")):console.warn("[ZpayPaymentDialog] æ¯ä»æªæåææªæ¯ä»",{outTradeNo:p,success:e.success,paid:e.paid,status:e.status,message:e.message})}catch(e){console.error("[ZpayPaymentDialog] æ£æ¥è®¢åç¶æå¤±è´¥:",{error:e,outTradeNo:p,errorMessage:e instanceof Error?e.message:String(e),errorStack:e instanceof Error?e.stack:void 0})}};e();let r=setInterval(e,3e3);return()=>{console.log("[ZpayPaymentDialog] åæ¢è½®è¯¢"),clearInterval(r)}},[t,p,f]),(0,N.useEffect)(()=>
1{if(!t||"pending"!==f)return;let e=setInterval(()=>{h(e=>e<=1?(x("error"),0):e-1)},1e3);return()=>clearInterval(e)},[t,f]),(0,N.useEffect)(()=>{if("success"!==f||!t)return;console.log("[ZpayPaymentDialog] æ¯ä»æåï¼å¼å§å计æ¶è·³è½¬"),v(5);let e=setInterval(()=>{v(t=>t<=1?(console.log("[ZpayPaymentDialog] å计æ¶ç»æ"),clearInterval(e),0):t-1)},1e3);return()=>{clearInterval(e)}},[f,t]),(0,N.useEffect)(()=>{0===y&&"success"===f&&t&&(console.log("[ZpayPaymentDialog] 跳转å°ä¸ªäººä¸å¿"),S.push("/app/settings/general"))},[y,f,t,S]),(0,N.useEffect)(()=>{t||(o(null),m(null),x("loading"),h(300),v(5),b.current=!1)},[t]);let P="wxpay"===n?"微信æ¯ä»":"æ¯ä»å®";return(0,s.jsx)(w.lG,{open:t,onOpenChange:r,children:(0,s.jsxs)(w.Cf,{className:"sm:max-w-md",children:[(0,s.jsxs)(w.c7,{children:[(0,s.jsx)(w.L3,{children:P}),(0,s.jsxs)(w.rr,{children:["loading"===f&&"æ£å¨å建订å...","pending"===f&&"è¯·ä½¿ç¨ææºæ«æäºç»´ç 宿æ¯ä»","success"===f&&"æ¯ä»æåï¼","error"===f&&"æ¯ä»å¤±è´¥æå·²è¶
æ¶ï¼è¯·éè¯"]})]}),(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4 py-4",children:["loading"===f&&(0,s.jsx)("div",{className:"flex items-center justify-center h-64 w-64",children:(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary"})}),"pending"===f&&l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"relative w-64 h-64",children:(0,s.jsx)(j.default,{src:l,alt:"Payment QR Code",width:256,height:256,className:"border rounded-lg",unoptimized:!0})}),(0,s.jsxs)("div",{className:"text-sm text-muted-foreground",children:["å©ä½æ¶é´: ",(e=>{let t=Math.floor(e/60);return"".concat(t,":").concat((e%60).toString().padStart(2,"0"))})(g)]}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground text-center",children:["订åå·: ",p]})]}),"success"===f&&(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4 py-4",children:[(0,s.jsx)(z.A,{className:"size-16 text-green-600"}),(0,s.jsx)("div",{className:"text-xl font-semibold text-green-600",children:"æ¯ä»æåï¼"}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground text-center",children:"æ¨ç订é
å·²æ¿æ´»"}),(0,s.jsxs)("div",{className:"text-sm text-muted-foreground text-center",children:[y," ç§åèªå¨è·³è½¬å°ä¸ªäººä¸å¿"]}),(0,s.jsx)(u.$,{className:"mt-2 w-full",variant:"primary",onClick:()=>{S.push("/app/settings/general")},children:"ç«å³åå¾ä¸ªäººä¸å¿"})]}),"error"===f&&(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,s.jsx)("div",{className:"text-4xl",children:"â"}),(0,s.jsx)("div",{className:"text-lg font-semibold text-red-600",children:"æ¯ä»å¤±è´¥"}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground text-center",children:"请å
³éçªå£åéè¯"})]})]})]})})}let C=n.$.payments.plans;function k(e){let{className:t,userId:r,organizationId:n,activePlanId:w}=e,z=(0,v.c3)(),_=(0,v.kc)(),k=(0,o.r)(),P=(0,b.Ym)(),I=(0,l.P)(),[D,Z]=(0,N.useState)(!1),[E,O]=(0,N.useState)("month"),[A,F]=(0,N.useState)(!1),[$,L]=(0,N.useState)(null),[M,T]=(0,N.useState)("wxpay"),[U,R]=(0,N.useState)(!1),{planData:Y}=(0,i.V)(),B=(0,d.useMutation)(c.z.payments.createCheckoutLink.mutationOptions()),V=async(e,t)=>{var s;if(!(r||n))return void k.push("/auth/signup");let a=null==(s=C[e].prices)?void 0:s.find(e=>e.productId===t);if(a){Z(e);try{let{checkoutLink:e}=await B.mutateAsync({type:"one-time"===a.type?"one-time":"subscription",productId:a.productId,organizationId:n,redirectUrl:window.location.href});window.location.href=e}catch(e){console.error(e)}finally{Z(!1)}}},X=Object.entries(C).filter(e=>{let[t]=e;return t!==w&&(!w||"free"!==t)}),G=X.some(e=>{var t;let[r,s]=e;return null==(t=s.prices)?void 0:t.some(e=>"recurring"===e.type)});return(0,s.jsxs)("div",{className:(0,m.cn)("@container",t),children:[G&&(0,s.jsx)("div",{className:"mb-6 flex @xl:justify-center",children:(0,s.jsx)(p.tU,{value:E,onValueChange:e=>O(e),"data-test":"price-table-interval-tabs",children:(0,s.jsxs)(p.j7,{className:"border-foreground
1/10",children:[(0,s.jsx)(p.Xi,{value:"month",children:z("pricing.monthly")}),(0,s.jsx)(p.Xi,{value:"year",children:z("pricing.yearly")})]})})}),(0,s.jsx)("div",{className:(0,m.cn)("grid grid-cols-1 gap-4",{"@xl:grid-cols-2":X.length>=2,"@3xl:grid-cols-3":X.length>=3,"@4xl:grid-cols-4":X.length>=4}),children:X.filter(e=>{let[t]=e;return t!==w}).map(e=>{var t,i,l;let o,[c,d]=e,{isFree:p,isEnterprise:j,prices:v,recommended:b}=d,{title:N,description:w,features:S}=Y[c];if("zh-CN"===P&&("pro"===c||"lifetime"===c)){let e="";"pro"===c?e="month"===E?"zpay_aibro_monthly":"zpay_aibro_yearly":"lifetime"===c&&(e="zpay_aibro_lifetime"),e&&(o=null==v?void 0:v.find(t=>!t.hidden&&t.productId===e&&"CNY"===t.currency)),o||(o=null==v?void 0:v.find(e=>!e.hidden&&("one-time"===e.type||e.interval===E)&&e.currency===I))}else o=null==v?void 0:v.find(e=>!e.hidden&&("one-time"===e.type||e.interval===E)&&e.currency===I);return(p&&(o={amount:0,currency:"zh-CN"===P?"CNY":I,interval:E,productId:"",type:"recurring"}),o||j)?(0,s.jsx)("div",{className:(0,m.cn)("rounded-3xl border p-6",{"border-2 border-primary":b}),"data-test":"price-table-plan",children:(0,s.jsxs)("div",{className:"flex h-full flex-col justify-between gap-4",children:[(0,s.jsxs)("div",{children:[b&&(0,s.jsx)("div",{className:"-mt-9 flex justify-center",children:(0,s.jsxs)("div",{className:"mb-2 flex h-6 w-auto items-center gap-1.5 rounded-full bg-primary px-2 py-1 font-semibold text-primary-foreground text-xs",children:[(0,s.jsx)(f.A,{className:"size-3"}),z("pricing.recommended")]})}),(0,s.jsx)("h3",{className:(0,m.cn)("my-0 font-semibold text-2xl",{"font-bold text-primary":b}),children:N}),w&&(0,s.jsx)("div",{className:"prose mt-2 text-foreground/60 text-sm",children:w}),!!(null==S?void 0:S.length)&&(0,s.jsx)("ul",{className:"mt-4 grid list-none gap-2 text-sm",children:S.map((e,t)=>{let r="".concat(c,"-feature-").concat(t);return(0,s.jsxs)("li",{className:"flex items-center justify-start",children:[(0,s.jsx)(x.A,{className:"mr-2 size-4 text-primary"}),(0,s.jsx)("span",{children:e})]},r)})}),o&&"trialPeriodDays"in o&&o.trialPeriodDays&&(0,s.jsxs)("div",{className:"mt-4 flex items-center justify-start font-medium text-primary text-sm opacity-80",children:[(0,s.jsx)(g.A,{className:"mr-2 size-4"}),z("pricing.trialPeriod",{days:o.trialPeriodDays})]})]}),(0,s.jsxs)("div",{children:[o&&(0,s.jsxs)("strong",{className:"block font-medium text-2xl lg:text-3xl","data-test":"price-table-plan-price",children:[_.number(o.amount,{style:"currency",currency:o.currency}),"interval"in o&&(0,s.jsxs)("span",{className:"font-normal text-xs opacity-60",children:[" / ","month"===E?z("pricing.month",{count:null!=(i=o.intervalCount)?i:1}):z("pricing.year",{count:null!=(l=o.intervalCount)?l:1})]}),"zh-CN"===P&&(null==(t=o.productId)?void 0:t.startsWith("zpay_"))&&"pro"===c&&(0,s.jsxs)("span",{className:"font-normal text-xs opacity-60",children:[" / ","month"===E?"1æ":"1å¹´"]}),n&&"seatBased"in o&&o.seatBased&&(0,s.jsxs)("span",{className:"font-normal text-xs opacity-60",children:[" / ",z("pricing.perSeat")]})]}),j?(0,s.jsx)(u.$,{className:"mt-4 w-full",variant:"light",asChild:!0,children:(0,s.jsxs)(a.XO,{href:"/contact",children:[(0,s.jsx)(h.A,{className:"mr-2 size-4"}),z("pricing.contactSales")]})}):(0,s.jsxs)(s.Fragment,{children:[!("zh-CN"===P&&(r||n))&&(0,s.jsxs)(u.$,{className:"mt-4 w-full",variant:b?"primary":"secondary",onClick:()=>V(c,null==o?void 0:o.productId),loading:D===c,children:[r||n?z("pricing.choosePlan"):z("pricing.getStarted"),(0,s.jsx)(y.A,{className:"ml-2 size-4"})]}),"zh-CN"===P&&("pro"===c||"lifetime"===c)&&(0,s.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,s.jsx)(u.$,{className:"flex-1",variant:"outline",size:"sm",onClick:()=>{let e="";"pro"===c?e="month"===E?"zpay_aibro_monthly":"zpay_aibro_yearly":"lifetime"===c&&(e="zpay_aibro_lifetime"),e&&(L(e),T("wxpay"),F(!0))},children:"微信æ¯ä»"}),(0,s.jsx)(u.$,{className:"flex-1",variant:"outline",size:"sm",onClick:()=>{let e="";"pro"===c?e="month"===E?"zpay_aibro_monthly":"zpay_aibro_yearly":"lifetime"===c&&(e="zpay_aibro_lifetime"),e&&(L(e),T("alipay"),F(!0))},children:"æ¯ä»å®"})]})]})]})]})},c):null})}),$&&(0,s.jsx)(S,{open:A,onOpenChange:F,productId:$,paymentType:M,organizationId:n}),"zh-CN"===P&&(0,s.jsxs)("div",{className:"mt-6 flex items-center justify-center gap-2 text-foreground
1/60 text-sm",children:[(0,s.jsx)("span",{children:"æé®é¢(客æ)请èç³»å°çº¢ä¹¦ä½è
"}),(0,s.jsxs)("button",{type:"button",className:"relative cursor-pointer text-foreground/60 hover:text-foreground transition-colors inline-flex items-center justify-center",onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),"aria-label":"å°çº¢ä¹¦ä½è
",children:[(0,s.jsxs)("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,s.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"4",fill:"#FF2442"}),(0,s.jsx)("text",{x:"12",y:"15",textAnchor:"middle",fontSize:"8",fontWeight:"bold",fill:"white",fontFamily:"Arial, sans-serif",children:"å°çº¢ä¹¦"})]}),U&&(0,s.jsx)("div",{className:"absolute bottom-full w-96 left-1/2 -translate-x-1/2 mb-2 z-50",children:(0,s.jsx)(j.default,{src:"/images/xhsauthor.jpg",alt:"å°çº¢ä¹¦ä½è
",width:384,height:384,className:"w-96 h-96 rounded-lg shadow-lg object-cover",unoptimized:!0})})]}),(0,s.jsx)("span",{children:"æé®ä»¶:"}),(0,s.jsx)("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]})]})}},15277:(e,t,r)=>{r.d(t,{V:()=>a});var s=r(33938);function a(){let e=(0,s.c3)();return{planData:{free:{title:e("pricing.products.free.title"),description:e("pricing.products.free.description"),features:[e("pricing.products.free.features.anotherFeature"),e("pricing.products.free.features.limitedSupport")]},pro:{title:e("pricing.products.pro.title"),description:e("pricing.products.pro.description"),features:[e("pricing.products.pro.features.anotherFeature"),e("pricing.products.pro.features.fullSupport")]},lifetime:{title:e("pricing.products.lifetime.title"),description:e("pricing.products.lifetime.description"),features:[e("pricing.products.lifetime.features.noRecurringCosts"),e("pricing.products.lifetime.features.extendSupport")]},enterprise:{title:e("pricing.products.enterprise.title"),description:e("pricing.products.enterprise.description"),features:[e("pricing.products.enterprise.features.unlimitedProjects"),e("pricing.products.enterprise.features.enterpriseSupport")]}}}}},42653:(e,t,r)=>{r.d(t,{U:()=>i});var s=r(60009),a=r(99453);r(70721);let n=new a.G({url:"".concat("https://www.aibrotherwatch.com","/api/rpc"),headers:async()=>({}),interceptors:[(0,s.S5)(e=>{console.error(e)})]}),i=(0,s.I0)(n)},90987:(e,t,r)=>{r.d(t,{Xi:()=>o,av:()=>c,j7:()=>l,tU:()=>i});var s=r(40098),a=r(50141),n=r(78874);r(73482);let i=a.bL,l=e=>{let{className:t,...r}=e;return(0,s.jsx)(a.B8,{className:(0,n.cn)("inline-flex items-center justify-center border-b-2 text-card-foreground/80 text-sm",t),...r})},o=e=>{let{className:t,...r}=e;return(0,s.jsx)(a.l9,{className:(0,n.cn)("-mb-0.5 inline-flex items-center justify-center whitespace-nowrap border-transparent border-b-2 px-3 py-2 font-medium text-foreground/60 text-sm ring-offset-background transition-all hover:text-foreground/80 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-primary data-[state=active]:text-card-foreground",t),...r})},c=e=>{let{className:t,...r}=e;return(0,s.jsx)(a.UC,{className:(0,n.cn)("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r})}}}]);
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.