PageSourceSearch

https://j2proxy.vn/_next/static/chunks/13065.cebc238381d102d4.js

js j2proxy.vn collected 2026-10-02 02:15:47 UTC 59,117 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[13065],{7181:(e,t,a)=>{a.d(t,{m:()=>x});var r=a(95155),s=a(39180),n=a(58795),l=a(37062),o=a(52095),i=a(58067),c=a(96199),d=a(18720);function x(e){let{selectedProxies:t,successMessage:a="Đ\xe3 copy th\xe0nh c\xf4ng",errorMessage:x="Copy thất bại"}=e,{data:p}=(0,c.wV)(),{config:m}=(0,s.r)(),h=null==m?void 0:m.hostName,u=()=>h?"https://".concat(h):null;return async e=>{let s;switch(e){case"id":s=Promise.resolve(t.map(e=>e.code).join("\n"));break;case"old-id":s=Promise.resolve(t.map(e=>e.id).join("\n"));break;case"proxy":s=Promise.resolve(t.filter(e=>(0,l.nU)(e.status)).map(e=>(0,l.dB)(e.proxy)).filter(Boolean).join("\n"));break;case"link":{let e=u(),a=e?"".concat(e,"/api"):"https://api-proxy.homeproxy.vn";s=Promise.all(t.map(async e=>{let t=await (0,n.f)(e.id,null==p?void 0:p.accessToken);return t?(0,o.z)({baseUrl:a,token:t}):""})).then(e=>e.filter(e=>e).join("\n"));break}case"proxy-link":{let e=u(),a=e?"".concat(e,"/api"):"https://api-proxy.homeproxy.vn";s=Promise.all(t.map(async e=>{let t=await (0,n.f)(e.id,null==p?void 0:p.accessToken);if(!t)return"";let r=(0,l.dB)(e.proxy),s=(0,o.z)({baseUrl:a,token:t});return r?"".concat(r,"|").concat(s):""})).then(e=>e.filter(e=>e).join("\n"));break}default:s=Promise.resolve(t.map(e=>(0,l.a)(e)).filter(e=>":"!==e).join("\n"))}let c=await (0,i.b)(s),m=await s;c?d.toast.success(a,{description:(0,r.jsx)("div",{className:"toast-clamp",children:m}),duration:5e3}):d.toast.error(x)}}},11821:(e,t,a)=>{a.d(t,{Lv:()=>s,f3:()=>n,mz:()=>r});let r=e=>(e=>Array.isArray(e)?e:e&&"object"==typeof e?[e]:[])(e).flatMap(e=>{var t;return Array.isArray(null==e||null==(t=e.data)?void 0:t.results)?e.data.results:Array.isArray(null==e?void 0:e.results)?e.results:Array.isArray(null==e?void 0:e.data)?e.data:[]}),s=e=>{let t=[],a=[],r=[];return e.forEach(e=>{var s,n;let l=null!=(s=null==e?void 0:e.username)?s:"unknown",o=null==e?void 0:e.status,i=null!=(n=null==e?void 0:e.time_remaining)?n:null==e?void 0:e.timeRemaining;switch(o){case"success":t.push("".concat(l,": Xoay proxy th\xe0nh c\xf4ng"));break;case"too_soon":a.push("".concat(l,": Chưa tới thời gian xoay").concat("number"==typeof i?" (".concat(i,"s)"):""));break;case"not_found":r.push("".concat(l,": Kh\xf4ng t\xecm thấy proxy"));break;case"failed":r.push("".concat(l,": ").concat((null==e?void 0:e.error)||"Xoay proxy thất bại"));break;default:(null==e?void 0:e.error)?r.push("".concat(l,": ").concat(e.error)):(null==e?void 0:e.message)&&o&&"success"!==o&&r.push("".concat(l,": ").concat(e.message))}}),{successMessages:t,tooSoonMessages:a,errorMessages:r}},n=e=>{var t;let a=null==e?void 0:e.status,r=null==e?void 0:e.message,s=null!=(t=null==e?void 0:e.timeRemaining)?t:null==e?void 0:e.time_remaining,n=null==e?void 0:e.proxy;return"success"===a&&n?{type:"success",title:r||"Xoay proxy th\xe0nh c\xf4ng",description:n}:"too_soon"===a||"number"==typeof s&&s>0?{type:"too_soon",title:"Chưa tới thời gian xoay proxy",description:r||"Vui l\xf2ng chờ th\xeam ".concat("number"==typeof s?s:0,"s để xoay tiếp.")}:{type:"error",title:"Xoay proxy thất bại",description:r||"Lỗi kh\xf4ng x\xe1c định"}}},15522:(e,t,a)=>{a.d(t,{Y:()=>l});var r=a(95155),s=a(72264),n=a(18720);function l(e){n.toast.custom(t=>(0,r.jsxs)("div",{className:"flex w-[332px] flex-col gap-1 rounded-[12px] bg-white p-3 shadow-[0px_14px_14px_rgba(0,0,0,0.24),0px_0px_4px_rgba(0,0,0,0.2)]",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2",children:[(0,r.jsx)(s.F.WarningIcon,{className:"h-5 w-5 shrink-0 text-[#FF6C2F]"}),(0,r.jsx)("p",{className:"text-[14px] leading-5 font-medium whitespace-nowrap text-[#18181B]",children:"Chọn \xedt nhất 1 d\xf2ng để thực hiện lệnh"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>n.toast.dismiss(t),"aria-label":"Đ\xf3ng",className:"h-5 w-5 shrink-0 text-[#18181B]",children:(0,r.jsx)(s.F.CloseIcon,{className:"h-5 w-5"})})]}),(0,r.jsx)("div",{className:"pl-[28px]",children:(0,r.jsxs)("p",{className:"text-[14px] leading-5 font-normal text-[#18181B]",children:["Bạn cần chọn \xedt nhất 1 proxy để ",e]})})]}),{position:"top-center"})}},17835:(e,t,a)=>{a.d(t,{$6:()=>d,D5:()=>c,I9:()=>l,Nd:()=>p,Q_:()=>x,_7:()=>h,cX:()=>o,jx:()=>m,zJ:()=>n});var r=a(64269);function s(e,t){return"dark"===t?e?"bg-sidebar-foreground hover:bg-sidebar-foreground border border-[#919191] text-[#919191] disabled:opacity-100":"bg-[image:var(--button-2-gradient-template-7)] text-white hover:brightness-110":e?"bg-[#BABDC4] text-[#D7D9DF] hover:bg-[#BABDC4] disabled:opacity-100":"bg-primary hover:bg-primary/90 text-white"}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"light";return(0,r.cn)("flex h-8 shrink-0 flex-row items-center gap-1.5 rounded-lg px-3 py-1.5 text-[14px] leading-[17px] font-semibold whitespace-nowrap sm:h-9 sm:gap-2 sm:px-4",s(e,t))}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"light";return(0,r.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg p-0 sm:h-9 sm:w-9",s(e,t))}let o="w-full min-w-0 max-w-full overflow-hidden 2xl:max-w-[min(100%,460px)]",i="flex h-9 shrink-0 flex-row items-center gap-1 rounded-[999px] px-3 py-2 text-sm leading-[19px] font-normal whitespace-nowrap transition-colors",c=(0,r.cn)(i,"border-none bg-[rgb(from_var(--primary)_calc(r+184)_calc(g+165)_calc(b+152))] text-primary hover:bg-border-template-6");function d(e){return(0,r.cn)(i,e?"border border-[rgb(from_var(--primary)_calc(r+183)_calc(g+142)_calc(b+123))] bg-white text-[rgb(from_var(--primary)_calc(r+103)_calc(g+62)_calc(b+45))] hover:bg-white disabled:opacity-100":"border border-[rgb(from_var(--primary)_calc(r+183)_calc(g+142)_calc(b+123))] bg-white text-black hover:border-[rgb(from_var(--primary)_calc(r+183)_calc(g+142)_calc(b+123))] hover:bg-[rgb(from_var(--primary)_calc(r+205)_calc(g+165)_calc(b+148))] hover:text-black")}let x={stackAlways:!0,wrapActions:!1,actionsClassName:"min-h-9 justify-start gap-3 px-0 py-0"},p={inlineFrom:"xl",wrapActions:!1,scrollbarVariant:"dark",searchClassName:"min-w-0 overflow-hidden xl:!min-w-[360px] xl:!max-w-[400px] xl:!shrink-0 2xl:!min-w-0 2xl:!max-w-[min(100%,480px)]",actionsClassName:"min-w-0 flex-1 gap-1.5 sm:gap-2 xl:!min-w-0 xl:!flex-1 xl:!justify-end xl:!overflow-x-auto xl:!overscroll-x-contain xl:!pb-1 xl:[scrollbar-width:thin]"},m="flex max-w-[736px] min-w-0 items-center gap-2 overflow-x-auto overscroll-x-contain pb-1 sm:gap-2.5 xl:justify-end xl:overflow-visible [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-[#C7C7CC] [&::-webkit-scrollbar-track]:rounded-full [&::-webkit-scrollbar-track]:bg-[#EBEBEB]",h="hover:text-primary hover:bg-background text-text-normal-template-3 h-9 shrink-0 gap-1.5 rounded-lg border border-[#e5e5ea] px-2 py-2 text-xs leading-[22px] font-medium tracking-[0] hover:cursor-pointer sm:h-10 sm:gap-[10px] sm:px-3 sm:py-[9px] sm:text-[14px]"},18332:(e,t,a)=>{a.d(t,{Fc:()=>o,TN:()=>c,XL:()=>i});var r=a(95155);a(12115);var s=a(83101),n=a(64269);let l=(0,s.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:a,...s}=e;return(0,r.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,n.cn)(l({variant:a}),t),...s})}function i(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-title",className:(0,n.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function c(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-description",className:(0,n.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...a})}},23117:(e,t,a)=>{a.d(t,{p:()=>o});var r=a(95155);a(12115);var s=a(64269),n=a(12108),l=a(24033);function o(e){let{className:t,type:a,useCustomStepper:o=!1,disabled:i=!1,...c}=e,d="number"===a;return d&&o?(0,r.jsxs)("div",{className:"group relative",children:[(0,r.jsx)("input",{type:a,"data-slot":"input",disabled:i,className:(0,s.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 text-normal flex h-10 w-full min-w-0 bg-transparent shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","placeholder:text-icon placeholder:text-sm placeholder:font-normal","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","border-border-input gap-2 rounded-lg border px-3 py-2.5 shadow-none","focus-visible:border-primary focus-visible:ring-primary/20 hover:border-primary/50 focus-visible:ring-[3px]","[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",d&&"w-full",t),...c}),d&&!1===i&&(0,r.jsxs)("div",{className:(0,s.cn)("pointer-events-none absolute top-1/2 right-1.5 flex -translate-y-1/2 flex-col items-center justify-center opacity-0 transition-opacity duration-150","group-hover:pointer-events-auto group-hover:opacity-100"),children:[(0,r.jsx)("button",{type:"button",className:"hover:text-icon/110 text-icon h-4 w-4 translate-y-1 transition-colors",onClick:e=>{var t;let a=null==(t=e.currentTarget.parentElement)?void 0:t.previousElementSibling;a.stepUp(),a.dispatchEvent(new Event("change",{bubbles:!0}))},children:(0,r.jsx)(n.A,{className:"h-4 w-4",strokeWidth:3})}),(0,r.jsx)("button",{type:"button",className:"hover:text-icon/110 text-icon h-4 w-4 -translate-y-1 transition-colors",onClick:e=>{var t;let a=null==(t=e.currentTarget.parentElement)?void 0:t.previousElementSibling;a.stepDown(),a.dispatchEvent(new Event("change",{bubbles:!0}))},children:(0,r.jsx)(l.A,{className:"h-4 w-4",strokeWidth:3})})]})]}):(0,r.jsx)("input",{type:a,"data-slot":"input",disabled:i,className:(0,s.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 text-normal flex h-10 w-full min-w-0 bg-transparent shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed md:text-sm","placeholder:text-icon placeholder:text-sm placeholder:font-normal","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","border-border-input gap-2 rounded-lg border px-3 py-2.5 shadow-none","focus-visible:border-primary focus-visible:ring-primary/20 hover:border-primary/50 focus-visible:ring-[3px]","truncate overflow-hidden text-ellipsis whitespace-nowrap",t),...c})}},29337:(e,t,a)=>{a.d(t,{$:()=>o,u:()=>l});var r=a(95155),s=a(12115);let n=(0,s.createContext)(void 0),l=e=>{let{children:t}
1=e,[a,l]=(0,s.useState)(null),[o,i]=s.useState({}),c=(0,s.useMemo)(()=>{var e;return null!=(e=null==a?void 0:a.getSelectedRowModel().rows.map(e=>e.original))?e:[]},[o]);return(0,r.jsx)(n.Provider,{value:{table:a,setTable:l,rowSelection:o,setRowSelection:i,selectedRows:c},children:t})};function o(){let e=(0,s.useContext)(n);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e}},33407:(e,t,a)=>{a.d(t,{a:()=>n});var r=a(95155),s=a(61504);let n=e=>{let{title:t,description:a,isOpen:n,onClose:l,children:o,className:i,titleClassName:c,headerClassName:d,showCloseButton:x=!0}=e;return(0,r.jsx)(s.lG,{open:n,onOpenChange:e=>{e||l()},children:(0,r.jsx)(s.Cf,{className:i,title:t,description:a,titleClassName:null!=c?c:"",headerClassName:null!=d?d:"",showCloseButton:x,onOpenAutoFocus:e=>{e.preventDefault()},children:(0,r.jsx)("div",{className:"min-w-0",children:o})})})}},34857:(e,t,a)=>{a.d(t,{M:()=>d});var r=a(95155),s=a(61362),n=a(52056),l=a(12115),o=a(18720),i=a(52095),c=a(39180);function d(){let[e,t]=(0,l.useState)(""),[a,d]=(0,l.useState)(!1),[x,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)([]),{config:u}=(0,c.r)(),g=null==u?void 0:u.hostName,f=async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=e.trim().split("\n").map(e=>e.trim()).filter(e=>e);if(0===a.length)return void o.toast.error("Vui l\xf2ng nhập \xedt nhất một key");t?d(!0):p(!0),h([]);let l=await Promise.all(a.map(async e=>{try{let a=(0,i.z)({hostName:g,token:e,checkOnly:t}),r=await fetch(a),s=await r.json();if(("success"===s.status||t)&&s.proxy)return{key:e,proxy:s.proxy,timeRemaining:s.timeRemaining,location:s.location,provider:s.provider,lastRotate:s.lastRotate};return{key:e,proxy:null,error:s.message||"Kh\xf4ng lấy được proxy"}}catch(t){return{key:e,proxy:null,error:"Lỗi kết nối API"}}}));h(l),t?d(!1):p(!1);let c=l.filter(e=>e.proxy).length,x=l.filter(e=>!e.proxy).length;if(c>0){let e=t?"Xem th\xe0nh c\xf4ng ".concat(c,"/").concat(l.length," proxy"):"Xoay & lấy th\xe0nh c\xf4ng ".concat(c,"/").concat(l.length," proxy");o.toast.success(e,{icon:(0,r.jsx)(s.A,{className:"h-4 w-4 text-green-600"})})}x>0&&o.toast.error("".concat(x,"/").concat(l.length," proxy thất bại"),{icon:(0,r.jsx)(n.A,{className:"h-4 w-4 text-red-500"})})};return{input:e,setInput:t,loadingCheck:a,loadingRotate:x,results:m,handleFetch:f,handleCopyResults:()=>{let e=m.filter(e=>e.proxy).map(e=>e.proxy).join("\n");e&&(navigator.clipboard.writeText(e),o.toast.success("Đ\xe3 copy danh s\xe1ch proxy!"))}}}},35610:(e,t,a)=>{a.d(t,{$:()=>o,u:()=>l});var r=a(95155),s=a(12115);let n=(0,s.createContext)(void 0),l=e=>{let{children:t}=e,[a,l]=(0,s.useState)(null),[o,i]=s.useState({}),c=(0,s.useMemo)(()=>{var e;return null!=(e=null==a?void 0:a.getSelectedRowModel().rows.map(e=>e.original))?e:[]},[o]);return(0,r.jsx)(n.Provider,{value:{table:a,setTable:l,rowSelection:o,setRowSelection:i,selectedRows:c},children:t})},o=()=>{let e=(0,s.useContext)(n);if(!e)throw Error("useTableContext must be used within a TableProvider");return e}},51042:(e,t,a)=>{a.d(t,{Wu:()=>o,Zp:()=>l,wL:()=>i});var r=a(95155),s=a(12115),n=a(64269);let l=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("bg-card text-card-foreground relative flex w-full flex-col gap-4 roun
1ded-lg border-0 px-6",a),...s})});l.displayName="Card",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("",a),...s})}).displayName="CardHeader",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("leading-none font-semibold tracking-tight",a),...s})}).displayName="CardTitle",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("text-muted-foreground text-sm",a),...s})}).displayName="CardDescription";let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("",a),...s})});o.displayName="CardContent";let i=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("w-full",a),...s})});i.displayName="CardFooter"},52095:(e,t,a)=>{a.d(t,{z:()=>n});let r=e=>e.replace(/\/+$/,""),s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.baseUrl)return r(e.baseUrl);if(e.hostName)return"https://".concat(e.hostName.replace(/^https?:\/\//,""),"/api");let t="https://api-proxy.homeproxy.vn";return t?r(t):r(e.fallbackBaseUrl||"")},n=e=>{let{baseUrl:t,hostName:a,token:r,checkOnly:n=!1,encodeToken:l=!0}=e,o=s({baseUrl:t,hostName:a}),i=l?encodeURIComponent(r):r;return"".concat(o,"/v3/users/rotatev2?token=").concat(i).concat(n?"&checkOnly=true":"")}},55970:(e,t,a)=>{a.d(t,{D:()=>$});var r=a(95155),s=a(12115),n=a(3998),l=a(33407),o=a(72264),i=a(6259),c=a(86948),d=a(41052),x=a(23117),p=a(76444),m=a(31120),h=a(13744),u=a(96334);function g(e){let{selectedProxies:t,onClose:a}=e,{form:s,watchDayOfRenewal:l,calculateTotalAmount:o,renewalInputPlaceholder:i,onSubmit:g,isSubmitting:f}=(0,u.I)({selectedProxies:t,categoryTypeId:1,onClose:a});return(0,r.jsx)(c.Zp,{className:"mx-auto mb-6 w-full min-w-[299px] gap-5 border-none px-0 py-0 shadow-none md:min-w-[350px]",children:(0,r.jsx)(c.Wu,{className:"px-0",children:(0,r.jsx)(d.lV,{...s,children:(0,r.jsx)("form",{onSubmit:g,className:"space-y-8",children:(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 px-6",children:[(0,r.jsx)(m.T,{readOnly:!0,className:"h-32 rounded-2xl border-[#D4D4D8] bg-white text-[14px] leading-5 text-[#71717A] shadow-xs",defaultValue:t.map(e=>{var t,a;return null==e||null==(a=e.proxy)||null==(t=a.ipaddress)?void 0:t.ip}).join("\n")}),(0,r.jsx)(d.zB,{control:s.control,name:"dayOfRenewal",render:e=>{let{field:t}=e;return(0,r.jsxs)(d.eI,{className:"gap-1",children:[(0,r.jsx)(d.lR,{className:"text-text-normal-template-3 text-[16px] leading-[22px] font-medium tracking-[0]",children:"Thời hạn"}),(0,r.jsx)(d.MJ,{children:(0,r.jsx)(x.p,{type:"number",placeholder:i,step:1,min:0,useCustomStepper:!0,className:"no-spinner text-text-normal-template-3 h-10 items-center gap-[10px] rounded-full border-[#D4D4D8] p-[10px] text-sm font-normal",...t,onChange:e=>t.onChange(e.target.value?+e.target.value:"")})}),(0,r.jsx)(d.C5,{})]})}}),(0,r.jsxs)("div",{className:"flex w-full flex-row justify-between",children:[(0,r.jsx)(p.J,{className:"text-text-normal-template-3 text-[16px] leading-[22px] font-medium tracking-[0]",children:"Tổng thanh to\xe1n"}),(0,r.jsxs)("span",{className:"text-2xl font-semibold text-[#DF3B30]",children:[h.A.formatNum(o(l)),"đ"]}
1)]}),(0,r.jsx)(n.$,{disabled:f,type:"submit",className:"h-10 w-full rounded-full bg-[#DF3B30] text-sm font-medium text-white hover:bg-[#DF3B30]/90",children:"Gia hạn"})]})})})})})}var f=a(65142),b=a(51042),v=a(98368),y=a(98535);function j(e){let{selectedProxies:t,onClose:a}=e,{form:s,onSubmit:l,isSubmitting:o}=(0,v.N)({selectedProxies:t,onClose:a});return(0,r.jsx)(b.Zp,{className:"mx-auto mb-6 w-full min-w-[299px] gap-5 border-none px-0 py-0 shadow-none md:min-w-[350px]",children:(0,r.jsx)(b.Wu,{className:"px-0",children:(0,r.jsx)(d.lV,{...s,children:(0,r.jsxs)("form",{onSubmit:l,autoComplete:"off",className:"relative space-y-8",children:[(0,r.jsx)(y.vU,{}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 px-6",children:[(0,r.jsx)(d.zB,{control:s.control,name:"username",render:e=>{let{field:t}=e;return(0,r.jsxs)(d.eI,{className:"relative gap-1",children:[(0,r.jsx)(d.lR,{className:"text-text-normal-template-3 text-[16px] leading-5 font-medium tracking-[0]",children:"T\xe0i khoản proxy"}),(0,r.jsx)(d.MJ,{children:(0,r.jsx)(f.p,{placeholder:"Nhập t\xe0i khoản proxy",className:"text-text-normal-template-3 h-10 rounded-full border-[#D4D4D8] px-4 text-[14px] leading-[22px] font-normal tracking-[0] placeholder:text-[#3C3C43]/60",...t,...y.OV})}),(0,r.jsx)(d.C5,{})]})}}),(0,r.jsx)(d.zB,{control:s.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(d.eI,{className:"relative gap-1",children:[(0,r.jsx)(d.lR,{className:"text-text-normal-template-3 text-[16px] leading-5 font-medium tracking-[0]",children:"Mật khẩu proxy"}),(0,r.jsx)(d.MJ,{children:(0,r.jsx)(f.p,{placeholder:"Nhập mật khẩu proxy",className:"text-text-normal-template-3 h-10 rounded-full border-[#D4D4D8] px-4 text-[14px] leading-[22px] font-normal tracking-[0] placeholder:text-[#3C3C43]/60",...t,...y.P1})}),(0,r.jsx)(d.C5,{})]})}}),(0,r.jsx)(n.$,{disabled:o,type:"submit",className:"h-10 w-full rounded-full bg-[#DF3B30] text-sm font-medium text-white hover:bg-[#DF3B30]/90",children:"Cập nhật"})]})]})})})})}var w=a(24058),N=a(99051),k=a(64269);function C(e){let{className:t,...a}=e;return(0,r.jsx)(w.bL,{"data-slot":"radio-group",className:(0,k.cn)("grid gap-3",t),...a})}function _(e){let{className:t,...a}=e;return(0,r.jsx)(w.q7,{"data-slot":"radio-group-item",className:(0,k.cn)("hover:cursor-pointer border-text-normal-template-3 text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square !w-6 !h-6 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,r.jsx)(w.C1,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:(0,r.jsx)(N.A,{className:"fill-text-normal-template-3 absolute top-1/2 left-1/2 w-[14px] h-[14px] -translate-x-1/2 -translate-y-1/2"})})})}var D=a(30030),F=a(62216);function I(e){let{selectedProxies:t,onClose:a}=e,{form:s,onSubmit:l,isSubmitting:o}=(0,F.d)({selectedProxies:t,onClose:a});return(0,r.jsx)(c.Zp,{className:"mx-auto mb-6 w-full min-w-[299px] gap-5 border-none px-0 py-0 shadow-none md:min-w-[350px]",children:(0,r.jsx)(c.Wu,{className:"px-0",children:(0,r.jsx)(d.lV,{...s,children:(0,r.jsx)("form",{onSubmit:l,className:"space-y-8",children:(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 px-6",children:[(0,r.jsx)(d.zB,{control:s.control,name:"protocol",render:e=>{let{field:t}=e;return(0,r.jsxs)(d.eI,{className:"relative w-full",children:[(0,r.jsx)(C,{defaultValue:t.value,onValueChange:t.onChange,className:"flex flex-col gap-4",children:D.q.map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(_,{value:e.value,id:e.value}),(0,r.jsx)("label",{htmlFor:e.value,className:"text-text-normal-template-3 text-[16px] leading-[22px] font-normal",children:e.name})]},e.value))}),(0,r.jsx)(d.C5,{})]})}}),(0,r.jsx)(n.$,{disabled:o,type:"submit",className:"h-10 w-full rounded-full bg-[#DF3B30] text-sm font-medium text-white hover:bg-[#DF3B30]/90",children:"Cập nhật"})]})})})})})}var B=a(29279),A=a(62976),T=a(37787),P=a(8873),S=a(15522),R=a(17835),E=a(62043);let L=(0,k.cn)(R._7,"rounded-full border-[#D4D4D8] hover:border-[#D4D4D8] hover:bg-[#F4F4F5] hover:text-text-normal-template-3 hover:shadow-[0px_1px_1px_rgba(0,0,0,0.05)] sm:!leading-5");function M(e){let{table:t}
1=e,[a,c]=(0,s.useState)(!1),[d,x]=(0,s.useState)(""),{selectedProxies:p,errorProxies:m,hasSelection:h}=(0,T.C)(t),u=(0,A.k)(),f=(0,s.useMemo)(()=>{switch(d){case"change-info":return"Đổi mật khẩu";case"change-protocol":return"Đổi giao thức";default:return"Gia hạn proxy"}},[d]),b=(0,P.R)({selectedProxies:p}),v=(0,B.H)({selectedProxies:p});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:(0,k.cn)(R.jx,"flex-wrap overflow-visible !pb-0 2xl:!flex-nowrap 2xl:!justify-end 2xl:!overflow-x-visible"),children:[m.length>0&&(0,r.jsxs)(n.$,{onClick:u,variant:"outline",className:(0,k.cn)(L,"whitespace-nowrap"),children:[(0,r.jsx)(o.F.LockIcon,{className:"!h-4 !w-4 text-[#18181B]"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Tạo lại Proxy"}),(0,r.jsx)("span",{className:"sm:hidden",children:"Tạo lại"})]}),(0,r.jsxs)(n.$,{onClick:()=>{if(!h)return void(0,S.Y)("đổi mật khẩu");c(!0),x("change-info")},variant:"outline",className:(0,k.cn)(L,"whitespace-nowrap"),children:[(0,r.jsx)(o.F.ChangePassIcon,{className:"!h-4 !w-4 text-[#18181B]"}),(0,r.jsx)("span",{className:"hidden md:inline",children:"Đổi mật khẩu"}),(0,r.jsx)("span",{className:"md:hidden",children:"Đổi MK"})]}),(0,r.jsxs)(n.$,{onClick:()=>{if(!h)return void(0,S.Y)("đổi giao thức");c(!0),x("change-protocol")},variant:"outline",className:(0,k.cn)(L,"whitespace-nowrap"),children:[(0,r.jsx)(o.F.SecurityIcon,{className:"!h-4 !w-4 text-[#18181B]"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Đổi giao thức"}),(0,r.jsx)("span",{className:"sm:hidden",children:"Giao thức"})]}),(0,r.jsxs)(n.$,{onClick:()=>{if(!h)return void(0,S.Y)("gia hạn");c(!0),x("change-renewal")},variant:"outline",className:(0,k.cn)(L,"whitespace-nowrap"),children:[(0,r.jsx)(o.F.ExtendIcon,{className:"!h-4 !w-4 text-[#18181B]"}),"Gia hạn"]}),(0,r.jsxs)(n.$,{onClick:()=>{if(!h)return void(0,S.Y)("fix");v()},variant:"outline",className:(0,k.cn)(L,"whitespace-nowrap"),children:[(0,r.jsx)(o.F.ChangeProxyIcon,{className:"!h-4 !w-4 text-[#18181B]"}),"Fix"]}),(0,r.jsxs)(i.rI,{modal:!1,children:[(0,r.jsx)(i.ty,{asChild:!0,children:(0,r.jsxs)(n.$,{variant:"outline",className:(0,k.cn)(L,"whitespace-nowrap"),title:"Copy h\xe0ng loạt",children:[(0,r.jsx)(o.F.CopyOrderIcon,{className:"!h-4 !w-4 text-[#18181B]"}),"Copy"]})}),(0,r.jsxs)(i.SQ,{align:"end",className:"rounded-[16px]",children:[(0,r.jsxs)(i._2,{onClick:()=>h?b("proxyIp"):(0,S.Y)("copy Proxy IP"),children:[(0,r.jsx)(o.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy Proxy IP"]}),(0,r.jsxs)(i._2,{onClick:()=>h?b("proxyDomain"):(0,S.Y)("copy Proxy Domain"),children:[(0,r.jsx)(o.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy Proxy Domain"]}),(0,r.jsxs)(i._2,{onClick:()=>h?b("id"):(0,S.Y)("copy ID"),children:[(0,r.jsx)(o.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy ID"]}),(0,r.jsxs)(i._2,{onClick:()=>h?b("id-proxy"):(0,S.Y)("copy ID and Proxy"),children:[(0,r.jsx)(o.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy ID and Proxy"]}),(0,r.jsxs)(i._2,{onClick:()=>h?b("prevIp"):(0,S.Y)("copy Proxy cũ"),children:[(0,r.jsx)(o.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy Proxy cũ"]})]})]}),(0,r.jsx)(E.q,{table:t,className:"shrink-0"})]}),(0,r.jsx)(l.a,{title:f,description:"",isOpen:a,onClose:()=>c(!1),className:(0,k.cn)("gap-5","lg:w-[412px]"),children:(()=>{let e;switch(d){case"change-info":e=(0,r.jsx)(j,{onClose:()=>c(!1),selectedProxies:p});break;case"change-protocol":e=(0,r.jsx)(I,{onClose:()=>c(!1),selectedProxies:p});break;default:e=(0,r.jsx)(g,{onClose:()=>c(!1),selectedProxies:p})}return e})()})]})}var z=a(35610);let $=e=>{let{withToolbar:t=!1}=e,a=(0,z.$)(),s=t?a.table:null;return s?(0,r.jsx)(M,{table:s}):(0,r.jsx)(r.Fragment,{})}},58067:(e,t,a)=>{a.d(t,{b:()=>l,k:()=>n});var r=a(87813),s=a.n(r);let n=e=>{let t=e.replace(/\D/g,"");return t.startsWith("0")?"+84".concat(t.substring(1)):11===t.length&&t.startsWith("84")?"+".concat(t):e},l=async e=>{if(navigator.clipboard&&window.isSecureContext&&"undefined"!=typeof ClipboardItem)try{let t=new ClipboardItem({"text/plain":e.then(e=>new Blob([e],{type:"text/plain"}))});return await navigator.clipboard.write([t]),!0}catch(t){try{let t=await e;return await navigator.clipboard.writeText(t),!0}catch(e){}}try{let t=await e;return s()(t)}catch(e){return!1}}},58795:(e,t,a)=>{a.d(t,{f:()=>s});var r=a(13744);let s=async(e,t)=>r.A.fetchApi("/api/v2/proxies/".concat(e,"/generate-token"),t).then(e=>null==e?void 0:e.token)},61504:(e,t,a)=>{a.d(t,{Cf:()=>d,lG:()=>o});var r=a(95155);a(12115);var s=a(89511),n=a(65229),l=a(64269);function o(e){let{...t}=e;return(0,r.jsx)(s.bL,{"data-slot":"dialog",...t})}function i(e){let{...t}=e;return(0,r.jsx)(s.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{className:t,...a}=e;return(0,r.jsx)(s.hJ,{"data-slot":"dialog-overlay",className:(0,l.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function d(e){let{className:t,children:a,showCloseButton:o=!0,title:d,titleClassName:m="",headerClassName:h="",description:u,...g}=e;return(0,r.jsxs)(i,{"data-slot":"dialog-portal",children:[(0,r.jsx)(c,{}),(0,r.jsxs)(s.UC,{"data-slot":"dialog-content",className:(0,l.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex w-auto max-w-[583px] min-w-0 translate-x-[-50%] translate-y-[-50%] flex-col rounded-[24px] border-none shadow-[0_2px_4px_0_var(--shadow-modal)] duration-200 sm:max-w-[886px]",t),...g,children:[(0,r.jsxs)(x,{className:h,children:[(0,r.jsx)(p,{className:d?"text-text-normal-template-3 h-full align-middle text-[18px] leading-5 font-semibold ".concat(m," "):"hidden",children:d}),o&&(0,r.jsxs)(s.bm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-primary data-[state=open]:bg-accent data-[state=open]:text-muted-foreground rounded-xs transition-opacity hover:cursor-pointer hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,r.jsx)(n.A,{className:"!h-6 !w-6 text-neutral-900"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]}),a]})]})}function x(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"dialog-header",className:(0,l.cn)("sticky top-0 z-50 flex h-12 w-auto flex-row items-center justify-between rounded-t-[24px] bg-[#F3EAE2] px-8 py-4 text-center sm:text-left",t),...a})}function p(e){let{className:t,...a}=e;return(0,r.jsx)(s.hE,{"data-slot":"dialog-title",className:(0,l.cn)("text-normal text-base leading-none font-semibold",t),...a})}},62043:(e,t,a)=>{a.d(t,{q:()=>d});var r=a(95155),s=a(3998),n=a(63817),l=a(26333),o=a(64269),i=a(72264),c=a(12115);function d(e){let{table:t,className:a}=e,d=c.useMemo(()=>t.getAllColumns().filter(e=>void 0!==e.accessorFn&&e.getCanHide()),[t]);return 0===d.length?null:(0,r.jsxs)(l.AM,{children:[(0,r.jsx)(l.Wv,{asChild:!0,children:(0,r.jsx)(s.$,{"aria-label":"Toggle columns",role:"combobox",variant:"outline",size:"sm",className:(0,o.cn)("bg-background group h-10 w-[140px] shrink-0 rounded-full border-[#D4D4D8] px-4 py-2 font-normal data-[state=open]:!border-[#DF3B30] data-[state=open]:!bg-white data-[state=open]:shadow-[0px_1px_2px_0px_rgba(0,0,0,0.05),0px_0px_0px_4px_#FFEBEB]",a),children:(0,r.jsxs)("div",{className:"flex w-full flex-row items-center gap-[10px]",children:[(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"!h-4 !w-4 text-[#18181B]",children:[(0,r.jsx)("path",{d:"M8.33333 4.16699H2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M10 15.833H2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M11.668 2.5V5.83333",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M13.332 14.167V17.5003",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M17.5 10H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M17.4987 15.833H13.332",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M17.5013 4.16699H11.668",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6.66797 8.33301V11.6663",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6.66667 10H2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,r.jsx)("span",{className:"text-[14px] leading-5 font-normal tracking-[0] text-[#18181B]",children:"Hiển thị"}),(0,r.jsx)(i.F.DropdownChevronIcon,{className:"!h-4 !w-4 shrink-0 text-[#8A92A6] transition-transform group-data-[state=open]:rotate-180"})]})})}),(0,r.jsx)(l.hl,{align:"end",className:"w-[170px] rounded-[16px] border-[#
1E4E4E7] p-[8px] shadow-[0px_0px_4px_rgba(0,0,0,0.05)]",children:(0,r.jsx)(n.uB,{children:(0,r.jsxs)(n.oI,{children:[(0,r.jsx)(n.xL,{children:"No columns found."}),(0,r.jsx)(n.L$,{className:"p-0",children:d.map(e=>{var t,a;return"filter"===e.id||"products"===e.id||"toAddress"===e.id||"proxy"===e.id||"protocol"===e.id?null:(0,r.jsxs)(n.h_,{onSelect:()=>{e.toggleVisibility(!e.getIsVisible()),0===d.filter(e=>e.getIsVisible()).length&&d.forEach(e=>e.toggleVisibility(!0))},className:"w-full justify-between gap-2 rounded-[12px] px-[8px] py-[4px] not-last:mb-[4px] data-[selected=true]:bg-[#F4F4F5] data-[selected=true]:text-[#18181B]",children:[(0,r.jsx)("span",{className:"text-text-normal truncate text-sm font-normal",children:null!=(a=null==(t=e.columnDef.meta)?void 0:t.label)?a:e.id}),(0,r.jsx)(i.F.CheckIcon,{className:(0,o.cn)("text-success !h-4 !w-4 shrink-0",e.getIsVisible()?"opacity-100":"opacity-0")})]},e.id)})})]})})})]})}},62976:(e,t,a)=>{a.d(t,{k:()=>d});var r=a(95155),s=a(13744),n=a(61362),l=a(96199),o=a(20063),i=a(18720),c=a(31342);function d(){let{data:e}=(0,l.wV)(),t=(0,o.useRouter)();return async function(){try{await s.A.fetchApi("/api/v1/proxies/repick",null==e?void 0:e.accessToken),i.toast.success("Tạo lại proxy th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(n.A,{className:"h-4 w-4 text-green-600"})})}catch(e){}finally{(0,c.j)(e=>null==e?void 0:e.toString().startsWith("/api/v1/users/proxies")),t.refresh()}}}},67907:(e,t,a)=>{a.d(t,{S:()=>i,_:()=>c});var r=a(95155),s=a(12115),n=a(38162),l=a(5917),o=a(64269);let i=s.forwardRef((e,t)=>{let{className:a,iconClassName:s,...i}=e;return(0,r.jsx)(n.bL,{ref:t,className:(0,o.cn)("peer data-[state=checked]:text-background hover:border-checkbox-blur hover:ring-checkbox-blur/40 h-5 w-5 shrink-0 rounded-sm border border-[#AEAEB2] shadow-none hover:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-none data-[state=checked]:bg-[#34c759]",a),...i,children:(0,r.jsx)(n.C1,{className:(0,o.cn)("text-background flex items-center justify-center"),children:(0,r.jsx)(l.A,{className:(0,o.cn)("h-4 w-4",s)})})})});i.displayName=n.bL.displayName;let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.bL,{ref:t,className:(0,o.cn)("peer focus-visible:ring-primary/10 data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground hover:border-checkbox-blur h-4 w-4 shrink-0 rounded-[3px] border-2 border-[#18181B] shadow-none hover:cursor-pointer hover:ring-1 hover:ring-black/50 focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",a),...s,children:(0,r.jsx)(n.C1,{className:(0,o.cn)("flex items-center justify-center text-current"),children:(0,r.jsx)(l.A,{className:"h-3 w-3"})})})});c.displayName=n.bL.displayName},68114:(e,t,a)=>{a.d(t,{I:()=>c});var r=a(15243),s=a(66942),n=a(12115),l=a(22544),o=a(15653);let i=o.z.object({password:o.z.string().nonempty("Mật khẩu l\xe0 bắt buộc"),rotateInterval:o.z.number().min(0,"Thời gian xoay lớn hơn 0").int({message:"Phải l\xe0 số nguy\xean"}).optional(),isAutoRotate:o.z.boolean()});function c(e){var t,a,o,c,d;let{selectedProxy:x,selectedProxies:p=[],onClose:m}=e,{router:h,accessToken:u,merchantId:g}=(0,r.x)(),f=null!=x?x:p[0],b=x?[x.id]:p.map(e=>e.id),v=(0,l.mN)({resolver:(0,s.u)(i),values:{password:null!=(c=null==f||null==(t=f.proxy)?void 0:t.password)?c:"",rotateInterval:null!=(d=null==f||null==(a=f.proxy)?void 0:a.rotateInterval)?d:0,isAutoRotate:(null==f||null==(o=f.proxy)?void 0:o.rotateInterval)!=0}}),y=v.watch("isAutoRotate");(0,n.useEffect)(()=>{y||v.setValue("rotateInterval",0)},[v,y]);let j=async e=>{await (0,r.C)({form:v,userProxyIds:b,values:e,accessToken:u,merchantId:g,onSuccess:()=>{h.refresh(),m()}})};return{form:v,activeProxy:f,wIsAutoRotate:y,onSubmit:v.handleSubmit(j),isSubmitting:v.formState.isSubmitting}}},69605:(e,t,a)=>{a.d(t,{Ru:()=>x,YB:()=>d,oA:()=>c});var r=a(95155),s=a(18720),n=a(52056),l=a(61362),o=a(11821);let i=e=>(0,r.jsx)("div",{className:"toast-clamp",children:e.join("\n")}),c=e=>{let t=(0,o.f3)(e);if("success"===t.type)return void s.toast.success(t.title,{description:t.description?(0,r.jsx)("div",{className:"toast-clamp",children:t.description}):void 0,duration:5e3});s.toast.error(t.title,{description:t.description,duration:5e3,icon:(0,r.jsx)(n.A,{className:"h-4 w-4 text-red-500"})})},d=e=>{let{successMessages:t,tooSoonMessages:a,errorMessages:n}=e;t.length>0&&s.toast.success("Xoay th\xe0nh c\xf4ng ".concat(t.length," proxy"),{description:i(t),duration:5e3,icon:(0,r.jsx)(l.A,{className:"h-4 w-4 text-green-600"})}),a.length>0&&s.toast.error("C\xf3 ".concat(a.length," proxy chưa thể xoay"),{description:i(a),duration:8e3}),n.length>0&&s.toast.error("C\xf3 ".concat(n.length," proxy xoay thất bại"),{description:i(n),duration:8e3})},x=()=>{s.toast.error("Kh\xf4ng nhận được kết quả xoay proxy từ hệ thống")}},75221:(e,t,a)=>{a.d(t,{O:()=>o});var r=a(95155),s=a(20243),n=a(87270),l=a(64269);
1function o(e){let{columnCount:t,rowCount:a=10,filterCount:o=0,cellWidths:i=["auto"],withViewOptions:c=!0,withPagination:d=!0,shrinkZero:x=!1,className:p,...m}=e,h=Array.from({length:t},(e,t)=>{var a;return null!=(a=i[t%i.length])?a:"auto"});return(0,r.jsxs)("div",{className:(0,l.cn)("flex flex-1 flex-col space-y-4",p),...m,children:[(0,r.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 overflow-auto p-1",children:[(0,r.jsx)("div",{className:"flex flex-1 items-center gap-2",children:o>0?Array.from({length:o}).map((e,t)=>(0,r.jsx)(s.E,{className:"h-7 w-[4.5rem] border-dashed"},t)):null}),c?(0,r.jsx)(s.E,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),(0,r.jsx)("div",{className:"flex-1 rounded-md border",children:(0,r.jsxs)(n.Table,{children:[(0,r.jsx)(n.TableHeader,{children:Array.from({length:1}).map((e,a)=>(0,r.jsx)(n.TableRow,{className:"hover:bg-transparent",children:Array.from({length:t}).map((e,t)=>(0,r.jsx)(n.TableHead,{style:{width:h[t],minWidth:x?h[t]:"auto"},children:(0,r.jsx)(s.E,{className:"h-6 w-full"})},t))},a))}),(0,r.jsx)(n.TableBody,{children:Array.from({length:a}).map((e,a)=>(0,r.jsx)(n.TableRow,{className:"hover:bg-transparent",children:Array.from({length:t}).map((e,t)=>(0,r.jsx)(n.TableCell,{style:{width:h[t],minWidth:x?h[t]:"auto"},children:(0,r.jsx)(s.E,{className:"h-6 w-full"})},t))},a))})]})}),d?(0,r.jsxs)("div",{className:"flex w-full items-center justify-between gap-4 overflow-auto p-1 sm:gap-8",children:[(0,r.jsx)(s.E,{className:"h-7 w-40 shrink-0"}),(0,r.jsxs)("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(s.E,{className:"h-7 w-24"}),(0,r.jsx)(s.E,{className:"h-7 w-[4.5rem]"})]}),(0,r.jsx)("div",{className:"flex items-center justify-center text-sm font-medium",children:(0,r.jsx)(s.E,{className:"h-7 w-20"})}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(s.E,{className:"hidden size-7 lg:block"}),(0,r.jsx)(s.E,{className:"size-7"}),(0,r.jsx)(s.E,{className:"size-7"}),(0,r.jsx)(s.E,{className:"hidden size-7 lg:block"})]})]})]}):null]})}},87270:(e,t,a)=>{a.d(t,{Table:()=>n,TableBody:()=>o,TableCell:()=>d,TableHead:()=>c,TableHeader:()=>l,TableRow:()=>i});var r=a(95155);a(12115);var s=a(64269);function n(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,r.jsx)("table",{"data-slot":"table",className:(0,s.cn)("w-full caption-bottom text-sm",t),...a})})}function l(e){let{className:t,...a}=e;return(0,r.jsx)("thead",{"data-slot":"table-header",className:(0,s.cn)("[&_tr]:border-b",t),...a})}function o(e){let{className:t,...a}=e;return(0,r.jsx)("tbody",{"data-slot":"table-body",className:(0,s.cn)("[&_tr:last-child]:border-0",t),...a})}function i(e){let{className:t,...a}=e;return(0,r.jsx)("tr",{"data-slot":"table-row",className:(0,s.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...a})}function c(e){let{className:t,...a}=e;return(0,r.jsx)("th",{"data-slot":"table-head",className:(0,s.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("td",{"data-slot":"table-cell",className:(0,s.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}},92079:(e,t,a)=>{a.d(t,{A:()=>x});var r=a(95155),s=a(3998),n=a(86948),l=a(41052),o=a(23117),i=a(67907),c=a(68114),d=a(98535);function x(e){var t,a;let{selectedProxies:x,selectedProxy:p,onClose:m}=e,{form:h,activeProxy:u,wIsAutoRotate:g,onSubmit:f,isSubmitting:b}=(0,c.I)({selectedProxy:p,selectedProxies:x,onClose:m});if(!u)return null;let v=null!=(a=null==u||null==(t=u.proxy)?void 0:t.rotateInterval)?a:0;return(0,r.jsx)(n.Zp,{className:"mx-auto mb-6 w-full min-w-[299px] gap-5 border-none px-0 py-0 shadow-none md:min-w-[350px]",children:(0,r.jsx)(n.Wu,{className:"px-0",children:(0,r.jsx)(l.lV,{...h,children:(0,r.jsxs)("form",{onSubmit:f,autoComplete:"off",className:"relative space-y-8",children:[(0,r.jsx)(d.vU,{}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 px-6",children:[(0,r.jsx)(l.zB,{control:h.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(l.eI,{className:"relative gap-1",children:[(0,r.jsx)(l.lR,{className:"text-text-normal-template-3 text-[16px] leading-5 font-medium tracking-[0]",children:"Mật khẩu proxy"}),(0,r.jsx)(l.MJ,{children:(0,r.jsx)(o.p,{placeholder:"Nhập mật khẩu proxy",className:"text-text-normal-template-3 h-10 rounded-full border-[#D4D4D8] px-4 text-[14px] leading-5 font-normal tracking-[0] placeholder:text-[#3C3C43]/60",...t,...d.P1})}),(0,r.jsx)(l.C5,{})]})}}),(0,r.jsxs)("div",{className:"flex h-[21px] flex-row justify-between",children:[(0,r.jsx)(l.zB,{control:h.control,name:"isAutoRotate",render:e=>{let{field:t}=e;return(0,r.jsxs)(l.eI,{className:"grid-cols-[120px_1fr]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(l.lR,{className:"whitespace-nowrap",children:"Tự động xoay"}),(0,r.jsx)(l.MJ,{children:(0,r.jsx)(i.S,{checked:t.value,onCheckedChange:t.onChange,className:"!h-4 !w-4 data-[state=checked]:bg-[#34c759]"})})]}),(0,r.jsx)(l.C5,{className:"col-span-2"})]})}}),(0,r.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,r.jsx)("span",{className:"text-text-normal-template-3 flex h-[20px] items-center text-sm font-normal",children:"Thời gian xoay (ph\xfat)"}),(0,r.jsx)(l.zB,{control:h.control,name:"rotateInterval",render:e=>{let{field:t}=e;return(0,r.jsx)(l.eI,{children:(0,r.jsx)(l.MJ,{children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{step:1,min:0,type:"number",placeholder:v.toString(),className:"no-spinner text-text-normal-template-3 w-15 border-b-1 border-b-[#c7c7cc] text-center focus:ring-0 focus:outline-none focus-visible:ring-0",value:t.value,disabled:!g,onChange:e=>{let a=e.target.value;if(""===a)return void t.onChange("");
1t.onChange(+a)},onBlur:()=>{(!t.value||t.value<0)&&t.onChange(0)}}),(0,r.jsx)(l.C5,{})]})})})}})]})]}),(0,r.jsx)(s.$,{disabled:b,type:"submit",className:"h-10 w-full rounded-full bg-[#DF3B30] text-sm font-medium text-white hover:bg-[#DF3B30]/90",children:"Cập nhật"})]})]})})})})}},97543:(e,t,a)=>{a.d(t,{D:()=>X});var r=a(95155),s=a(29337),n=a(3998),l=a(6259),o=a(17835),i=a(7181),c=a(13744),d=a(64269),x=a(72264),p=a(33407),m=a(15522),h=a(62043),u=a(11821),g=a(69605),f=a(61362),b=a(96199),v=a(20063),y=a(12115),j=a(18720),w=a(31342),N=a(41052),k=a(65142),C=a(51042),_=a(76444),D=a(31120),F=a(96334);function I(e){let{selectedProxies:t,onClose:a}=e,{form:s,watchDayOfRenewal:l,calculateTotalAmount:o,renewalInputPlaceholder:i,onSubmit:d,isSubmitting:x}=(0,F.I)({selectedProxies:t,categoryTypeId:2,onClose:a});return(0,r.jsx)(C.Zp,{className:"mx-auto mb-6 w-full min-w-[299px] gap-5 border-none px-0 py-0 shadow-none md:min-w-[350px]",children:(0,r.jsx)(C.Wu,{className:"px-0",children:(0,r.jsx)(N.lV,{...s,children:(0,r.jsx)("form",{onSubmit:d,className:"space-y-8",children:(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 px-6",children:[(0,r.jsx)(D.T,{readOnly:!0,className:"h-32 rounded-2xl border-[#D4D4D8] bg-white text-[14px] leading-5 text-[#71717A] shadow-xs",defaultValue:t.map(e=>{var t,a,r;return(null==e||null==(a=e.proxy)||null==(t=a.ipaddress)?void 0:t.ip)+":"+(null==e||null==(r=e.proxy)?void 0:r.port)}).join("\n")}),(0,r.jsx)(N.zB,{control:s.control,name:"dayOfRenewal",render:e=>{let{field:t}=e;return(0,r.jsxs)(N.eI,{className:"gap-1",children:[(0,r.jsx)(N.lR,{className:"text-text-normal-template-3 text-[14px] leading-5 font-medium tracking-[0]",children:"Thời hạn"}),(0,r.jsx)(N.MJ,{children:(0,r.jsx)(k.p,{type:"number",placeholder:i,step:1,min:0,className:"no-spinner text-text-normal-template-3 h-10 items-center gap-[10px] rounded-full border-[#D4D4D8] p-[10px] text-sm font-normal",...t,onChange:e=>t.onChange(e.target.value?+e.target.value:"")})}),(0,r.jsx)(N.C5,{})]})}}),(0,r.jsxs)("div",{className:"flex h-[28px] w-full flex-row justify-between",children:[(0,r.jsx)(_.J,{className:"text-text-normal-template-3 text-[14px] leading-5 font-medium tracking-[0]",children:"Tổng thanh to\xe1n"}),(0,r.jsxs)("span",{className:"text-2xl font-semibold text-[#DF3B30]",children:[c.A.formatNum(o(l)),"đ"]}
1)]}),(0,r.jsx)(n.$,{disabled:x,type:"submit",className:"h-10 w-full rounded-full bg-[#DF3B30] text-sm font-medium text-white hover:bg-[#DF3B30]/90",children:"Gia hạn"})]})})})})})}var B=a(92079),A=a(52056),T=a(75426),P=a(35299),S=a(18332),R=a(34857),E=a(52619),L=a.n(E);function M(e){let{onClose:t}=e,{input:a,setInput:s,loadingCheck:l,loadingRotate:o,results:i,handleFetch:c,handleCopyResults:d}=(0,R.M)();return(0,r.jsx)(C.Zp,{className:"mx-auto mb-6 flex max-h-[85vh] w-full min-w-[299px] flex-col gap-8 border-none px-0 py-0 shadow-none md:min-w-[350px]",children:(0,r.jsxs)(C.Wu,{className:"flex flex-1 flex-col overflow-hidden px-0",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-3.5 overflow-y-auto",children:[(0,r.jsx)("div",{className:"px-6",children:(0,r.jsxs)("div",{className:"space-y-1 text-sm text-[#18181B]",children:[(0,r.jsxs)("p",{className:"flex items-start gap-1",children:[(0,r.jsx)("span",{className:"mt-2 size-1.5 shrink-0 rounded-full bg-[#18181B]"}),(0,r.jsx)("span",{children:"Nhập key v\xe0o \xf4 b\xean dưới để xem th\xf4ng tin proxy hiện tại"})]}),(0,r.jsxs)("p",{className:"flex items-start gap-1",children:[(0,r.jsx)("span",{className:"mt-2 size-1.5 shrink-0 rounded-full bg-[#18181B]"}),(0,r.jsx)("span",{children:'Lấy link xoay: Sử dụng n\xfat "Copy Link xoay" trong bảng danh s\xe1ch'})]}),(0,r.jsxs)("p",{className:"flex items-start gap-1",children:[(0,r.jsx)("span",{className:"mt-2 size-1.5 shrink-0 rounded-full bg-[#18181B]"}),(0,r.jsxs)("span",{children:["Tham khảo"," ",(0,r.jsx)(L(),{href:"/tai-lieu-api",className:"text-primary hover:text-primary/80 underline",children:"t\xe0i liệu API"})," ","để biết th\xeam chi tiết"]})]})]})}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-4 px-6",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(_.J,{htmlFor:"input",className:"text-text-normal-template-3 text-[14px] leading-[20px] font-medium tracking-[0]",children:"Nhập key (mỗi d\xf2ng một key)"}),(0,r.jsx)(D.T,{id:"input",placeholder:"key1\nkey2\nkey3",value:a,onChange:e=>s(e.target.value),rows:5,spellCheck:!1,disabled:l||o,className:"text-text-normal-template-3 h-[120px] gap-[16px] rounded-2xl border-[#D4D4D8] bg-white font-mono text-sm shadow-xs",style:{whiteSpace:"pre",wordWrap:"normal",overflowWrap:"normal",wordBreak:"normal"}}),(0,r.jsx)("p",{className:"text-muted-foreground text-[11px] break-all sm:text-xs",children:"V\xed dụ: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."})]})}),i.length>0&&(0,r.jsxs)("div",{className:"space-y-3 px-6",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)(_.J,{className:"text-text-normal-template-3 text-[14px] leading-[20px] font-medium tracking-[0]",children:["Kết quả (",i.length,")"]}),(0,r.jsx)(n.$,{type:"button",size:"sm",variant:"outline",onClick:d,disabled:!i.some(e=>e.proxy),className:"h-9 rounded-[100px] px-4 text-sm",children:"Copy tất cả"})]}),(0,r.jsx)("div",{className:"border-border-template-3 max-h-[200px] space-y-2 overflow-y-auto rounded-[12px] border p-3 sm:max-h-[280px]",children:i.map((e,t)=>(0,r.jsxs)("div",{className:"space-y-0.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 sm:gap-1.5",children:[e.proxy?(0,r.jsx)(f.A,{className:"h-3 w-3 flex-shrink-0 text-green-600 sm:h-3.5 sm:w-3.5"}):(0,r.jsx)(A.A,{className:"h-3 w-3 flex-shrink-0 text-red-500 sm:h-3.5 sm:w-3.5"}),(0,r.jsx)("span",{className:"font-mono text-[10px] font-medium sm:text-xs",title:e.key,children:e.key.length>15?"".concat(e.key.substring(0,15),"..."):e.key})]}),e.proxy?(0,r.jsxs)("div",{className:"ml-4 flex items-start gap-1 sm:ml-5 sm:gap-1.5",children:[(0,r.jsxs)("div",{className:"flex-1 rounded-[8px] bg-[#787880]/8 px-1.5 py-0.5 font-mono text-[10px] leading-tight break-all sm:px-2 sm:py-1 sm:text-[11px]",children:[e.proxy,null!=e.timeRemaining&&(0,r.jsxs)("span",{className:"ml-2 font-semibold ".concat(0===e.timeRemaining?"text-green-500":"text-red-500"),children:[e.timeRemaining,"s"]}
1)]}),(0,r.jsx)(n.$,{type:"button",size:"sm",variant:"ghost",className:"h-5 w-5 flex-shrink-0 p-0 sm:h-6 sm:w-6",onClick:()=>{navigator.clipboard.writeText(e.proxy),j.toast.success("Đ\xe3 copy proxy!")},children:(0,r.jsx)(T.A,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5"})})]}):(0,r.jsx)(S.Fc,{variant:"destructive",className:"ml-4 py-0.5 sm:ml-5 sm:py-1",children:(0,r.jsx)(S.TN,{className:"text-[10px] sm:text-[11px]",children:e.error})})]},t))})]})]}),(0,r.jsxs)("div",{className:"flex flex-col-reverse gap-3 px-6 pt-2 sm:flex-row",children:[(0,r.jsxs)(n.$,{type:"button",onClick:()=>c(!0),disabled:l||o||!a.trim(),className:"h-10 flex-1 rounded-full bg-[#FAE1E0] text-sm font-medium text-[#DF3B30] hover:bg-[#FAE1E0]/80",children:[l&&(0,r.jsx)(P.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin sm:mr-2 sm:h-4 sm:w-4"}),l?"Đang xem...":"Xem proxy hiện tại"]}),(0,r.jsxs)(n.$,{type:"button",onClick:()=>c(!1),disabled:l||o||!a.trim(),className:"h-10 flex-1 rounded-full bg-[#DF3B30] text-sm font-medium text-white hover:bg-[#DF3B30]/90",children:[o&&(0,r.jsx)(P.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin sm:mr-2 sm:h-4 sm:w-4"}),o?"Đang xoay...":"Xoay"]})]})]})})}let z=(0,d.cn)(o._7,"rounded-full border-[#D4D4D8] hover:border-[#D4D4D8] hover:bg-[#F4F4F5] hover:text-text-normal-template-3 hover:shadow-[0px_1px_1px_rgba(0,0,0,0.05)] sm:!leading-5");function $(e){let{table:t}=e,[a,s]=(0,y.useState)(!1),[N,k]=(0,y.useState)(""),{data:C}=(0,b.wV)(),_=(0,v.useRouter)(),D=(0,y.useMemo)(()=>t.getSelectedRowModel().rows.map(e=>e.original),[t.getSelectedRowModel().rows]),F=D.length>0,A=(0,y.useMemo)(()=>t.getRowModel().rows.filter(e=>{var t;let a=null==(t=e.original.status)?void 0:t.id;return["10","11"].includes(null==a?void 0:a.toString())}),[t.getRowModel().rows]),T=(0,y.useMemo)(()=>D.some(e=>{var t;return!0===e.isCdk||(null==(t=e.proxy)?void 0:t.isCdk)===!0}),[D]),P=async()=>{try{await c.A.fetchApi("/api/v1/proxies/repick",null==C?void 0:C.accessToken),j.toast.success("Tạo lại proxy th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(f.A,{className:"h-4 w-4 text-green-600"})})}catch(e){}finally{(0,w.j)(e=>null==e?void 0:e.toString().startsWith("/api/v1/users/proxies")),_.refresh()}},S=(0,y.useMemo)(()=>{switch(N){case"change-info":return"Thiết lập th\xf4ng tin Proxy xoay";case"fetch-proxy":return"Lấy Proxy";default:return"Gia hạn proxy xoay"}},[N]),R=async()=>{if(0===D.length)return void(0,m.Y)("xoay");if(T)return void j.toast.error("Kh\xf4ng thể xoay proxy CDK. Vui l\xf2ng bỏ chọn c\xe1c proxy CDK.");try{let e=D.map(e=>e.id),t=await c.A.postApi("/api/v1/proxies/rotate-by-ids",{userproxiesIds:e},null==C?void 0:C.accessToken),a=(0,u.mz)(t);if(a.length>0){let{successMessages:e,tooSoonMessages:t,errorMessages:r}=(0,u.Lv)(a);(0,g.YB)({successMessages:e,tooSoonMessages:t,errorMessages:r}),(0,w.j)(e=>null==e?void 0:e.toString().startsWith("/api/v1/users/proxies")),_.refresh()}else(0,g.Ru)()}catch(l){var e,t,a,s,n;if((null==l||null==(e=l.response)?void 0:e.status)===400&&(null==l||null==(n=l.response)||null==(s=n.data)||null==(a=s.errors)||null==(t=a.msg)?void 0:t.skipped)){let e=[];l.response.data.errors.msg.skipped.forEach(t=>{e.push("".concat(t.username,": ").concat(t.reason))}),j.toast.error("Tất cả proxy đều chưa tới thời gian xoay",{description:(0,r.jsx)("div",{className:"toast-clamp",children:e.join("\n")}),duration:8e3})}else j.toast.error("C\xf3 lỗi xảy ra khi xoay proxy")}},E=(0,i.m)({selectedProxies:D,successMessage:"Copied to clipboard!",errorMessage:"Failed to copy. Please try again."});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:(0,d.cn)(o.jx,"flex-wrap overflow-visible !pb-0 2xl:!flex-nowrap 2xl:!justify-end 2xl:!overflow-x-visible"),children:[A.length>0&&(0,r.jsxs)(n.$,{onClick:P,variant:"outline",className:(0,d.cn)(z,"whitespace-nowrap"),children:[(0,r.jsx)(x.F.LockIcon,{className:"!h-4 !w-4 text-[#18181B]"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Tạo lại Proxy"}),(0,r.jsx)("span",{className:"sm:hidden",children:"Tạo lại"})]}),(0,r.jsxs)(n.$,{onClick:()=>
1{if(!F)return void(0,m.Y)("thiết lập");s(!0),k("change-info")},variant:"outline",className:(0,d.cn)(z,"whitespace-nowrap"),children:[(0,r.jsx)(x.F.SettingIcon,{className:"!h-4 !w-4 text-[#18181B]"}),"Thiết lập"]}),(0,r.jsxs)(n.$,{onClick:R,variant:"outline",className:(0,d.cn)(z,"whitespace-nowrap"),disabled:T,children:[(0,r.jsx)(x.F.RotateActionIcon,{className:"!h-4 !w-4 text-[#18181B]"}),"Xoay"]}),(0,r.jsxs)(n.$,{onClick:()=>{if(!F)return void(0,m.Y)("gia hạn");s(!0),k("change-renewal")},variant:"outline",className:(0,d.cn)(z,"whitespace-nowrap"),children:[(0,r.jsx)(x.F.ExtendIcon,{className:"!h-4 !w-4 text-[#18181B]"}),"Gia hạn"]}),(0,r.jsxs)(l.rI,{modal:!1,children:[(0,r.jsx)(l.ty,{asChild:!0,children:(0,r.jsxs)(n.$,{variant:"outline",className:(0,d.cn)(z,"whitespace-nowrap"),title:"Copy h\xe0ng loạt",children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"!h-4 !w-4 text-[#18181B]"}),"Copy"]})}),(0,r.jsxs)(l.SQ,{align:"end",className:"rounded-[16px]",children:[(0,r.jsxs)(l._2,{onClick:()=>F?E("proxy"):(0,m.Y)("copy Proxy"),children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy Proxy"]}),(0,r.jsxs)(l._2,{onClick:()=>F?E("link"):(0,m.Y)("copy Link xoay"),children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy Link xoay"]}),(0,r.jsxs)(l._2,{onClick:()=>F?E("proxy-link"):(0,m.Y)("copy Proxy v\xe0 link xoay"),children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy Proxy v\xe0 link xoay"]}),(0,r.jsxs)(l._2,{onClick:()=>F?E("id"):(0,m.Y)("copy ID"),children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy ID"]}),(0,r.jsxs)(l._2,{onClick:()=>F?E("old-id"):(0,m.Y)("copy ID cũ"),children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy ID cũ"]})]})]}),(0,r.jsx)(h.q,{table:t,className:"shrink-0"})]}),(0,r.jsx)(p.a,{title:S,description:"",isOpen:a,onClose:()=>s(!1),className:(0,d.cn)("gap-5","fetch-proxy"===N?"lg:w-[492px]":"lg:w-[412px]"),children:(()=>{let e;switch(N){case"change-info":e=(0,r.jsx)(B.A,{onClose:()=>s(!1),selectedProxies:D});break;case"fetch-proxy":e=(0,r.jsx)(M,{onClose:()=>s(!1)});break;default:e=(0,r.jsx)(I,{onClose:()=>s(!1),selectedProxies:D})}return e})()})]})}var V=a(39180),O=a(52095),W=a(58067),Y=a(58795);let J=(0,d.cn)(o._7,"rounded-full border-[#D4D4D8] hover:border-[#D4D4D8] hover:bg-[#F4F4F5] hover:text-text-normal-template-3 hover:shadow-[0px_1px_1px_rgba(0,0,0,0.05)] sm:!leading-5");function H(e){let{table:t}=e,[a,s]=(0,y.useState)(!1),[i,c]=(0,y.useState)(""),{data:u}=(0,b.wV)(),{config:g}=(0,V.r)(),f=null==g?void 0:g.hostName,v=()=>f?"https://".concat(f):null,w=(0,y.useMemo)(()=>t.getSelectedRowModel().rows.map(e=>e.original),[t.getSelectedRowModel().rows]),N=w.length>0,k=(0,y.useMemo)(()=>"fetch-proxy"===i?"Lấy Proxy":"Gia hạn key xoay",[i]),C=async e=>{let t;switch(e){case"id":t=Promise.resolve(w.map(e=>e.code).join("\n"));break;case"key":t=Promise.all(w.map(async e=>{let t=await (0,Y.f)(e.id,null==u?void 0:u.accessToken);return t?"".concat(t):""})).then(e=>e.filter(e=>e).join("\n"));break;case"link":{let e=v()?v()+"/api":"https://api-proxy.homeproxy.vn";t=Promise.all(w.map(async t=>{let a=await (0,Y.f)(t.id,null==u?void 0:u.accessToken);return a?(0,O.z)({baseUrl:e,token:a}):""})).then(e=>e.filter(e=>e).join("\n"))}break;default:t=Promise.resolve("")}let a=await (0,W.b)(t),s=await t;a?j.toast.success("Copied to clipboard!",{description:(0,r.jsx)("div",{className:"toast-clamp",children:s}),duration:5e3}):j.toast.error("Failed to copy. Please try again.")};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:(0,d.cn)(o.jx,"flex-wrap overflow-visible !pb-0 2xl:!flex-nowrap 2xl:!justify-end 2xl:!overflow-x-visible"),children:[(0,r.jsxs)(n.$,{onClick:()=>{s(!0),c("fetch-proxy")},variant:"outline",className:(0,d.cn)(J,"whitespace-nowrap"),children:[(0,r.jsx)(x.F.FetchProxyIcon,{className:"!h-4 !w-4"}),"Lấy Proxy"]}),(0,r.jsxs)(n.$,{onClick:()=>{if(!N)return void(0,m.Y)("gia hạn");s(!0),c("change-renewal")},variant:"outline",className:(0,d.cn)(J,"whitespace-nowrap"),children:[(0,r.jsx)(x.F.ExtendIcon,{className:"!h-4 !w-4"}),"Gia hạn"]}),(0,r.jsxs)(l.rI,{modal:!1,children:[(0,r.jsx)(l.ty,{asChild:!0,children:(0,r.jsxs)(n.$,{variant:"outline",className:(0,d.cn)(J,"whitespace-nowrap"),title:"Copy h\xe0ng loạt",children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"!h-4 !w-4"}),"Copy"]})}),(0,r.jsxs)(l.SQ,{align:"end",className:"rounded-[16px]",children:[(0,r.jsxs)(l._2,{onClick:()=>N?C("key"):(0,m.Y)("copy Key"),children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy Key"]}),(0,r.jsxs)(l._2,{onClick:()=>
1N?C("link"):(0,m.Y)("copy Link xoay"),children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy Link xoay"]}),(0,r.jsxs)(l._2,{onClick:()=>N?C("id"):(0,m.Y)("copy ID"),children:[(0,r.jsx)(x.F.CopyOrderIcon,{className:"text-icon-template-3 h-4 w-4"}),"Copy ID"]})]})]}),(0,r.jsx)(h.q,{table:t,className:"shrink-0"})]}),(0,r.jsx)(p.a,{title:k,description:"",isOpen:a,onClose:()=>s(!1),className:(0,d.cn)("gap-5","fetch-proxy"===i?"lg:w-[492px]":"lg:w-[412px]"),children:"fetch-proxy"===i?(0,r.jsx)(M,{onClose:()=>s(!1)}):(0,r.jsx)(I,{onClose:()=>s(!1),selectedProxies:w})})]})}let X=e=>{let{withToolbar:t=!1,isCdk:a=!1}=e,n=(0,s.$)(),l=t?n.table:null,{rowSelection:o}=(0,s.$)();return l?a?(0,r.jsx)(H,{table:l}):(0,r.jsx)($,{table:l,rowSelection:o}):(0,r.jsx)(r.Fragment,{})}}}]);

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.