1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8654],{3250:(e,t,r)=>{r.d(t,{A:()=>s});var a=r(7946);let n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),o=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:i="",children:s,iconNode:u,...c},d)=>(0,a.createElement)("svg",{ref:d,...l,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:n("lucide",i),...!s&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(c)&&{"aria-hidden":"true"},...c},[...u.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(s)?s:[s]])),s=(e,t)=>{let r=(0,a.forwardRef)(({className:r,...l},s)=>(0,a.createElement)(i,{ref:s,iconNode:t,className:n(`lucide-${o(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...l}));return r.displayName=o(e),r}},15540:(e,t,r)=>{r.d(t,{ToastProvider:()=>s,useToast:()=>l});var a=r(24130),n=r(7946);let o=(0,n.createContext)({toast:()=>{}});function l(){return(0,n.useContext)(o)}let i={default:"border-border-subtle bg-canvas-elevated text-white",success:"border-teal-800 bg-teal-900/80 text-teal-100",error:"border-red-800 bg-red-900/80 text-red-100"};function s({children:e}){let[t,r]=(0,n.useState)([]),l=(0,n.useCallback)((e,t="default")=>{let a=Math.random().toString(36).slice(2,9);r(r=>[...r,{id:a,message:e,variant:t}])},[]);return(0,a.jsxs)(o.Provider,{value:{toast:l},children:[e,(0,a.jsx)("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col gap-2",children:t.map(e=>(0,a.jsx)(u,{item:e,onDone:()=>r(t=>t.filter(t=>t.id!==e.id))},e.id))})]})}function u({item:e,onDone:t}){let[r,o]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{let e=setTimeout(()=>o(!1),3500);return()=>clearTimeout(e)},[]),(0,n.useEffect)(()=>{if(!r){let e=setTimeout(t,300);return()=>clearTimeout(e)}},[r,t]),(0,a.jsx)("div",{className:`rounded-card border px-4 py-3 text-sm shadow-card-hover transition-all duration-300 ${i[e.variant]} ${r?"translate-y-0 opacity-100":"translate-y-2 opacity-0"}`,children:e.message})}},30311:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(3250).A)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]])},31099:(e,t,r)=>{r.d(t,{A:()=>h});var a=r(42467),n=r(7946),o=r.t(n,2),l=r(87697),i=o["use".trim()],s=r(23594),u=r(30755),c=r(81343),d=r(24130),f=r(13781);function h(e){let{Link:t,config:r,getPathname:o,...h}=function(e,t){var r,o,l;let f={...r=t||{},localePrefix:"object"==typeof(l=r.localePrefix)?l:{mode:l||"always"},localeCookie:!!((o=r.localeCookie)??1)&&{name:"NEXT_LOCALE",sameSite:"lax",..."object"==typeof o&&o},localeDetection:r.localeDetection??!0,alternateLinks:r.alternateLinks??!0},h=f.pathnames,m=(0,n.forwardRef)(function({href:t,locale:r,...a},n){let o,l;"object"==typeof t?(o=t.pathname,l=t.params):o=t;let c=(0,s._x)(t),m=e(),v=(0,s.yL)(m)?i(m):m,x=c?p({locale:r||v,href:null==h?o:{pathname:o,params:l},forcePrefix:null!=r||void 0}):o;return(0,d.jsx)(u.default,{ref:n,href:"object"==typeof t?{...t,pathname:x}:x,locale:r,localeCookie:f.localeCookie,...a})});function p(e){let t,{forcePrefix:r,href:a,locale:n}=e;return null==h?"object"==typeof a?(t=a.pathname,a.query&&(t+=(0,c.Zn)(a.query))):t=a:t=(0,c.FP)({locale:n,...(0,c.TK)(a),pathnames:f.pathnames}),(0,c.x3)(t,n,f,r)}function v(e){return function(t,...r){return e(p(t),...r)}}return{config:f,Link:m,redirect:v(a.redirect),permanentRedirect:v(a.permanentRedirect),getPathname:p}}(l.Ym,e);return{...h,Link:t,usePathname:function(){let e=function(e){let t=(0,a.usePathname)(),r=(0,l.Ym)();return(0,n.useMemo)(()=>
1{if(!t)return t;let a=t,n=(0,s.XP)(r,e.localePrefix);if((0,s.wO)(n,t))a=(0,s.MY)(t,n);else if("never"!==e.localePrefix.mode&&e.localePrefix.prefixes){let e=(0,s.bL)(r);(0,s.wO)(e,t)&&(a=(0,s.MY)(t,e))}return a},[e.localePrefix,r,t])}(r),t=(0,l.Ym)();return(0,n.useMemo)(()=>e&&r.pathnames?(0,c.aM)(t,e,r.pathnames):e,[t,e])},useRouter:function(){let e=(0,a.useRouter)(),t=(0,l.Ym)(),i=(0,a.usePathname)();return(0,n.useMemo)(()=>{function a(e){return function(a,n){let{locale:l,...s}=n||{},u=[o({href:a,locale:l||t,forcePrefix:null!=l||void 0})];Object.keys(s).length>0&&u.push(s),(0,f.A)(r.localeCookie,i,t,l),e(...u)}}return{...e,push:a(e.push),replace:a(e.replace),prefetch:a(e.prefetch)}},[t,i,e])},getPathname:o}}},33099:(e,t,r)=>{r.d(t,{useAstoolsEvent:()=>n});var a=r(7946);function n(e,t){let r=(0,a.useRef)(t);r.current=t,(0,a.useEffect)(()=>{function t(t){t.data?.type==="astools:event"&&t.data.event===e&&r.current(t.data.payload)}return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[e])}},42735:(e,t,r)=>{r.d(t,{Dialog:()=>o,DialogFooter:()=>i,DialogHeader:()=>l});var a=r(24130),n=r(7946);function o({open:e,onClose:t,children:r,className:o=""}){let l=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]);let i=(0,n.useCallback)(e=>{e.target===l.current&&t()},[t]);return e?(0,a.jsx)("div",{ref:l,onClick:i,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:(0,a.jsx)("div",{role:"dialog","aria-modal":"true",className:`w-full max-w-lg rounded-card border border-border-subtle bg-canvas-elevated p-6 shadow-card-hover ${o}`,children:r})}):null}function l({children:e,className:t=""}){return(0,a.jsx)("div",{className:`mb-4 text-lg font-semibold text-white ${t}`,children:e})}function i({children:e,className:t=""}){return(0,a.jsx)("div",{className:`mt-6 flex justify-end gap-2 ${t}`,children:e})}},44420:(e,t,r)=>{r.d(t,{IB:()=>a,L$:()=>o,q:()=>n});let a=["en","vi","zh","ko","ja"],n="en",o={en:"English",vi:"Tiếng Viá»t",zh:"䏿",ko:"íêµì´",ja:"æ¥æ¬èª"}},65783:(e,t,r)=>{r.d(t,{G8:()=>l,_7:()=>n,rP:()=>o});let a="/api/proxy";async function n(){return(await fetch(`${a}/boards`,{credentials:"include"})).json()}async function o(e,t){let r=new URLSearchParams;t&&r.set("sort",t);let n=r.toString();return(await fetch(`${a}/boards/${e}/products${n?`?${n}`:""}`,{credentials:"include"})).json()}async function l(e,t,r){return(await fetch(`${a}/boards/${e}/products/${t}/notes`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:r})})).json()}},71900:(e,t,r)=>{r.d(t,{N_:()=>i,a8:()=>u,rd:()=>c});var a=r(99377),n=r(31099),o=r(44420);let l=(0,a.A)({locales:o.IB,defaultLocale:o.q,localePrefix:"always",localeCookie:!1}),{Link:i,redirect:s,usePathname:u,useRouter:c}=(0,n.A)(l)},75100:(e,t,r)=>{r.d(t,{Dropdown:()=>l,DropdownContent:()=>s,DropdownItem:()=>u,DropdownSeparator:()=>c,DropdownTrigger:()=>i});var a=r(24130),n=r(7946);let o=(0,n.createContext)({open:!1,setOpen:()=>{}});function l({children:e,className:t=""}){let[r,l]=(0,n.useState)(!1),i=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!r)return;let e=e=>{i.current&&!i.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r]),(0,n.useEffect)(()=>{if(!r)return;let e=e=>{"Escape"===e.key&&l(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r]),(0,a.jsx)(o.Provider,{value:{open:r,setOpen:l},children:(0,a.jsx)("div",{ref:i,className:`relative inline-block ${t}`,children:e})})}function i({children:e,className:t=""}){let{open:r,setOpen:l}=(0,n.useContext)(o);return(0,a.jsx)("button",{type:"button","aria-expanded":r,"aria-haspopup":"menu",onClick:()=>l(!r),className:t,children:e})}function s({children:e,align:t="left",className:r=""}){let{open:l}=(0,n.useContext)(o);return l?(0,a.jsx)("div",{role:"menu",className:`absolute z-50 mt-1 min-w-[10rem] rounded-card border border-border-subtle bg-canvas-elevated p-1 shadow-card-hover ${"right"===t?"right-0":"left-0"} ${r}`,children:e}):null}function u({children:e,onClick:t,disabled:r=!1,className:l=""}){let{setOpen:i}=(0,n.useContext)(o),s=(0,n.useCallback)(()=>{r||(t?.(),i(!1))},[r,t,i]);return(0,a.jsx)("button",{type:"button",role:"menuitem",disabled:r,onClick:s,className:`flex w-full items-center rounded-md px-2 py-1.5 text-sm text-gray-300 transition-colors hover:bg-surface-elevated hover:text-white disabled:pointer-events-none disabled:opacity-50 ${l}`,children:e})}function c(){return(0,a.jsx)("div",{className:"my-1 h-px bg-border-subtle"})}},88097:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(3250).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},89793:(e,t,r)=>{r.d(t,{default:()=>o});var a=r(87697),n=r(24130);function o({locale:e,...t}){if(!e)throw Error(void 0);return(0,n.jsx)(a.Dk,{locale:e,...t})}},91603:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(3250).A)("log-in",[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}
1],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]])},92051:(e,t,r)=>{r.d(t,{Tabs:()=>l,TabsContent:()=>u,TabsList:()=>i,TabsTrigger:()=>s});var a=r(24130),n=r(7946);let o=(0,n.createContext)({value:"",onChange:()=>{}});function l({defaultValue:e,children:t,className:r=""}){let[l,i]=(0,n.useState)(e);return(0,a.jsx)(o.Provider,{value:{value:l,onChange:i},children:(0,a.jsx)("div",{className:r,children:t})})}function i({children:e,className:t=""}){return(0,a.jsx)("div",{role:"tablist",className:`flex gap-1 rounded-lg bg-canvas-card p-1 ${t}`,children:e})}function s({value:e,children:t,className:r=""}){let l=(0,n.useContext)(o),i=l.value===e;return(0,a.jsx)("button",{role:"tab","aria-selected":i,onClick:()=>l.onChange(e),className:`rounded-md px-3 py-1.5 text-sm font-medium transition-colors ${i?"bg-canvas-elevated text-white shadow-sm":"text-text-muted hover:text-white"} ${r}`,children:t})}function u({value:e,children:t,className:r=""}){return(0,n.useContext)(o).value!==e?null:(0,a.jsx)("div",{role:"tabpanel",className:`mt-2 ${r}`,children:t})}},94137:(e,t,r)=>{r.d(t,{O:()=>c,A:()=>d});var a=r(24130),n=r(7946);let o=(r(69865).env.NEXT_PUBLIC_API_URL||"https://api.astools.app").replace(/\/api\/v\d+$/,"");async function l(e,t){let r=await fetch(`${o}${e}`,{credentials:"include",headers:{"Content-Type":"application/json"},...t});if(!r.ok)throw Error((await r.json().catch(()=>({message:"Request failed"}))).message||`HTTP ${r.status}`);return r.json()}async function i(){let e=await l("/auth/me");if(!e.ok)throw Error("Failed to fetch user");return e.data}async function s(){await l("/auth/logout",{method:"POST"})}let u=(0,n.createContext)(null);function c({children:e}){let[t,r]=(0,n.useState)({user:null,isAuthenticated:!1,isLoading:!0}),o=(0,n.useCallback)(async()=>{try{let e=await i();r({user:e,isAuthenticated:!0,isLoading:!1})}catch{r({user:null,isAuthenticated:!1,isLoading:!1})}},[]);(0,n.useEffect)(()=>{o()},[o]);let l=(0,n.useCallback)(async()=>{try{await s()}catch{}finally{r({user:null,isAuthenticated:!1,isLoading:!1})}},[]);return(0,a.jsx)(u.Provider,{value:{...t,checkAuth:o,logout:l},children:e})}function d(){let e=(0,n.useContext)(u);if(!e)throw Error("useAuth must be used within AuthProvider");return e}},99377:(e,t,r)=>{r.d(t,{A:()=>a});function a(e){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.