PageSourceSearch

https://realelixir.com/_nuxt/7TPlHSLs.js

js realelixir.com collected 2026-10-08 09:57:03 UTC 776,883 bytes, 33 lines download raw bytes

1import{o as p,c as f,b as i,j as ke,E as ee,h as z,p as pe,n as J,y as c,q as b,u as n,M as gt,F as at,r as xt,a as C,i as lt,f as ae,$ as Ro,a3 as To,d as zt,e as ne,B as ls,t as bt,x as Ie,a4 as Ma,z as Wo,W as Po,s as Qt,a5 as Sa,k as _o,w as nl,l as we,g as kd,P as nn,a1 as We,m as Ls,v as Rs,S as Lt,a2 as De,a6 as rs,Y as jo,T as il,A as mo,K as bn,G as $d,I as xn,J as yn,N as Da,_ as Aa,U as za,O as as,a7 as ja,a8 as Ta,a9 as Fi,aa as Ii,ab as Cd,ac as Pa,ad as Ni,ae as La,Q as Xn,af as Md}from"./BFFGn8X3.js";import{o as si}from"./B9TH4Xx5.js";import{_ as ni,u as Sd,a as Vs,r as kn,b as Dd,c as Ad}from"./DQjGRDjv.js";import{u as je,a as Ra,b as ll}from"./Fqy8GCTk.js";import{c as Oa,q as zd,s as jd,t as Td,_ as Pd}from"./DNtSvnsn.js";import{r as Ts,_ as Nl}from"./D3S5B9aI.js";import{_ as Ld,L as Rd,r as Hl,a as Vl,b as Od}from"./D7qgzZFh.js";import{i as Bd,_ as Ed,a as Fd}from"./ClOgiIjy.js";import{_ as Wl}from"./DBhUiF7w.js";import{d as re}from"./CF-8GdPb.js";import{_ as xi}from"./DazjazQx.js";import{c as Ul}from"./Di_bOkkM.js";import{r as rl}from"./CCjI5ap_.js";import{g as Ba}from"./Cpj98o6Y.js";import{r as Ea}from"./CXyYKZ73.js";import{N as Id,G as Yl}from"./CIZT6YI2.js";import{F as ql}from"./Di1N8dwn.js";import{g as Nd}from"./CGUmEm0-.js";import{u as Hd}from"./C7lZ6r2z.js";function al(o,t){return p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[i("path",{"fill-rule":"evenodd",d:"M12 2.25a.75.75 0 0 1 .75.75v11.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 1 1 1.06-1.06l3.22 3.22V3a.75.75 0 0 1 .75-.75Zm-9 13.5a.75.75 0 0 1 .75.75v2.25a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5V16.5a.75.75 0 0 1 1.5 0v2.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V16.5a.75.75 0 0 1 .75-.75Z","clip-rule":"evenodd"})])}function yi(o,t){return p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[i("path",{"fill-rule":"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z","clip-rule":"evenodd"})])}function Vd(o,t){return p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[i("path",{"fill-rule":"evenodd",d:"M19.902 4.098a3.75 3.75 0 0 0-5.304 0l-4.5 4.5a3.75 3.75 0 0 0 1.035 6.037.75.75 0 0 1-.646 1.353 5.25 5.25 0 0 1-1.449-8.45l4.5-4.5a5.25 5.25 0 1 1 7.424 7.424l-1.757 1.757a.75.75 0 1 1-1.06-1.06l1.757-1.757a3.75 3.75 0 0 0 0-5.304Zm-7.389 4.267a.75.75 0 0 1 1-.353 5.25 5.25 0 0 1 1.449 8.45l-4.5 4.5a5.25 5.25 0 1 1-7.424-7.424l1.757-1.757a.75.75 0 1 1 1.06 1.06l-1.757 1.757a3.75 3.75 0 1 0 5.304 5.304l4.5-4.5a3.75 3.75 0 0 0-1.035-6.037.75.75 0 0 1-.354-1Z","clip-rule":"evenodd"})])}function Wd(o,t){return p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[i("path",{"fill-rule":"evenodd",d:"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z","clip-rule":"evenodd"})])}function Ud(o,t){return p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[i("path",{"fill-rule":"evenodd",d:"M18.685 19.097A9.723 9.723 0 0 0 21.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 0 0 3.065 7.097A9.716 9.716 0 0 0 12 21.75a9.716 9.716 0 0 0 6.685-2.653Zm-12.54-1.285A7.486 7.486 0 0 1 12 15a7.486 7.486 0 0 1 5.855 2.812A8.224 8.224 0 0 1 12 20.25a8.224 8.224 0 0 1-5.855-2.438ZM15.75 9a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z","clip-rule":"evenodd"})])}function Yd(o,t){return p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v12m-3-2.818.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Hi(o,t){return p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function qd(o,t){return p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"})])}const Zd={key:0,class:"absolute top-full left-0 mt-2 w-[290px] bg-white rounded-2xl shadow-xl border border-gray-300 p-4 z-30"},Xd={class:"flex items-center justify-between mb-4 px-1"},Kd={class:"flex items-center gap-3"},Gd={class:"w-3.5 h-3.5 text-[#343434] transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Qd=["d"],Jd={class:"w-3.5 h-3.5 text-[#343434] transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},tu=["d"],eu={class:"flex items-center gap-1"},ou=["disabled"],su={key:0,class:"grid grid-cols-3 gap-2 max-h-[220px] overflow-y-auto pr-1"},nu=["onClick"],iu={key:1,class:"grid grid-cols-3 gap-2"},lu=["onClick"],ru={class:"grid grid-cols-7 text-center text-xs text-gray-500 mb-2"},au={class:"grid grid-cols-7 gap-y-2"},cu=["onClick","disabled"],du={class:"flex gap-3 mt-4 pt-4 border-t border-gray-200"},uu=["disabled"],hu={__name:"CalendarBirthDate",props:{modelValue:{type:String,default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:t}){const e=o,s=ke(),l=t,{locale:r}=ee(),a=z(!1),d=z("date"),u=z(null),h=new Date,_=z(h.getMonth()),m=z(h.getFullYear()),x=z(e.modelValue||"");pe(()=>e.modelValue,H=>{if(x.value=H||"",H){const[P,W]=H.split("-");P&&W&&(m.value=parseInt(P),_.value=parseInt(W)-1)}},{immediate:!0});const $=()=>{e.disabled||(a.value=!a.value)},S={th:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],en:["January","February","March","April","May","June","July","August","September","October","November","December"]},v={th:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},M=lt(()=>r.value==="th"?["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),w=lt(()=>S[r.value]||S.en),I=lt(()=>v[r.value]||v.en),O=lt(()=>{if(!x.value)return"";const[H,P,W]=x.value.split("-");
1return new Date(H,P-1,W).toLocaleDateString(r.value==="th"?"th-TH":"en-GB",{day:"2-digit",month:"2-digit",year:"numeric"})}),tt=lt(()=>{const H=new Date().getFullYear(),P=H-100;return Array.from({length:H-P+1},(W,U)=>H-U)}),G=lt(()=>{const H=m.value,P=_.value,U=new Date(H,P,1).getDay(),B=new Date(H,P+1,0).getDate(),Z=[],q=new Date(H,P,0).getDate();for(let ut=0;ut<U;ut++)Z.push({key:`prev-${ut}`,day:q-U+1+ut,currentMonth:!1});for(let ut=1;ut<=B;ut++)Z.push({key:ut,day:ut,currentMonth:!0,date:`${H}-${String(P+1).padStart(2,"0")}-${String(ut).padStart(2,"0")}`});return Z}),Y=H=>!H||!x.value?!1:H===x.value,et=H=>{m.value=H,d.value="month"},ht=H=>{_.value=H,d.value="date"},ct=H=>{!H.currentMonth||st(H.date)||(x.value=H.date)},dt=lt(()=>{const H=h.getFullYear(),P=h.getMonth();return d.value==="year"?m.value>=H:m.value>H||m.value===H&&_.value>=P}),pt=()=>{d.value==="year"?m.value-=12:(_.value--,_.value<0&&(_.value=11,m.value--))},D=()=>{dt.value||(d.value==="year"?m.value+=12:(_.value++,_.value>11&&(_.value=0,m.value++)))},Mt=()=>{e.modelValue?(x.value=e.modelValue,l("update:modelValue",e.modelValue)):(x.value="",l("update:modelValue","")),d.value="date",a.value=!1},ot=()=>{x.value&&(l("update:modelValue",x.value),a.value=!1)},st=H=>{if(!H)return!1;const P=new Date,W=P.getFullYear(),U=String(P.getMonth()+1).padStart(2,"0"),B=String(P.getDate()).padStart(2,"0"),Z=`${W}-${U}-${B}`;return H>Z},X=H=>{if(!H)return!1;const P=new Date,W=P.getFullYear(),U=String(P.getMonth()+1).padStart(2,"0"),B=String(P.getDate()).padStart(2,"0"),Z=`${W}-${U}-${B}`;return H===Z};return si(u,()=>a.value=!1),(H,P)=>(p(),f("div",{class:"relative inline-block w-full",ref_key:"CalendarPointRef",ref:u},[i("div",{onClick:$,class:J(["w-full border rounded-full px-3 text-base py-1.5 flex items-center justify-between text-[16px] transition-all",[o.disabled?"bg-gray-50 text-gray-500 border-gray-300 cursor-default":"bg-white text-black border-gray-300 cursor-pointer"]]),style:b({borderColor:!o.disabled&&a.value?n(s).color:"#D1D5DB"})},[i("span",{class:J(x.value?o.disabled?"text-gray-500":"text-black":"text-gray-400")},c(O.value||H.$t("selectdate")),3)],6),a.value&&!o.disabled?(p(),f("div",Zd,[i("div",Xd,[i("div",Kd,[i("button",{class:"font-medium cursor-pointer flex items-center gap-1 text-gray-850",onClick:P[0]||(P[0]=W=>d.value="month")},[gt(c(w.value[_.value])+" ",1),(p(),f("svg",Gd,[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:d.value==="month"?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"},null,8,Qd)]))]),i("button",{class:"font-medium cursor-pointer flex items-center gap-1 text-gray-850",onClick:P[1]||(P[1]=W=>d.value="year")},[gt(c(n(r)==="th"?m.value+543:m.value)+" ",1),(p(),f("svg",Jd,[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:d.value==="year"?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"},null,8,tu)]))])]),i("div",eu,[i("button",{onClick:pt,class:"w-7 h-7 flex items-center justify-center rounded-full hover:bg-gray-100 transition cursor-pointer text-gray-600"},[...P[2]||(P[2]=[i("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),i("button",{onClick:D,disabled:dt.value,class:J(["w-7 h-7 flex items-center justify-center rounded-full transition cursor-pointer text-gray-600",[dt.value?"opacity-30 cursor-not-allowed":"text-gray-100 cursor-pointer"]])},[...P[3]||(P[3]=[i("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],10,ou)])]),d.value==="year"?(p(),f("div",su,[(p(!0),f(at,null,xt(tt.value,W=>(p(),f("button",{key:W,onClick:U=>et(W),class:J(["h-10 rounded-full hover:bg-gray-50 cursor-pointer text-sm",{"font-semibold":W===m.value}]),style:b(W===m.value?{backgroundColor:n(s).color,color:"#ffffff"}:{})},c(n(r)==="th"?W+543:W),15,nu))),128))])):d.value==="month"?(p(),f("div",iu,[(p(!0),f(at,null,xt(I.value,(W,U)=>(p(),f("button",{key:W,onClick:B=>ht(U),class:J(["h-10 rounded-full hover:bg-gray-50 cursor-pointer text-sm",{"font-semibold":U===_.value}]),style:b(U===_.value?{backgroundColor:n(s).color,color:"#ffffff"}:{})},c(W),15,lu))),128))])):(p(),f(at,{key:2},[i("div",ru,[(p(!0),f(at,null,xt(M.value,W=>(p(),f("div",{key:W},c(W),1))),128))]),i("div",au,[(p(!0),f(at,null,xt(G.value,W=>(p(),f("div",{key:W.key,class:"relative flex justify-center items-center h-8"},[i("button",{onClick:U=>ct(W),disabled:!W.currentMonth||st(W.date),class:J(["relative z-10 h-8 w-8 rounded-full text-sm transition-colors flex items-center justify-center font-medium",{"text-gray-300 pointer-events-none":!W.currentMonth||st(W.date),"text-white":Y(W.date),"text-gray-700 cursor-pointer hover:bg-gray-100":W.currentMonth&&!st(W.date)&&!Y(W.date)}]),style:b([Y(W.date)?{backgroundColor:n(s).color}:{},X(W.date)&&!Y(W.date)?{color:n(s).color}:{}])},c(W.day),15,cu)]))),128))])],64)),i("div",du,[i("button",{onClick:Mt,class:"flex-1 h-9 rounded-full border cursor-pointer font-medium text-sm transition",style:b({borderColor:n(s).color,color:n(s).color})},c(H.$t("cancel")),5),i("button",{onClick:ot,disabled:!x.value,class:J(["flex-1 h-9 rounded-full font-medium text-sm transition text-white",[x.value?"curs
1or-pointer":"bg-gray-200 text-gray-400 cursor-not-allowed"]]),style:b(x.value?{backgroundColor:n(s).color}:{})},c(H.$t("confirm")),15,uu)])])):C("",!0)],512))}};function Zl(o,t){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);t&&(s=s.filter((function(l){return Object.getOwnPropertyDescriptor(o,l).enumerable}))),e.push.apply(e,s)}return e}function se(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Zl(Object(e),!0).forEach((function(s){eo(o,s,e[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):Zl(Object(e)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(e,s))}))}return o}function eo(o,t,e){return t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function pu(o,t){if(o==null)return{};var e,s,l=(function(a,d){if(a==null)return{};var u,h,_={},m=Object.keys(a);for(h=0;h<m.length;h++)u=m[h],d.indexOf(u)>=0||(_[u]=a[u]);return _})(o,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);for(s=0;s<r.length;s++)e=r[s],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(o,e)&&(l[e]=o[e])}return l}function ys(o){return(function(t){if(Array.isArray(t))return wi(t)})(o)||(function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)})(o)||(function(t,e){if(t){if(typeof t=="string")return wi(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return wi(t,e)}})(o)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wi(o,t){(t==null||t>o.length)&&(t=o.length);for(var e=0,s=new Array(t);e<t;e++)s[e]=o[e];return s}var Xl,fu,$n,$e=(Xl=function(o){(function(){var t={}.hasOwnProperty;function e(){for(var s=[],l=0;l<arguments.length;l++){var r=arguments[l];if(r){var a=typeof r;if(a==="string"||a==="number")s.push(r);else if(Array.isArray(r)){if(r.length){var d=e.apply(null,r);d&&s.push(d)}}else if(a==="object")if(r.toString===Object.prototype.toString)for(var u in r)t.call(r,u)&&r[u]&&s.push(u);else s.push(r.toString())}}return s.join(" ")}o.exports?(e.default=e,o.exports=e):window.classNames=e})()},Xl($n={path:fu,exports:{},require:function(o,t){return(function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")})(t==null&&$n.path)}},$n.exports),$n.exports),vo=function(o){return function(t,e){if(!t)return o;var s;typeof t=="string"?s=t:e=t;var l=o;return s&&(l+="__"+s),l+(e?Object.keys(e).reduce((function(r,a){var d=e[a];return d&&(r+=" "+(typeof d=="boolean"?l+"--"+a:l+"--"+a+"_"+d)),r}),""):"")}};function Vi(o,t,e){var s,l,r,a,d;function u(){var _=Date.now()-a;_<t&&_>=0?s=setTimeout(u,t-_):(s=null,e||(d=o.apply(r,l),r=l=null))}t==null&&(t=100);var h=function(){r=this,l=arguments,a=Date.now();var _=e&&!s;return s||(s=setTimeout(u,t)),_&&(d=o.apply(r,l),r=l=null),d};return h.clear=function(){s&&(clearTimeout(s),s=null)},h.flush=function(){s&&(d=o.apply(r,l),r=l=null,clearTimeout(s),s=null)},h}Vi.debounce=Vi;var Wi=Vi,Ht=function(){return Ht=Object.assign||function(o){for(var t,e=1,s=arguments.length;e<s;e++)for(var l in t=arguments[e])Object.prototype.hasOwnProperty.call(t,l)&&(o[l]=t[l]);return o},Ht.apply(this,arguments)};function Fa(o,t){var e,s;return o&&t?(e=""+o+t[0].toUpperCase()+t.slice(1),s=o+"-"+t):(e=o||t,s=o||t),{name:e,classname:s}}function Ia(o){return/^blob:/.test(o)}function Kl(o){return Ia(o)||(function(t){return/^data:/.test(t)})(o)}function As(o){return!!(o&&o.constructor&&o.call&&o.apply)}function Me(o){return o===void 0}function Vn(o){return typeof o=="object"&&o!==null}function Ui(o,t,e){var s={};return Vn(o)?(Object.keys(t).forEach((function(l){Me(o[l])?s[l]=t[l]:Vn(t[l])?Vn(o[l])?s[l]=Ui(o[l],t[l],e[l]):s[l]=o[l]?t[l]:e[l]:t[l]===!0||t[l]===!1?s[l]=!!o[l]:s[l]=o[l]})),s):o?t:e}function Cn(o){var t=Number(o);return Number.isNaN(t)?o:t}function Gl(o){return typeof(o=="number"||(function(t){return typeof t=="object"&&t!==null})(o)&&toString.call(o)=="[object Number]")&&!Na(o)}function Na(o){return o!=o}function Ha(o,t){return Math.sqrt(Math.pow(o.x-t.x,2)+Math.pow(o.y-t.y,2))}var ln=function(o,t){o===void 0&&(o={}),t===void 0&&(t={}),this.type="manipulateImage",this.move=o,this.scale=t},_u=function(o,t){t===void 0&&(t={}),this.type="resize",this.directions=o,this.params=t},cl=function(o){this.type="move",this.directions=o},mu=(function(){function o(t,e,s,l,r){this.type="drag",this.nativeEvent=t,this.position=s,this.previousPosition=l,this.element=e,this.anchor=r}return o.prototype.shift=function(){var t=this,e=t.element,s=t.anchor,l=t.position;if(e){var r=e.getBoundingClientRect(),a=r.left,d=r.top;return{left:l.left-a-s.left,top:l.top-d-s.top}}return{left:0,top:0}},o})(),dl={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(o){o.cancelable&&!this.disabled&&o.touches.length===1&&(this.touches=ys(o.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),o.touches.length&&this.initAnchor(this.touches.reduce((function(t,e){return{clientX:t.clientX+e.clientX/o.touches.length,clientY:t.clientY+e.clientY/o.touches.length}}),{clientX:0,clientY:0})),o.preventDefault&&o.preventDefault(),o.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(o){this.touches.length&&(this.processMove(o,o.touches),o.preventDefault&&o.preventDefault(),o.stopPropagation&&o.stopPropagation())}
vendor: 4,109 bytes, line 2
2,onMouseDown:function(o){if(!this.disabled){var t={fake:!0,clientX:o.clientX,clientY:o.clientY};this.touches=[t],this.initAnchor(t),o.stopPropagation()}},onMouseMove:function(o){this.touches.length&&(this.processMove(o,[{fake:!0,clientX:o.clientX,clientY:o.clientY}]),o.preventDefault&&o.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(o){var t=this.$refs.draggable.getBoundingClientRect(),e=t.left,s=t.right,l=t.bottom,r=t.top;this.anchor={left:o.clientX-e,top:o.clientY-r,bottom:l-o.clientY,right:s-o.clientX}},processMove:function(o,t){var e=ys(t);if(this.touches.length){if(this.touches.length===1&&e.length===1){var s=this.$refs.draggable;this.$emit("drag",new mu(o,s,{left:e[0].clientX,top:e[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=e}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"]};dl.render=function(o,t,e,s,l,r){return p(),ae("div",{ref:"draggable",class:e.classname,onTouchstart:t[1]||(t[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:t[2]||(t[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onMouseover:t[3]||(t[3]=function(){return r.onMouseOver&&r.onMouseOver.apply(r,arguments)}),onMouseleave:t[4]||(t[4]=function(){return r.onMouseLeave&&r.onMouseLeave.apply(r,arguments)})},[Ro(o.$slots,"default")],34)};var ki=vo("vue-handler-wrapper"),Va={name:"HandlerWrapper",components:{DraggableElement:dl},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var o;if(this.horizontalPosition||this.verticalPosition){var t,e=Fa(this.horizontalPosition,this.verticalPosition);o=ki((eo(t={},e.classname,!0),eo(t,"disabled",this.disabled),t))}else o=ki({disabled:this.disabled});return{root:o,draggable:ki("draggable")}}},emits:["leave","enter","drag","drag-end"]};Va.render=function(o,t,e,s,l,r){var a=To("DraggableElement");return p(),ae("div",{class:r.classes.root},[zt(a,{class:r.classes.draggable,onDrag:t[1]||(t[1]=function(d){return o.$emit("drag",d)}),onDragEnd:t[2]||(t[2]=function(d){return o.$emit("drag-end")}),onLeave:t[3]||(t[3]=function(d){return o.$emit("leave")}),onEnter:t[4]||(t[4]=function(d){return o.$emit("enter")})},{default:ne((function(){return[Ro(o.$slots,"default")]})),_:3},8,["class"])],2)};var vu=vo("vue-line-wrapper"),Wa={name:"LineWrapper",components:{DraggableElement:dl},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var o;return vu((eo(o={},this.position,!0),eo(o,"disabled",this.disabled),o))}},emits:["leave","enter","drag","drag-end"]};Wa.render=function(o,t,e,s,l,r){var a=To("DraggableElement");return p(),ae(a,{class:r.classname,onDrag:t[1]||(t[1]=function(d){return o.$emit("drag",d)}),onDragEnd:t[2]||(t[2]=function(d){return o.$emit("drag-end")}),onLeave:t[3]||(t[3]=function(d){return o.$emit("leave")}),onEnter:t[4]||(t[4]=function(d){return o.$emit("enter")})},{default:ne((function(){return[Ro(o.$slots,"default")]})),_:3},8,["class"])};var zo=["left","right","top","bottom"],gu=["left","right"],bu=["top","bottom"],xu=["left","top"],yu=["fill-area","fit-area","stencil","none"],Ql={left:0,top:0,width:0,height:0};function Jl(o,t,e){return!(e=e||["width","height","left","top"]).some((function(s){return o[s]!==t[s]}))}function Lo(o){return{left:o.left,top:o.top,right:o.left+o.width,bottom:o.top+o.height}}function Bs(o,t){return{left:o.left-t.left,top:o.top-t.top}}function Ae(o){return{left:o.left+o.width/2,top:o.top+o.height/2}}function hn(o,t){var e={left:0,top:0,right:0,bottom:0};return zo.forEach((function(s){var l=t[s],r=Lo(o)[s];e[s]=l!==void 0&&r!==void 0?s==="left"||s==="top"?Math.max(0,l-r):Math.max(0,r-l):0})),e}function Ao(o,t){return{left:o.left-t.left,top:o.top-t.top,width:o.width+t.left+t.right,height:o.height+t.top+t.bottom}}function ii(o){return{left:-o.left,top:-o.top}}function Ye(o,t){return Ht(Ht({}
2,o),{left:o.left+t.left,top:o.top+t.top})}function no(o,t,e,s){if(t!==1){if(e){var l=Ae(o);return{width:o.width*t,height:o.height*t,left:o.left+o.width*(1-t)/2+(e.left-l.left)*(1-t),top:o.top+o.height*(1-t)/2+(e.top-l.top)*(1-t)}}return{width:o.width*t,height:o.height*t,left:o.left+o.width*(1-t)/2,top:o.top+o.height*(1-t)/2}}return o}function ie(o){return o.width/o.height}function Es(o,t){return Math.min(t.right!==void 0&&t.left!==void 0?(t.right-t.left)/o.width:1/0,t.bottom!==void 0&&t.top!==void 0?(t.bottom-t.top)/o.height:1/0)}function Fs(o,t){var e={left:0,top:0},s=hn(o,t);return s.left&&s.left>0?e.left=s.left:s.right&&s.right>0&&(e.left=-s.right),s.top&&s.top>0?e.top=s.top:s.bottom&&s.bottom>0&&(e.top=-s.bottom),e}function $i(o,t){var e;return t.minimum&&o<t.minimum?e=t.minimum:t.maximum&&o>t.maximum&&(e=t.maximum),e}function Ua(o,t){var e=ie(o),s=ie(t);return t.width<1/0&&t.height<1/0?e>s?{width:t.width,height:t.width/e}:{width:t.height*e,height:t.height}:t.width<1/0?{width:t.width,height:t.width/e}:t.height<1/0?{width:t.height*e,height:t.height}:o}function Ya(o,t){var e=t*Math.PI/180;return{width:Math.abs(o.width*Math.cos(e))+Math.abs(o.height*Math.sin(e)),height:Math.abs(o.width*Math.sin(e))+Math.abs(o.height*Math.cos(e))}}function os(o,t){var e=t*Math.PI/180;return{left:o.left*Math.cos(e)-o.top*Math.sin(e),top:o.left*Math.sin(e)+o.top*Math.cos(e)}}function li(o,t){var e=hn(ze(o,t),t);return e.left+e.right+e.top+e.bottom?e.left+e.right>e.top+e.bottom?Math.min((o.width+e.left+e.right)/o.width,Es(o,t)):Math.min((o.height+e.top+e.bottom)/o.height,Es(o,t)):1}function ze(o,t,e){e===void 0&&(e=!1);var s=Fs(o,t);return Ye(o,e?ii(s):s)}function Yi(o){return{width:o.right!==void 0&&o.left!==void 0?o.right-o.left:1/0,height:o.bottom!==void 0&&o.top!==void 0?o.bottom-o.top:1/0}}function wu(o,t){return Ht(Ht({},o),{minWidth:Math.min(t.width,o.minWidth),minHeight:Math.min(t.height,o.minHeight),maxWidth:Math.min(t.width,o.maxWidth),maxHeight:Math.min(t.height,o.maxHeight)})}function qa(o,t,e){e===void 0&&(e=!0);var s={};return zo.forEach((function(l){var r=o[l],a=t[l];r!==void 0&&a!==void 0?s[l]=l==="left"||l==="top"?e?Math.max(r,a):Math.min(r,a):e?Math.min(r,a):Math.max(r,a):a!==void 0?s[l]=a:r!==void 0&&(s[l]=r)})),s}function ri(o,t){return qa(o,t,!0)}function tr(o){var t=o.size,e=o.aspectRatio,s=o.ignoreMinimum,l=o.sizeRestrictions;return!!((t.correctRatio||ie(t)>=e.minimum&&ie(t)<=e.maximum)&&t.height<=l.maxHeight&&t.width<=l.maxWidth&&t.width&&t.height&&(s||t.height>=l.minHeight&&t.width>=l.minWidth))}function er(o,t){return Math.pow(o.width-t.width,2)+Math.pow(o.height-t.height,2)}function Yo(o){var t=o.width,e=o.height,s=o.sizeRestrictions,l={minimum:o.aspectRatio&&o.aspectRatio.minimum||0,maximum:o.aspectRatio&&o.aspectRatio.maximum||1/0},r={width:Math.max(s.minWidth,Math.min(s.maxWidth,t)),height:Math.max(s.minHeight,Math.min(s.maxHeight,e))};function a(h,_){return _===void 0&&(_=!1),h.reduce((function(m,x){return tr({size:x,aspectRatio:l,sizeRestrictions:s,ignoreMinimum:_})&&(!m||er(x,{width:t,height:e})<er(m,{width:t,height:e}))?x:m}),null)}var d=[];l&&[l.minimum,l.maximum].forEach((function(h){h&&d.push({width:r.width,height:r.width/h,correctRatio:!0},{width:r.height*h,height:r.height,correctRatio:!0})})),tr({size:r,aspectRatio:l,sizeRestrictions:s})&&d.push(r);var u=a(d)||a(d,!0);return u&&{width:u.width,height:u.height}}function qi(o){var t=o.event,e=o.coordinates,s=o.positionRestrictions,l=s===void 0?{}:s,r=Ye(e,t.directions);return Ye(r,Fs(r,l))}function ku(o){var t=o.coordinates,e=o.transform,s=o.imageSize,l=o.sizeRestrictions,r=o.positionRestrictions,a=o.aspectRatio,d=o.visibleArea,u=function(_,m){return qi({coordinates:_,positionRestrictions:r,event:new cl({left:m.left-_.left,top:m.top-_.top})})},h=Ht({},t);return(Array.isArray(e)?e:[e]).forEach((function(_){var m={};Me((m=typeof _=="function"?_({coordinates:h,imageSize:s,visibleArea:d}):_).width)&&Me(m.height)||(h=(function(x,$){var S=Ht(Ht(Ht({},x),Yo({width:$.width,height:$.height,sizeRestrictions:l,aspectRatio:a})),{left:0,top:0});return u(S,{left:x.left,top:x.top})})(h,Ht(Ht({},h),m))),Me(m.left)&&Me(m.top)||(h=u(h,Ht(Ht({},h),m)))})),h}function $u(o){o.event;var t=o.getAreaRestrictions,e=o.boundaries,s=o.coordinates,l=o.visibleArea;o.aspectRatio;var r=o.stencilSize,a=o.sizeRestrictions,d=o.positionRestrictions;o.stencilReference;
vendor: 6,360 bytes, line 2
2var u,h,_,m=Ht({},s),x=Ht({},l),$=Ht({},r);u=ie($),h=ie(m),_===void 0&&(_=.001),(u===0||h===0?Math.abs(h-u)<_:Math.abs(h/u)<1+_&&Math.abs(h/u)>1-_)||(m=Ht(Ht({},m),Yo({sizeRestrictions:a,width:m.width,height:m.height,aspectRatio:{minimum:ie($),maximum:ie($)}})));var S=li(x=no(x,m.width*e.width/(x.width*$.width)),t({visibleArea:x,type:"resize"}));return S!==1&&(x=no(x,S),m=no(m,S)),x=ze(x=Ye(x,Bs(Ae(m),Ae(x))),t({visibleArea:x,type:"move"})),{coordinates:m=ze(m,ri(Lo(x),d)),visibleArea:x}}function Cu(o){var t=o.event,e=o.getAreaRestrictions,s=o.boundaries,l=o.coordinates,r=o.visibleArea;o.aspectRatio,o.stencilSize,o.sizeRestrictions;var a=o.positionRestrictions;o.stencilReference;var d=Ht({},l),u=Ht({},r);if(l&&r&&t.type!=="manipulateImage"){var h={width:0,height:0};u.width,s.width,ie(s)>ie(d)?(h.height=.8*s.height,h.width=h.height*ie(d)):(h.width=.8*s.width,h.height=h.width*ie(d));var _=li(u=no(u,d.width*s.width/(u.width*h.width)),e({visibleArea:u,type:"resize"}));u=no(u,_),_!==1&&(h.height/=_,h.width/=_),u=ze(u=Ye(u,Bs(Ae(d),Ae(u))),e({visibleArea:u,type:"move"})),d=ze(d,ri(Lo(u),a))}return{coordinates:d,visibleArea:u}}function Mu(o){var t=o.event,e=o.coordinates,s=o.visibleArea,l=o.getAreaRestrictions,r=Ht({},s),a=Ht({},e);if(t.type==="setCoordinates"){var d=Math.max(0,a.width-r.width),u=Math.max(0,a.height-r.height);d>u?r=no(r,Math.min(a.width/r.width,Es(r,l({visibleArea:r,type:"resize"})))):u>d&&(r=no(r,Math.min(a.height/r.height,Es(r,l({visibleArea:r,type:"resize"}))))),r=ze(r=Ye(r,ii(Fs(a,Lo(r)))),l({visibleArea:r,type:"move"}))}return{visibleArea:r,coordinates:a}}function Su(o){var t=o.imageSize,e=o.visibleArea,s=o.coordinates,l=e||t;return{left:(e?e.left:0)+l.width/2-s.width/2,top:(e?e.top:0)+l.height/2-s.height/2}}function Du(o){var t=o.imageSize,e=o.visibleArea,s=o.aspectRatio,l=o.sizeRestrictions,r=e||t,a=Math.min(s.maximum||1/0,Math.max(s.minimum||0,ie(r))),d=r.width<r.height?{width:.8*r.width,height:.8*r.width/a}:{height:.8*r.height,width:.8*r.height*a};return Yo(Ht(Ht({},d),{aspectRatio:s,sizeRestrictions:l}))}function Au(o){var t,e,s=o.imageSize,l=o.visibleArea,r=o.boundaries,a=o.aspectRatio,d=o.sizeRestrictions,u=o.stencilSize,h=l||s;return ie(h)>ie(r)?e=(t=u.height*h.height/r.height)*ie(u):t=(e=u.width*h.width/r.width)/ie(u),Yo({width:e,height:t,aspectRatio:a,sizeRestrictions:d})}function zu(o){var t=o.getAreaRestrictions,e=o.coordinates,s=o.imageSize,l=ie(o.boundaries);if(e){var r={height:Math.max(e.height,s.height),width:Math.max(e.width,s.width)},a=Ua({width:ie(r)>l?r.width:r.height*l,height:ie(r)>l?r.width/l:r.height},Yi(t())),d={left:e.left+e.width/2-a.width/2,top:e.top+e.height/2-a.height/2,width:a.width,height:a.height},u=hn(e,Lo(Ht({left:0,top:0},s))),h={};return!u.left&&!u.right&&d.width<=s.width&&(h.left=0,h.right=s.width),!u.top&&!u.bottom&&d.height<=s.height&&(h.top=0,h.bottom=s.height),ze(d,h)}var _=ie(s);return a={height:_>l?s.height:s.width/l,width:_>l?s.height*l:s.width},{left:s.width/2-a.width/2,top:s.height/2-a.height/2,width:a.width,height:a.height}}function Mn(o,t){return qa(o,Lo(t))}function ju(o){var t=o.event,e=o.coordinates,s=o.visibleArea,l=o.sizeRestrictions,r=o.getAreaRestrictions,a=o.positionRestrictions,d=o.adjustStencil,u=t.scale,h=t.move,_=Ht({},s),m=Ht({},e),x=1,$=1,S=u.factor&&Math.abs(u.factor-1)>.001;_=Ye(_,{left:h.left||0,top:h.top||0});var v={stencil:{minimum:Math.max(l.minWidth?l.minWidth/m.width:0,l.minHeight?l.minHeight/m.height:0),maximum:Math.min(l.maxWidth?l.maxWidth/m.width:1/0,l.maxHeight?l.maxHeight/m.height:1/0,Es(m,a))},area:{maximum:Es(_,r({visibleArea:_,type:"resize"}))}};u.factor&&S&&(u.factor<1?($=Math.max(u.factor,v.stencil.minimum))>1&&($=1):u.factor>1&&($=Math.min(u.factor,Math.min(v.area.maximum,v.stencil.maximum)))<1&&($=1)),$&&(_=no(_,$,u.center));var M=e.left-s.left,w=s.width+s.left-(e.width+e.left),I=e.top-s.top,O=s.height+s.top-(e.height+e.top);return _=ze(_=Ye(_,Fs(_,{left:a.left!==void 0?a.left-M*$:void 0,top:a.top!==void 0?a.top-I*$:void 0,bottom:a.bottom!==void 0?a.bottom+O*$:void 0,right:a.right!==void 0?a.right+w*$:void 0})),r({visibleArea:_,type:"move"})),m.width=m.width*$,m.height=m.height*$,m.left=_.left+M*$,m.top=_.top+I*$,m=ze(m,ri(Lo(_),a)),u.factor&&S&&d&&(u.factor>1?x=Math.min(v.area.maximum,u.factor)/$:u.factor<1&&(x=Math.max(m.height/_.height,m.width/_.width,u.factor/$)),x!==1&&(_=Ye(_=ze(_=no(_,x,u.factor>1?u.center:Ae(m)),r({visibleArea:_,type:"move"})),ii(Fs(m,Lo(_)))))),{coordinates:m,visibleArea:_}}function Tu(o){var t=o.aspectRatio,e=o.getAreaRestrictions,s=o.coordinates,l=o.visibleArea,r=o.sizeRestrictions,a=o.positionRestrictions,d=o.imageSize,u=o.previousImageSize,h=o.angle,_=Ht({},s),m=Ht({},l),x=os(Ae(Ht({left:0,top:0},u)),h);return(_=Ht(Ht({},Yo({sizeRestrictions:r,aspectRatio:t,width:_.width,height:_.height})),os(Ae(_),h))).left-=x.left-d.width/2+_.width/2,_.top-=x.top-d.height/2+_.height/2,m=no(m,li(m,e({visibleArea:m,type:"resize"}))),{coordinates:_=ze(_,a),visibleArea:m=ze(m=Ye(m,Bs(Ae(_),Ae(s))),e({visibleArea:m,type:"move"}))}}function Pu(o){var t=o.flip,e=o.previousFlip,s=o.rotate,l=o.getAreaRestrictions,r=o.coordinates,a=o.visibleArea,d=o.imageSize,u=Ht({},r),h=Ht({},a),_=e.horizontal!==t.horizontal,m=e.vertical!==t.vertical;if(_||m){var x=os({left:d.width/2,top:d.height/2},-s),$=os(Ae(u),-s),S=os({left:_?x.left-($.left-x.left):$.left,top:m?x.top-($.top-x.top):$.top},s);u=Ye(u,Bs(S,Ae(u))),$=os(Ae(h),-s),h=ze(h=Ye(h,Bs(S=os({left:_?x.left-($.left-x.left):$.left,top:m?x.top-($.top-x.top):$.top},s),Ae(h))),l({visibleArea:h,type:"move"}))}return{coordinates:u,visibleArea:h}}function or(o){var t=o.directions,e=o.coordinates,s=o.positionRestrictions,l=s===void 0?{}:s,r=o.sizeRestrictions,a=o.preserveRatio,d=o.compensate,u=Ht({},t),h=Ao(e,u).width,_=Ao(e,u).height;h<0&&(u.left<0&&u.right<0?(u.left=-(e.width-r.minWidth)/(u.left/u.right),u.right=-(e.width-r.minWidth)/(u.right/u.left)):u.left<0?u.left=-(e.width-r.minWidth):u.right<0&&(u.right=-(e.width-r.minWidth))),_<0&&(u.top<0&&u.bottom<0?(u.top=-(e.height-r.minHeight)/(u.top/u.bottom),u.bottom=-(e.height-r.minHeight)/(u.bottom/u.top)):u.top<0?u.top=-(e.height-r.minHeight):u.bottom<0&&(u.bottom=-(e.height-r.minHeight)));var m=hn(Ao(e,u),l);d&&(m.left&&m.left>0&&m.right===0?(u.right+=m.left,u.left-=m.left):m.right&&m.right>0&&m.left===0&&(u.left+=m.right,u.right-=m.right),m.top&&m.top>
vendor: 5,050 bytes, line 2
20&&m.bottom===0?(u.bottom+=m.top,u.top-=m.top):m.bottom&&m.bottom>0&&m.top===0&&(u.top+=m.bottom,u.bottom-=m.bottom),m=hn(Ao(e,u),l));var x={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(zo.forEach((function(v){var M=m[v];M&&u[v]&&(x[v]=Math.max(0,1-M/u[v]))})),a){var $=Math.min.apply(null,zo.map((function(v){return x[v]})));$!==1/0&&zo.forEach((function(v){u[v]*=$}))}else zo.forEach((function(v){x[v]!==1/0&&(u[v]*=x[v])}));if(h=Ao(e,u).width,_=Ao(e,u).height,u.right+u.left&&(h>r.maxWidth?x.width=(r.maxWidth-e.width)/(u.right+u.left):h<r.minWidth&&(x.width=(r.minWidth-e.width)/(u.right+u.left))),u.bottom+u.top&&(_>r.maxHeight?x.height=(r.maxHeight-e.height)/(u.bottom+u.top):_<r.minHeight&&(x.height=(r.minHeight-e.height)/(u.bottom+u.top))),a){var S=Math.min(x.width,x.height);S!==1/0&&zo.forEach((function(v){u[v]*=S}))}else x.width!==1/0&&gu.forEach((function(v){u[v]*=x.width})),x.height!==1/0&&bu.forEach((function(v){u[v]*=x.height}));return u}function Sn(o,t,e){return t==0&&e==0?o/2:t==0?0:e==0?o:o*Math.abs(t/(t+e))}var Lu=vo("vue-simple-handler"),Ru=vo("vue-simple-handler-wrapper"),ul={name:"SimpleHandler",components:{HandlerWrapper:Va},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var o,t=(eo(o={},this.horizontalPosition,!!this.horizontalPosition),eo(o,this.verticalPosition,!!this.verticalPosition),eo(o,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),eo(o,"hover",this.hover),o);return{default:$e(Lu(t),this.defaultClass,this.hover&&this.hoverClass),wrapper:$e(Ru(t),this.wrapperClass)}}},methods:{onDrag:function(o){this.$emit("drag",o)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};ul.render=function(o,t,e,s,l,r){var a=To("HandlerWrapper");return p(),ae(a,{class:r.classes.wrapper,"vertical-position":e.verticalPosition,"horizontal-position":e.horizontalPosition,disabled:e.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:ne((function(){return[zt("div",{class:r.classes.default},null,2)]})),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var Ou=vo("vue-simple-line"),Bu=vo("vue-simple-line-wrapper"),hl={name:"SimpleLine",components:{LineWrapper:Wa},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:$e(Ou(eo({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:$e(Bu(eo({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(o){this.$emit("drag",o)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};hl.render=function(o,t,e,s,l,r){var a=To("LineWrapper");return p(),ae(a,{class:r.classes.wrapper,position:e.position,disabled:e.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:ne((function(){return[zt("div",{class:r.classes.root},null,2)]})),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var Ci=vo("vue-bounding-box"),Eu=["east","west",null],Fu=["south","north",null],Za={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return ul}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return hl}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var o=[];return Eu.forEach((function(t){Fu.forEach((function(e){if(t!==e){var s=Fa(t,e),l=s.name,r=s.classname;o.push({name:l,classname:r,verticalDirection:e,horizontalDirection:t})}}))})),{points:o}},computed:{style:function(){var o={};return this.width&&this.height&&(o.width="".concat(this.width,"px"),o.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),o},classes:function(){var o=this.handlersClasses,t=this.handlersWrappersClasses,e=this.linesClasses,s=this.linesWrappersClasses;return{root:Ci(),handlers:o,handlersWrappers:t,lines:e,linesWrappers:s}},lineNodes:function(){var o=this,t=[];
2return this.points.forEach((function(e){e.horizontalDirection&&e.verticalDirection||!o.lines[e.name]||t.push({name:e.name,component:o.linesComponent,class:$e(o.classes.lines.default,o.classes.lines[e.name],!o.resizable&&o.classes.lines.disabled),wrapperClass:$e(o.classes.linesWrappers.default,o.classes.linesWrappers[e.name],!o.resizable&&o.classes.linesWrappers.disabled),hoverClass:o.classes.lines.hover,verticalDirection:e.verticalDirection,horizontalDirection:e.horizontalDirection,disabled:!o.resizable})})),t},handlerNodes:function(){var o=this,t=[],e=this.width,s=this.height;return this.points.forEach((function(l){if(o.handlers[l.name]){var r={name:l.name,component:o.handlersComponent,class:$e(o.classes.handlers.default,o.classes.handlers[l.name]),wrapperClass:$e(o.classes.handlersWrappers.default,o.classes.handlersWrappers[l.name]),hoverClass:o.classes.handlers.hover,verticalDirection:l.verticalDirection,horizontalDirection:l.horizontalDirection,disabled:!o.resizable};if(e&&s){var a=l.horizontalDirection,d=l.verticalDirection,u=a==="east"?e:a==="west"?0:e/2,h=d==="south"?s:d==="north"?0:s/2;r.wrapperClass=Ci("handler"),r.wrapperStyle={transform:"translate(".concat(u,"px, ").concat(h,"px)")},o.transitions&&o.transitions.enabled&&(r.wrapperStyle.transition="".concat(o.transitions.time,"ms ").concat(o.transitions.timingFunction))}else r.wrapperClass=Ci("handler",eo({},l.classname,!0));t.push(r)}})),t}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(o,t,e){var s,l=o.shift(),r=l.left,a=l.top,d={left:0,right:0,top:0,bottom:0};t==="west"?d.left-=r:t==="east"&&(d.right+=r),e==="north"?d.top-=a:e==="south"&&(d.bottom+=a),!e&&t?s="width":e&&!t&&(s="height"),this.resizable&&this.$emit("resize",new _u(d,{allowedDirections:{left:t==="west"||!t,right:t==="east"||!t,bottom:e==="south"||!e,top:e==="north"||!e},preserveAspectRatio:o.nativeEvent&&o.nativeEvent.shiftKey,respectDirection:s}))}},emits:["resize","resize-end"]};Za.render=function(o,t,e,s,l,r){return p(),ae("div",{ref:"box",class:r.classes.root,style:r.style},[Ro(o.$slots,"default"),zt("div",null,[(p(!0),ae(at,null,xt(r.lineNodes,(function(a){return p(),ae(ls(a.component),{key:a.name,"default-class":a.class,"hover-class":a.hoverClass,"wrapper-class":a.wrapperClass,position:a.name,disabled:a.disabled,onDrag:function(d){return r.onHandlerDrag(d,a.horizontalDirection,a.verticalDirection)},onDragEnd:t[1]||(t[1]=function(d){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])})),128))]),(p(!0),ae(at,null,xt(r.handlerNodes,(function(a){return p(),ae("div",{key:a.name,style:a.wrapperStyle,class:a.wrapperClass},[(p(),ae(ls(a.component),{"default-class":a.class,"hover-class":a.hoverClass,"wrapper-class":a.wrapperClass,"horizontal-position":a.horizontalDirection,"vertical-position":a.verticalDirection,disabled:a.disabled,onDrag:function(d){return r.onHandlerDrag(d,a.horizontalDirection,a.verticalDirection)},onDragEnd:t[2]||(t[2]=function(d){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)})),128))],6)};var Iu=vo("vue-draggable-area"),Xa={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:Iu()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1}
2,methods:{onTouchStart:function(o){if(o.cancelable){var t=this.movable&&o.touches.length===1;t&&(this.touches=ys(o.touches)),(this.touchStarted||t)&&(o.preventDefault(),o.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(o){this.touches.length>=1&&(this.touchStarted?(this.processMove(o,o.touches),o.preventDefault(),o.stopPropagation()):Ha({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:o.touches[0].clientX,y:o.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:o.touches[0].clientX,clientY:o.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(o){if(this.movable&&o.button===0){var t={fake:!0,clientX:o.clientX,clientY:o.clientY};this.touches=[t],this.initAnchor(t),o.stopPropagation()}},onMouseMove:function(o){this.touches.length&&(this.processMove(o,[{fake:!0,clientX:o.clientX,clientY:o.clientY}]),o.preventDefault&&o.cancelable&&o.preventDefault(),o.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(o){var t=this.$refs.container.getBoundingClientRect(),e=t.left,s=t.top;this.anchor={x:o.clientX-e,y:o.clientY-s}},processMove:function(o,t){var e=ys(t);if(this.touches.length){var s=this.$refs.container.getBoundingClientRect(),l=s.left,r=s.top;this.touches.length===1&&e.length===1&&this.$emit("move",new cl({left:e[0].clientX-(l+this.anchor.x),top:e[0].clientY-(r+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};Xa.render=function(o,t,e,s,l,r){return p(),ae("div",{ref:"container",onTouchstart:t[1]||(t[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:t[2]||(t[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)})},[Ro(o.$slots,"default")],544)};function Mi(o){var t,e;return{rotate:o.rotate||0,flip:{horizontal:((t=o?.flip)===null||t===void 0?void 0:t.horizontal)||!1,vertical:((e=o?.flip)===null||e===void 0?void 0:e.vertical)||!1}}}function Nu(o){return new Promise((function(t,e){try{if(o)if(/^data:/i.test(o))t((function(u){u=u.replace(/^data:([^;]+);base64,/gim,"");for(var h=atob(u),_=h.length,m=new ArrayBuffer(_),x=new Uint8Array(m),$=0;$<_;$++)x[$]=h.charCodeAt($);return m})(o));else if(/^blob:/i.test(o)){var s=new FileReader;s.onload=function(u){t(u.target.result)},r=o,a=function(u){s.readAsArrayBuffer(u)},(d=new XMLHttpRequest).open("GET",r,!0),d.responseType="blob",d.onload=function(){this.status!=200&&this.status!==0||a(this.response)},d.send()}else{var l=new XMLHttpRequest;l.onreadystatechange=function(){l.readyState===4&&(l.status===200||l.status===0?t(l.response):e("Warning: could not load an image to parse its orientation"),l=null)},l.onprogress=function(){l.getResponseHeader("content-type")!=="image/jpeg"&&l.abort()},l.withCredentials=!1,l.open("GET",o,!0),l.responseType="arraybuffer",l.send(null)}else e("Error: the image is empty")}catch(u){e(u)}var r,a,d}))}function Ka(o){var t=o.rotate,e=o.flip,s=o.scaleX,l=o.scaleY,r="";return r+=" rotate("+t+"deg) ",r+=" scaleX("+s*(e.horizontal?-1:1)+") ",r+=" scaleY("+l*(e.vertical?-1:1)+") "}function Hu(o){try{var t,e=new DataView(o),s=void 0,l=void 0,r=void 0,a=void 0;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var d=e.byteLength,u=2;u+1<d;){if(e.getUint8(u)===255&&e.getUint8(u+1)===225){r=u;break}u++}if(r&&(s=r+10,(function($,S,v){var M,w="";for(M=S,v+=S;M<v;M++)w+=String.fromCharCode($.getUint8(M));return w})(e,r+4,4)==="Exif")){var h=e.getUint16(s);if(((l=h===18761)||h===19789)&&e.getUint16(s+2,l)===42){var _=e.getUint32(s+4,l);_>=8&&(a=s+_)}}if(a){for(var m=e.getUint16(a,l),x=0;x<m;x++)if(u=a+12*x+2,e.getUint16(u,l)===274){u+=8,t=e.getUint16(u,l),e.setUint16(u,1,l);break}}return t}catch{return null}}function sr(o,t){var e=t.getBoundingClientRect(),s=e.left,l=e.top,r={left:0,top:0},a=0;return o.forEach((function(d){r.left+=(d.clientX-s)/o.length,r.top+=(d.clientY-l)/o.length})),o.forEach((function(d){a+=Ha({x:r.left,y:r.top},{x:d.clientX-s,y:d.clientY-l})})),{centerMass:r,spread:a,count:o.length}}var Ga={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=Wi(this.processEnd),this.touches=[]},methods:{processMove:function(o,t){if(this.touches.length){if(this.touches.length===1&&t.length===1)this.$emit("move",new ln({left:this.touches[0].clientX-t[0].clientX,top:this.touches[0].clientY-t[0].clientY}));else if(this.touches.length>1&&this.touchResize){var e=sr(t,this.$refs.container),s=this.oldGeometricProperties;s.count===e.count&&s.count>1&&this.$emit("resize",new ln({left:s.centerMass.left-e.centerMass.left,top:s.centerMass.top-e.centerMass.top},{factor:s.spread/e.spread,center:e.centerMass})),this.oldGeometricProperties=e}this.touches=t}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(o){return this.eventsFilter?this.eventsFilter(o,this.transforming)!==!1:(o.preventDefault(),o.stopPropagation(),!0)}
vendor: 8,476 bytes, lines 2-3
2,onTouchStart:function(o){if(o.cancelable&&(this.touchMove||this.touchResize&&o.touches.length>1)&&this.processEvent(o)){var t=this.$refs.container,e=t.getBoundingClientRect(),s=e.left,l=e.top,r=e.bottom,a=e.right;this.touches=ys(o.touches).filter((function(d){return d.clientX>s&&d.clientX<a&&d.clientY>l&&d.clientY<r})),this.oldGeometricProperties=sr(this.touches,t)}},onTouchEnd:function(o){o.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(o){var t=this;if(this.touches.length){var e=ys(o.touches).filter((function(s){return!s.identifier||t.touches.find((function(l){return l.identifier===s.identifier}))}));this.processEvent(o)&&(this.processMove(o,e),this.processStart())}},onMouseDown:function(o){if(this.mouseMove&&"buttons"in o&&o.buttons===1&&this.processEvent(o)){var t={fake:!0,clientX:o.clientX,clientY:o.clientY};this.touches=[t],this.processStart()}},onMouseMove:function(o){this.touches.length&&this.processEvent(o)&&this.processMove(o,[{clientX:o.clientX,clientY:o.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(o){if(this.wheelResize&&this.processEvent(o)){var t=this.$refs.container.getBoundingClientRect(),e=t.left,s=t.top,l=1+this.wheelResize.ratio*(a=o.deltaY||o.detail||o.wheelDelta,(d=+a)==0||Na(d)?d:d>0?1:-1),r={left:o.clientX-e,top:o.clientY-s};this.$emit("resize",new ln({},{factor:l,center:r})),this.touches.length||this.debouncedProcessEnd()}var a,d}},emits:["resize","move","transform-end"]};Ga.render=function(o,t,e,s,l,r){return p(),ae("div",{ref:"container",onTouchstart:t[1]||(t[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:t[2]||(t[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onWheel:t[3]||(t[3]=function(){return r.onWheel&&r.onWheel.apply(r,arguments)})},[Ro(o.$slots,"default")],544)};var Zi={components:{TransformableImage:Ga},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"]};Zi.render=function(o,t,e,s,l,r){var a=To("transformable-image");return p(),ae(a,{"touch-move":e.touchMove,"touch-resize":e.touchResize,"mouse-move":e.mouseMove,"wheel-resize":e.wheelResize,onMove:t[1]||(t[1]=function(d){return o.$emit("move",d)}),onResize:t[2]||(t[2]=function(d){return o.$emit("resize",d)})},{default:ne((function(){return[Ro(o.$slots,"default")]})),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])};var Dn=vo("vue-preview"),Qa={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:Dn({fill:this.fill}),wrapper:Dn("wrapper"),imageWrapper:Dn("image-wrapper"),image:$e(Dn("image"),this.imageClass)}},style:function(){if(this.fill)return{};var o={};return this.width&&(o.width="".concat(this.size.width,"px")),this.height&&(o.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o},wrapperStyle:function(){var o={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o},imageStyle:function(){if(this.coordinates&&this.image){var o=this.coordinates.width/this.size.width,t=se(se({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/o,scaleY:1/o}),e=this.imageSize.width,s=this.imageSize.height,l=Ya({width:e,height:s},t.rotate),r={width:"".concat(e,"px"),height:"".concat(s,"px"),left:"0px",top:"0px"},a={rotate:{left:(e-l.width)*t.scaleX/2,top:(s-l.height)*t.scaleY/2},scale:{left:(1-t.scaleX)*e/2,top:(1-t.scaleY)*s/2}};return r.transform=`translate(
3				`.concat(-this.coordinates.left/o-a.rotate.left-a.scale.left,"px,").concat(-this.coordinates.top/o-a.rotate.top-a.scale.top,"px) ")+Ka(t),this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(o){(o.width||o.height)&&this.onChangeImage()}},mounted:function(){var o=this;this.onChangeImage(),this.$refs.image.addEventListener("load",(function(){o.refreshImage()})),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var o=this.$refs.image;this.calculatedImageSize.height=o.naturalHeight,this.calculatedImageSize.width=o.naturalWidth},refresh:function(){var o=this.$refs.root;this.width||(this.calculatedSize.width=o.clientWidth),this.height||(this.calculatedSize.height=o.clientHeight)},onChangeImage:function(){var o=this.$refs.image;o&&o.complete&&this.refreshImage(),this.refresh()}}};Qa.render=function(o,t,e,s,l,r){return p(),ae("div",{ref:"root",class:r.classes.root,style:r.style},[zt("div",{ref:"wrapper",class:r.classes.wrapper,style:r.wrapperStyle},[bt(zt("img",{ref:"image",src:e.image&&e.image.src,class:r.classes.image,style:r.imageStyle},null,14,["src"]),[[Ie,e.image&&e.image.src]])],6)],6)};var Ja={components:{Preview:Qa},inheritAttrs:!1};Ja.render=function(o,t,e,s,l,r){var a=To("preview");return p(),ae(a,Ma(o.$attrs,{fill:!0}),null,16)};var Si=vo("vue-rectangle-stencil"),tc={name:"RectangleStencil",components:{StencilPreview:Ja,BoundingBox:Za,DraggableArea:Xa},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return ul}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return hl}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:$e(Si({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:$e(Si("preview"),this.previewClass),boundingBox:$e(Si("bounding-box"),this.boundingBoxClass)}},style:function(){var o=this.stencilCoordinates,t=o.height,e=o.width,s=o.left,l=o.top,r={width:"".concat(e,"px"),height:"".concat(t,"px"),transform:"translate(".concat(s,"px, ").concat(l,"px)")};return this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}},methods:{onMove:function(o){this.$emit("move",o),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(o){this.$emit("resize",o),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};tc.render=function(o,t,e,s,l,r){var a=To("stencil-preview"),d=To("draggable-area"),u=To("bounding-box");return p(),ae("div",{class:r.classes.stencil,style:r.style},[zt(u,{width:e.stencilCoordinates.width,height:e.stencilCoordinates.height,transitions:e.transitions,class:r.classes.boundingBox,handlers:e.handlers,"handlers-component":e.handlersComponent,"handlers-classe
3s":e.handlersClasses,"handlers-wrappers-classes":e.handlersWrappersClasses,lines:e.lines,"lines-component":e.linesComponent,"lines-classes":e.linesClasses,"lines-wrappers-classes":e.linesWrappersClasses,resizable:e.resizable,onResize:r.onResize,onResizeEnd:r.onResizeEnd},{default:ne((function(){return[zt(d,{movable:e.movable,onMove:r.onMove,onMoveEnd:r.onMoveEnd},{default:ne((function(){return[zt(a,{image:e.image,coordinates:e.coordinates,width:e.stencilCoordinates.width,height:e.stencilCoordinates.height,class:r.classes.preview,transitions:e.transitions},null,8,["image","coordinates","width","height","class","transitions"])]})),_:1},8,["movable","onMove","onMoveEnd"])]})),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var Vu=["transitions"],Io=vo("vue-advanced-cropper"),ec={name:"Cropper",components:{BackgroundWrapper:Zi},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return tc}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Zi}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(o){return yu.indexOf(o)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(o){return!(typeof o=="string"&&o!=="fill"&&o!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(o){var t=o.event,e=o.coordinates,s=o.aspectRatio,l=o.positionRestrictions,r=o.sizeRestrictions,a=Ht(Ht({},e),{right:e.left+e.width,bottom:e.top+e.height}),d=t.params||{},u=Ht({},t.directions),h=d.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};r.widthFrozen&&(u.left=0,u.right=0),r.heightFrozen&&(u.top=0,u.bottom=0),zo.forEach((function(tt){h[tt]||(u[tt]=0)}));var _=Ao(a,u=or({coordinates:a,directions:u,sizeRestrictions:r,positionRestrictions:l})).width,m=Ao(a,u).height,x=d.preserveRatio?ie(a):$i(_/m,s);if(x){var $=d.respectDirection;if($||($=a.width>=a.height||x===1?"width":"height"),$==="width"){var S=_/x-a.height;if(h.top&&h.bottom){var v=u.top,M=u.bottom;u.bottom=Sn(S,M,v),u.top=Sn(S,v,M)}else h.bottom?u.bottom=S:h.top?u.top=S:h.right?u.right=0:h.left&&(u.left=0)}else if($==="height"){var w=a.width-m*x;if(h.left&&h.right){var I=u.left,O=u.right;u.left=-Sn(w,I,O),u.right=-Sn(w,O,I)}else h.left?u.left=-w:h.right?u.right=-w:h.top?u.top=0:h.bottom&&(u.bottom=0)}u=or({directions:u,coordinates:a,sizeRestrictions:r,positionRestrictions:l,preserveRatio:!0,compensate:d.compensate})}return _=Ao(a,u).width,m=Ao(a,u).height,(x=d.preserveRatio?ie(a):$i(_/m,s))&&Math.abs(x-_/m)>.001&&zo.forEach((function(tt){h[tt]||(u[tt]=0)})),qi({event:new cl({left:-u.left,top:-u.top}),coordinates:{width:e.width+u.right+u.left,height:e.height+u.top+u.bottom,left:e.left,top:e.top},positionRestrictions:l})}},moveAlgorithm:{type:Function,default:qi},initStretcher:{type:Function,default:function(o){var t=o.stretcher,e=o.imageSize,s=ie(e);t.style.width=e.width+"px",t.style.height=t.clientWidth/s+"px",t.style.width=t.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(o){var t=o.visibleArea,e=o.coordinates,s=o.aspectRatio,l=o.sizeRestrictions,r=o.positionRestrictions,a=Ht(Ht({},e),Yo({width:e.width,height:e.height,aspectRatio:s,sizeRestrictions:{maxWidth:t.width,maxHeight:t.height,minHeight:Math.min(t.height,l.minHeight),minWidth:Math.min(t.width,l.minWidth)}}));return a=ze(a=Ye(a,Bs(Ae(e),Ae(a))),ri(Lo(t),r))}},fitVisibleArea:{type:Function,default:function(o){var t=o.visibleArea,e=o.boundaries,s=o.getAreaRestrictions,l=o.coordinates,r=Ht({},t);r.height=r.width/ie(e),r.top+=(t.height-r.height)/2,(l.height-r.height>0||l.width-r.width>0)&&(r=no(r,Math.max(l.height/r.height,l.width/r.width)));var a=ii(Fs(l,Lo(r=no(r,li(r,s({visibleArea:r,type:"resize"}))))));return r.width<l.width&&(a.left=0),r.height<l.height&&(a.top=0),r=ze(r=Ye(r,a),s({visibleArea:r,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(o){var t=o.visibleArea,e=o.boundaries,s=o.imageSize,l=o.imageRestriction,r=o.type,a={};return l==="fill-area"?a={left:0,top:0,right:s.width,bottom:s.height}:l==="fit-area"&&(ie(e)>ie(s)?(a={top:0,bottom:s.height},t&&r==="move"&&(t.width>s.width?(a.left=-(t.width-s.width)/2,a.right=s.width-a.left):(a.left=0,a.right=s.width))):(a={left:0,right:s.width},t&&r==="move"&&(t.height>s.height?(a.top=-(t.height-s.height)/2,a.bottom=s.height-a.top):(a.top=0,a.bottom=s.height)))),a}},sizeRestrictionsAlgorithm:{type:Function,default:function(o){return{minWidth:o.minWidth,minHeight:o.minHeight,maxWidth:o.maxWidth,maxHeight:o.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(o){var t=o.imageSize,e={};return o.imageRestriction!=="none"&&(e={left:0,top:0,right:t.width,bottom:t.height}),e}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:se({},Ql)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var o=(function(t){return t*Math.PI/180})(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(o))+Math.abs(this.imageAttributes.height*Math.sin(o)),height:Math.abs(this.imageAttributes.width*Math.sin(o))+Math.abs(this.imageAttributes.height*Math.cos(o))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var o=Ui(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:Ui(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:o}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var o=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:Me(this.minWidth)?0:Cn(this.minWidth),minHeight:Me(this.minHeight)?0:Cn(this.minHeight),maxWidth:Me(this.maxWidth)?1/0:Cn(this.maxWidth),maxHeight:Me(this.maxHeight)?1/0:Cn(this.maxHeight)});if(o=(function(s){var l=s.areaRestrictions,r=s.sizeRestrictions,a=s.boundaries,d=s.positionRestrictions,u=Ht(Ht({},r),{minWidth:r.minWidth!==void 0?r.minWidth:0,minHeight:r.minHeight!==void 0?r.minHeight:0,maxWidth:r.maxWidth!==void 0?r.maxWidth:1/0,maxHeight:r.maxHeight!==void 0?r.maxHeight:1/0});d.left!==void 0&&d.right!==void 0&&(u.maxWidth=Math.min(u.maxWidth,d.right-d.left)),d.bottom!==void 0&&d.top!==void 0&&(u.maxHeight=Math.min(u.maxHeight,d.bottom-d.top));var h=Yi(l),_=Ua(a,h);return h.width<1/0&&(!u.maxWidth||u.maxWidth>_.width)&&(u.maxWidth=Math.min(u.maxWidth,_.width)),h.height<1/0&&(!u.maxHeight||u.maxHeight>_.height)&&(u.maxHeight=Math.min(u.maxHeight,_.height)),u.minWidth>u.maxWidth&&(u.minWidth=u.maxWidth,u.widthFrozen=!0),u.minHeight>u.maxHeight&&(u.minHeight=u.maxHeight,u.heightFrozen=!0),u})({sizeRestrictions:o,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}
vendor: 5,229 bytes, line 3
3),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var t=this.getStencilSize(),e=Yi(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));o.maxWidth=Math.min(o.maxWidth,e.width*t.width/this.boundaries.width),o.maxHeight=Math.min(o.maxHeight,e.height*t.height/this.boundaries.height),o.maxWidth<o.minWidth&&(o.minWidth=o.maxWidth),o.maxHeight<o.minHeight&&(o.minHeight=o.maxHeight)}return o}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:Io(),image:$e(Io("image"),this.imageClass),stencil:Io("stencil"),boundaries:$e(Io("boundaries"),this.boundariesClass),stretcher:$e(Io("stretcher")),background:$e(Io("background"),this.backgroundClass),foreground:$e(Io("foreground"),this.foregroundClass),imageWrapper:$e(Io("image-wrapper")),cropperWrapper:$e(Io("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var o=this.coordinates,t=o.width,e=o.height,s=o.left,l=o.top;return{width:t/this.coefficient,height:e/this.coefficient,left:(s-this.visibleArea.left)/this.coefficient,top:(l-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var o={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(o.opacity="0"),o},imageStyle:function(){var o=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},t={left:(o.width-this.imageSize.width)/(2*this.coefficient),top:(o.height-this.imageSize.height)/(2*this.coefficient)},e={left:(1-1/this.coefficient)*o.width/2,top:(1-1/this.coefficient)*o.height/2},s=se(se({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/o.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/o.height)}),l={width:"".concat(o.width,"px"),height:"".concat(o.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-t.left-e.left-this.imageTransforms.translateX,"px, ").concat(-t.top-e.top-this.imageTransforms.translateY,"px)")+Ka(s)};return this.transitionsOptions.enabled&&(l.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),l}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var o=this;this.$nextTick((function(){o.resetCoordinates(),o.runAutoZoom("setCoordinates"),o.onChange()}))},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(o,t){["aspectRatio","minAspectRatio","maxAspectRatio"].find((function(e){return o[e]!==t[e]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=Wi(this.update,this.debounce),this.debouncedDisableTransitions=Wi(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var o=this.initialized?this.prepareResult(se({},this.coordinates)):this.defaultCoordinates(),t={rotate:this.imageTransforms.rotate%360,flip:se({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var e=this;return{image:this.image,coordinates:o,visibleArea:this.visibleArea?se({},this.visibleArea):null,imageTransforms:t,get canvas(){return e.canvas?e.getCanvas():void 0}}}return{image:this.image,coordinates:o,visibleArea:this.visibleArea?se({},this.visibleArea):null,canvas:void 0,imageTransforms:t}},zoom:function(o,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=e.transitions,l=s===void 0||s;this.onManipulateImage(new ln({},{factor:1/o,center:t}),{normalize:!1,transitions:l})},move:function(o,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=e.transitions,l=s===void 0||s;this.onManipulateImage(new ln({left:o||0,top:t||0}),{normalize:!1,transitions:l})}
3,setCoordinates:function(o){var t=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=e.autoZoom,l=s===void 0||s,r=e.transitions,a=r===void 0||r;this.$nextTick((function(){t.imageLoaded?(t.transitionsActive||(a&&t.enableTransitions(),t.coordinates=t.applyTransform(o),l&&t.runAutoZoom("setCoordinates"),a&&t.debouncedDisableTransitions()),t.onChange()):t.delayedTransforms=o}))},refresh:function(){var o=this,t=this.$refs.image;if(this.src&&t)return this.initialized?this.updateVisibleArea().then((function(){o.onChange()})):this.resetVisibleArea().then((function(){o.onChange()}))},reset:function(){var o=this;return this.resetVisibleArea().then((function(){o.onChange(!1)}))},awaitRender:function(o){var t=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){o(),t.awaiting=!1})))},prepareResult:function(o){return this.roundResult?(function(t){var e=t.coordinates,s=t.sizeRestrictions,l=t.positionRestrictions,r={width:Math.round(e.width),height:Math.round(e.height),left:Math.round(e.left),top:Math.round(e.top)};return r.width>s.maxWidth?r.width=Math.floor(e.width):r.width<s.minWidth&&(r.width=Math.ceil(e.width)),r.height>s.maxHeight?r.height=Math.floor(e.height):r.height<s.minHeight&&(r.height=Math.ceil(e.height)),ze(r,l)})(se(se({},this.getPublicProperties()),{},{positionRestrictions:Mn(this.positionRestrictions,this.visibleArea),coordinates:o})):o},processAutoZoom:function(o,t,e,s){var l=this.autoZoomAlgorithm;l||(l=this.stencilSize?$u:this.autoZoom?Cu:Mu);var r=l({event:{type:o,params:s},visibleArea:t,coordinates:e,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return se(se({},r),{},{changed:!Jl(r.visibleArea,t)||!Jl(r.coordinates,e)})},runAutoZoom:function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.transitions,s=e!==void 0&&e,l=pu(t,Vu),r=this.processAutoZoom(o,this.visibleArea,this.coordinates,l),a=r.visibleArea,d=r.coordinates,u=r.changed;s&&u&&this.enableTransitions(),this.visibleArea=a,this.coordinates=d,s&&u&&this.debouncedDisableTransitions()},normalizeEvent:function(o){return(function(t){var e=t.event,s=t.visibleArea,l=t.coefficient;if(e.type==="manipulateImage")return Ht(Ht({},e),{move:{left:e.move&&e.move.left?l*e.move.left:0,top:e.move&&e.move.top?l*e.move.top:0},scale:{factor:e.scale&&e.scale.factor?e.scale.factor:1,center:e.scale&&e.scale.center?{left:e.scale.center.left*l+s.left,top:e.scale.center.top*l+s.top}:null}});if(e.type==="resize"){var r=Ht(Ht({},e),{directions:Ht({},e.directions)});return zo.forEach((function(d){r.directions[d]*=l})),r}if(e.type==="move"){var a=Ht(Ht({},e),{directions:Ht({},e.directions)});return xu.forEach((function(d){a.directions[d]*=l})),a}return e})(se(se({},this.getPublicProperties()),{},{event:o}))},getCanvas:function(){if(this.$refs.canvas){var o=this.$refs.canvas,t=this.$refs.image,e=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?(function(d,u,h){var _=h.rotate,m=h.flip,x={width:u.naturalWidth,height:u.naturalHeight},$=Ya(x,_),S=d.getContext("2d");d.height=$.height,d.width=$.width,S.save();var v=os(Ae(Ht({left:0,top:0},x)),_);return S.translate(-(v.left-$.width/2),-(v.top-$.height/2)),S.rotate(_*Math.PI/180),S.translate(m.horizontal?x.width:0,m.vertical?x.height:0),S.scale(m.horizontal?-1:1,m.vertical?-1:1),S.drawImage(u,0,0,x.width,x.height),S.restore(),d})(this.$refs.sourceCanvas,t,this.imageTransforms):t,s=se({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),l=function(d){return d.find((function(u){return h=u,!Number.isNaN(parseFloat(h))&&isFinite(h);var h}))},r=Yo({sizeRestrictions:{minWidth:l([s.width,s.minWidth])||0,minHeight:l([s.height,s.minHeight])||0,maxWidth:l([s.width,s.maxWidth])||1/0,maxHeight:l([s.height,s.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(s.maxArea&&r.width*r.height>s.maxArea){var a=Math.sqrt(s.maxArea/(r.width*r.height));r={width:Math.round(a*r.width),height:Math.round(a*r.height)}}return(function(d,u,h,_,m){d.width=_?_.width:h.width,d.height=_?_.height:h.height;var x=d.getContext("2d");x.clearRect(0,0,d.width,d.height),m&&(m.imageSmoothingEnabled&&(x.imageSmoothingEnabled=m.imageSmoothingEnabled),m.imageSmoothingQuality&&(x.imageSmoothingQuality=m.imageSmoothingQuality),m.fillColor&&(x.fillStyle=m.fillColor,x.fillRect(0,0,d.width,d.height),x.save()));var $=h.left<0?-h.left:0,S=h.top<0?-h.top:0;x.drawImage(u,h.left+$,h.top+S,h.width,h.height,$*(d.width/h.width),S*(d.height/h.height),d.width,d.height)})(o,e,this.coordinates,r,s),o}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(o){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],e=this.visibleArea&&t?wu(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,s=this.visibleArea&&t?Mn(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return ku({transform:o,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:e,positionRestrictions:s,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var o=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var t=this.defaultSize;t||(t=this.stencilSize?Au:Du);var e=this.sizeRestrictions;e.minWidth,e.minHeight,e.maxWidth,e.maxHeight;var s=As(t)?t({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):t,l=this.defaultPosition||Su,r=[s,function(a){var d=a.coordinates;return se({},As(l)?l({coordinates:d,imageSize:o.imageSize,visibleArea:o.visibleArea}):o.defaultPosition)}];this.delayedTransforms&&r.push.apply(r,ys(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(r,!0),this.delayedTransforms=null}},clearImage:function(){var o=this;this.imageLoaded=!1,setTimeout((function(){var t=o.$refs.stretcher;t&&(t.style.height="auto",t.style.width="auto"),o.coordinates=o.defaultCoordinates(),o.boundaries={width:0,height:0}}),this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var o=this,t=this.$refs.stretcher,e=this.$refs.cropper;return this.initStretcher({cropper:e,stretcher:t,imageSize:this.imageSize}),this.$nextTick().then((function(){var s={cropper:e,imageSize:o.imageSize};if(As(o.defaultBoundaries)?o.boundaries=o.defaultBoundaries(s):o.defaultBoundaries==="fit"?o.boundaries=(function(l){var r=l.cropper,a=l.imageSize,d=r.clientHeight,u=r.clientWidth,h=d,_=a.width*d/a.height;return _>u&&(_=u,h=a.height*u/a.width),{width:_,height:h}})(s):o.boundaries=(function(l){var r=l.cropper;return{width:r.clientWidth,height:r.clientHeight}})(s),!o.boundaries.width||!o.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")}))},resetVisibleArea:function(){var o=this;return this.appliedImageTransforms=se(se({},this.defaultImageTransforms),{},{flip:se({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then((function(){o.priority!=="visible-area"&&(o.visibleArea=null,o.resetCoordinates());var t,e,s,l,r,a,d=o.defaultVisibleArea||zu;
3o.visibleArea=As(d)?d({imageSize:o.imageSize,boundaries:o.boundaries,coordinates:o.priority!=="visible-area"?o.coordinates:null,getAreaRestrictions:o.getAreaRestrictions,stencilSize:o.getStencilSize()}):o.defaultVisibleArea,o.visibleArea=(t={visibleArea:o.visibleArea,boundaries:o.boundaries,getAreaRestrictions:o.getAreaRestrictions},e=t.visibleArea,s=t.boundaries,l=t.getAreaRestrictions,r=Ht({},e),a=ie(s),r.width/r.height!==a&&(r.height=r.width/a),ze(r,l({visibleArea:r,type:"move"}))),o.priority==="visible-area"?o.resetCoordinates():o.coordinates=o.fitCoordinates({visibleArea:o.visibleArea,coordinates:o.coordinates,aspectRatio:o.getAspectRatio(),positionRestrictions:o.positionRestrictions,sizeRestrictions:o.sizeRestrictions}),o.runAutoZoom("resetVisibleArea")})).catch((function(){o.visibleArea=null}))},updateVisibleArea:function(){var o=this;return this.updateBoundaries().then((function(){o.visibleArea=o.fitVisibleArea({imageSize:o.imageSize,boundaries:o.boundaries,visibleArea:o.visibleArea,coordinates:o.coordinates,getAreaRestrictions:o.getAreaRestrictions}),o.coordinates=o.fitCoordinates({visibleArea:o.visibleArea,coordinates:o.coordinates,aspectRatio:o.getAspectRatio(),positionRestrictions:o.positionRestrictions,sizeRestrictions:o.sizeRestrictions}),o.runAutoZoom("updateVisibleArea")})).catch((function(){o.visibleArea=null}))},onChange:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];o&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var o,t=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if((function(l){if(Kl(l))return!1;var r=window.location,a=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(l)||[],d={protocol:a[1]||"",host:a[2]||"",port:a[3]||""},u=function(h){return h.port||((h.protocol||r.protocol)==="http"?80:433)};return!(!d.protocol&&!d.host&&!d.port||d.protocol&&d.protocol==r.protocol&&d.host&&d.host==r.host&&d.host&&u(d)==u(r))})(this.src)){var e=Me(this.crossOrigin)?this.canvas:this.crossOrigin;e===!0&&(e="anonymous"),this.imageAttributes.crossOrigin=e||null}if(this.checkOrientation){var s=(o=this.src,new Promise((function(l){Nu(o).then((function(r){var a=Hu(r);l(r?{source:o,arrayBuffer:r,orientation:a}:{source:o,arrayBuffer:null,orientation:null})})).catch((function(r){console.warn(r),l({source:o,arrayBuffer:null,orientation:null})}))})));setTimeout((function(){s.then(t.onParseImage)}),this.transitionTime)}else setTimeout((function(){t.onParseImage({source:t.src})}),this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var o=this,t=this.$refs.image;t&&!this.imageLoaded&&(this.imageAttributes.height=t.naturalHeight,this.imageAttributes.width=t.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then((function(){o.$emit("ready"),o.onChange(!1)})))},onParseImage:function(o){var t=this,e=o.source,s=o.arrayBuffer,l=o.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,s&&l&&l>1?Ia(e)||!Kl(e)?(this.imageAttributes.src=URL.createObjectURL(new Blob([s])),this.imageAttributes.revoke=!0):this.imageAttributes.src=(function(r){for(var a=[],d=new Uint8Array(r);d.length>0;){var u=d.subarray(0,8192);a.push(String.fromCharCode.apply(null,Array.from?Array.from(u):u.slice())),d=d.subarray(8192)}return"data:image/jpeg;base64,"+btoa(a.join(""))})(s):this.imageAttributes.src=e,As(this.defaultTransforms)?this.appliedImageTransforms=Mi(this.defaultTransforms()):Vn(this.defaultTransforms)?this.appliedImageTransforms=Mi(this.defaultTransforms):this.appliedImageTransforms=(function(r){var a=Mi({});if(r)switch(r){case 2:a.flip.horizontal=!0;break;case 3:a.rotate=-180;break;case 4:a.flip.vertical=!0;break;case 5:a.rotate=90,a.flip.vertical=!0;break;case 6:a.rotate=90;break;case 7:a.rotate=90,a.flip.horizontal=!0;break;case 8:a.rotate=-90}return a})(l),this.defaultImageTransforms=se(se({},this.appliedImageTransforms),{},{flip:se({},this.appliedImageTransforms.flip)}),this.$nextTick((function(){var r=t.$refs.image;
vendor: 5,783 bytes, line 3
3r&&r.complete&&((function(a){return!!a.naturalWidth})(r)?t.onSuccessLoadImage():t.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(o){var t=this;this.transitionsOptions.enabled||this.awaitRender((function(){t.coordinates=t.moveAlgorithm(se(se({},t.getPublicProperties()),{},{positionRestrictions:Mn(t.positionRestrictions,t.visibleArea),coordinates:t.coordinates,event:t.normalizeEvent(o)})),t.onChange()}))},onResize:function(o){var t=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var e=t.sizeRestrictions,s=Math.min(t.coordinates.width,t.coordinates.height,20*t.coefficient);t.coordinates=t.resizeAlgorithm(se(se({},t.getPublicProperties()),{},{positionRestrictions:Mn(t.positionRestrictions,t.visibleArea),sizeRestrictions:{maxWidth:Math.min(e.maxWidth,t.visibleArea.width),maxHeight:Math.min(e.maxHeight,t.visibleArea.height),minWidth:Math.max(e.minWidth,s),minHeight:Math.max(e.minHeight,s)},event:t.normalizeEvent(o)})),t.onChange(),t.ticking=!1}))},onManipulateImage:function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var e=t.transitions,s=e!==void 0&&e,l=t.normalize,r=l===void 0||l;s&&this.enableTransitions();var a=ju(se(se({},this.getPublicProperties()),{},{event:r?this.normalizeEvent(o):o,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),d=a.visibleArea,u=a.coordinates;this.visibleArea=d,this.coordinates=u,this.runAutoZoom("manipulateImage"),this.onChange(),s&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=o.visibleArea,e=o.type,s=e===void 0?"move":e;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:t,type:s})},getAspectRatio:function(o){var t,e,s=this.stencilProps,l=s.aspectRatio,r=s.minAspectRatio,a=s.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var d=this.$refs.stencil.aspectRatios();t=d.minimum,e=d.maximum}if(Me(t)&&(t=Me(l)?r:l),Me(e)&&(e=Me(l)?a:l),!o&&(Me(t)||Me(e))){var u=this.getStencilSize(),h=u?ie(u):null;Me(t)&&(t=Gl(h)?h:void 0),Me(e)&&(e=Gl(h)?h:void 0)}return{minimum:t,maximum:e}},getStencilSize:function(){if(this.stencilSize)return o={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},t=o.boundaries,e=o.stencilSize,s=o.aspectRatio,$i(ie(l=As(e)?e({boundaries:t,aspectRatio:s}):e),s)&&(l=Yo({sizeRestrictions:{maxWidth:t.width,maxHeight:t.height,minWidth:0,minHeight:0},width:l.width,height:l.height,aspectRatio:{minimum:s.minimum,maximum:s.maximum}})),(l.width>t.width||l.height>t.height)&&(l=Yo({sizeRestrictions:{maxWidth:t.width,maxHeight:t.height,minWidth:0,minHeight:0},width:l.width,height:l.height,aspectRatio:{minimum:ie(l),maximum:ie(l)}})),l;var o,t,e,s,l},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return se({},Ql)},flip:function(o,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=e.transitions,l=s===void 0||s;if(!this.transitionsActive){l&&this.enableTransitions();var r=se({},this.imageTransforms.flip),a=Pu({flip:{horizontal:o?!r.horizontal:r.horizontal,vertical:t?!r.vertical:r.vertical},previousFlip:r,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),d=a.visibleArea,u=a.coordinates;o&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),t&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=d,this.coordinates=u,this.onChange(),l&&this.debouncedDisableTransitions()}},rotate:function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.transitions,s=e===void 0||e;if(!this.transitionsActive){s&&this.enableTransitions();var l=se({},this.imageSize);this.appliedImageTransforms.rotate+=o;var r=Tu({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:l,imageSize:this.imageSize,angle:o,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=r.visibleArea,d=r.coordinates,u=this.processAutoZoom("rotateImage",a,d);a=u.visibleArea,d=u.coordinates,this.visibleArea=a,this.coordinates=d,this.onChange(),s&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},Wu={key:0,ref:"canvas",style:{display:"none"}},Uu={key:1,ref:"sourceCanvas",style:{display:"none"}};ec.render=function(o,t,e,s,l,r){return p(),ae("div",{ref:"cropper",class:r.classes.cropper},[zt("div",{ref:"stretcher",class:r.classes.stretcher},null,2),zt("div",{class:r.classes.boundaries,style:r.boundariesStyle},[(p(),ae(ls(e.backgroundWrapperComponent),{class:r.classes.cropperWrapper,"
3wheel-resize":r.settings.resizeImage.wheel,"touch-resize":r.settings.resizeImage.touch,"touch-move":r.settings.moveImage.touch,"mouse-move":r.settings.moveImage.mouse,onMove:r.onManipulateImage,onResize:r.onManipulateImage},{default:ne((function(){return[zt("div",{class:r.classes.background,style:r.boundariesStyle},null,6),zt("div",{class:r.classes.imageWrapper},[zt("img",{ref:"image",crossorigin:l.imageAttributes.crossOrigin,src:l.imageAttributes.src,class:r.classes.image,style:r.imageStyle,onMousedown:t[1]||(t[1]=Wo((function(){}),["prevent"]))},null,46,["crossorigin","src"])],2),zt("div",{class:r.classes.foreground,style:r.boundariesStyle},null,6),bt((p(),ae(ls(e.stencilComponent),Ma({ref:"stencil",image:r.image,coordinates:l.coordinates,"stencil-coordinates":r.stencilCoordinates,transitions:r.transitionsOptions},e.stencilProps,{onResize:r.onResize,onResizeEnd:r.onResizeEnd,onMove:r.onMove,onMoveEnd:r.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[Ie,l.imageLoaded]]),e.canvas?(p(),ae("canvas",Wu,null,512)):C("",!0),e.canvas?(p(),ae("canvas",Uu,null,512)):C("",!0)]})),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const Yu={class:"p-6 xl:px-6 xl:pt-[28px] xl:pb-6 rounded-xl"},qu={class:"flex justify-between items-center mb-4"},Zu={class:"flex items-center"},Xu={class:"!text-base md:!text-lg font-semibold"},Ku={class:"space-y-3"},Gu={class:"flex flex-col items-center mb-4"},Qu=["src"],Ju={key:0,class:"fixed inset-0 bg-black/60 z-50 flex items-center justify-center"},th={class:"bg-white rounded-lg p-4 max-w-[90vw] w-full md:w-[400px]"},eh={class:"flex justify-center text-lg font-bold mb-2"},oh={class:"flex justify-end mt-4 gap-2"},sh={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},nh=["value","disabled"],ih={key:0,class:"text-red-500 text-base mt-1"},lh=["value","disabled"],rh={key:0,class:"text-red-500 text-base mt-1"},ah=["value","disabled"],ch={key:0,class:"text-red-500 text-base mt-1"},dh=["value","disabled"],uh={key:0,class:"text-red-500 text-base mt-1"},hh={key:0},ph={key:0,class:"text-red-500 text-base mt-1"},fh={class:"text-xs text-[#D1D1D1] mt-1"},_h={key:0,class:"my-7 border-gray-300"},mh={key:1,class:"flex justify-end gap-4 pt-4"},vh={key:0,disabled:"",class:"px-4 py-2 rounded-full w-40 text-white bg-gray-400 cursor-not-allowed"},gh={key:0,class:"fixed inset-0 bg-black/60 flex items-center justify-center z-50"},bh={class:"bg-white rounded-lg p-6 w-[400px] max-w-full shadow-lg text-center"},xh={class:"text-xl font-semibold mb-4"},yh={class:"mb-6"},wh={class:"flex gap-4"},kh={__name:"AccountSection",async setup(o){let t,e;const s=ke();Po();const{color:l,button_color:r,bg_color:a,isShowBirthDate:d}=Qt(s),{getDetailId:u,user_detail:h,updateUserProfile:_}=Sa(),m=je(),{showContent:x}=Qt(m),$=_o(),S=nn();$.changeStateLoading(!0),[t,e]=nl(()=>u()),await t,e(),we(async()=>{h.value.img_path?.startsWith(S.public.PARTY_URL)||(h.value.img_path=""),$.changeStateLoading(!1)});const v=z({firstName:h?.value?.first_name_th||"",lastName:h?.value?.last_name_th||"",birthDate:h?.value?.birth_date||"",phone:h?.value?.phone||"",email:h.value?.email||""}),M=lt(()=>({firstName:h?.value?.first_name_th||"",lastName:h?.value?.last_name_th||"",birthDate:h?.value?.birth_date||"",phone:h?.value?.phone||"",email:h?.value?.email||""})),w=We({firstName:"",lastName:"",phone:"",email:"",birthDate:""}),I=z(!1),O=z(!1),tt=z(null),G=z(null),Y=z(null),et=z(null),ht=z(null),ct=z(null),dt=z({}),pt=lt(()=>["w-full border border-[#D1D1D1] focus:border-transparent rounded-full px-3 text-base py-1.5 focus:outline-none focus:ring-1 focus:ring-[var(--focus-color)] text-[16px]",I.value?"bg-white text-black":"bg-gray-50 text-gray-500"]);function D(){dt.value={...v.value},I.value=!0}async function Mt(){Z("firstName",dt.value.firstName),Z("lastName",dt.value.lastName),dt.value.firstName!=""&&dt.value.lastName!=""&&($.changeStateLoading(!0),v.value={...dt.value},w.firstName="",w.lastName="",await ot(),await u(),I.value=!1,v.value={...M.value},$.changeStateLoading(!1))}async function ot(){h?.value?.social_type==="oneid"?(console.log("oneid"),await _(v.value.firstName,v.value.lastName,G.value,v.value.birthDate)):await _(v.value.firstName,v.value.lastName,G.value,v.value.birthDate,v.value.phone,v.value.email)}const st=lt(()=>Ls("user_img").value),X=lt(()=>{const vt=h?.value?.next_birth_date_change_at;if(!vt)return!0;const yt=new Date(vt),Ft=new Date;return yt.setHours(0,0,0,0),Ft>=yt}),H=vt=>{if(!vt)return"";const yt=new Date(vt);if(isNaN(yt.getTime()))return vt;const Ft=String(yt.getDate()).padStart(2,"0"),N=String(yt.getMonth()+1).padStart(2,"0"),$t=yt.getFullYear()+543;return`${Ft}/${N}/${$t}`};function P(){G.value=null,et.value=null,dt.value={},I.value=!1,tt.value=null,O.value=!1,w.firstName="",w.lastName="",w.birthDate="",w.p
3hone="",w.email=""}const W=vt=>{const yt=vt.key;if(yt.charCodeAt(0)===3647){vt.preventDefault();return}/^[ก-ฮะ-ๅ่-๋็์a-zA-Z\s]$/.test(yt)||vt.preventDefault()},U=vt=>{const yt=/^0/;vt.target.value=vt.target.value.replace(/\D/g,""),dt.value.phone=vt.target.value,dt.value.phone?/^\d+$/.test(dt.value.phone)?yt.test(dt.value.phone)?dt.value.phone.length<9||dt.value.phone.length>10?w.phone="please_add_number_nine_or_ten_digits":w.phone="":w.phone="phone_number_begin_with_zero":w.phone="number_only":w.phone="please_enter_phone"},B=vt=>{const yt=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;vt.target.value=vt.target.value.replace(/[ก-ฮะ-์]/g,""),dt.value.email=vt.target.value,dt.value.email.endsWith(".xn--com-1pl")&&(dt.value.email=dt.value.email.replace(/\.xn--com-1pl$/i,".com"),vt.target.value=dt.value.email),dt.value.email?yt.test(dt.value.email)?w.email="":w.email="invalid_email_format":w.email="please_enter_email"},Z=(vt,yt)=>{const Ft=/[^ก-๙a-zA-Z\s]/g,N=yt.replace(Ft,"");dt.value[vt]=N,vt==="firstName"&&(w.firstName=N.trim()?"":"please_enter_name"),vt==="lastName"&&(w.lastName=N.trim()?"":"please_enter_last_name")};function q(){Y.value?.click()}function ut(vt){const yt=vt.target.files[0];yt&&(et.value=URL.createObjectURL(yt),console.log("croppingImage.value",et.value)),vt.target.value=""}function wt({canvas:vt,cropper:yt}){ht.value=yt,ct.value=vt}function St(){if(ct.value){const vt=ct.value.toDataURL("image/jpeg");tt.value=vt,G.value=vt.split(",")[1],et.value=null}}function Tt(){et.value=null}return(vt,yt)=>{const Ft=kd,N=hu;return p(),f(at,null,[i("div",Yu,[i("div",qu,[i("div",Zu,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:yt[0]||(yt[0]=$t=>x.value=!1)},[...yt[8]||(yt[8]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("h3",Xu,c(vt.$t("personal_information")),1)]),I.value?C("",!0):(p(),f("button",{key:0,onClick:D,style:b(`color:${n(l)}`),class:"underline cursor-pointer font-bold text-base"},c(vt.$t("edit")),5))]),i("div",Ku,[i("div",Gu,[i("div",{class:"rounded-full border-2 p-2 w-[100px] h-[100px] md:w-[120px] md:h-[120px] inline-flex items-center justify-center overflow-hidden allow-rounded",style:b(`color:${n(l)};`)},[tt.value||st.value?(p(),f("img",{key:0,src:tt.value||st.value,alt:"Uploaded",class:"w-full h-full object-cover rounded-full allow-rounded"},null,8,Qu)):(p(),ae(n(Ud),{key:1,style:b(`color:${n(l)}`),class:"h-24 w-24"},null,8,["style"]))],4),I.value?(p(),f("button",{key:0,class:"mt-2 text-sm px-3 py-1 rounded-full border cursor-pointer",style:b(`color:${n(l)}; border-color:${n(l)}`),onClick:q},c(st.value?vt.$t("change_picture"):vt.$t("add_picture")),5)):C("",!0),i("input",{type:"file",ref_key:"fileInput",ref:Y,class:"hidden",accept:"image/*",onChange:ut},null,544),zt(Ft,null,{default:ne(()=>[et.value?(p(),f("div",Ju,[i("div",th,[i("div",eh,c(vt.$t("resize_profile_picture")),1),zt(n(ec),{src:et.value,"stencil-props":{aspectRatio:1,round:!0},class:"h-[300px] w-full border",onChange:wt},null,8,["src"]),i("div",oh,[i("button",{onClick:Tt,class:"px-3 py-1 border rounded cursor-pointer"},c(vt.$t("cancel")),1),i("button",{onClick:St,class:"px-3 py-1 bg-blue-500 text-white rounded cursor-pointer",style:b({backgroundColor:n(l)})},c(vt.$t("save")),5)])])])):C("",!0)]),_:1})]),i("div",sh,[i("div",null,[i("label",{class:"block text-base font-medium mb-1",style:b({color:n(s).black})},[gt(c(vt.$t("first_name")),1),yt[9]||(yt[9]=i("span",{class:"text-red-500"}," *",-1))],4),i("input",{type:"text",value:I.value?dt.value.firstName:v.value?.firstName,onInput:yt[1]||(yt[1]=$t=>Z("firstName",$t.target.value)),onKeypress:yt[2]||(yt[2]=$t=>W($t)),disabled:!I.value,class:J(pt.value),style:b({"--focus-color":n(s).color})},null,46,nh),n(w).firstName?(p(),f("p",ih,c(`${vt.$t(n(w).firstName)}`),1)):C("",!0)]),i("div",null,[i("label",{class:"block text-base font-medium mb-1",style:b({color:n(s).black})},[gt(c(vt.$t("last_name")),1),yt[10]||(yt[10]=i("span",{class:"text-red-500"}," *",-1))],4),i("input",{type:"text",value:I.value?dt.value.lastName:v.value?.lastName,onInput:yt[3]||(yt[3]=$t=>Z("lastName",$t.target.value)),onKeypress:yt[4]||(yt[4]=$t=>W($t)),disabled:!I.value,class:J(pt.value),style:b({"--focus-color":n(s).color})},null,46,lh),n(w).lastName?(p(),f("p",rh,c(`${vt.$t(n(w).lastName)}`),1)):C("",!0)]),i("div",null,[i("label",{class:"block text-base font-medium mb-1",style:b({color:n(s).black})},c(vt.$t("phone_number")),5),i("input",{type:"tel",value:I.value?dt.value.phone:v.value?.phone,onInput:U,disabled:n(h)?.social_type==="oneid"||!I.value,class:J(["w-full border border-gray-300 rounded-full px-3 text-base py-1.5 focus:outline-none focus:border-transparent focus:ring-2 focus:border-[var(--focus-color)] text-[16px]",I.value&&n(h)?.social_type!=="oneid"?"bg-white text-black":"bg-gray-50 text-gray-500"]),style:b({"--focus-color":n(s).color}),maxlength:"10"},null,46,ah),n(w).phone?(p(),f("p",ch,c(`${vt.$t(n(w).phone)}`),1)):C("",!0)]),i("div",null,[i("label",{class:"block text-base font-medium mb-1",style:b({color:n(s).black})},c(vt.$t("email")),5),i("input",{type:"email",value:I.value?dt.value.email:v.value?.email,onInput:B,disabled:n(h)?.social_type==="oneid"||!I.value,class:J(["w-full border border-gray-300 rounded-full px-3 text-base py-1.5 focus:outline-none focus:border-transparent focus:ring-2 focus:border-[var(--focus-color)] text-[16px]",I.value&&n(h)?.social_type!=="oneid"?"bg-white text-black":"bg-gray-50 text-gray-500"]),style:b({"--focus-color":n(s).color})},null,46,dh),n(w).email?(p(),f("p",uh,c(`${vt.$t(n(w).email)}`),1)):C("",!0)]),n(d)?(p(),f("div",hh,[i("label",{class:"block text-base font-medium mb-1",style:b({color:n(s).black})},c(vt.$t("birthdate")),5),(p(),ae(N,{key:I.value?"editing":"readonly","model-value":I.value?dt.value.birthDate:n(h)?.birth_date||v.value?.birthDate||"","onUpdate:modelValue":yt[5]||(yt[5]=$t=>dt.value.birthDate=$t),disabled:!I.value||!X.value,class:J([I.value&&X.value?"curs
3or-pointer":"cursor-default"])},null,8,["model-value","disabled","class"])),n(w).birthDate?(p(),f("p",ph,c(`${vt.$t(n(w).birthDate)}`),1)):C("",!0),i("div",fh,[n(h)?.next_birth_date_change_at&&!X.value?(p(),f(at,{key:0},[gt(c(vt.$t("can_changedate_again"))+" "+c(H(n(h).next_birth_date_change_at)),1)],64)):(p(),f(at,{key:1},[gt(c(vt.$t("changeddate")),1)],64))])])):C("",!0)]),I.value?(p(),f("hr",_h)):C("",!0),I.value?(p(),f("div",mh,[i("button",{onClick:yt[6]||(yt[6]=$t=>O.value=!0),class:"px-4 py-2 w-40 font-bold border rounded-full bg-white cursor-pointer",style:b({color:n(s).color,border:`1px solid ${n(s).color}`})},c(vt.$t("discard_changes")),5),n(w).firstName||n(w).lastName||n(w).email||n(w).phone?(p(),f("button",vh,c(vt.$t("save")),1)):(p(),f("button",{key:1,onClick:Mt,class:"px-4 py-2 rounded-full w-40 font-bold text-white cursor-pointer",style:b({backgroundColor:n(l)})},c(vt.$t("save")),5))])):C("",!0)]),O.value?(p(),f("div",gh,[i("div",bh,[i("h2",xh,c(vt.$t("discard_changes")),1),i("p",yh,c(vt.$t("confirm_discard_warning")),1),yt[11]||(yt[11]=i("hr",{class:"my-7 border-gray-300"},null,-1)),i("div",wh,[i("button",{onClick:yt[7]||(yt[7]=$t=>O.value=!1),class:"flex-1 px-4 py-2 rounded-lg border border-gray-400 text-gray-700 hover:bg-gray-100 cursor-pointer"},c(vt.$t("continue")),1),i("button",{onClick:P,class:"flex-1 px-4 py-2 rounded-lg text-white cursor-pointer",style:b({backgroundColor:n(l)})},c(vt.$t("confirm")),5)])])])):C("",!0)]),zt(ni)],64)}}},$h={key:0,class:"bg-white p-6 rounded-xl shadow mb-6"},Ch={class:"flex justify-between items-center"},Mh={class:"flex items-center mb-6"},Sh={class:"!text-[16px] xl:!text-lg font-semibold"},Dh={class:"flex justify-between items-center mb-6"},Ah={key:0},zh={class:"flex justify-center mb-4"},jh={class:"flex justify-center mb-4 space-y-2 text-gray-700"},Th={key:1},Ph={key:0,class:"space-y-4"},Lh={class:"font-semibold text-gray-800 mb-3 flex flex-wrap justify-between items-start gap-y-1"},Rh={class:"flex flex-col md:flex-row md:items-center sm:gap-x-2 text-gray-800 min-w-0 flex-1"},Oh=["title"],Bh={key:0,class:"whitespace-nowrap"},Eh=["onClick"],Fh={key:0,class:"whitespace-nowrap mb-4"},Ih={key:1,class:"text-gray-700 text-sm leading-relaxed break-words mb-4"},Nh={key:0},Hh={key:1},Vh={key:2},Wh={key:3},Uh={key:4},Yh={key:5},qh={key:6},Zh={key:7},Xh={key:8},Kh={key:9},Gh={key:10},Qh={key:11},Jh={key:12},tp={key:13},ep={key:14},op={key:15},sp={key:2,class:"text-gray-700 text-sm leading-relaxed mb-4"},np={key:3},ip={class:"font-bold inline"},lp={class:"inline break-words whitespace-normal"},rp=["onClick"],ap={key:1,class:"bg-white p-6 rounded-xl shadow mb-6"},cp={class:"flex justify-between items-center mb-4"},dp={key:2,class:"text-lg font-semibold"},up={class:"flex items-center gap-2 mb-4"},hp={class:"relative flex items-center justify-center w-5 h-5 cursor-pointer"},pp={class:"font-semibold mb-2 !text-base"},fp={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},_p=["placeholder"],mp={key:0,class:"text-red-500 text-sm"},vp=["placeholder"],gp={key:0,class:"text-red-500 text-sm"},bp=["placeholder"],xp={class:"relative h-full shrink-0"},yp=["src"],wp={class:"text-base text-[#343434] whitespace-nowrap"},kp=["maxlength","placeholder"],$p={key:0,class:"absolute top-full left-0 mt-1 w-full bg-white border border-gray-200 rounded-lg shadow-lg z-20 py-1 max-h-48 overflow-y-auto"},Cp=["onClick"],Mp={class:"text-sm"},Sp={class:"text-sm"},Dp={key:2,class:"text-red-500 text-sm"},Ap=["placeholder"],zp={key:0,class:"text-red-500 text-sm"},jp={class:"font-semibold mb-2 !text-base"},Tp={key:0},Pp={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"},Lp=["placeholder"],Rp={key:0,class:"text-red-500 text-sm"},Op=["placeholder"],Bp=["placeholder"],Ep=["placeholder"],Fp=["placeholder"],Ip=["placeholder"],Np=["placeholder"],Hp=["placeholder"],Vp=["placeholder"],Wp={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Up={class:"relative"},Yp={disabled:"",value:null},qp=["value"],Zp={key:0,class:"text-red-500 text-sm"},Xp={class:"relative"},Kp=["disabled"],Gp={disabled:"",value:null},Qp=["value"],Jp={key:0,class:"text-red-500 text-sm"},tf={class:"relative"},ef=["disabled"],of={disabled:"",value:null},sf=["value"],nf={key:0,class:"text-red-500 text-sm"},lf={class:"relative"},rf=["disabled"],af={disabled:"",value:null},cf=["value"],df={key:0,class:"text-red-500 text-sm"},uf={key:1},hf={class:"grid grid-cols-1 md:grid-cols-6 gap-4 mt-4"},pf={class:"col-span-3"},ff={class:"relative"},_f={disabled:"",value:{iso:"",code:"",name:""}},mf=["value"],vf={key:0,class:"text-red-500 text-sm"},gf={key:0,class:"col-span-3"},bf={class:"relative"},xf={disabled:"",value:null},yf=["value"],wf={key:0,class:"text-red-500 text-sm"},kf={key:1,class:"col-span-3 md:col-span-2"},$f={class:"relative"},Cf=["disabled"],Mf={disabled:"",value:null},Sf=["value"],Df={key:0,class:"text-red-500 text-sm"},Af={key:2,class:"col-span-3 md:col-span-2"},zf={class:"relative"},jf=["disabled"],Tf={disabled:"",value:null},Pf=["value"],Lf={key:0,class:"text-red-500 text-sm"},Rf={key:3,class:"col-span-3"},Of={class:"block"},Bf=["placeholder"],Ef={key:0,class:"text-red-500 text-sm"},Ff={key:4,class:"col-span-3"},If={class:"block"},Nf=["placeholder"],Hf={key:0,class:"text-red-500 text-sm"},Vf={key:0,class:"relative"},Wf=["disabled"],Uf={disabled:"",value:null},Yf=["value"],qf={key:1},Zf=["placeholder"],Xf={key:2,class:"text-red-500 text-sm"},Kf={key:2},Gf={class:"grid grid-cols-1 md:grid-cols-3 gap-4 my-4"},Qf=["placeholder"],Jf={key:0,class:"text-red-500 text-sm"},t_=["placeholder"],e_=["placeholder"],o_=["placeholder"],s_=["placeholder"],n_=["placeholder"],i_=["placeholder"],l_=["placeholder"],r_=["placeholder"],a_={key:3},c_={class:"mt-4"},d_={class:"block mb-1"},u_=["placeholder"],h_={class:"w-full text-xs text-right text-[#d1d1d1] mt-1"},p_={key:0,class:"text-red-500 text-sm mt-[-15px]"},f_={class:"mt-2"},__={class:"block mb-1"},m_=["placeholder"],v_={class:"w-full text-xs text-right text-[#d1d1d1] mt-1"},g_={class:"mt-5 text-base"},b_={class:"font-semibold mb-2"},x_={class:"w-full"},y_=["placeholder"],w_={class:"w-full text-right text-[#d1d1d1] text-xs"},k_={class:"flex justify-end space-x-2"},$_=["disabled"],C_={key:2,class:"bg-white p-6 rounded-xl shadow mb-6"},M_={class:"flex justify-between items-center mb-4"}
3,S_={class:"!text-[16px] xl:!text-lg font-semibold"},D_={class:"flex justify-between"},A_={key:0},z_={class:"flex justify-center mb-4"},j_={class:"flex justify-center mb-4 space-y-2 text-gray-700"},T_={key:1,class:"space-y-4"},P_=["onClick"],L_={class:"font-semibold mb-1"},R_={key:0,class:"text-nowrap"},O_={key:1,class:"text-nowrap"},B_={key:0},E_={class:"text-sm"},F_={key:0},I_={class:"text-sm leading-relaxed"},N_={class:"font-semibold"},H_={class:"text-sm leading-relaxed"},V_=["onClick"],W_={key:3,class:"bg-white p-6 rounded-xl shadow mb-6"},U_={class:"flex justify-between items-center mb-4"},Y_={class:"flex items-center gap-2 mb-4"},q_={key:0,class:"relative flex items-center justify-center w-5 h-5 cursor-pointer"},Z_={key:1},X_={class:"flex items-center gap-2 mb-4"},K_={class:"relative flex items-center justify-center w-5 h-5 cursor-pointer"},G_={class:"!text-base font-bold"},Q_={class:"flex my-4 gap-4"},J_={class:"flex flex-1 gap-2 items-center text-base"},t1={class:"flex flex-1 gap-2 items-center text-base"},e1={class:"block mb-1"},o1={class:"flex flex-col gap-4"},s1={class:"flex gap-4 w-full flex-col md:flex-row"},n1={class:"flex-1"},i1=["placeholder"],l1={key:0,class:"text-red-500 text-sm"},r1={key:0,class:"flex-1"},a1=["placeholder"],c1={key:0,class:"text-red-500 text-sm"},d1={key:0,class:"w-full"},u1={class:"flex gap-4"},h1={class:"flex flex-1 gap-2 items-center text-base"},p1={class:"flex flex-1 gap-2 items-center text-base"},f1={key:1,class:"flex gap-4 flex-col md:flex-row w-full"},_1={class:"mb-4 flex-col flex-1"},m1={class:"block mb-1"},v1=["value","placeholder","disabled"],g1={key:0,class:"text-red-500 text-sm"},b1={class:"mb-4 flex-col flex-1 flex"},x1={class:"mb-1"},y1=["value","placeholder","disabled"],w1={key:0},k1={key:1},$1=["placeholder"],C1={key:2,class:"text-red-500 text-sm"},M1=["placeholder"],S1={key:0,class:"text-red-500 text-sm"},D1={class:"!text-base mt-4 font-bold"},A1={key:0,class:"mt-2 !text-sm"},z1={key:1,class:"mt-2 !text-sm"},j1={class:"w-full mt-1"},T1=["placeholder"],P1={key:0,class:"text-red-500 text-sm"},L1={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4"},R1={class:"block mb-1"},O1={disabled:"",value:""},B1=["value"],E1={key:0,class:"text-red-500 text-sm"},F1={class:"block mb-1"},I1=["disabled"],N1={disabled:"",value:""},H1=["value"],V1={key:0,class:"text-red-500 text-sm"},W1={class:"block mb-1"},U1=["disabled"],Y1={disabled:"",value:""},q1=["value"],Z1={key:0,class:"text-red-500 text-sm"},X1={class:"block mb-1"},K1=["disabled"],G1={disabled:"",value:""},Q1=["value"],J1={key:0,class:"text-red-500 text-sm"},tm={class:"flex justify-end space-x-2 mt-4"},em=["disabled"],om={key:4,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-2"},sm={class:"w-80 md:w-150 bg-white p-6 rounded-lg shadow-xl relative"},nm={class:"text-center"},im={class:"text-base xl:text-[20px] font-bold mb-2"},lm={class:"font-normal text-sm xl:text-[16px]"},rm={class:"mt-4 flex justify-between font-bold text-[16px] gap-4"},am={key:5,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-2"},cm={class:"w-80 md:w-150 bg-white p-6 rounded-lg shadow-xl relative"},dm={class:"text-center"},um={class:"text-base xl:text-[20px] font-bold mb-2"},hm={class:"font-normal text-sm xl:text-[16px]"},pm={class:"mt-4 flex justify-between font-bold text-[16px] gap-4"},fm={key:6,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-2"},_m={class:"w-80 md:w-150 bg-white p-6 rounded-lg shadow-xl relative"},mm={class:"text-center"},vm={class:"text-base xl:text-[20px] font-bold mb-2"},gm={class:"font-normal text-sm xl:text-[16px]"},bm={class:"mt-4 flex justify-between font-bold text-[16px] gap-4"},xm={key:7,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-2"},ym={class:"w-80 md:w-150 bg-white p-6 rounded-lg shadow-xl relative"},wm={class:"text-center"},km={class:"text-base xl:text-[20px] font-bold mb-2"},$m={class:"font-normal text-sm xl:text-[16px]"},Cm={class:"mt-4 flex justify-between font-bold text-[16px] gap-4"},An=200,Mm={__name:"AddressesSection",async setup(o){let t,e;const{t:s}=ee(),l=ke(),r=je(),{showContent:a}=Qt(r),d=Po(),u=_o(),{color:h,button_color:_,bg_color:m,main_gray_cl:x}=Qt(l),$=Po(),S=lt(()=>Oa.value),v=z(!1),{locale:M}=ee();[t,e]=nl(()=>Promise.all([$.loadProvince(),$.loadTambons(),$.loadAmphures()])),await t,e();const w=z(null),I=z(null),O=z(!1),tt=z(!1),G=z(!1),Y=z(null),et=z(null),ht=z(null),ct=z(null),dt=z(null),pt=z(null),D=z(null),Mt=z(null),ot=z(null),{originalTambon:st,getProvince:X,originalAmphures:H}=Qt($),P=z({iso:"",code:"",name:""}),W=lt(()=>{const K=d.originalAmphures.find(y=>y.name_th===D.value||y.name_en===D.value);return K?d.originalTambon.filter(y=>y.amphure_id===K.id&&(y.name_th===Mt.value||y.name_en===Mt.value)):[]}),U=z(!1),B=z(!1),Z=z(!1),q=lt(()=>Array.isArray(r.user)?r.user:[]),ut=z(null),wt=z(null),St=z(d.originalTambon),Tt=z(d.originalAmphures),vt=z(""),yt=z(""),Ft=z([]),N=z({tax_type:"Personal",role_user:"ext_buyer",name:"",email:"",address:"",postal_code:"",province:"",district:"",sub_district:"",tax_id:"",default_invoice:"Y",branch_id:"",branch_name:"",branch_type:""}),$t=z({tax_type:"Personal",role_user:"",name:"",email:"",address:"",postal_code:"",province:"",district:"",sub_district:"",tax_id:"",default_invoice:"",branch_id:"",branch_name:""}),T=z({id:"",user_id:"",order_number:"",email:"",first_name:"",last_name:"",detail:"",house_no:"",room_no:"",floor:"",building_name:"",moo_ban:"",moo_no:"",soi:"",yaek:"",street:"",sub_district:"",district:"",province:"",zipcode:"",phone:"",note_address:"",default_address:"",service_id:"",status:"",country:"",country_code:"",city:"",state:"",premises:"",addition:""}),Pt=z({id:"",user_id:"",order_number:"",email:"",first_name:"",last_name:"",detail:"",house_no:"",room_no:"",floor:"",building_name:"",moo_ban:"",moo_no:"",soi:"",yaek:"",street:"",sub_district:"",district:"",province:"",zipcode:"",phone:"",note_address:"",default_address:"",service_id:"",status:""});we(async()=>{u.changeStateLoading(!0),await Rt(),u.changeStateLoading(!1)});async function Rt(){await d.loadListAddressTax(),Ft.value=d.getListAddressTax||[],Ft.value.length>0&&(N.value.tax_type==="Business"?(vt.value=N.value.name,yt.value=""):[vt.value,yt.value=""]=N.value.name.split(" "),N.value.branch_id==="00000"?N.value.branch_type="head_office":N.value.branch_type||(N.value.branch_type="branch"))}const ft=lt(()=>{const K=new Set;return St.value.filter(g=>K.has(g.name_th)?!1:(K.add(g.name_th),!0))});function F(){N.value.sub_district="",N.value.postal_code="",wt.value=d.originalAmphures.find(K=>K.name_th===N.value.district)?.id,St.value=d.originalTambon.filter(K=>K.amphure_id===wt.value)}function R(){ut.value=d.originalTambon.filter(K=>K.name_th===N.value.sub_district&&K.amphure_id===wt.value)}function kt(){}function qt(){N.value.district="",N.value.sub_district="",N.value.postal_code="";let K=d.getProvince.find(g=>g.name_th===N.value.province)?.id;Tt.value=d.originalAmphures.filter(g=>g.province_id===K)}const It=lt(()=>[...q.value].sort((K,g)=>g.setDefault-K.setDefault)),he=async()=>{I.value=!1,d.payload.address[0]=T.value;const K=await d.loadDeleteUserAddress();await r.loadUserAllAddress(),K?.code===200?O.value=!1:u.openErrorAPIModal(s("error")+` ${K?.message}`),u.changeStateLoading(!1)},Q=async()=>{u.changeStateLoading(!0),w.value=!1;const K=await d.loadDeleteAddressTax(N.value.id);await Rt(),K?.code===200?G.value=!1:u.openErrorAPIModal(s("error")+` ${K?.message}`),u.changeStateLoading(!1)},E=async()=>{u.changeStateLoading(!0),U.value===!0?(T.value.default_address="Y",console.log("Y Case :>> ")):(T.value.default_address="N",console.log("N Case :>> ")),d.payload.address[0]=T.value,d.payload.address[0].zip_code=ot.value!=null?String(ot.value):"",l.international?(d.payload.address[0].province=pt.value,d.payload.address[0].district=D.value,d.payload.address[0].sub_district=
3Mt.value):(d.payload.address[0].province=d.getProvince.find(g=>g.name_th===pt.value||g.name_en===pt.value)?.name_th,d.payload.address[0].district=d.originalAmphures.find(g=>g.name_th===D.value||g.name_en===D.value)?.name_th,d.payload.address[0].sub_district=d.originalTambon.find(g=>g.name_th===Mt.value||g.name_en===Mt.value)?.name_th),l.international&&(d.payload.address[0].country=P.value.name,d.payload.address[0].country_code=P.value.iso,d.payload.address[0].country_code==="TH"&&(d.payload.address[0].state=d.payload.address[0].province,d.payload.address[0].city=d.payload.address[0].district));let K=null;T.value.id!==""?K=await d.loadUpdateUserAddress():K=await d.loadCreateUserAddress(),await r.loadUserAllAddress(),K?.code===200&&(O.value=!1),oe(),U.value=!1,u.changeStateLoading(!1)},mt=()=>{Ke.value=!1,T.value={...Pt.value},U.value=!1,pt.value=null,D.value=null,Mt.value=null,ot.value=null,Y.value=d.getProvince,et.value=d.getAmphures,ht.value=st.value,O.value=!O.value,Jo({iso:"TH",code:"+66",name:"Thailand"}),window.scrollTo({top:0,behavior:"smooth"})},Zt=async()=>{G.value=!G.value,N.value={...$t.value},vt.value="",yt.value="",B.value=!1,window.scrollTo({top:0,behavior:"smooth"})},Oe=()=>{T.value.house_no="",T.value.room_no="",T.value.floor="",T.value.building_name="",T.value.moo_ban="",T.value.moo_no="",T.value.soi="",T.value.yaek="",T.value.street="",T.value.phone="",T.value.city="",T.value.state="",T.value.premises="",T.value.addition="",pt.value=null,ct.value=null,D.value=null,dt.value=null,Mt.value=null,ot.value=null},ve=()=>{D.value=null,Mt.value=null,ot.value=null,ct.value=d.getProvince.find(K=>K.name_th===pt.value||K.name_en===pt.value)?.id,et.value=ct.value?d.originalAmphures.filter(K=>K.province_id===ct.value):d.originalAmphures},qo=()=>{Mt.value=null,ot.value=null,dt.value=d.originalAmphures.find(K=>K.name_th===D.value||K.name_en===D.value)?.id,ht.value=dt.value?d.originalTambon.filter(K=>K.amphure_id===dt.value):d.originalTambon},Te=()=>{ot.value=null};function go(K){const g=K.target.value.replace(/\D/g,"");N.value.tax_id=g.slice(0,13)}const Zo=lt(()=>{if(!ht.value)return[];const K=new Set;return ht.value.filter(g=>K.has(l.international?g.name_en:g.name_th)?!1:(K.add(l.international?g.name_en:g.name_th),!0))}),Xo=K=>{window.scrollTo({top:0,behavior:"smooth"}),N.value={...Ft.value[K]},N.value.tax_type==="Business"?(vt.value=N.value.name,yt.value="",N.value.branch_id=N.value.branch_id==="-"?"":N.value.branch_id):([vt.value,yt.value=""]=N.value.name.split(" "),N.value.branch_id="",N.value.branch_name="");let g=d.getProvince.find(y=>y.name_th===N.value.province)?.id;Tt.value=d.originalAmphures.filter(y=>y.province_id===g),wt.value=d.originalAmphures.find(y=>y.name_th===N.value.district)?.id,St.value=d.originalTambon.filter(y=>y.amphure_id===wt.value),ut.value=d.originalTambon.filter(y=>y.name_th===N.value.sub_district&&y.amphure_id===wt.value),N.value.default_invoice==="Y"?B.value=!0:B.value=!1,G.value=!0},Ke=z(!1),Ko=z(null),bo=z(!1),Xt=lt(()=>Ko.value?JSON.stringify(T.value)!==JSON.stringify(Ko.value):!1),Et=()=>{Ke.value&&Xt.value?bo.value=!0:Ot()},ce=K=>{if(Ke.value=!0,window.scrollTo({top:0,behavior:"smooth"}),T.value={...q.value[K]},Ko.value={...q.value[K]},tt.value=!0,O.value=!0,T.value.default_address==="Y"?U.value=!0:U.value=!1,pt.value=T.value.province,D.value=T.value.district,Mt.value=T.value.sub_district,ot.value=T.value.zip_code,Y.value=d.getProvince,ct.value=d.getProvince.find(g=>g.name_th===T.value.province||g.name_en===T.value.province)?.id,et.value=ct.value?d.getAmphures.filter(g=>g.province_id===ct.value):d.getAmphures,dt.value=d.getAmphures.find(g=>g.name_th===T.value.district||g.name_en===T.value.district)?.id,ht.value=dt.value?d.originalTambon.filter(g=>g.amphure_id===dt.value):d.originalTambon,l.international){const g=S.value.find(y=>y.iso===T.value.country_code).code;P.value={iso:T.value.country_code,code:g,name:T.value.country}}},Nt=K=>`w-full text-[#343434] placeholder:text-[#D1D1D1] border rounded-full focus:border-transparent px-4 text-base py-2 focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] ${K?"border-gray-300":"border-red-400"}`,qe=K=>`w-full text-[#343434] border rounded-full focus:border-transparent px-4 text-base py-2 focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] ${K?"border-gray-300":"border-red-400 "}`,ds=K=>{T.value.last_name=K.target.value.replace(/[0-9]/g,"")},rt=We({phone:"",email:"",first_name:"",last_name:"",tax_id:"",address:"",province:"",district:"",sub_district:"",zip_code:"",country:"",city:"",state:"",premises:"",branch_id:""}),lo=K=>{const g=K.key;if(g.charCodeAt(0)===3647){K.preventDefault();return}(N.value.tax_type==="Personal"?/^[ก-ฮะ-ๅ่-๋็์a-zA-Z\s]$/:/^[ก-ฮะ-ๅ่-๋็์a-zA-Z\s().]$/).test(g)||K.preventDefault()};pe(()=>N.value.tax_type,K=>{K==="Personal"&&(vt.value=vt.value.replace(/[().]/g,""),yt.value=yt.value.replace(/[().]/g,""),rt.branch_id="")}),pe(()=>N.value.branch_id,K=>
3{if(K==="00000"){N.value.branch_type="head_office";return}N.value.tax_type==="Business"&&K&&N.value.branch_type!=="branch"&&(N.value.branch_type="branch")}),pe(()=>N.value.branch_type,K=>{if(K==="head_office"){N.value.branch_id="00000",N.value.branch_name="สำนักงานใหญ่";return}K==="branch"&&N.value.branch_id==="00000"&&(N.value.branch_id=""),K==="branch"&&N.value.branch_name==="สำนักงานใหญ่"&&(N.value.branch_name="")});const Jt=K=>{K.target.value=K.target.value.replace(/[ก-ฮะ-์]/g,""),T.value.email=K.target.value,T.value.email.endsWith(".xn--com-1pl")&&(T.value.email=T.value.email.replace(/\.xn--com-1pl$/i,".com"),K.target.value=T.value.email);const g=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,y=T.value.email;y?g.test(y)?rt.email="":rt.email="invalid_email_format":rt.email="please_enter_email",Yt()},Be=z(!1),ro=z(!1),xo=K=>{const g={"๐":"0","๑":"1","๒":"2","๓":"3","๔":"4","๕":"5","๖":"6","๗":"7","๘":"8","๙":"9"};return K.replace(/[๐-๙]/g,y=>g[y]).replace(/[^0-9-]/g,"")},Ge=K=>{const g={"๐":"0","๑":"1","๒":"2","๓":"3","๔":"4","๕":"5","๖":"6","๗":"7","๘":"8","๙":"9"};return K.replace(/[๐-๙]/g,y=>g[y]).replace(/[^0-9/-]/g,"")};function Yt(K){Be.value=Us(K)}function ge(K){ro.value=Qe(K)}function Vt(){const K=q.value.find(g=>g.default_address==="Y");if(Z.value===!0){if(N.value.role_user="ext_buyer",N.value.default_invoice="N",K){vt.value=M.value==="th"?K.first_name:K.first_name_en||K.first_name,yt.value=M.value==="th"?K.last_name:K.last_name_en||K.last_name,N.value.email=K.email,N.value.tax_type==="Personal"?N.value.name=vt.value+" "+yt.value:N.value.name=vt.value,N.value.address=K.detail,N.value.province=K.province,N.value.district=K.district,N.value.sub_district=K.sub_district,N.value.postal_code=K.zip_code;let g=d.getProvince.find(y=>y.name_th===N.value.province)?.id;Tt.value=d.originalAmphures.filter(y=>y.province_id===g),wt.value=d.originalAmphures.find(y=>y.name_th===N.value.district)?.id,St.value=d.originalTambon.filter(y=>y.amphure_id===wt.value),ut.value=d.originalTambon.filter(y=>y.name_th===N.value.sub_district&&y.amphure_id===wt.value)}ge("first_name"),ge("last_name"),ge("address"),ge("province"),ge("district"),ge("sub_district"),ge("zip_code")}else N.value={...$t.value},vt.value="",yt.value=""}function Ot(){O.value=!1,oe()}function oe(){bo.value=!1,ko.value=!1,tt.value=!1,Be.value=!1,rt.phone="",rt.email="",rt.first_name="",rt.last_name="",rt.address="",rt.province="",rt.district="",rt.sub_district="",rt.zip_code=null,rt.house_no="",rt.tax_id="",rt.branch_id="",N.value={...$t.value},vt.value="",yt.value="",wt.value=null,Z.value=!1,B.value=!1}function Us(K){rt.province="",rt.district="",rt.sub_district="",rt.zip_code=null;const g=/^0/,y=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;K==="phone"&&!l.international?T.value.phone?/^\d+$/.test(T.value.phone)?g.test(T.value.phone)?T.value.phone.length<9||T.value.phone.length>10?rt.phone="please_add_number_nine_or_ten_digits":rt.phone="":rt.phone="phone_number_begin_with_zero":rt.phone="number_only":rt.phone="please_enter_phone":K==="phone"&&l.international&&P.value.iso==="TH"?T.value.phone?/^\d+$/.test(T.value.phone)?g.test(T.value.phone)?T.value.phone.length<9||T.value.phone.length>10?rt.phone="please_add_number_nine_or_ten_digits":rt.phone="":rt.phone="phone_number_begin_with_zero":rt.phone="number_only":rt.phone="please_enter_phone":K==="phone"&&l.international&&P.value.iso!=="TH"&&(T.value.phone?/^\d+$/.test(T.value.phone)?rt.phone="":rt.phone="number_only":rt.phone="please_enter_phone"),K==="email"&&(y.test(T.value.email)?rt.email="":rt.email="please_enter_email"),K==="first_name"&&(T.value.first_name?.trim()?l.international&&/[ก-๙]/.test(T.value.first_name)?rt.first_name="eng_only":rt.first_name="":rt.first_name="please_enter_name"),K==="last_name"&&(T.value.last_name?.trim()?l.international&&/[ก-๙]/.test(T.value.last_name)?rt.last_name="eng_only":rt.last_name="":rt.last_name="please_enter_last_name"),K==="house_no"&&(T.value.house_no?.trim()?rt.house_no="":rt.house_no="please_enter_house_number"),K==="province"&&(pt.value?rt.province="":rt.province="please_select_province"),K==="district"&&(D.value?rt.district="":rt.district="please_select_district"),K==="sub_district"&&(Mt.value?rt.sub_district="":rt.sub_district="please_select_sub_district"),K==="zip_code"&&(ot.value?rt.z
3ip_code="":rt.zip_code="please_select_postal_code"),K==="country"&&(P.value.iso?.trim()?rt.country="":rt.country="please_select_country"),K==="city"&&(T.value.city?.trim()?rt.city="":rt.city="please_select_city"),K==="state"&&(T.value.state?.trim()?rt.state="":rt.state="please_select_state"),K==="premises"&&(T.value.premises?.trim()?rt.premises="":rt.premises="please_enter_premises");const Ut=T.value.first_name?.trim()&&T.value.last_name?.trim()&&T.value.phone?.trim()&&T.value.email?.trim()&&(T.value.house_no?.trim()||T.value.premises?.trim())&&(pt.value||P.value.iso?.trim())&&(D.value||T.value.state?.trim())&&(Mt.value||T.value.city?.trim())&&ot.value;return Object.values(rt).every(le=>!le)&&!!Ut}async function Cs(){Z.value=!1,N.value.postal_code=String(N.value.postal_code),N.value.tax_type==="Personal"?(N.value.name=vt.value+" "+yt.value,N.value.branch_id="",N.value.branch_name=""):N.value.name=vt.value,d.payload.required_invoice="yes",B.value===!0?N.value.default_invoice="Y":N.value.default_invoice="N",N.value.id?await Ms():await Go()}async function Go(){const K=await d.loadCreateAddressTax(N.value);await Rt(),Ot(),K?.code===200?G.value=!1:u.openErrorAPIModal(s("error")+` ${K?.message}`)}async function Ms(){const K=await d.loadUpdateAddressTax(N.value);await Rt(),Ot(),K?.code===200?G.value=!1:u.openErrorAPIModal(s("error")+` ${K?.message}`)}function Qe(K){K==="email"&&(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(N.value.email)?rt.email="":rt.email="please_enter_email"),K==="first_name"&&(vt.value?.trim()?rt.first_name="":rt.first_name="please_enter_name"),N.value.tax_type==="Personal"?K==="last_name"&&(yt.value?.trim()?rt.last_name="":rt.last_name="please_enter_last_name"):N.value.tax_type==="Business"&&K==="branch_id"&&(N.value.branch_id?rt.branch_id="":rt.branch_id="please_enter_branch_id"),K==="tax_id"&&(N.value.tax_id?.trim()?rt.tax_id="":rt.tax_id="please_enter_tax_id"),K==="address"&&(N.value.address?.trim()?rt.address="":rt.address="please_enter_billing_address"),K==="province"&&(N.value.province?rt.province="":rt.province="please_select_province"),K==="district"&&(N.value.district?rt.district="":rt.district="please_select_district"),K==="sub_district"&&(N.value.sub_district?rt.sub_district="":rt.sub_district="please_select_sub_district"),K==="zip_code"&&(N.value.postal_code?rt.zip_code="":rt.zip_code="please_select_postal_code");let y={};if(N.value.tax_type==="Personal"){const{name:le,branch_id:ao,branch_name:Je,...co}=N.value;y=co}else if(l.isBranchEtax){const{name:le,branch_name:ao,...Je}=N.value;y=Je}else{const{name:le,branch_id:ao,...Je}=N.value;y=Je}const Ut=Object.values(y).every(le=>typeof le=="string"?le.trim()!=="":le!=="");return Oo.value=Ut&&vt!=="",N.value.role_user="ext_buyer",N.value.tax_type==="Personal"?(N.value.name=vt.value+yt.value,N.value.branch_id="",N.value.branch_name=""):N.value.name=vt.value,N.value.default_invoice===""&&(N.value.default_invoice="N"),Object.values(rt).every(le=>!le)}const Oo=lt(()=>N.value.tax_type==="Personal"?vt.value&&N.value.tax_id&&N.value.email&&N.value.address&&N.value.province&&N.value.district&&N.value.sub_district&&N.value.postal_code:vt.value&&(l.isBranchEtax?N.value.branch_id:!0)&&N.value.tax_id&&N.value.email&&N.value.address&&N.value.province&&N.value.district&&N.value.sub_district&&N.value.postal_code);function Qo(K){return K.replace(/\r\n/g,`
4`).replace(/\n/g,"")}function Ne(K){let g=Qo(K.target.value);Array.from(g).length>An&&(g=Array.from(g).slice(0,An).join("")),T.value.note_address=g}function us(K){let g=Qo(K.target.value);Array.from(g).length>An&&(g=Array.from(g).slice(0,An).join("")),N.value.address=g}const Ys=K=>K&&K.normalize("NFC").replace(/([\u0E01-\u0E2E])([\u0E31\u0E34-\u0E37\u0E47-\u0E4E]+)/g,(g,y,Ut)=>{const le=[];for(const ao of Ut)if(le.includes(ao)||le.push(ao),le.length===2)break;return y+le.join("")}),Ss=K=>{if(!K)return"";const g={GB:"GB-UKM",BQ:"BQ-BO"},y=K.toUpperCase();return`flags/s/${g[y]||y}.svg`},Jo=K=>{P.value=K,v.value=!1},yo=(K,g)=>{const y=S.value.find(Je=>Je.iso===g);if(!y)return console.warn(`ไม่พบรหัสประเทศสำหรับ ISO: ${g}`),K;const Ut=y.code;let le=K;return le.startsWith("0")&&(le=le.slice(1)),(Ut.startsWith("+")?Ut:`+${Ut}`)+le},_e=K=>{if(!K)return"";const g=d.getProvince.find(y=>y.name_th===K||y.name_en===K);return g?M.value==="th"?g.name_th:g.name_en:K},wo=K=>{if(!K)return"";const g=d.originalAmphures.find(y=>y.name_th===K||y.name_en===K);return g?M.value==="th"?g.name_th:g.name_en:K},ts=K=>{if(!K)return"";const g=d.originalTambon.find(y=>y.name_th===K||y.name_en===K);return g?M.value==="th"?g.name_th:g.name_en:K},Bo=K=>K?K.replace(/[^a-zA-Z0-9\s-]/g,""):"",ko=z(!1);function Dt(){const K=Object.values(T.value).some(g=>g!=null&&String(g).trim()!=="");K&&!Ke.value?ko.value=!0:K&&Ke.value&&Xt.value?bo.value=!0:Ot()}const hs=K=>K?K.replace(/[^\x20-\x7E]/g,""):"",be=K=>{N.value.branch_id=K.target.value.replace(/\D/g,"")},jt=K=>{N.value.branch_name=K.target.value};return(K,g)=>
4(p(),f(at,null,[!O.value&&!G.value?(p(),f("div",$h,[i("div",Ch,[i("div",Mh,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:g[0]||(g[0]=y=>a.value=!1)},[...g[143]||(g[143]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("h1",Sh,[gt(c(n(s)("shipping_address"))+" ",1),i("span",null,c(It.value.length)+" / 5",1)])]),i("div",Dh,[i("h4",{class:"text-lg font-semibold cursor-pointer",onClick:g[1]||(g[1]=y=>O.value=!1)}),It.value.length<5?(p(),f("button",{key:0,onClick:mt,class:"hover:underline cursor-pointer text-xs md:text-sm xl:!text-base font-bold underline underline-offset-6",style:b({color:n(l).color})},c(O.value?n(s)("back"):n(s)("add_address")),5)):C("",!0)])]),It.value.length<1?(p(),f("div",Ah,[i("div",zh,[(p(),f("svg",{style:b(`color:${n(h)}`),class:"h-20 w-20",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...g[144]||(g[144]=[i("path",{d:"M29.561 49.0834C26.4347 51.6525 24 53 24 53C24 53 5 42.4839 5 24.2C5 13.5961 13.5066 5 24 5C34.4934 5 43 13.5961 43 24.2C43 26.2304 42.7657 28.165 42.3491 30M31.6 24.2C31.6 28.4415 28.1974 31.88 24 31.88C19.8026 31.88 16.4 28.4415 16.4 24.2C16.4 19.9585 19.8026 16.52 24 16.52C28.1974 16.52 31.6 19.9585 31.6 24.2Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),i("path",{d:"M50.793 38.6416V54.273L45.4662 54.2734M45.4662 54.2734H35.406M45.4662 54.2734V45.2664H35.406V54.2734M35.406 54.2734H29.8828V46.4575V38.6416",stroke:"currentColor","stroke-width":"2","stroke-miterlimit":"10"},null,-1),i("path",{d:"M54.0018 41.5391L42.2624 30.6164L40.3368 28.8248L26.6719 41.5391",stroke:"currentColor","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square"},null,-1)])],4))]),i("div",jh,c(n(s)("no_shipping_address_yet")),1)])):(p(),f("div",Th,[It.value.length>0?(p(),f("div",Ph,[(p(!0),f(at,null,xt(It.value,(y,Ut)=>(p(),f("div",{key:Ut,class:"relative border p-4 rounded-lg overflow-hidden",style:b({border:`1px solid ${n(h)}`,backgroundColor:y.default_address==="Y"?n(l).bg_color2:K.bg_white})},[i("div",Lh,[i("div",Rh,[i("span",{class:"block truncate max-w-full",title:y.first_name+" "+y.last_name},c(y.first_name)+" "+c(y.last_name),9,Oh),y.phone?(p(),f("span",Bh," | "+c(n(l).international?yo(y.phone,y.country_code):y.phone),1)):C("",!0)]),i("button",{class:J(["hidden md:block text-sm hover:underline cursor-pointer rounded-3xl px-2 py-1 !text-[12px] bg-white max-h-[27.14px] ml-2",y.default_address==="Y"?"black":"white"]),onClick:le=>ce(Ut),style:b({border:`1px solid ${n(h)}`,color:n(h)})},c(n(s)("edit")),15,Eh)]),g[145]||(g[145]=i("div",{class:"block md:hidden w-full h-[1px] bg-[#D1D1D1] my-4"},null,-1)),y.email?(p(),f("div",Fh,c(y.email),1)):C("",!0),n(l).international?(p(),f("div",Ih,[y.house_no!=="-"?(p(),f("span",Nh,"House Number (No.) "+c(y.house_no),1)):C("",!0),y.room_no!=="-"?(p(),f("span",Hh," Room / Unit "+c(y.room_no),1)):C("",!0),y.floor!=="-"?(p(),f("span",Vh," Floor / Level "+c(y.floor)+" ",1)):C("",!0),y.building_name!=="-"?(p(),f("span",Wh," Building "+c(y.building_name)+" ",1)):C("",!0),y.moo_ban!=="-"?(p(),f("span",Uh," Village / Housing Estate "+c(y.moo_ban)+" ",1)):C("",!0),y.moo_no!=="-"?(p(),f("span",Yh," Village No. "+c(y.moo_no)+" ",1)):C("",!0),y.soi!=="-"?(p(),f("span",qh," Soi / Alley / Lane "+c(y.soi)+" ",1)):C("",!0),y.yaek!=="-"?(p(),f("span",Zh," Intersection "+c(y.yaek)+" ",1)):C("",!0),y.street!=="-"?(p(),f("span",Xh," Road / Street (Rd. / St.) "+c(y.street)+" ",1)):C("",!0),y.premises&&y.country_code!=="TH"?(p(),f("span",Kh,c(y.premises)+" ",1)):C("",!0),y.addition&&y.country_code!=="TH"?(p(),f("span",Gh,c(y.addition)+" ",1)):C("",!0),y.country_code==="TH"&&y.sub_district?(p(),f("span",Qh,c(y.sub_district)+" ",1)):C("",!0),y.city?(p(),f("span",Jh,c(y.city)+" ",1)):C("",!0),y.state?(p(),f("span",tp,c(y.state)+" ",1)):C("",!0),y.zip_code?(p(),f("span",ep,c(y.zip_code)+" ",1)):C("",!0),y.country?(p(),f("span",op,c(y.country)+" ",1)):C("",!0)])):n(l).international?C("",!0):(p(),f("div",sp,c(y.house_no)+" "+c(y.room_no?` ${n(s)("room_unit")} `+y.room_no:"")+" "+c(y.floor?` ${n(s)("floor_level")} `+y.floor:"")+" "+c(y.building_name?` ${n(s)("building")} `+y.building_name:"")+" "+c(y.moo_ban?` ${n(s)("village")} `+y.moo_ban:"")+" "+c(y.moo_no?` ${n(s)("village_no")} `+y.moo_no:"")+" "+c(y.soi?` ${n(s)("soi_alley")} `+y.soi:"")+" "+c(y.yaek?` ${n(s)("intersection")} `+y.yaek:"")+" "+c(y.street?` ${n(s)("road_street")} `+y.street:"")+" "+c(y.sub_district?` ${y.province==="กรุงเทพมหานคร"||y.province==="Bangkok"?n(s)("kweang"):n(s)("tumbon")}`+ts(y.sub_district):"")+" "+c(y.district?` ${y.province==="กรุงเทพมหานคร"||y.province==="Bangkok"?n(s)("ked"):n(s)("ampear")}`+wo(y.district):"")+" "+c(y.province?n(s)("province")+_e(y.province):"")+" "+c(y.zip_code?" "+y.zip_code:""),1)),y.note_address?(p(),f("div",np,[i("p",ip,c(n(s)("note"))+" : ",1),i("span",lp,c(Ys(y.note_address||n(s)("no_note"))),1)])):C("",!0),y.default_address==="Y"?(p(),f("div",{key:4,class:"mt-4",style:b({color:n(l).color})},c(n(s)("default_settings")),5)):C("",!0),i("button",{class:J(["block md:hidden text-sm hover:underline cursor-pointer rounded-3xl px-2 py-1 !text-[12px] font-bold bg-white max-h-[27.14px] mt-2",y.default_address==="Y"?"black":"white"]),onClick:le=>ce(Ut),style:b({border:`1px solid ${n(h)}`,color:n(h)})},c(n(s)("edit")),15,rp)],4))),128))])):C("",!0)]))])):C("",!0),O.value?(p(),f("div",ap,[i("div",cp,[O.value?(p(),f("h4",{key:0,class:"text-lg font-semibold cursor-pointer flex items-center gap-1",onClick:g[2]||(g[2]=y=>Dt())},[zt(n(Ts),{class:"w-5 h-5 text-gray-700"}),gt(" "+c(Ke.value?n(s)("edit_shipping"):n(s)("add_shipping")),1)])):C("",!0),O.value&&tt.value&&!U.value&&It.value.length>1?(p(),f("button",{key:1,class:"hover:underline font-semibold cursor-pointer",style:b({color:n(l).color}),onClick:g[3]||(g[3]=y=>I.value=!0)},c(n(s)("delete_address")),5)):C("",!0),O.value?C("",!0):(p(),f("h4",dp,c(n(s)("shipping_address")),1))]),i("div",up,[i("label",hp,[bt(i("input",{"onUpdate:modelValue":g[4]||(g[4]=y=>U.value=y),type:"checkbox",class:"peer absolute w-full h-full opacity-0 z-10 cursor-pointer",onClick:Yt},null,512),[[Rs,U.value]]),i("div",{class:"w-full h-full rounded-[6px] border flex items-center justify-center",style:b(U.value?{backgroundColor:n(l).colorcheckbox,borderColor:n(l).colorcheckbox}:{backgroundColor:"white",borderColor:n(l).colorcheckbox})},[bt((p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3.5","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4",style:b({color:n(l).white})},[...g[146]||(g[146]=[i("polyline",{points:"20 6 9 17 4 12"},null,-1)])],4)),[[Ie,U.value]])],4)]),gt(" "+c(n(s)("default_address")),1)]),i("h1",pp,c(n(s)("recipient_information")),1),i("div",fp,[i("div",null,[i("label",null,[gt(c(n(s)("first_name")),1),g[147]||(g[147]=i("span",{class:"text-red-500"}
4," *",-1))]),bt(i("input",{onBlur:g[5]||(g[5]=y=>Yt("first_name")),onKeypress:g[6]||(g[6]=y=>lo(y)),"onUpdate:modelValue":g[7]||(g[7]=y=>T.value.first_name=y),placeholder:n(s)("enter_first_name"),class:J(Nt(!n(rt).first_name)),style:b({"--focus-color":n(l).color})},null,46,_p),[[Lt,T.value.first_name]]),n(rt).first_name?(p(),f("p",mp,c(`${n(s)(n(rt).first_name)}`),1)):C("",!0)]),i("div",null,[i("label",null,[gt(c(n(s)("last_name")),1),g[148]||(g[148]=i("span",{class:"text-red-500"}," *",-1))]),bt(i("input",{onBlur:g[8]||(g[8]=y=>Yt("last_name")),onInput:ds,onKeypress:g[9]||(g[9]=y=>lo(y)),"onUpdate:modelValue":g[10]||(g[10]=y=>T.value.last_name=y),placeholder:n(s)("enter_last_name"),class:J(Nt(!n(rt).last_name)),style:b({"--focus-color":n(l).color})},null,46,vp),[[Lt,T.value.last_name]]),n(rt).last_name?(p(),f("p",gp,c(`${n(s)(n(rt).last_name)}`),1)):C("",!0)]),i("div",null,[i("label",null,[gt(c(n(s)("phone_number")),1),g[149]||(g[149]=i("span",{class:"text-red-500"}," *",-1))]),n(l).international?n(l).international?(p(),f("div",{key:1,class:"flex items-center h-10 w-full border border-gray-300 rounded-full focus-within:border-transparent focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--focus-color)] bg-white relative",style:b({"--focus-color":n(l).color})},[i("div",xp,[i("button",{type:"button",onClick:g[14]||(g[14]=y=>v.value=!v.value),class:"flex items-center gap-2 h-full px-4 rounded-l-full cursor-pointer hover:bg-gray-50 outline-none"},[i("img",{src:Ss(P.value.iso),alt:"flag",class:"w-6 h-4 object-cover rounded-[2px] shadow-sm"},null,8,yp),i("span",wp,c(P.value.code),1),g[150]||(g[150]=i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))])]),g[151]||(g[151]=i("div",{class:"w-[1px] h-6 bg-gray-300 shrink-0"},null,-1)),bt(i("input",{"onUpdate:modelValue":g[15]||(g[15]=y=>T.value.phone=y),type:"text",maxlength:n(l).international&&P.value.iso!=="TH"?100:10,placeholder:n(s)("enter_phone_number"),onBlur:g[16]||(g[16]=y=>{Yt("phone"),v.value=!1}),onClick:g[17]||(g[17]=y=>v.value=!1),class:"flex-1 h-full px-4 text-base placeholder:text-[#D1D1D1] bg-transparent outline-none rounded-r-full text-[#343434]"},null,40,kp),[[Lt,T.value.phone]]),v.value?(p(),f("div",$p,[(p(!0),f(at,null,xt(S.value,y=>(p(),f("div",{key:y.iso,onClick:Ut=>{Jo(y),Oe()},class:J(["flex items-center gap-3 px-4 py-2 hover:bg-gray-100 cursor-pointer",[P.value.iso===y.iso?"font-bold bg-gray-100":""]])},[i("span",Mp,c(y.name),1),i("span",Sp,"("+c(y.code)+")",1)],10,Cp))),128))])):C("",!0)],4)):C("",!0):bt((p(),f("input",{key:0,onBlur:g[11]||(g[11]=y=>Yt("phone")),onInput:g[12]||(g[12]=y=>T.value.phone=y.target.value.replace(/\D/g,"")),"onUpdate:modelValue":g[13]||(g[13]=y=>T.value.phone=y),placeholder:n(s)("enter_phone_number"),class:J(Nt(!n(rt).phone)),style:b({"--focus-color":n(l).color}),maxlength:"10"},null,46,bp)),[[Lt,T.value.phone]]),n(rt).phone?(p(),f("p",Dp,c(`${n(s)(n(rt).phone)}`),1)):C("",!0)]),i("div",null,[i("label",null,[gt(c(n(s)("email")),1),g[152]||(g[152]=i("span",{class:"text-red-500"}," *",-1))]),bt(i("input",{onBlur:g[18]||(g[18]=y=>Yt("email")),onInput:Jt,"onUpdate:modelValue":g[19]||(g[19]=y=>T.value.email=y),placeholder:n(s)("enter_email"),class:J(Nt(!n(rt).email)),style:b({"--focus-color":n(l).color})},null,46,Ap),[[Lt,T.value.email]]),n(rt).email?(p(),f("p",zp,c(`${n(s)(n(rt).email)}`),1)):C("",!0)])]),i("h1",jp,c(n(s)("address")),1),n(l).international?n(l).international?(p(),f("div",uf,[i("div",hf,[i("div",pf,[i("label",null,[gt(c(n(s)("country")),1),g[162]||(g[162]=i("span",{class:"text-red-500"}," *",-1))]),i("div",ff,[bt(i("select",{class:J([[qe(!n(rt).country),P.value.iso===""?"text-[#D1D1D1]":""],"appearance-none pl-4 pr-10"]),style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[50]||(g[50]=y=>P.value=y),onChange:g[51]||(g[51]=y=>Oe()),onBlur:g[52]||(g[52]=y=>Yt("country"))},[i("option",_f,c(n(s)("enter_country")),1),(p(!0),f(at,null,xt(S.value,y=>(p(),f("option",{key:y.iso,value:y,class:J(["text-[#343434]",[P.value.iso===y.iso?"font-bold":""]])},c(y.name),11,mf))),128))],38),[[De,P.value]]),g[163]||(g[163]=i("div",{class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"},[i("svg",{class:"w-5 h-5 text-[#343434]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))]),n(rt).country?(p(),f("p",vf,c(`${n(s)(n(rt).country)}`),1)):C("",!0)]),P.value.iso==="TH"?(p(),f("div",gf,[i("label",null,[gt(c(n(s)("province")),1),g[164]||(g[164]=i("span",{class:"text-red-500"}," *",-1))]),i("div",bf,[bt(i("select",{class:J([[qe(!n(rt).province),pt.value===null?"text-[#D1D1D1
4]":""],"appearance-none pl-4 pr-10"]),style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[53]||(g[53]=y=>pt.value=y),onChange:ve,onBlur:g[54]||(g[54]=y=>Yt("province"))},[i("option",xf,c(n(s)("enter_province")),1),(p(!0),f(at,null,xt(Y.value,y=>(p(),f("option",{key:y.id,value:y.name_en,class:"text-[#343434]"},c(y.name_en),9,yf))),128))],38),[[De,pt.value]]),g[165]||(g[165]=i("div",{class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"},[i("svg",{class:"w-5 h-5 text-[#343434]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))]),n(rt).province?(p(),f("p",wf,c(`${n(s)(n(rt).province)}`),1)):C("",!0)])):C("",!0),P.value.iso==="TH"?(p(),f("div",kf,[i("label",null,[gt(c(n(s)("district_city")),1),g[166]||(g[166]=i("span",{class:"text-red-500"}," *",-1))]),i("div",$f,[bt(i("select",{class:J([[qe(!n(rt).district),D.value===null?"text-[#D1D1D1]":""],"disabled:bg-gray-100 appearance-none pl-4 pr-10"]),style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[55]||(g[55]=y=>D.value=y),onChange:qo,disabled:pt.value===null,onBlur:g[56]||(g[56]=y=>Yt("district"))},[i("option",Mf,c(n(s)("enter_district_city")),1),(p(!0),f(at,null,xt(et.value,y=>(p(),f("option",{key:y.id,value:y.name_en,class:"text-[#343434]"},c(y.name_en),9,Sf))),128))],46,Cf),[[De,D.value]]),g[167]||(g[167]=i("div",{class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"},[i("svg",{class:"w-5 h-5 text-[#343434]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))]),n(rt).district?(p(),f("p",Df,c(`${n(s)(n(rt).district)}`),1)):C("",!0)])):C("",!0),P.value.iso==="TH"?(p(),f("div",Af,[i("label",null,[gt(c(n(s)("sub_district")),1),g[168]||(g[168]=i("span",{class:"text-red-500"}," *",-1))]),i("div",zf,[bt(i("select",{onBlur:g[57]||(g[57]=y=>Yt("sub_district")),class:J([[qe(!n(rt).sub_district),Mt.value===null?"text-[#D1D1D1]":""],"disabled:bg-gray-100 appearance-none pl-4 pr-10"]),style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[58]||(g[58]=y=>Mt.value=y),onChange:Te,disabled:D.value===null},[i("option",Tf,c(n(s)("enter_sub_district")),1),(p(!0),f(at,null,xt(Zo.value,y=>(p(),f("option",{key:y.id,value:y.name_en,class:"text-[#343434]"},c(y.name_en),9,Pf))),128))],46,jf),[[De,Mt.value]]),g[169]||(g[169]=i("div",{class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"},[i("svg",{class:"w-5 h-5 text-[#343434]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))]),n(rt).sub_district?(p(),f("p",Lf,c(`${n(s)(n(rt).sub_district)}`),1)):C("",!0)])):C("",!0),P.value.iso!=="TH"?(p(),f("div",Rf,[i("label",Of,[gt(c(n(s)("city")),1),g[170]||(g[170]=i("span",{class:"text-red-500"}," *",-1))]),bt(i("input",{"onUpdate:modelValue":g[59]||(g[59]=y=>T.value.city=y),type:"text",placeholder:n(s)("enter_city"),onBlur:g[60]||(g[60]=y=>Yt("city")),class:"h-10 w-full placeholder:text-[#D1D1D1] px-4 text-base py-1.5 border border-gray-300 rounded-full focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(l).color})},null,44,Bf),[[Lt,T.value.city]]),n(rt).city?(p(),f("p",Ef,c(`${n(s)(n(rt).city)}`),1)):C("",!0)])):C("",!0),P.value.iso!=="TH"?(p(),f("div",Ff,[i("label",If,[gt(c(n(s)("state")),1),g[171]||(g[171]=i("span",{class:"text-red-500"}," *",-1))]),bt(i("input",{"onUpdate:modelValue":g[61]||(g[61]=y=>T.value.state=y),type:"text",placeholder:n(s)("enter_state"),onBlur:g[62]||(g[62]=y=>
4Yt("state")),class:"h-10 w-full placeholder:text-[#D1D1D1] px-4 text-base py-1.5 border border-gray-300 rounded-full focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(l).color})},null,44,Nf),[[Lt,T.value.state]]),n(rt).state?(p(),f("p",Hf,c(`${n(s)(n(rt).state)}`),1)):C("",!0)])):C("",!0),i("div",{class:J([P.value.iso!=="TH"?"col-span-3":"col-span-3 md:col-span-2"])},[i("label",null,[gt(c(n(s)("postal_code")),1),g[172]||(g[172]=i("span",{class:"text-red-500"}," *",-1))]),P.value.iso==="TH"?(p(),f("div",Vf,[bt(i("select",{onBlur:g[63]||(g[63]=y=>Yt("zip_code")),class:J([[qe(!n(rt).zip_code),ot.value===null?"text-[#D1D1D1]":""],"disabled:bg-gray-100 appearance-none pl-4 pr-10"]),style:b({"--focus-color":n(l).color}),disabled:Mt.value===null,"onUpdate:modelValue":g[64]||(g[64]=y=>ot.value=y)},[i("option",Uf,c(n(s)("select_postal_code")),1),(p(!0),f(at,null,xt(W.value,y=>(p(),f("option",{key:y.zip_code,value:y.zip_code,class:"text-[#343434]"},c(y.zip_code),9,Yf))),128))],46,Wf),[[De,ot.value]]),g[173]||(g[173]=i("div",{class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"},[i("svg",{class:"w-5 h-5 text-[#343434]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))])):P.value.iso!=="TH"?(p(),f("div",qf,[bt(i("input",{"onUpdate:modelValue":g[65]||(g[65]=y=>ot.value=y),type:"text",placeholder:n(s)("enter_postal_code"),onBlur:g[66]||(g[66]=y=>Yt("zip_code")),onChange:g[67]||(g[67]=y=>T.value.zipcode=ot.value),class:"h-10 w-full placeholder:text-[#D1D1D1] px-4 text-base py-1.5 border border-gray-300 rounded-full focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(l).color})},null,44,Zf),[[Lt,ot.value]])])):C("",!0),n(rt).zip_code?(p(),f("p",Xf,c(`${n(s)(n(rt).zip_code)}`),1)):C("",!0)],2)])])):C("",!0):(p(),f("div",Tp,[i("div",Pp,[i("div",null,[i("label",null,[gt(c(n(s)("house_number")),1),g[153]||(g[153]=i("span",{class:"text-red-500"}," *",-1))]),bt(i("input",{onBlur:g[20]||(g[20]=y=>Yt("house_no")),"onUpdate:modelValue":g[21]||(g[21]=y=>T.value.house_no=y),placeholder:n(s)("enter_house_number"),class:J([Nt(!n(rt).house_no),"placeholder:truncate truncate"]),style:b({"--focus-color":n(l).color}),onInput:g[22]||(g[22]=y=>T.value.house_no=Ge(y.target.value))},null,46,Lp),[[Lt,T.value.house_no]]),n(rt).house_no?(p(),f("p",Rp,c(`${n(s)(n(rt).house_no)}`),1)):C("",!0)]),i("div",null,[i("label",null,c(n(s)("room_unit")),1),bt(i("input",{onBlur:g[23]||(g[23]=y=>Yt()),"onUpdate:modelValue":g[24]||(g[24]=y=>T.value.room_no=y),placeholder:n(s)("enter_room_unit"),class:J([Nt(!0),"placeholder:truncate truncate"]),style:b({"--focus-color":n(l).color}),onInput:g[25]||(g[25]=y=>T.value.room_no=Ge(y.target.value))},null,46,Op),[[Lt,T.value.room_no]])]),i("div",null,[i("label",null,c(n(s)("floor_level")),1),bt(i("input",{onBlur:g[26]||(g[26]=y=>Yt()),"onUpdate:modelValue":g[27]||(g[27]=y=>T.value.floor=y),placeholder:n(s)("enter_floor_level"),class:J([Nt(!0),"placeholder:truncate truncate"]),style:b({"--focus-color":n(l).color}),onInput:g[28]||(g[28]=y=>T.value.floor=Ge(y.target.value))},null,46,Bp),[[Lt,T.value.floor]])]),i("div",null,[i("label",null,c(n(s)("building")),1),bt(i("input",{onBlur:g[29]||(g[29]=y=>Yt()),"onUpdate:modelValue":g[30]||(g[30]=y=>T.value.building_name=y),placeholder:n(s)("enter_building"),class:J([Nt(!0),"placeholder:truncate truncate"]),style:b({"--focus-color":n(l).color})},null,46,Ep),[[Lt,T.value.building_name]])]),i("div",null,[i("label",null,c(n(s)("village")),1),bt(i("input",{onBlur:g[31]||(g[31]=y=>Yt()),"onUpdate:modelValue":g[32]||(g[32]=y=>T.value.moo_ban=y),placeholder:n(s)("enter_village"),class:J([Nt(!0),"placeholder:truncate truncate"]),style:b({"--focus-color":n(l).color})},null,46,Fp),[[Lt,T.value.moo_ban]])]),i("div",null,[i("label",null,c(n(s)("village_no")),1),bt(i("input",{onBlur:g[33]||(g[33]=y=>Yt()),"onUpdate:modelValue":g[34]||(g[34]=y=>T.value.moo_no=y),placeholder:n(s)("enter_village_no"),class:J([Nt(!0),"placeholder:truncate truncate"]),style:b({"--focus-color":n(l).color}),onInput:g[35]||(g[35]=y=>T.value.moo_no=xo(y.target.value))},null,46,Ip),[[Lt,T.value.moo_no]])]),i("div",null,[i("label",null,c(n(s)("soi_alley")),1),bt(i("input",{onBlur:g[36]||(g[36]=y=>Yt()),"onUpdate:modelValue":g[37]||(g[37]=y=>
4T.value.soi=y),placeholder:n(s)("enter_soi_alley"),class:J(Nt(!0)),style:b({"--focus-color":n(l).color})},null,46,Np),[[Lt,T.value.soi]])]),i("div",null,[i("label",null,c(n(s)("intersection")),1),bt(i("input",{onBlur:g[38]||(g[38]=y=>Yt()),"onUpdate:modelValue":g[39]||(g[39]=y=>T.value.yaek=y),placeholder:n(s)("enter_intersection"),class:J([Nt(!0),"placeholder:truncate truncate"]),style:b({"--focus-color":n(l).color})},null,46,Hp),[[Lt,T.value.yaek]])]),i("div",null,[i("label",null,c(n(s)("road_street")),1),bt(i("input",{onBlur:g[40]||(g[40]=y=>Yt()),"onUpdate:modelValue":g[41]||(g[41]=y=>T.value.street=y),placeholder:n(s)("enter_road_street"),class:J([Nt(!0),"placeholder:truncate truncate"]),style:b({"--focus-color":n(l).color})},null,46,Vp),[[Lt,T.value.street]])])]),i("div",Wp,[i("div",null,[i("label",null,[gt(c(n(s)("province")),1),g[154]||(g[154]=i("span",{class:"text-red-500"}," *",-1))]),i("div",Up,[bt(i("select",{class:J([[qe(!n(rt).province),pt.value===null?"text-[#D1D1D1]":""],"appearance-none pl-4 pr-10"]),style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[42]||(g[42]=y=>pt.value=y),onChange:ve,onBlur:g[43]||(g[43]=y=>Yt("province"))},[i("option",Yp,c(n(s)("enter_province")),1),(p(!0),f(at,null,xt(Y.value,y=>(p(),f("option",{key:y.id,value:n(l).international||pt.value===y.name_en?y.name_en:y.name_th,class:"text-[#343434]"},c(n(l).international?y.name_en:n(M)==="th"?y.name_th:y.name_en),9,qp))),128))],38),[[De,pt.value]]),g[155]||(g[155]=i("div",{class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"},[i("svg",{class:"w-5 h-5 text-[#343434]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))]),n(rt).province?(p(),f("p",Zp,c(`${n(s)(n(rt).province)}`),1)):C("",!0)]),i("div",null,[i("label",null,[gt(c(n(s)("district_city")),1),g[156]||(g[156]=i("span",{class:"text-red-500"}," *",-1))]),i("div",Xp,[bt(i("select",{class:J([[qe(!n(rt).district),D.value===null?"text-[#D1D1D1]":""],"disabled:bg-gray-100 appearance-none pl-4 pr-10"]),style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[44]||(g[44]=y=>D.value=y),onChange:qo,disabled:pt.value===null,onBlur:g[45]||(g[45]=y=>Yt("district"))},[i("option",Gp,c(n(s)("enter_district_city")),1),(p(!0),f(at,null,xt(et.value,y=>(p(),f("option",{key:y.id,value:n(l).international||D.value===y.name_en?y.name_en:y.name_th,class:"text-[#343434]"},c(n(l).international?y.name_en:n(M)==="th"?y.name_th:y.name_en),9,Qp))),128))],46,Kp),[[De,D.value]]),g[157]||(g[157]=i("div",{class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"},[i("svg",{class:"w-5 h-5 text-[#343434]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))]),n(rt).district?(p(),f("p",Jp,c(`${n(s)(n(rt).district)}`),1)):C("",!0)]),i("div",null,[i("label",null,[gt(c(n(s)("sub_district")),1),g[158]||(g[158]=i("span",{class:"text-red-500"}," *",-1))]),i("div",tf,[bt(i("select",{onBlur:g[46]||(g[46]=y=>Yt("sub_district")),class:J([[qe(!n(rt).sub_district),Mt.value===null?"text-[#D1D1D1]":""],"disabled:bg-gray-100 appearance-none pl-4 pr-10"]),style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[47]||(g[47]=y=>Mt.value=y),onChange:Te,disabled:D.value===null},[i("option",of,c(n(s)("enter_sub_district")),1),(p(!0),f(at,null,xt(Zo.value,y=>(p(),f("option",{key:y.id,value:n(l).international||Mt.value===y.name_en?y.name_en:y.name_th,class:"text-[#343434]"},c(n(l).international?y.name_en:n(M)==="th"?y.name_th:y.name_en),9,sf))),128))],46,ef),[[De,Mt.value]]),g[159]||(g[159]=i("div",{class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"},[i("svg",{class:"w-5 h-5 text-[#343434]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))]),n(rt).sub_district?(p(),f("p",nf,c(`${n(s)(n(rt).sub_district)}`),1)):C("",!0)]),i("div",null,[i("label",null,[gt(c(n(s)("postal_code")),1),g[160]||(g[160]=i("span",{class:"text-red-500"}," *",-1))]),i("div",lf,[bt(i("select",{onBlur:g[48]||(g[48]=y=>Yt("zip_code")),class:J([[qe(!n(rt).zip_code),ot.value===null?"text-[#D1D1D1
4]":""],"disabled:bg-gray-100 appearance-none pl-4 pr-10"]),style:b({"--focus-color":n(l).color}),disabled:Mt.value===null,"onUpdate:modelValue":g[49]||(g[49]=y=>ot.value=y)},[i("option",af,c(n(s)("select_postal_code")),1),(p(!0),f(at,null,xt(W.value,y=>(p(),f("option",{key:y.zip_code,value:y.zip_code,class:"text-[#343434]"},c(y.zip_code),9,cf))),128))],46,rf),[[De,ot.value]]),g[161]||(g[161]=i("div",{class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"},[i("svg",{class:"w-5 h-5 text-[#343434]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))]),n(rt).zip_code?(p(),f("p",df,c(`${n(s)(n(rt).zip_code)}`),1)):C("",!0)])])])),n(l).international&&P.value.iso==="TH"?(p(),f("div",Kf,[i("div",Gf,[i("div",null,[i("label",null,[gt(c(n(s)("house_number")),1),g[174]||(g[174]=i("span",{class:"text-red-500"}," *",-1))]),bt(i("input",{onBlur:g[68]||(g[68]=y=>Yt("house_no")),"onUpdate:modelValue":g[69]||(g[69]=y=>T.value.house_no=y),placeholder:n(s)("enter_house_number"),class:J(Nt(!n(rt).house_no)),style:b({"--focus-color":n(l).color}),onInput:g[70]||(g[70]=y=>T.value.house_no=Ge(y.target.value))},null,46,Qf),[[Lt,T.value.house_no]]),n(rt).house_no?(p(),f("p",Jf,c(`${n(s)(n(rt).house_no)}`),1)):C("",!0)]),i("div",null,[i("label",null,c(n(s)("room_unit")),1),bt(i("input",{onBlur:g[71]||(g[71]=y=>Yt()),"onUpdate:modelValue":g[72]||(g[72]=y=>T.value.room_no=y),placeholder:n(s)("enter_room_unit"),class:J(Nt(!0)),style:b({"--focus-color":n(l).color}),onInput:g[73]||(g[73]=y=>T.value.room_no=Ge(y.target.value))},null,46,t_),[[Lt,T.value.room_no]])]),i("div",null,[i("label",null,c(n(s)("floor_level")),1),bt(i("input",{onBlur:g[74]||(g[74]=y=>Yt()),"onUpdate:modelValue":g[75]||(g[75]=y=>T.value.floor=y),placeholder:n(s)("enter_floor_level"),class:J(Nt(!0)),style:b({"--focus-color":n(l).color}),onInput:g[76]||(g[76]=y=>T.value.floor=Ge(y.target.value))},null,46,e_),[[Lt,T.value.floor]])]),i("div",null,[i("label",null,c(n(s)("building")),1),bt(i("input",{onInput:g[77]||(g[77]=y=>T.value.building_name=Bo(T.value.building_name)),onBlur:g[78]||(g[78]=y=>Yt()),"onUpdate:modelValue":g[79]||(g[79]=y=>T.value.building_name=y),placeholder:n(s)("enter_building"),class:J(Nt(!0)),style:b({"--focus-color":n(l).color})},null,46,o_),[[Lt,T.value.building_name]])]),i("div",null,[i("label",null,c(n(s)("village")),1),bt(i("input",{onInput:g[80]||(g[80]=y=>T.value.moo_ban=Bo(T.value.moo_ban)),onBlur:g[81]||(g[81]=y=>Yt()),"onUpdate:modelValue":g[82]||(g[82]=y=>T.value.moo_ban=y),placeholder:n(s)("enter_village"),class:J(Nt(!0)),style:b({"--focus-color":n(l).color})},null,46,s_),[[Lt,T.value.moo_ban]])]),i("div",null,[i("label",null,c(n(s)("village_no")),1),bt(i("input",{onBlur:g[83]||(g[83]=y=>Yt()),"onUpdate:modelValue":g[84]||(g[84]=y=>T.value.moo_no=y),placeholder:n(s)("enter_village_no"),class:J(Nt(!0)),style:b({"--focus-color":n(l).color}),onInput:g[85]||(g[85]=y=>T.value.moo_no=xo(y.target.value))},null,46,n_),[[Lt,T.value.moo_no]])]),i("div",null,[i("label",null,c(n(s)("soi_alley")),1),bt(i("input",{onInput:g[86]||(g[86]=y=>T.value.soi=Bo(T.value.soi)),onBlur:g[87]||(g[87]=y=>Yt()),"onUpdate:modelValue":g[88]||(g[88]=y=>T.value.soi=y),placeholder:n(s)("enter_soi_alley"),class:J(Nt(!0)),style:b({"--focus-color":n(l).color})},null,46,i_),[[Lt,T.value.soi]])]),i("div",null,[i("label",null,c(n(s)("intersection")),1),bt(i("input",{onInput:g[89]||(g[89]=y=>T.value.yaek=Bo(T.value.yaek)),onBlur:g[90]||(g[90]=y=>Yt()),"onUpdate:modelValue":g[91]||(g[91]=y=>T.value.yaek=y),placeholder:n(s)("enter_intersection"),class:J(Nt(!0)),style:b({"--focus-color":n(l).color})},null,46,l_),[[Lt,T.value.yaek]])]),i("div",null,[i("label",null,c(n(s)("road_street")),1),bt(i("input",{onBlur:g[92]||(g[92]=y=>Yt()),onInput:g[93]||(g[93]=y=>T.value.street=Bo(T.value.street)),"onUpdate:modelValue":g[94]||(g[94]=y=>T.value.street=y),placeholder:n(s)("enter_road_street"),class:J(Nt(!0)),style:b({"--focus-color":n(l).color})},null,46,r_),[[Lt,T.value.street]])])])])):C("",!0),n(l).international&&P.value.iso!=="TH"?(p(),f("div",a_,[i("div",c_,[i("label",d_,[gt(c(n(s)("address_line1"))+" ",1),g[175]||(g[175]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{"onUpdate:modelValue":g[95]||(g[95]=y=>T.value.premises=y),type:"text",maxlength:"200",placeholder:n(s)("enter_address_line1"),onInput:g[96]||(g[96]=y=>{T.value.premises=hs(y.target.value),y.target.value=T.value.premises}),onBlur:g[97]||(g[97]=y=>
4Yt("premises")),class:"h-10 w-full placeholder:text-[#D1D1D1] px-4 text-base py-1.5 border border-gray-300 rounded-full focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(l).color})},null,44,u_),[[Lt,T.value.premises]]),i("div",h_,c(T.value.premises?.length||0)+"/200",1),n(rt).premises?(p(),f("p",p_,c(`${n(s)(n(rt).premises)}`),1)):C("",!0)]),i("div",f_,[i("label",__,c(n(s)("address_line2")),1),bt(i("input",{"onUpdate:modelValue":g[98]||(g[98]=y=>T.value.addition=y),type:"text",maxlength:"200",placeholder:n(s)("enter_address_line2"),onInput:g[99]||(g[99]=y=>{T.value.addition=hs(y.target.value),y.target.value=T.value.addition}),class:"h-10 w-full placeholder:text-[#D1D1D1] px-4 text-base py-1.5 border border-gray-300 rounded-full focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(l).color})},null,44,m_),[[Lt,T.value.addition]]),i("div",v_,c(T.value.addition?.length||0)+"/200",1)])])):C("",!0),i("div",g_,[i("p",b_,c(n(s)("note")),1),i("div",x_,[bt(i("textarea",{maxlength:"200",onInput:Ne,onBlur:g[100]||(g[100]=y=>Yt()),"onUpdate:modelValue":g[101]||(g[101]=y=>T.value.note_address=y),placeholder:n(s)("note_placeholder"),class:"w-full h-[100px] px-4 pt-4 border border-gray-300 focus:border-[var(--focus-color)] rounded-lg resize-none focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] text-[16px]",style:b({"--focus-color":n(l).color})},null,44,y_),[[Lt,T.value.note_address]]),i("div",w_,c(T.value.note_address?.length)+"/200 ",1)])]),g[176]||(g[176]=i("br",null,null,-1)),g[177]||(g[177]=i("hr",{class:"my-4 border border-gray-300"},null,-1)),i("div",k_,[bt(i("button",{onClick:Et,style:b({color:n(h),border:`1px ${n(h)} solid`}),class:J(["text-white font-semibold w-full md:w-40 h-9 xl:h-10 rounded-3xl bg-white cursor-pointer flex-1 md:flex-none"])},c(n(s)("discard_changes")),5),[[Ie,Ke.value]]),i("button",{onClick:E,style:b({backgroundColor:Be.value?n(l).color:n(x),hover:K.text-K.blue-200}),disabled:!Be.value,class:J(["text-white font-semibold flex-1 md:flex-none md:px-8 py-2 rounded-3xl",Be.value?"hover:text-gray-200 cursor-pointer":"cursor-not-allowed"])},c(n(s)("save")),15,$_)])])):C("",!0),!O.value&&!G.value&&n(l).isInvoice?(p(),f("div",C_,[i("div",M_,[i("h4",S_,c(n(s)("invoice_receipt_issuance")),1),i("div",D_,[i("h4",{class:"text-lg font-semibold cursor-pointer",onClick:g[102]||(g[102]=y=>G.value=!1)}),i("button",{onClick:Zt,class:"text-blue-600 hover:underline"}),i("h4",{class:"text-lg font-semibold cursor-pointer",onClick:g[103]||(g[103]=y=>G.value=!1)}),!G.value&&Ft.value.length<4?(p(),f("button",{key:0,onClick:Zt,class:"hover:underline cursor-pointer text-[14px] xl:text-base font-bold underline underline-offset-6",style:b({color:n(l).color})},c(n(s)("add_information")),5)):C("",!0)])]),Ft.value.length===0?(p(),f("div",A_,[i("div",z_,[(p(),f("svg",{class:"h-20 w-20",style:b(`color:${n(h)}`),viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...g[178]||(g[178]=[rs('<path d="M30.2934 21.7388V13.9764C30.2934 12.3757 28.9956 11.0781 27.3947 11.0781C25.7939 11.0781 24.4961 12.3757 24.4961 13.9764V21.7388" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M24.4961 16.8672H30.2934" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M41.8871 9.51562V12.5169L36.0898 18.7274V21.7288" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M36.0898 9.51562V12.5169L41.8871 18.7274V21.7288" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M11.3477 11.0781H20.2506" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M12.8984 42.4609H41.8847" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M12.8984 36.2578H41.8847" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M41.8847 30.0469H12.8984V48.6782H41.8847V30.0469Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M15.7969 11.0781V21.7387" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M7 51.782V5H47.7878V51.782C47.7878 53.497 49.1782 54.8872 50.8934 54.8872H10.1057C8.39042 54.8872 7 53.497 7 51.782Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M50.8946 54.8922C52.6099 54.8922 54.0003 53.5019 54.0003 51.7869V38.9531H47.7891" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path><path d="M35.6758 30.0469V48.6782" stroke="currentColor" stroke-width="2" stroke-miterlimit="10"></path>',12)])],4))]),i("div",j_,c(n(s)("no_billing_tax_invoice_info_yet")),1)])):(p(),f("div",T_,[(p(!0),f(at,null,xt(Ft.value,(y,Ut)=>(p(),f("div",{key:Ut,class:"relative border p-4 rounded-lg",style:b({border:`1px solid ${n(h)}`,backgroundColor:y.default_invoice==="Y"?n(l).bg_color2:K.bg_white,color:n(l).black})},[i("button",{class:J(["hidden md:block absolute top-2 right-2 hover:underline cursor-pointer px-[8px] py-[5px] rounded-full bg-white",y.default_invoice==="Y"?"black":"white"]),onClick:le=>Xo(Ut),style:b({border:`1px solid ${n(h)}`,color:n(h)})},[i("p",{class:"font-bold text-xs",style:b({color:n(h)})},c(n(s)("edit")),5)],14,P_),i("div",L_,[gt(c(y.name)+" | ",1),y.tax_type==="Personal"?(p(),f("span",R_,c(n(s)("individual")),1)):(p(),f("span",O_,c(n(s)("company")),1
4))]),y.tax_type==="Business"&&n(l).isBranchEtax?(p(),f("div",B_,[i("p",E_,[gt(c(n(s)("branch_id_etax"))+" : "+c(y.branch_id)+" ",1),y.branch_name&&y.branch_name!=="-"?(p(),f("span",F_,"("+c(y.branch_name)+")",1)):C("",!0)])])):C("",!0),i("div",I_,[gt(c(n(s)("tax_identification_number"))+" : ",1),i("span",N_,c(y.tax_id),1)]),i("div",H_,c(y.address)+" "+c(y.province==="กรุงเทพมหานคร"||y.province==="Bangkok"?n(s)("kweang"):n(s)("tumbon"))+c(ts(y.sub_district))+" "+c(y.province==="กรุงเทพมหานคร"||y.province==="Bangkok"?n(s)("ked"):n(s)("ampear"))+c(wo(y.district))+" "+c(n(s)("province"))+c(_e(y.province))+" "+c(y.postal_code),1),y.default_invoice==="Y"?(p(),f("div",{key:1,class:"mt-4",style:b({color:n(l).color})},c(n(s)("default_settings")),5)):C("",!0),i("button",{class:J(["block md:hidden mt-2 hover:underline cursor-pointer px-[8px] py-[5px] rounded-full bg-white",y.default_invoice==="Y"?"black":"white"]),onClick:le=>Xo(Ut),style:b({border:`1px solid ${n(h)}`,color:n(h)})},[i("p",{class:"font-bold text-xs",style:b({color:n(h)})},c(n(s)("edit")),5)],14,V_)],4))),128))]))])):C("",!0),G.value?(p(),f("div",W_,[i("div",U_,[G.value?(p(),f("h4",{key:0,class:"text-lg font-semibold cursor-pointer flex items-center gap-1",onClick:g[104]||(g[104]=y=>{G.value=!1,Ot()})},[zt(n(Ts),{class:"w-5 h-5 text-gray-700"}),gt(" "+c(n(s)("invoice_receipt_issuance")),1)])):C("",!0),N.value.id&&N.value.default_invoice!=="Y"&&!B.value?(p(),f("button",{key:1,class:"hover:underline font-semibold cursor-pointer",style:b({color:n(l).color}),onClick:g[105]||(g[105]=y=>w.value=!0)},c(n(s)("delete_address")),5)):C("",!0)]),i("div",Y_,[N.value.id?C("",!0):(p(),f("label",q_,[bt(i("input",{"onUpdate:modelValue":g[106]||(g[106]=y=>Z.value=y),type:"checkbox",value:"Y",class:"peer absolute w-full h-full opacity-0 z-10 cursor-pointer",onChange:Vt},null,544),[[Rs,Z.value]]),i("div",{class:"w-full h-full rounded-[6px] border flex items-center justify-center",style:b(Z.value?{backgroundColor:n(l).colorcheckbox,borderColor:n(l).colorcheckbox}:{backgroundColor:"white",borderColor:n(l).colorcheckbox})},[bt((p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3.5","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4",style:b({color:n(l).white})},[...g[179]||(g[179]=[i("polyline",{points:"20 6 9 17 4 12"},null,-1)])],4)),[[Ie,Z.value]])],4)])),N.value.id?C("",!0):(p(),f("p",Z_,c(n(s)("same_as_shipping_address")),1))]),i("div",X_,[i("label",K_,[bt(i("input",{"onUpdate:modelValue":g[107]||(g[107]=y=>B.value=y),type:"checkbox",value:"Y",class:"peer absolute w-full h-full opacity-0 z-10 cursor-pointer"},null,512),[[Rs,B.value]]),i("div",{class:"w-full h-full rounded-[6px] border flex items-center justify-center",style:b(B.value?{backgroundColor:n(l).colorcheckbox,borderColor:n(l).colorcheckbox}:{backgroundColor:"white",borderColor:n(l).colorcheckbox})},[bt((p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3.5","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4",style:b({color:n(l).white})},[...g[180]||(g[180]=[i("polyline",{points:"20 6 9 17 4 12"},null,-1)])],4)),[[Ie,B.value]])],4)]),gt(" "+c(n(s)("default_address")),1)]),i("h1",G_,c(n(s)("basic_information")),1),i("div",Q_,[i("div",J_,[bt(i("input",{type:"radio","onUpdate:modelValue":g[108]||(g[108]=y=>N.value.tax_type=y),value:"Personal",class:"appearance-none w-5 h-5 rounded-full border-1 border-gray-300 checked:border-[var(--radio-color)] checked:bg-[var(--radio-color)] bg-transparent bg-clip-content p-[3px] cursor-pointer transition-all duration-200 outline-none",style:b({"--radio-color":n(l).colorcheckbox})},null,4),[[jo,N.value.tax_type]]),gt(" "+c(n(s)("individual")),1)]),i("div",t1,[bt(i("input",{type:"radio","onUpdate:modelValue":g[109]||(g[109]=y=>N.value.tax_type=y),value:"Business",class:"appearance-none w-5 h-5 rounded-full border-1 border-gray-300 checked:border-[var(--radio-color)] checked:bg-[var(--radio-color)] bg-transparent bg-clip-content p-[3px] curs
4or-pointer transition-all duration-200 outline-none",style:b({"--radio-color":n(l).colorcheckbox})},null,4),[[jo,N.value.tax_type]]),gt(" "+c(n(s)("company")),1)])]),i("label",e1,[gt(c(n(s)("name_for_tax_invoice"))+" ",1),g[181]||(g[181]=i("span",{class:"text-red-500"},"*",-1))]),i("div",o1,[i("div",s1,[i("div",n1,[bt(i("input",{placeholder:n(s)("enter_first_name"),onBlur:g[110]||(g[110]=y=>ge("first_name")),onKeypress:g[111]||(g[111]=y=>lo(y)),"onUpdate:modelValue":g[112]||(g[112]=y=>vt.value=y),type:"text",class:J([Nt(!n(rt).first_name),"w-full border px-3 py-2"]),style:b({"--focus-color":n(l).color})},null,46,i1),[[Lt,vt.value]]),n(rt).first_name?(p(),f("p",l1,c(`${n(s)(n(rt).first_name)}`),1)):C("",!0)]),N.value.tax_type==="Personal"?(p(),f("div",r1,[bt(i("input",{placeholder:n(s)("enter_last_name"),onBlur:g[113]||(g[113]=y=>ge("last_name")),onKeypress:g[114]||(g[114]=y=>lo(y)),class:J([Nt(!n(rt).last_name),"w-full border px-3 py-2"]),style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[115]||(g[115]=y=>yt.value=y),type:"text"},null,46,a1),[[Lt,yt.value]]),n(rt).last_name?(p(),f("p",c1,c(`${n(s)(n(rt).last_name)}`),1)):C("",!0)])):C("",!0)]),N.value.tax_type==="Business"&&n(l).isBranchEtax?(p(),f("div",d1,[i("div",u1,[i("div",h1,[bt(i("input",{type:"radio","onUpdate:modelValue":g[116]||(g[116]=y=>N.value.branch_type=y),value:"head_office",class:"appearance-none w-5 h-5 rounded-full border-1 border-gray-300 checked:border-[var(--radio-color)] checked:bg-[var(--radio-color)] bg-transparent bg-clip-content p-[3px] cursor-pointer transition-all duration-200 outline-none",style:b({"--radio-color":n(l).colorcheckbox})},null,4),[[jo,N.value.branch_type]]),gt(" "+c(n(s)("head_office_etax")),1)]),i("div",p1,[bt(i("input",{type:"radio","onUpdate:modelValue":g[117]||(g[117]=y=>N.value.branch_type=y),value:"branch",class:"appearance-none w-5 h-5 rounded-full border-1 border-gray-300 checked:border-[var(--radio-color)] checked:bg-[var(--radio-color)] bg-transparent bg-clip-content p-[3px] cursor-pointer transition-all duration-200 outline-none",style:b({"--radio-color":n(l).colorcheckbox})},null,4),[[jo,N.value.branch_type]]),gt(" "+c(n(s)("branch_etax")),1)])])])):C("",!0),N.value.tax_type==="Business"&&n(l).isBranchEtax?(p(),f("div",f1,[i("div",_1,[i("label",m1,[gt(c(n(s)("branch_id_etax")),1),g[182]||(g[182]=i("span",{class:"text-red-500"},"*",-1))]),i("input",{value:N.value.branch_type==="head_office"?"00000":N.value.branch_id,type:"text",placeholder:n(s)("please_enter_branch_id"),maxlength:"5",onInput:g[118]||(g[118]=y=>(be(y),ge("branch_id"))),onBlur:g[119]||(g[119]=y=>ge("branch_id")),class:J(["w-full px-4 py-2 border border-gray-300 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] rounded-full",[N.value.branch_type!=="head_office"?"border border-gray-300":"border border-[#D1D1D1] bg-[#F6F6F6] text-[#A4A4A4]"]]),style:b({"--focus-color":n(l).color}),disabled:N.value.branch_type=="head_office"},null,46,v1),n(rt).branch_id&&N.value.branch_type!=="head_office"?(p(),f("p",g1,c(`${n(s)(n(rt).branch_id)}`),1)):C("",!0)]),i("div",b1,[i("label",x1,c(n(s)("branch_name_etax")),1),i("input",{value:N.value.branch_type==="head_office"?n(s)("head_office_etax"):N.value.branch_name,type:"text",placeholder:n(s)("please_enter_branch_name"),onInput:g[120]||(g[120]=y=>jt(y)),onBlur:g[121]||(g[121]=y=>ge("branch_name")),class:J(["w-full px-4 py-2 border border-gray-300 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] rounded-full",[N.value.branch_type!=="head_office"?"border border-gray-300":"border border-[#D1D1D1] bg-[#F6F6F6] text-[#A4A4A4]"]]),style:b({"--focus-color":n(l).color}),disabled:N.value.branch_type=="head_office"},null,46,y1)])])):C("",!0),i("div",null,[N.value.tax_type==="Personal"?(p(),f("label",w1,[gt(c(n(s)("tax_identification_number")),1),g[183]||(g[183]=i("span",{class:"text-red-500"}," *",-1))])):(p(),f("label",k1,[gt(c(n(s)("tax_id_number")),1),g[184]||(g[184]=i("span",{class:"text-red-500"}," *",-1))])),bt(i("input",{onInput:go,placeholder:n(s)("enter_tax_id_number"),onBlur:g[122]||(g[122]=y=>ge("tax_id")),class:J([Nt(!n(rt).tax_id),"w-full border rounded-full px-3 py-2"]),style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[123]||(g[123]=y=>N.value.tax_id=y),type:"text"},null,46,$1),[[Lt,N.value.tax_id]]),n(rt).tax_id?(p(),f("p",C1,c(n(s)(n(rt).tax_id)),1)):C("",!0)]),i("div",null,[i("label",null,[gt(c(n(s)("email_for_tax_invoice")),1),g[185]||(g[185]=i("span",{class:"text-red-500"}," *",-1))]),bt(i("input",{placeholder:n(s)("enter_email_for_tax_invoice"),onBlur:g[124]||(g[124]=y=>ge("email")),class:J([Nt(!n(rt).email),"w-full border rounded-full px-3 py-2"]),onInput:Jt,style:b({"--focus-color":n(l).color}),"onUpdate:modelValue":g[125]||(g[125]=y=>N.value.email=y),type:"text"},null,46,M1),[[Lt,N.value.email]]),n(rt).email?(p(),f("p",S1,c(`${n(s)(n(rt).email)}`),1)):C("",!0)])]),i("h1",D1,c(n(s)("address")),1),N.value.tax_type==="Personal"?(p(),f("h2",A1,[gt(c(n(s)("address_for_tax_invoice")),1),g[186]||(g[186]=i("span",{class:"text-red-500"}," *",-1))])):(p(),f("h2",z1,[gt(c(n(s)("company_address")),1),g[187]||(g[187]=i("span",{class:"text-red-500"}," *",-1))])),i("div",j1,[bt(i("textarea",{maxlength:"200",onInput:us,onBlur:g[126]||(g[126]=y=>ge("address")),class:J([Nt(!n(rt).address),"w-full min-h-[100px] px-4 pt-4 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:border-[var(--input-text-border)] outline-none"]),style:b({"--focus-color":n(l).color,"--input-text-border":n(l).color}),placeholder:n(s)("enter_full_address"),"onUpdate:modelValue":g[127]||(g[127]=y=>N.value.address=y)},"      ",46,T1),[[Lt,N.value.address]]),n(rt).address?(p(),f("p",P1,c(n(s)(n(rt).address)),1)):C("",!0)]),i("div",L1,[i("div",null,[i("label",R1,[gt(c(n(s)("province")),1),g[188]||(g[188]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("select",{onBlur:g[128]||(g[128]=y=>ge("province")),class:J([[Nt(!n(rt).province),N.value.province===""?"text-[#D1D1D1
4]":""],"w-full px-4 py-2 border border-gray-300 rounded-full focus:outline-none focus:ring-2"]),style:b({"--focus-color":n(l).color}),onChange:qt,"onUpdate:modelValue":g[129]||(g[129]=y=>N.value.province=y)},[i("option",O1,c(n(s)("enter_province")),1),(p(!0),f(at,null,xt(n(d).getProvince,y=>(p(),f("option",{key:y.id,value:y.name_th,class:"text-black"},c(n(M)==="th"?y.name_th:y.name_en),9,B1))),128))],38),[[De,N.value.province]]),n(rt).province?(p(),f("p",E1,c(`${n(s)(n(rt).province)}`),1)):C("",!0)]),i("div",null,[i("label",F1,[gt(c(n(s)("district_city")),1),g[189]||(g[189]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("select",{disabled:N.value.province===null||N.value.province==="",onBlur:g[130]||(g[130]=y=>ge("district")),class:J([[Nt(!n(rt).district),N.value.district===""?"text-[#D1D1D1]":""],"w-full px-4 py-2 border border-gray-300 rounded-full focus:outline-none focus:ring-2 disabled:bg-gray-100 disabled:cursor-not-allowed"]),style:b({"--focus-color":n(l).color}),onChange:F,"onUpdate:modelValue":g[131]||(g[131]=y=>N.value.district=y)},[i("option",N1,c(n(s)("enter_district_city")),1),(p(!0),f(at,null,xt(Tt.value,y=>(p(),f("option",{key:y.id,value:y.name_th,class:"text-black"},c(n(M)==="th"?y.name_th:y.name_en),9,H1))),128))],46,I1),[[De,N.value.district]]),n(rt).district?(p(),f("p",V1,c(`${n(s)(n(rt).district)}`),1)):C("",!0)]),i("div",null,[i("label",W1,[gt(c(n(s)("sub_district"))+" ",1),g[190]||(g[190]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("select",{disabled:N.value.district===null||N.value.district==="",onChange:R,"onUpdate:modelValue":g[132]||(g[132]=y=>N.value.sub_district=y),onBlur:g[133]||(g[133]=y=>ge("sub_district")),class:J([[Nt(!n(rt).sub_district),N.value.sub_district===""?"text-[#D1D1D1]":""],"w-full px-4 py-2 border border-gray-300 rounded-full focus:outline-none focus:ring-2 disabled:bg-gray-100 disabled:cursor-not-allowed"]),style:b({"--focus-color":n(l).color})},[i("option",Y1,c(n(s)("enter_sub_district")),1),(p(!0),f(at,null,xt(ft.value,y=>(p(),f("option",{key:y.id,value:y.name_th,class:"text-black"},c(n(M)==="th"?y.name_th:y.name_en),9,q1))),128))],46,U1),[[De,N.value.sub_district]]),n(rt).sub_district?(p(),f("p",Z1,c(`${n(s)(n(rt).sub_district)}`),1)):C("",!0)]),i("div",null,[i("label",X1,[gt(c(n(s)("postal_code"))+" ",1),g[191]||(g[191]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("select",{disabled:N.value.sub_district===null||N.value.sub_district==="",onChange:kt,"onUpdate:modelValue":g[134]||(g[134]=y=>N.value.postal_code=y),onBlur:g[135]||(g[135]=y=>ge("zip_code")),class:J([[Nt(!n(rt).zip_code),N.value.postal_code===""?"text-[#D1D1D1]":""],"w-full px-4 py-2 border border-gray-300 rounded-full focus:outline-none focus:ring-2 disabled:bg-gray-100 disabled:cursor-not-allowed"]),style:b({"--focus-color":n(l).color})},[i("option",G1,c(n(s)("select_postal_code")),1),(p(!0),f(at,null,xt(ut.value,y=>(p(),f("option",{key:y.id,value:y.zip_code,class:"text-black"},c(y.zip_code),9,Q1))),128))],46,K1),[[De,N.value.postal_code]]),n(rt).zip_code?(p(),f("p",J1,c(`${n(s)(n(rt).zip_code)}`),1)):C("",!0)])]),i("div",tm,[i("button",{onClick:g[136]||(g[136]=y=>Cs()),style:b({backgroundColor:ro.value&&Oo.value?n(h):n(x)}),disabled:!ro.value||!Oo.value,class:J(["text-white font-semibold px-8 py-2 rounded-3xl",ro.value&&Oo.value?"hover:brightness-95 cursor-pointer":"cursor-not-allowed"])},c(n(s)("save")),15,em)])])):C("",!0),I.value?(p(),f("div",om,[i("div",sm,[i("div",nm,[i("div",im,c(n(s)("alert_delete_adress")),1),i("div",lm,c(n(s)("alert_delete_adress_detail")),1),g[192]||(g[192]=i("div",{class:"mt-4 md:mt-8 border-b-[1px] border-[#D1D1D1]"},null,-1)),i("div",rm,[i("button",{onClick:g[137]||(g[137]=y=>I.value=!1),class:"border-[1px] flex-1 rounded-3xl h-9 xl:h-10 hover:[background-color:var(--hover-color)] cursor-pointer",style:b({borderColor:n(h),color:n(h),"--hover-color":n(l).bg_hover_button})},c(n(s)("cancel")),5),i("button",{onClick:he,class:"border-[1px] flex-1 rounded-3xl h-9 xl:h-10 hover:[background-color:var(--hover-color)] cursor-pointer",style:b({borderColor:n(h),backgroundColor:n(h),color:"#ffff","--hover-color":n(l).bg_hover_button})},c(n(s)("confirm")),5)])])])])):C("",!0),w.value?(p(),f("div",am,[i("div",cm,[i("div",dm,[i("div",um,c(n(s)("alert_delete_adress")),1),i("div",hm,c(n(s)("alert_delete_adress_detail")),1),g[193]||(g[193]=i("div",{class:"mt-4 md:mt-8 border-b-[1px] border-[#D1D1D1
4]"},null,-1)),i("div",pm,[i("button",{onClick:g[138]||(g[138]=y=>w.value=!1),class:"border-[1px] flex-1 rounded-3xl h-9 xl:h-10 hover:[background-color:var(--hover-color)] cursor-pointer",style:b({borderColor:n(h),color:n(h),"--hover-color":n(l).bg_hover_button})},c(n(s)("cancel")),5),i("button",{onClick:Q,class:"border-[1px] flex-1 rounded-3xl h-9 xl:h-10 hover:[background-color:var(--hover-color)] cursor-pointer",style:b({borderColor:n(h),backgroundColor:n(h),color:"#ffff","--hover-color":n(l).bg_hover_button})},c(n(s)("confirm")),5)])])])])):C("",!0),ko.value?(p(),f("div",fm,[i("div",_m,[i("div",mm,[i("div",vm,c(n(s)("cancel_add_address")),1),i("div",gm,c(n(s)("confirm_discard_shipping_address")),1),g[194]||(g[194]=i("div",{class:"mt-4 md:mt-8 border-b-[1px] border-[#D1D1D1]"},null,-1)),i("div",bm,[i("button",{onClick:g[139]||(g[139]=y=>ko.value=!1),class:"border-[1px] flex-1 rounded-3xl h-9 xl:h-10 hover:[background-color:var(--hover-color)] cursor-pointer",style:b({borderColor:n(h),color:n(h),"--hover-color":n(l).bg_hover_button})},c(n(s)("continue")),5),i("button",{onClick:g[140]||(g[140]=y=>Ot()),class:"border-[1px] flex-1 rounded-3xl h-9 xl:h-10 hover:[background-color:var(--hover-color)] cursor-pointer",style:b({borderColor:n(h),backgroundColor:n(h),color:"#ffff","--hover-color":n(l).bg_hover_button})},c(n(s)("confirm")),5)])])])])):C("",!0),bo.value?(p(),f("div",xm,[i("div",ym,[i("div",wm,[i("div",km,c(n(s)("discard_changes")),1),i("div",$m,c(n(s)("confirm_discard_warning")),1),g[195]||(g[195]=i("div",{class:"mt-4 md:mt-8 border-b-[1px] border-[#D1D1D1]"},null,-1)),i("div",Cm,[i("button",{onClick:g[141]||(g[141]=y=>bo.value=!1),class:"border-[1px] flex-1 rounded-3xl h-9 xl:h-10 hover:[background-color:var(--hover-color)] cursor-pointer",style:b({borderColor:n(h),color:n(h),"--hover-color":n(l).bg_hover_button})},c(n(s)("continue")),5),i("button",{onClick:g[142]||(g[142]=y=>Ot()),class:"border-[1px] flex-1 rounded-3xl h-9 xl:h-10 hover:[background-color:var(--hover-color)] cursor-pointer",style:b({borderColor:n(h),backgroundColor:n(h),color:"#ffff","--hover-color":n(l).bg_hover_button})},c(n(s)("confirm")),5)])])])])):C("",!0),zt(ni)],64))}},Sm={__name:"ReviewVideoModal",props:{visible:Boolean,canClose:{type:Boolean,default:!0}},setup(o){return(t,e)=>o.visible?(p(),f("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm px-2",onClick:e[2]||(e[2]=s=>t.$emit("close"))},[i("div",{class:"bg-white rounded-lg shadow-xl relative w-80 md:w-150",onClick:e[1]||(e[1]=Wo(()=>{},["stop"]))},[o.canClose?(p(),f("button",{key:0,class:"cursor-pointer absolute top-2 right-2 text-gray-500 hover:text-black",onClick:e[0]||(e[0]=s=>t.$emit("close"))}," ✖ ")):C("",!0),Ro(t.$slots,"default")])])):C("",!0)}},Dm={key:0,class:"fixed inset-0 bg-black/60 z-40"},Am={class:"absolute right-0 top-0 w-full sm:w-[600px] h-full bg-white shadow-xl z-50 flex flex-col"},zm={class:"flex items-center px-8 py-[8px] md:py-[16px] border-b gap-2 justify-between md:justify-start"},jm={class:"!text-base md:!text-[18px] font-bold"},Tm={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Pm=["stroke"],Lm={class:"flex-1 overflow-y-auto px-6 py-6 xl:px-8 xl:py-8"}
4,Rm={__name:"ReviewDetailList",props:{isOpen:Boolean,title:String,onClose:Function},setup(o){const t=Sd(),{model_detail_zone1:e}=Qt(t),s=ke();return(l,r)=>(p(),ae(il,{name:"slide"},{default:ne(()=>[o.isOpen?(p(),f("div",Dm,[i("div",Am,[i("div",zm,[i("button",{onClick:r[0]||(r[0]=(...a)=>o.onClose&&o.onClose(...a)),class:"hidden md:block text-gray-500 hover:text-black text-xl cursor-pointer"},[...r[2]||(r[2]=[i("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",class:"w-5 h-5 text-gray-600 hover:text-black"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19l-7-7 7-7"})],-1)])]),i("h2",jm,c(o.title),1),i("button",{onClick:r[1]||(r[1]=(...a)=>o.onClose&&o.onClose(...a)),class:"md:hidden text-gray-500 hover:text-black text-xl cursor-pointer"},[(p(),f("svg",Tm,[i("path",{d:"M6 18L18 6M6 6L18 18",stroke:n(s).black,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Pm)]))])]),i("div",Lm,[Ro(l.$slots,"default")])])])):C("",!0)]),_:3}))}},Om={class:"bg-white rounded-xl shadow-2xl w-full max-w-[680px] h-[682px] md:h-[722px] xl:h-[638px] p-[24px] md:p-[32px] overflow-hidden animate-in fade-in zoom-in duration-200 for-min-h"},Bm={class:"flex justify-between items-center mb-4 h-[24px] md:h-[28px]"},Em={class:"text-[16px] md:text-[18px] font-bold text-[#343434]"},Fm={class:"flex justify-between mb-[16px] md:mb-4 xl:mb-2"},Im={class:"text-[#343434] md:py-2 font-bold text-[16px]"},Nm={key:0,class:"flex gap-2"},Hm=["disabled"],Vm=["disabled"],Wm={class:"hidden xl:grid grid-cols-3 bg-white mb-[24px]"},Um={class:"pr-4 border-r border-gray-100"},Ym={class:"text-[16px] mb-[4px] font-bold leading-[30px]"},qm={class:"text-gray-800 text-[14px] leading-[24px]"},Zm={class:"px-4 border-r border-gray-100"},Xm={class:"text-[16px] mb-[4px] font-bold leading-[30px]"},Km={class:"text-gray-800 text-[14px] leading-[24px]"},Gm={class:"pl-4"},Qm={class:"text-[16px] mb-[4px] font-bold leading-[30px]"},Jm={class:"text-gray-800 text-[14px] leading-[24px]"},tv={class:"flex flex-col mb-[0px] md:mb-0 xl:hidden"},ev={class:"flex justify-between items-center pb-4 mb-[16px] border-b border-gray-200"},ov={class:"text-[16px] text-[#343434] font-bold"},sv={class:"text-[#343434] text-[16px]"},nv={class:"flex justify-between items-center pb-4 mb-[16px] border-b border-gray-200"},iv={class:"text-[16px] text-[#343434] font-bold"},lv={class:"text-[#343434] text-[16px]"},rv={class:"flex justify-between items-center pb-4 mb-[16px] border-b border-gray-200"},av={class:"text-[16px] text-[#343434] font-bold"},cv={class:"text-[#343434] text-[16px]"},dv={class:"text-[#343434] font-bold text-[16px] mb-[4px] md:mb-[4px] xl:mb-3 leading-[24px] md:leading-[32px]"},uv={class:"relative rounded-lg h-[330px] overflow-hidden flex items-center justify-center bg-[#00000099] group"},hv=["src"],pv={__name:"SlipModal",props:{isOpen:Boolean,slips:{type:Array,default:()=>[]},amount:[String,Number],date:String,time:String},emits:["close"],setup(o){const{locale:t}=ee(),e=o,s=z(0);pe(()=>e.isOpen,M=>{M&&(s.value=0)});const l=lt(()=>{if(!e.slips?.length)return[];const M=[];return e.slips[0]?.url_img?e.slips.forEach(w=>{(Array.isArray(w.url_img)?w.url_img:[w.url_img]).forEach(O=>{M.push({url:O,amount:w.amount,paid_date:w.paid_date,paid_time:w.paid_time})})}):e.slips.forEach(w=>{M.push({url:w,amount:e.amount,paid_date:e.date,paid_time:e.time})}),M}),r=lt(()=>l.value.map(M=>M.url)),a=lt(()=>l.value[s.value]||{}),d=lt(()=>a.value?.amount||"-"),u=lt(()=>a.value?.paid_date||"-"),h=lt(()=>a.value?.paid_time||"-"),_=lt(()=>s.value<r.value.length-1),m=lt(()=>s.value>0),x=()=>{_.value&&(s.value+=1)},$=()=>{m.value&&(s.value-=1)},S=M=>{if(!M||M==="-")return"-";const[w,I,O]=M.split("-");return!w||!I||!O?M:`${O.padStart(2,"0")}/${I.padStart(2,"0")}/${String(w).slice(-2)}`},v=M=>!M||M==="-"?"-":M.slice(0,5);return(M,w)=>o.isOpen?(p(),f("div",{key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-[24px] backdrop-blur-sm overflow-y-auto",onClick:w[1]||(w[1]=Wo(I=>M.$emit("close"),["self"]))},[i("div",Om,[i("div",Bm,[i("p",Em,c(M.$t("proof_payment")),1),i("button",{onClick:w[0]||(w[0]=I=>M.$emit("close")),class:"p-1 hover:bg-gray-100 rounded-full transition-colors"},[...w[2]||(w[2]=[i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),w[5]||(w[5]=i("hr",{class:"mb-[16px] md:mb-6 border-gray-200"},null,-1)),i("div",Fm,[i("p",Im,c(M.$t("payment_details"))+" ("+c(r.value.length-s.value)+"/"+c(r.value.length)+") ",1),r.value.length>1?(p(),f("div",Nm,[i("button",{onClick:$,disabled:!m.value,class:"p-2 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-white/80 w-[36px] h-[36px] xl:h-[40px] xl:w-[40px]"},[...w[3]||(w[3]=[i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[20px] w-[20px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])],8,Hm),i("button",{onClick:x,disabled:!_.value,class:"p-2 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-white/80 w-[36px] h-[36px] xl:h-[40px] xl:w-[40px]"},[...w[4]||(w[4]=[i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[20px] w-[20px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],8,Vm)])):C("",!0)]),i("div",Wm,[i("div",Um,[i("p",Ym,c(M.$t("amount_payment_detail")),1),i("p",qm,"฿"+c(d.value),1)]),i("div",Zm,[i("p",Xm,c(M.$t("payment_date_slip")),1),i("p",Km,c(S(u.value)),1)]),i("div",Gm,[i("p",Qm,c(M.$t("payment_time_slip")),1),i("p",Jm,c(v(h.value)),1)])]),i("div",tv,[i("div",ev,[i("p",ov,c(M.$t("amount_payment_detail")),1),i("p",sv,"฿ "+c(d.value),1)]),i("div",nv,[i("p",iv,c(M.$t("payment_date_slip")),1),i("p",lv,c(S(u.value)),1)]),i("div",rv,[i("p",av,c(M.$t("payment_time_slip")),1),i("p",cv,c(h.value),1)])]),i("div",null,[i("p",dv,c(M.$t("proof_image")),1),i("div",uv,[r.value.length?(p(),f("img",{key:0,src:r.value[s.value],class:"h-full object-contain"},null,8,hv)):C("",!0)])])])])):C("",!0)}},fv={class:"flex flex-col justify-center items-center p-8 pb-4"},_v={class:"font-bold text-base xl:text-[20px] pb-2"}
4,mv={class:"text-[14px] xl:text-[16px]"},vv={class:"text-center flex flex-col gap-2"},gv={class:"text-base xl:text-[20px] font-bold"},bv={class:"text-sm xl:text-base"},xv={class:"w-full border-t border-t-[#D1D1D1] pt-4"},yv=["src"],wv=["src"],kv={class:"flex justify-between p-8 pb-4"},$v={class:"font-bold text-base xl:text-[18px]"},Cv={class:"px-[24px] md:px-[32px] py-[24px]"},Mv={class:"flex gap-4 mb-4"},Sv=["src"],Dv={class:"font-bold text-[14px] text-[#343434]"},Av={class:"flex mt-2"},zv={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4",viewBox:"0 0 16 16"},jv={key:1,xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4 text-gray-300",viewBox:"0 0 24 24",fill:"currentColor"},Tv={class:"mt-2 text-[14px] break-all text-[#343434] mb-6"},Pv={class:"w-[279px] h-[330px] md:w-[436px] xl:w-[616px] xl:h-[338px] rounded-lg overflow-hidden mb-4 flex justify-center bg-[#D1D1D1]"},Lv=["src"],Rv=["src"],Ov={class:"flex gap-2"},Bv=["onClick"],Ev=["src"],Fv=["src"],Iv={class:"absolute bottom-0 left-0 right-0 bg-black/40 px-1 py-0.5 flex items-center justify-between"},Nv={class:"text-white text-xs"},Hv={class:"border-b border-gray-200"},Vv={class:"pb-4 flex items-center gap-4 md:gap-8"},Wv=["src","alt"],Uv={class:"font-bold line-clamp-2",style:{color:"black"}},Yv={key:0,class:"text-xs text-[#343434] truncate md:overflow-visible md:whitespace-normal w-[260px] md:w-[450px] lg:w-[450px]"},qv={class:"py-4"},Zv={class:"font-medium text-[#343434] mb-1 text-base"},Xv={class:"flex items-center justify-between border-b border-gray-200"},Kv={class:"flex items-center gap-1 mb-2"},Gv={class:"text-base text-[#343434]"},Qv={class:"font-medium text-[#343434] mb-1 text-base"},Jv={class:"flex items-center justify-between"},tg=["onUpdate:modelValue","placeholder"],eg={class:"text-xs text-gray-500 text-right mt-1"},og={class:"font-medium text-[#343434] text-base"},sg={class:"text-[14px] text-[#343434] mb-2"},ng={class:"flex flex-wrap items-center gap-2 mt-4"},ig=["src"],lg=["onClick"],rg={key:0,class:"relative w-24 h-24 flex-shrink-0 rounded-lg overflow-hidden border-2 border-gray-100"},ag=["src"],cg={class:"absolute bottom-0 left-0 right-0 bg-black/40 px-1 py-0.5 flex items-center justify-between"},dg={class:"text-white text-xs"},ug=["onClick"],hg=["onChange"],pg=["onChange"],fg={key:0,class:"flex gap-2 justify-center items-center mt-2"},_g={class:"text-[#C4021A] text-[12px] w-full"},mg={class:"flex items-center gap-2 mb-6"},vg={class:"text-left text-base font-medium select-none"},gg={class:"flex gap-4"},bg={class:"border-b border-gray-200 pb-4"},xg={class:"flex items-center gap-4 md:gap-8"},yg=["onClick","src","alt"],wg={class:"font-bold line-clamp-2",style:{color:"black"}},kg={key:0,class:"text-xs text-[#343434] w-[220px] md:w-[450px] lg:w-[450px]"},$g={class:"flex items-start space-x-4 md:space-x-5 mb-4 pl-8"},Cg=["src"],Mg={class:"flex-1 min-w-0 overflow-hidden"},Sg={class:"font-bold text-[#343434]"},Dg={class:"flex mt-2 gap-1"},Ag={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4",viewBox:"0 0 16 16"},zg={key:1,xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4 text-gray-300",viewBox:"0 0 24 24",fill:"currentColor"},jg={class:"mt-4 text-[#343434] break-words"},Tg={class:"flex flex-wrap gap-2 mt-4"},Pg=["src","onClick"],Lg=["onClick"],Rg=["src"],Og={class:"absolute bottom-0 left-0 right-0 bg-black/40 px-1 py-0.5 flex items-center justify-between"},Bg={class:"text-white text-xs"},Eg={class:"mt-2 text-[#a4a4a4] text-[12px]"},Fg={class:"flex justify-center text-xl font-bold mb-4"},Ig={class:"flex justify-center"},Ng=["src"],Hg={class:"text-lg font-bold"},Vg={class:"px-4"},Wg=["onClick"],Ug={class:"w-8 h-6 mr-4 flex-shrink-0 flex items-center justify-center"},Yg=["innerHTML"],qg=["src"],Zg={class:"flex-1"},Xg={class:"font-semibold"},Kg={class:"text-sm text-gray-600 mt-1"},Gg={class:"pl-4"},Qg=["value"],Jg={class:"flex gap-4"},tb=["disabled"],eb={class:"flex justify-center text-xl font-bold mb-4"},ob=["src"],sb={class:"mt-4 flex justify-center"},nb={class:"font-bold text-xl text-center"},ib={style:{"font-size":"14px"},class:"mt-2 flex flex-col items-center text-center"},lb={class:"mb-5",style:{"font-weight":"400",color:"#a4a4a4"}},rb={class:"font-bold",style:{color:"#a4a4a4"}},ab={class:"hidden sm:inline"},cb={class:"block sm:hidden"},db={class:"text-left mt-2",style:{"font-weight":"400","font-size":"14px",color:"#a4a4a4"}},ub={class:"w-full mt-4"},hb={class:"mt-4 flex justify-around font-bold text-[16px] gap-1 md:gap-8"},pb={class:"flex justify-center text-xl font-bold sm:mb-4"},fb=["src"],_b={class:"mt-2 sm:mt-4 flex justify-center"},mb={class:"font-bold text-base sm:text-xl text-center"},vb={class:"mt-1 sm:mt-2 flex flex-col text-xs sm:text-sm items-center text-center"},gb={class:"sm:mb-5",style:{"font-weight":"400",color:"#a4a4a4"}},bb={class:"font-bold",style:{color:"#a4a4a4"}}
4,xb={class:"text-left mt-1 sm:mt-2 text-xs sm:text-sm",style:{"font-weight":"400",color:"#a4a4a4"}},yb={class:"w-full mt-2 sm:mt-4"},wb={class:"text-[18px] font-bold md:py-6 md:px-8 py-5 px-4"},kb={class:"overflow-x-auto"},$b={class:"md:py-6 md:px-8 py-5 px-4"},Cb={class:"border-b-1 border-[#F5F5F5]"},Mb={class:"pb-2 font-bold"},Sb={class:"pb-2 flex gap-2"},Db={class:"mt-4 border-b-1 border-gray-300"},Ab={class:"pb-2 font-bold"},zb={class:"pb-2 flex gap-2"},jb={class:"mt-4"},Tb={class:"pb-2 font-bold"},Pb={class:"flex gap-2"},Lb={class:"md:py-6 md:px-8 py-5 px-4 md:-mt-4 -mt-3"},Rb={class:"w-full mt-2"},Ob=["placeholder"],Bb={class:"w-full text-right text-[#d1d1d1] text-xs"},Eb={class:"flex justify-center mt-4 mx-2 mb-1 gap-4"},Fb=["disabled"],Ib={key:0,class:"w-full rounded-lg px-4 bg-white py-3"},Nb={class:"flex items-center mb-6"},Hb={class:"text-2xl font-semibold"},Vb={class:"border-b mb-4"},Wb={class:"flex overflow-x-auto"},Ub=["onClick"],Yb={class:"relative"},qb=["placeholder"],Zb={key:1},Xb={key:0,class:"flex flex-col items-center justify-center py-14 text-center"},Kb={class:"w-20 h-20 rounded-full flex items-center justify-center mb-2"},Gb={class:"text-xl font-medium mb-2"},Qb={key:0,class:"text-gray-600"},Jb={key:1,class:"space-y-4 mt-8"},t0={key:0,class:"border border-gray-300 rounded-lg hover:shadow-md transition-shadow"},e0={class:"px-4 py-3 border-b border-gray-100 flex justify-between items-center bg-white rounded-t-lg"},o0={class:"flex"},s0={class:"text-[16px] md:text-[16px] xl:text-[18px] font-bold text-gray-900 sm:block hidden md:block"},n0=["title"],i0=["onClick"],l0={class:"bg-white p-4"},r0=["onClick"],a0={class:"w-full text-left text-sm cursor-pointer"},c0={class:"py-2 flex flex-col gap-1 items-start w-full"},d0={class:"flex items-start gap-4 w-full"},u0=["src","alt"],h0=["src","alt"],p0={class:"w-full overflow-hidden max-md:max-w-[65vw] md:max-w-[60vw] xl:max-w-[528px]"},f0={class:"font-bold text-sm line-clamp-2 break-all leading-relaxed",style:{color:"black"}},_0={key:0},m0=["title"],v0={key:0},g0={class:"md:hidden flex justify-between text-xs mt-1 w-full"},b0={class:"font-semibold"},x0={class:"font-semibold text-gray-700"},y0={class:"hidden md:table-cell py-2 font-bold text-center w-1/8"},w0={class:"hidden md:table-cell py-2 font-bold text-right w-1/8 whitespace-nowrap"},k0={class:"flex flex-col items-end space-y-4"},$0={class:"font-bold"},C0={class:"flex items-center space-x-3 mb-4"},M0=["onClick"],S0=["onClick"],D0=["onClick"],A0=["onClick"],z0=["onClick"],j0=["onClick"],T0=["onClick"],P0=["onClick"],L0={key:2},R0={class:"bg-white p-4 rounded-lg shadow-md mb-8"},O0={class:"flex items-start mb-4"},B0={class:"flex flex-col md:flex-row justify-between items-start flex-1 gap-2 min-w-0"},E0=["title"],F0={class:"block md:hidden"},I0={class:"hidden md:inline"},N0={class:"text-sm text-gray-600 text-nowrap mt-[2px]"},H0={key:0,class:"flex items-center justify-between relative"},V0={class:"flex flex-col items-center flex-1"},W0={class:"hidden md:block text-xs md:text-sm text-gray-700 mt-2 text-center"},U0={class:"block md:hidden text-xs md:text-sm text-gray-700 mt-2 text-center text-nowrap"},Y0={class:"text-xs text-gray-500 mt-1 text-center h-[40px]"},q0={class:"flex flex-col items-center flex-1"},Z0={class:"hidden md:block text-xs md:text-sm text-gray-700 mt-2 text-center"},X0={class:"block md:hidden text-xs md:text-sm text-gray-700 mt-2 text-center text-nowrap"},K0={class:"text-xs text-gray-500 mt-1 text-center h-[40px] block"},G0={class:"flex flex-col items-center flex-1"},Q0={class:"text-xs md:text-sm text-gray-700 mt-2 text-center text-nowrap"},J0={key:0,class:"text-xs text-gray-500 mt-1 text-center h-[40px] block"},tx={key:1,class:"text-xs text-gray-500 mt-1 text-center h-[40px] block"},ex={class:"flex flex-col items-center flex-1"},ox={class:"text-xs md:text-sm text-gray-700 mt-2 text-center text-nowrap"},sx={key:0,class:"text-xs text-gray-500 mt-1 text-center h-[40px]"},nx={key:1,class:"text-xs text-gray-500 mt-1 text-center h-[40px] block"},ix={key:1},lx={class:"bg-white p-6 rounded-lg shadow-sm mb-8"},rx={class:"font-semibold !text-[18px] mb-4"},ax={key:0,class:"text-sm space-y-1"},cx={class:"font-bold"},dx={class:"mb-1"},ux={key:0},hx={key:1},px={key:0},fx={class:"font-bold"},_x={class:"w-full break-words"},mx={key:0,class:"font-bold mb-2 flex justify-between items-center"},vx={key:1,class:"mb-2"},gx={class:"font-bold"}
4,bx={key:1},xx={class:"space-y-2"},yx={class:"font-bold"},wx={class:"text-sm"},kx={class:"mt-4 space-y-2"},$x={class:"font-bold"},Cx={class:"bg-white p-6 rounded-lg shadow-sm mb-8"},Mx={class:"font-semibold !text-[18px] mb-4"},Sx={key:0,class:"flex justify-between mb-[18px]"},Dx={class:"font-bold text-[14px]"},Ax={class:"font-bold text-[14px]"},zx={class:"text-[14px]"},jx=["onClick"],Tx={key:0,class:"text-[12px]"},Px={key:0,class:"flex justify-center mt-2"},Lx={key:0,class:"bg-white p-6 rounded-lg shadow-sm mb-8"},Rx={class:"font-semibold text-lg mb-4"},Ox={class:"text-[14px] space-y-1 mb-2"},Bx={class:"font-bold"},Ex={class:"text-[14px] space-y-1"},Fx={class:"font-bold"},Ix={key:0},Nx={key:0},Hx={key:0},Vx={class:"bg-white rounded-lg shadow-sm"},Wx={class:"!text-[18px] font-semibold text-gray-800 mb-4"},Ux={class:""},Yx={class:"flex justify-between items-center text-gray-700 py-4 px-2 border-b border-[#F5F5F5]"},qx={class:"text-sm"},Zx={class:"font-bold text-sm"},Xx={class:"text-sm"},Kx={class:"text-sm font-bold"},Gx={class:"text-sm"},Qx={class:"text-sm font-bold"},Jx={class:"text-sm"},t2={class:"text-sm font-bold"},e2={class:"text-sm"},o2={class:"text-sm font-bold"},s2={class:"text-sm"},n2={class:"text-sm font-bold"},i2={class:"text-sm"},l2={class:"text-sm font-bold"},r2={class:"text-sm"},a2={class:"text-sm font-bold"},c2={class:"text-sm"},d2={class:"text-sm font-bold"},u2={key:5,class:"flex justify-between items-center text-[#343434] py-4"},h2={class:"text-sm"},p2={class:"text-sm font-bold"},f2={class:""},_2={key:0,class:"flex justify-between items-center text-gray-700 py-4 px-2 border-b border-[#F5F5F5]"},m2={class:"text-sm"},v2={class:"text-sm font-bold"},g2={key:1,class:"flex justify-between items-center text-gray-700 py-4 px-2 border-b border-[#F5F5F5]"},b2={class:"text-sm"},x2={class:"text-sm font-bold"},y2={key:2,class:"flex justify-between items-center text-gray-700 py-4 px-2 border-b border-[#F5F5F5]"},w2={class:"text-sm font-bold"},k2={class:"flex justify-between items-center text-gray-700 py-4 px-2 border-b border-[#F5F5F5]"},$2={class:"text-sm"},C2={key:0,class:"text-sm font-bold"},M2={key:1,class:"flex items-center gap-2 font-bold"},S2={class:"flex justify-between items-center text-gray-700 py-4 px-2 border-b border-[#F5F5F5]"},D2={class:"text-sm"},A2={class:"font-bold text-[#343434]"},z2={key:3,class:"py-4 px-2"},j2={class:"flex justify-between items-center text-gray-700"},T2={class:"text-sm"},P2=["disabled"],L2={class:"bg-white p-4 rounded-lg shadow-sm mt-4"},R2={class:"font-semibold !text-lg mb-4"},O2={class:"hidden md:block overflow-x-auto"},B2={class:"hidden sm:flex py-[18px] px-4"},E2={class:"w-6/12"},F2={class:"text-center w-2/12"},I2={class:"text-center w-2/12"},N2={class:"text-center w-2/12"},H2={class:"flex items-center gap-3"},V2={class:"text-[10px] font-bold leading-none"},W2={class:"text-base font-bold"},U2={class:"text-sm font-bold"},Y2={class:"flex items-center"},q2={class:"w-6/12 flex items-start"},Z2={class:"flex-shrink-0"},X2=["src"],K2={class:"flex flex-col overflow-hidden"},G2={class:"font-bold overflow-hidden line-clamp-2 leading-relaxed break-all"},Q2=["title"],J2={key:0},ty={class:"w-2/12 flex flex-col justify-center items-center font-bold"},ey={class:"w-2/12 flex flex-col justify-center items-center font-bold"},oy={class:"w-2/12 flex flex-col justify-center items-center font-bold"},sy={key:0,class:"mt-2 w-full flex flex-col gap-2 bg-gray-100 rounded"},ny={class:"flex flex-col gap-2 w-full"},iy=["src"],ly=["title"],ry={key:0,class:"ml-1"},ay={class:"flex-shrink-0 text-[14px] font-medium"},cy={class:"flex items-center"},dy={class:"w-6/12 flex items-start"},uy={class:"flex-shrink-0"},hy=["src"],py={class:"flex flex-col overflow-hidden"},fy={class:"font-bold overflow-hidden line-clamp-2 leading-relaxed break-all"},_y=["title"],my={key:0},vy={class:"w-2/12 flex flex-col justify-center items-center font-bold"},gy={class:"w-2/12 flex flex-col justify-center items-center font-bold"},by={class:"w-2/12 flex flex-col justify-center items-center font-bold"},xy={class:"flex flex-col gap-2 w-full"},yy=["src"],wy=["title"],ky={key:0,class:"ml-1"},$y={class:"flex-shrink-0 text-[14px] font-medium"},Cy={class:"flex flex-col gap-1 md:flex-row md:items-center md:gap-3"},My={class:"text-[10px] font-bold h-[22px] flex items-center justify-centerleading-none"},Sy={class:"text-base font-bold"},Dy={class:"flex items-start w-full"},Ay={class:"flex-shrink-0"},zy=["src"],jy={class:"flex flex-col flex-1 overflow-hidden pl-4"},Ty={class:"flex flex-col overflow-hidden text-xs md:text-sm"},Py={class:"font-bold line-clamp-2 leading-relaxed",style:{color:"black"}}
4,Ly=["title"],Ry={key:0},Oy={class:"space-y-1 mt-3 w-full text-xs md:text-sm px-1 pl-[62px]"},By={class:"flex justify-between border-t border-gray-300 pt-2"},Ey={class:"text-right font-bold"},Fy={class:"flex justify-between"},Iy={class:"text-right font-bold"},Ny={class:"flex justify-between"},Hy={class:"text-right font-bold"},Vy=["src"],Wy=["title"],Uy={key:0,class:"ml-1"},Yy={class:"flex-shrink-0"},qy={class:"flex items-start w-full text-xs md:text-sm"},Zy={class:"flex-shrink-0"},Xy=["src"],Ky={class:"flex flex-col flex-1 overflow-hidden pl-4"},Gy={class:"flex flex-col overflow-hidden"},Qy={class:"font-bold line-clamp-2 leading-relaxed break-all",style:{color:"black"}},Jy=["title"],t4={key:0},e4={class:"space-y-1 mt-3 w-full text-xs md:text-sm px-1 pl-[62px]"},o4={class:"flex justify-between border-t border-gray-300 pt-2"},s4={class:"text-right font-bold"},n4={class:"flex justify-between"},i4={class:"text-right font-bold"},l4={class:"flex justify-between"},r4={class:"text-right font-bold"},a4=["src"],c4=["title"],d4={key:0,class:"ml-1"},u4={class:"flex-shrink-0"},h4={key:3,class:"flex justify-between gap-4 p-4"},p4={class:"text-xs flex justify-center items-center"},f4={class:"flex gap-2 items-center"},_4=["disabled"],m4=["onClick"],v4={key:1,class:"px-2 text-gray-400 select-none"},g4=["disabled"],b4={class:"flex justify-between p-8 pb-4"},x4={class:"font-bold text-base xl:text-[18px]"},y4={class:"px-[30px] py-[20px]"},w4={class:"mb-6"},k4={class:"text-base font-bold"},$4={class:"text-[14px] mt-1 text-center h-[40px]"},C4={class:"text-base font-bold mb-1"},M4={class:"w-full h-80 rounded-lg overflow-hidden mb-4 justify-center bg-[#D1D1D1]"},S4=["src"],D4={class:"flex gap-2"},A4=["onClick"],z4=["src"],nr=200,j4={__name:"OrdersSection",async setup(o){let t,e;const{t:s}=ee(),l=z("all"),r=z(!1),a=nn(),d=bn(),u=lt(()=>Oa.value),{locale:h,t:_}=ee(),m=_o(),x=$d(),$=xn(),S=z(!0),v=z({}),M=z(!0),w=je(),{loadCancelNotSentOrder:I}=je(),O=Po(),{showContent:tt}=Qt(w),G=z(!1),Y=z(!1),et=z(!1),ht=z(""),ct=z(""),dt=z(""),pt=z(""),D=ke(),{color:Mt,button_color:ot,bg_color:st}=Qt(D),X=z(null),H=z(""),P=z(1),W=z(!1),U=z(!1),B=z(!1),Z=z(!1),q=z(""),ut=z(""),wt=z(""),St=z(""),Tt=z(""),vt=z(""),yt=z(""),Ft=z(""),N=z(""),$t=z(null),T=z(null),Pt=z(!1),Rt=z(!1),ft=z(!1),F=lt(()=>O.shopAddress?.data?.[0]),R=z(!1),kt=z(!1),qt=z(!1),It=z(!1),he=z(!1),Q=z(!1),E=z(""),mt=z(""),{product_repeat:Zt}=Qt(x),Oe=z(!1),ve=z(null),qo=z([]),Te=z(null),go=z({type:null,src:""}),Zo=z("");[t,e]=nl(()=>Promise.all([O.loadProvince(),O.loadTambons(),O.loadAmphures()])),await t,e(),pe(()=>Oe.value,L=>{if(L){if(go.value?.type==="video"){Te.value=go.value.src;return}if(go.value?.type==="image"){Te.value=go.value.src;return}if(ve.value?.image_data?.length>0){const A=ve.value.image_data[0];qo.value=Object.entries(A).filter(([_t,Ct])=>_t.startsWith("media_path")&&Ct).map(([_t,Ct])=>Ct),Te.value=qo.value[0]||"";return}ve.value?.video_data?.length>0&&(Te.value=ve.value.video_data[0].media_path)}});const Xo=L=>new Promise(A=>{const _t=document.createElement("video");_t.preload="metadata",_t.src=L,_t.addEventListener("loadedmetadata",()=>{const Ct=Math.floor(_t.duration),At=Math.floor(Ct/60),Wt=Ct%60;A(`${At}:${Wt.toString().padStart(2,"0")}`)}),_t.addEventListener("error",()=>A("0:00"))}),Ke=async()=>{const L=gi.value.product_list.flatMap(A=>A.reviews.flatMap(_t=>!_t.video_data||_t.video_data.length===0?[]:_t.video_data.map(async Ct=>{Ct.video_duration||(Ct.video_duration=await Xo(Ct.media_path))})));await Promise.all(L)},Ko=async(L,A)=>{const _t=L.product_id,Ct=A.target.files;if(!Ct||!Ct.length)return;Fo.value[_t]=null,$o.value[_t]=null,ho.value[_t]||(ho.value[_t]=[]);const At=4-ho.value[_t].length,Wt=Array.from(Ct).slice(0,At),de=["image/jpeg","image/png","image/webp"];for(const j of Wt){if(!de.includes(j.type)){Fo.value[_t]="type";continue}if(j.size>6*1024*1024){Fo.value[_t]="size";continue}try{const nt=await bo(j);ho.value[_t].push({file:j,url:nt})}catch(nt){console.error("เกิดข้อผิดพลาดในการอ่านไฟล์:",nt),Fo.value[_t]="upload_failed"}}A.target.value=""},bo=L=>new Promise((A,_t)=>{const Ct=new FileReader;
4Ct.readAsDataURL(L),Ct.onload=()=>A(Ct.result),Ct.onerror=At=>_t(At)}),Xt=async(L,A)=>{const _t=L.product_id;m.changeStateLoading(!0);const Ct=A.target.files[0];if(!Ct){m.changeStateLoading(!1);return}if($o.value[_t]=null,!["video/mp4"].includes(Ct.type)){$o.value[_t]="type",A.target.value="",m.changeStateLoading(!1);return}if(Ct.size>20*1024*1024){$o.value[_t]="size",A.target.value="",m.changeStateLoading(!1);return}try{const Wt=new FormData;Wt.append("type","review_video"),Wt.append("order_number",v?.value.order_number),Wt.append("image",Ct);const de=Ls("auth_token").value,j=await $fetch(`${a.public.API_BASE_URL}backend/api/upload_to_s3`,{method:"POST",headers:{Authorization:`Bearer ${de}`},body:Wt});j?.data?.list_path?.[0]&&(Xe.value[_t]={file:Ct,url:j.data.list_path[0].path,video_duration:await Xo(j.data.list_path[0].path)})}catch(Wt){console.error("เกิดข้อผิดพลาดในการอัปโหลดวิดีโอ:",Wt),$o.value[_t]="upload_failed"}A.target.value="",m.changeStateLoading(!1)},Et=(L,A)=>{const _t=L.product_id,Ct=ho.value[_t]||[],At=Ct.splice(A,1)[0];At?.file&&At?.url?.startsWith("blob:")&&URL.revokeObjectURL(At.url),ho.value[_t]=[...Ct]},ce=L=>{const A=L.product_id,_t=Xe.value[A];_t?.file&&_t?.url?.startsWith("blob:")&&URL.revokeObjectURL(_t.url),delete Xe.value[A]},Nt=(L,A)=>{Ds.value[L.product_id]=A},qe=L=>{switch(L??5){case 1:return s("poor");case 2:return s("fair");case 3:return s("average");case 4:return s("good");case 5:return s("excellent");default:return s("reviews_available")}},ds=z(!1),rt=lt(()=>Ee.query.order),lo=z(!1),Jt=z(!1),Be=z(""),ro=z([]),xo=z(!1),Ge=Po(),Yt=lt(()=>{const L=v.value||{};return[{label:s("QuoNo")+" :",value:L.qt_order,name:L.order_number},{label:s("PurchNo")+" :",value:L.po_external,name:L.po_external_name},{label:s("StoreRrc")+" :",value:L.receipt_external,name:L.receipt_external_name},{label:s("ReceNo")+" :",value:L?.payment_receipt.orderIDRef,text:L?.payment_receipt.orderIDRef},{label:s("PurchRe")+" :",value:L.pr_external,name:L.pr_external_name},{label:s("SaleNo")+" :",value:L.so_external,name:L.so_external_name},{label:s("InvoiceNo")+" :",value:L.invoice_external,name:L.invoice_external_name},{label:s("OtherDoc")+" :",value:L.other_external,name:L.other_external_name}].filter(_t=>_t.value)}),ge=lt(()=>v.value?Number(v.value.total_member_discount??0)+Number(v.value.total_flash_sale_discount??0)+Number(v.value.total_bundle_discount??0)+Number(v.value.total_whole_sale_discount??0):0),Vt=L=>!!(L?.bundle_info??L)?.is_eligible,Ot=lt(()=>Zo.value||[]),oe=lt(()=>{const A=Ot.value.flatMap(Ct=>Ct.bundles||[]),_t=new Map;return A.forEach(Ct=>{_t.has(Ct.bundle_id)||_t.set(Ct.bundle_id,Ct)}),Array.from(_t.values())}),Us=lt(()=>{const L={},A=Ot.value;return oe.value.forEach(Ct=>{const At=Ct.bundle_id;L[At]={bundle_info:Ct,products:[]},(Ct.bundle_products||[]).forEach(Wt=>{const de=A.filter(j=>j.product_id===Wt);de&&L[At].products.push(...de)})}),L}),Cs=lt(()=>Object.values(Us.value)),Go=lt(()=>{const L=new Set;return oe.value.forEach(A=>{(A.bundle_products||[]).forEach(_t=>L.add(_t))}),L}),Ms=lt(()=>Ot.value.filter(L=>!Go.value.has(L.product_id))),Qe=L=>L==null||L===""?"0":Number(L).toLocaleString("th-TH"),Oo=L=>{const A=L?.bundle_info||L,_t=A?.progress;if(!_t)return"";_t.current_qty;const Ct=A?.applied_tiers?.[0],At=_t?.next_tier,Wt=Object.values(Ct?.products_used_in_set||{}).reduce((j,nt)=>j+nt,0),de=Ct?.min_quantity;if(Ct)return Ct.discount_type==="fixed_price"||A.discount_type==="fixed_price"?`${s("add")} ${Wt} ${s("items")} ${Qe(Ct.fixed_price)} ${s("bath")}`:Ct.discount_type==="percent"||A.discount_type==="percent"?`${s("add")} ${Wt} ${s("pices")} ${s("Savee")} ${Ct.discount_value}%`:`${s("add")} ${de} ${s("pices")} ${s("Savee")} ${Qe(Ct.discount_value)} ${s("bath")}`;if(At){const j=At.min_quantity;return At.discount_type==="fixed_price"?`${s("add")} ${j} ${s("pices")} ${Qe(At.fixed_price)} ${s("bath")}`:At.discount_type==="percent"?`${s("add")} ${j} ${s("pices")} ${s("Savee")} ${At.discount_value}%`:`${s("add")} ${j} ${s("pices")} ${s("Savee")} ${Qe(At.discount_value)} ${s("bath")}`}return""},Qo=L=>{L&&window.open(L,"_blank")};pe(()=>Jt.value,L=>{if(L){const A=v.value?.additional_image?.[0]||{};ro.value=Object.entries(A).filter(([_t,Ct])=>_t.startsWith("Image_")&&Ct).map(([_t,Ct])=>Ct),Be.value=ro.value[0]||""}}),we(async()=>{await O.loadShopAddress(),Ne.value.length>0&&(T.value=Ne.value[0])});
4const Ne=z([{value:"qrcode",label:"QR Prompt Pay",description:"สแกนคิวอาร์โค้ดเพื่อจ่ายเงิน",description_en:"Scan QR Code to Pay",image:zd,isUpload:!1},{value:"qrcode",label:"ชำระผ่านบัญชีธนาคาร",label_en:"Bank Transfer",description:"ชำระผ่านทางบัญชีธนาคารและแนบหลักฐาน",description_en:"Make a bank transfer and upload the payment slip",icon:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 64 64" stroke-width="1" stroke="${D.color}" class="size-6">
5          <g>
6            <path fill="#231F20" d="M60,58c0-2.209-1.791-4-4-4h-2V25h6c1.795,0,3.369-1.194,3.852-2.922c0.484-1.728-0.242-3.566-1.775-4.497
7              l-28-17C33.439,0.193,32.719,0,32,0s-1.438,0.193-2.076,0.581l-28,17c-1.533,0.931-2.26,2.77-1.775,4.497
8              C0.632,23.806,2.207,25,4,25h6v29H8c-2.209,0-4,1.791-4,4c-2.209,0-4,1.791-4,4v2h64v-2C64,59.791,62.209,58,60,58z M52,54h-4V25h4
9              V54z M18,25h4v29h-4V25z M24,25h4v29h-4V25z M30,25h4v29h-4V25z M36,25h4v29h-4V25z M42,25h4v29h-4V25z M4,23
10              c-0.893,0-1.685-0.601-1.926-1.462c-0.241-0.859,0.124-1.784,0.888-2.247l28-17.001C31.275,2.1,31.635,2,32,2
11              c0.367,0,0.725,0.1,1.039,0.291l28,17c0.764,0.463,1.129,1.388,0.887,2.248C61.686,22.399,60.893,23,60,23H4z M12,25h4v29h-4V25z
12              M8,56h48c1.105,0,2,0.896,2,2H6C6,56.896,6.896,56,8,56z M2,62c0-1.104,0.896-2,2-2h56c1.105,0,2,0.896,2,2H2z"/>
13            <path fill="#231F20" d="M32,9c-2.762,0-5,2.238-5,5s2.238,5,5,5s5-2.238,5-5S34.762,9,32,9z M32,17c-1.656,0-3-1.343-3-3
14              s1.344-3,3-3c1.658,0,3,1.343,3,3S33.658,17,32,17z"/>
15          </g>
16          </svg>`,isUpload:!0},{value:"SPayLater",label:"SPayLater",description:"อัปโหลดสลิปเพื่อยืนยันการชำระเงิน",image:jd},{value:"truemoney",label:"truemoney",description:"อัปโหลดสลิปเพื่อยืนยันการชำระเงิน",image:Td},{value:"creditcard",label:"Credit/Debit Card",description:"ชำระด้วยบัตรเครดิต/เดบิต",description_en:"Pay with Credit/Debit Card",icon:`
17      <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="${D.color}" class="size-6">
18  <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z" />
19</svg>
20
21    `},{value:"ewallet",label:"E-wallet",description:"ชำระด้วย e-wallet",description_en:"Pay by E-Wallet",isDisabled:!1,icon:`
22      <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
23<path d="M26.7269 14.1174V10.1821C26.7269 8.84765 25.6918 7.76241 24.3841 7.65717L20.7294 1.27376C20.3907 0.68338 19.8438 0.261418 19.1895 0.0862021C18.5382 -0.0878206 17.8571 0.00357561 17.2742 0.342851L4.7458 7.63665H2.54543C1.14162 7.63665 0 8.77821 0 10.1821V25.4546C0 26.8584 1.14156 28 2.54543 28H24.1815C25.5853 28 26.7269 26.8584 26.7269 25.4546V21.5192C27.466 21.2556 27.9996 20.5559 27.9996 19.7274V15.9093C27.9996 15.0807 27.466 14.381 26.7269 14.1174ZM22.9052 7.63665H17.3587L21.5186 5.21477L22.9052 7.63665ZM20.8863 4.11032L14.8293 7.63665H12.3169L20.2581 3.01315L20.8863 4.11032ZM17.9149 1.44277C18.2026 1.27435 18.5388 1.22961 18.8601 1.3154C19.1851 1.40238 19.4561 1.61244 19.6245 1.90637L19.6258 1.9087L9.78757 7.63665H7.27531L17.9149 1.44277ZM25.4542 25.4546C25.4542 26.1561 24.883 26.7272 24.1815 26.7272H2.54543C1.84385 26.7272 1.27275 26.1561 1.27275 25.4546V10.1821C1.27275 9.4805 1.84385 8.9094 2.54543 8.9094H24.1815C24.883 8.9094 25.4542 9.4805 25.4542 10.1821V14.0002H21.636C19.5306 14.0002 17.8179 15.7129 17.8179 17.8183C17.8179 19.9238 19.5306 21.6364 21.636 21.6364H25.4542V25.4546ZM26.7269 19.7274C26.7269 20.0785 26.4417 20.3638 26.0905 20.3638H21.636C20.2322 20.3638 19.0906 19.2222 19.0906 17.8183C19.0906 16.4145 20.2322 15.2729 21.636 15.2729H26.0905C26.4416 15.2729 26.7269 15.5581 26.7269 15.9093V19.7274Z" fill="${D.color}"/>
24</svg>
25
26    `}]),us=()=>{x.payment_transaction_number=v?.value.order_number,Y.value=!1,$.push("/payment/ConfirmPayment")},Ys=()=>{Pt.value=!1,es(T?.value.value)};function Ss(){const L=v?.value?.tracking_data?.tracking_url;L&&window.open(L,"_blank")}async function Jo(){await Ge.loadListPayment(),Pt.value=!0;const L=Ge.ListPayment||[];Ne.value=Ne.value.filter(A=>L.includes(A.value)?A.value==="qrcode"?A.isUpload===!!D.UploadSlip:!0:!1),Ne.value.length>0&&(T.value=Ne.value[0])}function yo(){Pt.value=!1}function _e(){Rt.value=!0,r.value===!1&&m.changeStateLoading(!0)}function wo(){Fo.value={},$o.value={},Ds.value={},ho.value={},Xe.value={},Zs.value={},Rt.value=!1,ft.value=!1,R.value=!1}const ts=()=>{m.changeStateLoading(!0),P.value-=1,Eo(),window.scrollTo({top:0,behavior:"smooth"})},Bo=()=>{m.changeStateLoading(!0),P.value+=1,Eo(),window.scrollTo({top:0,behavior:"smooth"})},ko=()=>{M.value=!M.value}
26,{postOrderDetail:Dt}=Ra(),hs=lt(()=>[{id:"all",name:s("all"),count:q},{id:"not_paid",name:s("payment_pending"),count:Tt},{id:"fail",name:s("payment_failed"),count:vt},{id:"pending",name:s("pending_actions"),count:ut},{id:"to_ship",name:s("shipment_pending"),count:yt},{id:"to_receive",name:s("receive_pending"),count:Ft},{id:"success",name:s("success"),count:N}]),be=lt(()=>l.value==="not_paid"?Tt.value:l.value==="success"?N.value:l.value==="fail"?vt.value:l.value==="pending"?ut.value:l.value==="to_receive"?Ft.value:l.value==="to_ship"?yt.value:q.value),jt=z([null]),K=z(null);function g(){const L=w.qrCode2?.data?.img_base64;if(!L){alert("ไม่พบลิงก์รูปภาพ");return}const A=L.startsWith("data:")?L:`data:image/png;base64,${L}`;fetch(A).then(_t=>_t.blob()).then(_t=>{const Ct=URL.createObjectURL(_t),At=document.createElement("a");At.href=Ct,At.download="qr-code.png",document.body.appendChild(At),At.click(),document.body.removeChild(At),URL.revokeObjectURL(Ct)}).catch(_t=>{console.error("Download QR error:",_t),alert("เกิดข้อผิดพลาดในการดาวน์โหลด")})}function y(){const L=w.qrCode2?.data?.img_base64;if(!L){alert("ไม่พบลิงก์รูปภาพ");return}const A=L.startsWith("data:")?L:`data:image/png;base64,${L}`;fetch(A).then(_t=>_t.blob()).then(_t=>{const Ct=URL.createObjectURL(_t),At=document.createElement("a");At.href=Ct,At.download="qr-code.png",document.body.appendChild(At),At.click(),document.body.removeChild(At),URL.revokeObjectURL(Ct)}).catch(_t=>{console.error("Download QR error:",_t),alert("เกิดข้อผิดพลาดในการดาวน์โหลด")})}pe([Pt,et,qt,It,Y,G,lo],([L,A,_t,Ct,At,Wt,de])=>{document.body.style.overflow=L||A||_t||Ct||At||Wt||de?"hidden":"auto"}),pe(Rt,L=>{document.body.style.overflow=L?"hidden":"auto"}),pe(ft,L=>{document.body.style.overflow=L?"hidden":"auto"}),pe(Jt,L=>{document.body.style.overflow=L?"hidden":"auto"}),we(async()=>{m.changeStateLoading(!0);try{const[L,A,_t,Ct,At,Wt,de,j]=await Promise.all([Dt("","",void 0,!0),Dt("","Pending",""),Dt("","Not Paid",""),Dt("","Fail",""),Dt("","To Ship",""),Dt("","To Receive",""),Dt("","Success",""),Dt("","Cancel","")]);L.success?(jt.value=L.data?.data??"",K.value=jt.value.all_without_cancel,St.value=jt.value?.pagination?.total||0,ut.value=A.data?.data?.pagination?.total||0,vt.value=Ct.data?.data?.pagination?.total||0,Tt.value=_t.data?.data?.pagination?.total||0,yt.value=At.data?.data?.pagination?.total||0,Ft.value=Wt.data?.data?.pagination?.total||0,N.value=de.data?.data?.pagination?.total||0,wt.value=j.data?.data?.pagination?.total||0,q.value=jt.value?.pagination?.total||0):pt.value=L.data?.message||"โหลดข้อมูลไม่สำเร็จ",rt.value&&await Ze(rt.value)}catch(L){console.error("Error fetching orders:",L),pt.value="เกิดข้อผิดพลาดในการเชื่อมต่อเซิร์ฟเวอร์"}finally{S.value=!1,m.changeStateLoading(!1)}});const Ut=L=>{m.changeStateLoading(!0),P.value=L,window.scrollTo({top:0,behavior:"smooth"}),Eo()},le=async L=>{S.value=!0;try{const A=nn(),_t=Ls("auth_token").value,Ct=await $fetch(`${A.public.API_BASE_URL}backend/api/erp/get_order_detail?order_number=${L}&role_user=ext_buyer`,{headers:{"api-key":A.public.API_KEY,"api-secret":A.public.API_SECRET,Authorization:`Bearer ${_t}`}});v.value=Ct?.data??null,Zo.value=Ct?.data.order_items?.[0].product_items??null,ao()}catch(A){pt.value="โหลดข้อมูลรายละเอียดล้มเหลว",console.error("detail fetch error:",A)}S.value=!1},ao=()=>{v.value?.tracking_data?.tracking_steps?.some(L=>L.status==="ยกเลิกคำสั่งซื้อ")||v.value?.tracking_data?.tracking_steps.length===1?(W.value=!0,[U.value,B.value,Z.value]=[!1,!1,!1]):v.value?.tracking_data?.tracking_steps.length>=2&&v.value?.payment_data?.payment_status==="Success"&&v.value?.tracking_data?.tracking_number==="-"?v.value?.shipping_type==="front"?v.value?.buyer_received_status=="received"?[W.value,U.value,B.value,Z.value]=[!0,!0,!0,!0]:[W.value,U.value,B.value,Z.value]=[!0,!0,!0,!1]:([W.value,U.value]=[!0,!0],[B.value,Z.value]=[!1,!1]):v.value?.tracking_data?.tracking_number!=="-"&&v.value?.shipping_status!=="การจัดส่งสำเร็จ"?([W.value,U.value,B.value]=[!0,!0,!0],[Z.value]=[!1]):v.value?.shipping_status=="การจัดส่งสำเร็จ"&&([W.value,U.value,B.value,Z.value]=[!0,!0,!0,!0])},Je=async L=>{H.value="",P.value=1,l.value=L,Eo()},co=()=>{clearTimeout($t.value),$t.value=setTimeout(async()=>{m.changeStateLoading(!0),console.log("searchOrder",l.value),await Eo(),console.log("searchOrder.value",H.value),m.changeStateLoading(!1)},1e3)},mi=()=>{m.changeStateLoading(!0),clearTimeout($t.value),$t.value=setTimeout(async()=>{console.log("searchOrder",l.value),await Eo(),console.log("searchOrder.value",H.value),m.changeStateLoading(!1)},1e3)};async function Eo(){m.changeStateLoading(!0);let L="",A=!1;l.value==="not_paid"?L="Not Paid":l.value==="success"?L="Success":l.value==="pending"?L="Pending":l.value==="fail"?L="Fail":l.value==="to_receive"?L="To Receive":l.value==="to_ship"?L="To Ship":(L="",A=!0);const _t=await Dt(H.value,L,P.value,A);_t.success?(K.value=null,jt.value=_t.data.data??"",K.value=jt.value?.all_without_cancel):pt.value=_t.data?.message||"โหลดข้อมูลไม่สำเร็จ",m.changeStateLoading(!1)}const Ee=yn(),Ze=async(L,A)=>{m.changeStateLoading(!0),await le(L),$.push({path:Ee.path,query:{...Ee.query,order:L}}),P.value=1,r.value=!0,V(),m.changeStateLoading(!1),(v.value?.cancellation_detail||v.value?.order_status_eng==="Cancel")&&$.push({path:"/profile",query:{menu:"cancelorder",order:L}})},it=async L=>{m.changeStateLoading(!0),await le(L),P.value=1,r.value=!0,_e(),m.changeStateLoading(!1)},k=()=>{const L={...Ee.query};delete L.order,$.replace({query:L})},V=()=>{window.scrollTo({top:0})};function Kt(L){if(!L)return"";const A=L.split(":");if(A.length<2)return L;const _t=A[0],Ct=A[1];return`${_t}:${Ct}`}function He(L){if(!L)return"";const A=["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],_t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],[Ct,At,Wt]=L.split("/").map(Number),de=h.value==="th"?Wt+543:Wt,j=h.value==="th"?A[At-1]||"":_t[At-1]||"";return`${Ct} ${j} ${de}`}async function es(L){if(console.log("type",L),m.changeStateLoading(!0),await w.loadCheckStock(v?.value.order_number),console.log("checkStockPayment :>> ",w.checkStockPayment.is_stock_sufficient),w.checkStockPayment.is_stock_sufficient){if(L==="qrcode")if(D.UploadSlip)D.UploadSlip&&(await w.loadsPaylater(v?.value.order_number,"Qr Code"),Y.value=!0,m.changeStateLoading(!1));else{await w.loadQrCode2(v?.value.order_number),G.value=!0,m.changeStateLoading(!1);try{await w.loadResultPayment2(v?.value.order_number),await Ze(v?.value.order_number),await Ml(),G.value=!1}catch(A){console.log("การตรวจสอบ payment ล้มเหลวหรือถูกยกเลิก:",A)}}else L==="creditcard"?(console.log("credit"),await w.loadCredit2(v?.value.order_number)):L==="ewallet"?(console.log("ewallet"),await w.loadEwallet2(v?.value.order_number)):L==="SPayLater"?
26(console.log("SPayLater"),await w.loadsPaylater(v?.value.order_number,"paylater"),Y.value=!0):L==="truemoney"&&(console.log("truemoney"),await w.loadsPaylater(v?.value.order_number,"truemoney"),Y.value=!0);m.changeStateLoading(!1)}else console.log("สินค้าหมดสต็อกค้าบ :>> "),ds.value=!0;m.changeStateLoading(!1)}async function Ml(){m.changeStateLoading(!0);const L=await Dt("","",void 0,!0),A=await Dt("","Pending",""),_t=await Dt("","Not Paid",""),Ct=await Dt("","Fail",""),At=await Dt("","To Ship",""),Wt=await Dt("","To Receive",""),de=await Dt("","Success",""),j=await Dt("","Cancel","");L.success?(jt.value=L.data.data??"",K.value=jt.value?.all_without_cancel,St.value=jt.value?.pagination?.total,ut.value=A.data?.data?.pagination?.total,vt.value=Ct.data?.data?.pagination?.total,Tt.value=_t.data?.data?.pagination?.total,yt.value=At.data?.data?.pagination?.total,Ft.value=Wt.data?.data?.pagination?.total,N.value=de.data?.data?.pagination?.total,wt.value=j.data?.data?.pagination?.total,q.value=jt.value?.pagination?.total):pt.value=L.data?.message||"โหลดข้อมูลไม่สำเร็จ",S.value=!1,m.changeStateLoading(!1)}function qs(){G.value=!1,w.isCancelled=!0,Y.value=!1,he.value=!1,Q.value=!1}const vi=z(!1);async function Qc(){if(!vi.value){vi.value=!0;try{await w.loadCancelOrder(ht.value,X.value),et.value=!1,await Eo(),w.cancelStatus&&td(`/profile?menu=cancelorder&order=${ht.value}`)}finally{setTimeout(()=>{vi.value=!1},1500)}}}async function Jc(){const L=await Dt(H.value);L.success?jt.value=L.data.data??"":pt.value=L.data?.message||"โหลดข้อมูลไม่สำเร็จ",S.value=!1}function xe(L){return new Intl.NumberFormat("th-TH",{style:"currency",currency:"THB"}).format(L).replace("฿","฿ ")}function Sl(L){return L?Number(L).toLocaleString("th-TH",{minimumFractionDigits:2,maximumFractionDigits:2}):"0.00"}function uo(L){const A=new Date(L);if(isNaN(A.getTime()))return"-";const _t=["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],Ct=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],At=A.getDate(),Wt=h.value==="th"?_t[A.getMonth()]:Ct[A.getMonth()],de=h.value==="th"?A.getFullYear()+543:A.getFullYear(),j=String(A.getHours()).padStart(2,"0"),nt=String(A.getMinutes()).padStart(2,"0");return`${At} ${Wt} ${de} ${j}:${nt}`}const td=L=>{$.push(L)},ed=async L=>{m.changeStateLoading(!0),await Ze(L.order_number),Dl()},Dl=async()=>{r.value===!1&&m.changeStateLoading(!0),console.log("confirm button"),m.changeStateLoading(!0),await w.loadConfirmReceive(v.value?.order_number),await Ze(v.value?.order_number),await Ml(),await Je("to_receive"),m.changeStateLoading(!1)};function od(L){if(L.payment_method=="COD"){if(L.transportation_status==="การจัดส่งสำเร็จ"&&L.buyer_received_status=="received")return s("success");if(L.seller_sent_status=="sent")return s("received_cod");if(L.transaction_status=="Not Paid")return s("shipment_pending")}if(L.transaction_status==="Pending")return s("pending_actions");if(L.transaction_status==="Fail")return s("fail_payment");if(L.payment_transaction_status=="ชำระเงินสำเร็จ"&&L.shipping_type=="front"&&L.buyer_received_status=="received")return s("success");if(L.payment_transaction_status=="ชำระเงินสำเร็จ"&&L.shipping_type=="front")return s("receive_pending");if(L.transportation_status&&L.transportation_status!=="-")return L.transportation_status==="การจัดส่งสำเร็จ"&&L.buyer_received_status=="not_received"?s("receive_pending"):L.transportation_status==="การจัดส่งสำเร็จ"?s("success"):L.transportation_status==="อยู่ระหว่างดำเนินการ"&&L?.seller_sent_status=="not_sent"||L.transportation_status==="อยู่ระหว่างการขนส่ง"&&L?.seller_sent_status=="not_sent"?s("shipment_pending"):L.transportation_status==="อยู่ระหว่างการขนส่ง"&&L?.seller_sent_status=="sent"||L.transportation_status==="อยู่ระหว่างการขนส่ง"||L.transportation_status==="อยู่ระหว่างดำเนินการ"?s("receive_pending"):L.transportation_status;switch(L.payment_transaction_status){case"เกินกำหนดชำระเงิน":return s("order_can");case"ชำระเงินสำเร็จ":return s("shipment_pending");case"ยังไม่ชำระเงิน":return s("payment_pending");default:return L.payment_transaction_status}}const sd=async()=>{const L=Fl.value;if(L){m.changeStateLoading(!0);for(const A of L){const _t={role_user:"ext_buyer",order_number:v.value?.order_number,product_id:A.product_id,stars:Ds.value[A.product_id]??5,comment:Zs.value[A.product_id]||"",hide_username:R.value==!0?"yes":"no",image_upload:ho.value[A.product_id]?.map(Ct=>({image_data:Ct.url}))||[],video_upload:Xe.value[A.product_id]?[{video_data:Xe.value[A.product_id].url}]:[]};try{await nd(_t),console.log("ส่ง payload:",_t)}catch(Ct){console.error("ส่งรีวิวล้มเหลว",A.product_name,Ct)}}kt.value=!0,m.changeStateLoading(!1)}},nd=async L=>{S.value=!0;try{const A=nn(),_t=Ls("auth_token").value,Ct=await $fetch(`${A.public.API_BASE_URL}
26backend/api/erp/comment_product`,{method:"POST",headers:{"api-key":A.public.API_KEY,"api-secret":A.public.API_SECRET,Authorization:`Bearer ${_t}`},body:L})}catch(A){pt.value="โหลดข้อมูลรายละเอียดล้มเหลว",console.error("detail fetch error:",A)}S.value=!1},id=lt(()=>{const L=v.value?.payment_data?.payment_status,A=v.value?.shipping_type;return A==="front"&&L==="Not Paid"?s("payment_pending"):A==="front"&&L==="Success"&&v.value?.received_date==""?s("receive_pending"):v.value?.buyer_received_status=="received"?s("success"):L==="Success"&&v.value?.sent_date!="-"&&v.value?.seller_sent_status!="not_sent"?s("receive_pending"):v.value?.payment_data?.payment_channel=="COD"?v.value?.sent_date!="-"&&v.value?.seller_sent_status!="not_sent"?s("receive_pending"):s("shipment_pending"):L==="Success"?s("shipment_pending"):L==="Not Paid"?s("payment_pending"):L==="Pending"?s("pending_actions"):L==="Fail"?s("fail_payment"):L||""}),ld=async()=>{r.value=!1,kt.value=!1,Rt.value=!1};function rd(){ds.value=!1,window.location.reload()}const gi=lt(()=>w.userReviewDetial),Al=async L=>{m.changeStateLoading(!0),await w.loadDetailReceive(L),await Ke(),ft.value=!0,m.changeStateLoading(!1)};function ad(L){const A=L.category_data.category_name==="Default Category"?Ee.query.category_name:L.category_data.category_name;$.push({path:"/products/detail",query:{product_id:L.product_id,category_id:Ee.query.category_id||"",category:A||"",status_product:Ee.query.status_product||""}})}const cd=()=>{const L={...Ee.query};delete L.showContent,$.replace({query:L})};function zl(){Jt.value=!1}async function jl(L,A){m.changeStateLoading(!0),ve.value=L,go.value=A,L.video_data.length>0&&(Tl.value=await Pl(L.video_data[0].media_path)),Oe.value=!0,m.changeStateLoading(!1)}const dd=L=>/\.(mp4|webm|ogg)$/i.test(L),ud=L=>L&&L.normalize("NFC").replace(/([\u0E01-\u0E2E])([\u0E31\u0E34-\u0E37\u0E47-\u0E4E]+)/g,(A,_t,Ct)=>{const At=[];for(const Wt of Ct)if(At.includes(Wt)||At.push(Wt),At.length===2)break;return _t+At.join("")});function hd(L){return L.replace(/\r\n/g,`
27`).replace(/\n/g,"")}function pd(L){let A=hd(L.target.value);Array.from(A).length>nr&&(A=Array.from(A).slice(0,nr).join("")),X.value=A}const bi=z({}),Tl=z(""),Pl=(L,A=1)=>new Promise(_t=>{const Ct=document.createElement("video");Ct.src=L,Ct.crossOrigin="anonymous",Ct.muted=!0,Ct.playsInline=!0,Ct.addEventListener("loadeddata",()=>{Ct.currentTime=A}),Ct.addEventListener("seeked",()=>{const At=document.createElement("canvas");At.width=Ct.videoWidth,At.height=Ct.videoHeight,At.getContext("2d").drawImage(Ct,0,0),_t(At.toDataURL("image/jpeg"))})}),fd=(L,A)=>{const _t=u.value.find(de=>de.iso===A);if(!_t)return console.warn(`ไม่พบรหัสประเทศสำหรับ ISO: ${A}`),L;const Ct=_t.code;let At=L;return At.startsWith("0")&&(At=At.slice(1)),(Ct.startsWith("+")?Ct:`+${Ct}`)+At};pe(()=>gi.value?.product_list,async L=>{if(L)for(const A of L)for(const _t of A.reviews||[]){if(!_t.video_data?.length)continue;const Ct=_t.review_id,At=_t.video_data[0].media_path,Wt=`order_video_thumb_${Ct}`,de=localStorage.getItem(Wt);if(de){bi.value[Ct]=de;continue}const j=await Pl(At);bi.value[Ct]=j,localStorage.setItem(Wt,j)}},{immediate:!0});const Ll=L=>{if(!L)return"";const A=O.getProvince.find(_t=>_t.name_th===L||_t.name_en===L);return A?h.value==="th"?A.name_th:A.name_en:L},Rl=L=>{if(!L)return"";const A=O.originalAmphures.find(_t=>_t.name_th===L||_t.name_en===L);return A?h.value==="th"?A.name_th:A.name_en:L},Ol=L=>{if(!L)return"";const A=O.originalTambon.find(_t=>_t.name_th===L||_t.name_en===L);return A?h.value==="th"?A.name_th:A.name_en:L},_d=lt(()=>{const L=jt.value?.pagination;return L?(L.current_page-1)*L.per_page+1:0}),md=lt(()=>{const L=jt.value?.pagination;return L?L.current_page*L.per_page:0}),Bl=lt(()=>{const L=jt.value?.pagination,A=Number(L?.last_page)||0,_t=Number(L?.current_page)||1,Ct=[];if(A>4)_t<3?Ct.push(1,2,3,"...",A):_t==3&&A==5?Ct.push(1,2,3,4,5):_t>=A-2?Ct.push(1,"...",A-2,A-1,A):Ct.push(1,"...",_t-1,_t,_t+1,"...",A);else for(let At=1;At<=A;At++)Ct.push(At);return Ct}),El=lt(()=>{const L=v.value;if(!L)return!1;const A=L?.payment_data?.payment_status,_t=A==="Not Paid"||A==="Fail",Ct=A==="Success"&&!D.UploadSlip,At=(_t||Ct)&&L?.tracking_data?.tracking_number==="-",Wt=_t&&L?.payment_data?.payment_channel!=="COD",de=L?.accept_product_data?.status==="waiting_accept"&&L?.shipping_status==="การจัดส่งสำเร็จ"&&A!=="Not Paid",j=L?.accept_product_data?.status==="waiting_review"&&L?.shipping_status==="การจัดส่งสำเร็จ"&&A!=="Not Paid"||!L.accept_product_data.review_at&&L.buyer_received_status==="received"&&L.shipping_type==="front"&&D.hasReview,nt=L?.accept_product_data?.status==="success"&&D.hasReview;return At||Wt||de||j||nt}),Ds=z({}),ho=z({}),Xe=z({}),Fo=z({}),$o=z({}),Zs=z({}),Fl=lt(()=>{const L={};
27return(v.value?.order_items?.[0]?.product_items||[]).forEach(_t=>{const Ct=_t.product_id;L[Ct]||(L[Ct]={..._t,attributes:[]});const At=_t.product_attribute;let Wt=[];At?.attribute_key_1&&At?.attribute_priority_1&&Wt.push(`${h.value==="th"?At.attribute_key_1:At.attribute_key_1_en||At.attribute_key_1}: ${h.value==="th"?At.attribute_priority_1:At.attribute_priority_1_en||At.attribute_priority_1}`),At?.attribute_key_2&&At?.attribute_priority_2&&Wt.push(`${h.value==="th"?At.attribute_key_2:At.attribute_key_2_en||At.attribute_key_2}: ${h.value==="th"?At.attribute_priority_2:At.attribute_priority_2_en||At.attribute_priority_2}`),Wt.length&&L[Ct].attributes.push(Wt.join(" , "))}),Object.values(L)}),vd=lt(()=>{const L=gi.value?.product_list||[],A={};return L.forEach(_t=>{const Ct=_t.product_id;A[Ct]||(A[Ct]={..._t,attributes:[],reviews:_t.reviews?.length?[_t.reviews[0]]:[]});const At=_t.product_attribute_detail;if(At){let Wt=[];At.attribute_priority_1&&Wt.push(`${h.value==="th"?At.key_1_value:At.key_1_value_en||At.key_1_value} : ${h.value==="th"?At.attribute_priority_1:At.attribute_priority_1_en||At.attribute_priority_1}`),At.attribute_priority_2&&Wt.push(`${h.value==="th"?At.key_2_value:At.key_2_value_en||At.key_2_value} : ${h.value==="th"?At.attribute_priority_2:At.attribute_priority_2_en||At.attribute_priority_2}`),Wt.length&&A[Ct].attributes.push(Wt.join(" , "))}}),Object.values(A)}),Il=async L=>{m.changeStateLoading(!0);const A=await w.loadRepeatOrder(L.order_number);L.product_list?Zt.value=L.product_list:Zt.value=(L.order_items??[]).flatMap(de=>(de.product_items??[]).map(j=>({product_id:j.product_id,quantity:j.quantity,product_attribute_detail:{product_attribute_id:j.product_attribute.attribute_id}}))),console.log("product_repeat",Zt.value),m.changeStateLoading(!1),console.log("result repeat order :>> ",A?.message);const _t=Zt.value.length,Ct=A?.data?.product_list_out_stock??[],At=A?.data?.product_list_not_found??[],Wt=A?.data?.product_list_exceed_max_per_order??[];if(A?.code===500){d.trigger(s("no_items_found"),"error");return}if(Ct.length>0){d.trigger(s("temp_OutStock"),"error"),_t>1&&$.push("/cart");return}if(At.length>0){d.trigger(s("no_items_found"),"error");return}if(Wt.length>0){d.trigger(s("MaxperOrder"),"error"),$.push("/cart");return}(A?.message==="Repeat Order Success [Create New Cart]."||A?.message==="Repeat Order Success [Update Cart].")&&$.push("/cart")};async function gd(){qt.value=!0}function bd(){qt.value=!1}async function xd(L){m.changeStateLoading(!0);let A={order_number:L,account_name:"",phone:"",bank_code:"",bank_name:"",account_no:"",remark:""};try{(await I(A))?.code===200?It.value=!0:d.trigger(s("error_request"),"error")}catch(_t){console.error(_t)}finally{m.changeStateLoading(!1)}}async function yd(){It.value=!1,$.push({path:"/profile",query:{menu:"cancelorder",order:v.value?.order_number}})}return(L,A)=>{const _t=Sm,Ct=Ld,At=Ed,Wt=Fd,de=Aa;return p(),f(at,null,[zt(xi,{visible:kt.value,onClose:qs,canClose:!1},{default:ne(()=>[i("div",fv,[i("p",_v,c(n(s)("score")),1),i("p",mv,c(n(s)("comment")),1),A[37]||(A[37]=i("hr",{class:"border-[#D1D1D1] my-4 w-full"},null,-1)),i("button",{class:"cursor-pointer text-white hover:text-[#D1D1D1] w-full rounded-full h-10 font-bold",style:b({backgroundColor:n(D).color}),onClick:A[0]||(A[0]=j=>{ld(),Je("success")})},c(n(s)("understood")),5)])]),_:1},8,["visible"]),zt(xi,{visible:It.value,canClose:!1},{default:ne(()=>[i("div",{class:"flex flex-col justify-center items-center p-6 md:p-8 gap-4 md:gap-8",style:b({color:n(D).black})},[i("p",vv,[i("span",gv,c(n(s)("order_cancelled_successfully")),1),i("span",bv,c(n(s)("refund_in_30")),1)]),i("div",xv,[i("button",{onClick:A[1]||(A[1]=j=>yd()),class:"w-full py-[6px] md:py-2 text-sm xl:text-base text-white rounded-full font-bold cursor-pointer",style:b({backgroundColor:n(D).color})},c(n(s)("view_order_detail")),5)])],4)]),_:1},8,["visible"]),zt(_t,{visible:he.value,onClose:qs,canClose:!1},{default:ne(()=>[i("video",{controls:"",src:E.value,class:"w-full h-100 rounded"},null,8,yv)]),_:1},8,["visible"]),zt(_t,{visible:Q.value,onClose:qs,canClose:!1},{default:ne(()=>[i("img",{src:mt.value||n(re),class:"w-full h-full object-contain rounded"},null,8,wv)]),_:1},8,["visible"]),zt(Ct,{visible:Oe.value,onClose:A[4]||(A[4]=j=>zl()),canClose:!1},{default:ne(()=>[i("div",kv,[i("p",$v,c(n(s)("img_review")),1),i("button",{class:"cursor-pointer text-gray-500 hover:text-black",onClick:A[2]||(A[2]=j=>Oe.value=!1)}
27," ✖ ")]),A[42]||(A[42]=i("hr",{class:"border-[#D1D1D1]"},null,-1)),i("div",Cv,[i("div",Mv,[ve.value.user_image?(p(),f("img",{key:0,src:ve.value.user_image,alt:"user avatar",class:"w-12 h-12 rounded-full object-cover shrink-0"},null,8,Sv)):(p(),f("svg",{key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-12 h-12 rounded-full p-1 shrink-0",style:b({color:n(D).color})},[...A[38]||(A[38]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"},null,-1)])],4)),i("div",null,[i("p",Dv,c(ve.value.created_by),1),i("div",Av,[(p(),f(at,null,xt(5,j=>i("span",{key:j,style:b({color:n(D).color})},[j<=ve.value.stars?(p(),f("svg",zv,[...A[39]||(A[39]=[i("path",{d:"M3.612 15.443c-.396.198-.86-.106-.746-.555l.83-4.73-3.523-3.356c-.33-.315-.158-.888.283-.95l4.898-.696 2.186-4.437c.197-.4.73-.4.927 0l2.186 4.437 4.898.696c.441.062.613.635.283.95l-3.523 3.356.83 4.73c.114.449-.35.753-.746.555L8 13.187l-4.389 2.256z"},null,-1)])])):(p(),f("svg",jv,[...A[40]||(A[40]=[i("path",{d:"M12 .587l3.668 7.431L24 9.753l-6 5.847 1.417 8.27L12 19.771l-7.417 4.099L6 15.6 0 9.753l8.332-1.735z"},null,-1)])]))],4)),64))])])]),i("p",Tv,c(ve.value.comment),1),i("div",Pv,[dd(Te.value)?(p(),f("video",{key:0,controls:"",src:Te.value,class:"w-full h-full rounded"},null,8,Lv)):(p(),f("img",{key:1,src:Te.value,class:"w-full h-full object-contain"},null,8,Rv))]),i("div",Ov,[(p(!0),f(at,null,xt(ve.value.image_data,(j,nt)=>(p(),f("div",{key:nt,onClick:Bt=>Te.value=j.media_path,class:J(["w-[52px] h-[52px] md:w-20 md:h-20 rounded-lg overflow-hidden cursor-pointer",{"border-[var(--border-color)] border-2":Te.value===j.media_path}]),style:b({"--border-color":n(D).color})},[i("img",{src:j.media_path,class:"w-full h-full object-cover"},null,8,Ev)],14,Bv))),128)),ve.value?.video_data.length>0?(p(),f("div",{key:0,class:"w-[52px] h-[52px] md:w-20 md:h-20 rounded overflow-hidden relative cursor-pointer",onClick:A[3]||(A[3]=j=>Te.value=ve.value.video_data[0].media_path)},[i("img",{src:Tl.value,class:"w-full h-full object-cover"},null,8,Fv),i("div",Iv,[A[41]||(A[41]=i("span",{class:"text-white text-xs"},[i("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"white",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-3 md:size-6"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"})])],-1)),i("span",Nv,c(ve.value.video_data[0].video_duration||"0:00"),1)])])):C("",!0)])])]),_:1},8,["visible"]),zt(Nl,{isOpen:Rt.value,title:n(s)("review"),onClose:wo},{footer:ne(()=>[i("div",mg,[bt(i("input",{type:"checkbox","onUpdate:modelValue":A[6]||(A[6]=j=>R.value=j),class:"w-5 h-5 rounded-full cursor-pointer border-2 transition-all duration-200",style:b({"accent-color":n(D).colorcheckbox})},null,4),[[Rs,R.value]]),i("p",vg,c(n(s)("hide")),1)]),i("div",gg,[i("button",{onClick:wo,class:"cursor-pointer flex-1 py-3 border border-red-600 text-red-600 rounded-full text-center font-medium hover:[background-color:var(--hover-color)] transition",style:b({borderColor:n(Mt),color:n(Mt),"--hover-color":n(D).bg_hover_button})},c(n(s)("cancel")),5),i("button",{onClick:sd,class:J(["flex-1 py-3 rounded-full text-center font-medium transition",["hover:bg-sky-700 cursor-pointer text-white"]]),style:b(`background-color: ${n(Mt)};`)},c(n(s)("confirm")),5)])]),default:ne(()=>[(p(!0),f(at,null,xt(n(Fl),(j,nt)=>(p(),f(at,{key:nt},[i("div",Hv,[i("div",Vv,[i("img",{src:j?.product_image_original||j?.product_image||n(re),alt:j?.product_name,class:"w-[46px] h-[46px] md:h-15 md:w-15 !object-contain rounded"},null,8,Wv),i("div",null,[i("p",Uv,c(n(h)==="th"?j?.product_name:j?.product_name_en||j?.product_name),1),j.attributes.length?(p(),f("div",Yv,c(j.attributes.join(" , ")),1)):C("",!0)])])]),i("div",null,[i("div",qv,[i("p",Zv,c(n(s)("rate")),1),i("div",Xv,[i("div",Kv,[(p(),f(at,null,xt(5,Bt=>zt(ls(Bt<=(Ds.value[j.product_id]??5)?n(Wd):n(qd)),{key:Bt,style:b({color:Bt<=(Ds.value[j.product_id]??5)?n(D).color:"#D1D5DB"}),class:"w-6 h-6 cursor-pointer transition-transform hover:scale-110",onClick:Fe=>Nt(j,Bt)},null,8,["style","onClick"])),64))]),i("span",Gv,c(qe(Ds.value[j.product_id])),1)])])]),i("div",null,[i("p",Qv,c(n(s)("write_review")),1),i("div",Jv,[bt(i("textarea",{"onUpdate:modelValue":Bt=>Zs.value[j.product_id]=Bt,placeholder:n(s)("share"),maxlength:"200",class:"w-full border border-gray-300 rounded-md p-2 text-sm h-25 focus:border-[color:var(--counter-color)] focu
27s:outline-none transition-colors duration-200",style:b({"--counter-color":n(D).color})},null,12,tg),[[Lt,Zs.value[j.product_id]]])]),i("p",eg,c(Zs.value[j.product_id]?.length||0)+"/200 ",1)]),i("div",null,[i("p",og,c(n(s)("video_upload")),1),i("p",sg,c(n(s)("size")),1),i("div",ng,[(p(!0),f(at,null,xt(ho.value[j.product_id]||[],(Bt,Fe)=>(p(),f("div",{key:"img-"+Fe,class:"relative w-24 h-24 flex-shrink-0 rounded-lg overflow-hidden border-2 border-gray-100"},[i("img",{src:Bt.url,class:"w-full h-full object-cover"},null,8,ig),i("button",{class:"absolute top-1 right-1 text-white text-xs rounded-full px-1 cursor-pointer",style:b({backgroundColor:n(D).color}),onClick:wd=>Et(j,Fe)},"✕",12,lg)]))),128)),Xe.value[j.product_id]?(p(),f("div",rg,[Xe.value[j.product_id]?(p(),f("video",{key:0,src:Xe.value[j.product_id]?.url?.includes("#t=")?Xe.value[j.product_id]?.url:Xe.value[j.product_id]?.url+"#t=0.001",class:"w-full h-full object-cover",muted:"",playsinline:"",preload:"metadata",crossorigin:"anonymous",onError:A[5]||(A[5]=Bt=>console.error("Video load error:",Bt))},null,40,ag)):C("",!0),i("div",cg,[A[43]||(A[43]=i("span",{class:"text-white text-xs"},[i("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"white",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"})])],-1)),i("span",dg,c(Xe.value[j.product_id]?.video_duration||"0:00"),1)]),i("button",{class:"absolute top-1 right-1 text-white text-xs rounded-full px-1 cursor-pointer",style:b({backgroundColor:n(D).color}),onClick:Bt=>ce(j)},"✕",12,ug)])):C("",!0),(j._images?.length||0)<4&&ho.value[j.product_id]?.length!==4?(p(),f("label",{key:1,class:J(["size-20 flex-shrink-0 flex flex-col items-center justify-center border-2 border-dashed rounded-lg cursor-pointer hover:bg-gray-50",[Fo.value[j.product_id]?"border-[#C4021A]":"border-gray-300"]])},[i("div",{class:"flex flex-col items-center justify-center text-sm",style:b({color:n(D).color})},[A[44]||(A[44]=i("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z"}),i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z"})],-1)),i("span",null,c(n(s)("image")),1),i("p",null,"("+c(ho.value[j.product_id]?.length||0)+"/4)",1)],4),i("input",{type:"file",accept:"image/png, image/jpeg",multiple:"",class:"hidden",onChange:Bt=>Ko(j,Bt)},null,40,hg)],2)):C("",!0),Xe.value[j.product_id]?C("",!0):(p(),f("label",{key:2,class:J(["size-20 flex-shrink-0 flex flex-col items-center justify-center border-2 border-dashed rounded-lg cursor-pointer hover:bg-gray-50",$o.value[j.product_id]?"border-[#C4021A]":"border-gray-300"])},[i("div",{class:"flex flex-col items-center justify-center text-sm",style:b({color:n(D).color})},[A[45]||(A[45]=i("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"})],-1)),i("span",null,c(n(s)("video")),1),i("p",null,"("+c(j._video?1:0)+"/1)",1)],4),i("input",{type:"file",accept:"video/mp4",class:"hidden",onChange:Bt=>Xt(j,Bt)},null,40,pg)],2))])]),Fo.value[j.product_id]||$o.value[j.product_id]?(p(),f("div",fg,[A[46]||(A[46]=i("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4 text-[#C4021A] shrink-0"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75
27a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})],-1)),i("p",_g,[Fo.value[j.product_id]==="type"?(p(),f(at,{key:0},[gt(c(n(s)("upload_unsuccess_image")),1)],64)):Fo.value[j.product_id]==="size"?(p(),f(at,{key:1},[gt(c(n(s)("upload_unsuccess")),1)],64)):$o.value[j.product_id]==="type"?(p(),f(at,{key:2},[gt(c(n(s)("upload_unsuccess_image")),1)],64)):$o.value[j.product_id]==="size"?(p(),f(at,{key:3},[gt(c(n(s)("upload_unsuccess")),1)],64)):(p(),f(at,{key:4},[gt(c(n(s)("error")),1)],64))])])):C("",!0),A[47]||(A[47]=i("hr",{class:"my-6 border-t-1 border-gray-300"},null,-1))],64))),128))]),_:1},8,["isOpen","title"]),zt(Rm,{isOpen:ft.value,title:n(s)("review_my_product"),onClose:wo},{default:ne(()=>[(p(!0),f(at,null,xt(n(vd),(j,nt)=>(p(),f(at,{key:nt},[i("div",bg,[i("div",xg,[i("img",{onClick:Bt=>ad(j),src:j?.product_image_original||j?.product_image||n(re),alt:j?.product_name,class:"w-15 h-15 !object-contain rounded cursor-pointer"},null,8,yg),i("div",null,[i("p",wg,c(n(h)==="th"?j?.product_name:j?.product_name_en||j?.product_name),1),j.attributes.length?(p(),f("div",kg,c(j.attributes.join(" , ")),1)):C("",!0)])])]),(p(!0),f(at,null,xt(j.reviews,Bt=>(p(),f("div",{key:Bt.id,class:"pt-4"},[i("div",$g,[Bt.user_image?(p(),f("img",{key:0,src:Bt.user_image,alt:"user avatar",class:"w-12 h-12 rounded-full object-cover shrink-0 allow-rounded"},null,8,Cg)):(p(),f("svg",{key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-12 h-12 rounded-full p-1 shrink-0",style:b({color:n(D).color})},[...A[48]||(A[48]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"},null,-1)])],4)),i("div",Mg,[i("p",Sg,c(Bt.created_by),1),i("div",Dg,[(p(),f(at,null,xt(5,Fe=>i("span",{key:Fe,style:b({color:n(D).color})},[Fe<=Bt.stars?(p(),f("svg",Ag,[...A[49]||(A[49]=[i("path",{d:"M3.612 15.443c-.396.198-.86-.106-.746-.555l.83-4.73-3.523-3.356c-.33-.315-.158-.888.283-.95l4.898-.696 2.186-4.437c.197-.4.73-.4.927 0l2.186 4.437 4.898.696c.441.062.613.635.283.95l-3.523 3.356.83 4.73c.114.449-.35.753-.746.555L8 13.187l-4.389 2.256z"},null,-1)])])):(p(),f("svg",zg,[...A[50]||(A[50]=[i("path",{d:"M12 .587l3.668 7.431L24 9.753l-6 5.847 1.417 8.27L12 19.771l-7.417 4.099L6 15.6 0 9.753l8.332-1.735z"},null,-1)])]))],4)),64))]),i("p",jg,c(Bt.comment),1),i("div",Tg,[(p(!0),f(at,null,xt(Bt.image_data,Fe=>(p(),f("img",{key:Fe.id,src:Fe.media_path||n(re),class:"w-20 h-20 object-cover rounded-lg border-2 border-gray-100 cursor-pointer",onClick:wd=>jl(Bt,{type:"image",src:Fe.media_path})},null,8,Pg))),128)),Bt.video_data.length>0?(p(),f("div",{key:0,class:"w-20 h-20 rounded overflow-hidden relative cursor-pointer",onClick:Fe=>jl(Bt,{type:"video",src:Bt.video_data[0].media_path})},[i("img",{src:bi.value[Bt.review_id]||n(Rd),class:"w-full h-full object-cover"},null,8,Rg),i("div",Og,[A[51]||(A[51]=i("span",{class:"text-white text-xs"},[i("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"white",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"})])],-1)),i("span",Bg,c(Bt.video_data[0].video_duration||"0:00"),1)])],8,Lg)):C("",!0)]),i("div",Eg,c(He(Bt.date))+", "+c(Kt(Bt.time)),1)])]),A[52]||(A[52]=i("hr",{class:"mb-6 border-t-1 border-gray-300"},null,-1))]))),128))],64))),128))]),_:1},8,["isOpen","title"]),zt(Pd,{visible:ds.value,onClose:rd,canClose:!0},{default:ne(()=>[i("h2",Fg,c(n(s)("stock_alert")),1),i("div",Ig,[i("img",{src:n(Bd),alt:"",style:{width:"150px",height:"auto"}},null,8,Ng)])]),_:1},8,["visible"]),zt(Nl,{isOpen:Pt.value,title:n(s)("select_payment_method"),onClose:yo},{footer:ne(()=>[i("div",Jg,[i("button",{onClick:yo,class:"cursor-pointer flex-1 py-3 border border-red-600 text-red-600 rounded-full text-center font-medium hover:[background-color:var(--hover-color)] transition",style:b({borderColor:n(Mt),color:n(Mt),"--hover-color":n(D).bg_hover_button})},c(n(s)("cancel")),5),i("button",{onClick:A[8]||(A[8]=j=>Ys()),disabled:L.isConfirmDisabled,class:J(["flex-1 py-3 rounded-full text-center font-medium transition",[L.isConfirmDisabled?"bg-gray-300 text-gray-500 cursor-not-allowed":"hover:bg-sky-700 cursor-pointer text-white"]]),style:b(L.isConfirmDisabled?"":`background-color: ${n(Mt)};`)},c(n(s)("confirm")),15,tb)])]),default:ne(()=>[i("div",null,[i("p",Hg,c(n(s)("other_payment_methods")),1),i("div",Vg,[(p(!0),f(at,null,xt(Ne.value,(j,nt)=>(p(),f("div",{key:nt,onClick:Bt=>T.value=j,class:J(["flex items-center border rounded-lg cursor-pointer px-4 py-3 mt-6 transition duration-150",T.value===j?"border-[var(--border-color)] bg-[var(--selection-bg)]":"border-[var(--border-color)]"]),style:b({"--border-color":n(D).color,"--selection-bg":n(D).bg_color2})},[i("div",Ug,[j.icon?(p(),f("span",{key:0,innerHTML:j.icon,class:"w-full h-full text-gray-600"},null,8,Yg)):(p(),f("img",{key:1,src:j.image,class:"w-full h-full object-contain",alt:"payment image"},null,8,qg))]),i("div",Zg,[i("p",Xg,c(n(h)==="th"?j.label:j.label_en||j.label),1),i("p",Kg,c(n(h)==="th"?j.description:j.description_en||j.description),1)]),i("div",Gg,[bt(i("input",{type:"radio",class:"appearance-none w-5 h-5 rounded-full border-1 border-[var(--radio-color)] checked:border-[var(--radio-color)] checked:bg-[var(--radio-color)] bg-transparent bg-clip-content p-[3px] curs
27or-pointer transition-all duration-200 outline-none",style:b({"--radio-color":n(D).colorcheckbox}),value:j,"onUpdate:modelValue":A[7]||(A[7]=Bt=>T.value=Bt)},null,12,Qg),[[jo,T.value]])])],14,Wg))),128))])])]),_:1},8,["isOpen","title"]),zt(Wl,{visible:Y.value,onClose:qs,canClose:!0},{default:ne(()=>[i("h2",eb,c(n(D).BankOrQrcode?n(s)("pay_by_bank"):n(s)("scan_qr_code_to_pay")),1),n(w).qrCode2.data?.img_base64?(p(),f("img",{key:0,src:"data:image/png;base64,"+n(w).qrCode2.data?.img_base64||"",style:b({border:"6px solid "+n(Mt),borderRadius:"8px"}),class:"mx-auto w-60 h-full"},null,12,ob)):C("",!0),i("div",sb,[i("p",nb,c(n(s)("payment_amount",{count:Sl(n(w).qrCode2.data?.net_price)})),1)]),i("div",ib,[i("p",lb,c(n(s)("reference_code"))+" : "+c(n(w).qrCode2.data?.ref1||""),1),i("p",rb,[i("span",null,c(n(s)("payment_steps_mobile")),1),i("span",ab,c(n(s)("payment_steps_mobile2")),1),i("span",cb,c(n(s)("payment_steps_mobile2")),1)])]),i("div",db,[i("p",null,"1. "+c(n(D).BankOrQrcode?n(s)("open_banking_app"):n(s)("save_qr_code_image")),1),i("p",null,"2. "+c(n(D).BankOrQrcode?n(s)("select_menu_payment"):n(s)("open_banking_app")),1),i("p",null,"3. "+c(n(D).BankOrQrcode?n(s)("select_bank_payment"):n(s)("select_screenshot_to_scan")),1)]),i("div",ub,[A[53]||(A[53]=i("div",{class:"border-t border-gray-300 mb-4"},null,-1)),i("div",hb,[i("button",{onClick:A[9]||(A[9]=j=>y()),class:"border-[1px] rounded-3xl md:w-65 px-4 py-2 hover:[background-color:var(--hover-color)] cursor-pointer",style:b({borderColor:n(Mt),color:n(Mt),"--hover-color":n(D).bg_hover_button})},c(n(s)("save_image")),5),i("button",{onClick:us,class:"rounded-3xl md:w-65 px-4 py-2 text-white hover:[background-color:var(--hover-color)] cursor-pointer",style:b({backgroundColor:n(Mt)})},c(n(s)("confirm_payment")),5)])])]),_:1},8,["visible"]),zt(Wl,{visible:G.value,onClose:qs,canClose:!0},{default:ne(()=>[i("h2",pb,c(n(s)("scan_qr_code_to_pay")),1),i("img",{src:"data:image/png;base64,"+n(w).qrCode2?.data?.img_base64||"",style:b({border:"6px solid "+n(Mt),borderRadius:"9px"}),class:"mx-auto w-50 h-50 md:w-60 md:h-60"},null,12,fb),i("div",_b,[i("p",mb,c(n(s)("payment_amount",{count:Sl(n(w).qrCode2.data?.net_price)})),1)]),i("div",vb,[i("p",gb,c(n(s)("reference_code"))+" : "+c(n(w).qrCode2.data?.ref1||""),1),i("p",bb,[i("span",null,c(n(s)("payment_steps_mobile")),1)])]),i("div",xb,[i("p",null,"1. "+c(n(s)("save_qr_code_image")),1),i("p",null,"2. "+c(n(s)("open_banking_app")),1),i("p",null,"3. "+c(n(s)("select_screenshot_to_scan")),1)]),i("div",yb,[A[54]||(A[54]=i("div",{class:"border-t border-gray-300 mb-2 sm:mb-4"},null,-1)),i("button",{onClick:A[10]||(A[10]=j=>g()),class:"w-full px-4 py-2 text-white rounded-full cursor-pointer",style:b({backgroundColor:n(Mt)})},c(n(s)("save_image")),5)])]),_:1},8,["visible"]),zt(At,{visible:et.value,canClose:!1},{default:ne(()=>[i("h2",wb,c(n(s)("order_cancelled")),1),i("div",kb,[i("hr",{class:"h-[1px] w-full",style:b({borderColor:n(D).underline_color})},null,4),i("div",$b,[i("div",Cb,[i("p",Mb,c(n(s)("order_id")),1),i("td",Sb,c(ht.value),1)]),i("div",Db,[i("p",Ab,c(n(s)("customer_name")),1),i("td",zb,c(ct.value),1)]),i("div",jb,[i("p",Tb,c(n(s)("order_date")),1),i("td",Pb,c(uo(dt.value)),1)])]),A[57]||(A[57]=i("div",{class:"border-b xl:mx-8 border-[#D1D1D1]"},null,-1)),i("div",Lb,[gt(c(n(s)("cancellation_reason"))+" ",1),A[55]||(A[55]=i("span",{class:"text-red-500"},"*",-1)),i("div",Rb,[bt(i("textarea",{maxlength:"200",onInput:pd,"onUpdate:modelValue":A[11]||(A[11]=j=>X.value=j),placeholder:n(s)("note_placeholder"),class:"w-full h-[100px] px-4 pt-4 border border-gray-300 rounded-lg resize-none focus:border-[var(--input-text-border)] outline-none",style:b({"--input-text-border":n(D).color})},null,44,Ob),[[Lt,X.value]]),i("div",Bb,c(Array.from(X.value||"").length)+"/200 ",1)]),A[56]||(A[56]=i("hr",{class:"mt-4 border-t-1 border-[#D1D1D1]"},null,-1)),i("div",Eb,[i("button",{onClick:A[12]||(A[12]=j=>et.value=!1),class:"px-4 py-2 rounded-full text-sm font-medium hover:bg-opacity-10 focus:outline-none focus:ring-opacity-50 cursor-pointer w-full",style:b({border:`1px solid ${n(D).color}`,color:n(D).color,backgroundColor:"transparent","--tw-ring-color":n(D).color})},c(n(s)("cancel")),5),i("button",{disabled:!X.value,onClick:A[13]||(A[13]=j=>Qc()),class:"px-4 py-2 text-white rounded-full cursor-pointer disabled:cursor-not-allowed w-full",style:b({backgroundColor:X.value?n(D).color:"#D1D5DB"})},c(n(s)("confirm")),13,Fb)])])])]),_:1},8,["visible"]),zt(Wt,{isOpen:qt.value,onClose:bd,orderNumber:ht.value,orderDate:uo(dt.value),userName:ct.value},null,8,["isOpen","orderNumber","orderDate","userName"]),r.value?C("",!0):(p(),f("div",Ib,[i("div",Nb,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:A[14]||(A[14]=j=>{tt.value=!1,cd()})},[...A[58]||(A[58]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("h1",Hb,c(n(s)("order_list")),1)]),i("div",Vb,[i("div",Wb,[(p(!0),f(at,null,xt(n(hs),j=>(p(),f("button",{key:j.id,class:J(["w-full py-2 px-1 whitespace-nowrap cursor-pointer text-[10px] md:text-[12px]",l.value===j.id?"border-b-3 font-medium":"text-gray-500"]),style:b(`border-color:${n(Mt)}`),onClick:nt=>Je(j.id)},c(j.name)+" ("+c(j.count)+") ",15,Ub))),128))])]),i("div",Yb,[A[59]||(A[59]=i("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[i("svg",{class:"h-5 w-5 text-gray-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[i("circle",{cx:"11",cy:"11",r:"8"}),i("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})])],-1)),bt(i("input",{type:"text",onInput:co,"onUpdate:modelValue":A[15]||(A[15]=j=>H.value=j),onKeyup:Da(Jc,["enter"]),class:"w-full placeholder:text-[#A4A4A4] pl-10 pr-4 text-base py-2 rounded-full focus:border-transparent border border-[#D1D1D1
27] focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(D).color}),placeholder:n(s)("search_orders")},null,44,qb),[[Lt,H.value]]),H.value?(p(),f("button",{key:0,onClick:A[16]||(A[16]=j=>(H.value="",mi())),class:"absolute inset-y-0 right-0 flex items-center pr-3 cursor-pointer text-gray-400 hover:text-gray-600"}," ✕ ")):C("",!0)])])),r.value?C("",!0):(p(),f("div",Zb,[Array.isArray(K.value)&&K.value.length===0?(p(),f("div",Xb,[i("div",Kb,[(p(),f("svg",{class:"h-14 w-14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",style:b(`color:${n(Mt)}`)},[...A[60]||(A[60]=[i("path",{d:"M21 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.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"},null,-1),i("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"},null,-1),i("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"},null,-1),i("line",{x1:"12",y1:"12",x2:"12",y2:"12","stroke-linecap":"round","stroke-width":"4"},null,-1)])],4))]),i("h2",Gb,c(n(s)("no_orders_yet"))+c(l.value==="not_paid"?n(s)("wait_payment"):l.value==="to_ship"?n(s)("pending_shipment"):l.value==="to_receive"?n(s)("received"):l.value==="success"?n(s)("completed"):""),1),l.value==="all"?(p(),f("p",Qb,c(n(s)("start_first_order")),1)):C("",!0)])):(p(),f("div",Jb,[(p(!0),f(at,null,xt(K.value,j=>(p(),f("div",{key:j.id},[j.detail_status!=="ยกเลิกคำสั่งซื้อ"?(p(),f("div",t0,[i("div",e0,[i("div",o0,[i("p",s0,c(n(s)("orders_id"))+" : ",1),i("p",{title:j.order_number,class:"text-[16px] xl:text-[18px] font-bold text-gray-900 ml-1 line-clamp-1 break-all"}," #"+c(j.order_number),9,n0)]),i("div",{onClick:nt=>Ze(j.order_number),class:"flex items-center text-sm text-gray-500 cursor-pointer shrink-0"},[i("span",null,c(od(j)),1),A[61]||(A[61]=i("svg",{class:"w-4 h-4 ml-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))],8,i0)]),i("section",l0,[i("div",{class:"overflow-x-auto",onClick:nt=>Ze(j.order_number)},[i("table",a0,[i("tbody",null,[(p(!0),f(at,null,xt(j?.product_list,(nt,Bt)=>(p(),f("tr",{key:Bt,class:J([Bt!==j.product_list.length-1?"border-b border-gray-200":""])},[i("td",c0,[i("div",d0,[nt.product_image_original!="-"?(p(),f("img",{key:0,src:nt.product_image_original||nt.product_image||n(re),alt:nt?.product_name,style:{"object-fit":"contain"},class:"w-[46px] h-[46px] rounded"},null,8,u0)):(p(),f("img",{key:1,src:nt.product_image||n(re),alt:nt?.product_name,style:{"object-fit":"contain"},class:"w-[46px] h-[46px] rounded"},null,8,h0)),i("div",p0,[i("p",f0,c(n(h)==="th"?nt?.product_name:nt?.product_name_en||nt?.product_name),1),nt.product_attribute_detail.key_1_value?(p(),f("div",_0,[i("p",{title:`${n(h)==="th"?nt.product_attribute_detail.key_1_value:nt.product_attribute_detail.key_1_value_en||nt.product_attribute_detail.key_1_value} ${n(h)==="th"?nt.product_attribute_detail.attribute_priority_1:nt.product_attribute_detail.attribute_priority_1_en||nt.product_attribute_detail.attribute_priority_1}, ${n(h)==="th"?nt.product_attribute_detail.key_2_value:nt.product_attribute_detail.key_2_value_en||nt.product_attribute_detail.key_2_value} ${n(h)==="th"?nt.product_attribute_detail.attribute_priority_2:nt.product_attribute_detail.attribute_priority_2_en||nt.product_attribute_detail.attribute_priority_2}`,class:"text-xs line-clamp-1 break-all"},[gt(c(n(h)==="th"?nt.product_attribute_detail.attribute_priority_1:nt.product_attribute_detail.attribute_priority_1_en||nt.product_attribute_detail.attribute_priority_1)+" ",1),nt.product_attribute_detail.key_2_value?(p(),f("span",v0," , "+c(n(h)==="th"?nt.product_attribute_detail.attribute_priority_2:nt.product_attribute_detail.attribute_priority_2_en||nt.product_attribute_detail.attribute_priority_2),1)):C("",!0)],8,m0)])):C("",!0),i("div",g0,[i("span",b0,"x"+c(nt?.quantity),1),i("span",x0,c(xe(Number(nt?.total_normal_real_price))),1)])])])]),i("td",y0," x"+c(nt?.quantity),1),i("td",w0,c(xe(Number(nt?.total_normal_real_price))),1)],2))),128))])])],8,r0)]),i("div",{class:"px-4 pt-4 rounded-bl-lg rounded-br-lg flex justify-end",style:b({backgroundColor:n(D).bg_color2})},[i("div",k0,[i("div",null,[gt(c(n(s)("item_count",{count:j?.total_quantity}))+" :  ",1),i("span",$0,c(xe(j?.net_price)),1)]),i("div",C0,[(j?.transaction_status=="Not Paid"||j?.transaction_status=="Fail")&&j?.seller_sent_status!="sent"?(p(),f("button",{key:0,onClick:nt=>(et.value=!0,X.value=null,ht.value=j?.order_number,ct.value=j?.buyer_name,dt.value=j?.created_at),class:"px-4 py-2 rounded-full xl:text-[16
27px] text-sm font-medium hover:bg-opacity-10 focus:outline-none focus:ring-opacity-50 cursor-pointer",style:b({border:`1px solid ${n(D).color}`,color:n(D).color,backgroundColor:"white","--tw-ring-color":n(D).color})},c(n(s)("order_cancelled")),13,M0)):C("",!0),j?.transaction_status=="Success"&&j?.seller_sent_status!="sent"&&j?.order_mobilyst_no==="-"&&!n(D).UploadSlip?(p(),f("button",{key:1,onClick:nt=>Ze(j.order_number),class:"px-4 py-2 rounded-full xl:text-[16px] text-sm font-medium hover:bg-opacity-10 focus:outline-none focus:ring-opacity-50 cursor-pointer",style:b({border:`1px solid ${n(D).color}`,color:n(D).color,backgroundColor:"white","--tw-ring-color":n(D).color})},c(n(s)("order_cancelled")),13,S0)):C("",!0),(j?.transaction_status=="Not Paid"||j?.transaction_status=="Fail")&&j?.payment_method!="COD"?(p(),f("button",{key:2,onClick:nt=>{Jo(),Ze(j.order_number)},class:"text-white px-6 py-2 rounded-full xl:text-[16px] text-sm font-medium hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-600 focus:ring-opacity-50 cursor-pointer",style:b({backgroundColor:n(D).color,"--tw-ring-color":n(D).color})},c(j?.transaction_status==="Fail"?n(s)("payment_action_again"):n(s)("payment_action")),13,D0)):C("",!0),j?.accept_product_data?.status=="waiting_accept"&&j?.transportation_status=="การจัดส่งสำเร็จ"&&j?.transaction_status!="Not Paid"?(p(),f("button",{key:3,onClick:nt=>ed(j),class:"text-white px-6 py-2 rounded-full xl:text-[16px] text-sm font-medium focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] cursor-pointer disabled:cursor-not-allowed",style:b({backgroundColor:T.value?n(D).color:"#E7E7E7",color:T.value?"white":"#A4A4A4",borderColor:T.value?n(D).color:"#E7E7E7"})},c(n(s)("confirm_receipt")),13,A0)):C("",!0),j.buyer_received_status==="received"?(p(),f("button",{key:4,onClick:nt=>{Il(j)},class:"text-white px-7 py-2 rounded-full border xl:text-[16px] text-sm font-medium cursor-pointer",style:b({backgroundColor:"white",borderColor:n(D).color,color:n(D).color})},c(n(s)("reOrder")),13,z0)):C("",!0),j.accept_product_data?.status==="waiting_review"&&n(D).hasReview&&j.shipping_type!="front"?(p(),f("button",{key:5,onClick:nt=>{_e(),Ze(j.order_number)},class:"text-white px-6 py-2 rounded-full xl:text-[16px] text-sm font-medium hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-600 focus:ring-opacity-50 cursor-pointer",style:b({backgroundColor:n(D).color,"--tw-ring-color":n(D).color})},c(n(s)("review_product")),13,j0)):C("",!0),j.buyer_received_status==="received"&&j.shipping_type=="front"&&!j?.accept_product_data?.review_at&&n(D).hasReview?(p(),f("button",{key:6,onClick:nt=>{_e(),Ze(j.order_number)},class:"text-white px-6 py-2 rounded-full xl:text-[16px] text-sm font-medium hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-600 focus:ring-opacity-50 cursor-pointer",style:b({backgroundColor:n(D).color,"--tw-ring-color":n(D).color})},c(n(s)("review_product")),13,T0)):C("",!0),j.accept_product_data?.status==="success"&&n(D).hasReview?(p(),f("button",{key:7,onClick:nt=>Al(j.order_number),class:"px-6 py-2 rounded-full xl:text-[16px] text-sm font-medium border cursor-pointer",style:b({backgroundColor:"white",borderColor:n(D).color,color:n(D).color})},c(n(s)("review_detail")),13,P0)):C("",!0)])])],4)])):C("",!0)]))),128))]))])),r.value?(p(),f("div",L0,[i("div",R0,[i("div",O0,[(p(),f("svg",{onClick:A[17]||(A[17]=j=>{r.value=!1,M.value=!0,k()}),xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-3 mt-[2px] cursor-pointer shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...A[62]||(A[62]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("div",B0,[i("div",{title:v.value?.order_number,class:"text-base md:text-lg font-semibold text-gray-800 break-all md:break-normal"},[i("span",F0,"#"+c(v.value?.order_number),1),i("span",I0,c(n(s)("orders_id"))+" : #"+c(v.value?.order_number),1)],8,E0),i("span",N0,c(n(id)),1)])]),v.value?.payment_data?.payment_status!=="Fail"?(p(),f("div",H0,[i("div",V0,[i("div",{class:"absolute top-4 left-[12.5%] w-[25%] h-[2px] z-0",style:b({backgroundColor:U.value?n(D).color:"#D1D5DB"})},null,4),i("div",{class:"absolute top-4 left-[37.5%] w-[25%] h-[2px] z-0",style:b({backgroundColor:B.value?n(D).color:"#D1D5DB"})},null,4),i("div",{class:"absolute top-4 left-[62.5%] w-[25%] h-[2px] z-0",style:b({backgroundColor:Z.value?n(D).color:"#D1D5DB"})},null,4),i("div",{class:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold z-10 text-white",style:b(W.value?{backgroundColor:n(D).color}:{backgroundColor:"#D1D5DB",color:"#4B5563"})}," 1 ",4),i("span",W0,c(n(s)("create_order")),1),i("span",U0,c(n(s)("order")),1),i("span",Y0,c(uo(v.value?.tracking_data?.tracking_steps?.[0]?.date_time)),1)]),i("div",q0,[i("div",{class:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold z-10 text-white",style:b(U.value?{backgroundColor:n(D).color}:{backgroundColor:"#D1D5DB",color:"#4B5563"})}," 2 ",4),i("span",Z0,c(v.value?.payment_data?.payment_method=="COD"?n(s)("prepair_ship"):n(s)("payment_com")),1),i("span",X0,c(v.value?.payment_data?.payment_method=="COD"?n(s)("prepair_ship"):n(s)("payment_action")),1),i("span",K0,c(v.value?.tracking_data?.tracking_steps?.[1]?.status==="ยกเลิกคำสั่งซื้อ"?"-":uo(v.value?.tracking_data?.tracking_steps?.[1]?.date_time)||"-"),1)]),i("div",G0,[i("div",{class:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold z-10 text-white",style:b(B.value?{backgroundColor:n(D).color}:{backgroundColor:"#D1D5DB",color:"#4B5563"})}," 3 ",4),i("span",Q0,c(v.value?.shipping_type=="front"?n(s)("order_status_to_pick_up"):n(s)("on_the_way")),1),v.value?.shipping_type!="front"?(p(),f("span",J0,c(v.value?.sent_date&&uo(v.value?.sent_date)||"-"),1)):v.value?.shipping_type=="front"?(p(),f("span",tx,c(uo(v.value?.target_received_date!==""&&B.value&&v.value?.tracking_data?.tracking_steps?.[1]?.date_time||"-")),1)):C("",!0)]),i("div",ex,[i("div",{class:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold z-10 text-white",style:b(Z.value?{backgroundColor:n(D).color}:{backgroundColor:"#D1D5DB",color:"#4B5563"})}," 4 ",4),i("span",ox,c(v.value?.shipping_type=="front"?n(s)("order_status_pick_up_delivered"):n(s)("delivered")),1),v.value?.shipping_type!="front"?(p(),f("span",sx,c(uo(v.value?.received_date!==""&&v.value?.received_date||"-")),1)):v.value?.shipping_type=="front"?(p(),f("span",nx,c(uo(v.value?.received_date!==""&&v.value?.received_date||"-")),1)):C("",!0)])])):C("",!0),v.value?.payment_data?.payment_status==="Fail"?(p(),f("div",ix,[i("div",{class:"rounded-md p-4 flex border justify-between items-center",style:b({borderColor:n(Mt),backgroundColor:n(D).border_hover_color_login})},[i("span",{class:"font-bold",style:b({color:n(D).black})},c(n(s)("rejected_pay"))+": "+c(uo(v.value?.payment_data?.slip_verify_date)),5)],4)])):C("",!0)]),i("section",lx,[i("h2",rx,c(v.value?.shipping_type=="front"?n(s)("delivery_address"):n(s)("shipping_address")),1),v.value?.shipping_type!="front"?(p(),f("div",ax,[i("p",cx,[gt(c(v.value?.shipping_data?.shiiping_name)+" ",1),A[63]||(A[63]=i("br",{class:"block sm:hidden"},null,-1)),gt("| "+c(n(D).international?fd(v.value?.shipping_data?.shipping_phone,v.value?.shipping_data?.shipping_country_code):v.value?.shipping_data?.shipping_phone),1)]),i("div",dx,c(v.value?.shipping_data?.shipping_email),1),v.value?.shipping_data?.international?C("",!0):(p(),f("p",ux,
27c(n(h)==="th"?v.value?.shipping_data?.shipping_address:v.value?.shipping_data?.shipping_address_en||v.value?.shipping_data?.shipping_address)+" "+c(v.value?.shipping_data?.shipping_province==="กรุงเทพมหานคร"||v.value?.shipping_data?.shipping_province==="Bangkok"?n(s)("kweang"):n(s)("tumbon"))+c(Ol(v.value?.shipping_data?.shipping_sub_district))+" "+c(v.value?.shipping_data?.shipping_province==="กรุงเทพมหานคร"||v.value?.shipping_data?.shipping_province==="Bangkok"?n(s)("ked"):n(s)("ampear"))+c(Rl(v.value?.shipping_data?.shipping_district))+" "+c(n(s)("province"))+c(Ll(v.value?.shipping_data?.shipping_province))+" "+c(n(s)("postal_code")+" ")+c(v.value?.shipping_data?.shipping_zipcode),1)),v.value?.shipping_data?.international?(p(),f("p",hx,[gt(c(v.value?.shipping_data?.shipping_address_en)+" "+c(v.value?.shipping_data?.shipping_premises!=="-"&&v.value?.shipping_data?.shipping_country_code!=="TH"?v.value?.shipping_data?.shipping_premises:"")+" "+c(v.value?.shipping_data?.shipping_addition!=="-"&&v.value?.shipping_data?.shipping_country_code!=="TH"?v.value?.shipping_data?.shipping_addition:"")+" ",1),v.value?.shipping_data?.shipping_country_code==="TH"?(p(),f("span",px,c(v.value?.shipping_data?.shipping_sub_district),1)):C("",!0),gt(" "+c(v.value?.shipping_data?.shipping_city)+" "+c(v.value?.shipping_data?.shipping_state)+" "+c(v.value?.shipping_data?.shipping_zipcode)+" "+c(v.value?.shipping_data?.shipping_country),1)])):C("",!0),i("span",fx,c(n(s)("note"))+" : ",1),i("span",_x,c(ud(v.value?.shipping_data?.shipping_note_address)),1),v.value?.shipping_channel&&v.value?.seller_sent_status=="sent"?(p(),f("div",{key:2,class:"mt-8 p-4 bg-[#F3F4F6] border rounded-2xl",style:b({backgroundColor:n(D).border_hover_color_login,borderColor:n(Mt),color:n(Mt)})},[v.value?.shipping_channel?(p(),f("div",mx,[gt(c(v.value?.shipping_channel)+" ",1),v.value?.tracking_data?.tracking_url!=="-"||v.value?.tracking_data?.tracking_url&&v.value?.shipping_provider!="OUT_SOURCE"?(p(),f("button",{key:0,onClick:A[18]||(A[18]=j=>Ss()),class:"px-2 rounded-full text-sm font-medium hover:bg-opacity-10 focus:outline-none focus:ring-2 focus:ring-opacity-50 cursor-pointer p-1",style:b({border:`1px solid ${n(D).color}`,color:n(D).color,backgroundColor:"white","--tw-ring-color":n(D).color})},c(n(s)("order_tracking")),5)):C("",!0)])):C("",!0),v.value?.tracking_data?.tracking_number?(p(),f("div",vx,[i("span",gx,c(n(s)("tracking_number"))+" : ",1),gt(c(v.value?.tracking_data?.tracking_number),1)])):C("",!0)],4)):C("",!0)])):(p(),f("div",bx,[i("div",xx,[i("p",yx,c(n(h)==="th"?n(F)?.shop_name_th:n(F)?.shop_name_en||n(F)?.shop_name_th),1
27),i("p",null,c(n(F)?.shop_phone),1),i("p",wx,c(n(h)==="th"?n(F)?.shop_address?.address_detail:n(F)?.shop_address_en?.address_detail||n(F)?.shop_address?.address_detail)+" "+c(n(F)?.shop_address?.house_no)+" "+c(n(F)?.shop_address?.province==="กรุงเทพมหานคร"?n(s)("kweang"):n(s)("tumbon"))+c(n(h)==="th"?n(F)?.shop_address?.sub_district:n(F)?.shop_address_en?.sub_district||n(F)?.shop_address?.sub_district)+" "+c(n(F)?.shop_address?.province==="กรุงเทพมหานคร"?n(s)("ked"):n(s)("ampear"))+c(n(h)==="th"?n(F)?.shop_address?.district:n(F)?.shop_address_en?.district||n(F)?.shop_address?.district)+" "+c(n(h)==="th"?n(F)?.shop_address?.province:n(F)?.shop_address_en?.province||n(F)?.shop_address?.province)+" "+c(n(F)?.shop_address?.zip_code),1)]),i("div",kx,[i("p",$x,c(n(s)("Receiver_name")),1),i("p",null,c(v.value?.buyer_name),1),i("p",null,c(v.value?.buyer_phone),1)])]))]),i("section",Cx,[i("h2",Mx,c(n(s)("detail")),1),v.value.additional_image.length>0?(p(),f("div",Sx,[i("p",Dx,c(n(s)("evidence")),1),i("p",{class:"font-bold underline text-[12px] cursor-pointer",style:b({color:n(D).color}),onClick:A[19]||(A[19]=j=>Jt.value=!0)},"ดูรูปภาพ",4)])):C("",!0),i("p",Ax,c(n(s)("doc")),1),i("div",{class:"p-4 rounded-lg",style:b({backgroundColor:n(D).border_hover_color_login})},[(p(!0),f(at,null,xt(xo.value?n(Yt):n(Yt).slice(0,5),(j,nt)=>(p(),f("div",{key:nt,class:J(["flex justify-between",{"mb-4":nt!==(xo.value?n(Yt).length-1:Math.min(n(Yt).length,5)-1)}])},[i("p",zx,c(j.label),1),i("p",{class:"font-bold underline text-[12px] cursor-pointer",style:b({color:n(D).color}),onClick:Bt=>Qo(j.value)},c(j.name),13,jx),j.text?(p(),f("p",Tx,c(j.text),1)):C("",!0)],2))),128)),n(Yt).length>5?(p(),f("div",Px,[i("button",{class:"text-[14px] underline cursor-pointer font-bold",style:b({color:n(D).color}),onClick:A[20]||(A[20]=j=>xo.value=!xo.value)},c(xo.value?n(s)("load_less"):n(s)("load_more")),5)])):C("",!0)],4)]),v.value?.required_invoice==="ขอใบกำกับภาษี"?(p(),f("section",Lx,[i("h2",Rx,c(n(s)("billing_tax_invoice")),1),i("div",Ox,[i("p",Bx,c(n(s)("tax_identification_number")),1),i("p",null,c(v.value?.invoice_detail?.tax_id),1)]),i("div",Ex,[i("p",Fx,c(v.value?.invoice_detail?.name),1),v.value?.invoice_detail?.tax_type==="Business"&&n(D).isBranchEtax?(p(),f("div",Ix,[v.value?.invoice_detail?.branch_id!=="-"&&v.value?.invoice_detail?.branch_id?(p(),f("p",Nx,[gt(c(n(s)("branch_id_etax"))+" "+c(v.value?.invoice_detail?.branch_id)+" ",1),v.value?.invoice_detail?.branch_name!=="-"&&v.value?.invoice_detail?.branch_name?(p(),f("span",Hx,"("+c(v.value?.invoice_detail?.branch_name)+")",1)):C("",!0)])):C("",!0)])):C("",!0),i("p",null,c(v.value?.shipping_data?.shipping_phone),1),i("span",null,c(v.value?.invoice_detail?.address)+" "+c(v.value?.invoice_detail?.province==="กรุงเทพมหานคร"||v.value?.invoice_detail?.province==="Bangkok"?n(s)("kweang"):n(s)("tumbon"))+c(Ol(v.value?.invoice_detail?.sub_district))+" "+c(v.value?.invoice_detail?.province==="กรุงเทพมหานคร"||v.value?.invoice_detail?.province==="Bangkok"?n(s)("ked"):n(s)("ampear"))+c(Rl(v.value?.invoice_detail?.district))+" "+c(n(s)("province"))+c(Ll(v.value?.invoice_detail?.province))+" "+c(v.value?.invoice_detail?.postal_code),1)])])):C("",!0),i("section",Vx,[i("div",{class:J(["bg-white p-4",n(El)?"rounded-t-lg":"rounded-lg"])},[i("h2",Wx,c(n(s)("payment")),1),i("div",Ux,[i("div",Yx,[i("span",qx,c(n(s)("order_id")),1),i("span",Zx,c(v.value?.order_number),1)]),i("div",{class:"rounded-t-lg flex justify-between items-center cursor-pointer py-4 px-2 transition-colors duration-500 border-b border-[#F5F5F5]",style:b({backgroundColor:M.value?"":n(D).border_hover_color_login}),onClick:ko},[i("span",{style:b({color:M.value?"#343434":n(D).color,fontWeight:M.value?"normal":"bold",transition:"all 0.3s ease"})},c(n(s)("amount")),5),i("div",{class:"flex items-center font-bold",style:b({color:M.value?"#343434":n(D).color})},[i("span",null,c(xe(v.value?.net_price)),1),(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:J(["h-4 w-4 ml-[16
27px] transform transition-transform duration-300",{"rotate-180":M.value}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...A[64]||(A[64]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"},null,-1)])],2))],4)],4),i("div",{class:J(["px-4 overflow-hidden transition-all duration-200 ease-in-out rounded-b-lg",M.value?"max-h-0 opacity-0 py-0":"max-h-[1000px] opacity-100 py-4"]),style:b({backgroundColor:n(D).border_hover_color_login+"30"})},[i("div",{class:"flex justify-between items-center text-[#343434] py-4",style:b({borderBottom:`1px dashed ${n(D).border_hover_color_login}`})},[i("span",Xx,c(n(s)("product_count",{count:v.value?.total_quantity})),1),i("span",Kx,c(xe(v.value?.total_price_no_vat_before_discount)),1)],4),i("div",{class:"flex justify-between items-center text-[#343434] py-4",style:b({borderBottom:`1px solid ${n(D).border_hover_color_login}`})},[i("span",Gx,c(n(s)("vat")),1),i("span",Qx,c(xe(v.value?.total_vat_before_discount)),1)],4),Number(n(ge))>0?(p(),f("div",{key:0,class:"flex justify-between items-center text-[#343434] py-4",style:b({borderBottom:`1px solid ${n(D).border_hover_color_login}`})},[i("span",Jx,c(n(s)("product_discount")),1),i("span",t2,"-"+c(xe(n(ge))),1)],4)):C("",!0),v.value?.total_coupon_discount>0?(p(),f("div",{key:1,class:"flex justify-between items-center text-[#343434] py-4",style:b({borderBottom:`1px solid ${n(D).border_hover_color_login}`})},[i("span",e2,c(n(s)("coupon_discount")),1),i("span",o2,"-"+c(xe(v.value?.total_coupon_discount)),1)],4)):C("",!0),v.value?.total_point_discount>0?(p(),f("div",{key:2,class:"flex justify-between items-center text-[#343434] py-4",style:b({borderBottom:`1px solid ${n(D).border_hover_color_login}`})},[i("span",s2,c(n(s)("reward_points_discount")),1),i("span",n2,"-"+c(xe(v.value?.total_point_discount)),1)],4)):C("",!0),Number(v.value?.total_shipping_insurance_fee)>0?(p(),f("div",{key:3,class:"flex justify-between items-center text-[#343434] py-4",style:b({borderBottom:`1px solid ${n(D).border_hover_color_login}`})},[i("span",i2,c(n(s)("insurance_fee")),1),i("span",l2,c(xe(v.value?.total_shipping_insurance_fee)),1)],4)):C("",!0),i("div",{class:"flex justify-between items-center text-[#343434] py-4",style:b({borderBottom:v.value?.total_coupon_shipping_discount>0?`1px solid ${n(D).border_hover_color_login}`:"none"})},[i("span",r2,c(n(s)("shipping_fee")),1),i("span",a2,c(xe(v.value?.total_shipping)),1)],4),v.value?.total_coupon_shipping_discount>0?(p(),f("div",{key:4,class:"flex justify-between items-center text-[#343434] py-4",style:b({borderBottom:Number(v.value?.total_fee_payment)>0?`1px solid ${n(D).border_hover_color_login}`:"none"})},[i("span",c2,c(n(s)("shipping_discount")),1),i("span",d2,"-"+c(xe(v.value?.total_coupon_shipping_discount)),1)],4)):C("",!0),Number(v.value?.total_fee_payment)>0?(p(),f("div",u2,[i("span",h2,c(v.value?.payment_data?.payment_method=="COD"?n(s)("cod_payment_fee"):n(s)("payment_fee")),1),i("span",p2,c(xe(v.value?.total_fee_payment)),1)])):C("",!0)],6)]),i("div",f2,[n(D).point_allow?(p(),f("div",_2,[i("span",m2,c(n(s)("points_earned")),1),i("span",v2,c(v.value?.total_receive_point)+" "+c(n(s)("points")),1)])):C("",!0),v.value?.payment_data?.payment_date?(p(),f("div",g2,[i("span",b2,c(n(s)("payment_date")),1),i("span",x2,c(uo(v.value?.payment_data?.payment_date||"-")),1)])):C("",!0),v.value?.payment_receipt?.orderIDRef?(p(),f("div",y2,[A[65]||(A[65]=i("span",{class:"text-sm"},"Ref",-1)),i("span",w2,c(v.value?.payment_receipt?.orderIDRef||"-"),1)])):C("",!0),i("div",k2,[i("span",$2,c(n(s)("payment_method")),1),v.value?.payment_data?.payment_method?(p(),f("span",C2,c(v.value?.payment_data?.payment_method=="Digital Wallet"?"E-wallet":v.value?.payment_data?.payment_method),1)):(p(),f("div",M2,[i("p",null,c(v.value?.payment_data?.payment_channel==="Slip"?"Payment Slip":"-"),1)]))]),i("div",S2,[i("span",D2,c(n(s)("payment_result")),1),i("span",A2,c(v.value?.payment_data?.payment_method==="COD"?v.value?.payment_data?.payment_status==="Success"?n(s)("payment_com"):n(s)("payment_pending"):v.value?.payment_data?.payment_status==="Success"?n(s)("payment_successful"):v.value?.payment_data?.payment_status==="Not Paid"?n(s)("pending_payment"):v.value?.payment_data?.payment_status==="Fail"?n(s)("fail_payment"):v.value?.payment_data?.payment_status==="Cancel"?n(s)("order_cancelled"):v.value?.payment_data?.payment_status==="Pending"?n(s)("pending"):v.value?.payment_data?.payment_status),1)]),v.value?.payment_data?.payment_channel==="Slip"?(p(),f("div",z2,[i("div",j2,[i("span",T2,c(n(s)("receipt")),1),i("span",{class:"font-bold underline underline-offset-6 cursor-pointer hover:opacity-80",style:b({color:n(D).color}),onClick:A[21]||(A[21]=j=>lo.value=!0)},c(n(s)("see_receipt")),5)])])):C("",!0),zt(pv,{"is-open":lo.value,slips:v.value?.payment_data?.payment_slip_img||[],amount:v.value?.payment_data?.payment_slip_img?.[0]?.amount,date:v.value?.payment_data?.payment_slip_img?.[0]?.paid_date,time:v.value?.payment_data?.payment_slip_img?.[0]?.paid_time,onClose:A[22]||(A[22]=j=>lo.value=!1)},null,8,["is-open","slips","amount","date","time"])])],2)]),n(El)?(p(),f("div",{key:1,class:"flex justify-end space-x-3 p-4 rounded-b-lg",style:b({backgroundColor:v.value?.accept_product_data?.status==="waiting_review"?n(D).white:n(D).totalBg})},[(v.value?.payment_data?.payment_status=="Not Paid"||v.value?.payment_data?.payment_status=="Fail")&&v.value?.tracking_data?.tracking_number=="-"?(p(),f("button",{key:0,onClick:A[23]||(A[23]=j=>(et.value=!0,X.value=null,ht.value=v.value?.order_number,ct.value=v.value?.buyer_name,dt.value=v.value?.order_date)),class:"px-4 py-2 rounded-full xl:text-[16
27px] text-sm font-medium hover:bg-opacity-10 cursor-pointer",style:b({border:`1px solid ${n(D).color}`,color:n(D).color,backgroundColor:"white","--tw-ring-color":n(D).color})},c(n(s)("order_cancelled")),5)):C("",!0),v.value?.payment_data?.payment_status=="Success"&&v.value?.tracking_data?.tracking_number=="-"&&v.value?.payment_data?.payment_method!=="Credit Card"&&!n(D).UploadSlip&&(v.value?.shipping_type!=="front"||v.value?.buyer_received_status!=="received")?(p(),f("button",{key:1,onClick:A[24]||(A[24]=j=>(gd(),X.value=null,ht.value=v.value?.order_number,ct.value=v.value?.buyer_name,dt.value=v.value?.order_date)),class:"px-4 py-2 rounded-full xl:text-[16px] text-sm font-medium hover:bg-opacity-10 cursor-pointer",style:b({border:`1px solid ${n(D).color}`,color:n(D).color,backgroundColor:"white","--tw-ring-color":n(D).color})},c(n(s)("order_cancelled")),5)):C("",!0),v.value?.payment_data?.payment_status=="Success"&&v.value?.tracking_data?.tracking_number=="-"&&v.value?.payment_data?.payment_method==="Credit Card"&&!n(D).UploadSlip&&(v.value?.shipping_type!=="front"||v.value?.buyer_received_status!=="received")?(p(),f("button",{key:2,onClick:A[25]||(A[25]=j=>xd(v.value?.order_number)),class:"px-4 py-2 rounded-full text-sm font-medium hover:bg-opacity-10 cursor-pointer",style:b({border:`1px solid ${n(D).color}`,color:n(D).color,backgroundColor:"white","--tw-ring-color":n(D).color})},c(n(s)("order_cancelled")),5)):C("",!0),(v.value?.payment_data?.payment_status=="Not Paid"||v.value?.payment_data?.payment_status=="Fail")&&v.value?.payment_data?.payment_channel!="COD"?(p(),f("button",{key:3,disabled:!T.value,onClick:A[26]||(A[26]=j=>Jo()),class:"text-white px-6 py-2 rounded-full xl:text-[16px] text-sm font-medium ocus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] cursor-pointer disabled:cursor-not-allowed",style:b({backgroundColor:T.value?n(D).color:"#E7E7E7",color:T.value?"white":"#A4A4A4",borderColor:T.value?n(D).color:"#E7E7E7"})},c(v.value?.payment_data?.payment_status==="Fail"?n(s)("payment_action_again"):n(s)("payment_action")),13,P2)):C("",!0),v.value?.accept_product_data?.status=="waiting_accept"&&v.value?.shipping_status=="การจัดส่งสำเร็จ"&&v.value?.payment_data?.payment_status!="Not Paid"?(p(),f("button",{key:4,onClick:A[27]||(A[27]=j=>{Dl()}),class:"text-white px-6 py-2 rounded-full xl:text-[16px] text-sm font-medium ocus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] cursor-pointer disabled:cursor-not-allowed",style:b({backgroundColor:T.value?n(D).color:"#E7E7E7",color:T.value?"white":"#A4A4A4",borderColor:T.value?n(D).color:"#E7E7E7"})},c(n(s)("confirm_receipt")),5)):C("",!0),v.value.buyer_received_status==="received"?(p(),f("button",{key:5,onClick:A[28]||(A[28]=j=>{Il(v.value)}),class:"text-white px-7 py-2 rounded-full border xl:text-[16px] text-sm font-medium cursor-pointer",style:b({backgroundColor:"white",borderColor:n(D).color,color:n(D).color})},c(n(s)("reOrder")),5)):C("",!0),v.value.accept_product_data?.status==="waiting_review"&&n(D).hasReview&&v.value.shipping_type!="front"?(p(),f("button",{key:6,onClick:A[29]||(A[29]=j=>{it(v.value.order_number)}),class:"text-white px-6 py-2 rounded-full xl:text-[16px] text-sm font-medium hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-600 focus:ring-opacity-50 cursor-pointer",style:b({backgroundColor:n(D).color,"--tw-ring-color":n(D).color})},c(n(s)("review_product")),5)):C("",!0),v.value.buyer_received_status==="received"&&v.value.shipping_type=="front"&&!v.value?.accept_product_data?.review_at&&n(D).hasReview?(p(),f("button",{key:7,onClick:A[30]||(A[30]=j=>{it(v.value.order_number)}),class:"text-white px-6 py-2 rounded-full xl:text-[16px] text-sm font-medium hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-600 focus:ring-opacity-50 cursor-pointer",style:b({backgroundColor:n(D).color,"--tw-ring-color":n(D).color})},c(n(s)("review_product")),5)):C("",!0),v.value.accept_product_data?.status==="success"&&n(D).hasReview?(p(),f("button",{key:8,onClick:A[31]||(A[31]=j=>Al(v.value.order_number)),class:"px-6 py-2 rounded-full xl:text-[16
27px] text-sm font-bold border cursor-pointer",style:b({backgroundColor:"white",borderColor:n(D).color,color:n(D).color})},c(n(s)("review_detail")),5)):C("",!0)],4)):C("",!0),i("section",L2,[i("h2",R2,c(n(s)("ordered_itemss")),1),i("div",O2,[i("div",B2,[i("div",E2,[i("p",null,c(n(s)("order_list")),1)]),i("div",F2,c(n(s)("price")),1),i("div",I2,c(n(s)("quantity")),1),i("div",N2,c(n(s)("total")),1)]),A[66]||(A[66]=i("hr",{class:"mb-2 border-t border-gray-300"},null,-1)),(p(!0),f(at,null,xt(n(Cs),j=>(p(),f("div",{key:j.bundle_id,style:b(Vt(j)?{borderColor:n(D).color}:{}),class:J(Vt(j)?"border-1 rounded-lg overflow-hidden my-4":"")},[Vt(j)?(p(),f("div",{key:0,class:"flex items-center justify-between px-4 py-2",style:b(`background-color:${n(D).color_nav}`)},[i("div",H2,[i("div",{class:"shrink-0 flex items-center justify-center w-[91px] h-[22px] rounded-full text-white",style:b({background:`linear-gradient(150deg, ${n(D).bundle_color1}, ${n(D).bundle_color2})`})},[i("p",V2,c(n(s)("Exclusive_Deal")),1)],4),i("span",W2,c(n(s)("Special_Pricing")),1)]),i("div",{style:b({color:n(D).color}),class:"flex items-center gap-2 justify-end w-[200px] h-[32px] rounded-full"},[i("p",U2,c(Oo(j)),1)],4)],4)):C("",!0),(p(!0),f(at,null,xt(j.products,nt=>(p(),f("div",{key:nt.id,class:"border-b border-gray-200 py-2 px-4"},[i("div",Y2,[i("div",q2,[i("div",Z2,[i("img",{src:nt.product_image_original||nt.product_image||n(re),alt:"รูปสินค้า",class:"w-[46px] h-[46px] md:w-16 md:h-16 !object-contain rounded mr-4"},null,8,X2)]),i("div",K2,[i("div",G2,c(n(h)==="th"?nt.product_name:nt.product_name_en||nt.product_name),1),nt.product_attribute?.attribute_key_1?(p(),f("div",{key:0,class:"mt-1",style:b({color:n(D).black})},[i("p",{title:`${n(h)==="th"?nt.product_attribute.attribute_key_1:nt.product_attribute.attribute_key_1_en||nt.product_attribute.attribute_key_1} ${n(h)==="th"?nt.product_attribute.attribute_priority_1:nt.product_attribute.attribute_priority_1_en||nt.product_attribute.attribute_priority_1}, ${n(h)==="th"?nt.product_attribute.attribute_key_2:nt.product_attribute.attribute_key_2_en||nt.product_attribute.attribute_key_2} ${n(h)==="th"?nt.product_attribute.attribute_priority_2:nt.product_attribute.attribute_priority_2_en||nt.product_attribute.attribute_priority_2}`,class:"text-xs line-clamp-1 break-all"},[gt(c(n(h)==="th"?nt.product_attribute.attribute_priority_1:nt.product_attribute.attribute_priority_1_en||nt.product_attribute.attribute_priority_1)+" ",1),nt.product_attribute?.attribute_priority_2?(p(),f("span",J2,", "+c(n(h)==="th"?nt.product_attribute.attribute_priority_2:nt.product_attribute.attribute_priority_2_en||nt.product_attribute.attribute_priority_2),1)):C("",!0)],8,Q2)],4)):C("",!0),nt.message_status==="pre-order"?(p(),f("div",{key:1,class:"text-[10px] rounded-full w-fit px-2 py-1 text-center mt-2",style:b({border:`1px solid ${n(D).color}`,color:n(D).color})},c(n(s)("message_status")),5)):C("",!0)])]),i("div",ty,c(xe(nt.fake_price)),1),i("div",ey,c(nt.quantity),1),i("div",oy,c(xe(nt.total_normal_real_price)),1)]),Array.isArray(nt?.product_free)&&nt.product_free.length>0?(p(),f("div",sy,[i("div",ny,[(p(!0),f(at,null,xt(nt.product_free,(Bt,Fe)=>(p(),f("div",{key:Bt.id||Fe,class:"flex items-center gap-[16px] text-xs px-[16px] py-[8px]",style:b({color:n(D).black})},[i("img",{src:Bt.product_image_original||Bt.product_image||n(re),alt:"ของแถม",class:"w-10 h-10 object-contain rounded flex-shrink-0"},null,8,iy),i("p",{class:"flex-1 min-w-0 truncate text-[14px] leading-relaxed",title:Bt.product_name},[gt(c(n(h)==="th"?Bt.product_name:Bt.product_name_en||Bt.product_name)+" ",1),Bt.product_attribute?.attribute_priority_1?(p(),f("span",ry," ("+c(n(h)==="th"?Bt.product_attribute?.attribute_priority_1:Bt.product_attribute?.attribute_priority_1_en||Bt.product_attribute?.attribute_priority_1)+" "+c(n(h)==="th"?Bt.product_attribute?.attribute_priority_2:Bt.product_attribute?.attribute_priority_2_en||Bt.product_attribute?.attribute_priority_2)+") ",1)):C("",!0)],8,ly),i("span",ay," x"+c(Bt.quantity),1)],4))),128))])])):C("",!0)]))),128))],6))),128)),(p(!0),f(at,null,xt(n(Ms),j=>(p(),f("div",{key:j.id,class:"border-b border-gray-200 py-2 px-4"},[i("div",cy,[i("div",dy,[i("div",uy,[i("img",{src:j.product_image_original||j.product_image||n(re),alt:"รูปสินค้า",class:"w-[46px] h-[46px] md:w-16 md:h-16 !object-contain rounded mr-4"},null,8,hy)]),i("div",py,[i("div",fy,c(n(h)==="th"?j.product_name:j.product_name_en||j.product_name),1),j.product_attribute?.attribute_key_1?(p(),f("div",{key:0,class:"mt-1",style:b({color:n(D).black})},[i("p",{title:`${n(h)==="th"?j.product_attribute.attribute_key_1:j.product_attribute.attribute_key_1_en||j.product_attribute.attribute_key_1} ${n(h)==="th"?j.product_attribute.attribute_priority_1:j.product_attribute.attribute_priority_1_en||j.product_attribute.attribute_priority_1}, ${n(h)==="th"?j.product_attribute.attribute_key_2:j.product_attribute.attribute_key_2_en||j.product_attribute.attribute_key_2} ${n(h)==="th"?j.product_attribute.attribute_priority_2:j.product_attribute.attribute_priority_2_en||j.product_attribute.attribute_priority_2}`,class:"text-xs line-clamp-1 break-all"},[gt(c(n(h)==="th"?j.product_attribute.attribute_priority_1:j.product_attribute.attribute_priority_1_en||j.product_attribute.attribute_priority_1)+" ",1),j.product_attribute?.attribute_priority_2?(p(),f("span",my,", "+c(n(h)==="th"?j.product_attribute.attribute_priority_2:j.product_attribute.attribute_priority_2_en||j.product_attribute.attribute_priority_2),1)):C("",!0)],8,_y)],4)):C("",!0),j.message_status==="pre-order"?(p(),f("div",{key:1,class:"text-[10px] rounded-full w-fit px-2 py-1 text-center mt-2",style:b({border:`1px solid ${n(D).color}`,color:n(D).color})},c(n(s)("message_status")),5)):C("",!0)])]),i("div",vy,c(xe(j.revenue_default)),1),i("div",gy,c(j.quantity),1),i("div",by,c(xe(j.total_revenue_default)),1)]),Array.isArray(j.product_free)&&j.product_free.length>0?(p(),f("div",{key:0,class:"mt-2 rounded",style:b({backgroundColor:n(D).bg_box_gift})},[i("div",xy,[(p(!0),f(at,null,xt(j.product_free,(nt,Bt)=>(p(),f("div",{key:nt.id||Bt,class:"flex items-center gap-[16px] text-xs px-[16px] py-[8px]",style:b({color:n(D).black})},[i("img",{src:nt.product_image_original||nt.product_image||n(re),alt:"ของแถม",class:"w-10 h-10 object-contain rounded flex-shrink-0"},null,8,yy),i("p",{class:"flex-1 min-w-0 truncate text-[14px] leading-relaxed",title:nt.product_name},[gt(c(n(h)==="th"?nt.product_name:nt.product_name_en||nt.product_name)+" ",1),nt.product_attribute_detail?.attribute_priority_1?(p(),f("span",ky," ("+c(n(h)==="th"?nt.product_attribute_detail?.attribute_priority_1:nt.product_attribute_detail?.attribute_priority_1_en||nt.product_attribute_detail?.attribute_priority_1)+" "+c(n(h)==="th"?nt.product_attribute_detail?.attribute_priority_2:nt.product_attribute_detail?.attribute_priority_2_en||nt.product_attribute_detail?.attribute_priority_2)+") ",1)):C("",!0)],8,wy),i("span",$y," x"+c(nt.quantity),1)],4))),128))])],4)):C("",!0)]))),128))]),(p(!0),f(at,null,xt(n(Cs),j=>(p(),f("div",{key:j.bundle_id,style:b(Vt(j)&&{borderColor:n(D).color}),class:J(Vt(j)&&"md:hidden border-1 rounded-lg overflow-hidden my-4")},[Vt(j)?(p(),f("div",{key:0,class:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between px-4 py-4 md:py-2 lg:py-2",style:b(`background-color:${n(D).color_nav}`)},[i("div",Cy,[i("div",{class:"shrink-0 flex items-center justify-center w-[91px] h-[22px] rounded-full text-white",style:b({background:`linear-gradient(150deg, ${n(D).bundle_color1}, ${n(D).bundle_color2})`})},[i("p",My,c(n(s)("Exclusive_Deal")),1)],4),i("span",Sy,c(n(s)("Special_Pricing")),1)]),zt(de,{onClick:A[32]||(A[32]=nt=>L.navProductAllBT()),style:b({color:n(D).color}),class:"flex items-center text-sm md:justify-end font-bold"},{default:ne(()=>[gt(c(Oo(j)),1)]),_:2}
27,1032,["style"])],4)):C("",!0),(p(!0),f(at,null,xt(j.products,nt=>(p(),f("div",{key:nt.id,class:"md:hidden flex flex-col border-b border-gray-200 py-4 px-2"},[i("div",Dy,[i("div",Ay,[i("img",{src:nt.product_image_original=="-"||!nt.product_image_original?nt.product_image||n(re):nt.product_image_original,alt:"รูปสินค้า",class:"w-[46px] h-[46px] md:w-16 md:h-16 !object-contain rounded"},null,8,zy)]),i("div",jy,[i("div",Ty,[i("div",Py,c(n(h)==="th"?nt.product_name:nt.product_name_en||nt.product_name),1),nt.product_attribute?.attribute_key_1?(p(),f("div",{key:0,class:"mt-1",style:b({color:n(D).black})},[i("p",{title:`${n(h)==="th"?nt.product_attribute.attribute_key_1:nt.product_attribute.attribute_key_1_en||nt.product_attribute.attribute_key_1} ${n(h)==="th"?nt.product_attribute.attribute_priority_1:nt.product_attribute.attribute_priority_1_en||nt.product_attribute.attribute_priority_1}, ${n(h)==="th"?nt.product_attribute.attribute_key_2:nt.product_attribute.attribute_key_2_en||nt.product_attribute.attribute_key_2} ${n(h)==="th"?nt.product_attribute.attribute_priority_2:nt.product_attribute.attribute_priority_2_en||nt.product_attribute.attribute_priority_2}`,class:"text-xs line-clamp-1"},[gt(c(n(h)==="th"?nt.product_attribute.attribute_priority_1:nt.product_attribute.attribute_priority_1_en||nt.product_attribute.attribute_priority_1)+" ",1),nt.product_attribute?.attribute_priority_2?(p(),f("span",Ry,", "+c(n(h)==="th"?nt.product_attribute.attribute_priority_2:nt.product_attribute.attribute_priority_2_en||nt.product_attribute.attribute_priority_2),1)):C("",!0)],8,Ly)],4)):C("",!0),nt.message_status==="pre-order"?(p(),f("div",{key:1,class:"text-[10px] rounded-full w-fit px-2 py-1 text-center mt-2",style:b({border:`1px solid ${n(D).color}`,color:n(D).color})},c(n(s)("message_status")),5)):C("",!0)])])]),i("div",Oy,[i("div",By,[i("span",null,c(n(s)("price")),1),i("span",Ey,c(xe(nt.fake_price)),1)]),i("div",Fy,[i("span",null,c(n(s)("quantity")),1),i("span",Iy,c(nt?.quantity),1)]),i("div",Ny,[i("span",null,c(n(s)("total")),1),i("span",Hy,c(xe(Number(nt?.total_normal_real_price))),1)])]),Array.isArray(nt.product_free)&&nt.product_free.length>0?(p(),f("div",{key:0,style:b({backgroundColor:n(D).bg_box_gift}),class:"flex flex-col gap-2 mt-4"},[(p(!0),f(at,null,xt(nt.product_free,(Bt,Fe)=>(p(),f("div",{key:Bt.id||Fe,class:"flex items-center gap-[16px] text-xs md:text-sm mx-[16px] my-[8px]",style:b({color:n(D).black})},[i("img",{src:Bt.product_image_original||Bt.product_image||n(re),alt:"ของแถม",class:"w-7 h-7 md:w-10 md:h-10 object-contain rounded flex-shrink-0"},null,8,Vy),i("p",{class:"flex-1 line-clamp-1 leading-relaxed",title:Bt.product_name},[gt(c(n(h)==="th"?Bt.product_name:Bt.product_name_en||Bt.product_name)+" ",1),Bt.product_attribute_detail?.attribute_priority_1?(p(),f("span",Uy," ("+c(n(h)==="th"?Bt.product_attribute_detail?.attribute_priority_1:Bt.product_attribute_detail?.attribute_priority_1_en||Bt.product_attribute_detail?.attribute_priority_1)+" "+c(n(h)==="th"?Bt.product_attribute_detail?.attribute_priority_2:Bt.product_attribute_detail?.attribute_priority_2_en||Bt.product_attribute_detail?.attribute_priority_2)+") ",1)):C("",!0)],8,Wy),i("span",Yy," x"+c(Bt.quantity),1)],4))),128))],4)):C("",!0)]))),128))],6))),128)),(p(!0),f(at,null,xt(n(Ms),j=>(p(),f("div",{key:j.id,class:"md:hidden flex flex-col border-b border-gray-200 py-4 px-2"},[i("div",qy,[i("div",Zy,[i("img",{src:j.product_image_original=="-"||!j.product_image_original?j.product_image||n(re):j.product_image_original,alt:"รูปสินค้า",class:"w-[46px] h-[46px] md:w-16 md:h-16 !object-contain rounded"},null,8,Xy)]),i("div",Ky,[i("div",Gy,[i("div",Qy,c(n(h)==="th"?j.product_name:j.product_name_en||j.product_name),1),j.product_attribute?.attribute_key_1?(p(),f("div",{key:0,class:"mt-1",style:b({color:n(D).black})},[i("p",{title:`${n(h)==="th"?j.product_attribute.attribute_key_1:j.product_attribute.attribute_key_1_en||j.product_attribute.attribute_key_1} ${n(h)==="th"?j.product_attribute.attribute_priority_1:j.product_attribute.attribute_priority_1_en||j.product_attribute.attribute_priority_1}, ${n(h)==="th"?j.product_attribute.attribute_key_2:j.product_attribute.attribute_key_2_en||j.product_attribute.attribute_key_2} ${n(h)==="th"?j.product_attribute.attribute_priority_2:j.product_attribute.attribute_priority_2_en||j.product_attribute.attribute_priority_2}`,class:"text-xs line-clamp-1 break-all"},[gt(c(n(h)==="th"?j.product_attribute.attribute_priority_1:j.product_attribute.attribute_priority_1_en||j.product_attribute.attribute_priority_1)+" ",1),j.product_attribute?.attribute_priority_2?(p(),f("span",t4,", "+c(n(h)==="th"?j.product_attribute.attribute_priority_2:j.product_attribute.attribute_priority_2_en||j.product_attribute.attribute_priority_2),1)):C("",!0)],8,Jy)],4)):C("",!0),j.message_status==="pre-order"?(p(),f("div",{key:1,class:"text-[10px] rounded-full w-fit px-2 py-1 text-center mt-2",style:b({border:`1px solid ${n(D).color}`,color:n(D).color})},c(n(s)("message_status")),5)):C("",!0)])])]),i("div",e4,[i("div",o4,[i("span",null,c(n(s)("price")),1),i("span",s4,c(xe(j?.real_price)),1)]),i("div",n4,[i("span",null,c(n(s)("quantity")),1),i("span",i4,c(j?.quantity),1)]),i("div",l4,[i("span",null,c(n(s)("total")),1),i("span",r4,c(xe(Number(j?.real_price)*Number(j?.quantity))),1)])]),Array.isArray(j.product_free)&&j.product_free.length>0?(p(),f("div",{key:0,style:b({backgroundColor:n(D).bg_box_gift}),class:"flex flex-col gap-2 mt-4"},[(p(!0),f(at,null,xt(j.product_free,(nt,Bt)=>(p(),f("div",{key:nt.id||Bt,class:"flex items-center gap-[16px] text-xs md:text-sm mx-[16px] my-[8px]",style:b({color:n(D).black})},[i("img",{src:nt.product_image_original||nt.product_image||n(re),alt:"ของแถม",class:"w-7 h-7 md:w-10 md:h-10 object-contain rounded flex-shrink-0"},null,8,a4),i("p",{class:"flex-1 line-clamp-1 leading-relaxed",title:nt.product_name},[gt(c(n(h)==="th"?nt.product_name:nt.product_name_en||nt.product_name)+" ",1),nt.product_attribute_detail?.attribute_priority_1?(p(),f("span",d4," ("+c(n(h)==="th"?nt.product_attribute_detail?.attribute_priority_1:nt.product_attribute_detail?.attribute_priority_1_en||nt.product_attribute_detail?.attribute_priority_1)+" "+c(n(h)==="th"?nt.product_attribute_detail?.attribute_priority_2:nt.product_attribute_detail?.attribute_priority_2_en||nt.product_attribute_detail?.attribute_priority_2)+") ",1)):C("",!0)],8,c4),i("span",u4," x"+c(nt.quantity),1)],4))),128))],4)):C("",!0)]))),128))])])):C("",!0),!r.value&&Array.isArray(K.value)&&K.value.length!=0?(p(),f("div",h4,[i("p",p4,c(n(s)("show_"))+" "+c(n(_d))+" - "+c(n(md))+" "+c(n(s)("show_1"))+" "+c(n(be)||0)+" "+c(n(s)("show_2")),1),i("div",f4,[i("button",{disabled:jt.value?.pagination?.current_page===1,onClick:A[33]||(A[33]=j=>ts()),class:"w-8 h-8 text-2xl rounded-full disabled:opacity-50 disabled:cursor-default cursor-pointer flex justify-center items-center"}," ‹ ",8,_4),(p(!0),f(at,null,xt(n(Bl),j=>(p(),f(at,{key:j},[j!=="..."?(p(),f("button",{key:0,class:"min-w-[32px] min-h-[32px] md:min-w-[32px] md:min-
27h-[32px] lg:min-w-[32px] lg:min-h-[32px] xl:min-w-[32px] xl:min-h-[32px] aspect-square p-1 rounded-full text-sm xl:text-base flex justify-center items-center cursor-pointer disabled:cursor-default",style:b(j==jt.value?.pagination?.current_page?{backgroundColor:n(D).color,color:"white"}:{}),onClick:nt=>Ut(j)},c(j),13,m4)):(p(),f("span",v4,"..."))],64))),128)),n(Bl).length<1?(p(),f("button",{key:0,class:"w-6 h-6 md:w-8 md:h-8 rounded-full text-base flex justify-center items-center",style:b({backgroundColor:n(D).color,color:"white"})}," 1 ",4)):C("",!0),i("button",{disabled:jt.value?.pagination?.current_page===jt.value?.pagination?.last_page||jt.value?.pagination?.last_page==0,onClick:A[34]||(A[34]=j=>Bo()),class:"w-8 h-8 text-2xl rounded-full disabled:opacity-50 cursor-pointer disabled:cursor-default flex justify-center items-center"}," › ",8,g4)])])):C("",!0),zt(ni),zt(xi,{visible:Jt.value,onClose:A[36]||(A[36]=j=>zl()),canClose:!1},{default:ne(()=>[i("div",b4,[i("p",x4,c(n(s)("img_shop")),1),i("button",{class:"cursor-pointer text-gray-500 hover:text-black",onClick:A[35]||(A[35]=j=>Jt.value=!1)}," ✖ ")]),A[67]||(A[67]=i("hr",{class:"border-[#D1D1D1]"},null,-1)),i("div",y4,[i("div",w4,[i("p",k4,c(n(s)("upload_date")),1),i("span",$4,c(uo(v.value?.additional_image?.[0].latest_created_at)),1)]),i("p",C4,c(n(s)("evidence_pictures")),1),i("div",M4,[i("img",{src:Be.value,class:"w-full h-full object-contain"},null,8,S4)]),i("div",D4,[(p(!0),f(at,null,xt(ro.value,(j,nt)=>(p(),f("div",{key:nt,onClick:Bt=>Be.value=j,class:J(["w-20 h-20 rounded-lg overflow-hidden cursor-pointer",{"border-[var(--border-color)] border-2":Be.value===j}]),style:b({"--border-color":n(D).color})},[i("img",{src:j,class:"w-full h-full object-cover"},null,8,z4)],14,A4))),128))])])]),_:1},8,["visible"])],64)}}},T4=mo(j4,[["__scopeId","data-v-1cd2bf35"]]),P4={key:0,class:"fixed inset-0 bg-black/60 z-40"},L4={class:"absolute right-0 top-0 w-full sm:w-[600px] h-full bg-white shadow-xl z-50 flex flex-col"},R4={class:"flex justify-between items-center p-6 border-b-1 border-[#D1D1D1]"},O4={class:"flex gap-2 items-center"},B4={class:"text-xl font-bold"},E4={class:"flex-1 overflow-y-auto px-8 py-6"},F4={class:"flex justify-between items-center mb-2 xl:mb-4"},I4={key:0,class:"text-lg font-bold"},N4={key:1,class:"text-lg font-bold"},H4=["disabled"],V4=["disabled"],W4={class:"space-y-3"},U4={key:0,class:"flex flex-col items-center justify-center"},Y4={key:0,class:"flex flex-col items-center justify-center"},q4={width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Z4={"clip-path":"url(#clip0_20060_1514)"},X4=["stroke"],K4=["stroke"],G4=["stroke"],Q4=["stroke"],J4=["stroke"],tw=["stroke"],ew=["stroke"],ow={class:"text-sm mt-4"},sw={key:1,class:"space-y-4 w-full"},nw={class:"grid gap-4"},iw={class:"flex items-center gap-3"},lw={class:"flex-1 min-w-0"},rw={class:"font-semibold text-gray-800 mb-1 flex flex-wrap justify-between items-start gap-y-1"},aw={class:"flex flex-col md:flex-row md:items-center sm:gap-x-2 text-gray-800 min-w-0 flex-1"},cw=["title"],dw={key:0,class:"whitespace-nowrap"},uw={class:"text-gray-600"},hw={class:"pl-4"},pw=["value"],fw={key:1},_w={class:"grid grid-cols-1 gap-4 items-start"},mw={class:"block text-base font-medium text-gray-700 mb-1"},vw=["placeholder","value"],gw={key:0,class:"text-[#C4021A] text-sm mt-1"},bw={class:"block text-base font-medium text-gray-700 mb-1"},xw=["title"],yw={class:"absolute z-10 mt-2 w-full border border-gray-300 bg-white rounded-lg shadow-md overflow-y-auto max-h-44 md:max-h-50 custom-scrollbar"},ww=["onClick"],kw={key:0,class:"text-[#C4021A] text-sm mt-1"},$w={class:"block text-base font-medium text-gray-700 mb-1"},Cw=["placeholder","value","maxlength"],Mw={key:0,class:"text-[#C4021A] text-sm mt-1"},Sw={class:"p-4 border-t-1 border-[#D1D1D1] w-full"},Dw={class:"w-full flex justify-end gap-4"},Aw=["disabled"],zw=["disabled"],jw={__name:"RefundSideBar",props:{isOpen:Boolean,title:String,onClose:Function,order:String},emits:["refresh"],setup(o,{emit:t}){const{t:e}=ee(),s=je(),{loadRefundMethod:l}=je(),r=ke(),{user:a,sidebarRefundOpen:d}=Qt(s),u=o,h=t;Po();const{GetAccountList:_,GetBankList:m,GetAddAccount:x,GetUpdateAccount:$,GetChangMainAccount:S}=ll(),v=_o(),{color:M,button_color:w,bg_color:I}=Qt(r),O=z([]),tt=z([]),G=z(!1),Y=z(null),et=z({}),ht=z(!1),ct=z(null),dt=z(!1),pt=bn(),D=z(null),{locale:Mt}=ee(),ot=z(!1);si(ct,()=>ht.value=!1);const st=We({accountName:"",bankName:"",bankNumber:""}),X=z({accountName:"",bankName:"",bankNumber:""}),H=lt(()=>u.order);function P(){et.value={...X.value},Y.value=null,G.value=!0}const W=async()=>{yt()},U=ft=>{const F=ft?.toString().trim();if(!F||!tt.value||tt.value.length===0)return ft;const R=tt.value.find(kt=>{const qt=kt.name?.toString().trim(),It=kt.name_en?.toString().trim();return qt===F||It===F});return R?Mt.value==="th"?R.name:R.name_en||R.name:ft},B=ft=>["w-full border bg-white text-black focus:border-transparent roun
27ded-full px-3 text-base py-1.5 focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] text-[16px] placeholder:text-[#D1D1D1]",ft?"border-[#C4021A]":"border-[#D1D1D1]"],Z=z({}),q=z(null),ut=z(!1),wt=(ft,F)=>{let R=F;if(ft==="accountName"&&(R=F,st.accountName=R.trim()?"":e("enter_account_name")),ft==="bankNumber"){const kt=/[^0-9-]/g;R=F.replace(kt,""),st.bankNumber=R.trim()?"":e("enter_bank_account")}et.value[ft]=R},St=ft=>{const F=et.value[ft]||"";if(ft==="accountName"&&(st.accountName=F.trim()?"":e("enter_account_name")),ft==="bankNumber"){const R=Y.value?.digits;F.trim()?R&&!R.includes(F.length)?st.bankNumber=e("enter_bank_account"):st.bankNumber="":st.bankNumber=e("enter_bank_account")}},Tt=ft=>{const F=ft.which?ft.which:ft.keyCode;F>31&&(F<48||F>57)&&ft.preventDefault()},vt=ft=>{/[ก-๙a-zA-Z0-9.\s]/.test(ft.key)||ft.preventDefault()};pe(ht,(ft,F)=>{F===!0&&ft===!1&&(Y.value?st.bankName="":st.bankName=e("enter_bank_name"))});function yt(){et.value={},G.value=!1,dt.value=!1,q.value=null,Z.value={},st.accountName="",st.bankName="",st.bankNumber="",ut.value=!1,O.value.length>=1&&(D.value=O.value?.[0]?.id)}const Ft=async()=>{v.changeStateLoading(!0);let ft={bank_user_name:et.value.accountName||"",bank_no:et.value.bankNumber||"",bank_name:Y.value.name||"",bank_code:Y.value.code||"",bank_branch:"",id:q.value.id||""};if(console.log("payloadAccount :>> ",ft),(await $(ft))?.code==200){console.log("Success ADD :>> "),ut.value&&await S({id:q.value.id||""});const R=await _();O.value=R?.data||[],yt()}v.changeStateLoading(!1)},N=lt(()=>{const ft=!et.value.accountName?.trim()||!Y.value||!et.value.bankNumber?.trim(),F=st.accountName!==""||st.bankName!==""||st.bankNumber!=="";return ft||F}),$t=async ft=>{et.value.bankName=ft?.name,et.value.bankNumber="",Y.value=ft,ht.value=!1,st.bankName=""},T=async()=>{v.changeStateLoading(!0),ot.value=O.value.length===0;let ft={bank_user_name:et.value.accountName||"",bank_no:et.value.bankNumber||"",bank_name:Y.value.name||"",bank_code:Y.value.code||"",bank_branch:""};const F=await x(ft);if(F?.code==200){ut.value&&await S({id:F?.data?.id||""});const R=await _();O.value=R?.data||[],F?.data?.id?D.value=F.data.id:O.value.length>0&&(D.value=O.value[O.value.length-1].id),ot.value?await Pt():yt()}v.changeStateLoading(!1)},Pt=async()=>{v.changeStateLoading(!0);const ft=O.value.find(R=>R.id==D.value)||O.value[0];if(!ft){v.changeStateLoading(!1);return}let F={order_number:H.value.order_number,account_name:ft.bank_user_name,bank_code:ft.bank_code,account_no:ft.bank_no};try{(await l(F))?.code===200?(d.value=!1,pt.trigger(e("bank_verify_success"))):pt.trigger(e("error_request"),"error")}catch(R){console.error("Submit Error:",R)}finally{h("refresh")}},Rt=async()=>{v.changeStateLoading(!0);try{const[ft,F]=await Promise.all([_(),m()]);O.value=ft?.data||[],tt.value=F?.data||[]}catch(ft){console.error("Fetch Error:",ft)}finally{O.value.length>=1?(D.value=O.value?.[0]?.id,G.value=!1):P(),v.changeStateLoading(!1)}};return pe(()=>u.isOpen,async ft=>{ft?await Rt():yt()},{immediate:!0}),(ft,F)=>(p(),ae(il,{name:"slide"},{default:ne(()=>[o.isOpen?(p(),f("div",P4,[i("div",L4,[i("div",R4,[i("div",O4,[n(G)?C("",!0):(p(),f("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:F[0]||(F[0]=(...R)=>o.onClose&&o.onClose(...R))},[...F[11]||(F[11]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),n(G)?(p(),f("svg",{key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:F[1]||(F[1]=R=>n(O).length<1?o.onClose():W())},[...F[12]||(F[12]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])):C("",!0),i("h2",B4,c(n(G)?"เพิ่มบัญชี":"ช่องทางการคืนเงิน"),1)])]),i("div",E4,[i("div",F4,[i("div",null,[!n(G)||!n(G)?(p(),f("p",I4,c("บัญชีรับเงินคืน")+" ("+c(n(O).length)+"/2) ",1)):C("",!0),n(G)||n(G)?(p(),f("p",N4,c("บัญชีรับเงินคืน"))):C("",!0)]),n(G)?C("",!0):(p(),f("button",{key:0,onClick:P,disabled:n(O).length>=2,style:b(n(O).length>=2?"color: #A4A4A4":`color: ${n(M)}`),class:J(["underline font-bold text-sm xl:text-base underline-offset-4 transition-all",n(O).length>
27=2?"cursor-not-allowed ":"cursor-pointer"])},c(n(e)("add_account")),15,H4)),n(G)&&!n(G)?(p(),f("button",{key:1,disabled:n(q)?.main_account==1,onClick:F[2]||(F[2]=R=>ft.deleteModal=!0),style:b(`color: ${n(q)?.main_account==1?"#a4a4a4":n(M)}`),class:J(["underline font-bold text-sm xl:text-base underline-offset-4 transition-all",n(q)?.main_account==1?"cursor-not-allowed ":"cursor-pointer"])},c(n(e)("delete_account")),15,V4)):C("",!0)]),i("div",W4,[n(G)?C("",!0):(p(),f("div",U4,[n(O).length<1?(p(),f("div",Y4,[(p(),f("svg",q4,[i("g",Z4,[i("path",{d:"M13.6596 25.9998H49.5L51 34.3506M13.6596 25.9998L6 52.5261H15.5946M13.6596 25.9998L14.1702 34.3506M15.5946 52.5261L15.7021 53.9998L54 53.5085L51 34.3506M15.5946 52.5261L14.1702 34.3506M14.1702 34.3506H51",stroke:n(r).color,"stroke-width":"2","stroke-miterlimit":"10"},null,8,X4),i("path",{d:"M30 21.9998C34.4183 21.9998 38 18.418 38 13.9998C38 9.58148 34.4183 5.99976 30 5.99976C25.5817 5.99976 22 9.58148 22 13.9998C22 18.418 25.5817 21.9998 30 21.9998Z",stroke:n(r).color,"stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}
27,null,8,K4),i("path",{d:"M31.3625 10.7512C31.1331 10.5796 30.3954 10.1248 29.3581 10.4373C28.1999 10.7862 27.9122 12.371 28.6993 12.9884C29.1513 13.3429 29.8313 13.6344 30.7478 13.9583C32.7991 14.6834 32.0409 17.5762 29.9542 17.5902C29.1399 17.5956 28.7593 17.5439 28.0439 17.076",stroke:n(r).color,"stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square","stroke-linejoin":"round"},null,8,G4),i("path",{d:"M29.9542 18.0188V18.6461",stroke:n(r).color,"stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square","stroke-linejoin":"round"},null,8,Q4),i("path",{d:"M29.9542 9.35376V10.0348",stroke:n(r).color,"stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square","stroke-linejoin":"round"},null,8,J4),i("path",{d:"M38 48.9998H48",stroke:n(r).color,"stroke-width":"2"},null,8,tw),i("path",{d:"M38 45.9998H48",stroke:n(r).color,"stroke-width":"2"},null,8,ew)]),F[13]||(F[13]=i("defs",null,[i("clipPath",{id:"clip0_20060_1514"},[i("rect",{width:"52",height:"52",fill:"white",transform:"translate(4 3.99976)"})])],-1))])),i("p",ow,c(n(e)("no_bank_account")),1)])):(p(),f("div",sw,[i("div",nw,[(p(!0),f(at,null,xt(n(O),(R,kt)=>(p(),f("label",{key:kt,class:"flex items-center justify-between border p-4 rounded-lg overflow-hidden cursor-pointer transition-all",style:b({border:n(D)===R.id?`1px solid ${n(r).color}`:`1px solid ${n(M)}`,backgroundColor:n(D)===R.id?n(r).bg_color2:"white"})},[i("div",iw,[i("div",lw,[i("div",rw,[i("div",aw,[i("span",{class:"block truncate max-w-full",title:R.bank_name},c(R.bank_user_name),9,cw),i("span",{class:"hidden md:block",style:b({color:n(r).color})},"|",4),R.bank_no?(p(),f("span",dw,[i("span",{class:"inline md:hidden",style:b({color:n(r).color})},"|",4),gt(" "+c(R.bank_no),1)])):C("",!0)])]),i("div",null,[i("p",uw,c(U(R.bank_name)),1)]),R.main_account=="1"?(p(),f("div",{key:0,class:"mt-[6px] text-sm",style:b({color:n(r).color})},c(n(e)("default_settings")),5)):C("",!0)])]),i("div",hw,[bt(i("input",{type:"radio",class:"appearance-none w-5 h-5 rounded-full border-1 border-[var(--radio-color)] checked:bg-[var(--radio-color)] bg-transparent bg-clip-content p-[3px] cursor-pointer transition-all duration-200 outline-none",style:b({"--radio-color":n(r).colorcheckbox}),value:R.id,"onUpdate:modelValue":F[3]||(F[3]=qt=>za(D)?D.value=qt:null)},null,12,pw),[[jo,n(D)]])])],4))),128))])]))])),n(G)?(p(),f("div",fw,[i("div",_w,[i("div",null,[i("label",mw,[gt(c(n(e)("bank_account_name")),1),F[14]||(F[14]=i("span",{class:"text-[#C4021A]"}," *",-1))]),i("input",{type:"text",placeholder:n(e)("enter_bank"),value:n(et).accountName,onInput:F[4]||(F[4]=R=>wt("accountName",R.target.value)),onKeypress:vt,onBlur:F[5]||(F[5]=R=>St("accountName")),class:J(B(n(st).accountName)),style:b({"--focus-color":n(r).color})},null,46,vw),n(st).accountName?(p(),f("p",gw,c(n(st).accountName),1)):C("",!0)]),i("div",{class:"relative",ref_key:"bankDropdownRef",ref:ct},[i("label",bw,[gt(c(n(e)("bank")),1),F[15]||(F[15]=i("span",{class:"text-[#C4021A]"}," *",-1))]),i("div",{onClick:F[6]||(F[6]=R=>ht.value=!n(ht)),class:"w-full px-3 py-2 border border-[#D1D1D1] rounded-full bg-white cursor-pointer text-[16px] flex justify-between items-center h-10",style:b({borderColor:n(ht)?n(r).color:n(st).bankName?"#C4021A":"#D1D1D1"})},[i("span",{class:"truncate text-base",style:b({color:n(Y)?.name?n(r).text_color2:"#D1D1D1"}),title:n(Mt)==="th"?n(Y)?.name:n(Y)?.name_en},c(n(Mt)==="th"?n(Y)?.name||n(e)("select_bank"):n(Y)?.name_en||n(e)("select_bank")),13,xw),(p(),f("svg",{class:J(["w-4 h-4 pointer-events-none transform transition-transform",{"rotate-180":n(ht)}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...F[16]||(F[16]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],4),bt(i("ul",yw,[(p(!0),f(at,null,xt(n(tt),(R,kt)=>(p(),f("li",{key:kt,onClick:qt=>$t(R),class:J(["px-4 py-2 cursor-pointer hover:bg-gray-100",{"bg-[#d1d1d1] font-bold text-[var(--text-color)]":n(Y)?.name==R.name}]),style:b({"--text-color":n(r).color})},c(n(Mt)==="th"?R.name:R.name_en),15,ww))),128))],512),[[Ie,n(ht)]]),n(st).bankName&&!n(ht)?(p(),f("p",kw,c(n(st).bankName),1)):C("",!0)],512),i("div",null,[i("label",$w,[gt(c(n(e)("bank_account_number")),1),F[17]||(F[17]=i("span",{class:"text-[#C4021A]"}," *",-1))]),i("input",{type:"tel",placeholder:n(e)("enter_bank_number"),onInput:F[7]||(F[7]=R=>wt("bankNumber",R.target.value)),onBlur:F[8]||(F[8]=R=>St("bankNumber")),onKeypress:Tt,value:n(et).bankNumber,class:J(B(n(st).bankNumber)),maxlength:n(Y)?.digits?.length?Math.max(...n(Y).digits):15,style:b({"--focus-color":n(r).color})},null,46,Cw),n(st).bankNumber?(p(),f("p",Mw,c(n(st).bankNumber),1)):C("",!0)])])])):C("",!0)])]),i("div",Sw,[i("div",Dw,[n(G)?C("",!0):(p(),f("button",{key:0,disabled:!n(D),onClick:F[9]||(F[9]=R=>Pt()),class:"py-2 rounded-full w-full h-10 text-sm xl:text-base font-bold cursor-pointer disabled:cursor-not-allowed",style:b({color:n(D)?"white":"#A4A4A4",backgroundColor:n(D)?n(r).color:"#E7E7E7"})},c(n(e)("confirm")),13,Aw)),n(G)?(p(),f("button",{key:1,onClick:F[10]||(F[10]=R=>n(G)?T():Ft()),disabled:n(N),class:J(["py-2 rounded-full w-full h-10 text-sm xl:text-base font-bold",n(N)?"bg-[#E7E7E7] cursor-not-allowed text-[#a4a4a4]":"cursor-pointer text-white bg-[var(--bg-color)]"]),style:b({"--bg-color":n(r).color})},c(n(ot)?n(e)("confirm"):n(e)("save")),15,zw)):C("",!0)])])])])):C("",!0)]),_:1}))}},Tw=mo(jw,[["__scopeId","data-v-d3c0048f"]]),oc={__name:"WarningBox",props:{show:Boolean,color:{type:String,default:"##000000"}},setup(o){const t=ke();
27return(e,s)=>o.show?(p(),f("div",{key:0,class:"mt-8 p-4 bg-[#FEFDF8] border rounded-2xl",style:b({borderColor:o.color,color:o.color,backgroundColor:n(t).totalBg})},[Ro(e.$slots,"default",{},()=>[s[0]||(s[0]=gt(" ข้อความแจ้งเตือน ",-1))])],4)):C("",!0)}},Pw={xmlns:"http://www.w3.org/2000/svg",width:"60",height:"60",fill:"none"};function Lw(o,t){return p(),f("svg",Pw,[...t[0]||(t[0]=[i("path",{stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"2",d:"M50.005 35.64V53.71H10.154V35.863M24.26 35.637H6l4.48-6.973h19.6zM36.002 35.637h18.157l-4.479-6.973h-19.6zM30.08 28.664v25.04"},null,-1),i("path",{stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"2",d:"M50.006 42.773H41.37v5.97h8.634zM30.08 24.524A9.262 9.262 0 1 0 30.08 6a9.262 9.262 0 0 0 0 18.524ZM33.257 11.898l-6.354 6.354M33.257 18.252l-6.354-6.354"},null,-1)])])}const Rw={render:Lw},Ow={key:0,class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},Bw={class:"flex items-center mb-6"},Ew={class:"text-2xl font-semibold"},Fw={key:0,class:"relative"},Iw=["placeholder"],Nw={key:1,class:"flex flex-col items-center justify-center py-14 text-center"},Hw={class:"w-20 h-20 rounded-full flex items-center justify-center mb-2"},Vw={class:"text-xl font-medium mb-2"},Ww={key:2},Uw={class:"bg-white p-4 rounded-lg shadow-md mb-6"},Yw={class:"flex items-start mb-4"},qw={class:"flex flex-col md:flex-row justify-between items-start flex-1 gap-2 min-w-0"},Zw={class:"block md:hidden text-base"},Xw={class:"hidden md:inline"},Kw={class:"text-sm text-gray-600 text-nowrap mt-[2px]"},Gw={class:"flex items-start gap-4"},Qw={class:"text-sm font-bold"},Jw={key:0,class:"text-sm text-gray-600 [overflow-wrap:anywhere]"},tk={class:"mt-4 pt-4 flex justify-between text-base border-t border-t-[#F5F5F5] -mx-4 px-4"},ek={class:"font-bold"},ok={class:"font-medium"},sk={key:0,class:"bg-white p-4 rounded-lg shadow-sm mb-6"},nk={class:"mb-4 flex flex-col md:flex-row justify-between md:items-center"},ik={class:"text-base xl:text-lg font-bold"},lk={key:0,class:"text-sm xl:text-base max-sm:pr-26"},rk={class:"text-sm flex flex-col gap-2"},ak={key:0,class:"font-bold"},ck={key:1},dk={key:2},uk={class:"font-semibold text-lg mb-4"},hk={class:"hidden md:block overflow-x-auto"},pk={class:"mt-4 hidden sm:flex"},fk={class:"w-6/12"},_k={class:"text-center w-2/12"},mk={class:"text-center w-2/12"},vk={class:"text-center w-2/12"},gk={class:"flex items-center gap-3"},bk={class:"text-[10px] font-bold leading-none"},xk={class:"text-base font-bold"},yk={class:"text-sm font-bold"},wk={class:"flex items-center"},kk={class:"w-6/12 flex items-start"},$k={class:"flex-shrink-0"},Ck=["src"],Mk={class:"flex flex-col overflow-hidden"},Sk={class:"font-bold overflow-hidden line-clamp-2 leading-relaxed break-all"},Dk=["title"],Ak={key:0},zk={class:"w-2/12 flex flex-col justify-center items-center font-bold"},jk={class:"w-2/12 flex flex-col justify-center items-center font-bold"},Tk={class:"w-2/12 flex flex-col justify-center items-center font-bold"},Pk={key:0,class:"mt-2 w-full flex flex-col gap-2 bg-gray-100"},Lk={class:"flex flex-col gap-2 w-full"},Rk=["src"],Ok=["title"],Bk={key:0,class:"ml-1"},Ek={class:"flex-shrink-0 text-[14px] font-medium"},Fk={class:"flex items-center"},Ik={class:"w-6/12 flex items-start"},Nk={class:"flex-shrink-0"},Hk=["src"],Vk={class:"flex flex-col overflow-hidden"},Wk={class:"font-bold overflow-hidden line-clamp-2 leading-relaxed break-all"},Uk=["title"],Yk={key:0},qk={class:"w-2/12 flex flex-col justify-center items-center font-bold"},Zk={class:"w-2/12 flex flex-col justify-center items-center font-bold"},Xk={class:"w-2/12 flex flex-col justify-center items-center font-bold"},Kk={class:"flex flex-col gap-2 w-full"},Gk=["src"],Qk=["title"],Jk={key:0,class:"ml-1"},t3={class:"flex-shrink-0 text-[14px] font-medium"},e3={class:"flex flex-col gap-1 md:flex-row md:items-center md:gap-3"},o3={class:"text-[10px] font-bold leading-none"},s3={class:"text-base font-bold"},n3={class:"flex items-start w-full"},i3={class:"flex-shrink-0"},l3=["src"],r3={class:"flex flex-col flex-1 overflow-hidden pl-4"},a3={class:"flex flex-col overflow-hidden"},c3={class:"font-bold line-clamp-2 leading-relaxed",style:{color:"black"}},d3=["title"],u3={key:0},h3={class:"text-[#343434] font-bold space-y-1 mt-3 w-full text-sm px-1 pl-20"},p3={class:"flex justify-between border-t border-gray-300 pt-2"},f3={class:"font-light"},_3={class:"text-right"},m3={class:"flex justify-between"},v3={class:"font-light"},g3={class:"text-right"},b3={class:"flex justify-between"},x3={class:"font-light"},y3={class:"text-right"},w3=["src"],k3=["title"],$3={key:0,class:"ml-1"},C3={class:"flex-shrink-0"},M3={class:"flex items-start w-full"},S3={class:"flex-shrink-0"},D3=["src"],A3={class:"flex flex-col flex-1 overflow-hidden pl-4"},z3={class:"flex flex-col overflow-hidden"},j3={class:"font-bold line-clamp-2 leading-relaxed",style:{color:"black"}},T3=["title"],P3={key:0},L3={class:"text-[#343434] space-y-1 mt-3 w-full text-sm px-1 pl-20"},R3={class:"flex justify-between border-t border-gray-300 pt-2"},O3={class:"text-right font-bold"},B3={class:"flex justify-between"},E3={class:"text-right font-bold"},F3={class:"flex justify-between"},I3={class:"text-right font-bold"},N3=["src"],H3=["title"],V3={key:0,class:"ml-1"},W3={class:"flex-shrink-0"},U3={key:3,class:"space-y-4"},Y3={class:"px-4 py-3 border-b border-gray-100 flex justify-between items-center bg-white rounded-t-lg"},q3={class:"flex line-clamp-1 break-all"}
27,Z3={class:"xl:text-[18px] md:text-[16px] text-[16px] font-bold sm:block hidden md:block text-nowrap"},X3={class:"xl:text-[18px] md:text-[16px] text-[16px] font-bold line-clamp-1 break-all"},K3=["onClick"],G3={class:"bg-white p-4"},Q3=["onClick"],J3={class:"w-full text-left text-sm cursor-pointer"},t5={class:"py-2 flex flex-col gap-1 items-start w-full"},e5={class:"flex items-start gap-4 w-full"},o5=["src","alt"],s5=["src","alt"],n5={class:"w-full"},i5={key:0},l5=["title"],r5={key:0},a5={class:"md:hidden flex justify-between text-xs mt-1 w-full"},c5={class:"font-semibold"},d5={class:"font-semibold"},u5={class:"hidden md:table-cell py-2 font-bold text-center w-1/8"},h5={class:"hidden md:table-cell py-2 font-bold text-right w-1/8 text-nowrap"},p5={class:"flex flex-col items-end space-y-4"},f5={class:"flex justify-end items-center"},_5={class:"text-l font-bold"},m5={key:0,class:"flex items-center space-x-3 mb-4"},v5=["onClick"],g5={key:4,class:"flex justify-between gap-4 p-4"},b5={class:"text-xs flex justify-center items-center"},x5={class:"flex gap-2 items-center"},y5=["disabled"],w5=["onClick"],k5={key:1,class:"px-2 text-gray-400 select-none"},$5=["disabled"],C5={__name:"CancelOrdersSection",setup(o){const{t}=ee(),e=z([]),s=z(!1),l=z(""),r=z(null),a=z(""),d=je(),u=z(""),h=yn(),_=xn(),{showContent:m,sidebarRefundOpen:x}=Qt(d),$=z({total:0,per_page:10,current_page:1,last_page:1});ll();const S=_o(),v=z(null),M=z({}),w=ke(),{color:I,button_color:O,bg_color:tt}=Qt(w),{postOrderDetail:G}=Ra(),{locale:Y}=ee(),et=async()=>{clearTimeout(v.value),v.value=setTimeout(async()=>{S.changeStateLoading(!0),await ht(),console.log("searchOrder.value",wt.value),S.changeStateLoading(!1)},1e3)};async function ht(){const kt=await G(u.value,"Cancel","");kt.success?(e.value=kt.data.data.all,$.value=kt.data.data.pagination,r.value=e.value):l.value=kt.data?.message||"โหลดข้อมูลไม่สำเร็จ"}const ct=z([null]);we(async()=>{await dt()});async function dt(){S.changeStateLoading(!0);const R=await G(u.value,"Cancel",wt.value),kt=h.query.order;R.success?(ct.value=R.data?.data??"",e.value=R.data.data.all,$.value=R.data.data.pagination,r.value=e.value,kt&&await D(kt)):l.value=R.data?.message||"โหลดข้อมูลไม่สำเร็จ",S.changeStateLoading(!1)}const pt=async R=>{try{const kt=nn(),qt=Ls("auth_token").value,It=await $fetch(`${kt.public.API_BASE_URL}backend/api/erp/get_order_detail?order_number=${R}&role_user=ext_buyer`,{headers:{"api-key":kt.public.API_KEY,"api-secret":kt.public.API_SECRET,Authorization:`Bearer ${qt}`}});M.value=It?.data??null,a.value=It?.data.order_items?.[0].product_items??null}catch(kt){l.value="โหลดข้อมูลรายละเอียดล้มเหลว",console.error("detail fetch error:",kt)}},D=async R=>{await pt(R),s.value=!0,window.scrollTo({top:0,left:0,behavior:"smooth"})},Mt=R=>{if(R==null)return" ";{const kt=new Date(R);if(isNaN(kt.getTime()))return"-";const qt=["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],It=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],he=kt.getDate(),Q=Y.value==="th"?qt[kt.getMonth()]:It[kt.getMonth()],E=Y.value==="th"?kt.getFullYear()+543:kt.getFullYear(),mt=String(kt.getHours()).padStart(2,"0"),Zt=String(kt.getMinutes()).padStart(2,"0");return`${he} ${Q} ${E} ${mt}:${Zt}`}};function ot(R){return new Intl.NumberFormat("th-TH",{style:"currency",currency:"THB"}).format(R).replace("฿","฿ ")}function st(R){const kt=Y.value==="th"?"บาท":"Baht";return Number(R).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})+` ${kt}`}const X=R=>!!(R?.bundle_info??R)?.is_eligible,H=lt(()=>a.value||[]),P=lt(()=>{const kt=H.value.flatMap(It=>It.bundles||[]),qt=new Map;return kt.forEach(It=>{qt.has(It.bundle_id)||qt.set(It.bundle_id,It)}),Array.from(qt.values())}),W=lt(()=>{const R={},kt=H.value;return P.value.forEach(It=>{const he=It.bundle_id;R[he]={bundle_info:It,products:[]}
27,(It.bundle_products||[]).forEach(Q=>{const E=kt.filter(mt=>mt.product_id===Q);E&&R[he].products.push(...E)})}),R}),U=lt(()=>Object.values(W.value)),B=lt(()=>{const R=new Set;return P.value.forEach(kt=>{(kt.bundle_products||[]).forEach(qt=>R.add(qt))}),R}),Z=lt(()=>H.value.filter(R=>!B.value.has(R.product_id))),q=R=>R==null||R===""?"0":Number(R).toLocaleString("th-TH"),ut=R=>{const kt=R?.bundle_info||R,qt=kt?.progress;if(!qt)return"";qt.current_qty;const It=kt?.applied_tiers?.[0],he=qt?.next_tier,Q=Object.values(It?.products_used_in_set||{}).reduce((mt,Zt)=>mt+Zt,0),E=It?.min_quantity;if(It)return It.discount_type==="fixed_price"||kt.discount_type==="fixed_price"?`${t("add")} ${Q} ${t("items")} ${q(It.fixed_price)} ${t("bath")}`:It.discount_type==="percent"||kt.discount_type==="percent"?`${t("add")} ${Q} ${t("pices")} ${t("Savee")} ${It.discount_value}%`:`${t("add")} ${E} ${t("pices")} ${t("Savee")} ${q(It.discount_value)} ${t("bath")}`;if(he){const mt=he.min_quantity;return he.discount_type==="fixed_price"?`${t("add")} ${mt} ${t("pices")} ${q(he.fixed_price)} ${t("bath")}`:he.discount_type==="percent"?`${t("add")} ${mt} ${t("pices")} ${t("Savee")} ${he.discount_value}%`:`${t("add")} ${mt} ${t("pices")} ${t("Savee")} ${q(he.discount_value)} ${t("bath")}`}return""},wt=lt(()=>Math.max($.value.current_page,1)),St=async R=>{console.log("page :>> ",R),S.changeStateLoading(!0),R!=="..."&&($.value.current_page=R,await dt(),window.scrollTo({top:0,behavior:"smooth"}),document.documentElement.scrollTop=0,document.body.scrollTop=0,S.changeStateLoading(!1))},Tt=async()=>{$.value.current_page>1&&($.value.current_page--,await dt()),window.scrollTo({top:0,behavior:"smooth"})},vt=async()=>{$.value.current_page<$.value.last_page&&($.value.current_page++,await dt()),window.scrollTo({top:0,behavior:"smooth"})},yt=lt(()=>{const R=ct.value?.pagination;return R?(R.current_page-1)*R.per_page+1:0}),Ft=lt(()=>{const R=ct.value?.pagination;return R?R.current_page*R.per_page:0}),N=lt(()=>{const R=ct.value?.pagination,kt=Number(R?.last_page)||0,qt=Number(R?.current_page)||1,It=[];if(kt>4)qt<3?It.push(1,2,3,"...",kt):qt==3&&kt==5?It.push(1,2,3,4,5):qt>=kt-2?It.push(1,"...",kt-2,kt-1,kt):It.push(1,"...",qt-1,qt,qt+1,"...",kt);else for(let he=1;he<=kt;he++)It.push(he);return It}),$t=z(null);async function T(R){$t.value=R,x.value=!0}function Pt(){x.value=!1}pe(x,R=>{document.body.style.overflow=R?"hidden":"auto"});const Rt=async()=>{await dt(),s.value&&M.value?.order_number&&await D(M.value.order_number)},ft=lt(()=>{const R=M.value?.account_data?.length===0,kt=M.value?.payment_data?.payment_status==="Success"&&!w.UploadSlip,qt=M.value?.payment_data?.payment_method;return R&&kt&&qt!=="Credit Card"});function F(){const R={...h.query};delete R.order,_.replace({query:R}),s.value=!1}return(R,kt)=>{const qt=Tw,It=oc,he=Aa;return p(),f(at,null,[zt(qt,{isOpen:n(x),onClose:Pt,order:n($t),onRefresh:Rt},null,8,["isOpen","order"]),n(s)?C("",!0):(p(),f("div",Ow,[i("div",Bw,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:kt[0]||(kt[0]=Q=>m.value=!1)},[...kt[10]||(kt[10]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("h1",Ew,c(n(t)("cancelled_orders")),1)]),n(s)?C("",!0):(p(),f("div",Fw,[kt[11]||(kt[11]=i("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[i("svg",{class:"h-5 w-5 text-gray-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[i("circle",{cx:"11",cy:"11",r:"8"}),i("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})])],-1)),bt(i("input",{type:"text",onInput:et,"onUpdate:modelValue":kt[1]||(kt[1]=Q=>za(u)?u.value=Q:null),onKeyup:kt[2]||(kt[2]=Da((...Q)=>R.orderFilter&&R.orderFilter(...Q),["enter"])),class:"w-full placeholder:text-[#A4A4A4] pl-10 pr-4 text-base py-2 rounded-full border focus:border-transparent border-[#D1D1D1] focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(w).color}),placeholder:n(t)("search_orders")},null,44,Iw),[[Lt,n(u)]]),n(u)?(p(),f("button",{key:0,onClick:kt[3]||(kt[3]=Q=>
27(u.value="",dt())),class:"absolute inset-y-0 right-0 flex items-center pr-3 cursor-pointer text-gray-400 hover:text-gray-600"}," ✕ ")):C("",!0)]))])),n(e).length===0?(p(),f("div",Nw,[i("div",Hw,[zt(n(Rw),{class:"h-14 w-14",style:b(`color:${n(I)}`)},null,8,["style"])]),i("h2",Vw,c(n(t)("no_cancelled_orders")),1)])):n(s)?(p(),f("div",Ww,[i("div",Uw,[i("div",Yw,[(p(),f("svg",{onClick:kt[4]||(kt[4]=Q=>F()),xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-3 mt-[2px] cursor-pointer shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...kt[12]||(kt[12]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("div",qw,[i("div",{onClick:kt[5]||(kt[5]=Q=>F()),class:"text-base md:text-lg font-semibold text-gray-800 break-all md:break-normal cursor-pointer"},[i("span",Zw,"#"+c(n(M)?.order_number),1),i("span",Xw,c(n(t)("orders_id"))+" : #"+c(n(M)?.order_number),1)]),i("span",Kw,c(n(Y)==="th"?n(M)?.order_status:n(M)?.order_status_eng||n(M)?.order_status),1)])]),zt(It,{show:!0,color:n(I)},{default:ne(()=>[i("div",Gw,[i("div",null,[i("p",Qw,c(n(t)("cancellation_request_approved"))+" : "+c(Mt(n(M)?.tracking_data?.tracking_steps[n(M)?.tracking_data?.tracking_steps.length-1].date_time)),1),n(M)?.action_reason?(p(),f("div",Jw,c(n(t)("remarks"))+" : "+c(n(M)?.action_reason),1)):C("",!0)])])]),_:1},8,["color"]),i("div",tk,[i("span",ek,c(n(t)("operator")),1),i("span",ok,c(n(M)?.cancel_by==="buyer"?n(t)("buyer"):n(t)("seller")||"ทดสอบ"),1)])]),n(M)?.account_data.length!==0||n(M)?.payment_data?.payment_method==="Credit Card"&&n(M)?.payment_data?.payment_status==="Success"?(p(),f("section",sk,[i("p",nk,[i("span",ik,c(n(t)("refund")),1),n(M)?.payment_data?.payment_method==="Credit Card"?(p(),f("span",lk,c(n(t)("refund_in_30")),1)):C("",!0)]),i("p",rk,[n(M)?.payment_data?.payment_method!=="Credit Card"?(p(),f("span",ak,c(n(M)?.account_data[0]?.account_name),1)):C("",!0),n(M)?.payment_data?.payment_method!=="Credit Card"?(p(),f("span",ck,c(n(Y)==="th"?n(M)?.account_data[0]?.bank_name:n(M)?.account_data[0]?.bank_name_en||n(M)?.account_data[0]?.bank_name),1)):C("",!0),n(M)?.payment_data?.payment_method!=="Credit Card"?(p(),f("span",dk,c(n(M)?.account_data[0]?.account_no),1)):C("",!0),i("span",null,c(n(t)("money_received"))+" : "+c(st(n(M)?.net_price)),1)])])):C("",!0),i("section",{class:J(["bg-white p-4 shadow-sm",[n(ft)?"":"rounded-lg"]])},[i("h2",uk,c(n(t)("ordered_itemss")),1),i("div",hk,[i("div",pk,[i("div",fk,[i("p",null,c(n(t)("product_list")),1)]),i("div",_k,c(n(t)("price")),1),i("div",mk,c(n(t)("quantity")),1),i("div",vk,c(n(t)("total")),1)]),kt[13]||(kt[13]=i("hr",{class:"mb-2 border-t border-gray-300"},null,-1)),(p(!0),f(at,null,xt(n(U),Q=>(p(),f("div",{key:Q.bundle_id,style:b(X(Q)&&{borderColor:n(w).color}),class:J(X(Q)&&"border-1 rounded-lg overflow-hidden my-4")},[X(Q)?(p(),f("div",{key:0,class:"flex items-center justify-between px-4 py-2",style:b(`background-color:${n(w).color_nav}`)},[i("div",gk,[i("div",{class:"shrink-0 flex items-center justify-center w-[91px] h-[22px] rounded-full text-white",style:b({background:`linear-gradient(150deg, ${n(w).bundle_color1}, ${n(w).bundle_color2})`})},[i("p",bk,c(n(t)("Exclusive_Deal")),1)],4),i("span",xk,c(n(t)("Special_Pricing")),1)]),i("div",{style:b({color:n(w).color}),class:"flex items-center gap-2 justify-end w-[200px] h-[32px] rounded-full"},[i("p",yk,c(ut(Q)),1)],4)],4)):C("",!0),(p(!0),f(at,null,xt(Q.products,E=>(p(),f("div",{key:E.id,class:"border-b border-gray-200 py-2 px-4"},[i("div",wk,[i("div",kk,[i("div",$k,[i("img",{src:E.product_image_original||E.product_image||n(re),alt:"รูปสินค้า",class:"w-16 h-16 !object-contain rounded mr-4"},null,8,Ck)]),i("div",Mk,[i("div",Sk,c(n(Y)==="th"?E.product_name:E.product_name_en||E.product_name),1),E.product_attribute?.attribute_key_1?(p(),f("div",{key:0,class:"mt-1",style:b({color:n(w).black})},[i("p",{title:`${n(Y)==="th"?E.product_attribute.attribute_key_1:E.product_attribute.attribute_key_1_en||E.product_attribute.attribute_key_1} ${n(Y)==="th"?E.product_attribute.attribute_priority_1:E.product_attribute.attribute_priority_1_en||E.product_attribute.attribute_priority_1}, ${n(Y)==="th"?E.product_attribute.attribute_key_2:E.product_attribute.attribute_key_2_en||E.product_attribute.attribute_key_2} ${n(Y)==="th"?E.product_attribute.attribute_priority_2:E.product_attribute.attribute_priority_2_en||E.product_attribute.attribute_priority_2}`,class:"text-xs line-clamp-1 break-all"},[gt(c(n(Y)==="th"?E.product_attribute.attribute_priority_1:E.product_attribute.attribute_priority_1_en||E.product_attribute.attribute_priority_1)+" ",1),E.product_attribute?.attribute_priority_2?(p(),f("span",Ak,", "+c(n(Y)==="th"?E.product_attribute.attribute_priority_2:E.product_attribute.attribute_priority_2_en||E.product_attribute.attribute_priority_2),1)):C("",!0)],8,Dk)],4)):C("",!0)])]),i("div",zk,c(ot(E.normal_real_price)),1),i("div",jk,c(E.quantity),1),i("div",Tk,c(ot(E.total_normal_real_price)),1)]),Array.isArray(E?.product_free)&&E.product_free.length>0?(p(),f("div",Pk,[i("div",Lk,[(p(!0),f(at,null,xt(E.product_free,(mt,Zt)=>(p(),f("div",{key:mt.id||Zt,class:"flex items-center gap-[16px] text-xs px-[16px] py-[8px]",style:b({color:n(w).black})},[i("img",{src:mt.product_image_original||mt.product_image||n(re),alt:"ของแถม",class:"w-10 h-10 object-contain rounded flex-shrink-0"},null,8,Rk),i("p",{class:"flex-1 min-w-0 truncate text-[14px] leading-relaxed",title:mt.product_name},[gt(c(n(Y)==="th"?mt.product_name:mt.product_name_en||mt.product_name)+" ",1),mt.product_attribute_detail?.attribute_priority_1?(p(),f("span",Bk," ("+c(n(Y)==="th"?mt.product_attribute_detail?.attribute_priority_1:mt.product_attribute_detail?.attribute_priority_1_en||mt.product_attribute_detail?.attribute_priority_1)+" "+c(n(Y)==="th"?mt.product_attribute_detail?.attribute_priority_2:mt.product_attribute_detail?.attribute_priority_2_en||mt.product_attribute_detail?.attribute_priority_2)+") ",1)):C("",!0)],8,Ok),i("span",Ek," x"+c(mt.quantity),1)],4))),128))])])):C("",!0)]))),128))],6))),128)),(p(!0),f(at,null,xt(n(Z),Q=>(p(),f("div",{key:Q.id,class:"border-b border-gray-200 py-2 px-4"},[i("div",Fk,[i("div",Ik,[i("div",Nk,[i("img",{src:Q.product_image_original||Q.product_image||n(re),alt:"รูปสินค้า",class:"w-16 h-16 !object-contain rounded mr-4"},null,8,Hk)]),i("div",Vk,[i("div",Wk,c(n(Y)==="th"?Q.product_name:Q.product_name_en||Q.product_name),1),Q.product_attribute?.attribute_key_1?(p(),f("div",{key:0,class:"mt-1",style:b({color:n(w).black})},[i("p",{title:`${n(Y)==="th"?Q.product_attribute.attribute_key_1:Q.product_attribute.attribute_key_1_en||Q.product_attribute.attribute_key_1} ${n(Y)==="th"?Q.product_attribute.attribute_priority_1:Q.product_attribute.attribute_priority_1_en||Q.product_attribute.attribute_priority_1}, ${n(Y)==="th"?Q.product_attribute.attribute_key_2:Q.product_attribute.attribute_key_2_en||Q.product_attribute.attribute_key_2} ${n(Y)==="th"?Q.product_attribute.attribute_priority_2:Q.product_attribute.attribute_priority_2_en||Q.product_attribute.attribute_priority_2}`,class:"text-xs line-clamp-1 break-all"},[gt(c(n(Y)==="th"?Q.product_attribute.attribute_priority_1:Q.product_attribute.attribute_priority_1_en||Q.product_attribute.attribute_priority_1)+" ",1),Q.product_attribute?.attribute_priority_2?(p(),f("span",Yk,", "+c(n(Y)==="th"?Q.product_attribute.attribute_priority_2:Q.product_attribute.attribute_priority_2_en||Q.product_attribute.attribute_priority_2),1)):C("",!0)],8,Uk)],4)):C("",!0)])]),i("div",qk,c(ot(Q.normal_real_price)),1),i("div",Zk,c(Q.quantity),1),i("div",Xk,c(ot(Q?.total_revenue_default)),1)]),Array.isArray(Q.product_free)&&Q.product_free.length>0?(p(),f("div",{key:0,class:"mt-2 rounded",style:b({backgroundColor:n(w).bg_box_gift})},[i("div",Kk,[(p(!0),f(at,null,xt(Q.product_free,(E,mt)=>
27(p(),f("div",{key:E.id||mt,class:"flex items-center gap-[16px] text-xs px-[16px] py-[8px]",style:b({color:n(w).black})},[i("img",{src:E.product_image_original||E.product_image||n(re),alt:"ของแถม",class:"w-10 h-10 object-contain rounded flex-shrink-0"},null,8,Gk),i("p",{class:"flex-1 min-w-0 truncate text-[14px] leading-relaxed",title:E.product_name},[gt(c(n(Y)==="th"?E.product_name:E.product_name_en||E.product_name)+" ",1),E.product_attribute_detail?.attribute_priority_1?(p(),f("span",Jk," ("+c(n(Y)==="th"?E.product_attribute_detail?.attribute_priority_1:E.product_attribute_detail?.attribute_priority_1_en||E.product_attribute_detail?.attribute_priority_1)+" "+c(n(Y)==="th"?E.product_attribute_detail?.attribute_priority_2:E.product_attribute_detail?.attribute_priority_2_en||E.product_attribute_detail?.attribute_priority_2)+") ",1)):C("",!0)],8,Qk),i("span",t3," x"+c(E.quantity),1)],4))),128))])],4)):C("",!0)]))),128))]),(p(!0),f(at,null,xt(n(U),Q=>(p(),f("div",{key:Q.bundle_id,style:b(X(Q)&&{borderColor:n(w).color}),class:J(X(Q)&&"md:hidden border-1 rounded-lg overflow-hidden my-4")},[X(Q)?(p(),f("div",{key:0,class:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between px-4 py-4 md:py-2 lg:py-2",style:b(`background-color:${n(w).color_nav}`)},[i("div",e3,[i("div",{class:"shrink-0 flex items-center justify-center w-[91px] h-[22px] rounded-full text-white",style:b({background:`linear-gradient(150deg, ${n(w).bundle_color1}, ${n(w).bundle_color2})`})},[i("p",o3,c(n(t)("Exclusive_Deal")),1)],4),i("span",s3,c(n(t)("Special_Pricing")),1)]),zt(he,{onClick:kt[6]||(kt[6]=E=>R.navProductAllBT()),style:b({color:n(w).color}),class:"flex items-center text-sm md:justify-end font-bold"},{default:ne(()=>[gt(c(ut(Q)),1)]),_:2},1032,["style"])],4)):C("",!0),(p(!0),f(at,null,xt(Q.products,E=>(p(),f("div",{key:E.id,class:"md:hidden flex flex-col border-b border-gray-200 py-4 px-2"},[i("div",n3,[i("div",i3,[i("img",{src:E.product_image_original=="-"||!E.product_image_original?E.product_image||n(re):E.product_image_original,alt:"รูปสินค้า",class:"w-16 h-16 !object-contain rounded"},null,8,l3)]),i("div",r3,[i("div",a3,[i("div",c3,c(n(Y)==="th"?E.product_name:E.product_name_en||E.product_name),1),E.product_attribute?.attribute_key_1?(p(),f("div",{key:0,class:"mt-1",style:b({color:n(w).black})},[i("p",{title:`${n(Y)==="th"?E.product_attribute.attribute_key_1:E.product_attribute.attribute_key_1_en||E.product_attribute.attribute_key_1} ${n(Y)==="th"?E.product_attribute.attribute_priority_1:E.product_attribute.attribute_priority_1_en||E.product_attribute.attribute_priority_1}, ${n(Y)==="th"?E.product_attribute.attribute_key_2:E.product_attribute.attribute_key_2_en||E.product_attribute.attribute_key_2} ${n(Y)==="th"?E.product_attribute.attribute_priority_2:E.product_attribute.attribute_priority_2_en||E.product_attribute.attribute_priority_2}`,class:"text-xs line-clamp-1 break-all"},[gt(c(n(Y)==="th"?E.product_attribute.attribute_priority_1:E.product_attribute.attribute_priority_1_en||E.product_attribute.attribute_priority_1)+" ",1),E.product_attribute?.attribute_priority_2?(p(),f("span",u3,", "+c(n(Y)==="th"?E.product_attribute.attribute_priority_2:E.product_attribute.attribute_priority_2_en||E.product_attribute.attribute_priority_2),1)):C("",!0)],8,d3)],4)):C("",!0)])])]),i("div",h3,[i("div",p3,[i("span",f3,c(n(t)("price")),1),i("span",_3,c(ot(E?.normal_real_price)),1)]),i("div",m3,[i("span",v3,c(n(t)("quantity")),1),i("span",g3,c(E?.quantity),1)]),i("div",b3,[i("span",x3,c(n(t)("total")),1),i("span",y3,c(ot(Number(E?.real_price)*Number(E?.quantity))),1)])]),Array.isArray(E.product_free)&&E.product_free.length>0?(p(),f("div",{key:0,style:b({backgroundColor:n(w).bg_box_gift}),class:"flex flex-col gap-2 mt-4"},[(p(!0),f(at,null,xt(E.product_free,(mt,Zt)=>(p(),f("div",{key:mt.id||Zt,class:"flex items-center gap-[16px] text-xs md:text-sm mx-[16px] my-[8px]",style:b({color:n(w).black})},[i("img",{src:mt.product_image_original||mt.product_image||n(re),alt:"ของแถม",class:"w-7 h-7 md:w-10 md:h-10 object-contain rounded flex-shrink-0"},null,8,w3),i("p",{class:"flex-1 line-clamp-1 leading-relaxed",title:mt.product_name},[gt(c(n(Y)==="th"?mt.product_name:mt.product_name_en||mt.product_name)+" ",1),mt.product_attribute_detail?.attribute_priority_1?(p(),f("span",$3," ("+c(n(Y)==="th"?mt.product_attribute_detail?.attribute_priority_1:mt.product_attribute_detail?.attribute_priority_1_en||mt.product_attribute_detail?.attribute_priority_1)+" "+c(n(Y)==="th"?mt.product_attribute_detail?.attribute_priority_2:mt.product_attribute_detail?.attribute_priority_2_en||mt.product_attribute_detail?.attribute_priority_2)+") ",1)):C("",!0)],8,k3),i("span",C3," x"+c(mt.quantity),1)],4))),128))],4)):C("",!0)]))),128))],6))),128)),(p(!0),f(at,null,xt(n(Z),Q=>(p(),f("div",{key:Q.id,class:"md:hidden flex flex-col border-b border-gray-200 py-4 px-2"},[i("div",M3,[i("div",S3,[i("img",{src:Q.product_image_original=="-"||!Q.product_image_original?Q.product_image||n(re):Q.product_image_original,alt:"รูปสินค้า",class:"w-16 h-16 !object-contain rounded"},null,8,D3)]),i("div",A3,[i("div",z3,[i("div",j3,c(n(Y)==="th"?Q.product_name:Q.product_name_en||Q.product_name),1),Q.product_attribute?.attribute_key_1?(p(),f("div",{key:0,class:"mt-1",style:b({color:n(w).black})},[i("p",{title:`${n(Y)==="th"?Q.product_attribute.attribute_key_1:Q.product_attribute.attribute_key_1_en||Q.product_attribute.attribute_key_1} ${n(Y)==="th"?Q.product_attribute.attribute_priority_1:Q.product_attribute.attribute_priority_1_en||Q.product_attribute.attribute_priority_1}, ${n(Y)==="th"?Q.product_attribute.attribute_key_2:Q.product_attribute.attribute_key_2_en||Q.product_attribute.attribute_key_2} ${n(Y)==="th"?Q.product_attribute.attribute_priority_2:Q.product_attribute.attribute_priority_2_en||Q.product_attribute.attribute_priority_2}`,class:"text-xs line-clamp-1 break-all"},[gt(c(n(Y)==="th"?Q.product_attribute.attribute_priority_1:Q.product_attribute.attribute_priority_1_en||Q.product_attribute.attribute_priority_1)+" ",1),Q.product_attribute?.attribute_priority_2?(p(),f("span",P3,", "+c(n(Y)==="th"?Q.product_attribute.attribute_priority_2:Q.product_attribute.attribute_priority_2_en||Q.product_attribute.attribute_priority_2),1)):C("",!0)],8,T3)],4)):C("",!0)])])]),i("div",L3,[i("div",R3,[i("span",null,c(n(t)("price")),1),i("span",O3,c(ot(Q.normal_real_price)),1)]),i("div",B3,[i("span",null,c(n(t)("quantity")),1),i("span",E3,c(Q?.quantity),1)]),i("div",F3,[i("span",null,c(n(t)("total")),1),i("span",I3,c(ot(Q?.total_revenue_default)),1)])]),Array.isArray(Q.product_free)&&Q.product_free.length>0?(p(),f("div",{key:0,style:b({backgroundColor:n(w).bg_box_gift}),class:"flex flex-col gap-2 mt-4"},[(p(!0),f(at,null,xt(Q.product_free,(E,mt)=>
27(p(),f("div",{key:E.id||mt,class:"flex items-center gap-[16px] text-xs md:text-sm mx-[16px] my-[8px]",style:b({color:n(w).black})},[i("img",{src:E.product_image_original||E.product_image||n(re),alt:"ของแถม",class:"w-7 h-7 md:w-10 md:h-10 object-contain rounded flex-shrink-0"},null,8,N3),i("p",{class:"flex-1 line-clamp-1 leading-relaxed",title:E.product_name},[gt(c(n(Y)==="th"?E.product_name:E.product_name_en||E.product_name)+" ",1),E.product_attribute_detail?.attribute_priority_1?(p(),f("span",V3," ("+c(n(Y)==="th"?E.product_attribute_detail?.attribute_priority_1:E.product_attribute_detail?.attribute_priority_1_en||E.product_attribute_detail?.attribute_priority_1)+" "+c(n(Y)==="th"?E.product_attribute_detail?.attribute_priority_2:E.product_attribute_detail?.attribute_priority_2_en||E.product_attribute_detail?.attribute_priority_2)+") ",1)):C("",!0)],8,H3),i("span",W3," x"+c(E.quantity),1)],4))),128))],4)):C("",!0)]))),128))],2),n(ft)?(p(),f("div",{key:1,class:J(["w-full p-4 flex justify-end border-t border-t-[#D1D1D1]",[n(ft)?"rounded-b-lg shadow-sm":""]]),style:b({backgroundColor:n(w).bg_color})},[n(w).UploadSlip?C("",!0):(p(),f("button",{key:0,onClick:kt[7]||(kt[7]=Q=>T(n(M))),style:b({backgroundColor:n(w).color}),class:"rounded-full py-2 px-3 cursor-pointer flex justify-center items-center text-white text-sm xl:text-base font-bold"},c(n(t)("refund_channal")),5))],6)):C("",!0)])):(p(),f("div",U3,[(p(!0),f(at,null,xt(n(r),Q=>(p(),f("div",{key:Q.id,class:"border border-gray-300 rounded-lg hover:shadow-md transition-shadow",style:b({color:n(w).black})},[i("div",Y3,[i("div",q3,[i("span",Z3,c(n(t)("orders_id"))+" :  ",1),i("span",X3," #"+c(Q.order_number),1)]),i("div",{onClick:E=>D(Q.order_number),class:"cursor-pointer flex items-center text-sm text-gray-500"},[gt(c(Q.status==="Cancel"||Q.status==="N"?n(t)("cancelled"):Q.status)+" ",1),kt[14]||(kt[14]=i("svg",{class:"w-4 h-4 ml-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))],8,K3)]),i("section",G3,[i("div",{class:"overflow-x-auto",onClick:E=>D(Q.order_number)},[i("table",J3,[i("tbody",null,[(p(!0),f(at,null,xt(Q?.product_list,(E,mt)=>(p(),f("tr",{key:mt,class:J([mt!==Q.product_list.length-1?"border-b border-gray-200":""])},[i("td",t5,[i("div",e5,[E.product_image_original!="-"?(p(),f("img",{key:0,src:E.product_image_original||E.product_image||n(re),alt:E?.product_name,style:{"object-fit":"contain"},class:"w-[46px] h-[46px] rounded"},null,8,o5)):(p(),f("img",{key:1,src:E.product_image||n(re),alt:E?.product_name,style:{"object-fit":"contain"},class:"w-[46px] h-[46px] rounded"},null,8,s5)),i("div",n5,[i("p",{class:"font-bold text-sm line-clamp-2 break-all leading-relaxed xl:w-[480px]",style:b({color:n(w).black})},c(n(Y)==="th"?E?.product_name:E?.product_name_en||E?.product_name),5),E.product_attribute_detail.key_1_value?(p(),f("div",i5,[i("p",{title:`${n(Y)==="th"?E.product_attribute_detail.key_1_value:E.product_attribute_detail.key_1_value_en||E.product_attribute_detail.key_1_value} ${n(Y)==="th"?E.product_attribute_detail.attribute_priority_1:E.product_attribute_detail.attribute_priority_1_en||E.product_attribute_detail.attribute_priority_1}, ${n(Y)==="th"?E.product_attribute_detail.key_2_value:E.product_attribute_detail.key_2_value_en||E.product_attribute_detail.key_2_value} ${n(Y)==="th"?E.product_attribute_detail.attribute_priority_2:E.product_attribute_detail.attribute_priority_2_en||E.product_attribute_detail.attribute_priority_2}`,class:"text-xs line-clamp-1 break-all"},[gt(c(n(Y)==="th"?E.product_attribute_detail.attribute_priority_1:E.product_attribute_detail.attribute_priority_1_en||E.product_attribute_detail.attribute_priority_1)+" ",1),E.product_attribute_detail.key_2_value?(p(),f("span",r5," , "+c(n(Y)==="th"?E.product_attribute_detail.attribute_priority_2:E.product_attribute_detail.attribute_priority_2_en||E.product_attribute_detail.attribute_priority_2),1)):C("",!0)],8,l5)])):C("",!0),i("div",a5,[i("span",c5,"x"+c(E?.quantity),1),i("span",d5,c(E.vat_default=="no"?ot(Number(E?.real_price)*Number(E?.quantity)):ot(Number(E?.revenue_vat)*Number(E?.quantity))),1)])])])]),i("td",u5," x"+c(E?.quantity),1),i("td",h5,c(ot(Number(E?.total_normal_real_price))),1)],2))),128))])])],8,Q3)]),i("div",{class:"p-4 rounded-bl-lg rounded-br-lg flex justify-end",style:b({backgroundColor:n(w).bg_color2})},[i("div",p5,[i("div",f5,[i("div",null,c(n(t)("item_count",{count:Q.total_quantity}))+" :  ",1),i("div",_5,c(ot(Q?.net_price)),1)]),Q?.status==="Cancel"&&Q?.payment_pay_type!=="Credit Card"&&Q?.transaction_status==="Success"&&Q?.account_data.length===0&&!n(w).UploadSlip?(p(),f("div",m5,[i("button",{class:"px-4 py-2 rounded-full text-sm font-bold hover:bg-opacity-10 focus:outline-none focus:ring-opacity-50 cursor-pointer",onClick:E=>T(Q),style:b({border:`1px solid ${n(w).color}`,color:"white",backgroundColor:n(w).color,"--tw-ring-color":n(w).color})},c(n(t)("refund_channal")),13,v5)])):C("",!0)])],4)],4))),128))])),!n(s)&&Array.isArray(n(r))&&n(r).length!=0?(p(),f("div",g5,[i("p",b5,c(n(t)("show_"))+" "+c(n(yt))+" - "+c(n(Ft))+" "+c(n(t)("show_1"))+" "+c(n(ct).total_all||0)+" "+c(n(t)("show_2")),1),i("div",x5,[i("button",{disabled:n(ct)?.pagination?.current_page===1,onClick:kt[8]||(kt[8]=Q=>Tt()),class:"w-8 h-8 text-2xl rounded-full disabled:opacity-50 disabled:cursor-default cursor-pointer flex justify-center items-center"}," ‹ ",8,y5),(p(!0),f(at,null,xt(n(N),Q=>
27(p(),f(at,{key:Q},[Q!=="..."?(p(),f("button",{key:0,class:"min-w-[32px] min-h-[32px] md:min-w-[32px] md:min-h-[32px] lg:min-w-[32px] lg:min-h-[32px] xl:min-w-[32px] xl:min-h-[32px] aspect-square p-1 rounded-full text-sm xl:text-base flex justify-center items-center cursor-pointer disabled:cursor-default",style:b(Q==n(ct)?.pagination?.current_page?{backgroundColor:n(w).color,color:"white"}:{}),onClick:E=>St(Q)},c(Q),13,w5)):(p(),f("span",k5,"..."))],64))),128)),n(N).length<1?(p(),f("button",{key:0,class:"min-w-[32px] min-h-[32px] md:min-w-[32px] md:min-h-[32px] lg:min-w-[32px] lg:min-h-[32px] xl:min-w-[32px] xl:min-h-[32px] aspect-square p-1 rounded-full text-base flex justify-center items-center",style:b({backgroundColor:n(w).color,color:"white"})}," 1 ",4)):C("",!0),i("button",{disabled:n(ct)?.pagination?.current_page===n(ct)?.pagination?.last_page||n(ct)?.pagination?.last_page==0,onClick:kt[9]||(kt[9]=Q=>vt()),class:"w-8 h-8 text-2xl rounded-full disabled:opacity-50 cursor-pointer disabled:cursor-default flex justify-center items-center"}," › ",8,$5)])])):C("",!0)],64)}}},M5=mo(C5,[["__scopeId","data-v-8ef02767"]]),S5={xmlns:"http://www.w3.org/2000/svg",width:"60",height:"60",fill:"none"};function D5(o,t){return p(),f("svg",S5,[...t[0]||(t[0]=[rs('<path stroke="currentColor" stroke-linecap="square" stroke-miterlimit="10" stroke-width="2" d="m33.64 48.592 3.663 3.758c.809.83 2.12.83 2.93 0a2.165 2.165 0 0 0 0-3.006l-3.663-3.758"></path><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M56 28h-7v19h7zM5 47h7V28H5zM28.965 9.313h-8.287v6.377h8.287z"></path><path stroke="currentColor" stroke-linecap="square" stroke-miterlimit="10" stroke-width="2" d="M33.107 11.438h7.251M33.107 15.688h7.2509999999999994M20.678 19.945h19.681M20.68 24H40.36M36.571 45.59l4.392 4.506c.81.832 2.125.832 2.936 0a2.17 2.17 0 0 0 .006-3.006L39 40.002l-8.407-6.682"></path><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M44.501 29.72V5.064H16.533v19.715"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M16.533 29.722v-5.527"></path><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="m39.018 33.364-.812.52a5.18 5.18 0 0 1-4.63.463l-2.558-.983-2.747 2.375a3.61 3.61 0 0 1-4.582.083l-.671-.537 4.5-5.762c.944-1.21 2.426-1.921 4-1.921h3.5"></path><path fill="currentColor" d="M42.5 43.602a1 1 0 1 0 0 2v-2m6.5 1v1h1v-1zm0-14h1a1 1 0 0 0-1-1zm-5.408 0-.576.817a1 1 0 0 0 .576.183zm-1.986-1.4.576-.818zm-7.588-2.6a1 1 0 1 0 0 2v-2m8.482 18v1H49v-2h-6.5zm6.5 0h1v-14h-2v14zm0-14v-1h-5.408v2H49zm-5.408 0 .576-.818-1.986-1.4-.576.818-.576.817 1.986 1.4zm-1.986-1.4.576-.818a9.87 9.87 0 0 0-5.682-1.782v2c1.64 0 3.23.5 4.53 1.417zm-5.106-1.6v-1h-2.482v2H36.5z"></path><path fill="currentColor" d="M32.018 28.602a1 1 0 0 0 0-2v2m-9.88-.156-.423-.907zm-4.636 2.156v1a1 1 0 0 0 .422-.094zm-5.502 0v-1h-1v1zM12 44.5h-1v.985l.984.015zm6.452 1.1a1 1 0 1 0 .031-2l-.015 1zm13.566-18v-1h-6.034v2h6.034zm-6.034 0v-1c-1.479 0-2.94.32-4.269.938l.422.907.422.907a8.1 8.1 0 0 1 3.425-.751zm-3.847.845-.422-.907-4.635 2.156.422.907.422.906 4.635-2.155zm-4.635 2.156v-1H12v2h5.502zm-5.502 0h-1V44.5h2V30.6zM12 44.5l-.016 1 6.468.1.015-1 .016-1-6.467-.1z"></path><path stroke="currentColor" stroke-linecap="square" stroke-miterlimit="10" stroke-width="2" d="m33.64 48.594 2.93 3.006c.81.83.81 2.176 0 3.006-.809.83-2.12.83-2.93 0M23.1 45.75l-1.332 1.628c-.735.9-1.458.094-2.335-.66-.876-.756-1.575-1.173-.84-2.073l1.333-1.628a2.036 2.036 0 0 1 2.918-.262c.877.755.991 2.096.256 2.995Z"></path><path stroke="currentColor" stroke-linecap="square" stroke-miterlimit="10" stroke-width="2" d="m26.276 48.484-1.332 1.629c-.735.899-1.317.336-2.194-.418-.876-.755-1.715-1.416-.98-2.315l1.332-1.629a2.036 2.036 0 0 1 2.918-.261c.877.754.991 2.095.256 2.994Z"></path><path stroke="currentColor" stroke-linecap="square" stroke-miterlimit="10" stroke-width="2" d="m29.45 51.21-1.332 1.63c-.736.898-1.54.1-2.416-.654s-1.494-1.18-.758-2.08l1.332-1.628a2.036 2.036 0 0 1 2.918-.262c.877.755.991 2.096.256 2.995Z"></path><path stroke="currentColor" stroke-linecap="square" stroke-miterlimit="10" stroke-width="2" d="m32.622 53.945-1.332 
271.629c-.735.899-1.376.202-2.253-.553-.876-.754-1.741-1.19-1.006-2.09l1.417-1.718a2.036 2.036 0 0 1 2.919-.263c.876.755.99 2.096.255 2.995Z"></path>',12)])])}const A5={render:D5},z5={xmlns:"http://www.w3.org/2000/svg",width:"60",height:"60",fill:"none"};function j5(o,t){return p(),f("svg",z5,[...t[0]||(t[0]=[i("path",{stroke:"#C4021A","stroke-miterlimit":"10","stroke-width":"2",d:"M28.472 8.586h-9.179V54.48h33.655V8.586H43.77"},null,-1),i("path",{stroke:"#C4021A","stroke-miterlimit":"10","stroke-width":"2",d:"M40.71 11.643h-9.178l-3.06-3.06v-3.06H43.77v3.06zM23.89 36.117h3.047M48.353 36.117H30.008M23.89 42.234h3.047M48.353 42.234H30.008M23.89 48.36h3.047M48.353 48.36H30.008M7.055 17.766h6.119v28.697c0 2.77-1.1 5.427-3.06 7.386a10.45 10.45 0 0 1-3.06-7.386zM7.055 44.664h6.119M7.055 23.883h6.119M36 32a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM38.746 21.094l-5.488 5.488M38.746 26.582l-5.488-5.488"},null,-1)])])}const ir={render:j5},T5={key:0,class:"text-form"},P5={key:0,class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},L5={class:"flex items-center"},R5={class:"text-[16px] xl:text-[18px] font-semibold"},O5={key:1,class:"space-y-4"},B5={class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},E5={class:"flex items-center justify-between w-full"},F5={class:"text-[16px] xl:text-[18px] font-semibold flex-1 xl:flex-none text-left"},I5={class:"text-base font-normal"},N5={class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},H5={class:"text-[16px] xl:text-[18px] font-bold"},V5={class:"text-[14px] font-bold mt-7"},W5={class:"mt-3"},U5={class:"text-[14px] font-bold mt-4"},Y5={class:"mt-3"},q5={class:"mt-3"},Z5={class:"mt-3"},X5={class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},K5={class:"text-[18px] font-bold"},G5={class:"text-[14px] font-bold mt-7"},Q5={class:"mt-3"},J5={class:"mt-3"},t$={class:"text-[14px] font-bold mt-4"},e$={class:"mt-3"},o$={class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},s$={class:"text-[18px] font-bold"},n$={class:"mt-7"},i$={key:0},l$={class:"mt-3 break-all"},r$={key:1},a$={class:"mt-3 break-all"},c$={key:2},d$={class:"mt-3 break-all"},u$={key:3},h$={class:"mt-3 break-all"},p$={key:4},f$={class:"mt-3 break-all"},_$={key:2,class:"space-y-4"},m$={class:"w-full flex rounded-lg px-4 py-6 bg-white mb-8"},v$={class:"flex items-center justify-between w-full"},g$={class:"text-[16px] xl:text-[18px] font-semibold"},b$={class:"text-base font-normal"},x$={class:"flex flex-col items-center justify-center py-14 text-center rounded-lg px-4 py-6 bg-white mb-8"},y$={class:"w-20 h-20 rounded-full flex items-center justify-center mb-2"},w$={class:"text-base font-bold"},k$={class:"text-gray-600"},$$={key:3,class:"space-y-4"},C$={class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},M$={class:"flex items-center justify-between w-full"},S$={class:"flex items-center"},D$={class:"text-[18px] font-semibold"},A$={class:"text-base font-normal"},z$={class:"flex flex-col items-center justify-center py-14 text-center rounded-lg px-4 py-6 bg-white mb-8"},j$={class:"w-20 h-20 rounded-full flex items-center justify-center mb-2"},T$={class:"text-base font-bold"},P$={class:"text-gray-600"},L$={key:4,class:"space-y-4"},R$={class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},O$={class:"flex items-center w-full"},B$={class:"text-[16px] xl:text-[18px] font-semibold"},E$={key:0,class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},F$={class:"flex justify-between items-center"},I$={class:"text-[16px] xl:text-[18px] font-bold"},N$={class:"text-[14px] font-bold mt-7"},H$={class:"mt-3"},V$={class:"text-[14px] font-bold mt-4"},W$={class:"mt-3"},U$={class:"mt-3"},Y$={class:"mt-3"},q$={key:1,class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},Z$={class:"flex justify-between items-center"},X$={class:"text-[16px] xl:text-[18px] font-bold"},K$={class:"text-[14px] font-bold mt-7"},G$={class:"mt-3"},Q$={class:"mt-3"},J$={class:"text-[14px] font-bold mt-4"},t6={class:"mt-3"},e6={key:2,class:"w-full rounded-lg px-4 py-6 bg-white"},o6={class:"flex justify-between items-center"},s6={class:"text-[16px] xl:text-[18px] font-bold"},n6={class:"mt-7"},i6={key:0},l6={class:"mt-3 break-all"},r6={key:1},a6={class:"mt-3 break-all"},c6={key:2},d6={class:"mt-3 break-all"},u6={key:3},h6={class:"mt-3 break-all"},p6={key:4},f6={class:"mt-3 break-all"},_6={key:5,class:"flex flex-col items-center justify-center py-14 text-center rounded-lg px-4 py-6 bg-white mb-8"},m6={class:"w-20 h-20 rounded-full flex items-center justify-center mb-2"},v6={class:"text-[16px] font-bold"},g6={class:"text-gray-600 text-center mt-2 mb-2"},b6={class:"block md:hidden"},x6={class:"hidden md:block"},y6={key:1,class:"text-form"},w6={class:"w-full rounded-lg px-4 py-6 bg-white mb-8"},k6={class:"flex items-center"},$6={class:"text-[16px] xl:text-[18px] font-semibold text-[#343434]"},C6={class:"flex items-center justify-between relative mt-5"},M6={class:"flex flex-col items-center flex-1"},S6={class:"flex flex-col items-center flex-1"},D6={class:"flex flex-col items-center flex-1"},A6={key:0,class:"step1-form"},z6={class:"rounded-lg px-4 py-6 bg-white mb-8"},j6={class:"text-[16px] font-bold"},T6={class:"flex mb-4 mt-5"},P6={class:"flex items-center space-x-2"},L6={class:"text-[16px] cursor-pointer"},R6={class:"flex items-center space-x-2 xl:ml-18 md:ml-20 ml-0"},O6={class:"text-[16px] cursor-pointer"},B6={class:"mt-5"},E6={class:"text-[16px] font-bold"},F6={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},I6={class:"mt-5 flex flex-col"},N6={class:"mb-2 font-medium text-[16px]"},H6=["placeholder"],V6={key:0,class:"text-red-500 text-sm"},W6={class:"mb-2 font-medium text-[16px]"},U6={class:"relative w-full"},Y6={class:"absolute inset-y-0 right-5 flex items-center pointer-events-none"},q6=["onClick"],Z6={key:0,class:"text-red-500 text-sm"},X6={class:"mt-5 flex flex-col"},K6={class:"mb-2 font-medium text-[16px]"},G6=["placeholder"],Q6={key:0,class:"text-red-500 text-sm"},J6={class:"mt-5 flex flex-col"},t8={class:"mb-2 font-medium text-[16px]"},e8=["placeholder","maxlength"],o8={key:0,class:"text-red-500 text-sm"},s8={class:"flex flex-col gap-2 py-8 border-y border-gray-300 my-4"},n8={class:"flex justify-between items-start flex-col gap-2 md:flex-row md:items-center"},i8={class:"font-bold flex items-center text-[16px]"},l8={key:0,class:"flex justify-center bg-gray-100 rounded-lg text-center mt-4 p-2"},r8=["src"],a8={key:1,class:"flex flex-col items-center justify-center mt-6 space-y-2"},c8={class:"mt-10 lg:mt-20 xl:mt-10"},d8={class:"mb-4 mt-5"},u8={class:"text-[16px] font-medium text-[#343434] mb-2"},h8={class:"block xl:hidden"},p8={class:"hidden xl:block"},f8={class:"text-[14px] text-gray-500 mb-4"},_8={key:3,class:"flex items-center gap-2 mt-2 text-red-500"},m8={key:4,class:"flex items-center gap-2 mt-2 text-red-500"},v8={class:"flex justify-end"},g8=["disabled"],b8={key:1,class:"step2-form"},x8={class:"rounded-lg px-4 py-6 bg-white mb-30"},y8={class:"text-[16px] font-bold"},w8={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},k8={class:"mt-5 flex flex-col"},$8={class:"mb-2 font-medium text-[16px]"},C8=["placeholder"],M8={key:0,class:"text-red-500 text-sm"},S8={class:"mt-2 md:mt-4 flex flex-col"},D8={class:"mb-3 font-medium invisible hidden md:block"},A8=["placeholder"],z8={key:0,class:"text-red-500 text-sm"},j8={class:"mt-5 flex flex-col md:col-span-2"},T8={class:"mb-2 font-medium text-[16px]"},P8=["placeholder"],L8={key:0,class:"text-red-500 text-sm"},R8={class:"mt-5"},O8={class:"text-[16px] font-bold"},B8={class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 mb-4"},E8={class:"mt-5 flex flex-col"},F8={class:"mb-2 font-medium text-[16px]"},I8=["placeholder"],N8={key:0,class:"text-red-500 text-sm"},H8={class:"mt-5 flex flex-col"},V8={class:"mb-2 font-medium text-[16px]"},W8=["placeholder"],U8={class:"mt-5 flex flex-col"},Y8={class:"mb-2 font-medium text-[16px]"},q8=["placeholder"],Z8={class:"mt-5 flex flex-col"},X8={class:"mb-2 font-medium text-[16px]"},K8=["placeholder"],G8={class:"mt-5 flex flex-col"},Q8={class:"mb-2 font-medium text-[16px]"},J8=["placeholder"],t7={class:"mt-5 flex flex-col"},e7={class:"mb-2 font-medium text-[16px]"},o7=["placeholder"],s7={class:"mt-5 flex flex-col"},n7={class:"mb-2 font-medium text-[16px]"},i7=["placeholder"],l7={class:"mt-5 flex flex-col"},r7={class:"mb-2 font-medium text-[16px]"},a7=["placeholder"],c7={class:"mt-5 flex flex-col"},d7={class:"mb-2 font-medium text-[16px]"},u7=["placeholder"],h7={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},p7={class:"mb-2 font-medium text-[16px]"},f7={class:"relative w-full"},_7=["onClick"],m7={key:0,class:"text-red-500 text-sm mt-1"},v7={class:"mb-2 font-medium text-[16px]"},g7={class:"relative w-full"},b7=["onClick"],x7={key:0,class:"text-red-500 text-sm"},y7={class:"mb-2 font-medium text-[16px]"},w7={class:"relative w-full"},k7=["onClick"],$7={key:0,class:"text-red-500 text-sm"},C7={class:"mb-2 font-medium text-[16px]"},M7={class:"relative w-full"},S7=["onClick"],D7={key:0,class:"text-red-500 text-sm"},A7={class:"flex justify-end space-x-4 mt-4"},z7=["disabled"],j7={key:2,class:"step3-form"},T7={class:"rounded-lg px-4 py-6 bg-white mb-8"},P7={class:"text-[16px] font-bold"},L7={class:"text-[14px] font-normal mt-3"},R7={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},O7={class:"mt-5 flex flex-col md:col-span-2"},B7=["placeholder"],E7={class:"mt-5 flex flex-col md:col-span-2"},F7=["placeholder"],I7={class:"mt-5 flex flex-col md:col-span-2"},N7=["placeholder"],H7={class:"mt-5 flex flex-col md:col-span-2"},V7=["placeholder"],W7={class:"mt-5 flex flex-col md:col-span-2"},U7=["placeholder"],Y7={class:"flex items-center mb-2 mt-5"},q7={class:"inline-flex items-center"},Z7={class:"flex items-center cursor-pointer relative w-5 h-5"},X7={class:"ml-2 block text-[16px] text-gray-900"},K7={class:"flex justify-end space-x-4 mt-4"},G7=["disabled"],Q7={key:2,class:"edit-form rounded-lg px-4 py-6 bg-white"},J7={class:"flex items-center mb-7"},t9={class:"text-[16px] xl:text-[18px] font-semibold"},e9={class:"text-[16px] font-bold"},o9={class:"flex mb-4 mt-5"},s9={class:"flex items-center space-x-2"},n9={class:"text-[16px]"},i9={class:"flex items-center space-x-2 ml-20"},l9={class:"text-[16px]"},r9={class:"mt-5"},a9={class:"text-[16px] font-bold"},c9={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},d9={class:"mt-5 flex flex-col"},u9={class:"mb-2 font-medium text-[16px]"},h9=["placeholder"],p9={key:0,class:"text-red-500 text-sm"},f9={class:"mb-2 font-medium text-[16px]"},_9={class:"relative w-full"},m9={class:"truncate"},v9={class:"absolute inset-y-0 right-5 flex items-center pointer-events-none"},g9=["onClick"],b9={class:"mt-5 flex flex-col"},x9={class:"mb-2 font-medium text-[16px]"},y9=["placeholder"],w9={key:0,class:"text-red-500 text-sm"},k9={class:"mt-5 flex flex-col"},$9={class:"mb-2 font-medium text-[16px]"},C9=["maxlength","placeholder"],M9={key:0,class:"text-red-500 text-sm"},S9={class:"flex flex-col gap-2 py-8 border-y border-gray-300 my-4"},D9={class:"flex justify-between items-start flex-col gap-2 md:flex-row md:items-center"},A9={class:"font-bold flex items-center text-[16px]"},z9={key:0,class:"flex justify-center bg-gray-100 rounded-lg text-center mt-4 p-2"},j9=["src"],T9={class:"mt-10"},P9={key:2,class:"flex items-center gap-2 mt-2 text-red-500"},L9={key:3,class:"flex items-center gap-2 mt-2 text-red-500"},R9={class:"flex justify-end space-x-4 mt-4"},O9=["disabled"],B9={key:3,class:"edit-form rounded-lg px-4 py-6 bg-white"},E9={class:"flex items-center mb-7"},F9={class:"text-[16px] xl:text-[18px] font-bold"},I9={class:"text-[16px] font-bold mt-5"},N9={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},H9={class:"mt-5 flex flex-col"},V9={class:"mb-2 font-medium text-[16px]"},W9=["placeholder"],U9={key:0,class:"text-red-500 text-sm"},Y9={class:"mt-2 md:mt-5 flex flex-col"},q9={class:"mb-3 font-medium invisible hidden md:block"},Z9=["placeholder"],X9={key:0,class:"text-red-500 text-sm"},K9={class:"mt-2 md:mt-5 flex flex-col md:col-span-2"},G9={class:"mb-2 font-medium text-[16px]"},Q9=["placeholder"],J9={key:0,class:"text-red-500 text-sm"},tC={class:"mt-5"},eC={class:"text-[16px] font-bold"},oC={class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 mb-4"},sC={class:"mt-5 flex flex-col"},nC={class:"mb-2 font-medium text-[16px]"},iC=["placeholder"],lC={key:0,class:"text-red-500 text-sm"},rC={class:"mt-5 flex flex-col"},aC={class:"mb-2 font-medium text-[16px]"},cC=["placeholder"],dC={class:"mt-5 flex flex-col"},uC={class:"mb-2 font-medium text-[16px]"},hC=["placeholder"],pC={class:"mt-5 flex flex-col"},fC={class:"mb-2 font-medium text-[16px]"},_C=["placeholder"],mC={class:"mt-5 flex flex-col"},vC={class:"mb-2 font-medium text-[16px]"},gC=["placeholder"],bC={class:"mt-5 flex flex-col"},xC={class:"mb-2 font-medium text-[16px]"},yC=["placeholder"],wC={class:"mt-5 flex flex-col"},kC={class:"mb-2 font-medium text-[16px]"},$C=["placeholder"],CC={class:"mt-5 flex flex-col"},MC={class:"mb-2 font-medium text-[16px]"},SC=["placeholder"],DC={class:"mt-5 flex flex-col"},AC={class:"mb-2 font-medium text-[16px]"},zC=["placeholder"],jC={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},TC={class:"mb-2 font-medium text-[16px]"},PC={class:"relative w-full"},LC={class:"text-[16px]"},RC=["onClick"],OC={key:0,class:"text-red-500 text-sm"},BC={class:"mb-2 font-medium text-[16px]"},EC={class:"relative w-full"},FC={class:"text-[16px]"}
27,IC=["onClick"],NC={key:0,class:"text-red-500 text-sm"},HC={class:"mb-2 font-medium text-[16px]"},VC={class:"relative w-full overflow-visible"},WC={class:"text-[16px]"},UC=["onClick"],YC={key:0,class:"text-red-500 text-sm"},qC={class:"mb-2 font-medium text-[16px]"},ZC={class:"relative w-full"},XC={class:"text-[16px]"},KC=["onClick"],GC={key:0,class:"text-red-500 text-sm"},QC={class:"flex justify-end space-x-4 mt-4"},JC=["disabled"],tM={key:4,class:"edit-form rounded-lg px-4 py-6 bg-white"},eM={class:"flex items-center mb-7"},oM={class:"text-[16px] xl:text-[18px] font-bold"},sM={class:"text-[14px] font-normal mt-3"},nM={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"},iM={class:"mt-5 flex flex-col md:col-span-2"},lM=["placeholder"],rM={class:"flex flex-col md:col-span-2"},aM=["placeholder"],cM={class:"flex flex-col md:col-span-2"},dM=["placeholder"],uM={class:"flex flex-col md:col-span-2"},hM=["placeholder"],pM={class:"flex flex-col md:col-span-2"},fM=["placeholder"],_M={class:"flex justify-end space-x-4 mt-4"},mM=["disabled"],vM={key:5,class:"fixed inset-0 bg-black/30 flex items-center justify-center z-50"},gM={class:"bg-white rounded-lg shadow-lg text-center w-[327px] h-[180px] sm:w-[600px] sm:h-[220px]"},bM={class:"px-4 pt-4 sm:px-6 sm:pt-4 sm:mt-5"},xM={class:"text-[16px] xl:text-[20px] font-semibold mb-2 sm:mb-2"},yM={class:"text-[14px] xl:text-[16px] mb-4 sm:mb-2"},wM={class:"block sm:inline"},kM={class:"flex justify-center gap-3 sm:gap-4 mt-4 sm:mt-6"},$M={key:6,class:"fixed inset-0 bg-black/30 flex items-center justify-center z-50"},CM={class:"bg-white rounded-lg shadow-lg text-center w-[327px] h-[171px] sm:w-[600px] sm:h-[220px]"},MM={class:"px-4 pt-4 sm:px-6 sm:pt-4 sm:mt-5"},SM={class:"text-[16px] sm:text-[20px] font-semibold mb-2 sm:mb-2"},DM={class:"text-[14px] sm:text-[16px] mb-4 sm:mb-2"},AM={class:"flex justify-center gap-3 sm:gap-4 mt-4 sm:mt-6"},zM={key:7,class:"fixed inset-0 bg-black/30 flex items-center justify-center z-50"},jM={class:"bg-white rounded-lg p-6 w-[300px] lg:w-[350px] xl:w-[400px] shadow-lg text-center"},TM={class:"text-xl font-semibold mb-4"},PM={class:"flex justify-center"},LM={key:8,class:"fixed inset-0 bg-black/30 flex items-center justify-center z-50"},RM={class:"bg-white rounded-lg p-6 w-[327px] md:w-[500px] lg:w-[500px] xl:w-[600px] shadow-lg text-center"},OM={class:"text-[20px] font-bold mb-2"},BM={class:"text-[16px] font-normal"},EM={class:"flex justify-center"},FM={__name:"Affiliate",emits:["refreshData"],setup(o,{emit:t}){const{t:e}=ee(),s=bn(),l=Po(),r=Vs(),a=Po(),d=lt(()=>v.color),u=z(1),h=z(""),_=je();yn(),xn();const{showContent:m}=Qt(_),x=z(!1),$=z(!1),S=z(!1);_o();const v=ke(),M=_o(),{color:w,button_color:I,bg_color:O}=Qt(v),tt=z(null),G=z(null),Y=z(null),et=z(null),ht=z(null),ct=z(null),dt=z(null),pt=z(null),D=z(!1),Mt=z(!1),ot=z(!1),st=z(null),X=z(!1),H=z(!1),P=z(!1),W=z(!0),U=z(!1),B=z(!1),Z=z(null),q=z(!1),ut=z(!1),wt=z(!1),St=z(!1),Tt=z(!1),vt=z(!1),yt=z(!1),Ft=z(!1),N=z(null),$t=z(null),T=z(null),Pt=z(null),Rt=z({top:0,left:0,width:0}),{locale:ft}=ee(),F=lt(()=>l.getProvince||[]),R=lt(()=>tt.value?(l.originalAmphures||[]).filter(it=>it.province_id===tt.value):[]),kt=lt(()=>G.value?(l.originalTambon||[]).filter(it=>it.amphure_id===G.value):[]),qt=lt(()=>ht.value?.id?[ht.value]:[]),It=()=>{if(!U.value){const it=Z.value.getBoundingClientRect(),k=window.innerHeight-it.bottom,V=200;B.value=k<V}U.value=!U.value},he=()=>{if(!q.value){const it=N.value.getBoundingClientRect(),k=window.innerHeight-it.bottom,V=200;ut.value=k<V}q.value=!q.value},Q=()=>{if(!wt.value&&Y.value){const it=$t.value.getBoundingClientRect(),k=window.innerHeight-it.bottom,V=200;St.value=k<V}wt.value=!wt.value},E=()=>{if(!Tt.value&&et.value){const it=T.value.getBoundingClientRect(),k=window.innerHeight-it.bottom,V=200;vt.value=k<V,Rt.value={top:vt.value?it.top+window.scrollY-V:it.bottom+window.scrollY,left:it.left+window.scrollX,width:it.width}}Tt.value=!Tt.value},mt=()=>{if(!yt.value&&ht.value){const it=Pt.value.getBoundingClientRect(),k=window.innerHeight-it.bottom,V=150;Ft.value=k<V}yt.value=!yt.value},Zt=it=>{Y.value=it,Ot.province=it?.name_th||"",q.value=!1,et.value=null,Ot.district="",ht.value=null,Ot.sub_district="",ct.value=null,Ot.postal_code="",tt.value=it?.id||null,be.province&&(be.province="")},Oe=it=>{et.value=it,Ot.district=it?.name_th||"",wt.value=!1,ht.value=null,Ot.sub_district="",ct.value=null,Ot.postal_code="",G.value=it?.id||null,be.district&&(be.district="")},ve=it=>{ht.value=it,Ot.sub_district=it?.name_th||"",Tt.value=!1,ct.value=null,Ot.postal_code="",be.sub_district&&(be.sub_district="")},qo=it=>{ct.value=it,Ot.postal_code=it,yt.value=!1,be.zip_code&&(be.zip_code="")},Te=lt(()=>{const it=new Set;return kt.value.filter(k=>{const V=`${k.name_th}_${k.amphure_id}`;return it.has(V)?!1:(it.add(V),!0)})}),go=it=>{if(!it)return"";const k=l.getProvince.find(V=>V.name_th===it||V.name_en===it);return k?ft.value==="th"?k.name_th:k.name_en:it},Zo=it=>{if(!it)return"";const k=l.originalAmphures.find(V=>V.name_th===it||V.name_en===it);return k?ft.value==="th"?k.name_th:k.name_en:it},Xo=it=>{if(!it)return"";const k=l.originalTambon.find(V=>V.name_th===it||V.name_en===it);return k?ft.value==="th"?k.name_th:k.name_en:it},Ke=it=>{if(!it)return"";const k=yo.value.find(V=>V.name===it||V.name_en===it);return k?ft.value==="th"?k.name:k.name_en:it},Ko=it=>{Z.value?.contains(it.target)||(U.value=!1),N.value?.contains(it.target)||(q.value=!1),$t.value?.contains(it.target)||(wt.value=!1),T.value?.contains(it.target)||(Tt.value=!1),Pt.value?.contains(it.target)||(yt.value=!1)};we(()=>document.addEventListener("click",Ko)),as(()=>document.removeEventListener("click",Ko));const bo=it=>{_e.value=it??null,U.value=!1,Vt.bank_id=it?.id||null,Vt.bank_name=Nt(it),Vt.bank_no="",Xt.bank_no="",Ys(Vt)},Xt=We({account_type:"",bank_account_name:"",bank_branch:"",bank_no:"",bookbank_image_url:""}),Et=We({first_name:"",last_name:"",tax_id_invoice:"",house_no:"",room_no:"",floor:"",building:"",village:"",village_no:"",lane:"",intersection:"",road:"",sub_district:"",district:"",province:"",postal_code:""}),ce=We({facebook:"",tiktok:"",instagram:"",line:"",youtube:""}),Nt=it=>it?ft.value==="en"?it.name_en||it.name||it.name_th||"":it.name_th||it.name||"":"",qe=()=>{Xt.account_type=Dt.value.payment_detail.account_type||"",Xt.bank_account_name=Dt.value.payment_detail.bank_account_name||"",Xt.bank_branch=Dt.value.payment_detail.bank_branch||"",Xt.bank_no=Dt.value.payment_detail.bank_no||"",Xt.bank_code=Dt.value.payment_detail.bank_code||"";const it=Xt.bank_code?yo.value.find(Kt=>Kt.code===Xt.bank_code):null,k=(Dt.value.payment_detail.bank_name||"").trim(),V=k?yo.value.find(Kt=>Kt.name===k||Kt.name_en===k):null;_e.value=it||V||null,_e.value?(Xt.bank_code=_e.value.code,Xt.bank_name=Nt(_e.value)):Xt.bank_name=Dt.value.payment_detail.bank_name||"",Xt.bookbank_image_url=Dt.value.payment_detail.bookbank_image||"",pt.value=Xt.bookbank_image_url,Jt.value.payment=!0,window.scrollTo({top:0,behavior:"smooth"})},ds=()=>{const it=Dt.value?.tax_invoice_detail||{};Et.first_name=it.first_name||"",Et.last_name=it.last_name||"",Et.tax_id_invoice=it.tax_id_invoice||"",Et.house_no=it.house_no||"",Et.room_no=it.room_no||"",Et.floor=it.floor||"",Et.building=it.building||"",Et.village=it.village||"",Et.village_no=it.village_no||"",Et.lane=it.lane||"",Et.intersection=it.intersection||"",Et.road=it.road||"",Et.sub_district=it.sub_district||"",Et.district=it.district||"",Et.province=it.province||"",Et.postal_code=it.postal_code||"";const k=(l.getProvince||[]).find(He=>He.name_th===it.province||He.name_en===it.province);Y.value=k||null,tt.value=k?.id||null;const V=(l.originalAmphures||[]).find(He=>(He.name_th===it.district||He.name_en===it.district)&&He.province_id===tt.value);et.value=V||null,G.value=V?.id||null;const Kt=(l.originalTambon||[]).find(He=>(He.name_th===it.sub_district||He.name_en===it.sub_district)&&He.amphure_id===G.value);ht.value=Kt||null,ct.value=Kt||null,Jt.value.tax=!0,window.scrollTo({top:0,behavior:"smooth"})},rt=()=>{ce.facebook=Dt.value.social_detail.facebook||"",ce.tiktok=Dt.value.social_detail.tiktok||"",ce.instagram=Dt.value.social_detail.instagram||"",ce.line=Dt.value.social_detail.line||"",ce.youtube=
27Dt.value.social_detail.youtube||"",Jt.value.social=!0,window.scrollTo({top:0,behavior:"smooth"})};function lo(){H.value=!1,Jt.value.payment=!1,Jt.value.tax=!1,Jt.value.social=!1,window.scrollTo({top:0,behavior:"smooth"})}const Jt=z({payment:!1,tax:!1,social:!1}),Be=()=>{dt.value.click()},ro=it=>{const k=it.target.files[0];Ge(k)},xo=async()=>{await Yt(),Ss()},Ge=it=>{if(D.value=!1,Mt.value=!1,!it)return;if(!["image/png","image/jpeg"].includes(it.type)){D.value=!0;return}if(it.size>5*1024*1024){Mt.value=!0;return}st.value=it,X.value=!0;const k=new FileReader;k.onload=()=>{pt.value=k.result},k.readAsDataURL(it)},Yt=async()=>{if(!st.value){console.error("ไม่มีไฟล์ที่เลือก");return}try{const it=new FileReader;it.onload=async()=>{const V={type:"bookbank",image:[it.result.split(",")[1]]},Kt=await r.uploadBookBank(V);Kt?.data?.list_path?.length>0&&(Vt.bookbank_image_url=Kt.data.list_path[0].path)},W.value=!1,it.readAsDataURL(st.value)}catch(it){console.error("Upload failed:",it)}},ge=()=>new Promise((it,k)=>{if(!st.value)return it();const V=new FileReader;V.onload=async()=>{const He={type:"bookbank",image:[V.result.split(",")[1]]};try{const es=await r.uploadBookBank(He);es?.data?.list_path?.length>0&&(Xt.bookbank_image_url=es.data.list_path[0].path,pt.value=Xt.bookbank_image_url),it(es)}catch(es){console.error("Upload failed:",es),k(es)}},V.onerror=Kt=>k(Kt),V.readAsDataURL(st.value)}),Vt=We({account_type:"",bank_code:"",bank_name:"",bank_branch:"",bank_account_name:"",bank_no:"",bookbank_image_url:""}),Ot=We({first_name:"",last_name:"",tax_id_invoice:"",house_no:"",room_no:"",floor:"",building:"",village:"",village_no:"",lane:"",intersection:"",road:"",sub_district:"",district:"",province:"",postal_code:""}),oe=We({facebook:"",tiktok:"",instagram:"",line:"",youtube:""}),Us=async()=>{const it={payment_detail:Vt,tax_invoice_detail:Ot,social_detail:oe};r.setPayload(it),M.changeStateLoading(!0);try{const k=await r.createAffiliate();if(k?.code!==200)throw new Error(k?.message||"เกิดข้อผิดพลาดจากเซิร์ฟเวอร์");(k?.message==="Create user success"||k?.message==="Update user success")&&(M.affiliateSuccess(!0),M.changeStateLoading(!0)),console.log("API Success:",k)}catch(k){console.error("API Error:",k),h.value=k?.message||"เกิดข้อผิดพลาดในการส่งข้อมูล",$.value=!0}finally{M.changeStateLoading(!1)}},Cs=async()=>{try{M.changeStateLoading(!0),await ge();const it={account_type:Xt.account_type||"",bank_code:_e.value.code||"",bank_name:Nt(_e.value)||"",bank_branch:Xt.bank_branch||"",bank_account_name:Xt.bank_account_name||"",bank_no:Xt.bank_no||"",bookbank_image_url:Xt.bookbank_image_url};r.setPayloadpayment(it);const k=await r.editPayment();window.scrollTo({top:0,behavior:"smooth"}),s.trigger(e("payment_update"),"success"),Jt.value.payment=!1,await r.checkStatus(),k?.message}catch(it){console.error("Confirm edit payment failed:",it),s.trigger(e("fail_account"),"error")}finally{M.changeStateLoading(!1)}},Go=lt(()=>jt.step1.bank_account_name||jt.step1.bank_name||jt.step1.bank_branch||jt.step1.bank_no||!!!pt),Ms=async()=>{const it={first_name:Et.first_name||"",last_name:Et.last_name||"",tax_id_invoice:Et.tax_id_invoice||"",house_no:Et.house_no||"",room_no:Et.room_no||"",floor:Et.floor||"",building:Et.building||"",village:Et.village||"",village_no:Et.village_no||"",lane:Et.lane||"",intersection:Et.intersection||"",road:Et.road||"",sub_district:ht.value?.name_th||Et.sub_district||"",district:et.value?.name_th||Et.district||"",province:Y.value?.name_th||Et.province||"",postal_code:ct.value?.zip_code||ct.value?.zipcode||Et.postal_code||""};r.setPayloadtax(it),M.changeStateLoading(!0);try{(await r.editTax())?.message==="update success"&&(window.scrollTo({top:0,behavior:"smooth"}),s.trigger(e("tax_update"),"success"),Jt.value.tax=!1,await r.checkStatus())}catch(k){console.error("Confirm edit tax failed:",k),s.trigger(e("fail_tax"),"error")}finally{M.changeStateLoading(!1)}},Qe=lt(()=>jt.step2.first_name||jt.step2.last_name||jt.step2.tax_id_invoice||jt.step2.house_no||!Y.value||!et.value||!ht.value||!ct.value),Oo=async()=>{const it={facebook:ce.facebook||"",tiktok:ce.tiktok||"",instagram:ce.instagram||"",youtube:ce.youtube||"",line:ce.line||""};r.setPayloadsocial(it),M.changeStateLoading(!0);try{(await r.editSocial())?.message==="update success"&&(window.scrollTo({top:0,behavior:"smooth"}),s.trigger(e("social_update"),"success"),Jt.value.social=!1,await r.checkStatus())}catch(k){console.error("Confirm edit social failed:",k),s.trigger(e("fail_social"),"error")}finally{M.changeStateLoading(!1)}},Qo=lt(()=>!(ce.facebook?.trim()||ce.tiktok?.trim()||ce.instagram?.trim()||ce.youtube?.trim()||ce.line?.trim())),Ne=z(!1),us=lt(()=>!((oe.facebook?.trim()||oe.tiktok?.trim()||oe.instagram?.trim()||oe.line?.trim()||oe.youtube?.trim())&&Ne.value)),Ys=it=>{it&&(_e.value?(it.bank_code=_e.value.code||"",it.bank_name=Nt(_e.value)):(it.bank_code="",it.bank_name=""),Ut.step1.bank_name=!0,g(1,"bank_name",it))};pe(ct,it=>{Ot.postal_code=it?.zip_code||it?.zipcode||""});const Ss=()=>{(u.value===1&&le()||u.value===2&&ao())&&u.value++,window.scrollTo({top:0,behavior:"smooth"})},Jo=()=>{u.value>1&&u.value--,Ne.value=!1,window.scrollTo({top:0,behavior:"smooth"})},yo=lt(()=>r.getBank),_e=z(null),wo=lt(()=>r.check==="waiting"),ts=lt(()=>r.check==="reject"),Bo=lt(()=>r.check==="approve"),ko=lt(()=>r.check==="cancel"),Dt=lt(()=>r.getStatus),hs=lt(()=>_.getStatusRegister);we(async()=>{await Promise.all([a.loadProvince(),a.loadTambons(),a.loadAmphures(),r.loadBank(),r.checkStatus()])});const be=We({}),jt=We({step1:{account_type:"",bank_code:"",bank_name:"",bank_account_name:"",bank_no:"",bank_branch:""},step2:{first_name:"",last_name:"",tax_id_invoice:"",house_no:"",sub_district:"",district:"",province:"",postal_code:""},step3:{social_media:""}}),K=it=>{switch(it){case"province":be.province=Y.value?"":"please_select_province";break;case"district":be.district=et.value?"":"please_select_district";break;case"sub_district":be.sub_district=ht.value?"":"please_select_sub_district";break;case"zip_code":be.zip_code=ct.value?"":"please_select_postal_code";break}};function g(it,k,V){if(it===1&&Ut.step1[k]&&(k==="account_type"&&(jt.step1.account_type=V.account_type?"":"enter_account_type"),k==="bank_account_name"&&(jt.step1.bank_account_name=V.bank_account_name?.trim()?"":"enter_account_name"),k==="bank_name"&&(jt.step1.bank_name=V.bank_name?"":"enter_select_bank"),k==="bank_branch"&&(jt.step1.bank_branch=V.bank_branch?.trim()?"":"enter_bank_branchs"),k==="bank_no"&&(jt.step1.bank_no=V.bank_no?.trim()?"":"enter_bank_account")),it===2&&Ut.step2[k]){if(k==="first_name"&&(jt.step2.first_name=V.first_name?.trim()?"":"please_enter_name"),k==="last_name"&&(jt.step2.last_name=V.last_name?.trim()?"":"please_enter_last_name"),k==="tax_id_invoice"){const Kt=V.tax_id_invoice?.trim();Kt?/^\d{13}$/.test(Kt)?y(Kt)?jt.step2.tax_id_invoice="":jt.step2.tax_id_invoice="invalid_taxid":jt.step2.tax_id_invoice="tax_digit":jt.step2.tax_id_invoice="enter_tax"}k==="house_no"&&(jt.step2.house_no=V.house_no?.trim()?"":"please_enter_house_number"),k==="sub_district"&&(jt.step2.sub_district=ht.value?"":"please_select_sub_district"),k==="district"&&(jt.step2.district=et.value?"":"please_select_district"),k==="province"&&(jt.step2.province=Y.value?"":"please_select_province"),k==="postal_code"&&(jt.step2.postal_code=ct.value?"":"please_select_postal_code")}if(it===3&&Ut.step3.social){const Kt=V.facebook||V.tiktok||V.youtube||V.instagram||V.line;jt.step3.social=Kt?"":"least_one"}}function y(it){if(!/^\d{13}$/.test(it))return!1;let k=0;for(let Kt=0;Kt<12;Kt++)k+=parseInt(it.charAt(Kt))*(13-Kt);return(11-k%11)%10===parseInt(it.charAt(12))}const Ut=We({step1:{account_type:!1,bank_account_name:!1,bank_code:!1,bank_name:!1,bank_branch:!1,bank_no:!1,bookbank_image_url:!1},step2:{first_name:!1,last_name:!1,house_no:!1,tax_id_invoice:!1,sub_district:!1,district:!1,province:!1,postal_code:!1},step3:{social:!1}});function le(){return g(1,"account_type",Vt),g(1,"bank_account_name",Vt),g(1,"bank_code",Vt),g(1,"bank_branch",Vt),g(1,"bank_no",Vt),g(1,"bookbank_image_url",Vt),Object.values(jt.step1).every(it=>it==="")}function ao(){return g(2,"first_name",Ot),g(2,"last_name",Ot),g(2,"house_no",Ot),g(2,"sub_district",Ot),g(2,"district",Ot),g(2,"province",Ot),g(2,"postal_code",Ot),Object.values(jt.step2).every(it=>it==="")}function Je(){return g(3,"social"),jt.step3.social===""}const co=lt(()=>u.value===1?!Vt.account_type||!Vt.bank_account_name?.trim()||!Vt.bank_code||!Vt.bank_branch?.trim()||!Vt.bank_no?.trim()||!le():u.value===2?!Ot.first_name?.trim()||!Ot.last_name?.trim()||!Ot.tax_id_invoice?.trim()||!Ot.house_no?.trim()||!ht.value||!et.value||!Y.value||!ct.value||!ao():u.value===3?!(oe.facebook?.trim()||oe.tiktok?.trim()||oe.youtube?.trim()||oe.instagram?.trim()||oe.line?.trim())||!Je():!1);function mi(){Vt.account_type="",Vt.bank_account_name="",Vt.bank_code="",Vt.bank_branch="",Vt.bank_no="",Vt.bookbank_image_url="",Ot.first_name="",Ot.last_name="",Ot.house_no="",Ot.sub_district="",Ot.district="",Ot.province="",Ot.postal_code="",Ot.tax_id_invoice="",oe.facebook="",oe.tiktok="",oe.youtube="",oe.instagram="",oe.line="",Object.keys(jt.step1).forEac
27h(it=>jt.step1[it]=""),Object.keys(jt.step2).forEach(it=>jt.step2[it]=""),Object.keys(jt.step3).forEach(it=>jt.step3[it]=""),Object.keys(Ut.step1).forEach(it=>Ut.step1[it]=!1),Object.keys(Ut.step2).forEach(it=>Ut.step2[it]=!1),Object.keys(Ut.step3).forEach(it=>Ut.step3[it]=!1),pt.value=null,_e.value=null}function Eo(){mi(),u.value=1,x.value=!1,P.value=!1}function Ee(){H.value=!0}const Ze=it=>{ot.value=!1;const k=it.dataTransfer?.files?.[0];Ge(k)};return(it,k)=>(p(),f(at,null,[x.value?C("",!0):(p(),f("div",T5,[!n(hs).is_affiliate&&!n(wo)&&!n(ts)&&!n(ko)?(p(),f("div",P5,[i("div",L5,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:k[0]||(k[0]=V=>m.value=!1)},[...k[95]||(k[95]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("p",R5,c(n(e)("account_affiliate")),1)])])):C("",!0),n(wo)&&!x.value?(p(),f("div",O5,[i("div",B5,[i("div",E5,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:k[1]||(k[1]=V=>m.value=!1)},[...k[96]||(k[96]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("p",F5,c(n(e)("account_affiliate")),1),i("div",null,[i("p",I5,c(n(e)("pending_approve")),1)])])]),i("div",N5,[i("p",H5,c(n(e)("payment_account")),1),i("p",V5,c(n(e)("account_type")),1),i("p",W5,c(n(Dt).payment_detail.account_type==="current"?n(e)("fixed_account"):n(Dt).payment_detail.account_type==="savings"?n(e)("saving_account"):n(Dt).payment_detail.account_type),1),i("p",U5,c(n(e)("payment_information")),1),i("p",Y5,c(n(Dt).payment_detail.bank_account_name),1),i("p",q5,c(n(ft)==="th"?n(Dt).payment_detail.bank_name:n(Dt).payment_detail.bank_name_en||n(Dt).payment_detail.bank_name)+" "+c(n(e)("branch"))+" "+c(n(Dt).payment_detail.bank_branch),1),i("p",Z5,c(n(Dt).payment_detail.bank_no),1)]),i("div",X5,[i("p",K5,c(n(e)("tax_information")),1),i("p",G5,c(n(e)("taxpayer")),1),i("p",Q5,c(n(Dt).tax_invoice_detail.first_name)+" "+c(n(Dt).tax_invoice_detail.last_name),1),i("p",J5,c(n(Dt).tax_invoice_detail.tax_id_invoice),1),i("p",t$,c(n(e)("id_card_address")),1),i("p",e$,c(n(e)("house_number"))+" "+c(n(Dt).tax_invoice_detail.house_no)+" "+c(n(e)("room_unit"))+" "+c(n(Dt).tax_invoice_detail.room_no)+" "+c(n(e)("floor_level"))+" "+c(n(Dt).tax_invoice_detail.floor)+" "+c(n(e)("building"))+" "+c(n(Dt).tax_invoice_detail.building)+" "+c(n(e)("village"))+" "+c(n(Dt).tax_invoice_detail.village)+" "+c(n(e)("village_no"))+" "+c(n(Dt).tax_invoice_detail.village_no)+" "+c(n(e)("soi_alley"))+" "+c(n(Dt).tax_invoice_detail.lane)+" "+c(n(e)("intersection"))+" "+c(n(Dt).tax_invoice_detail.intersection)+" "+c(n(e)("road_street"))+" "+c(n(Dt).tax_invoice_detail.road)+" "+c(n(e)("sub_district"))+" "+c(Xo(n(Dt).tax_invoice_detail.sub_district))+" "+c(n(e)("district_city"))+" "+c(Zo(n(Dt).tax_invoice_detail.district))+" "+c(n(e)("province"))+" "+c(go(n(Dt).tax_invoice_detail.province)),1)]),i("div",o$,[i("p",s$,c(n(e)("social_account_information")),1),i("div",n$,[n(Dt).social_detail.facebook&&n(Dt).social_detail.facebook!=="-"?(p(),f("div",i$,[k[97]||(k[97]=i("p",{class:"text-sm font-bold"},"Facebook",-1)),i("p",l$,c(n(Dt).social_detail.facebook),1)])):C("",!0),n(Dt).social_detail.instagram&&n(Dt).social_detail.instagram!=="-"?(p(),f("div",r$,[k[98]||(k[98]=i("p",{class:"text-sm font-bold mt-4"},"Instagram",-1)),i("p",a$,c(n(Dt).social_detail.instagram),1)])):C("",!0),n(Dt).social_detail.tiktok&&n(Dt).social_detail.tiktok!=="-"?(p(),f("div",c$,[k[99]||(k[99]=i("p",{class:"text-sm font-bold mt-4"},"TikTok",-1)),i("p",d$,c(n(Dt).social_detail.tiktok),1)])):C("",!0),n(Dt).social_detail.youtube&&n(Dt).social_detail.youtube!=="-"?(p(),f("div",u$,[k[100]||(k[100]=i("p",{class:"text-sm font-bold mt-4"},"YouTube",-1)),i("p",h$,c(n(Dt).social_detail.youtube),1)])):C("",!0),n(Dt).social_detail.line&&n(Dt).social_detail.line!=="-"?(p(),f("div",p$,[k[101]||(k[101]=i("p",{class:"text-sm font-bold mt-4"},"Line",-1)),i("p",f$,c(n(Dt).social_detail.line),1)])):C("",!0)])])])):C("",!0),n(ts)&&!x.value?(p(),f("div",_$,[i("div",m$,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:k[2]||(k[2]=V=>m.value=!1)},[...k[102]||(k[102]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("div",v$,[i("p",g$,c(n(e)("account_affiliate")),1),i("div",null,[i("p",b$,c(n(e)("not_approve")),1)])])]),i("div",x$,[i("div",y$,[zt(n(ir),{class:"h-14 w-14"})]),i("h2",w$,c(n(e)("not_approve_account")),1),i("p",k$,c(n(e)("reason"))+" "+c(n(Dt).remark),1),i("button",{onClick:k[3]||(k[3]=V=>
27x.value=!0),class:"w-[160px] h-[40px] cursor-pointer font-semibold rounded-full mt-2 flex items-center justify-center gap-2 border bg-white",style:b({borderColor:n(w),color:n(w)})},[gt(c(n(e)("register_aff"))+" ",1),zt(n(yi),{class:"w-4 h-4",style:b({color:n(w)})},null,8,["style"])],4)])])):C("",!0),n(ko)&&!x.value?(p(),f("div",$$,[i("div",C$,[i("div",M$,[i("div",S$,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:k[4]||(k[4]=V=>m.value=!1)},[...k[103]||(k[103]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("p",D$,c(n(e)("account_affiliate")),1)]),i("p",A$,c(n(e)("surspended")),1)])]),i("div",z$,[i("div",j$,[zt(n(ir),{class:"h-14 w-14"})]),i("h2",T$,c(n(e)("account_surspended")),1),i("p",P$,c(n(e)("reason"))+" "+c(n(Dt).remark),1),i("button",{onClick:k[5]||(k[5]=V=>S.value=!0),class:"w-[160px] h-[40px] cursor-pointer font-semibold rounded-full mt-2 flex items-center justify-center gap-2 border bg-white",style:b({borderColor:n(w),color:n(w)})},[gt(c(n(e)("contact_shop"))+" ",1),zt(n(yi),{class:"w-4 h-4",style:b({color:n(w)})},null,8,["style"])],4)])])):C("",!0),n(Bo)&&!x.value&&!Jt.value.payment&&!Jt.value.tax&&!Jt.value.social?(p(),f("div",L$,[i("div",R$,[i("div",O$,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:k[6]||(k[6]=V=>m.value=!1)},[...k[104]||(k[104]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("p",B$,c(n(e)("account_affiliate")),1)])]),!Jt.value.payment&&!Jt.value.tax&&!Jt.value.social?(p(),f("div",E$,[i("div",F$,[i("p",I$,c(n(e)("payment_account")),1),i("button",{onClick:qe,class:"text-[14px] xl:text-[16px] underline cursor-pointer underline-offset-4",style:b({color:n(v).color})},c(n(e)("edit")),5)]),i("p",N$,c(n(e)("account_type")),1),i("p",H$,c(n(Dt).payment_detail.account_type==="current"?n(e)("fixed_account"):n(Dt).payment_detail.account_type==="savings"?n(e)("saving_account"):n(Dt).payment_detail.account_type),1),i("p",V$,c(n(e)("payment_information")),1),i("p",W$,c(n(Dt).payment_detail.bank_account_name),1),i("p",U$,c(Ke(n(Dt).payment_detail.bank_name))+" "+c(n(e)("branch"))+" "+c(n(Dt).payment_detail.bank_branch),1),i("p",Y$,c(n(Dt).payment_detail.bank_no),1)])):C("",!0),!Jt.value.payment&&!Jt.value.tax&&!Jt.value.social?(p(),f("div",q$,[i("div",Z$,[i("p",X$,c(n(e)("tax_information")),1),i("button",{onClick:ds,class:"text-[14px] xl:text-[16px] underline cursor-pointer underline-offset-4",style:b({color:n(v).color})},c(n(e)("edit")),5)]),i("p",K$,c(n(e)("taxpayer")),1),i("p",G$,c(n(Dt).tax_invoice_detail.first_name)+" "+c(n(Dt).tax_invoice_detail.last_name),1),i("p",Q$,c(n(Dt).tax_invoice_detail.tax_id_invoice),1),i("p",J$,c(n(e)("id_card_address")),1),i("p",t6,c(n(e)("house_number"))+" "+c(n(Dt).tax_invoice_detail.house_no)+" "+c(n(e)("room_unit"))+" "+c(n(Dt).tax_invoice_detail.room_no)+" "+c(n(e)("floor_level"))+" "+c(n(Dt).tax_invoice_detail.floor)+" "+c(n(e)("building"))+" "+c(n(Dt).tax_invoice_detail.building)+" "+c(n(e)("village"))+" "+c(n(Dt).tax_invoice_detail.village)+" "+c(n(e)("village_no"))+" "+c(n(Dt).tax_invoice_detail.village_no)+" "+c(n(e)("soi_alley"))+" "+c(n(Dt).tax_invoice_detail.lane)+" "+c(n(e)("intersection"))+" "+c(n(Dt).tax_invoice_detail.intersection)+" "+c(n(e)("road_street"))+" "+c(n(Dt).tax_invoice_detail.road)+" "+c(Xo(n(Dt).tax_invoice_detail.sub_district))+" "+c(Zo(n(Dt).tax_invoice_detail.district))+" "+c(go(n(Dt).tax_invoice_detail.province))+" "+c(n(Dt).tax_invoice_detail.postal_code),1)])):C("",!0),!Jt.value.payment&&!Jt.value.tax&&!Jt.value.social?(p(),f("div",e6,[i("div",o6,[i("p",s6,c(n(e)("social_account_information")),1),i("button",{onClick:rt,class:"text-[14px] xl:text-[16px] underline cursor-pointer underline-offset-4",style:b({color:n(v).color})},c(n(e)("edit")),5)]),i("div",n6,[n(Dt).social_detail.facebook?(p(),f("div",i6,[k[105]||(k[105]=i("p",{class:"text-sm font-bold"},"Facebook",-1)),i("p",l6,c(n(Dt).social_detail.facebook),1)])):C("",!0),n(Dt).social_detail.instagram?(p(),f("div",r6,[k[106]||(k[106]=i("p",{class:"text-sm font-bold mt-4"},"Instagram",-1)),i("p",a6,c(n(Dt).social_detail.instagram),1)])):C("",!0),n(Dt).social_detail.tiktok?(p(),f("div",c6,[k[107]||(k[107]=i("p",{class:"text-sm font-bold mt-4"},"TikTok",-1)),i("p",d6,c(n(Dt).social_detail.tiktok),1)])):C("",!0),n(Dt).social_detail.youtube?(p(),f("div",u6,[k[108]||(k[108]=i("p",{class:"text-sm font-bold mt-4"},"YouTube",-1)),i("p",h6,c(n(Dt).social_detail.youtube),1)])):C("",!0),n(Dt).social_detail.line?(p(),f("div",p6,[k[109]||(k[109]=i("p",{class:"text-sm font-bold mt-4"},"Line",-1)),i("p",f6,c(n(Dt).social_detail.line),1)])):C("",!0)])])):C("",!0)])):C("",!0),!n(hs).is_affiliate&&!n(wo)&&!n(ts)&&!n(ko)?(p(),f("div",_6,[i("div",m6,[zt(n(A5),{class:"h-14 w-14",style:b(`color:${n(w)}`)},null,8,["style"])]),i("p",v6,c(n(e)("no_account_affiliate")),1),i("p",g6,[i("span",b6,[gt(c(n(e)("start_affiliate1")),1),k[110]||(k[110]=i("br",null,null,-1)),gt(" "+c(n(e)("start_affiliate2")),1)]),i("span",x6,c(n(e)("start_affiliate")),1)]),i("button",{onClick:k[7]||(k[7]=V=>
27x.value=!0),class:"w-[160px] h-[40px] cursor-pointer font-semibold rounded-full mt-2 flex items-center justify-center gap-2 border bg-white",style:b({borderColor:n(w),color:n(w)})},[gt(c(n(e)("register_aff"))+" ",1),zt(n(yi),{class:"w-4 h-4",style:b({color:n(w)})},null,8,["style"])],4)])):C("",!0)])),x.value?(p(),f("div",y6,[i("div",w6,[i("div",k6,[zt(n(Ts),{class:"w-12 h-6 cursor-pointer",onClick:k[8]||(k[8]=V=>P.value=!0)}),i("p",$6,c(n(e)("register_affiliate")),1)]),i("div",C6,[i("div",{class:"absolute top-4 left-1/6 h-[2px] z-0",style:b({width:"33%",backgroundColor:u.value>=2?n(d):"#D1D5DB"})},null,4),i("div",{class:"absolute top-4 left-1/2 h-[2px] z-0",style:b({width:"33%",backgroundColor:u.value>=3?n(d):"#D1D5DB"})},null,4),i("div",M6,[i("div",{class:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold z-10 text-white",style:b({backgroundColor:u.value>=1?n(d):"#D1D5DB",color:u.value>=1?"white":"#4B5563"})}," 1 ",4),i("span",{class:"text-[12px] md:text-[14px] xl:text-[16px] text-[#343434] mt-2 text-center h-[36px]",style:b({color:u.value>=1?"#343434":"#A4A4A4"})},c(n(e)("payment_account")),5)]),i("div",S6,[i("div",{class:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold z-10",style:b({backgroundColor:u.value>=2?n(d):"white",border:u.value>=2?`2px solid ${n(d)}`:"2px solid #D1D5DB",color:u.value>=2?"white":"#A4A4A4"})}," 2 ",4),i("span",{class:"text-[12px] md:text-[14px] xl:text-[16px] text-[#343434] mt-2 text-center h-[36px]",style:b({color:u.value>=2?"#343434":"#A4A4A4"})},c(n(e)("tax_information")),5)]),i("div",D6,[i("div",{class:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold z-10",style:b({backgroundColor:u.value>=3?n(d):"white",border:u.value>=3?`2px solid ${n(d)}`:"2px solid #D1D5DB",color:u.value>=3?"white":"#A4A4A4"})}," 3 ",4),i("span",{class:"text-[12px] md:text-[14px] xl:text-[16px] text-[#343434] mt-2 text-center h-[36px]",style:b({color:u.value>=3?"#343434":"#A4A4A4"})},c(n(e)("social_account")),5)])])]),u.value===1?(p(),f("div",A6,[i("div",z6,[i("div",null,[i("p",j6,c(n(e)("account_type")),1),i("div",T6,[i("label",P6,[bt(i("input",{"onUpdate:modelValue":k[9]||(k[9]=V=>n(Vt).account_type=V),type:"radio",name:"type",value:"savings",style:b({"accent-color":n(v).colorcheckbox}),class:"w-5 h-5 cursor-pointer"},null,4),[[jo,n(Vt).account_type]]),i("span",L6,c(n(e)("saving_account")),1)]),i("label",R6,[bt(i("input",{"onUpdate:modelValue":k[10]||(k[10]=V=>n(Vt).account_type=V),type:"radio",name:"type",value:"current",style:b({"accent-color":n(v).colorcheckbox}),class:"w-5 h-5 cursor-pointer"},null,4),[[jo,n(Vt).account_type]]),i("span",O6,c(n(e)("fixed_account")),1)])])]),i("div",B6,[i("p",E6,c(n(e)("payment_information")),1),i("div",F6,[i("div",I6,[i("label",N6,[gt(c(n(e)("bank_account_name"))+" ",1),k[111]||(k[111]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[11]||(k[11]=V=>n(Vt).bank_account_name=n(Vt).bank_account_name.replace(/[^ก-๙a-zA-Z\s]/g,"")),"onUpdate:modelValue":k[12]||(k[12]=V=>n(Vt).bank_account_name=V),onBlur:k[13]||(k[13]=()=>{n(Ut).step1.bank_account_name=!0,g(1,"bank_account_name",n(Vt))}),style:b({"--focus-color":n(w)}),type:"text",placeholder:n(e)("enter_bank"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,H6),[[Lt,n(Vt).bank_account_name]]),n(jt).step1.bank_account_name?(p(),f("p",V6,c(`${n(e)(n(jt).step1.bank_account_name)}`),1)):C("",!0)]),i("div",{class:"mt-5 flex flex-col",ref_key:"dropdownRef",ref:Z},[i("label",W6,[gt(c(n(e)("bank"))+" ",1),k[112]||(k[112]=i("span",{class:"text-red-500"},"*",-1))]),i("div",U6,[i("div",{onClick:It,onBlur:k[14]||(k[14]=()=>{n(Ut).step1.bank_name=!0,g(1,"bank_name",n(Vt))}),tabindex:"0",style:b({"--focus-color":n(w)}),class:"w-full border border-gray-300 rounded-full px-3 py-2 pr-8 cursor-pointer text-[16px] flex items-center justify-between"},[i("span",{class:J(["truncate",_e.value?.name?"text-black":"text-[#D1D1D1]"])},c(Nt(_e.value)||n(e)("select_bank")),3),i("div",Y6,[(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] transition-transform duration-200",{"rotate-180":U.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[113]||(k[113]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))])],36),U.value?(p(),f("div",{key:0,class:J(["absolute z-10 w-full bg-white border border-gray-300 rounded-xl shadow-lg overflow-hidden max-h-80 overflow-y-auto",B.value?"bottom-full mb-1":"mt-1"])},[(p(!0),f(at,null,xt(n(yo),V=>(p(),f("div",{key:V.id,onClick:Kt=>bo(V,n(Vt)),class:"px-4 py-2 cursor-pointer hover:bg-gray-100"},c(Nt(V)),9,q6))),128))],2)):C("",!0)]),n(jt).step1.bank_name?(p(),f("p",Z6,c(n(e)(`${n(jt).step1.bank_name}`)),1)):C("",!0)],512),i("div",X6,[i("label",K6,[gt(c(n(e)("bank_branch"))+" ",1),k[114]||(k[114]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{"onUpdate:modelValue":k[15]||(k[15]=V=>n(Vt).bank_branch=V),onBlur:k[16]||(k[16]=()=>{n(Ut).step1.bank_branch=!0,g(1,"bank_branch",n(Vt))}),style:b({"--focus-color":n(w)}),type:"text",placeholder:n(e)("enter_bank_branch"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,G6),[[Lt,n(Vt).bank_branch]]),n(jt).step1.bank_branch?(p(),f("p",Q6,c(`${n(e)(n(jt).step1.bank_branch)}`),1)):C("",!0)]),i("div",J6,[i("label",t8,[gt(c(n(e)("bank_account_number"))+" ",1),k[115]||(k[115]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[17]||(k[17]=V=>n(Vt).bank_no=n(Vt).bank_no.replace(/\D/g,"")),"onUpdate:modelValue":k[18]||(k[18]=V=>n(Vt).bank_no=V),onBlur:k[19]||(k[19]=()=>{n(Ut).step1.bank_no=!0,g(1,"bank_no",n(Vt))}),style:b({"--focus-color":n(w)}),type:"text",placeholder:n(e)("enter_bank_number"),maxlength:_e.value?.digits?.length?Math.max(..._e.value.digits):15,class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,e8),[[Lt,n(Vt).bank_no]]),n(jt).step1.bank_no?(p(),f("p",o8,c(`${n(e)(n(jt).step1.bank_no)}`),1)):C("",!0)])]),i("div",s8,[i("div",n8,[i("label",i8,[gt(c(n(e)("upload_bookbank"))+" ",1),k[116]||(k[116]=i("span",{class:"text-red-500"},"*",-1))]),pt.value?(p(),f("button",{key:0,onClick:Be,type:"button",class:"text-[14px] font-bold underline cursor-pointer underline-offset-5 self-start",style:b({color:n(v).color})},c(n(e)("re_upload")),5)):C("",!0)]),pt.value?(p(),f("div",l8,[i("img",{src:pt.value,class:"max-w-full h-auto rounded shadow object-contain"},null,8,r8)])):C("",!0),pt.value?(p(),f("div",a8)):(p(),f("div",{key:2,onClick:Be,class:J(["relative border-2 border-dashed items-center justify-center rounded-lg p-8 text-center cursor-pointer transition-all duration-200 w-full h-auto aspect-video",D.value||Mt.value?"border-red-500":ot.value?"border-green-400 bg-green-50":"border-gray-300 hover:bg-gray-100"]),onDragover:k[20]||(k[20]=Wo(V=>ot.value=!0,["prevent"])),onDragleave:k[21]||(k[21]=Wo(V=>ot.value=!1,["prevent"])),onDrop:Wo(Ze,["prevent"])},[i("div",c8,[zt(n(Ul),{class:"mx-auto",style:b(`color:${n(w)}`)},null,8,["style"])]),i("div",d8,[i("p",u8,[i("span",h8,c(n(e)("drag")),1),i("span",p8,c(n(e)("drag")),1)]),i("p",f8,[gt(c(n(e)("please_select_fomat")),1),k[117]||(k[117]=i("br",null,null,-1)),gt(" "+c(n(e)("file_size")),1)])]),i("button",{type:"button",class:"inline-flex items-center px-6 py-2 font-bold border text-[12px] curs
27or-pointer rounded-full outline-none",style:b({color:n(v).color})},c(n(e)("upload_img")),5)],34)),D.value?(p(),f("div",_8,[zt(n(kn),{class:"size-5"}),i("p",null,c(n(e)("upload_error1")),1)])):C("",!0),Mt.value?(p(),f("div",m8,[zt(n(kn),{class:"size-5"}),i("p",null,c(n(e)("upload_error2")),1)])):C("",!0),i("input",{ref_key:"fileInput",ref:dt,type:"file",accept:"image/png, image/jpeg",class:"hidden",onChange:ro},null,544)])]),i("div",v8,[i("button",{type:"button",onClick:xo,disabled:n(co)||!X.value,class:J(["w-[160px] h-[40px] flex items-center justify-center font-bold border text-[16px] rounded-full outline-none",n(co)||!X.value?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"text-white cursor-pointer"]),style:b({backgroundColor:n(co)||!X.value?"":n(w),borderColor:n(co)||!X.value?"":n(w)})},c(n(e)("next")),15,g8)])])])):C("",!0),u.value===2?(p(),f("div",b8,[i("div",x8,[i("div",null,[i("p",y8,c(n(e)("tax_information")),1)]),i("div",w8,[i("div",k8,[i("label",$8,[gt(c(n(e)("name_for_tax_invoice"))+" ",1),k[118]||(k[118]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[22]||(k[22]=V=>n(Ot).first_name=n(Ot).first_name.replace(/[^ก-๙a-zA-Z\s().]/g,"")),"onUpdate:modelValue":k[23]||(k[23]=V=>n(Ot).first_name=V),onBlur:k[24]||(k[24]=()=>{n(Ut).step2.first_name=!0,g(2,"first_name",n(Ot))}),style:b({"--focus-color":n(w)}),type:"text",placeholder:n(e)("enter_first_name"),class:"custom-placeholder w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,C8),[[Lt,n(Ot).first_name]]),n(jt).step2.first_name?(p(),f("p",M8,c(`${n(e)(n(jt).step2.first_name)}`),1)):C("",!0)]),i("div",S8,[i("label",D8,[gt(c(n(e)("last_name"))+" ",1),k[119]||(k[119]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[25]||(k[25]=V=>n(Ot).last_name=n(Ot).last_name.replace(/[^ก-๙a-zA-Z\s().]/g,"")),"onUpdate:modelValue":k[26]||(k[26]=V=>n(Ot).last_name=V),onBlur:k[27]||(k[27]=()=>{n(Ut).step2.last_name=!0,g(2,"last_name",n(Ot))}),style:b({"--focus-color":n(w)}),type:"text",placeholder:n(e)("enter_last_name"),class:"custom-placeholder w-full border border-gray-300 rounded-full px-3 py-2 text-[16px] xl:mt-[2px]"},null,44,A8),[[Lt,n(Ot).last_name]]),n(jt).step2.last_name?(p(),f("p",z8,c(`${n(e)(n(jt).step2.last_name)}`),1)):C("",!0)]),i("div",j8,[i("label",T8,[gt(c(n(e)("tax_identification_number"))+" ",1),k[120]||(k[120]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[28]||(k[28]=V=>n(Ot).tax_id_invoice=n(Ot).tax_id_invoice.replace(/\D/g,"").slice(0,13)),"onUpdate:modelValue":k[29]||(k[29]=V=>n(Ot).tax_id_invoice=V),onBlur:k[30]||(k[30]=()=>{n(Ut).step2.tax_id_invoice=!0,g(2,"tax_id_invoice",n(Ot))}),style:b({"--focus-color":n(w)}),type:"text",placeholder:n(e)("enter_taxnumber"),class:"custom-placeholder w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,P8),[[Lt,n(Ot).tax_id_invoice]]),n(jt).step2.tax_id_invoice?(p(),f("p",L8,c(`${n(e)(n(jt).step2.tax_id_invoice)}`),1)):C("",!0)])]),i("div",R8,[i("p",O8,c(n(e)("id_card_address")),1)]),i("div",B8,[i("div",E8,[i("label",F8,[gt(c(n(e)("house_number"))+" ",1),k[121]||(k[121]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[31]||(k[31]=V=>n(Ot).house_no=n(Ot).house_no.replace(/[^0-9/]/g,"")),"onUpdate:modelValue":k[32]||(k[32]=V=>n(Ot).house_no=V),onBlur:k[33]||(k[33]=()=>{n(Ut).step2.house_no=!0,g(2,"house_no",n(Ot))}),style:b({"--focus-color":n(w)}),type:"text",placeholder:n(e)("enter_house_number"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,I8),[[Lt,n(Ot).house_no]]),n(jt).step2.house_no?(p(),f("p",N8,c(`${n(e)(n(jt).step2.house_no)}`),1)):C("",!0)]),i("div",H8,[i("label",V8,c(n(e)("room_unit")),1),bt(i("input",{"onUpdate:modelValue":k[34]||(k[34]=V=>n(Ot).room_no=V),type:"text",style:b({"--focus-color":n(w)}),placeholder:n(e)("enter_room_unit"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,W8),[[Lt,n(Ot).room_no]])]),i("div",U8,[i("label",Y8,c(n(e)("floor_level")),1),bt(i("input",{"onUpdate:modelValue":k[35]||(k[35]=V=>n(Ot).floor=V),type:"text",style:b({"--focus-color":n(w)}),placeholder:n(e)("enter_floor_level"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,q8),[[Lt,n(Ot).floor]])]),i("div",Z8,[i("label",X8,c(n(e)("building")),1),bt(i("input",{"onUpdate:modelValue":k[36]||(k[36]=V=>n(Ot).building=V),type:"text",style:b({"--focus-color":n(w)}),placeholder:n(e)("enter_building"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,K8),[[Lt,n(Ot).building]])]),i("div",G8,[i("label",Q8,c(n(e)("village")),1),bt(i("input",{"onUpdate:modelValue":k[37]||(k[37]=V=>n(Ot).village=V),type:"text",style:b({"--focus-color":n(w)}),placeholder:n(e)("enter_village"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,J8),[[Lt,n(Ot).village]])]),i("div",t7,[i("label",e7,c(n(e)("village_no")),1),bt(i("input",{"onUpdate:modelValue":k[38]||(k[38]=V=>n(Ot).village_no=V),type:"text",style:b({"--focus-color":n(w)}),placeholder:n(e)("enter_village_no"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"}
27,null,12,o7),[[Lt,n(Ot).village_no]])]),i("div",s7,[i("label",n7,c(n(e)("soi_alley")),1),bt(i("input",{"onUpdate:modelValue":k[39]||(k[39]=V=>n(Ot).lane=V),type:"text",style:b({"--focus-color":n(w)}),placeholder:n(e)("enter_soi_alley"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,i7),[[Lt,n(Ot).lane]])]),i("div",l7,[i("label",r7,c(n(e)("intersection")),1),bt(i("input",{"onUpdate:modelValue":k[40]||(k[40]=V=>n(Ot).intersection=V),type:"text",style:b({"--focus-color":n(w)}),placeholder:n(e)("enter_intersection"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,a7),[[Lt,n(Ot).intersection]])]),i("div",c7,[i("label",d7,c(n(e)("road_street")),1),bt(i("input",{"onUpdate:modelValue":k[41]||(k[41]=V=>n(Ot).road=V),type:"text",style:b({"--focus-color":n(w)}),placeholder:n(e)("enter_road_street"),class:"custom-placeholder border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,u7),[[Lt,n(Ot).road]])])]),i("div",h7,[i("div",{class:"mt-5 flex flex-col",ref_key:"provinceDropdownRef",ref:N},[i("label",p7,[gt(c(n(e)("province"))+" ",1),k[122]||(k[122]=i("span",{class:"text-red-500"},"*",-1))]),i("div",f7,[i("div",{tabindex:"0",style:b({"--focus-color":n(w)}),onBlur:k[42]||(k[42]=V=>K("province")),onClick:he,class:"w-full border border-gray-300 rounded-full pl-4 pr-10 h-[42px] flex items-center justify-between cursor-pointer"},[i("span",{class:J(["text-[16px]",Y.value?"text-black":"text-[#D1D1D1]"])},c(Nt(Y.value)||n(e)("enter_province")),3),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] absolute right-2 transition-transform duration-200",{"rotate-180":q.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[123]||(k[123]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],36),q.value?(p(),f("div",{key:0,class:J(["absolute z-10 w-full bg-white border border-gray-300 rounded-xl shadow-lg max-h-50 overflow-y-auto",ut.value?"bottom-full mb-1":"mt-1"])},[(p(!0),f(at,null,xt(n(F),V=>(p(),f("div",{key:V.id,class:"px-4 py-2 cursor-pointer hover:bg-gray-100",onClick:Kt=>Zt(V)},c(Nt(V)),9,_7))),128))],2)):C("",!0)]),n(be).province?(p(),f("p",m7,c(n(e)(`${n(be).province}`)),1)):C("",!0)],512),i("div",{class:"mt-5 flex flex-col",ref_key:"amphureDropdownRef",ref:$t},[i("label",v7,[gt(c(n(e)("district_city"))+" ",1),k[124]||(k[124]=i("span",{class:"text-red-500"},"*",-1))]),i("div",g7,[i("div",{tabindex:"0",style:b({"--focus-color":n(w)}),onClick:Q,onBlur:k[43]||(k[43]=V=>K("district")),class:J([[Y.value?"bg-white border-[#E1E1E1]":" bg-[#E7E7E7] border-[#E7E7E7] cursor-not-allowed"],"w-full border rounded-full pl-4 pr-10 h-[42px] flex items-center justify-between"])},[i("span",{class:J(["text-[16px]",et.value?"text-black":"text-[#A4A4A4]"])},c(Nt(et.value)||n(e)("enter_district_city")),3),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] absolute right-2 transition-transform duration-200",{"rotate-180":wt.value&&Y.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[125]||(k[125]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],38),wt.value&&Y.value?(p(),f("div",{key:0,class:J(["absolute z-10 w-full bg-white border border-gray-300 rounded-xl shadow-lg max-h-50 overflow-y-auto",St.value?"bottom-full mb-1":"mt-1"])},[(p(!0),f(at,null,xt(n(R),V=>(p(),f("div",{key:V.id,class:"px-4 py-2 cursor-pointer hover:bg-gray-100",onClick:Kt=>Oe(V)},c(Nt(V)),9,b7))),128))],2)):C("",!0)]),n(be).district?(p(),f("p",x7,c(n(e)(`${n(be).district}`)),1)):C("",!0)],512),i("div",{class:"mt-5 flex flex-col",ref_key:"tambonDropdownRef",ref:T},[i("label",y7,[gt(c(n(e)("sub_district"))+" ",1),k[126]||(k[126]=i("span",{class:"text-red-500"},"*",-1))]),i("div",w7,[i("div",{tabindex:"0",style:b({"--focus-color":n(w)}),onBlur:k[44]||(k[44]=V=>K("sub_district")),onClick:E,class:J([[et.value?"bg-white border-[#
27E1E1E1]":" bg-[#E7E7E7] border-[#E7E7E7] cursor-not-allowed"],"w-full border rounded-full pl-4 pr-10 h-[42px] flex items-center justify-between"])},[i("span",{class:J(["text-[16px]",ht.value?"text-black":"text-[#A4A4A4]"])},c(Nt(ht.value)||n(e)("enter_sub_district")),3),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] absolute right-2 transition-transform duration-200",{"rotate-180":Tt.value&&et.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[127]||(k[127]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],38),Tt.value&&et.value?(p(),f("div",{key:0,class:J(["absolute z-10 w-full bg-white border border-gray-300 rounded-xl shadow-lg max-h-50 overflow-y-auto",vt.value?"bottom-full mb-1":"mt-1"])},[(p(!0),f(at,null,xt(n(Te),V=>(p(),f("div",{key:V.id,class:"px-4 py-2 cursor-pointer hover:bg-gray-100",onClick:Kt=>ve(V)},c(Nt(V)),9,k7))),128))],2)):C("",!0)]),n(be).sub_district?(p(),f("p",$7,c(n(e)(`${n(be).sub_district}`)),1)):C("",!0)],512),i("div",{class:"mt-5 flex flex-col",ref_key:"zipcodeDropdownRef",ref:Pt},[i("label",C7,[gt(c(n(e)("postal_code"))+" ",1),k[128]||(k[128]=i("span",{class:"text-red-500"},"*",-1))]),i("div",M7,[i("div",{tabindex:"0",onBlur:k[45]||(k[45]=V=>K("zip_code")),style:b({"--focus-color":n(w)}),onClick:mt,class:J([[ht.value?"bg-white border-[#E1E1E1]":" bg-[#E7E7E7] border-[#E7E7E7] cursor-not-allowed"],"w-full border rounded-full pl-4 pr-10 h-[42px] flex items-center justify-between"])},[i("span",{class:J(["text-[16px]",ct.value?"text-black":"text-[#A4A4A4]"])},c(ct.value?.zip_code||ct.value?.zipcode||n(e)("enter_postal_code")),3),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] absolute right-2 transition-transform duration-200",{"rotate-180":yt.value&&ht.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[129]||(k[129]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],38),yt.value&&ht.value?(p(),f("div",{key:0,class:J(["absolute z-10 w-full bg-white border border-gray-300 rounded-xl shadow-lg max-h-50 overflow-y-auto",Ft.value?"bottom-full mb-1":"mt-1"])},[(p(!0),f(at,null,xt(n(qt),V=>(p(),f("div",{key:V.zip_code,class:"px-4 py-2 cursor-pointer hover:bg-gray-100",onClick:Kt=>qo(V)},c(V.zip_code||V.zipcode),9,S7))),128))],2)):C("",!0)]),n(be).zip_code?(p(),f("p",D7,c(n(e)(`${n(be).zip_code}`)),1)):C("",!0)],512)]),k[130]||(k[130]=i("hr",{class:"border-t border-gray-300 my-4 mt-5"},null,-1)),i("div",A7,[i("button",{type:"button",onClick:Jo,class:"w-[160px] h-[40px] flex items-center justify-center font-bold border text-[16px] cursor-pointer rounded-full outline-none bg-white",style:b({borderColor:n(w),color:n(w)})},c(n(e)("back_aff")),5),i("button",{type:"button",onClick:Ss,disabled:n(co),class:J(["w-[160px] h-[40px] flex items-center justify-center font-bold border text-[16px] rounded-full outline-none",n(co)?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"text-white cursor-pointer"]),style:b(n(co)?{}:{backgroundColor:n(w),borderColor:n(w)})},c(n(e)("next")),15,z7)])])])):C("",!0),u.value===3?(p(),f("div",j7,[i("div",T7,[i("div",null,[i("p",P7,c(n(e)("social_account_information")),1),i("p",L7,c(n(e)("please_provide")),1)]),i("div",R7,[i("div",O7,[k[131]||(k[131]=i("label",{class:"mb-2 font-normal text-[16px]"}," Facebook ",-1)),bt(i("input",{"onUpdate:modelValue":k[46]||(k[46]=V=>n(oe).facebook=V),type:"text",placeholder:n(e)("facebook_link"),style:b({"--focus-color":n(w)}),class:"custom-placeholder w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,B7),[[Lt,n(oe).facebook]])]),i("div",E7,[k[132]||(k[132]=i("label",{class:"mb-2 font-normal text-[16px]"}," TikTok ",-1)),bt(i("input",{"onUpdate:modelValue":k[47]||(k[47]=V=>n(oe).tiktok=V),type:"text",placeholder:n(e)("tiktok_link"),style:b({"--focus-color":n(w)}),class:"custom-placeholder w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,F7),[[Lt,n(oe).tiktok]])]),i("div",I7,[k[133]||(k[133]=i("label",{class:"mb-2 font-normal text-[16px]"}," Youtube ",-1)),bt(i("input",{"onUpdate:modelValue":k[48]||(k[48]=V=>n(oe).youtube=V),type:"text",placeholder:n(e)("youtube_link"),style:b({"--focus-color":n(w)}),class:"custom-placeholder w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,N7),[[Lt,n(oe).youtube]])]),i("div",H7,[k[134]||(k[134]=i("label",{class:"mb-2 font-normal text-[16px]"}," Instagram ",-1)),bt(i("input",{"onUpdate:modelValue":k[49]||(k[49]=V=>n(oe).instagram=V),type:"text",placeholder:n(e)("instragram_link"),style:b({"--focus-color":n(w)}),class:"custom-placeholder w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,V7),[[Lt,n(oe).instagram]])]),i("div",W7,[k[135]||(k[135]=i("label",{class:"mb-2 font-normal text-[16px]"}," Line ",-1)),bt(i("input",{"onUpdate:modelValue":k[50]||(k[50]=V=>n(oe).line=V),type:"text",placeholder:n(e)("line_link"),style:b({"--focus-color":n(w)}),class:"custom-placeholder w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,U7),[[Lt,n(oe).line]])])]),i("div",Y7,[i("div",q7,[i("label",Z7,[bt(i("input",{type:"checkbox",id:"consent",name:"consent","onUpdate:modelValue":k[51]||(k[51]=V=>Ne.value=V),class:"peer w-full h-full appearance-none rounded border border-slate-300 transition-all shadow hover:shadow-md cursor-pointer checked:bg-[var(--checkbox-color)] disabled:cursor-not-allowed disabled:bg-gray-200 disabled:border-gray-300",style:b({"--checkbox-color":n(v).color})},null,4),[[Rs,Ne.value]]),k[136]||(k[136]=i("span",{class:"absolute text-white opacity-0 peer-checked:opacity-100 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none"},[i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3.5 w-3.5",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor","stroke-width":"1"},[i("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1))])]),i("label",X7,[gt(c(n(e)("accept_term"))+" ",1),i("a",{href:"/consentaffiliate/affiliate-requirements.pdf",target:"_blank",onMouseover:k[52]||(k[52]=V=>it.consent_hover1=!0),onMouseleave:k[53]||(k[53]=V=>it.consent_hover1=!1),class:"cursor-pointer font-medium underline underline-offset-4 decoration-2",style:b({color:it.consent_hover1?it.hover_color:n(w)})}," Affiliate.Requirements ",36)])]),k[137]||(k[137]=i("hr",{class:"border-t border-gray-300 my-4"},null,-1)),i("div",K7,[i("button",{type:"button",onClick:Jo,class:"w-[160px] h-[40p
27x] flex items-center justify-center font-bold border text-[16px] cursor-pointer rounded-full outline-none bg-white",style:b({borderColor:n(w),color:n(w)})},c(n(e)("back_aff")),5),i("button",{type:"button",onClick:Us,disabled:n(us),class:J(["w-[160px] h-[40px] flex items-center justify-center font-bold border text-[16px] cursor-pointer rounded-full outline-none",n(us)?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"text-white"]),style:b(n(us)?{}:{backgroundColor:n(w),borderColor:n(w)})},c(n(e)("save")),15,G7)])])])):C("",!0)])):C("",!0),Jt.value.payment?(p(),f("div",Q7,[i("div",null,[i("div",J7,[zt(n(Ts),{class:"w-12 h-6 cursor-pointer",onClick:Ee}),i("p",t9,c(n(e)("edit_payment_account")),1)]),i("p",e9,c(n(e)("account_type")),1),i("div",o9,[i("label",s9,[bt(i("input",{"onUpdate:modelValue":k[54]||(k[54]=V=>n(Xt).account_type=V),type:"radio",name:"type",value:"savings",class:"radio appearance-none w-5 h-5 rounded-full border-1 border-[var(--radio-color)] checked:border-[var(--radio-color)] checked:bg-[var(--radio-color)] bg-transparent bg-clip-content p-[3px] cursor-pointer transition-all duration-200 outline-none",style:b({"--radio-color":n(v).colorcheckbox})},null,4),[[jo,n(Xt).account_type]]),i("span",n9,c(n(e)("saving_account")),1)]),i("label",i9,[bt(i("input",{"onUpdate:modelValue":k[55]||(k[55]=V=>n(Xt).account_type=V),type:"radio",name:"type",value:"current",class:"radio appearance-none w-5 h-5 rounded-full border-1 border-[var(--radio-color)] checked:border-[var(--radio-color)] checked:bg-[var(--radio-color)] bg-transparent bg-clip-content p-[3px] cursor-pointer transition-all duration-200 outline-none",style:b({"--radio-color":n(v).colorcheckbox})},null,4),[[jo,n(Xt).account_type]]),i("span",l9,c(n(e)("fixed_account")),1)])])]),i("div",r9,[i("p",a9,c(n(e)("payment_information")),1),i("div",c9,[i("div",d9,[i("label",u9,[gt(c(n(e)("bank_account_name"))+" ",1),k[138]||(k[138]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[56]||(k[56]=V=>n(Vt).bank_account_name=n(Vt).bank_account_name.replace(/[^ก-๙a-zA-Z\s]/g,"")),"onUpdate:modelValue":k[57]||(k[57]=V=>n(Xt).bank_account_name=V),onBlur:k[58]||(k[58]=()=>{n(Ut).step1.bank_account_name=!0,g(1,"bank_account_name",n(Xt))}),type:"text",placeholder:n(e)("enter_bank"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,h9),[[Lt,n(Xt).bank_account_name]]),n(jt).step1.bank_account_name?(p(),f("p",p9,c(`${n(e)(n(jt).step1.bank_account_name)}`),1)):C("",!0)]),i("div",{class:"mt-5 flex flex-col",ref_key:"dropdownRef",ref:Z},[i("label",f9,[gt(c(n(e)("bank"))+" ",1),k[139]||(k[139]=i("span",{class:"text-red-500"},"*",-1))]),i("div",_9,[i("div",{tabindex:"0",style:b({"--focus-color":n(w)}),onClick:It,class:"w-full border border-gray-300 rounded-full px-3 py-2 pr-8 cursor-pointer text-[16px] flex items-center justify-between"},[i("span",m9,c(Nt(_e.value)||Ke(n(Dt)?.payment_detail?.bank_name)||n(e)("select_bank")),1),i("div",v9,[(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] transition-transform duration-200",{"rotate-180":U.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[140]||(k[140]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))])],4),U.value?(p(),f("div",{key:0,class:J(["absolute z-10 w-full bg-white border border-gray-300 rounded-xl shadow-lg overflow-hidden max-h-80 overflow-y-auto",B.value?"bottom-full mb-1":"mt-1"])},[(p(!0),f(at,null,xt(n(yo),V=>(p(),f("div",{key:V.code,onClick:Kt=>bo(V),class:"px-4 py-2 cursor-pointer hover:bg-gray-100"},c(Nt(V)),9,g9))),128))],2)):C("",!0)])],512),i("div",b9,[i("label",x9,[gt(c(n(e)("bank_branch"))+" ",1),k[141]||(k[141]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{"onUpdate:modelValue":k[59]||(k[59]=V=>n(Xt).bank_branch=V),onBlur:k[60]||(k[60]=()=>{n(Ut).step1.bank_branch=!0,g(1,"bank_branch",n(Xt))}),type:"text",placeholder:n(e)("enter_bank_branch"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,y9),[[Lt,n(Xt).bank_branch]]),n(jt).step1.bank_branch?(p(),f("p",w9,c(`${n(e)(n(jt).step1.bank_branch)}`),1)):C("",!0)]),i("div",k9,[i("label",$9,[gt(c(n(e)("bank_account_number"))+" ",1),k[142]||(k[142]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[61]||(k[61]=V=>n(Xt).bank_no=n(Xt).bank_no.replace(/\D/g,"")),"onUpdate:modelValue":k[62]||(k[62]=V=>n(Xt).bank_no=V),onBlur:k[63]||(k[63]=()=>{n(Ut).step1.bank_no=!0,g(1,"bank_no",n(Xt))}),type:"text",maxlength:_e.value?.digits?.length?Math.max(..._e.value.digits):15,placeholder:n(e)("enter_bank_number"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,C9),[[Lt,n(Xt).bank_no]]),n(jt).step1.bank_no?(p(),f("p",M9,c(`${n(e)(n(jt).step1.bank_no)}`),1)):C("",!0)])]),i("div",S9,[i("div",D9,[i("label",A9,[gt(c(n(e)("upload_bookbank"))+" ",1),k[143]||(k[143]=i("span",{class:"text-red-500"},"*",-1))]),pt.value?(p(),f("button",{key:0,onClick:Be,type:"button",class:"text-[14px] font-bold underline cursor-pointer underline-offset-5 self-start",style:b({color:n(v).color})},c(n(e)("re_upload")),5)):C("",!0)]),pt.value?(p(),f("div",z9,[i("img",{src:pt.value,class:"max-w-full h-auto rounded shadow object-contain"},null,8,j9)])):(p(),f("div",{key:1,onClick:Be,class:J(["relative border-2 border-dashed items-center justify-center rounded-lg p-8 text-center cursor-pointer transition-all duration-200 w-full max-w-[704px] h-auto aspect-video",D.value||Mt.value?"border-red-500":ot.value?"border-green-400 bg-green-50":"border-gray-300 hover:bg-gray-100"]),onDragover:k[64]||(k[64]=Wo(V=>ot.value=!0,["prevent"])),onDragleave:k[65]||(k[65]=Wo(V=>ot.value=!1,["prevent"])),onDrop:Wo(Ze,["prevent"])},[i("div",T9,[zt(n(Ul),{class:"mx-auto"})]),k[144]||(k[144]=i("div",{class:"mb-4"},[i("p",{class:"text-base font-medium text-gray-700 mb-2"}," อัปโหลดรูปลงในบริเวณนี้ "),i("p",{class:"text-[14px] text-gray-500 mb-4"},[gt(" โปรดเลือกไฟล์ PNG หรือ JPG"),i("br"),gt(" และมีขนาดไม่เกิน 5MB ")])],-1)),i("button",{type:"button",class:"inline-flex items-center px-6 py-2 font-bold border text-[12px] curs
27or-pointer rounded-full outline-none",style:b({color:n(v).color})}," อัปโหลดรูป ",4)],34)),D.value?(p(),f("div",P9,[zt(n(kn),{class:"size-5"}),k[145]||(k[145]=i("p",null,"อัปโหลดรูปภาพไม่สำเร็จ กรุณาเลือกรูปภาพใหม่อีกครั้ง",-1))])):C("",!0),Mt.value?(p(),f("div",L9,[zt(n(kn),{class:"size-5"}),k[146]||(k[146]=i("p",null,"ขนาดไฟล์เกิน 5MB กรุณาเลือกรูปภาพใหม่อีกครั้ง",-1))])):C("",!0),i("input",{ref_key:"fileInput",ref:dt,type:"file",accept:"image/png, image/jpeg",class:"hidden",onChange:ro},null,544)])]),i("div",R9,[i("button",{type:"button",onClick:Ee,class:"w-[160px] h-[40px] flex items-center justify-center font-bold text-[16px] cursor-pointer rounded-full outline-none border",style:b({backgroundColor:"white",borderColor:n(w),color:n(w)})},c(n(e)("discard_changes")),5),i("button",{type:"button",disabled:n(Go),onClick:Cs,class:"w-[160px] h-[40px] flex items-center justify-center font-bold border text-[16px] rounded-full outline-none",style:b({backgroundColor:n(Go)?"#D1D5DB":n(w),borderColor:n(Go)?"#D1D5DB":n(w),color:"white",cursor:n(Go)?"not-allowed":"pointer"})}
27,c(n(e)("save")),13,O9)])])):C("",!0),Jt.value.tax?(p(),f("div",B9,[i("div",null,[i("div",E9,[zt(n(Ts),{class:"w-12 h-6 cursor-pointer",onClick:Ee}),i("p",F9,c(n(e)("edit_tax_information")),1)])]),i("div",I9,c(n(e)("tax_information")),1),i("div",N9,[i("div",H9,[i("label",V9,[gt(c(n(e)("name_for_tax_invoice"))+" ",1),k[147]||(k[147]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[66]||(k[66]=V=>n(Et).first_name=n(Et).first_name.replace(/[^ก-๙a-zA-Z\s().]/g,"")),"onUpdate:modelValue":k[67]||(k[67]=V=>n(Et).first_name=V),onBlur:k[68]||(k[68]=()=>{n(Ut).step2.first_name=!0,g(2,"first_name",n(Et))}),type:"text",placeholder:n(e)("enter_first_name"),style:b({"--focus-color":n(w)}),class:"w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,W9),[[Lt,n(Et).first_name]]),n(jt).step2.first_name?(p(),f("p",U9,c(`${n(e)(n(jt).step2.first_name)}`),1)):C("",!0)]),i("div",Y9,[i("label",q9,[gt(c(n(e)("last_name"))+" ",1),k[148]||(k[148]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[69]||(k[69]=V=>n(Et).last_name=n(Et).last_name.replace(/[^ก-๙a-zA-Z\s().]/g,"")),"onUpdate:modelValue":k[70]||(k[70]=V=>n(Et).last_name=V),onBlur:k[71]||(k[71]=()=>{n(Ut).step2.last_name=!0,g(2,"last_name",n(Et))}),type:"text",placeholder:n(e)("enter_last_name"),style:b({"--focus-color":n(w)}),class:"w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,Z9),[[Lt,n(Et).last_name]]),n(jt).step2.last_name?(p(),f("p",X9,c(`${n(e)(n(jt).step2.last_name)}`),1)):C("",!0)]),i("div",K9,[i("label",G9,[gt(c(n(e)("tax_identification_number"))+" ",1),k[149]||(k[149]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[72]||(k[72]=V=>n(Et).tax_id_invoice=n(Et).tax_id_invoice.replace(/\D/g,"").slice(0,13)),"onUpdate:modelValue":k[73]||(k[73]=V=>n(Et).tax_id_invoice=V),onBlur:k[74]||(k[74]=()=>{n(Ut).step2.tax_id_invoice=!0,g(2,"tax_id_invoice",n(Et))}),type:"text",placeholder:n(e)("enter_taxnumber"),style:b({"--focus-color":n(w)}),class:"w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,Q9),[[Lt,n(Et).tax_id_invoice]]),n(jt).step2.tax_id_invoice?(p(),f("p",J9,c(`${n(e)(n(jt).step2.tax_id_invoice)}`),1)):C("",!0)])]),i("div",tC,[i("p",eC,c(n(e)("id_card_address")),1)]),i("div",oC,[i("div",sC,[i("label",nC,[gt(c(n(e)("house_number"))+" ",1),k[150]||(k[150]=i("span",{class:"text-red-500"},"*",-1))]),bt(i("input",{onInput:k[75]||(k[75]=V=>n(Et).house_no=n(Et).house_no.replace(/[^0-9/]/g,"")),"onUpdate:modelValue":k[76]||(k[76]=V=>n(Et).house_no=V),onBlur:k[77]||(k[77]=()=>{n(Ut).step2.house_no=!0,g(2,"house_no",n(Et))}),type:"text",placeholder:n(e)("enter_house_number"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,44,iC),[[Lt,n(Et).house_no]]),n(jt).step2.house_no?(p(),f("p",lC,c(`${n(e)(n(jt).step2.house_no)}`),1)):C("",!0)]),i("div",rC,[i("label",aC,c(n(e)("room_unit")),1),bt(i("input",{"onUpdate:modelValue":k[78]||(k[78]=V=>n(Et).room_no=V),type:"text",placeholder:n(e)("enter_room_unit"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,cC),[[Lt,n(Et).room_no]])]),i("div",dC,[i("label",uC,c(n(e)("floor_level")),1),bt(i("input",{"onUpdate:modelValue":k[79]||(k[79]=V=>n(Et).floor=V),type:"text",placeholder:n(e)("enter_floor_level"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,hC),[[Lt,n(Et).floor]])]),i("div",pC,[i("label",fC,c(n(e)("building")),1),bt(i("input",{"onUpdate:modelValue":k[80]||(k[80]=V=>n(Et).building=V),type:"text",placeholder:n(e)("enter_building"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,_C),[[Lt,n(Et).building]])]),i("div",mC,[i("label",vC,c(n(e)("village")),1),bt(i("input",{"onUpdate:modelValue":k[81]||(k[81]=V=>n(Et).village=V),type:"text",placeholder:n(e)("enter_village"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,gC),[[Lt,n(Et).village]])]),i("div",bC,[i("label",xC,c(n(e)("village_no")),1),bt(i("input",{"onUpdate:modelValue":k[82]||(k[82]=V=>n(Et).village_no=V),type:"text",placeholder:n(e)("enter_village_no"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,yC),[[Lt,n(Et).village_no]])]),i("div",wC,[i("label",kC,c(n(e)("soi_alley")),1),bt(i("input",{"onUpdate:modelValue":k[83]||(k[83]=V=>n(Et).lane=V),type:"text",placeholder:n(e)("enter_soi_alley"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,$C),[[Lt,n(Et).lane]])]),i("div",CC,[i("label",MC,c(n(e)("intersection")),1),bt(i("input",{"onUpdate:modelValue":k[84]||(k[84]=V=>n(Et).intersection=V),type:"text",placeholder:n(e)("enter_intersection"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,SC),[[Lt,n(Et).intersection]])]),i("div",DC,[i("label",AC,c(n(e)("road_street")),1),bt(i("input",{"onUpdate:modelValue":k[85]||(k[85]=V=>n(Et).road=V),type:"text",placeholder:n(e)("enter_road_street"),style:b({"--focus-color":n(w)}),class:"border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,zC),[[Lt,n(Et).road]])])]),i("div",jC,[i("div",{class:"mt-5 flex flex-col",ref_key:"provinceDropdownRef",ref:N},[i("label",TC,[gt(c(n(e)("province"))+" ",1),k[151]||(k[151]=i("span",{class:"text-red-500"},"*",-1))]),i("div",PC,[i("div",{tabindex:"0",style:b({"--focus-color":n(w)}),onClick:he,class:"w-full border border-gray-300 rounded-full pl-4 pr-10 h-[42px] flex items-center justify-between cursor-pointer"},[i("span",LC,c(Nt(Y.value)||n(e)("enter_province")),1),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] absolute right-2 transition-transform duration-200",{"rotate-180":q.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[152]||(k[152]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],4),q.value?(p(),f("div",{key:0,class:J(["absolute z-10 w-full bg-white border border-gray-300 rounded-xl shadow-lg max-h-50 overflow-y-auto",ut.value?"bottom-full mb-1":"mt-1"])},[(p(!0),f(at,null,xt(n(F),V=>(p(),f("div",{key:V.id,class:"px-4 py-2 cursor-pointer hover:bg-gray-100",onClick:Kt=>Zt(V)},c(Nt(V)),9,RC))),128))],2)):C("",!0)]),n(jt).step2.province?(p(),f("p",OC,c(`${n(e)(n(jt).step2.province)}`),1)):C("",!0)],512),i("div",{class:"mt-5 flex flex-col",ref_key:"amphureDropdownRef",ref:$t},[i("label",BC,[gt(c(n(e)("district_city"))+" ",1),k[153]||(k[153]=i("span",{class:"text-red-500"},"*",-1))]),i("div",EC,[i("div",{tabindex:"0",style:b({"--focus-color":n(w)}),onClick:Q,class:J([{"cursor-not-allowed opacity-50":!Y.value},"w-full border border-gray-300 rounded-full pl-4 pr-10 h-[42px] flex items-center justify-between"])},[i("span",FC,c(Nt(et.value)||n(e)("enter_district_city")),1),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] absolute right-2 transition-transform duration-200",{"rotate-180":wt.value&&Y.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[154]||(k[154]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],6),wt.value&&Y.value?(p(),f("div",{key:0,class:J(["absolute z-10 w-full bg-white border border-gray-300 rounded-xl shadow-lg max-h-50 overflow-y-auto",St.value?"bottom-full mb-1":"mt-1"])},[(p(!0),f(at,null,xt(n(R),V=>(p(),f("div",{key:V.id,class:"px-4 py-2 cursor-pointer hover:bg-gray-100",onClick:Kt=>Oe(V)},c(Nt(V)),9,IC))),128))],2)):C("",!0)]),n(jt).step2.district?(p(),f("p",NC,c(`${n(e)(n(jt).step2.district)}`),1)):C("",!0)],512),i("div",{class:"mt-5 flex flex-col",ref_key:"tambonDropdownRef",ref:T},[i("label",HC,[gt(c(n(e)("sub_district"))+" ",1),k[155]||(k[155]=i("span",{class:"text-red-500"},"*",-1))]),i("div",VC,[i("div",{tabindex:"0",style:b({"--focus-color":n(w)}),onClick:E,class:J([{"cursor-not-allowed opacity-50":!et.value},"w-full border border-gray-300 rounded-full pl-4 pr-10 h-[42px] flex items-center justify-between"])},[i("span",WC,c(Nt(ht.value)||n(e)("enter_sub_district")),1),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] absolute right-2 transition-transform duration-200",{"rotate-180":Tt.value&&et.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[156]||(k[156]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],6),(p(),ae(ja,{to:"body"},[Tt.value&&et.value?(p(),f("div",{key:0,style:b({position:"absolute",top:`${Rt.value.top}px`,left:`${Rt.value.left}px`,width:`${Rt.value.width}px`}),class:"z-50 bg-white border border-gray-300 rounded-xl shadow-lg max-h-50 overflow-y-auto"},[(p(!0),f(at,null,xt(n(Te),V=>(p(),f("div",{key:V.id,class:"px-4 py-2 cursor-pointer hover:bg-gray-100",onClick:Kt=>ve(V)},c(Nt(V)),9,UC))),128))],4)):C("",!0)]))]),n(jt).step2.sub_district?(p(),f("p",YC,c(`${n(e)(n(jt).step2.sub_district)}`),1)):C("",!0)],512),i("div",{class:"mt-5 flex flex-col",ref_key:"zipcodeDropdownRef",ref:Pt},[i("label",qC,[gt(c(n(e)("postal_code"))+" ",1),k[157]||(k[157]=i("span",{class:"text-red-500"},"*",-1))]),i("div",ZC,[i("div",{tabindex:"0",style:b({"--focus-color":n(w)}),onClick:mt,class:J([{"cursor-not-allowed opacity-50":!ht.value},"w-full border border-gray-300 rounded-full pl-4 pr-10 h-[42px] flex items-center justify-between"])},[i("span",XC,c(ct.value?.zip_code||ct.value?.zipcode||n(e)("enter_postal_code")),1),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] absolute right-2 transition-transform duration-200",{"rotate-180":yt.value&&ht.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...k[158]||(k[158]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],6),yt.value&&ht.value?(p(),f("div",{key:0,class:J(["absolute z-10 w-full bg-white border border-gray-300 rounded-xl shadow-lg max-h-50 overflow-y-auto",Ft.value?"bottom-full mb-1":"mt-1"])},[(p(!0),f(at,null,xt(n(qt),V=>(p(),f("div",{key:V.zip_code,class:"px-4 py-2 cursor-pointer hover:bg-gray-100",onClick:Kt=>qo(V)},c(V.zip_code||V.zipcode),9,KC))),128))],2)):C("",!0)]),n(jt).step2.postal_code?(p(),f("p",GC,c(`${n(e)(n(jt).step2.postal_code)}`),1)):C("",!0)],512)]),k[159]||(k[159]=i("hr",{class:"border-t border-gray-300 my-4 mt-5"},null,-1)),i("div",QC,[i("button",{type:"button",onClick:Ee,class:"w-[160px] h-[40p
27x] flex items-center justify-center font-bold border text-[16px] cursor-pointer rounded-full outline-none",style:b({backgroundColor:"white",borderColor:n(w),color:n(w)})},c(n(e)("discard_changes")),5),i("button",{type:"button",onClick:Ms,disabled:n(Qe),style:b({backgroundColor:n(Qe)?"#D1D5DB":n(w),borderColor:n(Qe)?"#D1D5DB":n(w),color:n(Qe)?"#6B7280":"white",cursor:n(Qe)?"not-allowed":"pointer"}),class:J(["bg-green-500 text-white border-green-500 w-[160px] h-[40px] flex items-center justify-center font-bold border text-[16px] cursor-pointer rounded-full outline-none"])},c(n(e)("save")),13,JC)])])):C("",!0),Jt.value.social?(p(),f("div",tM,[i("div",null,[i("div",eM,[zt(n(Ts),{class:"w-12 h-6 cursor-pointer",onClick:Ee}),i("p",oM,c(n(e)("edit_social")),1)]),i("p",sM,c(n(e)("please_provide")),1)]),i("div",nM,[i("div",iM,[k[160]||(k[160]=i("label",{class:"mb-2 font-normal text-[16px]"}," Facebook ",-1)),bt(i("input",{"onUpdate:modelValue":k[86]||(k[86]=V=>n(ce).facebook=V),type:"text",placeholder:n(e)("facebook_link"),style:b({"--focus-color":n(w)}),class:"w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,lM),[[Lt,n(ce).facebook]])]),i("div",rM,[k[161]||(k[161]=i("label",{class:"mb-2 font-normal text-[16px]"}," TikTok ",-1)),bt(i("input",{"onUpdate:modelValue":k[87]||(k[87]=V=>n(ce).tiktok=V),type:"text",placeholder:n(e)("tiktok_link"),style:b({"--focus-color":n(w)}),class:"w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,aM),[[Lt,n(ce).tiktok]])]),i("div",cM,[k[162]||(k[162]=i("label",{class:"mb-2 font-normal text-[16px]"}," Youtube ",-1)),bt(i("input",{"onUpdate:modelValue":k[88]||(k[88]=V=>n(ce).youtube=V),type:"text",placeholder:n(e)("youtube_link"),style:b({"--focus-color":n(w)}),class:"w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,dM),[[Lt,n(ce).youtube]])]),i("div",uM,[k[163]||(k[163]=i("label",{class:"mb-2 font-normal text-[16px]"}," Instagram ",-1)),bt(i("input",{"onUpdate:modelValue":k[89]||(k[89]=V=>n(ce).instagram=V),type:"text",placeholder:n(e)("instragram_link"),style:b({"--focus-color":n(w)}),class:"w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,hM),[[Lt,n(ce).instagram]])]),i("div",pM,[k[164]||(k[164]=i("label",{class:"mb-2 font-normal text-[16px]"}," Line ",-1)),bt(i("input",{"onUpdate:modelValue":k[90]||(k[90]=V=>n(ce).line=V),type:"text",placeholder:n(e)("line_link"),style:b({"--focus-color":n(w)}),class:"w-full border border-gray-300 rounded-full px-3 py-2 text-[16px]"},null,12,fM),[[Lt,n(ce).line]])])]),k[165]||(k[165]=i("hr",{class:"border-t border-gray-300 my-4"},null,-1)),i("div",_M,[i("button",{type:"button",onClick:Ee,style:b({color:n(w),borderColor:n(w)}),class:"w-[160px] h-[40px] flex items-center justify-center font-bold border text-[16px] cursor-pointer rounded-full outline-none"},c(n(e)("discard_changes")),5),i("button",{type:"button",onClick:Oo,disabled:n(Qo),class:J(["w-[160px] h-[40px] flex items-center justify-center font-bold border text-[16px] rounded-full outline-none",n(Qo)?"cursor-not-allowed":"cursor-pointer"]),style:b(n(Qo)?{backgroundColor:"#D1D5DB",borderColor:"#D1D5DB",color:"#6B7280"}:{backgroundColor:n(w),borderColor:n(w),color:"white"})},c(n(e)("save")),15,mM)])])):C("",!0),P.value?(p(),f("div",vM,[i("div",gM,[i("div",bM,[i("p",xM,c(n(e)("cancel_regis")),1),i("p",yM,[gt(c(n(e)("cancel_regis1"))+" ",1),i("span",wM,c(n(e)("cancel_regis2")),1)])]),k[166]||(k[166]=i("hr",{class:"border-gray-300 mx-auto w-[83%] sm:w-[90%] mt-5 sm:mt-8"},null,-1)),i("div",kM,[i("button",{onClick:k[91]||(k[91]=V=>P.value=!1),class:"font-bold rounded-full border border-gray-400 text-gray-700 hover:bg-gray-100 cursor-pointer w-[132px] h-[36px] sm:w-[260px] sm:h-[40px]"},c(n(e)("continue")),1),i("button",{onClick:Eo,class:"font-bold rounded-full text-white cursor-pointer w-[132px] h-[36px] sm:w-[260px] sm:h-[40px]",style:b({backgroundColor:n(w)})},c(n(e)("confirm")),5)])])])):C("",!0),H.value?(p(),f("div",$M,[i("div",CM,[i("div",MM,[i("p",SM,c(n(e)("discard_changes")),1),i("p",DM,c(n(e)("confirm_edit")),1)]),k[167]||(k[167]=i("hr",{class:"border-gray-300 mx-auto w-[83%] sm:w-[90%] mt-5 sm:mt-8"},null,-1)),i("div",AM,[i("button",{onClick:k[92]||(k[92]=V=>H.value=!1),class:"rounded-full border border-gray-400 font-bold text-gray-700 hover:bg-gray-100 cursor-pointer w-[132px] h-[36px] sm:w-[260px] sm:h-[40px]"},c(n(e)("continue")),1),i("button",{onClick:lo,class:"rounded-full text-white font-bold cursor-pointer w-[132px] h-[36px] sm:w-[260px] sm:h-[40px]",style:b({backgroundColor:n(w)})},c(n(e)("confirm")),5)])])])):C("",!0),$.value?(p(),f("div",zM,[i("div",jM,[i("h2",TM,c(h.value),1),i("div",PM,[i("button",{onClick:k[93]||(k[93]=V=>$.value=!1),class:"px-6 py-2 rounded-lg text-white cursor-pointer",style:b({backgroundColor:n(w)})},c(n(e)("ok")),5)])])])):C("",!0),S.value?(p(),f("div",LM,[i("div",RM,[i("h2",OM,c(n(e)("shop_info")),1),i("p",BM,c(n(e)("phone_number"))+" "+c(n(Dt).contact.phone),1),k[168]||(k[168]=i("hr",{class:"my-7 border-gray-300"},null,-1)),i("div",EM,[i("button",{onClick:k[94]||(k[94]=V=>S.value=!1),class:"px-6 py-2 rounded-full text-white cursor-pointer w-full font-bold",style:b({backgroundColor:n(w)})},c(n(e)("understood")),5)])])])):C("",!0)],64))}},IM=mo(FM,[["__scopeId","data-v-ee2e158a"]]),NM={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none"};function HM(o,t){return p(),f("svg",NM,[...t[0]||(t[0]=[rs('<g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" clip-path="url(#a)"><path d="M18.2 16.002a2.2 2.2 0 1 1-4.401 0 2.2 2.2 0 0 1 4.401 0"></path>
27<path d="M9 16.002a7.34 7.34 0 0 1 14 0 7.34 7.34 0 0 1-14 0"></path></g><rect width="31" height="31" x=".5" y=".5" stroke="#DEC34E" rx="15.5"></rect><defs><clipPath id="a"><rect width="32" height="32" fill="#fff" rx="16"></rect></clipPath></defs>',3)])])}const VM={render:HM},WM={class:"w-full rounded-lg px-4 py-6 bg-white mb-8 text-form"},UM={class:"flex items-center"},YM={class:"text-[16px] xl:text-[18px] font-bold"},qM={class:"space-y-4 text-form"},ZM={class:"w-full rounded-lg px-4 py-6 bg-white"},XM={class:"flex items-center w-full"},KM={class:"text-[16px] xl:text-[18px] font-bold"},GM={class:"mt-5 overflow-x-auto"},QM={class:"w-full text-left border-collapse"},JM={class:"hidden align-center text-center md:table-header-group"},tS={class:"border-b border-gray-400"},eS={class:"p-2 text-[14px] font-normal w-[130px]"},oS={class:"p-2 text-[14px] font-normal w-1/3"},sS={class:"p-2 text-[14px] font-normal"},nS={class:"p-2 text-[14px] font-normal w-[140px]"},iS={key:0},lS={colspan:"5",class:"p-4 text-center text-gray-500"},rS={class:"md:p-2 flex justify-start md:justify-center items-center"},aS=["src"],cS={class:"p-2 w-1/3 truncate max-w-[150px] text-left"},dS={class:"p-2"},uS={class:"flex flex-col leading-tight"},hS={key:1},pS={class:"p-2 w-[80px]"},fS={class:"p-2"},_S={class:"flex items-center justify-center h-full space-x-2"},mS={class:"p-2 text-center"},vS={class:"w-10"},gS=["src"],bS={class:"p-2 text-[12px]"},xS={class:"flex"},yS={class:"truncate max-w-[180px]"},wS={class:"font-normal flex justify-between"},kS={class:"leading-tight"},$S={key:0,class:"font-bold"},CS={key:1,class:"font-bold"},MS={class:"font-normal flex justify-between"},SS={class:"text-[#A4A4A4]"},DS={class:"font-bold"},AS={class:"font-normal flex items-center justify-start h-full space-x-2 mt-1"},zS=["onClick"],jS={class:"mt-6 flex flex-col sm:flex-row sm:items-center sm:justify-between"},TS={class:"text-sm text-gray-700 mb-4 sm:mb-0"},PS={class:"flex items-center space-x-1","aria-label":"Pagination"},LS=["disabled"],RS=["disabled","onClick"],OS=["disabled"],BS={key:0,class:"fixed inset-0 flex items-center justify-center z-50 bg-black/30"},ES={class:"bg-white rounded-lg shadow-lg p-6 w-[95%] max-w-[327px] md:max-w-[500px] xl:max-w-[920px] h-auto max-h-[90vh] overflow-y-auto"},FS={class:"flex justify-between items-center border-b border-gray-200 pb-4 mb-6"},IS={class:"text-[16px] xl:text-[18px] font-bold"},NS={class:"xl:flex w-full h-full mt-4 lg:mt-10 gap-6"},HS={class:"flex flex-shrink-0 justify-center"},VS=["src"],WS={class:"mt-8 xl:mt-0 flex-1 flex flex-col justify-start"},US={class:"text-[14px] xl:text-[16px] block mb-2"},YS={class:"flex flex-col md:flex-row md:items-center gap-3"},qS={class:"font-bold select-none"},ZS={class:"text-[20px] font-semibold line-clamp-2 break-words mt-3"},XS={class:"font-normal text-[14px] text-[#A4A4A4]"},KS={class:"flex mt-2 items-center space-x-3"},GS={key:0,class:"text-[20px] font-bold text-red-700"},QS={class:"text-[16px] xl:text-[20px] font-normal line-through",style:{color:"#a4a4a4"}},JS={key:2,class:"text-[16px] xl:text-[20px] font-bold"},tD={class:"flex space-x-4 mt-2"},eD={class:"text-[14px] xl:text-[16px]"},oD={class:"text-[14px] xl:text-[16px] text-[#A4A4A4]"},sD={key:1,class:"fixed inset-0 flex items-center justify-center z-50 bg-black/30"},nD={class:"bg-white rounded-lg shadow-lg p-6 w-[90%] max-w-md"},iD={class:"font-bold text-lg mb-4"},lD=["value"],rD={class:"flex justify-end space-x-2"},aD={__name:"ProductOffer",setup(o){const{locale:t}=ee(),e=ke(),{color:s,button_color:l,bg_hover_button:r,price_red:a}=Qt(e),d=je(),{showContent:u}=Qt(d),h=Vs(),_=z(!1),m=z(null),x=lt(()=>window.innerWidth<768),$=lt(()=>h.getProduct?.data?.data||[]),S=lt(()=>h.getProduct?.data?.pagination||{}),v=async P=>{m.value=P;try{const W=await h.generateLinkAffiliate(P.id);I.value=W?.data?.link||""}catch{I.value=""}_.value=!0},M=()=>{_.value=!1,m.value=null},w=z(!1),I=z(""),O=z(!1);pe(_,P=>{document.body.style.overflow=P?"hidden":""}),pe(w,P=>{document.body.style.overflow=P?"hidden":""});const tt=We({});pe(_,P=>{document.body.style.overflow=P?"hidden":""}),pe(w,P=>{document.body.style.overflow=P?"hidden":""});const G=()=>{w.value=!1,I.value=""},Y=async()=>{await ht(I.value)&&(O.value=!0,setTimeout(()=>{O.value=!1},2e3))},et=async P=>{try{const W=I.value;if(!W||!await ht(W))return;tt[P]=!0,setTimeout(()=>{tt[P]=!1},2e3)}catch(W){console.error("Copy link failed:",W)}},ht=async P=>{if(!P)return!1;try{const W=document.createElement("textarea");W.value=P,W.setAttribute("readonly",""),W.style.cssText="position:fixed;opacity:0;pointer-events:none;top:0;left:0;",document.body.appendChild(W),W.focus(),W.select(),W.setSelectionRange(0,99999);const U=document.execCommand("copy");return document.body.removeChild(W),U?!0:navigator?.clipboard?.writeText&&window.isSecureContext?(await navigator.clipboard.writeText(P),!0):!1}catch(W){return console.error("Copy failed:",W),!1}};we(()=>{ct.value=1,h.loadProduct({page:ct.value,limit:dt.value})});const ct=z(1),dt=z(10),pt=lt(()=>S.value.total_product||0),D=lt(()=>S.value.total_page||1),Mt=lt(()=>(ct.value-1)*dt.value+1),ot=lt(()=>Math.min(ct.value*dt.value,pt.value)),st=async P=>{P<1||P>D.value||(ct.value=P,await h.loadProduct({page:P,limit:10}),window.scrollTo({top:0,behavior:"smooth"}))},X=lt(()=>{const P=[],W=D.value,U=ct.value;if(W<=5)for(let B=1;B<=W;B++)P.push(B);else U<=3?P.push(1,2,3,"...",W):U>=W-2?P.push(1,"...",W-2,W-1,W):P.push(1,"...",U-1,U,U+1,"...",W);return P}),H=P=>
27P?Number(P).toLocaleString("th-TH",{minimumFractionDigits:2,maximumFractionDigits:2}):"0.00";return(P,W)=>{const U=To("P");return p(),f(at,null,[i("div",WM,[i("div",UM,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:W[0]||(W[0]=B=>u.value=!1)},[...W[5]||(W[5]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("p",YM,c(P.$t("offer")),1)])]),i("div",qM,[i("div",ZM,[i("div",XM,[i("p",KM,c(P.$t("all_product")),1)]),W[9]||(W[9]=i("div",{class:"border-b border-gray-300 mt-2 md:hidden -mx-4 mt-5"},null,-1)),i("div",GM,[i("table",QM,[i("thead",JM,[i("tr",tS,[i("th",eS,c(P.$t("product_img")),1),i("th",oS,c(P.$t("product_title")),1),i("th",sS,c(P.$t("price_aff")),1),i("th",nS,c(P.$t("commission")),1),W[6]||(W[6]=i("th",{class:"p-2 text-[14px] font-normal"},null,-1))])]),i("tbody",null,[n($).length===0?(p(),f("tr",iS,[i("td",lS,c(P.$t("no_product")),1)])):n($).length!==0&&!n(x)?(p(!0),f(at,{key:1},xt(n($),(B,Z)=>(p(),f("tr",{key:Z,class:"align-center text-center border-b border-gray-200 hover:bg-gray-50 text-[14px] font-bold"},[i("td",rS,[i("img",{src:B.product_image&&B.product_image!==""?B.product_image:n(re),alt:"Product Image",class:"w-[46px] h-[46px] md:w-12 md:h-12 xl:w-[46px] xl:h-[46px] object-contain rounded-md"},null,8,aS)]),i("td",cS,c(n(t)==="th"?B.name:B.name_en||B.name),1),i("td",dS,[i("div",uS,[B.max_real_price&&B.max_real_price!==B.real_price?(p(),f(at,{key:0},[i("span",null,"฿ "+c(H(B.real_price))+" -",1),i("span",null,"฿ "+c(H(B.max_real_price)),1)],64)):(p(),f("span",hS,"฿ "+c(H(B.real_price)),1))])]),i("td",pS,c(B.commission_rate)+"%",1),i("td",fS,[i("div",_S,[zt(n(VM),{class:"w-9 h-9 cursor-pointer",style:b({color:n(s)}),onClick:q=>v(B)},null,8,["style","onClick"])])])]))),128)):n($).length!==0&&n(x)?(p(!0),f(at,{key:2},xt(n($),(B,Z)=>(p(),f("tr",{key:Z,class:"align-center text-center border-b border-gray-200 hover:bg-gray-50 text-[14px] font-bold"},[i("td",mS,[i("div",vS,[i("img",{src:B.product_image&&B.product_image!==""?B.product_image:n(re),alt:"Product Image",class:"w-[40px] h-[40px] object-contain rounded-md mx-auto"},null,8,gS)])]),i("td",bS,[i("div",xS,[i("p",yS,c(n(t)==="th"?B.name:B.name_en||B.name),1)]),i("div",wS,[zt(U,{class:"text-[#A4A4A4]"},{default:ne(()=>[gt(c(P.$t("price_aff")),1)]),_:1}),i("td",null,[i("div",kS,[B.max_real_price&&B.max_real_price!==B.real_price?(p(),f("span",$S," ฿ "+c(H(B.real_price))+" - ฿ "+c(H(B.max_real_price)),1)):(p(),f("span",CS,"฿ "+c(H(B.real_price)),1))])])]),i("div",MS,[i("p",SS,c(P.$t("commission")),1),i("p",DS,c(B.commission_rate)+"%",1)]),i("div",AS,[i("div",{class:"w-8 h-8 cursor-pointer rounded-full flex items-center justify-center",style:b({border:`1px solid ${n(e).color}`}),onClick:q=>v(B)},[zt(n(Hi),{class:"w-5 h-5",style:b({color:n(s)})},null,8,["style"])],12,zS)])])]))),128)):C("",!0)])])]),i("div",jS,[i("div",TS,c(P.$t("showing_results",{start:n(Mt),end:n(ot),total:n(pt)||0})),1),i("nav",PS,[i("button",{onClick:W[1]||(W[1]=B=>st(ct.value-1)),disabled:ct.value===1,class:"px-2 text-xl text-gray-600 disabled:text-gray-300 cursor-pointer"},[...W[7]||(W[7]=[i("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])],8,LS),(p(!0),f(at,null,xt(n(X),B=>(p(),f("button",{key:B,disabled:B==="...",class:J(["w-8 h-8 rounded-full text-sm font-medium flex items-center justify-center cursor-pointer",B===ct.value?"":B==="..."?"cursor-default text-gray-400":"text-gray-700 hover:bg-gray-200"]),style:b(B===ct.value?{backgroundColor:n(s),color:"#ffff"}:{}),onClick:Z=>B!=="..."&&st(B)},c(B),15,RS))),128)),i("button",{onClick:W[2]||(W[2]=B=>st(ct.value+1)),disabled:ct.value===n(D),class:"px-2 text-xl text-gray-600 disabled:text-gray-300 cursor-pointer"},[...W[8]||(W[8]=[i("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})],-1)])],8,OS)])])]),_.value?(p(),f("div",BS,[i("div",ES,[i("div",FS,[i("p",IS,c(P.$t("product_offer")),1),i("button",{onClick:M,class:"text-gray-500 hover:text-gray-700 text-2xl font-bold leading-none cursor-pointer"},[zt(n(rl),{class:"h-5 w-5"})])]),i("div",NS,[i("div",HS,[m.value?(p(),f("img",{key:0,src:m.value.product_image&&m.value.product_image!==""?m.value.product_image:n(re),alt:"Product Image",class:"w-[200px] h-[200px] md:w-[240px] md:h-[240px] object-contain rounded-md",style:{border:"0.54px solid #d1d1d1"}},null,8,VS)):C("",!0)]),i("div",WS,[i("div",{class:"border rounded-md px-3 py-3",style:b(`color:${n(s)}; border-color:${n(s)}; background-color:${n(e).color_nav}`)},[i("span",US,c(P.$t("commission"))+" : "+c(m.value.commission_rate)+"% ",1),i("div",YS,[bt(i("input",{type:"text",readonly:"",class:"w-full md:w-[298px] xl:w-[454px] p-2 border rounded-full text-[14px] h-[40p
27x] focus:outline-none","onUpdate:modelValue":W[3]||(W[3]=B=>I.value=B),style:{border:"1px solid #D1D1D1",backgroundColor:"#ffffff"}},null,512),[[Lt,I.value]]),i("button",{class:"flex shrink-0 w-full md:w-[126px] h-[40px] text-[14px] font-medium items-center justify-center space-x-2 cursor-pointer relative z-10",onClick:W[4]||(W[4]=B=>et(m.value.id)),style:b({borderRadius:"24px",color:n(s),border:`1px solid ${n(s)}`,backgroundColor:n(tt)[m.value.id]?"var(--bg-hover-button)":"#ffffff"})},[(p(),ae(ls(n(tt)[m.value.id]?n(Dd):n(Vd)),{class:"w-[20px] h-[20px] pointer-events-none"})),i("span",qS,c(n(tt)[m.value.id]?P.$t("copy_link1"):P.$t("copy_link")),1)],4)])],4),i("p",ZS,c(n(t)==="th"?m.value.name:m.value.name_en||m.value.name),1),i("p",XS," SKU: "+c(m.value.sku),1),i("div",KS,[m.value.max_real_price&&Number(m.value.max_real_price)!==Number(m.value.real_price)?(p(),f("span",GS," ฿ "+c(H(m.value.real_price))+" - ฿ "+c(H(m.value.max_real_price)),1)):Number(m.value.fake_price)>Number(m.value.real_price)?(p(),f(at,{key:1},[i("span",{class:"text-[16px] xl:text-[20px] font-bold",style:b({color:n(a)})}," ฿ "+c(H(m.value.real_price)),5),i("span",QS," ฿ "+c(H(m.value.fake_price)),1)],64)):(p(),f("span",JS," ฿ "+c(H(m.value.real_price)),1))]),i("div",tD,[i("span",eD,c(P.$t("item_sold"))+" "+c(m.value.sold)+" "+c(P.$t("xx_products")),1),W[10]||(W[10]=i("span",{class:"text-[#A4A4A4] xl:mt-0.5"},"|",-1)),i("span",oD,c(P.$t("item_in_stock"))+" "+c(m.value.stock)+" "+c(P.$t("xx_products")),1)])])])])])):C("",!0),w.value?(p(),f("div",sD,[i("div",nD,[i("p",iD,c(P.$t("AffiliateLink")),1),i("input",{type:"text",readonly:"",class:"w-full p-2 border rounded mb-4",value:I.value,style:b({border:`1px solid ${n(e).color}`})},null,12,lD),i("div",rD,[i("button",{style:b({backgroundColor:O.value?n(e).color_nav:"#ffffff",border:`1px solid ${n(e).color}`,color:n(e).color,transition:"background-color 0.3s"}),class:"px-4 py-2 rounded-full font-bold",onClick:Y},c(O.value?P.$t("copy_link1"):P.$t("copy_link")),5),i("button",{class:"px-4 py-2 bg-gray-300 text-black rounded-full font-bold",onClick:G},c(P.$t("close")),1)])])])):C("",!0)])],64)}}},cD=mo(aD,[["__scopeId","data-v-8d980c00"]]);function wn(o){return o+.5|0}const ss=(o,t,e)=>Math.max(Math.min(o,e),t);function en(o){return ss(wn(o*2.55),0,255)}function is(o){return ss(wn(o*255),0,255)}function Uo(o){return ss(wn(o/2.55)/100,0,1)}function lr(o){return ss(wn(o*100),0,100)}const to={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Xi=[..."0123456789ABCDEF"],dD=o=>Xi[o&15],uD=o=>Xi[(o&240)>>4]+Xi[o&15],zn=o=>(o&240)>>4===(o&15),hD=o=>zn(o.r)&&zn(o.g)&&zn(o.b)&&zn(o.a);function pD(o){var t=o.length,e;return o[0]==="#"&&(t===4||t===5?e={r:255&to[o[1]]*17,g:255&to[o[2]]*17,b:255&to[o[3]]*17,a:t===5?to[o[4]]*17:255}:(t===7||t===9)&&(e={r:to[o[1]]<<4|to[o[2]],g:to[o[3]]<<4|to[o[4]],b:to[o[5]]<<4|to[o[6]],a:t===9?to[o[7]]<<4|to[o[8]]:255})),e}const fD=(o,t)=>o<255?t(o):"";function _D(o){var t=hD(o)?dD:uD;return o?"#"+t(o.r)+t(o.g)+t(o.b)+fD(o.a,t):void 0}const mD=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function sc(o,t,e){const s=t*Math.min(e,1-e),l=(r,a=(r+o/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[l(0),l(8),l(4)]}function vD(o,t,e){const s=(l,r=(l+o/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[s(5),s(3),s(1)]}function gD(o,t,e){const s=sc(o,1,.5);let l;for(t+e>1&&(l=1/(t+e),t*=l,e*=l),l=0;l<3;l++)s[l]*=1-t-e,s[l]+=t;return s}function bD(o,t,e,s,l){return o===l?(t-e)/s+(t<e?6:0):t===l?(e-o)/s+2:(o-t)/s+4}function pl(o){const e=o.r/255,s=o.g/255,l=o.b/255,r=Math.max(e,s,l),a=Math.min(e,s,l),d=(r+a)/2;let u,h,_;return r!==a&&(_=r-a,h=d>.5?_/(2-r-a):_/(r+a),u=bD(e,s,l,_,r),u=u*60+.5),[u|0,h||0,d]}function fl(o,t,e,s){return(Array.isArray(t)?o(t[0],t[1],t[2]):o(t,e,s)).map(is)}function _l(o,t,e){return fl(sc,o,t,e)}function xD(o,t,e){return fl(gD,o,t,e)}function yD(o,t,e){return fl(vD,o,t,e)}function nc(o){return(o%360+360)%360}function wD(o){const t=mD.exec(o);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?en(+t[5]):is(+t[5]));const l=nc(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=xD(l,r,a):t[1]==="hsv"?s=yD(l,r,a):s=_l(l,r,a),{r:s[0],g:s[1],b:s[2],a:e}}function kD(o,t){var e=pl(o);e[0]=nc(e[0]+t),e=_l(e),o.r=e[0],o.g=e[1],o.b=e[2]}function $D(o){if(!o)return;const t=pl(o),e=t[0],s=lr(t[1]),l=lr(t[2]);return o.a<255?`hsla(${e}, ${s}%, ${l}%, ${Uo(o.a)})`:`hsl(${e}, ${s}%, ${l}%)`}const rr={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ar={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",K
vendor: 5,064 bytes, line 27
27ocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function CD(){const o={},t=Object.keys(ar),e=Object.keys(rr);let s,l,r,a,d;for(s=0;s<t.length;s++){for(a=d=t[s],l=0;l<e.length;l++)r=e[l],d=d.replace(r,rr[r]);r=parseInt(ar[a],16),o[d]=[r>>16&255,r>>8&255,r&255]}return o}let jn;function MD(o){jn||(jn=CD(),jn.transparent=[0,0,0,0]);const t=jn[o.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const SD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function DD(o){const t=SD.exec(o);let e=255,s,l,r;if(t){if(t[7]!==s){const a=+t[7];e=t[8]?en(a):ss(a*255,0,255)}return s=+t[1],l=+t[3],r=+t[5],s=255&(t[2]?en(s):ss(s,0,255)),l=255&(t[4]?en(l):ss(l,0,255)),r=255&(t[6]?en(r):ss(r,0,255)),{r:s,g:l,b:r,a:e}}}function AD(o){return o&&(o.a<255?`rgba(${o.r}, ${o.g}, ${o.b}, ${Uo(o.a)})`:`rgb(${o.r}, ${o.g}, ${o.b})`)}const Di=o=>o<=.0031308?o*12.92:Math.pow(o,1/2.4)*1.055-.055,zs=o=>o<=.04045?o/12.92:Math.pow((o+.055)/1.055,2.4);function zD(o,t,e){const s=zs(Uo(o.r)),l=zs(Uo(o.g)),r=zs(Uo(o.b));return{r:is(Di(s+e*(zs(Uo(t.r))-s))),g:is(Di(l+e*(zs(Uo(t.g))-l))),b:is(Di(r+e*(zs(Uo(t.b))-r))),a:o.a+e*(t.a-o.a)}}function Tn(o,t,e){if(o){let s=pl(o);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=_l(s),o.r=s[0],o.g=s[1],o.b=s[2]}}function ic(o,t){return o&&Object.assign(t||{},o)}function cr(o){var t={r:0,g:0,b:0,a:255};return Array.isArray(o)?o.length>=3&&(t={r:o[0],g:o[1],b:o[2],a:255},o.length>3&&(t.a=is(o[3]))):(t=ic(o,{r:0,g:0,b:0,a:1}),t.a=is(t.a)),t}function jD(o){return o.charAt(0)==="r"?DD(o):wD(o)}class pn{constructor(t){if(t instanceof pn)return t;const e=typeof t;let s;e==="object"?s=cr(t):e==="string"&&(s=pD(t)||MD(t)||jD(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=ic(this._rgb);return t&&(t.a=Uo(t.a)),t}set rgb(t){this._rgb=cr(t)}rgbString(){return this._valid?AD(this._rgb):void 0}hexString(){return this._valid?_D(this._rgb):void 0}hslString(){return this._valid?$D(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,l=t.rgb;let r;const a=e===r?.5:e,d=2*a-1,u=s.a-l.a,h=((d*u===-1?d:(d+u)/(1+d*u))+1)/2;r=1-h,s.r=255&h*s.r+r*l.r+.5,s.g=255&h*s.g+r*l.g+.5,s.b=255&h*s.b+r*l.b+.5,s.a=a*s.a+(1-a)*l.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=zD(this._rgb,t._rgb,e)),this}clone(){return new pn(this.rgb)}alpha(t){return this._rgb.a=is(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=wn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Tn(this._rgb,2,t),this}darken(t){return Tn(this._rgb,2,-t),this}saturate(t){return Tn(this._rgb,1,t),this}desaturate(t){return Tn(this._rgb,1,-t),this}rotate(t){return kD(this._rgb,t),this}}function No(){}const TD=(()=>{let o=0;return()=>o++})();function fe(o){return o==null}function Ce(o){if(Array.isArray&&Array.isArray(o))return!0;const t=Object.prototype.toString.call(o);
vendor: 4,262 bytes, line 27
27return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function te(o){return o!==null&&Object.prototype.toString.call(o)==="[object Object]"}function Re(o){return(typeof o=="number"||o instanceof Number)&&isFinite(+o)}function Co(o,t){return Re(o)?o:t}function Gt(o,t){return typeof o>"u"?t:o}const PD=(o,t)=>typeof o=="string"&&o.endsWith("%")?parseFloat(o)/100*t:+o;function me(o,t,e){if(o&&typeof o.call=="function")return o.apply(e,t)}function ue(o,t,e,s){let l,r,a;if(Ce(o))for(r=o.length,l=0;l<r;l++)t.call(e,o[l],l);else if(te(o))for(a=Object.keys(o),r=a.length,l=0;l<r;l++)t.call(e,o[a[l]],a[l])}function Kn(o,t){let e,s,l,r;if(!o||!t||o.length!==t.length)return!1;for(e=0,s=o.length;e<s;++e)if(l=o[e],r=t[e],l.datasetIndex!==r.datasetIndex||l.index!==r.index)return!1;return!0}function Gn(o){if(Ce(o))return o.map(Gn);if(te(o)){const t=Object.create(null),e=Object.keys(o),s=e.length;let l=0;for(;l<s;++l)t[e[l]]=Gn(o[e[l]]);return t}return o}function lc(o){return["__proto__","prototype","constructor"].indexOf(o)===-1}function LD(o,t,e,s){if(!lc(o))return;const l=t[o],r=e[o];te(l)&&te(r)?fn(l,r,s):t[o]=Gn(r)}function fn(o,t,e){const s=Ce(t)?t:[t],l=s.length;if(!te(o))return o;e=e||{};const r=e.merger||LD;let a;for(let d=0;d<l;++d){if(a=s[d],!te(a))continue;const u=Object.keys(a);for(let h=0,_=u.length;h<_;++h)r(u[h],o,a,e)}return o}function rn(o,t){return fn(o,t,{merger:RD})}function RD(o,t,e){if(!lc(o))return;const s=t[o],l=e[o];te(s)&&te(l)?rn(s,l):Object.prototype.hasOwnProperty.call(t,o)||(t[o]=Gn(l))}const dr={"":o=>o,x:o=>o.x,y:o=>o.y};function OD(o){const t=o.split("."),e=[];let s="";for(const l of t)s+=l,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function BD(o){const t=OD(o);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Qn(o,t){return(dr[t]||(dr[t]=BD(t)))(o)}function ml(o){return o.charAt(0).toUpperCase()+o.slice(1)}const Jn=o=>typeof o<"u",cs=o=>typeof o=="function",ur=(o,t)=>{if(o.size!==t.size)return!1;for(const e of o)if(!t.has(e))return!1;return!0};function ED(o){return o.type==="mouseup"||o.type==="click"||o.type==="contextmenu"}const Se=Math.PI,fo=2*Se,FD=fo+Se,ti=Number.POSITIVE_INFINITY,ID=Se/180,po=Se/2,ps=Se/4,hr=Se*2/3,rc=Math.log10,Is=Math.sign;function an(o,t,e){return Math.abs(o-t)<e}function pr(o){const t=Math.round(o);o=an(o,t,o/1e3)?t:o;const e=Math.pow(10,Math.floor(rc(o))),s=o/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function ND(o){const t=[],e=Math.sqrt(o);let s;for(s=1;s<e;s++)o%s===0&&(t.push(s),t.push(o/s));return e===(e|0)&&t.push(e),t.sort((l,r)=>l-r).pop(),t}function HD(o){return typeof o=="symbol"||typeof o=="object"&&o!==null&&!(Symbol.toPrimitive in o||"toString"in o||"valueOf"in o)}function _n(o){return!HD(o)&&!isNaN(parseFloat(o))&&isFinite(o)}function VD(o,t){const e=Math.round(o);return e-t<=o&&e+t>=o}function WD(o,t,e){let s,l,r;for(s=0,l=o.length;s<l;s++)r=o[s][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function gs(o){return o*(Se/180)}function UD(o){return o*(180/Se)}function fr(o){if(!Re(o))return;let t=1,e=0;for(;Math.round(o*t)/t!==o;)t*=10,e++;return e}function YD(o,t){const e=t.x-o.x,s=t.y-o.y,l=Math.sqrt(e*e+s*s);let r=Math.atan2(s,e);return r<-.5*Se&&(r+=fo),{angle:r,distance:l}}function Ki(o,t){return Math.sqrt(Math.pow(t.x-o.x,2)+Math.pow(t.y-o.y,2))}function qD(o,t){return(o-t+FD)%fo-Se}function Do(o){return(o%fo+fo)%fo}function ac(o,t,e,s){const l=Do(o),r=Do(t),a=Do(e),d=Do(r-l),u=Do(a-l),h=Do(l-r),_=Do(l-a);return l===r||l===a||s&&r===a||d>u&&h<_}function oo(o,t,e){return Math.max(t,Math.min(e,o))}function ZD(o){return oo(o,-32768,32767)}function Ps(o,t,e,s=1e-6){return o>=Math.min(t,e)-s&&o<=Math.max(t,e)+s}function vl(o,t,e){e=e||(a=>o[a]<t);let s=o.length-1,l=0,r;for(;s-l>1;)r=l+s>>1,e(r)?l=r:s=r;return{lo:l,hi:s}}const bs=(o,t,e,s)=>vl(o,e,s?l=>{const r=o[l][t];return r<e||r===e&&o[l+1][t]===e}:l=>o[l][t]<e),XD=(o,t,e)=>vl(o,e,s=>o[s][t]>=e);function KD(o,t,e){let s=0,l=o.length;for(;s<l&&o[s]<t;)s++;for(;l>s&&o[l-1]>e;)l--;return s>0||l<o.length?o.slice(s,l):o}const cc=["push","pop","shift","splice","unshift"];function GD(o,t){if(o._chartjs){o._chartjs.listeners.push(t);return}Object.defineProperty(o,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}
vendor: 4,739 bytes, line 27
27),cc.forEach(e=>{const s="_onData"+ml(e),l=o[e];Object.defineProperty(o,e,{configurable:!0,enumerable:!1,value(...r){const a=l.apply(this,r);return o._chartjs.listeners.forEach(d=>{typeof d[s]=="function"&&d[s](...r)}),a}})})}function _r(o,t){const e=o._chartjs;if(!e)return;const s=e.listeners,l=s.indexOf(t);l!==-1&&s.splice(l,1),!(s.length>0)&&(cc.forEach(r=>{delete o[r]}),delete o._chartjs)}function QD(o){const t=new Set(o);return t.size===o.length?o:Array.from(t)}const dc=(function(){return typeof window>"u"?function(o){return o()}:window.requestAnimationFrame})();function uc(o,t){let e=[],s=!1;return function(...l){e=l,s||(s=!0,dc.call(window,()=>{s=!1,o.apply(t,e)}))}}function JD(o,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(o,t,s)):o.apply(this,s),t}}const gl=o=>o==="start"?"left":o==="end"?"right":"center",Pe=(o,t,e)=>o==="start"?t:o==="end"?e:(t+e)/2,tA=(o,t,e,s)=>o===(s?"left":"right")?e:o==="center"?(t+e)/2:t;function eA(o,t,e){const s=t.length;let l=0,r=s;if(o._sorted){const{iScale:a,vScale:d,_parsed:u}=o,h=o.dataset&&o.dataset.options?o.dataset.options.spanGaps:null,_=a.axis,{min:m,max:x,minDefined:$,maxDefined:S}=a.getUserBounds();if($){if(l=Math.min(bs(u,_,m).lo,e?s:bs(t,_,a.getPixelForValue(m)).lo),h){const v=u.slice(0,l+1).reverse().findIndex(M=>!fe(M[d.axis]));l-=Math.max(0,v)}l=oo(l,0,s-1)}if(S){let v=Math.max(bs(u,a.axis,x,!0).hi+1,e?0:bs(t,_,a.getPixelForValue(x),!0).hi+1);if(h){const M=u.slice(v-1).findIndex(w=>!fe(w[d.axis]));v+=Math.max(0,M)}r=oo(v,l,s)-l}else r=s-l}return{start:l,count:r}}function oA(o){const{xScale:t,yScale:e,_scaleRanges:s}=o,l={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return o._scaleRanges=l,!0;const r=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,l),r}const Pn=o=>o===0||o===1,mr=(o,t,e)=>-(Math.pow(2,10*(o-=1))*Math.sin((o-t)*fo/e)),vr=(o,t,e)=>Math.pow(2,-10*o)*Math.sin((o-t)*fo/e)+1,cn={linear:o=>o,easeInQuad:o=>o*o,easeOutQuad:o=>-o*(o-2),easeInOutQuad:o=>(o/=.5)<1?.5*o*o:-.5*(--o*(o-2)-1),easeInCubic:o=>o*o*o,easeOutCubic:o=>(o-=1)*o*o+1,easeInOutCubic:o=>(o/=.5)<1?.5*o*o*o:.5*((o-=2)*o*o+2),easeInQuart:o=>o*o*o*o,easeOutQuart:o=>-((o-=1)*o*o*o-1),easeInOutQuart:o=>(o/=.5)<1?.5*o*o*o*o:-.5*((o-=2)*o*o*o-2),easeInQuint:o=>o*o*o*o*o,easeOutQuint:o=>(o-=1)*o*o*o*o+1,easeInOutQuint:o=>(o/=.5)<1?.5*o*o*o*o*o:.5*((o-=2)*o*o*o*o+2),easeInSine:o=>-Math.cos(o*po)+1,easeOutSine:o=>Math.sin(o*po),easeInOutSine:o=>-.5*(Math.cos(Se*o)-1),easeInExpo:o=>o===0?0:Math.pow(2,10*(o-1)),easeOutExpo:o=>o===1?1:-Math.pow(2,-10*o)+1,easeInOutExpo:o=>Pn(o)?o:o<.5?.5*Math.pow(2,10*(o*2-1)):.5*(-Math.pow(2,-10*(o*2-1))+2),easeInCirc:o=>o>=1?o:-(Math.sqrt(1-o*o)-1),easeOutCirc:o=>Math.sqrt(1-(o-=1)*o),easeInOutCirc:o=>(o/=.5)<1?-.5*(Math.sqrt(1-o*o)-1):.5*(Math.sqrt(1-(o-=2)*o)+1),easeInElastic:o=>Pn(o)?o:mr(o,.075,.3),easeOutElastic:o=>Pn(o)?o:vr(o,.075,.3),easeInOutElastic(o){return Pn(o)?o:o<.5?.5*mr(o*2,.1125,.45):.5+.5*vr(o*2-1,.1125,.45)},easeInBack(o){return o*o*((1.70158+1)*o-1.70158)},easeOutBack(o){return(o-=1)*o*((1.70158+1)*o+1.70158)+1},easeInOutBack(o){let t=1.70158;return(o/=.5)<1?.5*(o*o*(((t*=1.525)+1)*o-t)):.5*((o-=2)*o*(((t*=1.525)+1)*o+t)+2)},easeInBounce:o=>1-cn.easeOutBounce(1-o),easeOutBounce(o){return o<1/2.75?7.5625*o*o:o<2/2.75?7.5625*(o-=1.5/2.75)*o+.75:o<2.5/2.75?7.5625*(o-=2.25/2.75)*o+.9375:7.5625*(o-=2.625/2.75)*o+.984375},easeInOutBounce:o=>o<.5?cn.easeInBounce(o*2)*.5:cn.easeOutBounce(o*2-1)*.5+.5};function bl(o){if(o&&typeof o=="object"){const t=o.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function gr(o){return bl(o)?o:new pn(o)}function Ai(o){return bl(o)?o:new pn(o).saturate(.5).darken(.1).hexString()}const sA=["x","y","borderWidth","radius","tension"],nA=["color","borderColor","backgroundColor"];function iA(o){o.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),o.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),o.set("animations",{colors:{type:"color",properties:nA},numbers:{type:"number",properties:sA}}),o.describe("animations",{_fallback:"animation"}),o.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function lA(o){o.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const br=new Map;function rA(o,t){t=t||{};const e=o+JSON.stringify(t);let s=br.get(e);return s||(s=new Intl.NumberFormat(o,t),br.set(e,s)),s}
vendor: 36,590 bytes, line 27
27function hc(o,t,e){return rA(t,e).format(o)}const aA={values(o){return Ce(o)?o:""+o},numeric(o,t,e){if(o===0)return"0";const s=this.chart.options.locale;let l,r=o;if(e.length>1){const h=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(h<1e-4||h>1e15)&&(l="scientific"),r=cA(o,e)}const a=rc(Math.abs(r)),d=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:l,minimumFractionDigits:d,maximumFractionDigits:d};return Object.assign(u,this.options.ticks.format),hc(o,s,u)}};function cA(o,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&o!==Math.floor(o)&&(e=o-Math.floor(o)),e}var pc={formatters:aA};function dA(o){o.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:pc.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),o.route("scale.ticks","color","","color"),o.route("scale.grid","color","","borderColor"),o.route("scale.border","color","","borderColor"),o.route("scale.title","color","","color"),o.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),o.describe("scales",{_fallback:"scale"}),o.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ws=Object.create(null),Gi=Object.create(null);function dn(o,t){if(!t)return o;const e=t.split(".");for(let s=0,l=e.length;s<l;++s){const r=e[s];o=o[r]||(o[r]=Object.create(null))}return o}function zi(o,t,e){return typeof t=="string"?fn(dn(o,t),e):fn(dn(o,""),t)}class uA{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,l)=>Ai(l.backgroundColor),this.hoverBorderColor=(s,l)=>Ai(l.borderColor),this.hoverColor=(s,l)=>Ai(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return zi(this,t,e)}get(t){return dn(this,t)}describe(t,e){return zi(Gi,t,e)}override(t,e){return zi(ws,t,e)}route(t,e,s,l){const r=dn(this,t),a=dn(this,s),d="_"+e;Object.defineProperties(r,{[d]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[d],h=a[l];return te(u)?Object.assign({},h,u):Gt(u,h)},set(u){this[d]=u}}})}apply(t){t.forEach(e=>e(this))}}var ye=new uA({_scriptable:o=>!o.startsWith("on"),_indexable:o=>o!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[iA,lA,dA]);function hA(o){return!o||fe(o.size)||fe(o.family)?null:(o.style?o.style+" ":"")+(o.weight?o.weight+" ":"")+o.size+"px "+o.family}function xr(o,t,e,s,l){let r=t[l];return r||(r=t[l]=o.measureText(l).width,e.push(l)),r>s&&(s=r),s}function fs(o,t,e){const s=o.currentDevicePixelRatio,l=e!==0?Math.max(e/2,.5):0;return Math.round((t-l)*s)/s+l}function yr(o,t){!t&&!o||(t=t||o.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,o.width,o.height),t.restore())}function Qi(o,t,e,s){fc(o,t,e,s,null)}function fc(o,t,e,s,l){let r,a,d,u,h,_,m,x;const $=t.pointStyle,S=t.rotation,v=t.radius;let M=(S||0)*ID;if($&&typeof $=="object"&&(r=$.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){o.save(),o.translate(e,s),o.rotate(M),o.drawImage($,-$.width/2,-$.height/2,$.width,$.height),o.restore();return}if(!(isNaN(v)||v<=0)){switch(o.beginPath(),$){default:l?o.ellipse(e,s,l/2,v,0,0,fo):o.arc(e,s,v,0,fo),o.closePath();break;case"triangle":_=l?l/2:v,o.moveTo(e+Math.sin(M)*_,s-Math.cos(M)*v),M+=hr,o.lineTo(e+Math.sin(M)*_,s-Math.cos(M)*v),M+=hr,o.lineTo(e+Math.sin(M)*_,s-Math.cos(M)*v),o.closePath();break;case"rectRounded":h=v*.516,u=v-h,a=Math.cos(M+ps)*u,m=Math.cos(M+ps)*(l?l/2-h:u),d=Math.sin(M+ps)*u,x=Math.sin(M+ps)*(l?l/2-h:u),o.arc(e-m,s-d,h,M-Se,M-po),o.arc(e+x,s-a,h,M-po,M),o.arc(e+m,s+d,h,M,M+po),o.arc(e-x,s+a,h,M+po,M+Se),o.closePath();break;case"rect":if(!S){u=Math.SQRT1_2*v,_=l?l/2:u,o.rect(e-_,s-u,2*_,2*u);break}M+=ps;case"rectRot":m=Math.cos(M)*(l?l/2:v),a=Math.cos(M)*v,d=Math.sin(M)*v,x=Math.sin(M)*(l?l/2:v),o.moveTo(e-m,s-d),o.lineTo(e+x,s-a),o.lineTo(e+m,s+d),o.lineTo(e-x,s+a),o.closePath();break;case"crossRot":M+=ps;case"cross":m=Math.cos(M)*(l?l/2:v),a=Math.cos(M)*v,d=Math.sin(M)*v,x=Math.sin(M)*(l?l/2:v),o.moveTo(e-m,s-d),o.lineTo(e+m,s+d),o.moveTo(e+x,s-a),o.lineTo(e-x,s+a);break;case"star":m=Math.cos(M)*(l?l/2:v),a=Math.cos(M)*v,d=Math.sin(M)*v,x=Math.sin(M)*(l?l/2:v),o.moveTo(e-m,s-d),o.lineTo(e+m,s+d),o.moveTo(e+x,s-a),o.lineTo(e-x,s+a),M+=ps,m=Math.cos(M)*(l?l/2:v),a=Math.cos(M)*v,d=Math.sin(M)*v,x=Math.sin(M)*(l?l/2:v),o.moveTo(e-m,s-d),o.lineTo(e+m,s+d),o.moveTo(e+x,s-a),o.lineTo(e-x,s+a);break;case"line":a=l?l/2:Math.cos(M)*v,d=Math.sin(M)*v,o.moveTo(e-a,s-d),o.lineTo(e+a,s+d);break;case"dash":o.moveTo(e,s),o.lineTo(e+Math.cos(M)*(l?l/2:v),s+Math.sin(M)*v);break;case!1:o.closePath();break}o.fill(),t.borderWidth>0&&o.stroke()}}function mn(o,t,e){return e=e||.5,!t||o&&o.x>t.left-e&&o.x<t.right+e&&o.y>t.top-e&&o.y<t.bottom+e}function ai(o,t){o.save(),o.beginPath(),o.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),o.clip()}function ci(o){o.restore()}function pA(o,t,e,s,l){if(!t)return o.lineTo(e.x,e.y);if(l==="middle"){const r=(t.x+e.x)/2;o.lineTo(r,t.y),o.lineTo(r,e.y)}else l==="after"!=!!s?o.lineTo(t.x,e.y):o.lineTo(e.x,t.y);o.lineTo(e.x,e.y)}function fA(o,t,e,s){if(!t)return o.lineTo(e.x,e.y);o.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function _A(o,t){t.translation&&o.translate(t.translation[0],t.translation[1]),fe(t.rotation)||o.rotate(t.rotation),t.color&&(o.fillStyle=t.color),t.textAlign&&(o.textAlign=t.textAlign),t.textBaseline&&(o.textBaseline=t.textBaseline)}function mA(o,t,e,s,l){if(l.strikethrough||l.underline){const r=o.measureText(s),a=t-r.actualBoundingBoxLeft,d=t+r.actualBoundingBoxRight,u=e-r.actualBoundingBoxAscent,h=e+r.actualBoundingBoxDescent,_=l.strikethrough?(u+h)/2:h;o.strokeStyle=o.fillStyle,o.beginPath(),o.lineWidth=l.decorationWidth||2,o.moveTo(a,_),o.lineTo(d,_),o.stroke()}}function vA(o,t){const e=o.fillStyle;o.fillStyle=t.color,o.fillRect(t.left,t.top,t.width,t.height),o.fillStyle=e}function vn(o,t,e,s,l,r={}){const a=Ce(t)?t:[t],d=r.strokeWidth>0&&r.strokeColor!=="";let u,h;for(o.save(),o.font=l.string,_A(o,r),u=0;u<a.length;++u)h=a[u],r.backdrop&&vA(o,r.backdrop),d&&(r.strokeColor&&(o.strokeStyle=r.strokeColor),fe(r.strokeWidth)||(o.lineWidth=r.strokeWidth),o.strokeText(h,e,s,r.maxWidth)),o.fillText(h,e,s,r.maxWidth),mA(o,e,s,h,r),s+=Number(l.lineHeight);o.restore()}function Ji(o,t){const{x:e,y:s,w:l,h:r,radius:a}=t;o.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*Se,Se,!0),o.lineTo(e,s+r-a.bottomLeft),o.arc(e+a.bottomLeft,s+r-a.bottomLeft,a.bottomLeft,Se,po,!0),o.lineTo(e+l-a.bottomRight,s+r),o.arc(e+l-a.bottomRight,s+r-a.bottomRight,a.bottomRight,po,0,!0),o.lineTo(e+l,s+a.topRight),o.arc(e+l-a.topRight,s+a.topRight,a.topRight,0,-po,!0),o.lineTo(e+a.topLeft,s)}const gA=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,bA=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function xA(o,t){const e=(""+o).match(gA);if(!e||e[1]==="normal")return t*1.2;switch(o=+e[2],e[3]){case"px":return o;case"%":o/=100;break}return t*o}const yA=o=>+o||0;function _c(o,t){const e={},s=te(t),l=s?Object.keys(t):t,r=te(o)?s?a=>Gt(o[a],o[t[a]]):a=>o[a]:()=>o;for(const a of l)e[a]=yA(r(a));return e}function wA(o){return _c(o,{top:"y",right:"x",bottom:"y",left:"x"})}function un(o){return _c(o,["topLeft","topRight","bottomLeft","bottomRight"])}function io(o){const t=wA(o);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Le(o,t){o=o||{},t=t||ye.font;let e=Gt(o.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=Gt(o.style,t.style);s&&!(""+s).match(bA)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const l={family:Gt(o.family,t.family),lineHeight:xA(Gt(o.lineHeight,t.lineHeight),e),size:e,style:s,weight:Gt(o.weight,t.weight),string:""};return l.string=hA(l),l}function Ln(o,t,e,s){let l,r,a;for(l=0,r=o.length;l<r;++l)if(a=o[l],a!==void 0&&a!==void 0)return a}function kA(o,t,e){const{min:s,max:l}=o,r=PD(t,(l-s)/2),a=(d,u)=>e&&d===0?0:d+u;return{min:a(s,-Math.abs(r)),max:a(l,r)}}function ks(o,t){return Object.assign(Object.create(o),t)}function xl(o,t=[""],e,s,l=()=>o[0]){const r=e||o;typeof s>"u"&&(s=bc("_fallback",o));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:o,_rootScopes:r,_fallback:s,_getTarget:l,override:d=>xl([d,...o],t,r,s)};return new Proxy(a,{deleteProperty(d,u){return delete d[u],delete d._keys,delete o[0][u],!0},get(d,u){return vc(d,u,()=>jA(u,t,o,d))},getOwnPropertyDescriptor(d,u){return Reflect.getOwnPropertyDescriptor(d._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(o[0])},has(d,u){return kr(d).includes(u)},ownKeys(d){return kr(d)},set(d,u,h){const _=d._storage||(d._storage=l());return d[u]=_[u]=h,delete d._keys,!0}})}function Ns(o,t,e,s){const l={_cacheable:!1,_proxy:o,_context:t,_subProxy:e,_stack:new Set,_descriptors:mc(o,s),setContext:r=>Ns(o,r,e,s),override:r=>Ns(o.override(r),t,e,s)};return new Proxy(l,{deleteProperty(r,a){return delete r[a],delete o[a],!0},get(r,a,d){return vc(r,a,()=>CA(r,a,d))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(o,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(o,a)},getPrototypeOf(){return Reflect.getPrototypeOf(o)},has(r,a){return Reflect.has(o,a)},ownKeys(){return Reflect.ownKeys(o)},set(r,a,d){return o[a]=d,delete r[a],!0}})}function mc(o,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:l=t.allKeys}=o;return{allKeys:l,scriptable:e,indexable:s,isScriptable:cs(e)?e:()=>e,isIndexable:cs(s)?s:()=>s}}const $A=(o,t)=>o?o+ml(t):t,yl=(o,t)=>te(t)&&o!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vc(o,t,e){if(Object.prototype.hasOwnProperty.call(o,t)||t==="constructor")return o[t];const s=e();return o[t]=s,s}function CA(o,t,e){const{_proxy:s,_context:l,_subProxy:r,_descriptors:a}=o;let d=s[t];return cs(d)&&a.isScriptable(t)&&(d=MA(t,d,o,e)),Ce(d)&&d.length&&(d=SA(t,d,o,a.isIndexable)),yl(t,d)&&(d=Ns(d,l,r&&r[t],a)),d}function MA(o,t,e,s){const{_proxy:l,_context:r,_subProxy:a,_stack:d}=e;if(d.has(o))throw new Error("Recursion detected: "+Array.from(d).join("->")+"->"+o);d.add(o);let u=t(r,a||s);return d.delete(o),yl(o,u)&&(u=wl(l._scopes,l,o,u)),u}function SA(o,t,e,s){const{_proxy:l,_context:r,_subProxy:a,_descriptors:d}=e;if(typeof r.index<"u"&&s(o))return t[r.index%t.length];if(te(t[0])){const u=t,h=l._scopes.filter(_=>_!==u);t=[];for(const _ of u){const m=wl(h,l,o,_);t.push(Ns(m,r,a&&a[o],d))}}return t}function gc(o,t,e){return cs(o)?o(t,e):o}const DA=(o,t)=>o===!0?t:typeof o=="string"?Qn(t,o):void 0;function AA(o,t,e,s,l){for(const r of t){const a=DA(e,r);if(a){o.add(a);const d=gc(a._fallback,e,l);if(typeof d<"u"&&d!==e&&d!==s)return d}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function wl(o,t,e,s){const l=t._rootScopes,r=gc(t._fallback,e,s),a=[...o,...l],d=new Set;d.add(s);let u=wr(d,a,e,r||e,s);return u===null||typeof r<"u"&&r!==e&&(u=wr(d,a,r,u,s),u===null)?!1:xl(Array.from(d),[""],l,r,()=>zA(t,e,s))}function wr(o,t,e,s,l){for(;e;)e=AA(o,t,e,s,l);return e}function zA(o,t,e){const s=o._getTarget();t in s||(s[t]={});const l=s[t];return Ce(l)&&te(e)?e:l||{}}function jA(o,t,e,s){let l;for(const r of t)if(l=bc($A(r,o),e),typeof l<"u")return yl(o,l)?wl(e,s,o,l):l}function bc(o,t){for(const e of t){if(!e)continue;const s=e[o];if(typeof s<"u")return s}}function kr(o){let t=o._keys;return t||(t=o._keys=TA(o._scopes)),t}function TA(o){const t=new Set;for(const e of o)for(const s of Object.keys(e).filter(l=>!l.startsWith("_")))t.add(s);return Array.from(t)}const PA=Number.EPSILON||1e-14,Hs=(o,t)=>t<o.length&&!o[t].skip&&o[t],xc=o=>o==="x"?"y":"x";function LA(o,t,e,s){const l=o.skip?t:o,r=t,a=e.skip?t:e,d=Ki(r,l),u=Ki(a,r);let h=d/(d+u),_=u/(d+u);h=isNaN(h)?0:h,_=isNaN(_)?0:_;const m=s*h,x=s*_;return{previous:{x:r.x-m*(a.x-l.x),y:r.y-m*(a.y-l.y)},next:{x:r.x+x*(a.x-l.x),y:r.y+x*(a.y-l.y)}}}function RA(o,t,e){const s=o.length;let l,r,a,d,u,h=Hs(o,0);for(let _=0;_<s-1;++_)if(u=h,h=Hs(o,_+1),!(!u||!h)){if(an(t[_],0,PA)){e[_]=e[_+1]=0;continue}l=e[_]/t[_],r=e[_+1]/t[_],d=Math.pow(l,2)+Math.pow(r,2),!(d<=9)&&(a=3/Math.sqrt(d),e[_]=l*a*t[_],e[_+1]=r*a*t[_])}}function OA(o,t,e="x"){const s=xc(e),l=o.length;let r,a,d,u=Hs(o,0);for(let h=0;h<l;++h){if(a=d,d=u,u=Hs(o,h+1),!d)continue;const _=d[e],m=d[s];a&&(r=(_-a[e])/3,d[`cp1${e}`]=_-r,d[`cp1${s}`]=m-r*t[h]),u&&(r=(u[e]-_)/3,d[`cp2${e}`]=_+r,d[`cp2${s}`]=m+r*t[h])}}function BA(o,t="x"){const e=xc(t),s=o.length,l=Array(s).fill(0),r=Array(s);let a,d,u,h=Hs(o,0);for(a=0;a<s;++a)if(d=u,u=h,h=Hs(o,a+1),!!u){if(h){const _=h[t]-u[t];l[a]=_!==0?(h[e]-u[e])/_:0}r[a]=d?h?Is(l[a-1])!==Is(l[a])?0:(l[a-1]+l[a])/2:l[a-1]:l[a]}RA(o,l,r),OA(o,r,t)}function Rn(o,t,e){return Math.max(Math.min(o,e),t)}function EA(o,t){let e,s,l,r,a,d=mn(o[0],t);for(e=0,s=o.length;e<s;++e)a=r,r=d,d=e<s-1&&mn(o[e+1],t),r&&(l=o[e],a&&(l.cp1x=Rn(l.cp1x,t.left,t.right),l.cp1y=Rn(l.cp1y,t.top,t.bottom)),d&&(l.cp2x=Rn(l.cp2x,t.left,t.right),l.cp2y=Rn(l.cp2y,t.top,t.bottom)))}function FA(o,t,e,s,l){let r,a,d,u;if(t.spanGaps&&(o=o.filter(h=>!h.skip)),t.cubicInterpolationMode==="monotone")BA(o,l);else{let h=s?o[o.length-1]:o[0];for(r=0,a=o.length;r<a;++r)d=o[r],u=LA(h,d,o[Math.min(r+1,a-(s?0:1))%a],t.tension),d.cp1x=u.previous.x,d.cp1y=u.previous.y,d.cp2x=u.next.x,d.cp2y=u.next.y,h=d}t.capBezierPoints&&EA(o,e)}function kl(){return typeof window<"u"&&typeof document<"u"}function $l(o){let t=o.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ei(o,t,e){let s;return typeof o=="string"?(s=parseInt(o,10),o.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=o,s}const di=o=>o.ownerDocument.defaultView.getComputedStyle(o,null);function IA(o,t){return di(o).getPropertyValue(t)}const NA=["top","right","bottom","left"];function xs(o,t,e){const s={};e=e?"-"+e:"";for(let l=0;l<4;l++){const r=NA[l];s[r]=parseFloat(o[t+"-"+r+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const HA=(o,t,e)=>(o>0||t>0)&&(!e||!e.shadowRoot);function VA(o,t){const e=o.touches,s=e&&e.length?e[0]:o,{offsetX:l,offsetY:r}=s;let a=!1,d,u;if(HA(l,r,o.target))d=l,u=r;else{const h=t.getBoundingClientRect();d=s.clientX-h.left,u=s.clientY-h.top,a=!0}return{x:d,y:u,box:a}}function ms(o,t){if("native"in o)return o;const{canvas:e,currentDevicePixelRatio:s}=t,l=di(e),r=l.boxSizing==="border-box",a=xs(l,"padding"),d=xs(l,"border","width"),{x:u,y:h,box:_}=VA(o,e),m=a.left+(_&&d.left),x=a.top+(_&&d.top);let{width:$,height:S}=t;return r&&($-=a.width+d.width,S-=a.height+d.height),{x:Math.round((u-m)/$*e.width/s),y:Math.round((h-x)/S*e.height/s)}}function WA(o,t,e){let s,l;if(t===void 0||e===void 0){const r=o&&$l(o);if(!r)t=o.clientWidth,e=o.clientHeight;else{const a=r.getBoundingClientRect(),d=di(r),u=xs(d,"border","width"),h=xs(d,"padding");t=a.width-h.width-u.width,e=a.height-h.height-u.height,s=ei(d.maxWidth,r,"clientWidth"),l=ei(d.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:s||ti,maxHeight:l||ti}}const ns=o=>Math.round(o*10)/10;function UA(o,t,e,s){const l=di(o),r=xs(l,"margin"),a=ei(l.maxWidth,o,"clientWidth")||ti,d=ei(l.maxHeight,o,"clientHeight")||ti,u=WA(o,t,e);let{width:h,height:_}=u;if(l.boxSizing==="content-box"){const x=xs(l,"border","width"),$=xs(l,"padding");h-=$.width+x.width,_-=$.height+x.height}return h=Math.max(0,h-r.width),_=Math.max(0,s?h/s:_-r.height),h=ns(Math.min(h,a,u.maxWidth)),_=ns(Math.min(_,d,u.maxHeight)),h&&!_&&(_=ns(h/2)),(t!==void 0||e!==void 0)&&s&&u.height&&_>u.height&&(_=u.height,h=ns(Math.floor(_*s))),{width:h,height:_}}function $r(o,t,e){const s=t||1,l=ns(o.height*s),r=ns(o.width*s);o.height=ns(o.height),o.width=ns(o.width);const a=o.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${o.height}px`,a.style.width=`${o.width}px`),o.currentDevicePixelRatio!==s||a.height!==l||a.width!==r?(o.currentDevicePixelRatio=s,a.height=l,a.width=r,o.ctx.setTransform(s,0,0,s,0,0),!0):!1}const YA=(function(){let o=!1;try{const t={get passive(){return o=!0,!1}};kl()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return o})();function Cr(o,t){const e=IA(o,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function vs(o,t,e,s){return{x:o.x+e*(t.x-o.x),y:o.y+e*(t.y-o.y)}}function qA(o,t,e,s){return{x:o.x+e*(t.x-o.x),y:s==="middle"?e<.5?o.y:t.y:s==="after"?e<1?o.y:t.y:e>0?t.y:o.y}}function ZA(o,t,e,s){const l={x:o.cp2x,y:o.cp2y},r={x:t.cp1x,y:t.cp1y},a=vs(o,l,e),d=vs(l,r,e),u=vs(r,t,e),h=vs(a,d,e),_=vs(d,u,e);return vs(h,_,e)}const XA=function(o,t){return{x(e){return o+o+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},KA=function(){return{x(o){return o},setWidth(o){},textAlign(o){return o},xPlus(o,t){return o+t},leftForLtr(o,t){return o}}};function Os(o,t,e){return o?XA(t,e):KA()}function yc(o,t){let e,s;(t==="ltr"||t==="rtl")&&(e=o.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),o.prevTextDirection=s)}function wc(o,t){t!==void 0&&(delete o.prevTextDirection,o.canvas.style.setProperty("direction",t[0],t[1]))}function kc(o){return o==="angle"?{between:ac,compare:qD,normalize:Do}:{between:Ps,compare:(t,e)=>t-e,normalize:t=>t}}function Mr({start:o,end:t,count:e,loop:s,style:l}){return{start:o%e,end:t%e,loop:s&&(t-o+1)%e===0,style:l}}function GA(o,t,e){const{property:s,start:l,end:r}=e,{between:a,normalize:d}=kc(s),u=t.length;let{start:h,end:_,loop:m}=o,x,$;if(m){for(h+=u,_+=u,x=0,$=u;x<$&&a(d(t[h%u][s]),l,r);++x)h--,_--;h%=u,_%=u}return _<h&&(_+=u),{start:h,end:_,loop:m,style:o.style}}function $c(o,t,e){if(!e)return[o];const{property:s,start:l,end:r}=e,a=t.length,{compare:d,between:u,normalize:h}=kc(s),{start:_,end:m,loop:x,style:$}=GA(o,t,e),S=[];let v=!1,M=null,w,I,O;const tt=()=>u(l,O,w)&&d(l,O)!==0,G=()=>d(r,w)===0||u(r,O,w),Y=()=>v||tt(),et=()=>!v||G();for(let ht=_,ct=_;ht<=m;++ht)I=t[ht%a],!I.skip&&(w=h(I[s]),w!==O&&(v=u(w,l,r),M===null&&Y()&&(M=d(w,l)===0?ht:ct),M!==null&&et()&&(S.push(Mr({start:M,end:ht,loop:x,count:a,style:$})),M=null),ct=ht,O=w));return M!==null&&S.push(Mr({start:M,end:m,loop:x,count:a,style:$})),S}function Cc(o,t){const e=[],s=o.segments;for(let l=0;l<s.length;l++){const r=$c(s[l],o.points,t);r.length&&e.push(...r)}return e}function QA(o,t,e,s){let l=0,r=t-1;if(e&&!s)for(;l<t&&!o[l].skip;)l++;for(;l<t&&o[l].skip;)l++;for(l%=t,e&&(r+=l);r>l&&o[r%t].skip;)r--;return r%=t,{start:l,end:r}}function JA(o,t,e,s){const l=o.length,r=[];let a=t,d=o[t],u;for(u=t+1;u<=e;++u){const h=o[u%l];h.skip||h.stop?d.skip||(s=!1,r.push({start:t%l,end:(u-1)%l,loop:s}),t=a=h.stop?u:null):(a=u,d.skip&&(t=u)),d=h}return a!==null&&r.push({start:t%l,end:a%l,loop:s}),r}function tz(o,t){const e=o.points,s=o.options.spanGaps,l=e.length;if(!l)return[];const r=!!o._loop,{start:a,end:d}=QA(e,l,r,s);if(s===!0)return Sr(o,[{start:a,end:d,loop:r}],e,t);const u=d<a?d+l:d,h=!!o._fullLoop&&a===0&&d===l-1;return Sr(o,JA(e,a,u,h),e,t)}function Sr(o,t,e,s){return!s||!s.setContext||!e?t:ez(o,t,e,s)}function ez(o,t,e,s){const l=o._chart.getContext(),r=Dr(o.options),{_datasetIndex:a,options:{spanGaps:d}}=o,u=e.length,h=[];let _=r,m=t[0].start,x=m;function $(S,v,M,w){const I=d?-1:1;if(S!==v){for(S+=u;e[S%u].skip;)S-=I;for(;e[v%u].skip;)v+=I;S%u!==v%u&&(h.push({start:S%u,end:v%u,loop:M,style:w}),_=w,m=v%u)}}for(const S of t){m=d?m:S.start;let v=e[m%u],M;for(x=m+1;x<=S.end;x++){const w=e[x%u];M=Dr(s.setContext(ks(l,{type:"segment",p0:v,p1:w,p0DataIndex:(x-1)%u,p1DataIndex:x%u,datasetIndex:a}))),oz(M,_)&&$(m,x-1,S.loop,_),v=w,_=M}m<x-1&&$(m,x-1,S.loop,_)}return h}function Dr(o){return{backgroundColor:o.backgroundColor,borderCapStyle:o.borderCapStyle,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderJoinStyle:o.borderJoinStyle,borderWidth:o.borderWidth,borderColor:o.borderColor}}function oz(o,t){if(!t)return!1;const e=[],s=function(l,r){return bl(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(o,s)!==JSON.stringify(t,s)}function On(o,t,e){return o.options.clip?o[e]:t[e]}function sz(o,t){const{xScale:e,yScale:s}=o;return e&&s?{left:On(e,t,"left"),right:On(e,t,"right"),top:On(s,t,"top"),bottom:On(s,t,"bottom")}:t}function Mc(o,t){const e=t._clip;if(e.disabled)return!1;const s=sz(t,o.chartArea);return{left:e.left===!1?0:s.left-(e.left===!0?0:e.left),right:e.right===!1?o.width:s.right+(e.right===!0?0:e.right),top:e.top===!1?0:s.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?o.height:s.bottom+(e.bottom===!0?0:e.bottom)}}class nz{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,l){const r=e.listeners[l],a=e.duration;r.forEach(d=>d({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=dc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,l)=>{if(!s.running||!s.items.length)return;const r=s.items;let a=r.length-1,d=!1,u;for(;a>=0;--a)u=r[a],u._active?(u._total>s.duration&&(s.duration=u._total),u.tick(t),d=!0):(r[a]=r[r.length-1],r.pop());d&&(l.draw(),this._notify(l,s,t,"progress")),r.length||(s.running=!1,this._notify(l,s,t,"complete"),s.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,l)=>Math.max(s,l._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let l=s.length-1;for(;l>=0;--l)s[l].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ho=new nz;const Ar="transparent",iz={boolean(o,t,e){return e>.5?t:o},color(o,t,e){const s=gr(o||Ar),l=s.valid&&gr(t||Ar);return l&&l.valid?l.mix(s,e).hexString():t},number(o,t,e){return o+(t-o)*e}};class lz{constructor(t,e,s,l){const r=e[s];l=Ln([t.to,l,r,t.from]);const a=Ln([t.from,r,l]);this._active=!0,this._fn=t.fn||iz[t.type||typeof a],this._easing=cn[t.easing]||cn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=l,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const l=this._target[this._prop],r=s-this._start,a=this._duration-r;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ln([t.to,e,l,t.from]),this._from=Ln([t.from,l,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,l=this._prop,r=this._from,a=this._loop,d=this._to;let u;if(this._active=r!==d&&(a||e<s),!this._active){this._target[l]=d,this._notify(!0);return}if(e<0){this._target[l]=r;return}u=e/s%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[l]=this._fn(r,d,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let l=0;l<s.length;l++)s[l][e]()}}class Sc{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!te(t))return;const e=Object.keys(ye.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(l=>{const r=t[l];if(!te(r))return;const a={};for(const d of e)a[d]=r[d];(Ce(r.properties)&&r.properties||[l]).forEach(d=>{(d===l||!s.has(d))&&s.set(d,a)})})}_animateOptions(t,e){const s=e.options,l=az(t,s);if(!l)return[];const r=this._createAnimations(l,s);return s.$shared&&rz(t.options.$animations,s).then(()=>{t.options=s},()=>{}),r}_createAnimations(t,e){const s=this._properties,l=[],r=t.$animations||(t.$animations={}),a=Object.keys(e),d=Date.now();let u;for(u=a.length-1;u>=0;--u){const h=a[u];if(h.charAt(0)==="$")continue;if(h==="options"){l.push(...this._animateOptions(t,e));continue}const _=e[h];let m=r[h];const x=s.get(h);if(m)if(x&&m.active()){m.update(x,_,d);continue}else m.cancel();if(!x||!x.duration){t[h]=_;continue}r[h]=m=new lz(x,t,h,_),l.push(m)}return l}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Ho.add(this._chart,s),!0}}function rz(o,t){const e=[],s=Object.keys(t);for(let l=0;l<s.length;l++){const r=o[s[l]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function az(o,t){if(!t)return;let e=o.options;if(!e){o.options=t;return}return e.$shared&&(o.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function zr(o,t){const e=o&&o.options||{},s=e.reverse,l=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:s?r:l,end:s?l:r}}function cz(o,t,e){if(e===!1)return!1;const s=zr(o,e),l=zr(t,e);return{top:l.end,right:s.end,bottom:l.start,left:s.start}}function dz(o){let t,e,s,l;return te(o)?(t=o.top,e=o.right,s=o.bottom,l=o.left):t=e=s=l=o,{top:t,right:e,bottom:s,left:l,disabled:o===!1}}function Dc(o,t){const e=[],s=o._getSortedDatasetMetas(t);let l,r;for(l=0,r=s.length;l<r;++l)e.push(s[l].index);return e}function jr(o,t,e,s={}){const l=o.keys,r=s.mode==="single";let a,d,u,h;if(t===null)return;let _=!1;for(a=0,d=l.length;a<d;++a){if(u=+l[a],u===e){if(_=!0,s.all)continue;break}h=o.values[u],Re(h)&&(r||t===0||Is(t)===Is(h))&&(t+=h)}return!_&&!s.all?0:t}function uz(o,t){const{iScale:e,vScale:s}=t,l=e.axis==="x"?"x":"y",r=s.axis==="x"?"x":"y",a=Object.keys(o),d=new Array(a.length);let u,h,_;for(u=0,h=a.length;u<h;++u)_=a[u],d[u]={[l]:_,[r]:o[_]};return d}function ji(o,t){const e=o&&o.options.stacked;return e||e===void 0&&t.stack!==void 0}function hz(o,t,e){return`${o.id}.${t.id}.${e.stack||e.type}`}function pz(o){const{min:t,max:e,minDefined:s,maxDefined:l}=o.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:l?e:Number.POSITIVE_INFINITY}}function fz(o,t,e){const s=o[t]||(o[t]={});return s[e]||(s[e]={})}function Tr(o,t,e,s){for(const l of t.getMatchingVisibleMetas(s).reverse()){const r=o[l.index];if(e&&r>0||!e&&r<0)return l.index}return null}function Pr(o,t){const{chart:e,_cachedMeta:s}=o,l=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:d}=s,u=r.axis,h=a.axis,_=hz(r,a,s),m=t.length;let x;for(let $=0;$<m;++$){const S=t[$],{[u]:v,[h]:M}=S,w=S._stacks||(S._stacks={});x=w[h]=fz(l,_,v),x[d]=M,x._top=Tr(x,a,!0,s.type),x._bottom=Tr(x,a,!1,s.type);const I=x._visualValues||(x._visualValues={});I[d]=M}}function Ti(o,t){const e=o.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function _z(o,t){return ks(o,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function mz(o,t,e){return ks(o,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Xs(o,t){const e=o.controller.index,s=o.vScale&&o.vScale.axis;if(s){t=t||o._parsed;for(const l of t){const r=l._stacks;if(!r||r[s]===void 0||r[s][e]===void 0)return;delete r[s][e],r[s]._visualValues!==void 0&&r[s]._visualValues[e]!==void 0&&delete r[s]._visualValues[e]}}}const Pi=o=>o==="reset"||o==="none",Lr=(o,t)=>t?o:Object.assign({},o),vz=(o,t,e)=>o&&!t.hidden&&t._stacked&&{keys:Dc(e,!0),values:null};class Ac{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ji(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Xs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),l=(m,x,$,S)=>m==="x"?x:m==="r"?S:$,r=e.xAxisID=Gt(s.xAxisID,Ti(t,"x")),a=e.yAxisID=Gt(s.yAxisID,Ti(t,"y")),d=e.rAxisID=Gt(s.rAxisID,Ti(t,"r")),u=e.indexAxis,h=e.iAxisID=l(u,r,a,d),_=e.vAxisID=l(u,a,r,d);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(d),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(_)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_r(this._data,this),t._stacked&&Xs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(te(e)){const l=this._cachedMeta;this._data=uz(e,l)}else if(s!==e){if(s){_r(s,this);const l=this._cachedMeta;Xs(l),l._parsed=[]}e&&Object.isExtensible(e)&&GD(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let l=!1;this._dataCheck();const r=e._stacked;e._stacked=ji(e.vScale,e),e.stack!==s.stack&&(l=!0,Xs(e),e.stack=s.stack),this._resyncElements(t),(l||r!==e._stacked)&&(Pr(this,e._parsed),e._stacked=ji(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:l}=this,{iScale:r,_stacked:a}=s,d=r.axis;let u=t===0&&e===l.length?!0:s._sorted,h=t>0&&s._parsed[t-1],_,m,x;if(this._parsing===!1)s._parsed=l,s._sorted=!0,x=l;else{Ce(l[t])?x=this.parseArrayData(s,l,t,e):te(l[t])?x=this.parseObjectData(s,l,t,e):x=this.parsePrimitiveData(s,l,t,e);const $=()=>m[d]===null||h&&m[d]<h[d];for(_=0;_<e;++_)s._parsed[_+t]=m=x[_],u&&($()&&(u=!1),h=m);s._sorted=u}a&&Pr(this,x)}parsePrimitiveData(t,e,s,l){const{iScale:r,vScale:a}=t,d=r.axis,u=a.axis,h=r.getLabels(),_=r===a,m=new Array(l);let x,$,S;for(x=0,$=l;x<$;++x)S=x+s,m[x]={[d]:_||r.parse(h[S],S),[u]:a.parse(e[S],S)};return m}parseArrayData(t,e,s,l){const{xScale:r,yScale:a}=t,d=new Array(l);let u,h,_,m;for(u=0,h=l;u<h;++u)_=u+s,m=e[_],d[u]={x:r.parse(m[0],_),y:a.parse(m[1],_)};return d}parseObjectData(t,e,s,l){const{xScale:r,yScale:a}=t,{xAxisKey:d="x",yAxisKey:u="y"}=this._parsing,h=new Array(l);let _,m,x,$;for(_=0,m=l;_<m;++_)x=_+s,$=e[x],h[_]={x:r.parse(Qn($,d),x),y:a.parse(Qn($,u),x)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const l=this.chart,r=this._cachedMeta,a=e[t.axis],d={keys:Dc(l,!0),values:e._stacks[t.axis]._visualValues};return jr(d,a,r.index,{mode:s})}updateRangeFromParsed(t,e,s,l){const r=s[e.axis];let a=r===null?NaN:r;const d=l&&s._stacks[e.axis];l&&d&&(l.values=d,a=jr(l,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,l=s._parsed,r=s._sorted&&t===s.iScale,a=l.length,d=this._getOtherScale(t),u=vz(e,s,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:_,max:m}=pz(d);let x,$;function S(){$=l[x];const v=$[d.axis];return!Re($[t.axis])||_>v||m<v}for(x=0;x<a&&!(!S()&&(this.updateRangeFromParsed(h,t,$,u),r));++x);if(r){for(x=a-1;x>=0;--x)if(!S()){this.updateRangeFromParsed(h,t,$,u);break}}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let l,r,a;for(l=0,r=e.length;l<r;++l)a=e[l][t.axis],Re(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,l=e.vScale,r=this.getParsed(t);return{label:s?""+s.getLabelForValue(r[s.axis]):"",value:l?""+l.getLabelForValue(r[l.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=dz(Gt(this.options.clip,cz(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,l=s.data||[],r=e.chartArea,a=[],d=this._drawStart||0,u=this._drawCount||l.length-d,h=this.options.drawActiveElementsOnTop;let _;for(s.dataset&&s.dataset.draw(t,r,d,u),_=d;_<d+u;++_){const m=l[_];m.hidden||(m.active&&h?a.push(m):m.draw(t,r))}for(_=0;_<a.length;++_)a[_].draw(t,r)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const l=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];r=a.$context||(a.$context=mz(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=l.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=_z(this.chart.getContext(),this.index)),r.dataset=l,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=s,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const l=e==="active",r=this._cachedDataOpts,a=t+"-"+e,d=r[a],u=this.enableOptionSharing&&Jn(s);if(d)return Lr(d,u);const h=this.chart.config,_=h.datasetElementScopeKeys(this._type,t),m=l?[`${t}Hover`,"hover",t,""]:[t,""],x=h.getOptionScopes(this.getDataset(),_),$=Object.keys(ye.elements[t]),S=()=>this.getContext(s,l,e),v=h.resolveNamedOptions(x,$,S,m);return v.$shared&&(v.$shared=u,r[a]=Object.freeze(Lr(v,u))),v}_resolveAnimations(t,e,s){const l=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,d=r[a];if(d)return d;let u;if(l.options.animation!==!1){const _=this.chart.config,m=_.datasetAnimationScopeKeys(this._type,e),x=_.getOptionScopes(this.getDataset(),m);u=_.createResolver(x,this.getContext(t,s,e))}const h=new Sc(l,u&&u.animations);return u&&u._cacheable&&(r[a]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Pi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),l=this._sharedOptions,r=this.getSharedOptions(s),a=this.includeOptions(e,r)||r!==l;return this.updateSharedOptions(r,e,s),{sharedOptions:r,includeOptions:a}}updateElement(t,e,s,l){Pi(l)?Object.assign(t,s):this._resolveAnimations(e,l).update(t,s)}updateSharedOptions(t,e,s){t&&!Pi(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,l){t.active=l;const r=this.getStyle(e,l);
vendor: 4,461 bytes, line 27
27this._resolveAnimations(e,s,l).update(t,{options:!l&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[d,u,h]of this._syncList)this[d](u,h);this._syncList=[];const l=s.length,r=e.length,a=Math.min(r,l);a&&this.parse(0,a),r>l?this._insertElements(l,r-l,t):r<l&&this._removeElements(r,l-r)}_insertElements(t,e,s=!0){const l=this._cachedMeta,r=l.data,a=t+e;let d;const u=h=>{for(h.length+=e,d=h.length-1;d>=a;d--)h[d]=h[d-e]};for(u(r),d=t;d<a;++d)r[d]=new this.dataElementType;this._parsing&&u(l._parsed),this.parse(t,e),s&&this.updateElements(r,t,e,"reset")}updateElements(t,e,s,l){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const l=s._parsed.splice(t,e);s._stacked&&Xs(s,l)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,l]=t;this[e](s,l)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class gz extends Ac{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:l=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:d,count:u}=eA(e,l,a);this._drawStart=d,this._drawCount=u,oA(e)&&(d=0,u=l.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!r._decimated,s.points=l;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:h},t),this.updateElements(l,d,u,t)}updateElements(t,e,s,l){const r=l==="reset",{iScale:a,vScale:d,_stacked:u,_dataset:h}=this._cachedMeta,{sharedOptions:_,includeOptions:m}=this._getSharedOptions(e,l),x=a.axis,$=d.axis,{spanGaps:S,segment:v}=this.options,M=_n(S)?S:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||r||l==="none",I=e+s,O=t.length;let tt=e>0&&this.getParsed(e-1);for(let G=0;G<O;++G){const Y=t[G],et=w?Y:{};if(G<e||G>=I){et.skip=!0;continue}const ht=this.getParsed(G),ct=fe(ht[$]),dt=et[x]=a.getPixelForValue(ht[x],G),pt=et[$]=r||ct?d.getBasePixel():d.getPixelForValue(u?this.applyStack(d,ht,u):ht[$],G);et.skip=isNaN(dt)||isNaN(pt)||ct,et.stop=G>0&&Math.abs(ht[x]-tt[x])>M,v&&(et.parsed=ht,et.raw=h.data[G]),m&&(et.options=_||this.resolveDataElementOptions(G,Y.active?"active":l)),w||this.updateElement(Y,G,et,l),tt=ht}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,l=t.data||[];if(!l.length)return s;const r=l[0].size(this.resolveDataElementOptions(0)),a=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(s,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function _s(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Cl{static override(t){Object.assign(Cl.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return _s()}parse(){return _s()}format(){return _s()}add(){return _s()}diff(){return _s()}startOf(){return _s()}endOf(){return _s()}}var bz={_date:Cl};function xz(o,t,e,s){const{controller:l,data:r,_sorted:a}=o,d=l._cachedMeta.iScale,u=o.dataset&&o.dataset.options?o.dataset.options.spanGaps:null;if(d&&t===d.axis&&t!=="r"&&a&&r.length){const h=d._reversePixels?XD:bs;if(s){if(l._sharedOptions){const _=r[0],m=typeof _.getRange=="function"&&_.getRange(t);if(m){const x=h(r,t,e-m),$=h(r,t,e+m);return{lo:x.lo,hi:$.hi}}}}else{const _=h(r,t,e);if(u){const{vScale:m}=l._cachedMeta,{_parsed:x}=o,$=x.slice(0,_.lo+1).reverse().findIndex(v=>
vendor: 4,223 bytes, line 27
27!fe(v[m.axis]));_.lo-=Math.max(0,$);const S=x.slice(_.hi).findIndex(v=>!fe(v[m.axis]));_.hi+=Math.max(0,S)}return _}}return{lo:0,hi:r.length-1}}function ui(o,t,e,s,l){const r=o.getSortedVisibleDatasetMetas(),a=e[t];for(let d=0,u=r.length;d<u;++d){const{index:h,data:_}=r[d],{lo:m,hi:x}=xz(r[d],t,a,l);for(let $=m;$<=x;++$){const S=_[$];S.skip||s(S,h,$)}}}function yz(o){const t=o.indexOf("x")!==-1,e=o.indexOf("y")!==-1;return function(s,l){const r=t?Math.abs(s.x-l.x):0,a=e?Math.abs(s.y-l.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function Li(o,t,e,s,l){const r=[];return!l&&!o.isPointInArea(t)||ui(o,e,t,function(d,u,h){!l&&!mn(d,o.chartArea,0)||d.inRange(t.x,t.y,s)&&r.push({element:d,datasetIndex:u,index:h})},!0),r}function wz(o,t,e,s){let l=[];function r(a,d,u){const{startAngle:h,endAngle:_}=a.getProps(["startAngle","endAngle"],s),{angle:m}=YD(a,{x:t.x,y:t.y});ac(m,h,_)&&l.push({element:a,datasetIndex:d,index:u})}return ui(o,e,t,r),l}function kz(o,t,e,s,l,r){let a=[];const d=yz(e);let u=Number.POSITIVE_INFINITY;function h(_,m,x){const $=_.inRange(t.x,t.y,l);if(s&&!$)return;const S=_.getCenterPoint(l);if(!(!!r||o.isPointInArea(S))&&!$)return;const M=d(t,S);M<u?(a=[{element:_,datasetIndex:m,index:x}],u=M):M===u&&a.push({element:_,datasetIndex:m,index:x})}return ui(o,e,t,h),a}function Ri(o,t,e,s,l,r){return!r&&!o.isPointInArea(t)?[]:e==="r"&&!s?wz(o,t,e,l):kz(o,t,e,s,l,r)}function Rr(o,t,e,s,l){const r=[],a=e==="x"?"inXRange":"inYRange";let d=!1;return ui(o,e,t,(u,h,_)=>{u[a]&&u[a](t[e],l)&&(r.push({element:u,datasetIndex:h,index:_}),d=d||u.inRange(t.x,t.y,l))}),s&&!d?[]:r}var $z={modes:{index(o,t,e,s){const l=ms(t,o),r=e.axis||"x",a=e.includeInvisible||!1,d=e.intersect?Li(o,l,r,s,a):Ri(o,l,r,!1,s,a),u=[];return d.length?(o.getSortedVisibleDatasetMetas().forEach(h=>{const _=d[0].index,m=h.data[_];m&&!m.skip&&u.push({element:m,datasetIndex:h.index,index:_})}),u):[]},dataset(o,t,e,s){const l=ms(t,o),r=e.axis||"xy",a=e.includeInvisible||!1;let d=e.intersect?Li(o,l,r,s,a):Ri(o,l,r,!1,s,a);if(d.length>0){const u=d[0].datasetIndex,h=o.getDatasetMeta(u).data;d=[];for(let _=0;_<h.length;++_)d.push({element:h[_],datasetIndex:u,index:_})}return d},point(o,t,e,s){const l=ms(t,o),r=e.axis||"xy",a=e.includeInvisible||!1;return Li(o,l,r,s,a)},nearest(o,t,e,s){const l=ms(t,o),r=e.axis||"xy",a=e.includeInvisible||!1;return Ri(o,l,r,e.intersect,s,a)},x(o,t,e,s){const l=ms(t,o);return Rr(o,l,"x",e.intersect,s)},y(o,t,e,s){const l=ms(t,o);return Rr(o,l,"y",e.intersect,s)}}};const zc=["left","top","right","bottom"];function Ks(o,t){return o.filter(e=>e.pos===t)}function Or(o,t){return o.filter(e=>zc.indexOf(e.pos)===-1&&e.box.axis===t)}function Gs(o,t){return o.sort((e,s)=>{const l=t?s:e,r=t?e:s;return l.weight===r.weight?l.index-r.index:l.weight-r.weight})}function Cz(o){const t=[];let e,s,l,r,a,d;for(e=0,s=(o||[]).length;e<s;++e)l=o[e],{position:r,options:{stack:a,stackWeight:d=1}}=l,t.push({index:e,box:l,pos:r,horizontal:l.isHorizontal(),weight:l.weight,stack:a&&r+a,stackWeight:d});return t}function Mz(o){const t={};for(const e of o){const{stack:s,pos:l,stackWeight:r}=e;if(!s||!zc.includes(l))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return t}function Sz(o,t){const e=Mz(o),{vBoxMaxWidth:s,hBoxMaxHeight:l}=t;let r,a,d;for(r=0,a=o.length;r<a;++r){d=o[r];const{fullSize:u}=d.box,h=e[d.stack],_=h&&d.stackWeight/h.weight;d.horizontal?(d.width=_?_*s:u&&t.availableWidth,d.height=l):(d.width=s,d.height=_?_*l:u&&t.availableHeight)}return e}function Dz(o){const t=Cz(o),e=Gs(t.filter(h=>h.box.fullSize),!0),s=Gs(Ks(t,"left"),!0),l=Gs(Ks(t,"right")),r=Gs(Ks(t,"top"),!0),a=Gs(Ks(t,"bottom")),d=Or(t,"x"),u=Or(t,"y");return{fullSize:e,leftAndTop:s.concat(r),rightAndBottom:l.concat(u).concat(a).concat(d),chartArea:Ks(t,"chartArea"),vertical:s.concat(l).concat(u),horizontal:r.concat(a).concat(d)}}function Br(o,t,e,s){return Math.max(o[e],t[e])+Math.max(o[s],t[s])}function jc(o,t){o.top=Math.max(o.top,t.top),o.left=Math.max(o.left,t.left),o.bottom=Math.max(o.bottom,t.bottom),o.right=Math.max(o.right,t.right)}function Az(o,t,e,s){const{pos:l,box:r}=e,a=o.maxPadding;if(!te(l)){e.size&&(o[l]-=e.size);const m=s[e.stack]||{size:0,count:1};
vendor: 4,702 bytes, line 27
27m.size=Math.max(m.size,e.horizontal?r.height:r.width),e.size=m.size/m.count,o[l]+=e.size}r.getPadding&&jc(a,r.getPadding());const d=Math.max(0,t.outerWidth-Br(a,o,"left","right")),u=Math.max(0,t.outerHeight-Br(a,o,"top","bottom")),h=d!==o.w,_=u!==o.h;return o.w=d,o.h=u,e.horizontal?{same:h,other:_}:{same:_,other:h}}function zz(o){const t=o.maxPadding;function e(s){const l=Math.max(t[s]-o[s],0);return o[s]+=l,l}o.y+=e("top"),o.x+=e("left"),e("right"),e("bottom")}function jz(o,t){const e=t.maxPadding;function s(l){const r={left:0,top:0,right:0,bottom:0};return l.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return s(o?["left","right"]:["top","bottom"])}function on(o,t,e,s){const l=[];let r,a,d,u,h,_;for(r=0,a=o.length,h=0;r<a;++r){d=o[r],u=d.box,u.update(d.width||t.w,d.height||t.h,jz(d.horizontal,t));const{same:m,other:x}=Az(t,e,d,s);h|=m&&l.length,_=_||x,u.fullSize||l.push(d)}return h&&on(l,t,e,s)||_}function Bn(o,t,e,s,l){o.top=e,o.left=t,o.right=t+s,o.bottom=e+l,o.width=s,o.height=l}function Er(o,t,e,s){const l=e.padding;let{x:r,y:a}=t;for(const d of o){const u=d.box,h=s[d.stack]||{placed:0,weight:1},_=d.stackWeight/h.weight||1;if(d.horizontal){const m=t.w*_,x=h.size||u.height;Jn(h.start)&&(a=h.start),u.fullSize?Bn(u,l.left,a,e.outerWidth-l.right-l.left,x):Bn(u,t.left+h.placed,a,m,x),h.start=a,h.placed+=m,a=u.bottom}else{const m=t.h*_,x=h.size||u.width;Jn(h.start)&&(r=h.start),u.fullSize?Bn(u,r,l.top,x,e.outerHeight-l.bottom-l.top):Bn(u,r,t.top+h.placed,x,m),h.start=r,h.placed+=m,r=u.right}}t.x=r,t.y=a}var so={addBox(o,t){o.boxes||(o.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},o.boxes.push(t)},removeBox(o,t){const e=o.boxes?o.boxes.indexOf(t):-1;e!==-1&&o.boxes.splice(e,1)},configure(o,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(o,t,e,s){if(!o)return;const l=io(o.options.layout.padding),r=Math.max(t-l.width,0),a=Math.max(e-l.height,0),d=Dz(o.boxes),u=d.vertical,h=d.horizontal;ue(o.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const _=u.reduce((v,M)=>M.box.options&&M.box.options.display===!1?v:v+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:e,padding:l,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/_,hBoxMaxHeight:a/2}),x=Object.assign({},l);jc(x,io(s));const $=Object.assign({maxPadding:x,w:r,h:a,x:l.left,y:l.top},l),S=Sz(u.concat(h),m);on(d.fullSize,$,m,S),on(u,$,m,S),on(h,$,m,S)&&on(u,$,m,S),zz($),Er(d.leftAndTop,$,m,S),$.x+=$.w,$.y+=$.h,Er(d.rightAndBottom,$,m,S),o.chartArea={left:$.left,top:$.top,right:$.left+$.w,bottom:$.top+$.h,height:$.h,width:$.w},ue(d.chartArea,v=>{const M=v.box;Object.assign(M,o.chartArea),M.update($.w,$.h,{left:0,top:0,right:0,bottom:0})})}};class Tc{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,l){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,l?Math.floor(e/l):s)}}isAttached(t){return!0}updateConfig(t){}}class Tz extends Tc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Wn="$chartjs",Pz={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Fr=o=>o===null||o==="";function Lz(o,t){const e=o.style,s=o.getAttribute("height"),l=o.getAttribute("width");if(o[Wn]={initial:{height:s,width:l,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Fr(l)){const r=Cr(o,"width");r!==void 0&&(o.width=r)}if(Fr(s))if(o.style.height==="")o.height=o.width/(t||2);else{const r=Cr(o,"height");r!==void 0&&(o.height=r)}return o}const Pc=YA?{passive:!0}:!1;function Rz(o,t,e){o&&o.addEventListener(t,e,Pc)}function Oz(o,t,e){o&&o.canvas&&o.canvas.removeEventListener(t,e,Pc)}function Bz(o,t){const e=Pz[o.type]||o.type,{x:s,y:l}=ms(o,t);return{type:e,chart:t,native:o,x:s!==void 0?s:null,y:l!==void 0?l:null}}function oi(o,t){for(const e of o)if(e===t||e.contains(t))return!0}function Ez(o,t,e){const s=o.canvas,l=new MutationObserver(r=>{let a=!1;for(const d of r)a=a||oi(d.addedNodes,s),a=a&&!oi(d.removedNodes,s);a&&e()});return l.observe(document,{childList:!0,subtree:!0}),l}function Fz(o,t,e){const s=o.canvas,l=new MutationObserver(r=>{let a=!1;for(const d of r)a=a||oi(d.removedNodes,s),a=a&&!oi(d.addedNodes,s);a&&e()});return l.observe(document,{childList:!0,subtree:!0}),l}const gn=new Map;let Ir=0;function Lc(){const o=window.devicePixelRatio;
vendor: 2,888 bytes, line 27
27o!==Ir&&(Ir=o,gn.forEach((t,e)=>{e.currentDevicePixelRatio!==o&&t()}))}function Iz(o,t){gn.size||window.addEventListener("resize",Lc),gn.set(o,t)}function Nz(o){gn.delete(o),gn.size||window.removeEventListener("resize",Lc)}function Hz(o,t,e){const s=o.canvas,l=s&&$l(s);if(!l)return;const r=uc((d,u)=>{const h=l.clientWidth;e(d,u),h<l.clientWidth&&e()},window),a=new ResizeObserver(d=>{const u=d[0],h=u.contentRect.width,_=u.contentRect.height;h===0&&_===0||r(h,_)});return a.observe(l),Iz(o,r),a}function Oi(o,t,e){e&&e.disconnect(),t==="resize"&&Nz(o)}function Vz(o,t,e){const s=o.canvas,l=uc(r=>{o.ctx!==null&&e(Bz(r,o))},o);return Rz(s,t,l),l}class Wz extends Tc{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Lz(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[Wn])return!1;const s=e[Wn].initial;["height","width"].forEach(r=>{const a=s[r];fe(a)?e.removeAttribute(r):e.setAttribute(r,a)});const l=s.style||{};return Object.keys(l).forEach(r=>{e.style[r]=l[r]}),e.width=e.width,delete e[Wn],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const l=t.$proxies||(t.$proxies={}),a={attach:Ez,detach:Fz,resize:Hz}[e]||Vz;l[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),l=s[e];if(!l)return;({attach:Oi,detach:Oi,resize:Oi}[e]||Oz)(t,e,l),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,l){return UA(t,e,s,l)}isAttached(t){const e=t&&$l(t);return!!(e&&e.isConnected)}}function Uz(o){return!kl()||typeof OffscreenCanvas<"u"&&o instanceof OffscreenCanvas?Tz:Wz}class $s{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return _n(this.x)&&_n(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const l={};return t.forEach(r=>{l[r]=s[r]&&s[r].active()?s[r]._to:this[r]}),l}}function Yz(o,t){const e=o.options.ticks,s=qz(o),l=Math.min(e.maxTicksLimit||s,s),r=e.major.enabled?Xz(t):[],a=r.length,d=r[0],u=r[a-1],h=[];if(a>l)return Kz(t,h,r,a/l),h;const _=Zz(r,t,l);if(a>0){let m,x;const $=a>1?Math.round((u-d)/(a-1)):null;for(En(t,h,_,fe($)?0:d-$,d),m=0,x=a-1;m<x;m++)En(t,h,_,r[m],r[m+1]);return En(t,h,_,u,fe($)?t.length:u+$),h}return En(t,h,_),h}function qz(o){const t=o.options.offset,e=o._tickSize(),s=o._length/e+(t?0:1),l=o._maxLength/e;return Math.floor(Math.min(s,l))}function Zz(o,t,e){const s=Gz(o),l=t.length/e;if(!s)return Math.max(l,1);const r=ND(s);for(let a=0,d=r.length-1;a<d;a++){const u=r[a];if(u>l)return u}return Math.max(l,1)}function Xz(o){const t=[];let e,s;for(e=0,s=o.length;e<s;e++)o[e].major&&t.push(e);return t}function Kz(o,t,e,s){let l=0,r=e[0],a;for(s=Math.ceil(s),a=0;a<o.length;a++)a===r&&(t.push(o[a]),l++,r=e[l*s])}function En(o,t,e,s,l){const r=Gt(s,0),a=Math.min(Gt(l,o.length),o.length);let d=0,u,h,_;
vendor: 46,855 bytes, line 27
27for(e=Math.ceil(e),l&&(u=l-s,e=u/Math.floor(u/e)),_=r;_<0;)d++,_=Math.round(r+d*e);for(h=Math.max(r,0);h<a;h++)h===_&&(t.push(o[h]),d++,_=Math.round(r+d*e))}function Gz(o){const t=o.length;let e,s;if(t<2)return!1;for(s=o[0],e=1;e<t;++e)if(o[e]-o[e-1]!==s)return!1;return s}const Qz=o=>o==="left"?"right":o==="right"?"left":o,Nr=(o,t,e)=>t==="top"||t==="left"?o[t]+e:o[t]-e,Hr=(o,t)=>Math.min(t||o,o);function Vr(o,t){const e=[],s=o.length/t,l=o.length;let r=0;for(;r<l;r+=s)e.push(o[Math.floor(r)]);return e}function Jz(o,t,e){const s=o.ticks.length,l=Math.min(t,s-1),r=o._startPixel,a=o._endPixel,d=1e-6;let u=o.getPixelForTick(l),h;if(!(e&&(s===1?h=Math.max(u-r,a-u):t===0?h=(o.getPixelForTick(1)-u)/2:h=(u-o.getPixelForTick(l-1))/2,u+=l<t?h:-h,u<r-d||u>a+d)))return u}function tj(o,t){ue(o,e=>{const s=e.gc,l=s.length/2;let r;if(l>t){for(r=0;r<l;++r)delete e.data[s[r]];s.splice(0,l)}})}function Qs(o){return o.drawTicks?o.tickLength:0}function Wr(o,t){if(!o.display)return 0;const e=Le(o.font,t),s=io(o.padding);return(Ce(o.text)?o.text.length:1)*e.lineHeight+s.height}function ej(o,t){return ks(o,{scale:t,type:"scale"})}function oj(o,t,e){return ks(o,{tick:e,index:t,type:"tick"})}function sj(o,t,e){let s=gl(o);return(e&&t!=="right"||!e&&t==="right")&&(s=Qz(s)),s}function nj(o,t,e,s){const{top:l,left:r,bottom:a,right:d,chart:u}=o,{chartArea:h,scales:_}=u;let m=0,x,$,S;const v=a-l,M=d-r;if(o.isHorizontal()){if($=Pe(s,r,d),te(e)){const w=Object.keys(e)[0],I=e[w];S=_[w].getPixelForValue(I)+v-t}else e==="center"?S=(h.bottom+h.top)/2+v-t:S=Nr(o,e,t);x=d-r}else{if(te(e)){const w=Object.keys(e)[0],I=e[w];$=_[w].getPixelForValue(I)-M+t}else e==="center"?$=(h.left+h.right)/2-M+t:$=Nr(o,e,t);S=Pe(s,a,l),m=e==="left"?-po:po}return{titleX:$,titleY:S,maxWidth:x,rotation:m}}class Ws extends $s{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:l}=this;return t=Co(t,Number.POSITIVE_INFINITY),e=Co(e,Number.NEGATIVE_INFINITY),s=Co(s,Number.POSITIVE_INFINITY),l=Co(l,Number.NEGATIVE_INFINITY),{min:Co(t,s),max:Co(e,l),minDefined:Re(t),maxDefined:Re(e)}}getMinMax(t){let{min:e,max:s,minDefined:l,maxDefined:r}=this.getUserBounds(),a;if(l&&r)return{min:e,max:s};const d=this.getMatchingVisibleMetas();for(let u=0,h=d.length;u<h;++u)a=d[u].controller.getMinMax(this,t),l||(e=Math.min(e,a.min)),r||(s=Math.max(s,a.max));return e=r&&e>s?s:e,s=l&&e>s?e:s,{min:Co(e,Co(s,e)),max:Co(s,Co(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){me(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:l,grace:r,ticks:a}=this.options,d=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=kA(this,r,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=d<this.ticks.length;this._convertTicksToLabels(u?Vr(this.ticks,d):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Yz(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){me(this.options.afterUpdate,[this])}beforeSetDimensions(){me(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){me(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),me(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){me(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,l,r;for(s=0,l=t.length;s<l;s++)r=t[s],r.label=me(e.callback,[r.value,s,t],this)}afterTickToLabelConversion(){me(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){me(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Hr(this.ticks.length,t.ticks.maxTicksLimit),l=e.minRotation||0,r=e.maxRotation;let a=l,d,u,h;if(!this._isVisible()||!e.display||l>=r||s<=1||!this.isHorizontal()){this.labelRotation=l;return}const _=this._getLabelSizes(),m=_.widest.width,x=_.highest.height,$=oo(this.chart.width-m,0,this.maxWidth);d=t.offset?this.maxWidth/s:$/(s-1),m+6>d&&(d=$/(s-(t.offset?.5:1)),u=this.maxHeight-Qs(t.grid)-e.padding-Wr(t.title,this.chart.options.font),h=Math.sqrt(m*m+x*x),a=UD(Math.min(Math.asin(oo((_.highest.height+6)/d,-1,1)),Math.asin(oo(u/h,-1,1))-Math.asin(oo(x/h,-1,1)))),a=Math.max(l,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){me(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){me(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:l,grid:r}}=this,a=this._isVisible(),d=this.isHorizontal();if(a){const u=Wr(l,e.options.font);if(d?(t.width=this.maxWidth,t.height=Qs(r)+u):(t.height=this.maxHeight,t.width=Qs(r)+u),s.display&&this.ticks.length){const{first:h,last:_,widest:m,highest:x}=this._getLabelSizes(),$=s.padding*2,S=gs(this.labelRotation),v=Math.cos(S),M=Math.sin(S);if(d){const w=s.mirror?0:M*m.width+v*x.height;t.height=Math.min(this.maxHeight,t.height+w+$)}else{const w=s.mirror?0:v*m.width+M*x.height;t.width=Math.min(this.maxWidth,t.width+w+$)}this._calculatePadding(h,_,M,v)}}this._handleMargins(),d?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,l){const{ticks:{align:r,padding:a},position:d}=this.options,u=this.labelRotation!==0,h=d!=="top"&&this.axis==="x";if(this.isHorizontal()){const _=this.getPixelForTick(0)-this.left,m=this.right-this.getPixelForTick(this.ticks.length-1);let x=0,$=0;u?h?(x=l*t.width,$=s*e.height):(x=s*t.height,$=l*e.width):r==="start"?$=e.width:r==="end"?x=t.width:r!=="inner"&&(x=t.width/2,$=e.width/2),this.paddingLeft=Math.max((x-_+a)*this.width/(this.width-_),0),this.paddingRight=Math.max(($-m+a)*this.width/(this.width-m),0)}else{let _=e.height/2,m=t.height/2;r==="start"?(_=0,m=t.height):r==="end"&&(_=e.height,m=0),this.paddingTop=_+a,this.paddingBottom=m+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){me(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)fe(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Vr(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:l,_longestTextCache:r}=this,a=[],d=[],u=Math.floor(e/Hr(e,s));let h=0,_=0,m,x,$,S,v,M,w,I,O,tt,G;for(m=0;m<e;m+=u){if(S=t[m].label,v=this._resolveTickFontOptions(m),l.font=M=v.string,w=r[M]=r[M]||{data:{},gc:[]},I=v.lineHeight,O=tt=0,!fe(S)&&!Ce(S))O=xr(l,w.data,w.gc,O,S),tt=I;else if(Ce(S))for(x=0,$=S.length;x<$;++x)G=S[x],!fe(G)&&!Ce(G)&&(O=xr(l,w.data,w.gc,O,G),tt+=I);a.push(O),d.push(tt),h=Math.max(O,h),_=Math.max(tt,_)}tj(r,e);const Y=a.indexOf(h),et=d.indexOf(_),ht=ct=>({width:a[ct]||0,height:d[ct]||0});return{first:ht(0),last:ht(e-1),widest:ht(Y),highest:ht(et),widths:a,heights:d}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ZD(this._alignToPixels?fs(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=oj(this.getContext(),t,s))}return this.$context||(this.$context=ej(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=gs(this.labelRotation),s=Math.abs(Math.cos(e)),l=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,d=r?r.widest.width+a:0,u=r?r.highest.height+a:0;return this.isHorizontal()?u*s>d*l?d/s:u/l:u*l<d*s?u/s:d/l}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,l=this.options,{grid:r,position:a,border:d}=l,u=r.offset,h=this.isHorizontal(),m=this.ticks.length+(u?1:0),x=Qs(r),$=[],S=d.setContext(this.getContext()),v=S.display?S.width:0,M=v/2,w=function(X){return fs(s,X,v)};let I,O,tt,G,Y,et,ht,ct,dt,pt,D,Mt;if(a==="top")I=w(this.bottom),et=this.bottom-x,ct=I-M,pt=w(t.top)+M,Mt=t.bottom;else if(a==="bottom")I=w(this.top),pt=t.top,Mt=w(t.bottom)-M,et=I+M,ct=this.top+x;else if(a==="left")I=w(this.right),Y=this.right-x,ht=I-M,dt=w(t.left)+M,D=t.right;else if(a==="right")I=w(this.left),dt=t.left,D=w(t.right)-M,Y=I+M,ht=this.left+x;else if(e==="x"){if(a==="center")I=w((t.top+t.bottom)/2+.5);else if(te(a)){const X=Object.keys(a)[0],H=a[X];I=w(this.chart.scales[X].getPixelForValue(H))}pt=t.top,Mt=t.bottom,et=I+M,ct=et+x}else if(e==="y"){if(a==="center")I=w((t.left+t.right)/2);else if(te(a)){const X=Object.keys(a)[0],H=a[X];I=w(this.chart.scales[X].getPixelForValue(H))}Y=I-M,ht=Y-x,dt=t.left,D=t.right}const ot=Gt(l.ticks.maxTicksLimit,m),st=Math.max(1,Math.ceil(m/ot));for(O=0;O<m;O+=st){const X=this.getContext(O),H=r.setContext(X),P=d.setContext(X),W=H.lineWidth,U=H.color,B=P.dash||[],Z=P.dashOffset,q=H.tickWidth,ut=H.tickColor,wt=H.tickBorderDash||[],St=H.tickBorderDashOffset;tt=Jz(this,O,u),tt!==void 0&&(G=fs(s,tt,W),h?Y=ht=dt=D=G:et=ct=pt=Mt=G,$.push({tx1:Y,ty1:et,tx2:ht,ty2:ct,x1:dt,y1:pt,x2:D,y2:Mt,width:W,color:U,borderDash:B,borderDashOffset:Z,tickWidth:q,tickColor:ut,tickBorderDash:wt,tickBorderDashOffset:St}))}return this._ticksLength=m,this._borderValue=I,$}_computeLabelItems(t){const e=this.axis,s=this.options,{position:l,ticks:r}=s,a=this.isHorizontal(),d=this.ticks,{align:u,crossAlign:h,padding:_,mirror:m}=r,x=Qs(s.grid),$=x+_,S=m?-_:$,v=-gs(this.labelRotation),M=[];let w,I,O,tt,G,Y,et,ht,ct,dt,pt,D,Mt="middle";if(l==="top")Y=this.bottom-S,et=this._getXAxisLabelAlignment();else if(l==="bottom")Y=this.top+S,et=this._getXAxisLabelAlignment();else if(l==="left"){const st=this._getYAxisLabelAlignment(x);et=st.textAlign,G=st.x}else if(l==="right"){const st=this._getYAxisLabelAlignment(x);et=st.textAlign,G=st.x}else if(e==="x"){if(l==="center")Y=(t.top+t.bottom)/2+$;else if(te(l)){const st=Object.keys(l)[0],X=l[st];Y=this.chart.scales[st].getPixelForValue(X)+$}et=this._getXAxisLabelAlignment()}else if(e==="y"){if(l==="center")G=(t.left+t.right)/2-$;else if(te(l)){const st=Object.keys(l)[0],X=l[st];G=this.chart.scales[st].getPixelForValue(X)}et=this._getYAxisLabelAlignment(x).textAlign}e==="y"&&(u==="start"?Mt="top":u==="end"&&(Mt="bottom"));const ot=this._getLabelSizes();for(w=0,I=d.length;w<I;++w){O=d[w],tt=O.label;const st=r.setContext(this.getContext(w));ht=this.getPixelForTick(w)+r.labelOffset,ct=this._resolveTickFontOptions(w),dt=ct.lineHeight,pt=Ce(tt)?tt.length:1;const X=pt/2,H=st.color,P=st.textStrokeColor,W=st.textStrokeWidth;let U=et;a?(G=ht,et==="inner"&&(w===I-1?U=this.options.reverse?"left":"right":w===0?U=this.options.reverse?"right":"left":U="center"),l==="top"?h==="near"||v!==0?D=-pt*dt+dt/2:h==="center"?D=-ot.highest.height/2-X*dt+dt:D=-ot.highest.height+dt/2:h==="near"||v!==0?D=dt/2:h==="center"?D=ot.highest.height/2-X*dt:D=ot.highest.height-pt*dt,m&&(D*=-1),v!==0&&!st.showLabelBackdrop&&(G+=dt/2*Math.sin(v))):(Y=ht,D=(1-pt)*dt/2);let B;if(st.showLabelBackdrop){const Z=io(st.backdropPadding),q=ot.heights[w],ut=ot.widths[w];let wt=D-Z.top,St=0-Z.left;switch(Mt){case"middle":wt-=q/2;break;case"bottom":wt-=q;break}switch(et){case"center":St-=ut/2;break;case"right":St-=ut;break;case"inner":w===I-1?St-=ut:w>0&&(St-=ut/2);break}B={left:St,top:wt,width:ut+Z.width,height:q+Z.height,color:st.backdropColor}}M.push({label:tt,font:ct,textOffset:D,options:{rotation:v,color:H,strokeColor:P,strokeWidth:W,textAlign:U,textBaseline:Mt,translation:[G,Y],backdrop:B}})}return M}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-gs(this.labelRotation))return t==="top"?"left":"right";let l="center";return e.align==="start"?l="left":e.align==="end"?l="right":e.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:l,padding:r}}=this.options,a=this._getLabelSizes(),d=t+r,u=a.widest.width;let h,_;return e==="left"?l?(_=this.right+r,s==="near"?h="left":s==="center"?(h="center",_+=u/2):(h="right",_+=u)):(_=this.right-d,s==="near"?h="right":s==="center"?(h="center",_-=u/2):(h="left",_=this.left)):e==="right"?l?(_=this.left+r,s==="near"?h="right":s==="center"?(h="center",_-=u/2):(h="left",_-=u)):(_=this.left+d,s==="near"?h="left":s==="center"?(h="center",_+=u/2):(h="right",_=this.right)):h="right",{textAlign:h,x:_}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:l,width:r,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,l,r,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const l=this.ticks.findIndex(r=>r.value===t);return l>=0?e.setContext(this.getContext(l)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,a;const d=(u,h,_)=>{!_.width||!_.color||(s.save(),s.lineWidth=_.width,s.strokeStyle=_.color,s.setLineDash(_.borderDash||[]),s.lineDashOffset=_.borderDashOffset,s.beginPath(),s.moveTo(u.x,u.y),s.lineTo(h.x,h.y),s.stroke(),s.restore())};if(e.display)for(r=0,a=l.length;r<a;++r){const u=l[r];e.drawOnChartArea&&d({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&d({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:l}}=this,r=s.setContext(this.getContext()),a=s.display?r.width:0;if(!a)return;const d=l.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let h,_,m,x;this.isHorizontal()?(h=fs(t,this.left,a)-a/2,_=fs(t,this.right,d)+d/2,m=x=u):(m=fs(t,this.top,a)-a/2,x=fs(t,this.bottom,d)+d/2,h=_=u),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(h,m),e.lineTo(_,x),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,l=this._computeLabelArea();l&&ai(s,l);const r=this.getLabelItems(t);for(const a of r){const d=a.options,u=a.font,h=a.label,_=a.textOffset;vn(s,h,0,_,u,d)}l&&ci(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:l}}=this;if(!s.display)return;const r=Le(s.font),a=io(s.padding),d=s.align;let u=r.lineHeight/2;e==="bottom"||e==="center"||te(e)?(u+=a.bottom,Ce(s.text)&&(u+=r.lineHeight*(s.text.length-1))):u+=a.top;const{titleX:h,titleY:_,maxWidth:m,rotation:x}=nj(this,u,e,d);vn(t,s.text,0,0,r,{color:s.color,maxWidth:m,rotation:x,textAlign:sj(d,e,l),textBaseline:"middle",translation:[h,_]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=Gt(t.grid&&t.grid.z,-1),l=Gt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ws.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:s,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",l=[];let r,a;for(r=0,a=e.length;r<a;++r){const d=e[r];d[s]===this.id&&(!t||d.type===t)&&l.push(d)}return l}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Le(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Fn{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;rj(e)&&(s=this.register(e));const l=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in l||(l[r]=t,ij(t,a,s),this.override&&ye.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,l=this.scope;s in e&&delete e[s],l&&s in ye[l]&&(delete ye[l][s],this.override&&delete ws[s])}}function ij(o,t,e){const s=fn(Object.create(null),[e?ye.get(e):{},ye.get(t),o.defaults]);ye.set(t,s),o.defaultRoutes&&lj(t,o.defaultRoutes),o.descriptors&&ye.describe(t,o.descriptors)}function lj(o,t){Object.keys(t).forEach(e=>{const s=e.split("."),l=s.pop(),r=[o].concat(s).join("."),a=t[e].split("."),d=a.pop(),u=a.join(".");ye.route(r,l,u,d)})}function rj(o){return"id"in o&&"defaults"in o}class aj{constructor(){this.controllers=new Fn(Ac,"datasets",!0),this.elements=new Fn($s,"elements"),this.plugins=new Fn(Object,"plugins"),this.scales=new Fn(Ws,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(l=>{const r=s||this._getRegistryForType(l);s||r.isForType(l)||r===this.plugins&&l.id?this._exec(t,r,l):ue(l,a=>{const d=s||this._getRegistryForType(a);this._exec(t,d,a)})})}_exec(t,e,s){const l=ml(t);me(s["before"+l],[],s),e[t](s),me(s["after"+l],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const l=e.get(t);if(l===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return l}}var So=new aj;class cj{constructor(){this._init=void 0}notify(t,e,s,l){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const r=l?this._descriptors(t).filter(l):this._descriptors(t),a=this._notify(r,t,e,s);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,s,l){l=l||{};for(const r of t){const a=r.plugin,d=a[s],u=[e,l,r.options];if(me(d,u,a)===!1&&l.cancelable)return!1}return!0}invalidate(){fe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,l=Gt(s.options&&s.options.plugins,{}),r=dj(s);return l===!1&&!e?[]:hj(t,r,l,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,l=(r,a)=>r.filter(d=>!a.some(u=>d.plugin.id===u.plugin.id));this._notify(l(e,s),t,"stop"),this._notify(l(s,e),t,"start")}}function dj(o){const t={},e=[],s=Object.keys(So.plugins.items);for(let r=0;r<s.length;r++)e.push(So.getPlugin(s[r]));const l=o.plugins||[];for(let r=0;r<l.length;r++){const a=l[r];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function uj(o,t){return!t&&o===!1?null:o===!0?{}:o}function hj(o,{plugins:t,localIds:e},s,l){const r=[],a=o.getContext();for(const d of t){const u=d.id,h=uj(s[u],l);h!==null&&r.push({plugin:d,options:pj(o.config,{plugin:d,local:e[u]},h,a)})}return r}function pj(o,{plugin:t,local:e},s,l){const r=o.pluginScopeKeys(t),a=o.getOptionScopes(s,r);return e&&t.defaults&&a.push(t.defaults),o.createResolver(a,l,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function tl(o,t){const e=ye.datasets[o]||{};return((t.datasets||{})[o]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function fj(o,t){let e=o;return o==="_index_"?e=t:o==="_value_"&&(e=t==="x"?"y":"x"),e}function _j(o,t){return o===t?"_index_":"_value_"}function Ur(o){if(o==="x"||o==="y"||o==="r")return o}function mj(o){if(o==="top"||o==="bottom")return"x";if(o==="left"||o==="right")return"y"}function el(o,...t){if(Ur(o))return o;for(const e of t){const s=e.axis||mj(e.position)||o.length>1&&Ur(o[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${o}' axis. Please provide 'axis' or 'position' option.`)}function Yr(o,t,e){if(e[t+"AxisID"]===o)return{axis:t}}function vj(o,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===o||s.yAxisID===o);if(e.length)return Yr(o,"x",e[0])||Yr(o,"y",e[0])}return{}}function gj(o,t){const e=ws[o.type]||{scales:{}},s=t.scales||{},l=tl(o.type,t),r=Object.create(null);return Object.keys(s).forEach(a=>{const d=s[a];if(!te(d))return console.error(`Invalid scale configuration for scale: ${a}`);if(d._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=el(a,d,vj(a,o),ye.scales[d.type]),h=_j(u,l),_=e.scales||{};r[a]=rn(Object.create(null),[{axis:u},d,_[u],_[h]])}),o.data.datasets.forEach(a=>{const d=a.type||o.type,u=a.indexAxis||tl(d,t),_=(ws[d]||{}).scales||{};Object.keys(_).forEach(m=>{const x=fj(m,u),$=a[x+"AxisID"]||x;r[$]=r[$]||Object.create(null),rn(r[$],[{axis:x},s[$],_[m]])})}),Object.keys(r).forEach(a=>{const d=r[a];rn(d,[ye.scales[d.type],ye.scale])}),r}function Rc(o){const t=o.options||(o.options={});t.plugins=Gt(t.plugins,{}),t.scales=gj(o,t)}function Oc(o){return o=o||{},o.datasets=o.datasets||[],o.labels=o.labels||[],o}function bj(o){return o=o||{},o.data=Oc(o.data),Rc(o),o}const qr=new Map,Bc=new Set;function In(o,t){let e=qr.get(o);return e||(e=t(),qr.set(o,e),Bc.add(e)),e}const Js=(o,t,e)=>{const s=Qn(t,e);s!==void 0&&o.add(s)};class xj{constructor(t){this._config=bj(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Oc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Rc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return In(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return In(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return In(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return In(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let l=s.get(t);return(!l||e)&&(l=new Map,s.set(t,l)),l}getOptionScopes(t,e,s){const{options:l,type:r}=this,a=this._cachedScopes(t,s),d=a.get(e);if(d)return d;const u=new Set;e.forEach(_=>{t&&(u.add(t),_.forEach(m=>Js(u,t,m))),_.forEach(m=>Js(u,l,m)),_.forEach(m=>Js(u,ws[r]||{},m)),_.forEach(m=>Js(u,ye,m)),_.forEach(m=>Js(u,Gi,m))});const h=Array.from(u);return h.length===0&&h.push(Object.create(null)),Bc.has(e)&&a.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,ws[e]||{},ye.datasets[e]||{},{type:e},ye,Gi]}resolveNamedOptions(t,e,s,l=[""]){const r={$shared:!0},{resolver:a,subPrefixes:d}=Zr(this._resolverCache,t,l);let u=a;if(wj(a,e)){r.$shared=!1,s=cs(s)?s():s;const h=this.createResolver(t,s,d);u=Ns(a,s,h)}for(const h of e)r[h]=u[h];return r}createResolver(t,e,s=[""],l){const{resolver:r}=Zr(this._resolverCache,t,s);return te(e)?Ns(r,e,void 0,l):r}}function Zr(o,t,e){let s=o.get(t);s||(s=new Map,o.set(t,s));const l=e.join();let r=s.get(l);return r||(r={resolver:xl(t,e),subPrefixes:e.filter(d=>!d.toLowerCase().includes("hover"))},s.set(l,r)),r}const yj=o=>te(o)&&Object.getOwnPropertyNames(o).some(t=>cs(o[t]));function wj(o,t){const{isScriptable:e,isIndexable:s}=mc(o);for(const l of t){const r=e(l),a=s(l),d=(a||r)&&o[l];if(r&&(cs(d)||yj(d))||a&&Ce(d))return!0}return!1}var kj="4.5.1";const $j=["top","bottom","left","right","chartArea"];function Xr(o,t){return o==="top"||o==="bottom"||$j.indexOf(o)===-1&&t==="x"}function Kr(o,t){return function(e,s){return e[o]===s[o]?e[t]-s[t]:e[o]-s[o]}}function Gr(o){const t=o.chart,e=t.options.animation;t.notifyPlugins("afterRender"),me(e&&e.onComplete,[o],t)}function Cj(o){const t=o.chart,e=t.options.animation;me(e&&e.onProgress,[o],t)}function Ec(o){return kl()&&typeof o=="string"?o=document.getElementById(o):o&&o.length&&(o=o[0]),o&&o.canvas&&(o=o.canvas),o}const Un={},Qr=o=>{const t=Ec(o);return Object.values(Un).filter(e=>e.canvas===t).pop()};function Mj(o,t,e){const s=Object.keys(o);for(const l of s){const r=+l;if(r>=t){const a=o[l];delete o[l],(e>0||r>t)&&(o[r+e]=a)}}}function Sj(o,t,e,s){return!e||o.type==="mouseout"?null:s?t:o}let hi=class{static defaults=ye;static instances=Un;static overrides=ws;static registry=So;static version=kj;static getChart=Qr;static register(...t){So.add(...t),Jr()}static unregister(...t){So.remove(...t),Jr()}constructor(t,e){const s=this.config=new xj(e),l=Ec(t),r=Qr(l);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Uz(l)),this.platform.updateConfig(s);const d=this.platform.acquireContext(l,a.aspectRatio),u=d&&d.canvas,h=u&&u.height,_=u&&u.width;if(this.id=TD(),this.ctx=d,this.canvas=u,this.width=_,this.height=h,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new cj,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=JD(m=>this.update(m),a.resizeDelay||0),this._dataChanges=[],Un[this.id]=this,!d||!u){console.error("Failed to create chart: can't acquire context from the given item");return}Ho.listen(this,"complete",Gr),Ho.listen(this,"progress",Cj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:l,_aspectRatio:r}=this;return fe(t)?e&&r?r:l?s/l:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return So}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():$r(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return yr(this.canvas,this.ctx),this}stop(){return Ho.stop(this),this}resize(t,e){Ho.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,l=this.canvas,r=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(l,t,e,r),d=s.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,$r(this,d,!0)&&(this.notifyPlugins("resize",{size:a}),me(s.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};ue(e,(s,l)=>{s.id=l})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,l=Object.keys(s).reduce((a,d)=>(a[d]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const d=e[a],u=el(a,d),h=u==="r",_=u==="x";return{options:d,dposition:h?"chartArea":_?"bottom":"left",dtype:h?"radialLinear":_?"category":"linear"}}))),ue(r,a=>{const d=a.options,u=d.id,h=el(u,d),_=Gt(d.type,a.dtype);(d.position===void 0||Xr(d.position,h)!==Xr(a.dposition))&&(d.position=a.dposition),l[u]=!0;let m=null;if(u in s&&s[u].type===_)m=s[u];else{const x=So.getScale(_);m=new x({id:u,type:_,ctx:this.ctx,chart:this}),s[m.id]=m}m.init(d,t)}),ue(l,(a,d)=>{a||delete s[d]}),ue(s,a=>{so.configure(this,a,a.options),so.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((l,r)=>l.index-r.index),s>e){for(let l=e;l<s;++l)this._destroyDatasetMeta(l);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Kr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,l)=>{e.filter(r=>r===s._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,l;for(this._removeUnreferencedMetasets(),s=0,l=e.length;s<l;s++){const r=e[s];let a=this.getDatasetMeta(s);const d=r.type||this.config.type;if(a.type&&a.type!==d&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=d,a.indexAxis=r.indexAxis||tl(d,this.options),a.order=r.order||0,a.index=s,a.label=""+r.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const u=So.getController(d),{datasetElementType:h,dataElementType:_}=ye.datasets[d];Object.assign(u,{dataElementType:So.getElement(_),datasetElementType:h&&So.getElement(h)}),a.controller=new u(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){ue(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let h=0,_=this.data.datasets.length;h<_;h++){const{controller:m}=this.getDatasetMeta(h),x=!l&&r.indexOf(m)===-1;m.buildOrUpdateElements(x),a=Math.max(+m.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),l||ue(r,h=>{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Kr("z","_idx"));const{_active:d,_lastEvent:u}=this;u?this._eventHandler(u,!0):d.length&&this._updateHoverStyles(d,d,!0),this.render()}_updateScales(){ue(this.scales,t=>{so.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!ur(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:l,count:r}of e){const a=s==="_removeElements"?-r:r;Mj(t,l,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=r=>new Set(t.filter(a=>a[0]===r).map((a,d)=>d+","+a.splice(1).join(","))),l=s(0);for(let r=1;r<e;r++)if(!ur(l,s(r)))return;return Array.from(l).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;so.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],ue(this.boxes,l=>{s&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,r)=>{l._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,cs(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),l={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",l)!==!1&&(s.controller._update(e),l.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",l))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ho.has(this)?this.attached&&!Ho.running(this)&&Ho.start(this):(this.draw(),Gr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:l}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,l)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let l,r;for(l=0,r=e.length;l<r;++l){const a=e[l];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s={meta:t,index:t.index,cancelable:!0},l=Mc(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(l&&ai(e,l),t.controller.draw(),l&&ci(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return mn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,l){const r=$z.modes[e];return typeof r=="function"?r(this,t,s,l):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let l=s.filter(r=>r&&r._dataset===e).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(l)),l}getContext(){return this.$context||(this.$context=ks(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const l=s?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,l);Jn(e)?(r.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(r,{visible:s}),this.update(d=>d.datasetIndex===t?l:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ho.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),yr(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Un[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(r,a)=>{e.addEventListener(this,r,a),t[r]=a},l=(r,a,d)=>{r.offsetX=a,r.offsetY=d,this._eventHandler(r)};ue(this.options.events,r=>s(r,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(u,h)=>{e.addEventListener(this,u,h),t[u]=h},l=(u,h)=>{t[u]&&(e.removeEventListener(this,u,h),delete t[u])},r=(u,h)=>{this.canvas&&this.resize(u,h)};let a;const d=()=>{l("attach",d),this.attached=!0,this.resize(),s("resize",r),s("detach",a)};a=()=>{this.attached=!1,l("resize",r),this._stop(),this._resize(0,0),s("attach",d)},e.isAttached(this.canvas)?d():a()}unbindEvents(){ue(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},ue(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const l=s?"set":"remove";let r,a,d,u;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+l+"DatasetHoverStyle"]()),d=0,u=t.length;d<u;++d){a=t[d];const h=a&&this.getDatasetMeta(a.datasetIndex).controller;h&&h[l+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:r,index:a})=>{const d=this.getDatasetMeta(r);if(!d)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:d.data[a],index:a}});!Kn(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const l=this.options.hover,r=(u,h)=>u.filter(_=>!h.some(m=>_.datasetIndex===m.datasetIndex&&_.index===m.index)),a=r(e,t),d=s?t:r(t,e);a.length&&this.updateHoverStyle(a,l.mode,!1),d.length&&l.mode&&this.updateHoverStyle(d,l.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},l=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,l)===!1)return;const r=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,l),(r||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:l=[],options:r}=this,a=e,d=this._getActiveElements(t,l,s,a),u=ED(t),h=Sj(t,this._lastEvent,s,u);s&&(this._lastEvent=null,me(r.onHover,[t,d,this],this),u&&me(r.onClick,[t,d,this],this));const _=!Kn(d,l);return(_||e)&&(this._active=d,this._updateHoverStyles(d,l,e)),this._lastEvent=h,_}_getActiveElements(t,e,s,l){if(t.type==="mouseout")return[];if(!s)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,l)}};function Jr(){return ue(hi.instances,o=>o._plugins.invalidate())}function Fc(o,t,e=t){o.lineCap=Gt(e.borderCapStyle,t.borderCapStyle),o.setLineDash(Gt(e.borderDash,t.borderDash)),o.lineDashOffset=Gt(e.borderDashOffset,t.borderDashOffset),o.lineJoin=Gt(e.borderJoinStyle,t.borderJoinStyle),o.lineWidth=Gt(e.borderWidth,t.borderWidth),o.strokeStyle=Gt(e.borderColor,t.borderColor)}function Dj(o,t,e){o.lineTo(e.x,e.y)}function Aj(o){return o.stepped?pA:o.tension||o.cubicInterpolationMode==="monotone"?fA:Dj}function Ic(o,t,e={}){const s=o.length,{start:l=0,end:r=s-1}=e,{start:a,end:d}=t,u=Math.max(l,a),h=Math.min(r,d),_=l<a&&r<a||l>d&&r>d;return{count:s,start:u,loop:t.loop,ilen:h<u&&!_?s+h-u:h-u}}function zj(o,t,e,s){const{points:l,options:r}=t,{count:a,start:d,loop:u,ilen:h}=Ic(l,e,s),_=Aj(r);let{move:m=!0,reverse:x}=s||{},$,S,v;for($=0;$<=h;++$)S=l[(d+(x?h-$:$))%a],!S.skip&&(m?(o.moveTo(S.x,S.y),m=!1):_(o,v,S,x,r.stepped),v=S);return u&&(S=l[(d+(x?h:0))%a],_(o,v,S,x,r.stepped)),!!u}function jj(o,t,e,s){const l=t.points,{count:r,start:a,ilen:d}=Ic(l,e,s),{move:u=!0,reverse:h}=s||{};let _=0,m=0,x,$,S,v,M,w;const I=tt=>(a+(h?d-tt:tt))%r,O=()=>{v!==M&&(o.lineTo(_,M),o.lineTo(_,v),o.lineTo(_,w))};for(u&&($=l[I(0)],o.moveTo($.x,$.y)),x=0;x<=d;++x){if($=l[I(x)],$.skip)continue;const tt=$.x,G=$.y,Y=tt|0;Y===S?(G<v?v=G:G>M&&(M=G),_=(m*_+tt)/++m):(O(),o.lineTo(tt,G),S=Y,m=0,v=M=G),w=G}O()}function ol(o){const t=o.options,e=t.borderDash&&t.borderDash.length;return!o._decimated&&!o._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?jj:zj}function Tj(o){return o.stepped?qA:o.tension||o.cubicInterpolationMode==="monotone"?ZA:vs}function Pj(o,t,e,s){let l=t._path;l||(l=t._path=new Path2D,t.path(l,e,s)&&l.closePath()),Fc(o,t.options),o.stroke(l)}function Lj(o,t,e,s){const{segments:l,options:r}=t,a=ol(t);for(const d of l)Fc(o,r,d.style),o.beginPath(),a(o,t,d,{start:e,end:e+s-1})&&o.closePath(),o.stroke()}const Rj=typeof Path2D=="function";function Oj(o,t,e,s){Rj&&!t.options.segment?Pj(o,t,e,s):Lj(o,t,e,s)}class pi extends $s{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const l=s.spanGaps?this._loop:this._fullLoop;FA(this._points,s,t,l,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=tz(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,l=t[e],r=this.points,a=Cc(this,{property:e,start:l,end:l});if(!a.length)return;const d=[],u=Tj(s);let h,_;for(h=0,_=a.length;h<_;++h){const{start:m,end:x}=a[h],$=r[m],S=r[x];if($===S){d.push($);continue}const v=Math.abs((l-$[e])/(S[e]-$[e])),M=u($,S,v,s.stepped);M[e]=t[e],d.push(M)}return d.length===1?d[0]:d}pathSegment(t,e,s){return ol(this)(t,this,e,s)}path(t,e,s){const l=this.segments,r=ol(this);let a=this._loop;e=e||0,s=s||this.points.length-e;for(const d of l)a&=r(t,this,d,{start:e,end:e+s-1});return!!a}draw(t,e,s,l){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Oj(t,this,s,l),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ta(o,t,e,s){const l=o.options,{[e]:r}=o.getProps([e],s);return Math.abs(t-r)<l.radius+l.hitRadius}class Bj extends $s{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,s){const l=this.options,{x:r,y:a}=this.getProps(["x","y"],s);
vendor: 4,246 bytes, line 27
27return Math.pow(t-r,2)+Math.pow(e-a,2)<Math.pow(l.hitRadius+l.radius,2)}inXRange(t,e){return ta(this,t,"x",e)}inYRange(t,e){return ta(this,t,"y",e)}getCenterPoint(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const s=e&&t.borderWidth||0;return(e+s)*2}draw(t,e){const s=this.options;this.skip||s.radius<.1||!mn(this,e,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,Qi(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Ej(o,t,e){const s=o.segments,l=o.points,r=t.points,a=[];for(const d of s){let{start:u,end:h}=d;h=fi(u,h,l);const _=sl(e,l[u],l[h],d.loop);if(!t.segments){a.push({source:d,target:_,start:l[u],end:l[h]});continue}const m=Cc(t,_);for(const x of m){const $=sl(e,r[x.start],r[x.end],x.loop),S=$c(d,l,$);for(const v of S)a.push({source:v,target:x,start:{[e]:ea(_,$,"start",Math.max)},end:{[e]:ea(_,$,"end",Math.min)}})}}return a}function sl(o,t,e,s){if(s)return;let l=t[o],r=e[o];return o==="angle"&&(l=Do(l),r=Do(r)),{property:o,start:l,end:r}}function Fj(o,t){const{x:e=null,y:s=null}=o||{},l=t.points,r=[];return t.segments.forEach(({start:a,end:d})=>{d=fi(a,d,l);const u=l[a],h=l[d];s!==null?(r.push({x:u.x,y:s}),r.push({x:h.x,y:s})):e!==null&&(r.push({x:e,y:u.y}),r.push({x:e,y:h.y}))}),r}function fi(o,t,e){for(;t>o;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function ea(o,t,e,s){return o&&t?s(o[e],t[e]):o?o[e]:t?t[e]:0}function Nc(o,t){let e=[],s=!1;return Ce(o)?(s=!0,e=o):e=Fj(o,t),e.length?new pi({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function oa(o){return o&&o.fill!==!1}function Ij(o,t,e){let l=o[t].fill;const r=[t];let a;if(!e)return l;for(;l!==!1&&r.indexOf(l)===-1;){if(!Re(l))return l;if(a=o[l],!a)return!1;if(a.visible)return l;r.push(l),l=a.fill}return!1}function Nj(o,t,e){const s=Uj(o);if(te(s))return isNaN(s.value)?!1:s;let l=parseFloat(s);return Re(l)&&Math.floor(l)===l?Hj(s[0],t,l,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Hj(o,t,e,s){return(o==="-"||o==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Vj(o,t){let e=null;return o==="start"?e=t.bottom:o==="end"?e=t.top:te(o)?e=t.getPixelForValue(o.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Wj(o,t,e){let s;return o==="start"?s=e:o==="end"?s=t.options.reverse?t.min:t.max:te(o)?s=o.value:s=t.getBaseValue(),s}function Uj(o){const t=o.options,e=t.fill;let s=Gt(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Yj(o){const{scale:t,index:e,line:s}=o,l=[],r=s.segments,a=s.points,d=qj(t,e);d.push(Nc({x:null,y:t.bottom},s));for(let u=0;u<r.length;u++){const h=r[u];for(let _=h.start;_<=h.end;_++)Zj(l,a[_],d)}return new pi({points:l,options:{}})}function qj(o,t){const e=[],s=o.getMatchingVisibleMetas("line");for(let l=0;l<s.length;l++){const r=s[l];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function Zj(o,t,e){const s=[];for(let l=0;l<e.length;l++){const r=e[l],{first:a,last:d,point:u}=Xj(r,t,"x");if(!(!u||a&&d)){if(a)s.unshift(u);else if(o.push(u),!d)break}}o.push(...s)}function Xj(o,t,e){const s=o.interpolate(t,e);if(!s)return{};const l=s[e],r=o.segments,a=o.points;let d=!1,u=!1;for(let h=0;h<r.length;h++){const _=r[h],m=a[_.start][e],x=a[_.end][e];if(Ps(l,m,x)){d=l===m,u=l===x;break}}return{first:d,last:u,point:s}}class Hc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:l,y:r,radius:a}=this;return e=e||{start:0,end:fo},t.arc(l,r,a,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:l}=this,r=t.angle;return{x:e+Math.cos(r)*l,y:s+Math.sin(r)*l,angle:r}}}function Kj(o){const{chart:t,fill:e,line:s}=o;if(Re(e))return Gj(t,e);if(e==="stack")return Yj(o);if(e==="shape")return!0;const l=Qj(o);return l instanceof Hc?l:Nc(l,s)}function Gj(o,t){const e=o.getDatasetMeta(t);return e&&o.isDatasetVisible(t)?e.dataset:null}function Qj(o){return(o.scale||{}).getPointPositionForValue?tT(o):Jj(o)}function Jj(o){const{scale:t={},fill:e}=o,s=Vj(e,t);if(Re(s)){const l=t.isHorizontal();return{x:l?s:null,y:l?null:s}}return null}function tT(o){const{scale:t,fill:e}
27=o,s=t.options,l=t.getLabels().length,r=s.reverse?t.max:t.min,a=Wj(e,t,r),d=[];if(s.grid.circular){const u=t.getPointPositionForValue(0,r);return new Hc({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<l;++u)d.push(t.getPointPositionForValue(u,a));return d}function Bi(o,t,e){const s=Kj(t),{chart:l,index:r,line:a,scale:d,axis:u}=t,h=a.options,_=h.fill,m=h.backgroundColor,{above:x=m,below:$=m}=_||{},S=l.getDatasetMeta(r),v=Mc(l,S);s&&a.points.length&&(ai(o,e),eT(o,{line:a,target:s,above:x,below:$,area:e,scale:d,axis:u,clip:v}),ci(o))}function eT(o,t){const{line:e,target:s,above:l,below:r,area:a,scale:d,clip:u}=t,h=e._loop?"angle":t.axis;o.save();let _=r;r!==l&&(h==="x"?(sa(o,s,a.top),Ei(o,{line:e,target:s,color:l,scale:d,property:h,clip:u}),o.restore(),o.save(),sa(o,s,a.bottom)):h==="y"&&(na(o,s,a.left),Ei(o,{line:e,target:s,color:r,scale:d,property:h,clip:u}),o.restore(),o.save(),na(o,s,a.right),_=l)),Ei(o,{line:e,target:s,color:_,scale:d,property:h,clip:u}),o.restore()}function sa(o,t,e){const{segments:s,points:l}=t;let r=!0,a=!1;o.beginPath();for(const d of s){const{start:u,end:h}=d,_=l[u],m=l[fi(u,h,l)];r?(o.moveTo(_.x,_.y),r=!1):(o.lineTo(_.x,e),o.lineTo(_.x,_.y)),a=!!t.pathSegment(o,d,{move:a}),a?o.closePath():o.lineTo(m.x,e)}o.lineTo(t.first().x,e),o.closePath(),o.clip()}function na(o,t,e){const{segments:s,points:l}=t;let r=!0,a=!1;o.beginPath();for(const d of s){const{start:u,end:h}=d,_=l[u],m=l[fi(u,h,l)];
vendor: 38,156 bytes, lines 27-29
27r?(o.moveTo(_.x,_.y),r=!1):(o.lineTo(e,_.y),o.lineTo(_.x,_.y)),a=!!t.pathSegment(o,d,{move:a}),a?o.closePath():o.lineTo(e,m.y)}o.lineTo(e,t.first().y),o.closePath(),o.clip()}function Ei(o,t){const{line:e,target:s,property:l,color:r,scale:a,clip:d}=t,u=Ej(e,s,l);for(const{source:h,target:_,start:m,end:x}of u){const{style:{backgroundColor:$=r}={}}=h,S=s!==!0;o.save(),o.fillStyle=$,oT(o,a,d,S&&sl(l,m,x)),o.beginPath();const v=!!e.pathSegment(o,h);let M;if(S){v?o.closePath():ia(o,s,x,l);const w=!!s.pathSegment(o,_,{move:v,reverse:!0});M=v&&w,M||ia(o,s,m,l)}o.closePath(),o.fill(M?"evenodd":"nonzero"),o.restore()}}function oT(o,t,e,s){const l=t.chart.chartArea,{property:r,start:a,end:d}=s||{};if(r==="x"||r==="y"){let u,h,_,m;r==="x"?(u=a,h=l.top,_=d,m=l.bottom):(u=l.left,h=a,_=l.right,m=d),o.beginPath(),e&&(u=Math.max(u,e.left),_=Math.min(_,e.right),h=Math.max(h,e.top),m=Math.min(m,e.bottom)),o.rect(u,h,_-u,m-h),o.clip()}}function ia(o,t,e,s){const l=t.interpolate(e,s);l&&o.lineTo(l.x,l.y)}var sT={id:"filler",afterDatasetsUpdate(o,t,e){const s=(o.data.datasets||[]).length,l=[];let r,a,d,u;for(a=0;a<s;++a)r=o.getDatasetMeta(a),d=r.dataset,u=null,d&&d.options&&d instanceof pi&&(u={visible:o.isDatasetVisible(a),index:a,fill:Nj(d,a,s),chart:o,axis:r.controller.options.indexAxis,scale:r.vScale,line:d}),r.$filler=u,l.push(u);for(a=0;a<s;++a)u=l[a],!(!u||u.fill===!1)&&(u.fill=Ij(l,a,e.propagate))},beforeDraw(o,t,e){const s=e.drawTime==="beforeDraw",l=o.getSortedVisibleDatasetMetas(),r=o.chartArea;for(let a=l.length-1;a>=0;--a){const d=l[a].$filler;d&&(d.line.updateControlPoints(r,d.axis),s&&d.fill&&Bi(o.ctx,d,r))}},beforeDatasetsDraw(o,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=o.getSortedVisibleDatasetMetas();for(let l=s.length-1;l>=0;--l){const r=s[l].$filler;oa(r)&&Bi(o.ctx,r,o.chartArea)}},beforeDatasetDraw(o,t,e){const s=t.meta.$filler;!oa(s)||e.drawTime!=="beforeDatasetDraw"||Bi(o.ctx,s,o.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const la=(o,t)=>{let{boxHeight:e=t,boxWidth:s=t}=o;return o.usePointStyle&&(e=Math.min(e,t),s=o.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},nT=(o,t)=>o!==null&&t!==null&&o.datasetIndex===t.datasetIndex&&o.index===t.index;class ra extends $s{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=me(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,l)=>t.sort(s,l,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,l=Le(s.font),r=l.size,a=this._computeTitleHeight(),{boxWidth:d,itemHeight:u}=la(s,r);let h,_;e.font=l.string,this.isHorizontal()?(h=this.maxWidth,_=this._fitRows(a,r,d,u)+10):(_=this.maxHeight,h=this._fitCols(a,l,d,u)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(_,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,l){const{ctx:r,maxWidth:a,options:{labels:{padding:d}}}=this,u=this.legendHitBoxes=[],h=this.lineWidths=[0],_=l+d;let m=t;r.textAlign="left",r.textBaseline="middle";let x=-1,$=-_;return this.legendItems.forEach((S,v)=>{const M=s+e/2+r.measureText(S.text).width;(v===0||h[h.length-1]+M+2*d>a)&&(m+=_,h[h.length-(v>0?0:1)]=0,$+=_,x++),u[v]={left:0,top:$,row:x,width:M,height:l},h[h.length-1]+=M+d}),m}_fitCols(t,e,s,l){const{ctx:r,maxHeight:a,options:{labels:{padding:d}}}=this,u=this.legendHitBoxes=[],h=this.columnSizes=[],_=a-t;let m=d,x=0,$=0,S=0,v=0;return this.legendItems.forEach((M,w)=>{const{itemWidth:I,itemHeight:O}=iT(s,e,r,M,l);w>0&&$+O+2*d>_&&(m+=x+d,h.push({width:x,height:$}),S+=x+d,v++,x=$=0),u[w]={left:S,top:$,col:v,width:I,height:O},x=Math.max(x,I),$+=O+d}),m+=x,h.push({width:x,height:$}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:l},rtl:r}}=this,a=Os(r,this.left,this.width);if(this.isHorizontal()){let d=0,u=Pe(s,this.left+l,this.right-this.lineWidths[d]);for(const h of e)d!==h.row&&(d=h.row,u=Pe(s,this.left+l,this.right-this.lineWidths[d])),h.top+=this.top+t+l,h.left=a.leftForLtr(a.x(u),h.width),u+=h.width+l}else{let d=0,u=Pe(s,this.top+t+l,this.bottom-this.columnSizes[d].height);for(const h of e)h.col!==d&&(d=h.col,u=Pe(s,this.top+t+l,this.bottom-this.columnSizes[d].height)),h.top=u,h.left+=this.left+l,h.left=a.leftForLtr(a.x(h.left),h.width),u+=h.height+l}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ai(t,this),this._draw(),ci(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:l}=this,{align:r,labels:a}=t,d=ye.color,u=Os(t.rtl,this.left,this.width),h=Le(a.font),{padding:_}=a,m=h.size,x=m/2;let $;this.drawTitle(),l.textAlign=u.textAlign("left"),l.textBaseline="middle",l.lineWidth=.5,l.font=h.string;const{boxWidth:S,boxHeight:v,itemHeight:M}=la(a,m),w=function(Y,et,ht){if(isNaN(S)||S<=0||isNaN(v)||v<0)return;l.save();const ct=Gt(ht.lineWidth,1);if(l.fillStyle=Gt(ht.fillStyle,d),l.lineCap=Gt(ht.lineCap,"butt"),l.lineDashOffset=Gt(ht.lineDashOffset,0),l.lineJoin=Gt(ht.lineJoin,"miter"),l.lineWidth=ct,l.strokeStyle=Gt(ht.strokeStyle,d),l.setLineDash(Gt(ht.lineDash,[])),a.usePointStyle){const dt={radius:v*Math.SQRT2/2,pointStyle:ht.pointStyle,rotation:ht.rotation,borderWidth:ct},pt=u.xPlus(Y,S/2),D=et+x;fc(l,dt,pt,D,a.pointStyleWidth&&S)}else{const dt=et+Math.max((m-v)/2,0),pt=u.leftForLtr(Y,S),D=un(ht.borderRadius);l.beginPath(),Object.values(D).some(Mt=>Mt!==0)?Ji(l,{x:pt,y:dt,w:S,h:v,radius:D}):l.rect(pt,dt,S,v),l.fill(),ct!==0&&l.stroke()}l.restore()},I=function(Y,et,ht){vn(l,ht.text,Y,et+M/2,h,{strikethrough:ht.hidden,textAlign:u.textAlign(ht.textAlign)})},O=this.isHorizontal(),tt=this._computeTitleHeight();O?$={x:Pe(r,this.left+_,this.right-s[0]),y:this.top+_+tt,line:0}:$={x:this.left+_,y:Pe(r,this.top+tt+_,this.bottom-e[0].height),line:0},yc(this.ctx,t.textDirection);const G=M+_;this.legendItems.forEach((Y,et)=>{l.strokeStyle=Y.fontColor,l.fillStyle=Y.fontColor;const ht=l.measureText(Y.text).width,ct=u.textAlign(Y.textAlign||(Y.textAlign=a.textAlign)),dt=S+x+ht;let pt=$.x,D=$.y;u.setWidth(this.width),O?et>0&&pt+dt+_>this.right&&(D=$.y+=G,$.line++,pt=$.x=Pe(r,this.left+_,this.right-s[$.line])):et>0&&D+G>this.bottom&&(pt=$.x=pt+e[$.line].width+_,$.line++,D=$.y=Pe(r,this.top+tt+_,this.bottom-e[$.line].height));const Mt=u.x(pt);if(w(Mt,D,Y),pt=tA(ct,pt+S+x,O?pt+dt:this.right,t.rtl),I(u.x(pt),D,Y),O)$.x+=dt+_;else if(typeof Y.text!="string"){const ot=h.lineHeight;$.y+=Vc(Y,ot)+_}else $.y+=G}),wc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=Le(e.font),l=io(e.padding);if(!e.display)return;const r=Os(t.rtl,this.left,this.width),a=this.ctx,d=e.position,u=s.size/2,h=l.top+u;let _,m=this.left,x=this.width;if(this.isHorizontal())x=Math.max(...this.lineWidths),_=this.top+h,m=Pe(t.align,m,this.right-x);else{const S=this.columnSizes.reduce((v,M)=>Math.max(v,M.height),0);_=h+Pe(t.align,this.top,this.bottom-S-t.labels.padding-this._computeTitleHeight())}const $=Pe(d,m,m+x);a.textAlign=r.textAlign(gl(d)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,vn(a,e.text,$,_,s)}_computeTitleHeight(){const t=this.options.title,e=Le(t.font),s=io(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,l,r;if(Ps(t,this.left,this.right)&&Ps(e,this.top,this.bottom)){for(r=this.legendHitBoxes,s=0;s<r.length;++s)if(l=r[s],Ps(t,l.left,l.left+l.width)&&Ps(e,l.top,l.top+l.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!aT(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const l=this._hoveredItem,r=nT(l,s);l&&!r&&me(e.onLeave,[t,l,this],this),this._hoveredItem=s,s&&!r&&me(e.onHover,[t,s,this],this)}else s&&me(e.onClick,[t,s,this],this)}}function iT(o,t,e,s,l){const r=lT(s,o,t,e),a=rT(l,s,t.lineHeight);return{itemWidth:r,itemHeight:a}}function lT(o,t,e,s){let l=o.text;return l&&typeof l!="string"&&(l=l.reduce((r,a)=>r.length>a.length?r:a)),t+e.size/2+s.measureText(l).width}function rT(o,t,e){let s=o;return typeof t.text!="string"&&(s=Vc(t,e)),s}function Vc(o,t){const e=o.text?o.text.length:0;return t*e}function aT(o,t){return!!((o==="mousemove"||o==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(o==="click"||o==="mouseup"))}var cT={id:"legend",_element:ra,start(o,t,e){const s=o.legend=new ra({ctx:o.ctx,options:e,chart:o});so.configure(o,s,e),so.addBox(o,s)},stop(o){so.removeBox(o,o.legend),delete o.legend},beforeUpdate(o,t,e){const s=o.legend;so.configure(o,s,e),s.options=e},afterUpdate(o){const t=o.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(o,t){t.replay||o.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(o,t,e){const s=t.datasetIndex,l=e.chart;l.isDatasetVisible(s)?(l.hide(s),t.hidden=!0):(l.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:o=>o.chart.options.color,boxWidth:40,padding:10,generateLabels(o){const t=o.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:l,color:r,useBorderRadius:a,borderRadius:d}}=o.legend.options;return o._getSortedDatasetMetas().map(u=>{const h=u.controller.getStyle(e?0:void 0),_=io(h.borderWidth);return{text:t[u.index].label,fillStyle:h.backgroundColor,fontColor:r,hidden:!u.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(_.width+_.height)/4,strokeStyle:h.borderColor,pointStyle:s||h.pointStyle,rotation:h.rotation,textAlign:l||h.textAlign,borderRadius:a&&(d||h.borderRadius),datasetIndex:u.index}},this)}},title:{color:o=>o.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:o=>!o.startsWith("on"),labels:{_scriptable:o=>!["generateLabels","filter","sort"].includes(o)}}};class Wc extends $s{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const l=Ce(s.text)?s.text.length:1;this._padding=io(s.padding);const r=l*Le(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:l,right:r,options:a}=this,d=a.align;let u=0,h,_,m;return this.isHorizontal()?(_=Pe(d,s,r),m=e+t,h=r-s):(a.position==="left"?(_=s+t,m=Pe(d,l,e),u=Se*-.5):(_=r-t,m=Pe(d,e,l),u=Se*.5),h=l-e),{titleX:_,titleY:m,maxWidth:h,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=Le(e.font),r=s.lineHeight/2+this._padding.top,{titleX:a,titleY:d,maxWidth:u,rotation:h}=this._drawArgs(r);vn(t,e.text,0,0,s,{color:e.color,maxWidth:u,rotation:h,textAlign:gl(e.align),textBaseline:"middle",translation:[a,d]})}}function dT(o,t){const e=new Wc({ctx:o.ctx,options:t,chart:o});so.configure(o,e,t),so.addBox(o,e),o.titleBlock=e}var uT={id:"title",_element:Wc,start(o,t,e){dT(o,e)},stop(o){const t=o.titleBlock;so.removeBox(o,t),delete o.titleBlock},beforeUpdate(o,t,e){const s=o.titleBlock;so.configure(o,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const sn={average(o){if(!o.length)return!1;let t,e,s=new Set,l=0,r=0;for(t=0,e=o.length;t<e;++t){const d=o[t].element;if(d&&d.hasValue()){const u=d.tooltipPosition();s.add(u.x),l+=u.y,++r}}return r===0||s.size===0?!1:{x:[...s].reduce((d,u)=>d+u)/s.size,y:l/r}},nearest(o,t){if(!o.length)return!1;let e=t.x,s=t.y,l=Number.POSITIVE_INFINITY,r,a,d;for(r=0,a=o.length;r<a;++r){const u=o[r].element;if(u&&u.hasValue()){const h=u.getCenterPoint(),_=Ki(t,h);_<l&&(l=_,d=u)}}if(d){const u=d.tooltipPosition();e=u.x,s=u.y}return{x:e,y:s}}};function Mo(o,t){return t&&(Ce(t)?Array.prototype.push.apply(o,t):o.push(t)),o}function Vo(o){return(typeof o=="string"||o instanceof String)&&o.indexOf(`
28`)>-1?o.split(`
29`):o}function hT(o,t){const{element:e,datasetIndex:s,index:l}=t,r=o.getDatasetMeta(s).controller,{label:a,value:d}=r.getLabelAndValue(l);return{chart:o,label:a,parsed:r.getParsed(l),raw:o.data.datasets[s].data[l],formattedValue:d,dataset:r.getDataset(),dataIndex:l,datasetIndex:s,element:e}}function aa(o,t){const e=o.chart.ctx,{body:s,footer:l,title:r}=o,{boxWidth:a,boxHeight:d}=t,u=Le(t.bodyFont),h=Le(t.titleFont),_=Le(t.footerFont),m=r.length,x=l.length,$=s.length,S=io(t.padding);let v=S.height,M=0,w=s.reduce((tt,G)=>tt+G.before.length+G.lines.length+G.after.length,0);if(w+=o.beforeBody.length+o.afterBody.length,m&&(v+=m*h.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),w){const tt=t.displayColors?Math.max(d,u.lineHeight):u.lineHeight;v+=$*tt+(w-$)*u.lineHeight+(w-1)*t.bodySpacing}x&&(v+=t.footerMarginTop+x*_.lineHeight+(x-1)*t.footerSpacing);let I=0;const O=function(tt){M=Math.max(M,e.measureText(tt).width+I)};return e.save(),e.font=h.string,ue(o.title,O),e.font=u.string,ue(o.beforeBody.concat(o.afterBody),O),I=t.displayColors?a+2+t.boxPadding:0,ue(s,tt=>{ue(tt.before,O),ue(tt.lines,O),ue(tt.after,O)}),I=0,e.font=_.string,ue(o.footer,O),e.restore(),M+=S.width,{width:M,height:v}}function pT(o,t){const{y:e,height:s}=t;return e<s/2?"top":e>o.height-s/2?"bottom":"center"}function fT(o,t,e,s){const{x:l,width:r}=s,a=e.caretSize+e.caretPadding;if(o==="left"&&l+r+a>t.width||o==="right"&&l-r-a<0)return!0}function _T(o,t,e,s){const{x:l,width:r}=e,{width:a,chartArea:{left:d,right:u}}=o;let h="center";return s==="center"?h=l<=(d+u)/2?"left":"right":l<=r/2?h="left":l>=a-r/2&&(h="right"),fT(h,o,t,e)&&(h="center"),h}function ca(o,t,e){const s=e.yAlign||t.yAlign||pT(o,e);return{xAlign:e.xAlign||t.xAlign||_T(o,t,e,s),yAlign:s}}function mT(o,t){let{x:e,width:s}=o;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function vT(o,t,e){let{y:s,height:l}=o;return t==="top"?s+=e:t==="bottom"?s-=l+e:s-=l/2,s}function da(o,t,e,s){const{caretSize:l,caretPadding:r,cornerRadius:a}=o,{xAlign:d,yAlign:u}=e,h=l+r,{topLeft:_,topRight:m,bottomLeft:x,bottomRight:$}=un(a);let S=mT(t,d);const v=vT(t,u,h);return u==="center"?d==="left"?S+=h:d==="right"&&(S-=h):d==="left"?S-=Math.max(_,x)+l:d==="right"&&(S+=Math.max(m,$)+l),{x:oo(S,0,s.width-t.width),y:oo(v,0,s.height-t.height)}}function Nn(o,t,e){const s=io(e.padding);return t==="center"?o.x+o.width/2:t==="right"?o.x+o.width-s.right:o.x+s.left}function ua(o){return Mo([],Vo(o))}function gT(o,t,e){return ks(o,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ha(o,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?o.override(e):o}const Uc={beforeTitle:No,title(o){if(o.length>0){const t=o[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:No,beforeBody:No,beforeLabel:No,label(o){if(this&&this.options&&this.options.mode==="dataset")return o.label+": "+o.formattedValue||o.formattedValue;let t=o.dataset.label||"";t&&(t+=": ");const e=o.formattedValue;return fe(e)||(t+=e),t},labelColor(o){const e=o.chart.getDatasetMeta(o.datasetIndex).controller.getStyle(o.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(o){const e=o.chart.getDatasetMeta(o.datasetIndex).controller.getStyle(o.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:No,afterBody:No,beforeFooter:No,footer:No,afterFooter:No};function Ve(o,t,e,s){const l=o[t].call(e,s);return typeof l>"u"?Uc[t].call(e,s):l}class pa extends $s{static positioners=sn;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),l=s.enabled&&e.options.animation&&s.animations,r=new Sc(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=gT(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,l=Ve(s,"beforeTitle",this,t),r=Ve(s,"title",this,t),a=Ve(s,"afterTitle",this,t);let d=[];return d=Mo(d,Vo(l)),d=Mo(d,Vo(r)),d=Mo(d,Vo(a)),d}getBeforeBody(t,e){return ua(Ve(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,l=[];return ue(t,r=>{const a={before:[],lines:[],after:[]},d=ha(s,r);Mo(a.before,Vo(Ve(d,"beforeLabel",this,r))),Mo(a.lines,Ve(d,"label",this,r)),Mo(a.after,Vo(Ve(d,"afterLabel",this,r))),l.push(a)}),l}getAfterBody(t,e){return ua(Ve(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,l=Ve(s,"beforeFooter",this,t),r=Ve(s,"footer",this,t),a=Ve(s,"afterFooter",this,t);let d=[];return d=Mo(d,Vo(l)),d=Mo(d,Vo(r)),d=Mo(d,Vo(a)),d}_createItems(t){const e=this._active,s=this.chart.data,l=[],r=[],a=[];let d=[],u,h;for(u=0,h=e.length;u<h;++u)d.push(hT(this.chart,e[u]));return t.filter&&(d=d.filter((_,m,x)=>t.filter(_,m,x,s))),t.itemSort&&(d=d.sort((_,m)=>t.itemSort(_,m,s))),ue(d,_=>{const m=ha(t.callbacks,_);l.push(Ve(m,"labelColor",this,_)),r.push(Ve(m,"labelPointStyle",this,_)),a.push(Ve(m,"labelTextColor",this,_))}),this.labelColors=l,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=d,d}update(t,e){const s=this.options.setContext(this.getContext()),l=this._active;let r,a=[];if(!l.length)this.opacity!==0&&(r={opacity:0});else{const d=sn[s.position].call(this,l,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const u=this._size=aa(this,s),h=Object.assign({},d,u),_=ca(this.chart,s,h),m=da(s,h,_,this.chart);this.xAlign=_.xAlign,this.yAlign=_.yAlign,r={opacity:1,x:m.x,y:m.y,width:u.width,height:u.height,caretX:d.x,caretY:d.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,l){const r=this.getCaretPosition(t,s,l);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,s){const{xAlign:l,yAlign:r}=this,{caretSize:a,cornerRadius:d}=s,{topLeft:u,topRight:h,bottomLeft:_,bottomRight:m}=un(d),{x,y:$}=t,{width:S,height:v}=e;let M,w,I,O,tt,G;return r==="center"?(tt=$+v/2,l==="left"?(M=x,w=M-a,O=tt+a,G=tt-a):(M=x+S,w=M+a,O=tt-a,G=tt+a),I=M):(l==="left"?w=x+Math.max(u,_)+a:l==="right"?w=x+S-Math.max(h,m)-a:w=this.caretX,r==="top"?(O=$,tt=O-a,M=w-a,I=w+a):(O=$+v,tt=O+a,M=w+a,I=w-a),G=O),{x1:M,x2:w,x3:I,y1:O,y2:tt,y3:G}}drawTitle(t,e,s){const l=this.title,r=l.length;let a,d,u;if(r){const h=Os(s.rtl,this.x,this.width);for(t.x=Nn(this,s.titleAlign,s),e.textAlign=h.textAlign(s.titleAlign),e.textBaseline="middle",a=Le(s.titleFont),d=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,u=0;u<r;++u)e.fillText(l[u],h.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+d,u+1===r&&(t.y+=s.titleMarginBottom-d)}}_drawColorBox(t,e,s,l,r){const a=this.labelColors[s],d=this.labelPointStyles[s],{boxHeight:u,boxWidth:h}=r,_=Le(r.bodyFont),m=Nn(this,"left",r),x=l.x(m),$=u<_.lineHeight?(_.lineHeight-u)/2:0,S=e.y+$;if(r.usePointStyle){const v={radius:Math.min(h,u)/2,pointStyle:d.pointStyle,rotation:d.rotation,borderWidth:1},M=l.leftForLtr(x,h)+h/2,w=S+u/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Qi(t,v,M,w),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Qi(t,v,M,w)}else{t.lineWidth=te(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const v=l.leftForLtr(x,h),M=l.leftForLtr(l.xPlus(x,1),h-2),w=un(a.borderRadius);Object.values(w).some(I=>I!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ji(t,{x:v,y:S,w:h,h:u,radius:w}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Ji(t,{x:M,y:S+1,w:h-2,h:u-2,radius:w}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(v,S,h,u),t.strokeRect(v,S,h,u),t.fillStyle=a.backgroundColor,t.fillRect(M,S+1,h-2,u-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:l}=this,{bodySpacing:r,bodyAlign:a,displayColors:d,boxHeight:u,boxWidth:h,boxPadding:_}=s,m=Le(s.bodyFont);let x=m.lineHeight,$=0;const S=Os(s.rtl,this.x,this.width),v=function(ht){e.fillText(ht,S.x(t.x+$),t.y+x/2),t.y+=x+r},M=S.textAlign(a);let w,I,O,tt,G,Y,et;for(e.textAlign=a,e.textBaseline="middle",e.font=m.string,t.x=Nn(this,M,s),e.fillStyle=s.bodyColor,ue(this.beforeBody,v),$=d&&M!=="right"?a==="center"?h/2+_:h+2+_:0,tt=0,Y=l.length;tt<Y;++tt){for(w=l[tt],I=this.labelTextColors[tt],e.fillStyle=I,ue(w.before,v),O=w.lines,d&&O.length&&(this._drawColorBox(e,t,tt,S,s),x=Math.max(m.lineHeight,u)),G=0,et=O.length;G<et;++G)v(O[G]),x=m.lineHeight;ue(w.after,v)}$=0,x=m.lineHeight,ue(this.afterBody,v),t.y-=r}drawFooter(t,e,s){const l=this.footer,r=l.length;let a,d;if(r){const u=Os(s.rtl,this.x,this.width);for(t.x=Nn(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=u.textAlign(s.footerAlign),e.textBaseline="middle",a=Le(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,d=0;d<r;++d)e.fillText(l[d],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,l){const{xAlign:r,yAlign:a}=this,{x:d,y:u}=t,{width:h,height:_}=s,{topLeft:m,topRight:x,bottomLeft:$,bottomRight:S}=un(l.cornerRadius);e.fillStyle=l.backgroundColor,e.strokeStyle=l.borderColor,e.lineWidth=l.borderWidth,e.beginPath(),e.moveTo(d+m,u),a==="top"&&this.drawCaret(t,e,s,l),e.lineTo(d+h-x,u),e.quadraticCurveTo(d+h,u,d+h,u+x),a==="center"&&r==="right"&&this.drawCaret(t,e,s,l),e.lineTo(d+h,u+_-S),e.quadraticCurveTo(d+h,u+_,d+h-S,u+_),a==="bottom"&&this.drawCaret(t,e,s,l),e.lineTo(d+$,u+_),e.quadraticCurveTo(d,u+_,d,u+_-$),a==="center"&&r==="left"&&this.drawCaret(t,e,s,l),e.lineTo(d,u+m),e.quadraticCurveTo(d,u,d+m,u),e.closePath(),e.fill(),l.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,l=s&&s.x,r=s&&s.y;if(l||r){const a=sn[t.position].call(this,this._active,this._eventPosition);if(!a)return;const d=this._size=aa(this,t),u=Object.assign({},a,this._size),h=ca(e,t,u),_=da(t,u,h,e);(l._to!==_.x||r._to!==_.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=d.width,this.height=d.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,_))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const l={width:this.width,height:this.height},r={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=io(e.padding),d=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&d&&(t.save(),t.globalAlpha=s,this.drawBackground(r,t,l,e),yc(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),wc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,l=t.map(({datasetIndex:d,index:u})=>{const h=this.chart.getDatasetMeta(d);if(!h)throw new Error("Cannot find a dataset at index "+d);return{datasetIndex:d,element:h.data[u],index:u}}),r=!Kn(s,l),a=this._positionChanged(l,e);(r||a)&&(this._active=l,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,s),d=this._positionChanged(a,t),u=e||!Kn(a,r)||d;return u&&(this._active=a,(l.enabled||l.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,s,l){const r=this.options;if(t.type==="mouseout")return[];if(!l)return e.filter(d=>this.chart.data.datasets[d.datasetIndex]&&this.chart.getDatasetMeta(d.datasetIndex).controller.getParsed(d.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,s);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:l,options:r}=this,a=sn[r.position].call(this,t,e);return a!==!1&&(s!==a.x||l!==a.y)}}var bT={id:"tooltip",_element:pa,positioners:sn,afterInit(o,t,e){e&&(o.tooltip=new pa({chart:o,options:e}))},beforeUpdate(o,t,e){o.tooltip&&o.tooltip.initialize(e)},reset(o,t,e){o.tooltip&&o.tooltip.initialize(e)},afterDraw(o){const t=o.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(o.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(o.ctx),o.notifyPlugins("afterTooltipDraw",e)}},afterEvent(o,t){if(o.tooltip){const e=t.replay;o.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(o,t)=>t.bodyFont.size,boxWidth:(o,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Uc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:o=>o!=="filter"&&o!=="itemSort"&&o!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const xT=(o,t,e,s)=>(typeof t=="string"?(e=o.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function yT(o,t,e,s){const l=o.indexOf(t);if(l===-1)return xT(o,t,e,s);const r=o.lastIndexOf(t);return l!==r?e:l}const wT=(o,t)=>o===null?null:oo(Math.round(o),0,t);function fa(o){const t=this.getLabels();return o>=0&&o<t.length?t[o]:o}class kT extends Ws{static id="category";static defaults={ticks:{callback:fa}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:l,label:r}of e)s[l]===r&&s.splice(l,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(fe(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:yT(s,t,Gt(e,t),this._addedLabels),wT(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:l}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(l=this.getLabels().length-1)),this.min=s,this.max=l}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,l=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)l.push({value:a});return l}getLabelForValue(t){return fa.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function $T(o,t){const e=[],{bounds:l,step:r,min:a,max:d,precision:u,count:h,maxTicks:_,maxDigits:m,includeBounds:x}=o,$=r||1,S=_-1,{min:v,max:M}=t,w=!fe(a),I=!fe(d),O=!fe(h),tt=(M-v)/(m+1);let G=pr((M-v)/S/$)*$,Y,et,ht,ct;if(G<1e-14&&!w&&!I)return[{value:v},{value:M}];ct=Math.ceil(M/G)-Math.floor(v/G),ct>S&&(G=pr(ct*G/S/$)*$),fe(u)||(Y=Math.pow(10,u),G=Math.ceil(G*Y)/Y),l==="ticks"?(et=Math.floor(v/G)*G,ht=Math.ceil(M/G)*G):(et=v,ht=M),w&&I&&r&&VD((d-a)/r,G/1e3)?(ct=Math.round(Math.min((d-a)/G,_)),G=(d-a)/ct,et=a,ht=d):O?(et=w?a:et,ht=I?d:ht,ct=h-1,G=(ht-et)/ct):(ct=(ht-et)/G,an(ct,Math.round(ct),G/1e3)?ct=Math.round(ct):ct=Math.ceil(ct));const dt=Math.max(fr(G),fr(et));Y=Math.pow(10,fe(u)?dt:u),et=Math.round(et*Y)/Y,ht=Math.round(ht*Y)/Y;let pt=0;for(w&&(x&&et!==a?(e.push({value:a}),et<a&&pt++,an(Math.round((et+pt*G)*Y)/Y,a,_a(a,tt,o))&&pt++):et<a&&pt++);pt<ct;++pt){const D=Math.round((et+pt*G)*Y)/Y;if(I&&D>d)break;e.push({value:D})}return I&&x&&ht!==d?e.length&&an(e[e.length-1].value,d,_a(d,tt,o))?e[e.length-1].value=d:e.push({value:d}):(!I||ht===d)&&e.push({value:ht}),e}function _a(o,t,{horizontal:e,minRotation:s}){const l=gs(s),r=(e?Math.sin(l):Math.cos(l))||.001,a=.75*t*(""+o).length;return Math.min(t/r,a)}class CT extends Ws{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return fe(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:l,max:r}=this;const a=u=>l=e?l:u,d=u=>r=s?r:u;if(t){const u=Is(l),h=Is(r);u<0&&h<0?d(0):u>0&&h>0&&a(0)}if(l===r){let u=r===0?1:Math.abs(r*.05);d(r+u),t||a(l-u)}this.min=l,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,l;return s?(l=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),e=e||11),e&&(l=Math.min(e,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const l={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,a=$T(l,r);return t.bounds==="ticks"&&WD(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const l=(s-e)/Math.max(t.length-1,1)/2;e-=l,s+=l}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return hc(t,this.chart.options.locale,this.options.ticks.format)}}class MT extends CT{static id="linear";static defaults={ticks:{callback:pc.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Re(t)?t:0,this.max=Re(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=gs(this.options.ticks.minRotation),l=(t?Math.sin(s):Math.cos(s))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/l))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const _i={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ue=Object.keys(_i);function ma(o,t){return o-t}function va(o,t){if(fe(t))return null;const e=o._adapter,{parser:s,round:l,isoWeekday:r}=o._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),Re(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(l&&(a=l==="week"&&(_n(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,l)),+a)}function ga(o,t,e,s){const l=Ue.length;for(let r=Ue.indexOf(o);r<l-1;++r){const a=_i[Ue[r]],d=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(d*a.size))<=s)return Ue[r]}return Ue[l-1]}function ST(o,t,e,s,l){for(let r=Ue.length-1;r>=Ue.indexOf(e);r--){const a=Ue[r];if(_i[a].common&&o._adapter.diff(l,s,a)>=t-1)return a}return Ue[e?Ue.indexOf(e):0]}function DT(o){for(let t=Ue.indexOf(o)+1,e=Ue.length;t<e;++t)if(_i[Ue[t]].common)return Ue[t]}function ba(o,t,e){if(!e)o[t]=!0;else if(e.length){const{lo:s,hi:l}=vl(e,t),r=e[s]>=t?e[s]:e[l];o[r]=!0}}function AT(o,t,e,s){const l=o._adapter,r=+l.startOf(t[0].value,s),a=t[t.length-1].value;let d,u;for(d=r;d<=a;d=+l.add(d,1,s))u=e[d],u>=0&&(t[u].major=!0);return t}function xa(o,t,e){const s=[],l={},r=t.length;let a,d;for(a=0;a<r;++a)d=t[a],l[d]=a,s.push({value:d,major:!1});return r===0||!e?s:AT(o,s,l,e)}class ya extends Ws{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),l=this._adapter=new bz._date(t.adapters.date);l.init(e),rn(s.displayFormats,l.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:va(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:l,max:r,minDefined:a,maxDefined:d}=this.getUserBounds();function u(h){!a&&!isNaN(h.min)&&(l=Math.min(l,h.min)),!d&&!isNaN(h.max)&&(r=Math.max(r,h.max))}(!a||!d)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),l=Re(l)&&!isNaN(l)?l:+e.startOf(Date.now(),s),r=Re(r)&&!isNaN(r)?r:+e.endOf(Date.now(),s)+1,this.min=Math.min(l,r-1),this.max=Math.max(l+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,l=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&l.length&&(this.min=this._userMin||l[0],this.max=this._userMax||l[l.length-1]);const r=this.min,a=this.max,d=KD(l,r,a);return this._unit=e.unit||(s.autoSkip?ga(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):ST(this,d.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:DT(this._unit),this.initOffsets(l),t.reverse&&d.reverse(),xa(this,d,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,l,r;this.options.offset&&t.length&&(l=this.getDecimalForValue(t[0]),t.length===1?e=1-l:e=(this.getDecimalForValue(t[1])-l)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?s=r:s=(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=oo(e,0,a),s=oo(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,l=this.options,r=l.time,a=r.unit||ga(r.minUnit,e,s,this._getLabelCapacity(e)),d=Gt(l.ticks.stepSize,1),u=a==="week"?r.isoWeekday:!1,h=_n(u)||u===!0,_={};let m=e,x,$;if(h&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,h?"day":a),t.diff(s,e,a)>1e5*d)throw new Error(e+" and "+s+" are too far apart with stepSize of "+d+" "+a);const S=l.ticks.source==="data"&&this.getDataTimestamps();for(x=m,$=0;x<s;x=+t.add(x,d,a),$++)ba(_,x,S);return(x===s||l.bounds==="ticks"||$===1)&&ba(_,x,S),Object.keys(_).sort(ma).map(v=>+v)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const l=this.options.time.displayFormats,r=this._unit,a=e||l[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,l){const r=this.options,a=r.ticks.callback;if(a)return me(a,[t,e,s],this);const d=r.time.displayFormats,u=this._unit,h=this._majorUnit,_=u&&d[u],m=h&&d[h],x=s[e],$=h&&m&&x&&x.major;return this._adapter.format(t,l||($?m:_))}generateTickLabels(t){let e,s,l;
29for(e=0,s=t.length;e<s;++e)l=t[e],l.label=this._tickFormatFunction(l.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,l=gs(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(l),a=Math.sin(l),d=this._resolveTickFontOptions(0).size;return{w:s*r+d*a,h:s*a+d*r}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,l=s[e.unit]||s.millisecond,r=this._tickFormatFunction(t,0,xa(this,[t],this._majorUnit),l),a=this._getLabelSize(r),d=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return d>0?d:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(e=0,s=l.length;e<s;++e)t=t.concat(l[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const l=this.getLabels();for(e=0,s=l.length;e<s;++e)t.push(va(this,l[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return QD(t.sort(ma))}}function Hn(o,t,e){let s=0,l=o.length-1,r,a,d,u;e?(t>=o[s].pos&&t<=o[l].pos&&({lo:s,hi:l}=bs(o,"pos",t)),{pos:r,time:d}=o[s],{pos:a,time:u}=o[l]):(t>=o[s].time&&t<=o[l].time&&({lo:s,hi:l}=bs(o,"time",t)),{time:r,pos:d}=o[s],{time:a,pos:u}=o[l]);const h=a-r;return h?d+(u-d)*(t-r)/h:d}class rV extends ya{static id="timeseries";static defaults=ya.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Hn(e,this.min),this._tableRange=Hn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,l=[],r=[];let a,d,u,h,_;for(a=0,d=t.length;a<d;++a)h=t[a],h>=e&&h<=s&&l.push(h);if(l.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,d=l.length;a<d;++a)_=l[a+1],u=l[a-1],h=l[a],Math.round((_+u)/2)!==h&&r.push({time:h,pos:a/(d-1)});return r}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((l,r)=>l-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Hn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Hn(this._table,s*this._tableRange+this._minPos,!0)}}const Yc={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},zT={ariaLabel:{type:String},ariaDescribedby:{type:String}},jT={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Yc,...zT},TT=Cd[0]==="2"?(o,t)=>Object.assign(o,{attrs:t}):(o,t)=>Object.assign(o,t);function js(o){return La(o)?Ni(o):o}function PT(o){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o;return La(t)?new Proxy(o,{}):o}function LT(o,t){const e=o.options;e&&t&&Object.assign(e,t)}function qc(o,t){o.labels=t}function Zc(o,t,e){const s=[];o.datasets=t.map(l=>{const r=o.datasets.find(a=>a[e]===l[e]);return!r||!l.data||s.includes(r)?{...l}:(s.push(r),Object.assign(r,l),r)})}function RT(o,t){const e={labels:[],datasets:[]};return qc(e,o.labels),Zc(e,o.datasets,t),e}const OT=Ta({props:jT,setup(o,t){let{expose:e,slots:s}=t;const l=z(null),r=Ii(null);e({chart:r});const a=()=>{if(!l.value)return;const{type:h,data:_,options:m,plugins:x,datasetIdKey:$}=o,S=RT(_,$),v=PT(S,_);r.value=new hi(l.value,{type:h,data:v,options:{...m},plugins:x})},d=()=>{const h=Ni(r.value);h&&(o.destroyDelay>0?setTimeout(()=>{h.destroy(),r.value=null},o.destroyDelay):(h.destroy(),r.value=null))},u=h=>{h.update(o.updateMode)};return we(a),Pa(d),pe([()=>
vendor: 5,393 bytes, line 29
29o.options,()=>o.data],(h,_)=>{let[m,x]=h,[$,S]=_;const v=Ni(r.value);if(!v)return;let M=!1;if(m){const w=js(m),I=js($);w&&w!==I&&(LT(v,w),M=!0)}if(x){const w=js(x.labels),I=js(S.labels),O=js(x.datasets),tt=js(S.datasets);w!==I&&(qc(v.config.data,w),M=!0),O&&O!==tt&&(Zc(v.config.data,O,o.datasetIdKey),M=!0)}M&&Xn(()=>{u(v)})},{deep:!0}),()=>Fi("canvas",{role:"img","aria-label":o.ariaLabel,"aria-describedby":o.ariaDescribedby,ref:l},[Fi("p",{},[s.default?s.default():""])])}});function BT(o,t){return hi.register(t),Ta({props:Yc,setup(e,s){let{expose:l}=s;const r=Ii(null),a=Ii(null);pe(()=>a.value?.chart??null,u=>{r.value=u},{flush:"sync"}),l({chart:r});const d=u=>{a.value=u};return()=>Fi(OT,TT({ref:d},{type:o,...e}))}})}const ET=BT("line",gz);var Yn={exports:{}},FT=Yn.exports,wa;function Xc(){return wa||(wa=1,(function(o,t){(function(e,s){o.exports=s()})(FT,(function(){var e=1e3,s=6e4,l=36e5,r="millisecond",a="second",d="minute",u="hour",h="day",_="week",m="month",x="quarter",$="year",S="date",v="Invalid Date",M=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(ot){var st=["th","st","nd","rd"],X=ot%100;return"["+ot+(st[(X-20)%10]||st[X]||st[0])+"]"}},O=function(ot,st,X){var H=String(ot);return!H||H.length>=st?ot:""+Array(st+1-H.length).join(X)+ot},tt={s:O,z:function(ot){var st=-ot.utcOffset(),X=Math.abs(st),H=Math.floor(X/60),P=X%60;return(st<=0?"+":"-")+O(H,2,"0")+":"+O(P,2,"0")},m:function ot(st,X){if(st.date()<X.date())return-ot(X,st);var H=12*(X.year()-st.year())+(X.month()-st.month()),P=st.clone().add(H,m),W=X-P<0,U=st.clone().add(H+(W?-1:1),m);return+(-(H+(X-P)/(W?P-U:U-P))||0)},a:function(ot){return ot<0?Math.ceil(ot)||0:Math.floor(ot)},p:function(ot){return{M:m,y:$,w:_,d:h,D:S,h:u,m:d,s:a,ms:r,Q:x}[ot]||String(ot||"").toLowerCase().replace(/s$/,"")},u:function(ot){return ot===void 0}},G="en",Y={};Y[G]=I;var et="$isDayjsObject",ht=function(ot){return ot instanceof D||!(!ot||!ot[et])},ct=function ot(st,X,H){var P;if(!st)return G;if(typeof st=="string"){var W=st.toLowerCase();Y[W]&&(P=W),X&&(Y[W]=X,P=W);var U=st.split("-");if(!P&&U.length>1)return ot(U[0])}else{var B=st.name;Y[B]=st,P=B}return!H&&P&&(G=P),P||!H&&G},dt=function(ot,st){if(ht(ot))return ot.clone();var X=typeof st=="object"?st:{};return X.date=ot,X.args=arguments,new D(X)},pt=tt;pt.l=ct,pt.i=ht,pt.w=function(ot,st){return dt(ot,{locale:st.$L,utc:st.$u,x:st.$x,$offset:st.$offset})};var D=(function(){function ot(X){this.$L=ct(X.locale,null,!0),this.parse(X),this.$x=this.$x||X.x||{},this[et]=!0}var st=ot.prototype;return st.parse=function(X){this.$d=(function(H){var P=H.date,W=H.utc;if(P===null)return new Date(NaN);if(pt.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var U=P.match(M);if(U){var B=U[2]-1||0,Z=(U[7]||"0").substring(0,3);return W?new Date(Date.UTC(U[1],B,U[3]||1,U[4]||0,U[5]||0,U[6]||0,Z)):new Date(U[1],B,U[3]||1,U[4]||0,U[5]||0,U[6]||0,Z)}}return new Date(P)})(X),this.init()},st.init=function(){var X=this.$d;this.$y=X.getFullYear(),this.$M=X.getMonth(),this.$D=X.getDate(),this.$W=X.getDay(),this.$H=X.getHours(),this.$m=X.getMinutes(),this.$s=X.getSeconds(),this.$ms=X.getMilliseconds()},st.$utils=function(){return pt},st.isValid=function(){return this.$d.toString()!==v},st.isSame=function(X,H){var P=dt(X);return this.startOf(H)<=P&&P<=this.endOf(H)},st.isAfter=function(X,H){return dt(X)<this.startOf(H)},st.isBefore=function(X,H){return this.endOf(H)<dt(X)},st.$g=function(X,H,P){return pt.u(X)?this[H]:this.set(P,X)},st.unix=function(){return Math.floor(this.valueOf()/1e3)},st.valueOf=function(){return this.$d.getTime()},st.startOf=function(X,H){var P=this,W=!!pt.u(H)||H,U=pt.p(X),B=function(yt,Ft){var N=pt.w(P.$u?Date.UTC(P.$y,Ft,yt):new Date(P.$y,Ft,yt),P);return W?N:N.endOf(h)},Z=function(yt,Ft){return pt.w(P.toDate()[yt].apply(P.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(Ft)),P)},q=this.$W,ut=this.$M,wt=this.$D,St="set"+(this.$u?"UTC":"");switch(U){case $:return W?B(1,0):B(31,11);case m:return W?B(1,ut):B(0,ut+1);case _:var Tt=this.$locale().weekStart||0,vt=(q<Tt?q+7:q)-Tt;return B(W?wt-vt:wt+(6-vt),ut);case h:case S:return Z(St+"Hours",0);case u:return Z(St+"Minutes",1);case d:return Z(St+"Seconds",2);case a:return Z(St+"Milliseconds",3);default:return this.clone()}},st.endOf=function(X){return this.startOf(X,!1)},st.$set=function(X,H){var P,W=pt.p(X),U="set"+(this.$u?"UTC":""),B=(P={},P[h]=U+"Date",P[S]=U+"Date",P[m]=U+"Month",P[$]=U+"FullYear",P[u]=U+"Hours",P[d]=U+"Minutes",P[a]=U+"Seconds",P[r]=U+"Milliseconds",P)[W],Z=W===h?this.$D+(H-this.$W):H;if(W===m||W===$){var q=this.clone().set(S,1);q.$d[B](Z),q.init(),this.$d=q.set(S,Math.min(this.$D,q.daysInMonth())).$d}else B&&this.$d[B](Z);return this.init(),this},st.set=function(X,H){return this.clone().$set(X,H)},st.get=function(X){return this[pt.p(X)]()},st.add=function(X,H){var P,W=this;X=Number(X);var U=pt.p(H),B=function(ut){var wt=dt(W);return pt.w(wt.date(wt.date()+Math.round(ut*X)),W)};if(U===m)return this.set(m,this.$M+X);if(U===$)return this.set($,this.$y+X);
vendor: 2,435 bytes, line 29
29if(U===h)return B(1);if(U===_)return B(7);var Z=(P={},P[d]=s,P[u]=l,P[a]=e,P)[U]||1,q=this.$d.getTime()+X*Z;return pt.w(q,this)},st.subtract=function(X,H){return this.add(-1*X,H)},st.format=function(X){var H=this,P=this.$locale();if(!this.isValid())return P.invalidDate||v;var W=X||"YYYY-MM-DDTHH:mm:ssZ",U=pt.z(this),B=this.$H,Z=this.$m,q=this.$M,ut=P.weekdays,wt=P.months,St=P.meridiem,Tt=function(Ft,N,$t,T){return Ft&&(Ft[N]||Ft(H,W))||$t[N].slice(0,T)},vt=function(Ft){return pt.s(B%12||12,Ft,"0")},yt=St||function(Ft,N,$t){var T=Ft<12?"AM":"PM";return $t?T.toLowerCase():T};return W.replace(w,(function(Ft,N){return N||(function($t){switch($t){case"YY":return String(H.$y).slice(-2);case"YYYY":return pt.s(H.$y,4,"0");case"M":return q+1;case"MM":return pt.s(q+1,2,"0");case"MMM":return Tt(P.monthsShort,q,wt,3);case"MMMM":return Tt(wt,q);case"D":return H.$D;case"DD":return pt.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return Tt(P.weekdaysMin,H.$W,ut,2);case"ddd":return Tt(P.weekdaysShort,H.$W,ut,3);case"dddd":return ut[H.$W];case"H":return String(B);case"HH":return pt.s(B,2,"0");case"h":return vt(1);case"hh":return vt(2);case"a":return yt(B,Z,!0);case"A":return yt(B,Z,!1);case"m":return String(Z);case"mm":return pt.s(Z,2,"0");case"s":return String(H.$s);case"ss":return pt.s(H.$s,2,"0");case"SSS":return pt.s(H.$ms,3,"0");case"Z":return U}return null})(Ft)||U.replace(":","")}))},st.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},st.diff=function(X,H,P){var W,U=this,B=pt.p(H),Z=dt(X),q=(Z.utcOffset()-this.utcOffset())*s,ut=this-Z,wt=function(){return pt.m(U,Z)};switch(B){case $:W=wt()/12;break;case m:W=wt();break;case x:W=wt()/3;break;case _:W=(ut-q)/6048e5;break;case h:W=(ut-q)/864e5;break;case u:W=ut/l;break;case d:W=ut/s;break;case a:W=ut/e;break;default:W=ut}return P?W:pt.a(W)},st.daysInMonth=function(){return this.endOf(m).$D},st.$locale=function(){return Y[this.$L]},st.locale=function(X,H){if(!X)return this.$L;var P=this.clone(),W=ct(X,H,!0);return W&&(P.$L=W),P},st.clone=function(){return pt.w(this.$d,this)},st.toDate=function(){return new Date(this.valueOf())},st.toJSON=function(){return this.isValid()?this.toISOString():null},st.toISOString=function(){return this.$d.toISOString()},st.toString=function(){return this.$d.toUTCString()},ot})(),Mt=D.prototype;return dt.prototype=Mt,[["$ms",r],["$s",a],["$m",d],["$H",u],["$W",h],["$M",m],["$y",$],["$D",S]].forEac
29h((function(ot){Mt[ot[1]]=function(st){return this.$g(st,ot[0],ot[1])}})),dt.extend=function(ot,st){return ot.$i||(ot(st,D,dt),ot.$i=!0),dt},dt.locale=ct,dt.isDayjs=ht,dt.unix=function(ot){return dt(1e3*ot)},dt.en=Y[G],dt.Ls=Y,dt.p={},dt}))})(Yn)),Yn.exports}var IT=Xc();const tn=Ba(IT);var qn={exports:{}},NT=qn.exports,ka;function HT(){return ka||(ka=1,(function(o,t){(function(e,s){o.exports=s()})(NT,(function(){var e="day";return function(s,l,r){var a=function(h){return h.add(4-h.isoWeekday(),e)},d=l.prototype;d.isoWeekYear=function(){return a(this).year()},d.isoWeek=function(h){if(!this.$utils().u(h))return this.add(7*(h-this.isoWeek()),e);var _,m,x,$,S=a(this),v=(_=this.isoWeekYear(),m=this.$u,x=(m?r.utc:r)().year(_).startOf("year"),$=4-x.isoWeekday(),x.isoWeekday()>4&&($+=7),x.add($,e));return S.diff(v,"week")+1},d.isoWeekday=function(h){return this.$utils().u(h)?this.day()||7:this.day(this.day()%7?h:h-7)};var u=d.startOf;d.startOf=function(h,_){var m=this.$utils(),x=!!m.u(_)||_;return m.p(h)==="isoweek"?x?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(h,_)}}}))})(qn)),qn.exports}var VT=HT();const WT=Ba(VT);var Zn={exports:{}},UT=Zn.exports,$a;function YT(){return $a||($a=1,(function(o,t){(function(e,s){o.exports=s(Xc())})(UT,(function(e){function s(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var l=s(e),r={name:"th",weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"},ordinal:function(a){return a+"."}};return l.default.locale(r,null,!0),r}))})(Zn)),Zn.exports}YT();const qT={style:{height:"300px"}},Ca={__name:"AreaChart",props:{data:{type:Array,default:()=>[]},labelKey:{type:String,default:"ค่าคอมมิชชั่น (บาท)"},type:{type:String,default:"income"}},setup(o){const{t}=ee(),e=ke(),{t:s,locale:l}=ee();tn.extend(WT),tn.locale("th"),hi.register(uT,bT,cT,pi,kT,MT,Bj,sT);const r=o,a=x=>{if(!x.length)return"daily";const $=x[0].date;return/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test($)?"daily":/^\d{4}-\d{2}-\d{2}$/.test($)?"monthly":/^\d{4}-\d{2}$/.test($)?"yearly":"daily"},d=x=>{const $=[{start:0,end:6,total:0},{start:6,end:12,total:0},{start:12,end:18,total:0},{start:18,end:24,total:0}];x.forEach(M=>{const w=tn(M.date).hour(),I=$.find(O=>w>=O.start&&w<O.end);I&&(I.total+=M.amount)});const S=window.innerWidth<768,v=(M,w)=>{if(l.value==="th")return`${String(M).padStart(2,"0")}:${w}`;const I=M%12||12;return`${String(I).padStart(2,"0")}:${w}`};return $.map(M=>{const w=v(M.start,"01"),I=M.end===24?0:M.end,O=v(I,"00");let tt=l.value==="th"?`${w} - ${O} ${s("am")}`:`${w} - ${O} ${M.end<=12?s("am"):s("pm")}`;return S&&(tt=tt.replace(" - ",` -
30`)),{label:tt,total:M.total}})},u=x=>{const $={};let S=1;x.forEach(M=>{const w=tn(M.date),I=w.startOf("week").format("DD/MM/YY"),O=w.endOf("week").format("DD/MM/YY"),tt=`${I}
30-${O}`;$[tt]||($[tt]={week:S,total:0,range:`${I} - ${O}`},S++),$[tt].total+=M.amount});const v=window.innerWidth<768;return Object.values($).map(M=>({label:v?`${s("week")} ${M.week}`:`${s("week")} ${M.week}
31(${M.range})`,total:M.total,range:M.range}))},h=x=>x.map($=>{const S=tn($.date+"-01").locale(l.value),v=S.format("MMM"),M=S.format("MMMM");return{label:v,total:$.amount,fullLabel:M}}),_=lt(()=>{const x=a(r.data);let $=[];x==="daily"?$=d(r.data):x==="monthly"?$=u(r.data):x==="yearly"&&($=h(r.data));const S=lt(()=>r.type==="click"),v=(S.value,e.color),M=(S.value,"rgba(255, 253, 245, 0.5)");return{labels:$.map(w=>w.label),datasets:[{label:r.labelKey,data:$.map(w=>w.total),backgroundColor:M,borderColor:v,fill:!0,tension:.4,_fullLabels:$.map(w=>w.fullLabel||w.label),_ranges:$.map(w=>w.range||"")}]}}),m=lt(()=>{const x=a(r.data),$=lt(()=>r.type==="click");let S=t("daily");if(x==="monthly")S=t("month");else if(x==="yearly"){const v=r.data[0]?.date?.split("-")[0],M=v?parseInt(v)+543:"";S=`${t("year")} (${M})`}return{responsive:!0,maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,ticks:{callback:v=>v.toLocaleString()}},x:{ticks:{autoSkip:!1,font:{size:12,weight:"400"},callback:function(v){return this.getLabelForValue(v).split(`
32`)}},title:{display:!0,text:S,font:{size:12,weight:"400"},padding:{top:20}}}},plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1,backgroundColor:"#fff",displayColors:!1,titleColor:"#000",bodyFont:{family:"sans-serif"},callbacks:{title:function(v){const M=a(r.data),w=v[0].dataIndex,I=v[0].dataset;if(M==="yearly")return I._fullLabels[w];if(M==="daily")return t("time_range")+v[0].label;if(M==="monthly"){const O=v[0].label.split(`
33`)[0],tt=I._ranges[w];return tt?[O,tt]:[O]}return[v[0].label]},label:function(v){const M=v.raw,w=$.value?s("click_time"):s("baht");return`${M.toLocaleString()} ${w}`},labelTextColor:function(v){return v.dataset.borderColor}}}}}});return(x,$)=>
33(p(),f("div",qT,[zt(n(ET),{data:_.value,options:m.value},null,8,["data","options"])]))}},Kc=""+new URL("defaultCat.8fI3_S0l.webp",import.meta.url).href,ZT={class:"flex-1 text-left ml-1 text-[16px]"},XT={key:0,class:"absolute z-30 right-0 mt-2 bg-white rounded-xl shadow-xl p-4 w-[420px]"},KT={class:"flex"},GT={class:"w-1/4 border-r-[1px] border-gray-300 pr-2"},QT=["onClick"],JT={class:"flex-1 pl-4"},tP={key:0,class:"text-center"},eP={class:"flex items-center justify-between mb-2"},oP={class:"font-semibold"},sP={class:"grid grid-cols-7 text-sm font-medium mb-2 text-gray-500"},nP={class:"grid grid-cols-7 gap-1 text-center"},iP=["onClick"],lP={key:1,class:"text-center"},rP={class:"font-semibold mb-2"},aP={class:"grid grid-cols-3 gap-2"},cP=["onClick"],dP={key:2,class:"text-center"},uP={class:"flex justify-between items-center mb-2"},hP={class:"font-semibold"},pP={class:"grid grid-cols-4 gap-2"},fP=["onClick"],_P={class:"flex justify-end mt-4 border-t-[1px] border-gray-300 pt-3"},mP={key:0,class:"fixed inset-0 z-50 bg-black/50 flex"},vP={class:"bg-white w-full max-w-md h-full flex flex-col relative"},gP={class:"relative w-full mt-5 px-2 flex items-center justify-between"},bP=["src"],xP={class:"px-4 py-3 mt-3"},yP={class:"relative w-full"},wP=["value"],kP={class:"flex justify-around px-4 py-3 border-b border-gray-300 w-[83%] mx-auto"},$P=["onClick"],CP={class:"flex-1 overflow-auto p-4 text-center"},MP={key:0},SP={class:"flex items-center justify-between mb-2 border-b border-gray-300 pb-3 w-[93%] mx-auto"},DP={class:"font-semibold"},AP={class:"grid grid-cols-7 text-sm font-medium mb-2 mt-3 text-gray-500"},zP={class:"grid grid-cols-7 gap-1 text-center"},jP=["onClick"],TP={key:1},PP={class:"font-semibold mb-2"},LP={class:"grid grid-cols-3 gap-2"},RP=["onClick"],OP={key:2},BP={class:"flex justify-between items-center mb-2"},EP={class:"font-semibold"},FP={class:"grid grid-cols-4 gap-2"},IP=["onClick"],NP={class:"flex justify-center gap-4 border-t border-gray-300 p-4"},HP={__name:"CalendarCustom",emits:["confirm"],setup(o,{emit:t}){const{t:e}=ee(),s=t,l=ke(),{color:r,button_color:a,bg_hover_button:d,price_red:u,white:h}=Qt(l),_=z(!1),m=z("day"),x=z(null),$=z("day"),S=new Date,v=z(S.getFullYear()),M=z(S.getMonth()+1),w=z(S.getDate()),I=z(v.value),O=z(M.value),tt=z(w.value),{locale:G}=ee(),Y=lt(()=>[e("months_short.jan"),e("months_short.feb"),e("months_short.mar"),e("months_short.apr"),e("months_short.may"),e("months_short.jun"),e("months_short.jul"),e("months_short.aug"),e("months_short.sep"),e("months_short.oct"),e("months_short.nov"),e("months_short.dec")]),et=lt(()=>[e("months_full.jan"),e("months_full.feb"),e("months_full.mar"),e("months_full.apr"),e("months_full.may"),e("months_full.jun"),e("months_full.jul"),e("months_full.aug"),e("months_full.sep"),e("months_full.oct"),e("months_full.nov"),e("months_full.dec")]),ht=lt(()=>[e("weekdays_short.sun"),e("weekdays_short.mon"),e("weekdays_short.tue"),e("weekdays_short.wed"),e("weekdays_short.thu"),e("weekdays_short.fri"),e("weekdays_short.sat")]),ct=lt(()=>[{label:e("today"),value:"today"},{label:e("yesterday"),value:"yesterday"},{label:e("monthly"),value:"month"},{label:e("yearly"),value:"year"}]),dt=z(!1),pt=()=>dt.value=window.innerWidth<=768;we(()=>{pt(),window.addEventListener("resize",pt)}),as(()=>window.removeEventListener("resize",pt));const D=()=>{I.value=v.value,O.value=M.value,tt.value=w.value,m.value=$.value,_.value=!_.value},Mt=Rt=>{const ft=new Date;Rt==="today"?(I.value=ft.getFullYear(),O.value=ft.getMonth()+1,tt.value=ft.getDate()):Rt==="yesterday"&&(ft.setDate(ft.getDate()-1),I.value=ft.getFullYear(),O.value=ft.getMonth()+1,tt.value=ft.getDate()),m.value=Rt==="today"||Rt==="yesterday"?"day":Rt},ot=lt(()=>new Date(I.value,O.value,0).getDate()),st=lt(()=>new Date(I.value,O.value-1,1).getDay()),X=lt(()=>{const Rt=Array(st.value).fill(null);for(let ft=1;ft<=ot.value;ft++)Rt.push(ft);return Rt}),H=Rt=>{Rt&&(tt.value=Rt)},P=lt(()=>G.value==="th"?I.value+543:I.value),W=lt(()=>{const Rt=G.value==="th"?v.value+543:v.value;return $.value==="month"?`${et.value[M.value-1]} ${Rt}`:$.value==="year"?`${e("yearr")} ${Rt}`:`${String(w.value).padStart(2,"0")}/${String(M.value).padStart(2,"0")}/${Rt}`}),U=()=>
33{v.value=I.value,M.value=O.value,w.value=tt.value,$.value=m.value,s("confirm",{year:I.value,month:O.value,day:tt.value,type:m.value}),_.value=!1},B=()=>{const Rt=new Date;v.value=Rt.getFullYear(),M.value=Rt.getMonth()+1,w.value=Rt.getDate(),I.value=v.value,O.value=M.value,tt.value=w.value,m.value="day",$.value="day",s("confirm",{year:v.value,month:M.value,day:w.value,type:"day"})},Z=Array.from({length:100},(Rt,ft)=>S.getFullYear()-50+ft),q=[];for(let Rt=0;Rt<Z.length;Rt+=16)q.push(Z.slice(Rt,Rt+16));const ut=z(Math.floor(q.length/2)),wt=()=>{ut.value>0&&ut.value--},St=()=>{ut.value<q.length-1&&ut.value++},Tt=lt(()=>{const Rt=q[ut.value];if(!Rt)return"";const ft=Rt[0],F=Rt[Rt.length-1];return G.value==="th"?`${ft+543} - ${F+543}`:`${ft} - ${F}`}),vt=()=>{I.value=v.value,O.value=M.value,tt.value=w.value,m.value="day",_.value=!1},yt=Rt=>{x.value&&(x.value.contains(Rt.target)||vt())},Ft=()=>{O.value===1?(O.value=12,I.value--):O.value--},N=()=>{O.value===12?(O.value=1,I.value++):O.value++},$t=lt(()=>{const Rt=new Date;return I.value===Rt.getFullYear()&&O.value===Rt.getMonth()+1&&tt.value===Rt.getDate()&&m.value==="day"}),T=lt(()=>{const Rt=new Date;return Rt.setDate(Rt.getDate()-1),I.value===Rt.getFullYear()&&O.value===Rt.getMonth()+1&&tt.value===Rt.getDate()&&m.value==="day"});we(()=>document.addEventListener("click",yt)),as(()=>document.removeEventListener("click",yt));const Pt=lt(()=>{const Rt=(O.value||1)-1;return et.value[Rt]||""});return(Rt,ft)=>(p(),f("div",{class:"relative inline-block",ref_key:"pickerRef",ref:x},[i("div",{class:"border rounded-full px-4 py-2 flex items-center cursor-pointer w-[260px] xl:w-[220px] transition-colors",style:b({borderColor:_.value?n(r):"#D1D5DB"}),onClick:D},[ft[1]||(ft[1]=i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5 text-gray-400 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),i("span",ZT,c(W.value),1),(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:J(["w-5 h-5 text-gray-500 transition-transform duration-200",{"rotate-180":_.value}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...ft[0]||(ft[0]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],4),_.value&&!dt.value?(p(),f("div",XT,[i("div",KT,[i("div",GT,[(p(!0),f(at,null,xt(ct.value,F=>(p(),f("div",{key:F.value,class:J(["py-2 px-2 rounded-full cursor-pointer text-center mb-1",{"text-white font-semibold":F.value==="today"&&$t.value||F.value==="yesterday"&&T.value||m.value===F.value,"hover:bg-gray-100":!(F.value==="today"&&$t.value||F.value==="yesterday"&&T.value||m.value===F.value)}]),style:b({backgroundColor:F.value==="today"&&$t.value||F.value==="yesterday"&&T.value||m.value===F.value?n(r):""}),onClick:R=>Mt(F.value)},c(F.label),15,QT))),128))]),i("div",JT,[m.value==="day"?(p(),f("div",tP,[i("div",eP,[i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:Ft}," < "),i("p",oP,c(Pt.value)+" "+c(P.value),1),i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:N}," > ")]),i("div",sP,[(p(!0),f(at,null,xt(ht.value,(F,R)=>(p(),f("span",{key:R},c(F),1))),128))]),i("div",nP,[(p(!0),f(at,null,xt(X.value,(F,R)=>(p(),f("div",{key:R,class:J(["py-2 rounded-full cursor-pointer",{"text-white font-semibold":tt.value===F,"hover:bg-gray-100":F&&tt.value!==F}]),style:b({backgroundColor:tt.value===F?n(r):""}),onClick:kt=>H(F)},c(F||""),15,iP))),128))])])):m.value==="month"?(p(),f("div",lP,[i("p",rP,c(P.value),1),i("div",aP,[(p(!0),f(at,null,xt(Y.value,(F,R)=>(p(),f("div",{key:R,class:J(["py-2 text-center rounded-full cursor-pointer",{"text-white font-semibold":O.value===R+1,"hover:bg-gray-100":O.value!==R+1}]),style:b({backgroundColor:O.value===R+1?n(r):""}),onClick:kt=>O.value=R+1},c(F),15,cP))),128))])])):m.value==="year"?(p(),f("div",dP,[i("div",uP,[i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:wt}," < "),i("span",hP,c(Tt.value),1),i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:St}," > ")]),i("div",pP,[(p(!0),f(at,null,xt(q[ut.value],F=>(p(),f("div",{key:F,class:J(["py-2 text-center rounded-full cursor-pointer",{"text-white font-semibold":I.value===F,"hover:bg-gray-100":I.value!==F}]),style:b({backgroundColor:I.value===F?n(r):""}),onClick:R=>I.value=F},c(n(G)==="th"?F+543:F),15,fP))),128))])])):C("",!0)])]),i("div",_P,[i("button",{class:"border px-4 py-1 rounded-full mr-5 h-[36px] w-[136px] cursor-pointer",onClick:B,style:b({color:n(r),borderColor:n(r)})},c(n(e)("reset")),5),i("button",{class:"text-white px-4 py-1 rounded-full h-[36px] w-[136px] cursor-pointer",onClick:U,style:b({backgroundColor:n(r),borderColor:n(r)})},c(n(e)("confirm")),5)])])):C("",!0),zt(il,{name:"fade"},{default:ne(()=>[_.value&&dt.value?(p(),f("div",mP,[i("div",vP,[i("div",gP,[i("img",{class:"cursor-pointer ml-5",style:{width:"50px",height:"50px"},src:n(Kc),alt:"logo"},null,8,bP),i("button",{class:"text-gray-500 cursor-pointer mr-3",onClick:vt},[zt(n(rl),{class:"w-6 h-6"})])]),i("div",xP,[i("div",yP,[ft[2]||(ft[2]=i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5 text-gray-400 absolute left-5 top-1/2 -translate-y-1/2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),i("input",{type:"text",class:"w-full rounded-full pl-14 pr-4 py-2 pointer-events-none select-none",value:W.value,style:b({border:`1px solid ${n(r)}`})},null,12,wP)])]),i("div",kP,[(p(!0),f(at,null,xt(ct.value,F=>(p(),f("div",{key:F.value,class:J(["px-3 py-2 rounded-full cursor-pointer",{"text-white font-semibold":F.value==="today"&&$t.value||F.value==="yesterday"&&T.value||m.value===F.value,"hover:bg-gray-100":!(F.value==="today"&&$t.value||F.value==="yesterday"&&T.value||m.value===F.value)}]),style:b({backgroundColor:F.value==="today"&&$t.value||F.value==="yesterday"&&T.value||m.value===F.value?n(r):""}),onClick:R=>Mt(F.value)},c(F.label),15,$P))),128))]),i("div",CP,[m.value==="day"?(p(),f("div",MP,[i("div",SP,[i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:Ft}," < "),i("p",DP,c(Pt.value)+" "+c(P.value),1),i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:N}," > ")]),i("div",AP,[(p(!0),f(at,null,xt(ht.value,(F,R)=>(p(),f("span",{key:R},c(F),1))),128))]),i("div",zP,[(p(!0),f(at,null,xt(X.value,(F,R)=>(p(),f("div",{key:R,class:J(["w-10 h-10 rounded-full cursor-pointer flex items-center justify-center",{"text-white font-semibold":tt.value===F,"hover:bg-gray-100":F&&tt.value!==F}]),style:b({backgroundColor:tt.value===F?n(r):""}),onClick:kt=>H(F)},c(F||""),15,jP))),128))])])):m.value==="month"?(p(),f("div",TP,[i("p",PP,c(P.value),1),i("div",LP,[(p(!0),f(at,null,xt(Y.value,(F,R)=>(p(),f("div",{key:R,class:J(["py-2 text-center rounded-full cursor-pointer",{"text-white font-semibold":O.value===R+1,"hover:bg-gray-100":O.value!==R+1}]),style:b({backgroundColor:O.value===R+1?n(r):""}),onClick:kt=>O.value=R+1},c(F),15,RP))),128))])])):m.value==="year"?(p(),f("div",OP,[i("div",BP,[i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:wt}," < "),i("span",EP,c(q[ut.value][0]+543)+" - "+c(q[ut.value][15]+543),1),i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:St}," > ")]),i("div",FP,[(p(!0),f(at,null,xt(q[ut.value],F=>(p(),f("div",{key:F,class:J(["py-2 text-center rounded-full cursor-pointer",{"text-white font-semibold":I.value===F,"hover:bg-gray-100":I.value!==F}]),style:b({backgroundColor:I.value===F?n(r):""}),onClick:R=>I.value=F},c(n(G)==="th"?F+543:F),15,IP))),128))])])):C("",!0)]),i("div",NP,[i("button",{class:"border px-4 py-2 rounded-full w-1/2",onClick:B,style:b({color:n(r),borderColor:n(r)})},c(n(e)("reset")),5),i("button",{class:"text-white px-4 py-2 rounded-full w-1/2",onClick:U,style:b({backgroundColor:n(r),borderColor:n(r)})},c(n(e)("confirm")),5)])])])):C("",!0)]),_:1})],512))}},VP={class:"text-form w-full rounded-lg px-4 py-6 bg-white mb-8"},WP={class:"w-full flex flex-col md:flex-row items-center justify-between gap-4"},UP={class:"flex items-center w-full md:w-auto justify-center md:justify-start gap-2"},YP={class:"text-[16px] xl:text-[18px] font-semibold text-center md:text-left"},qP={class:"block invisible ml-auto"},ZP={class:"flex items-center justify-center md:justify-end w-full md:w-auto gap-3 flex-wrap"},XP={class:"text-form flex space-x-4"},KP={class:"w-full rounded-lg px-4 py-6 bg-white mb-8 flex flex-col items-start"},GP={class:"flex items-baseline space-x-1 mb-1"},QP={class:"text-[20px] md:text-[32px] font-bold"}
33,JP={class:"text-[12px] md:text-[16px] font-bold"},tL={class:"text-[12px] font-normal"},eL={class:"w-full rounded-lg px-4 py-6 bg-white mb-8 flex flex-col items-start"},oL={class:"flex items-baseline space-x-1 mb-1"},sL={class:"text-[20px] md:text-[32px] font-bold"},nL={class:"text-[12px] md:text-[16px] font-bold"},iL={class:"text-[12px] font-normal"},lL={class:"text-form w-full rounded-lg px-4 py-6 bg-white mb-8"},rL={class:"text-[16px] xl:text-[18px] font-bold mb-5"},aL=["onClick"],cL={key:0,class:"py-2 mt-5"},dL={class:"text-[12px] font-normal",style:{color:"#a4a4a4"}},uL={key:1,class:"py-2 mt-5"},hL={class:"text-[12px] font-normal",style:{color:"#a4a4a4"}},pL={class:"space-y-4 text-form"},fL={class:"w-full rounded-lg px-4 py-6 bg-white"},_L={class:"flex items-center justify-between w-full mb-4"},mL={class:"text-[16px] xl:text-[18px] font-semibold"},vL={key:0,class:"absolute z-10 w-full bg-white border border-gray-300 rounded-xl mt-1 shadow-lg overflow-hidden max-h-60 overflow-y-auto"},gL=["onClick"],bL={class:"flex border-b border-gray-200 mb-4 mt-5"},xL=["onClick"],yL={key:0,class:"py-2 space-y-2"},wL={class:"hidden sm:block w-[40px] text-gray-500 font-medium text-center"},kL={class:"flex-shrink-0 w-[60px]"},$L=["src"],CL={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between w-full min-w-0"},ML={class:"text-[14px] font-bold truncate min-w-0 flex-1 sm:mr-2 mb-2 sm:mb-0"},SL={key:0},DL={class:"p-4 text-center text-gray-500"},AL={key:1,class:"py-2 space-y-2"},zL={class:"hidden sm:block w-[40px] text-gray-500 font-medium text-center"},jL={class:"flex-shrink-0 w-[60px]"},TL=["src"],PL={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between w-full min-w-0"},LL={class:"text-[14px] font-bold truncate min-w-0 flex-1 sm:mr-2 mb-2 sm:mb-0"},RL={class:"flex items-center justify-center rounded-full text-white font-normal text-[14px] flex-shrink-0",style:"background-color:#DEC34E; width:120px; height:28px;"},OL={key:0},BL={class:"p-4 text-center text-gray-500"},EL={__name:"ShareAffiliate",setup(o){const{t}=ee(),{locale:e}=ee(),s=z(""),l=ke(),r=z(!1),a=z(null),{color:d,button_color:u,bg_hover_button:h,price_red:_}=Qt(l),m=je(),{showContent:x}=Qt(m),$=Vs(),S=z("highest_price"),v=z("highest_click"),M=z(!1),w=z(!1),I=z(null),O=lt(()=>[{value:"highest_price",label:t("high_rank")},{value:"lowest_price",label:t("low_rank")}]),tt=lt(()=>[{value:"highest_click",label:t("high_rank")},{value:"lowest_click",label:t("low_rank")}]),G=lt(()=>D.value==="income"?O.value:tt.value),Y=ut=>D.value==="income"?S.value===ut.value:v.value===ut.value,et=lt(()=>{const ut=D.value==="income"?S.value:v.value,wt=G.value.find(St=>St.value===ut);return wt?wt.label:t("high_rank")}),ht=ut=>{D.value==="income"?S.value=ut.value:v.value=ut.value,M.value=!1,w.value=!1},ct=ut=>{I.value&&!I.value.contains(ut.target)&&(M.value=!1,w.value=!1)};we(()=>{document.addEventListener("click",ct)}),as(()=>{document.removeEventListener("click",ct)}),pe([S,v],async([ut,wt])=>{D.value==="income"?v.value=ut==="highest_price"?"highest_click":"lowest_click":S.value=wt==="highest_click"?"highest_price":"lowest_price";let St=q(a.value);if(!St||!St.start||!St.end){const yt=new Date,Ft=yt.getFullYear(),N=String(yt.getMonth()+1).padStart(2,"0"),$t=String(yt.getDate()).padStart(2,"0");St={type:"day",start:`${Ft}-${N}-${$t}`,end:`${Ft}-${N}-${$t}`}}const Tt=D.value==="income"?ut==="highest_price"?"desc":"asc":wt==="highest_click"?"desc":"asc",vt={start_date:St.start,end_date:St.end,group_by:St.type,sort_by:Tt};try{await $.shareProduct(vt)}catch(yt){s.value=yt.message||"เรียกข้อมูลล้มเหลว"}});const dt=lt(()=>[{label:t("earnnig_data"),value:"income"},{label:t("click_data"),value:"clicks"}]),pt=lt(()=>[{label:t("earnnig_data"),value:"incomegraph"},{label:t("click_data"),value:"clicksgraph"}]),D=z("income"),Mt=z("incomegraph"),ot=lt(()=>$.topSold||[]),st=lt(()=>$.topClick||[]),X=lt(()=>$.graphIncome),H=lt(()=>$.graphClick),P=lt(()=>$.totalComm),W=lt(()=>$.totalClick);we(()=>{$.shareProduct()});const U=ut=>ut?Number(ut).toLocaleString("th-TH",{minimumFractionDigits:2,maximumFractionDigits:2}):"0.00",B=async()=>{try{r.value=!0;const ut=q(a.value),wt={start_date:ut?.start,end_date:ut?.end,group_by:ut?.type,sort_by:"desc"},St=await $.ExportShare(wt),Tt=document.createElement("a");Tt.href=window.URL.createObjectURL(St),Tt.download="Affiliate_My Sharing_Report.xlsx",Tt.click()}catch(ut){console.error("ดาวน์โหลดล้มเหลว:",ut)}finally{r.value=!1}},Z=async ut=>{if(!ut)return;if(ut.type==="today"){const Tt=new Date;ut.year=Tt.getFullYear(),ut.month=Tt.getMonth()+1,ut.day=Tt.getDate()}else if(ut.type==="yesterday"){const Tt=new Date;Tt.setDate(Tt.getDate()-1),ut.year=Tt.getFullYear(),ut.month=Tt.getMonth()+1,ut.day=Tt.getDate()}const wt=q(ut);if(!wt||!wt.start||!wt.end)return;const St={start_date:wt.start,end_date:wt.end,group_by:wt.type,sort_by:"desc"};try{await $.shareProduct(St),a.value=ut}catch(Tt){s.value=Tt.message||"Fetch failed"}},q=ut=>{if(!ut||!ut.type)return{type:"day",start:"",end:""};const wt=String(ut.year||new Date().getFullYear()),St=ut.month?String(ut.month).padStart(2,"0"):"01",Tt=ut.day?String(ut.day).padStart(2,"0"):"01";if(ut.type==="day"||ut.type==="today"||ut.type==="yesterday")return{type:"day",start:`${wt}-${St}-${Tt}`,end:`${wt}-${St}-${Tt}`};if(ut.type==="month"){const vt=parseInt(ut.month||1,10),yt=new Date(parseInt(wt,10),vt,0).getDate(),Ft=String(yt).padStart(2,"0");return{type:"month",start:`${wt}-${St}-01`,end:`${wt}-${St}-${Ft}`}}else if(ut.type==="year")return{type:"year",start:`${wt}-01-01`,end:`${wt}-12-31`}};return(ut,wt)=>(p(),f(at,null,[i("div",VP,[i("div",WP,[i("div",UP,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:wt[0]||(wt[0]=St=>x.value=!1)},[...wt[5]||(wt[5]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("p",YP,c(n(t)("my_share")),1),i("div",qP,[i("div",{onClick:B,class:"w-8 h-8 rounded-full flex items-center justify-center border",style:{"border-color":"#77a8d1"}}
33,[zt(n(al),{class:"w-5 h-5",style:{color:"#77a8d1"}})])])]),i("div",ZP,[zt(HP,{modelValue:a.value,"onUpdate:modelValue":wt[1]||(wt[1]=St=>a.value=St),onConfirm:Z},null,8,["modelValue"])])])]),i("div",XP,[i("div",KP,[(p(),f("svg",{class:"mb-2",style:b({color:n(l).color}),width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...wt[6]||(wt[6]=[rs('<path d="M35.5009 32.619C43.4038 32.619 49.8104 26.2125 49.8104 18.3095C49.8104 10.4066 43.4038 4 35.5009 4C27.598 4 21.1914 10.4066 21.1914 18.3095C21.1914 26.2125 27.598 32.619 35.5009 32.619Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" data-v-786f9de4></path><path d="M37.9398 12.5027C37.5294 12.1959 36.2099 11.3824 34.3546 11.9413C32.2828 12.5654 31.7683 15.4002 33.1762 16.5045C33.9845 17.1385 35.2009 17.6599 36.8403 18.2394C40.5095 19.5363 39.1531 24.7107 35.4208 24.7356C33.9643 24.7453 33.2834 24.6529 32.0039 23.8159" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round" data-v-786f9de4></path><path d="M35.4219 25.5V26.6221" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round" data-v-786f9de4></path><path d="M35.4219 10V11.2182" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round" data-v-786f9de4></path><path d="M29.8167 47.9016H40.9154V44.8659C40.9154 42.6896 39.1541 40.9239 36.9778 40.9183L31.9235 40.9029L31.0159 40.0473C27.3899 36.6293 22.0315 35.9482 17.707 38.2194C16.8397 38.6749 15.8777 38.9208 14.8982 38.9208H10.4922V52.2993H16.5427L27.287 55.8473C27.5939 55.9486 27.9151 56.0003 28.2383 56.0003H40.2966C41.1012 56.0003 41.8729 55.6807 42.4418 55.1118L54.906 42.6475C56.3623 41.1912 56.3623 38.8299 54.906 37.3735C53.4497 35.9172 51.0884 35.9172 49.632 37.3735L41.0793 45.7811" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M10.494 37.3594H4V53.7897H10.494V37.3594Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" data-v-786f9de4></path>',6)])],4)),i("div",GP,[i("p",QP,c(U(n(P))),1),i("p",JP,c(n(t)("baht")),1)]),i("p",tL,c(n(t)("total_commission")),1)]),i("div",eL,[(p(),f("svg",{class:"mb-2",style:b({color:n(l).color}),width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...wt[7]||(wt[7]=[rs('<g clip-path="url(#clip0_11372_65526)" data-v-786f9de4><path d="M54.4766 5.52344H5.52344V54.4766H54.4766V5.52344Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M54.4766 11.6172H5.52344" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M11.6172 5.52344V11.6172" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M17.7109 5.52344V11.6172" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M29.0508 29.0469L45.9999 35.4028L41.1419 38.142L46 43.0001L43.0041 45.996L38.146 41.1379L35.4067 45.996L29.0508 29.0469Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M33.2216 25.7316L35.4688 23.4844" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M23.4833 35.4659L25.7305 33.2188" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M21.0017 29.4766H24.1797" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M23.4833 23.4844L25.7305 25.7316" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path><path d="M29.4727 24.178V21" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-786f9de4></path></g><defs data-v-786f9de4><clipPath id="clip0_11372_65526" data-v-786f9de4><rect width="52" height="52" fill="white" transform="translate(4 4)" data-v-786f9de4></rect></clipPath></defs>',2)])],4)),i("div",oL,[i("p",sL,c(n(W)),1),i("p",nL,c(n(t)("click_time")),1)]),i("p",iL,c(n(t)("total_click")),1)])]),i("div",lL,[i("p",rL,c(n(t)("share_history")),1),i("div",null,[(p(!0),f(at,null,xt(n(pt),St=>(p(),f("button",{key:St.value,onClick:Tt=>Mt.value=St.value,class:"py-2 px-4 text-[16px] cursor-pointer font-medium border-b-2 transition-all duration-200",style:b(Mt.value===St.value?{borderColor:n(d),color:n(d)}:{borderColor:"transparent",color:"#343434"})},c(St.label),13,aL))),128)),Mt.value==="incomegraph"?(p(),f("div",cL,[i("div",null,[i("p",dL,c(n(t)("commission_thb")),1),zt(Ca,{data:n(X),labelKey:n(t)("commission_thb"),type:"income"},null,8,["data","labelKey"])])])):C("",!0),Mt.value==="clicksgraph"?(p(),f("div",uL,[i("div",null,[i("p",hL,c(n(t)("total_click_time")),1),zt(Ca,{data:n(H),labelKey:n(t)("total_click_time"),type:"click"},null,8,["data","labelKey"])])])):C("",!0)])]),i("div",pL,[i("div",fL,[i("div",_L,[i("p",mL,c(n(t)("product_rank")),1),i("div",{class:"relative w-[156px] md:w-[219px]",ref_key:"dropdownRef",ref:I},[i("div",{tabindex:"0",onClick:wt[2]||(wt[2]=St=>M.value=!M.value),onBlur:wt[3]||(wt[3]=St=>w.value=!1),onFocus:wt[4]||(wt[4]=St=>w.value=!0),class:"w-full rounded-full px-3 py-2 text-[16px] flex items-center justify-between cursor-pointer transition-colors duration-200",style:b({border:`1px solid ${w.value?n(d):"#D1D5DB"}`})},[i("span",null,c(n(et)),1),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] transition-transform duration-200",{"rotate-180":M.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...wt[8]||(wt[8]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],36),M.value?(p(),f("div",vL,[(p(!0),f(at,null,xt(n(G),St=>(p(),f("div",{key:St.value,onClick:Tt=>ht(St),style:b({backgroundColor:Y(St)?n(h):""}),class:"px-4 py-2 cursor-pointer hover:bg-hover_button"},c(St.label),13,gL))),128))])):C("",!0)],512)]),i("div",bL,[(p(!0),f(at,null,xt(n(dt),St=>(p(),f("button",{key:St.value,onClick:Tt=>D.value=St.value,class:"py-2 px-4 cursor-pointer text-[16px] font-medium border-b-2 transition-all duration-200",style:b(D.value===St.value?{borderColor:n(d),color:n(d)}:{borderColor:"transparent",color:"#343434","--hover-color":n(d)})},c(St.label),13,xL))),128))]),D.value==="income"?(p(),f("div",yL,[(p(!0),f(at,null,xt(n(ot),(St,Tt)=>(p(),f("div",{key:St.product_id+"-"+Tt,class:"flex flex-row sm:flex-row items-start sm:items-center border-b border-gray-200 p-2 space-x-3"},[i("p",wL,c(Tt+1),1),i("div",kL,[i("img",{src:St.product_image&&St.product_image!==""?St.product_image:n(re),alt:"product image",class:"w-12 h-12 object-cover rounded"},null,8,$L)]),i("div",CL,[i("p",ML,c(n(e)==="th"?St.product_name:St.product_name_en||St.product_name),1),i("div",{class:"flex items-center justify-center rounded-full text-white font-normal text-[14px] flex-shrink-0",style:b(`background-color:${n(d)}; width:115px; height:28px;`)},c(n(t)("sold_item"))+" "+c(St.sold)+" "+c(n(t)("items")),5)])]))),128)),n(ot).length<=0?(p(),f("div",SL,[i("p",DL,c(n(t)("no_data")),1)])):C("",!0)])):D.value==="clicks"?(p(),f("div",AL,[(p(!0),f(at,null,xt(n(st),(St,Tt)=>(p(),f("div",{key:St.product_id,class:"flex flex-row sm:flex-row items-start sm:items-center border-b border-gray-200 p-2 space-x-3"},[i("p",zL,c(Tt+1),1),i("div",jL,[i("img",{src:St.product_image&&St.product_image!==""?St.product_image:n(re),alt:"product image",class:"w-12 h-12 object-cover rounded"}
33,null,8,TL)]),i("div",PL,[i("p",LL,c(n(e)==="th"?St.product_name:St.product_name_en||St.product_name),1),i("div",RL,c(n(t)("click_item"))+" "+c(St.clicks)+" "+c(n(t)("click_time")),1)])]))),128)),n(st).length<=0?(p(),f("div",OL,[i("p",BL,c(n(t)("no_data")),1)])):C("",!0)])):C("",!0)])])],64))}},FL=mo(EL,[["__scopeId","data-v-786f9de4"]]),IL={class:"flex-1 text-left ml-2 xl:ml-0 md:ml-0 truncate text-[16px]"},NL={class:"flex justify-between items-center mb-2 px-2"},HL={class:"flex space-x-2"},VL=["value"],WL=["value"],UL={class:"grid grid-cols-7 text-sm font-medium mb-2 text-gray-500 text-center"},YL={class:"grid grid-cols-7 gap-1 text-center"},qL=["onClick"],ZL={class:"flex justify-center mt-4 border-t-[1px] border-gray-300 pt-3 space-x-4"},XL={key:1,class:"fixed inset-0 z-[9999] bg-black/50 flex flex-col"},KL={class:"bg-white w-full max-w-md h-full flex flex-col relative overflow-hidden"},GL={class:"relative w-full mt-5 px-2 flex items-center justify-between"},QL=["src"],JL={class:"p-4 border-b border-gray-200 mt-2"},tR={class:"relative w-full"},eR=["value","placeholder"],oR={class:"flex justify-between items-center mb-2 px-4 mt-4 mb-5"},sR={class:"flex space-x-2"},nR=["value"],iR=["value"],lR={class:"grid grid-cols-7 text-sm font-medium mb-2 text-gray-500 text-center px-4"},rR={class:"grid grid-cols-7 gap-1 text-center px-4 overflow-auto max-h-[350px]"},aR=["onClick"],cR={class:"flex justify-center border-t border-gray-200 p-4 space-x-4 mt-auto"},dR={__name:"CalendarRange",emits:["confirm"],setup(o,{emit:t}){const{t:e}=ee(),s=ke(),{color:l,button_color:r,bg_hover_button:a,price_red:d,white:u}=Qt(s),h=z(!1),_=z(null),m=z(null),x=z({top:0,left:0}),$=t,S=new Date,v=z(S.getFullYear()),M=z(S.getMonth()+1),w=z(null),I=z(null),O=lt(()=>window.innerWidth<768),{locale:tt}=ee(),G=lt(()=>[e("months_full.jan"),e("months_full.feb"),e("months_full.mar"),e("months_full.apr"),e("months_full.may"),e("months_full.jun"),e("months_full.jul"),e("months_full.aug"),e("months_full.sep"),e("months_full.oct"),e("months_full.nov"),e("months_full.dec")]),Y=lt(()=>[e("weekdays_short.sun"),e("weekdays_short.mon"),e("weekdays_short.tue"),e("weekdays_short.wed"),e("weekdays_short.thu"),e("weekdays_short.fri"),e("weekdays_short.sat")]),et=lt(()=>{const B=S.getFullYear(),Z=B-5,q=B+5,ut=[];for(let wt=Z;wt<=q;wt++)ut.push(wt);return ut}),ht=lt(()=>new Date(v.value,M.value,0).getDate()),ct=lt(()=>new Date(v.value,M.value-1,1).getDay()),dt=lt(()=>{const B=Array(ct.value).fill(null);for(let Z=1;Z<=ht.value;Z++)B.push(Z);return B}),pt=()=>{h.value=!h.value,h.value&&W()},D=B=>{B&&(!w.value||w.value&&I.value?(w.value=B,I.value=null):B<w.value?(I.value=w.value,w.value=B):I.value=B)},Mt=lt(()=>{if(!w.value)return"";const B=v.value,Z=String(M.value).padStart(2,"0"),q=String(w.value).padStart(2,"0"),ut=I.value?String(I.value).padStart(2,"0"):q,wt=tt.value==="th"?B+543:B,St=String(wt).slice(-2),Tt=`${q}/${Z}/${St}`,vt=`${ut}/${Z}/${St}`;return I.value?`${Tt} - ${vt}`:Tt});pe(tt,()=>{ot()});const ot=()=>{if(!w.value)return;const B=v.value,Z=String(M.value).padStart(2,"0"),q=String(w.value).padStart(2,"0"),ut=I.value?String(I.value).padStart(2,"0"):q,wt=`${B}-${Z}-${q}`,St=`${B}-${Z}-${ut}`,Tt=String(B+543).slice(-2),vt=`${q}/${Z}/${Tt}`,yt=`${ut}/${Z}/${Tt}`;Mt.value=I.value?`${vt} - ${yt}`:vt,$("confirm",{start_date:wt,end_date:St}),h.value=!1},st=()=>{w.value=null,I.value=null;const B=new Date;v.value=B.getFullYear(),M.value=B.getMonth()+1,$("confirm",{day:"",month:"",year:""}),h.value=!1,Mt.value=""},X=()=>{M.value===1?(M.value=12,v.value--):M.value--},H=()=>{M.value===12?(M.value=1,v.value++):M.value++};function P(B){return tt.value==="th"?B+543:B}const W=()=>{Xn(()=>{if(!_.value)return;const B=_.value.getBoundingClientRect();x.value.top=B.bottom+window.scrollY+4,x.value.left=B.left+window.scrollX})},U=B=>{!_.value||!m.value||!_.value.contains(B.target)&&!m.value.contains(B.target)&&(h.value=!1)};return we(()=>document.addEventListener("click",U)),as(()=>document.removeEventListener("click",U)),(B,Z)=>(p(),f("div",{class:"relative inline-block",ref_key:"pickerRef",ref:_},[i("div",{class:"border border-gray-300 rounded-full px-4 py-2 flex items-center cursor-pointer w-full md:w-[250px] h-[40p
33x]",onClick:pt,style:b({borderColor:h.value?n(l):"#D1D5DB"})},[Z[5]||(Z[5]=i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5 text-gray-400 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),i("span",IL,c(Mt.value||n(e)("select_date")),1)],4),(p(),ae(ja,{to:"body"},[h.value&&!O.value?(p(),f("div",{key:0,ref_key:"calendarRef",ref:m,class:"bg-white rounded-xl p-4 shadow-lg z-30 absolute",style:b({top:`${x.value.top}px`,left:`${x.value.left}px`,width:"300px"})},[i("div",NL,[i("div",HL,[bt(i("select",{"onUpdate:modelValue":Z[0]||(Z[0]=q=>M.value=q),class:"px-2 py-1"},[(p(!0),f(at,null,xt(G.value,(q,ut)=>(p(),f("option",{key:ut,value:ut+1},c(q),9,VL))),128))],512),[[De,M.value]]),bt(i("select",{"onUpdate:modelValue":Z[1]||(Z[1]=q=>v.value=q),class:"px-2 py-1"},[(p(!0),f(at,null,xt(et.value,q=>(p(),f("option",{key:q,value:q},c(P(q)),9,WL))),128))],512),[[De,v.value]])]),i("div",{class:"flex space-x-1"},[i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:X}," < "),i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:H}," > ")])]),i("div",UL,[(p(!0),f(at,null,xt(Y.value,(q,ut)=>(p(),f("span",{key:ut},c(q),1))),128))]),i("div",YL,[(p(!0),f(at,null,xt(dt.value,(q,ut)=>(p(),f("div",{key:ut,class:J(["flex items-center justify-center w-9 h-9 rounded-full cursor-pointer",{"text-white font-semibold":q&&(q===w.value||q===I.value||w.value&&I.value&&q>w.value&&q<I.value),"hover:bg-gray-100":q,"text-gray-300 cursor-default":!q}]),style:b({backgroundColor:q&&(q===w.value||q===I.value||w.value&&I.value&&q>w.value&&q<I.value)?n(l):""}),onClick:wt=>D(q)},c(q||""),15,qL))),128))]),i("div",ZL,[i("button",{class:"border px-4 py-1 rounded-full w-[100px] cursor-pointer",onClick:st,style:b({color:n(l),borderColor:n(l)})},c(n(e)("reset")),5),i("button",{class:"text-white px-4 py-1 rounded-full w-[100px] cursor-pointer",onClick:ot,style:b({backgroundColor:n(l),borderColor:n(l)})},c(n(e)("confirm")),5)])],4)):C("",!0),h.value&&O.value?(p(),f("div",XL,[i("div",KL,[i("div",GL,[i("img",{class:"cursor-pointer ml-5",style:{width:"50px",height:"50px"},src:n(Kc),alt:"logo"},null,8,QL),i("button",{class:"text-gray-500 cursor-pointer mr-3",onClick:Z[2]||(Z[2]=q=>h.value=!1)},[zt(n(rl),{class:"w-6 h-6"})])]),i("div",JL,[i("div",tR,[Z[6]||(Z[6]=i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5 text-gray-400 absolute left-5 top-1/2 -translate-y-1/2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),i("input",{type:"text",class:"w-full border border-gray-300 rounded-full pl-14 px-4 py-2 pointer-events-none select-none",style:b({border:`1px solid ${n(l)}`}),value:Mt.value,placeholder:n(e)("select_date"),readonly:""},null,12,eR)])]),i("div",oR,[i("div",sR,[bt(i("select",{"onUpdate:modelValue":Z[3]||(Z[3]=q=>M.value=q),class:"px-2 py-1"},[(p(!0),f(at,null,xt(G.value,(q,ut)=>(p(),f("option",{key:ut,value:ut+1},c(q),9,nR))),128))],512),[[De,M.value]]),bt(i("select",{"onUpdate:modelValue":Z[4]||(Z[4]=q=>v.value=q),class:"px-2 py-1"},[(p(!0),f(at,null,xt(et.value,q=>(p(),f("option",{key:q,value:q},c(P(q)),9,iR))),128))],512),[[De,v.value]])]),i("div",{class:"flex space-x-1"},[i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:X}," < "),i("button",{class:"px-2 py-1 rounded hover:bg-gray-100",onClick:H}," > ")])]),i("div",lR,[(p(!0),f(at,null,xt(Y.value,(q,ut)=>(p(),f("span",{key:ut},c(q),1))),128))]),i("div",rR,[(p(!0),f(at,null,xt(dt.value,(q,ut)=>(p(),f("div",{key:ut,class:J(["flex items-center justify-center aspect-square rounded-full cursor-pointer",{"text-white font-semibold":q&&(q===w.value||q===I.value||w.value&&I.value&&q>w.value&&q<I.value),"hover:bg-gray-100":q,"text-gray-300 cursor-default":!q}]),style:b({backgroundColor:q&&(q===w.value||q===I.value||w.value&&I.value&&q>w.value&&q<I.value)?n(l):""}),onClick:wt=>D(q)},c(q||""),15,aR))),128))]),i("div",cR,[i("button",{class:"border rounded-full w-[132px] h-[36px]",onClick:st,style:b({color:n(l),borderColor:n(l)})},c(n(e)("reset")),5),i("button",{class:"text-white rounded-full w-[132px] h-[36px]",onClick:ot,style:b({backgroundColor:n(l),borderColor:n(l)})},c(n(e)("confirm")),5)])])])):C("",!0)]))],512))}},Gc=mo(dR,[["__scopeId","data-v-db77c064"]]),uR={class:"w-full rounded-lg px-4 py-6 bg-white mb-8 text-form"},hR={class:"flex flex-col md:flex-row items-center justify-between w-full gap-4"},pR={class:"flex items-center w-full md:w-auto justify-center md:justify-start gap-2"},fR={class:"text-[16px] xl:text-[18px] font-semibold text-center md:text-left"},_R={class:"block invisible ml-auto"},mR={class:"w-full rounded-lg bg-white mb-8 text-form"},vR={class:"flex items-start px-4 pt-3 md:mb-[20px]"},gR={class:"flex flex-col"},bR={class:"flex items-baseline space-x-1"},xR={class:"text-[20px] md:text-[32px] font-bold"},yR={class:"text-[16px] xl:text-[18px] font-bold"},wR={class:"text-[12px] font-normal mt-1"},kR={class:"relative grid grid-cols-2 md:grid-cols-4 gap-x-[8px] md:gap-x-0 gap-y-2 justify-center p-3 px-3 md:p-0"},$R={class:"flex flex-col items-start justify-center border rounded-lg w-full h-[78px] mx-auto md:w-auto md:h-auto md:border-0 px-2 md:mb-[20px]",style:{borderColor:"#D1D1D1"}},CR={class:"flex items-baseline space-x-1"},MR={class:"text-[16px] font-bold"},SR={class:"text-[16px] font-bold"},DR={class:"text-[12px] font-normal mt-1"},AR={class:"flex flex-col items-start justify-center border rounded-lg w-full h-[78px] mx-auto md:w-auto md:h-auto md:border-0 px-2 md:mb-[20px]",style:{borderColor:"#D1D1D1"}},zR={class:"flex items-baseline space-x-1"},jR={class:"text-[16px] font-bold"},TR={class:"text-[16px] font-bold"},PR={class:"text-[12px] font-normal mt-1"},LR={class:"flex flex-col items-start justify-center border rounded-lg w-full h-[78px] mx-auto md:w-auto md:h-auto md:border-0 px-2 md:mb-[20px]",style:{borderColor:"#D1D1D1"}},RR={class:"flex items-baseline space-x-1"},OR={class:"text-[16px] font-bold"},BR={class:"text-[16px] font-bold"},ER={class:"text-[12px] font-normal mt-1"},FR={class:"flex flex-col items-start justify-center border rounded-lg w-full h-[78px] mx-auto md:w-auto md:h-auto md:border-0 px-2 md:mb-[20px]",style:{borderColor:"#D1D1D1"}},IR={class:"flex items-baseline space-x-1"},NR={class:"text-[16px] font-bold"},HR={class:"text-[16px] font-bold"},VR={class:"text-[12px] font-normal mt-1"},WR={class:"space-y-4 text-form"},UR={class:"w-full rounded-lg px-4 py-6 bg-white"},YR={class:"mb-4"},qR={class:"text-[16px] xl:text-[18px] font-semibold mb-2"},ZR={class:"w-full flex justify-center mb-4"},XR={class:"flex flex-col gap-2 md:flex-row md:items-center md:gap-4 w-full max-w-[1200px]"},KR={class:"relative w-full md:flex-[2] h-[40px]"},GR=["placeholder"],QR={class:"relative w-full md:flex-1"},JR={class:"text-[16px] ml-5"},tO={key:0,class:"absolute z-10 w-full bg-white border border-gray-300 rounded-xl mt-1 shadow-lg overflow-hidden max-h-60 overflow-y-auto"},eO=["onClick"],oO={class:"mt-10 overflow-x-auto"},sO={class:"w-full text-left border-collapse"},nO={class:"hidden md:table-header-group text-center"},iO={class:"border-b border-gray-400"},lO={class:"p-2 text-[14px] font-normal w-[120px]"},rO={class:"p-2 text-[14px] font-normal w-[100px]"},aO={class:"p-2 text-[14px] font-normal w-[100px]"},cO={class:"p-2 text-[14px] font-normal w-[100px]"},dO={key:0},uO={colspan:"5",class:"p-10 text-center text-gray-500"},hO={class:"hidden md:table-cell p-2 text-center"},pO={class:"hidden md:table-cell p-2 text-center"},fO={class:"hidden md:table-cell p-2 text-center"},_O={class:"hidden md:table-cell p-2 text-center"},mO={class:"md:hidden p-2"},vO={class:"flex flex-col gap-1 text-[12px]"},gO={class:"flex justify-between"},bO={class:"flex justify-between"},xO={class:"font-normal text-[#A4A4A4]"},yO={class:"flex justify-between"},wO={class:"font-normal text-[#A4A4A4]"},kO={class:"flex justify-between"},$O={class:"font-normal text-[#A4A4A4]"},CO={key:0,class:"mt-6 flex flex-wrap items-center justify-between text-[12px] md:text-[14px]"},MO={class:"text-gray-700 mb-4 sm:mb-0"},SO={class:"flex items-center space-x-1","aria-label":"Pagination"},DO=["disabled"],AO=["disabled","onClick"],zO=["disabled"],jO={__name:"WithdrawMoney",setup(o){const t=ke(),e=z(!1),{t:s}=ee(),{color:l,button_color:r,bg_hover_button:a,price_red:d}=Qt(t),u=je(),{showContent:h}=Qt(u),_=Vs(),m=z(""),x=z(""),$=z(null),S=z(!1),v=lt(()=>m.value&&{Waiting:s("pending"),Success:s("success"),Cancel:s("unsuccess")}[m.value]||s("all_filter")),M=lt(()=>[{value:"",label:s("all_filter")},{value:"Waiting",label:s("pending")},{value:"Success",label:s("success")},{value:"Cancel",label:s("unsuccess")}]),w=z(null),I=U=>{m.value=U.value,v.value=U.label,S.value=!1,et()},O=U=>{w.value&&!w.value.contains(U.target)&&(S.value=!1)};we(()=>{document.addEventListener("click",O)}),as(()=>{document.removeEventListener("click",O)});const tt=lt(()=>_.DataWithdraw?.pagination||{}),G=lt(()=>_.DataWithdraw?.data||[]),Y=lt(()=>_.DataWithdraw||[]),et=async()=>{ct.value=1,await _.WithDraw({keyword:x.value.trim()||"",start_date:$.value?.start_date||"",end_date:$.value?.end_date||"",status:m.value||"",page:ct.value,limit:dt.value})};pe(x,U=>{U.trim()===""&&_.WithDraw({keyword:"",page:1,limit:dt.value})}),we(()=>{_.WithDraw()});const ht=U=>{if(!U)return"-";const B=new Date(U);if(isNaN(B))return"-";const Z=B.getDate().toString().padStart(2,"0"),q=(B.getMonth()+1).toString().padStart(2,"0"),ut=(B.getFullYear()+543).toString().slice(-2);return`${Z}/${q}/${ut}`},ct=z(1),dt=z(10),pt=lt(()=>tt.value.total||0),D=lt(()=>tt.value.max_page||1),Mt=lt(()=>(ct.value-1)*dt.value+1),ot=lt(()=>Math.min(ct.value*dt.value,pt.value)),st=async U=>{U<1||U>D.value||(ct.value=U,await _.WithDraw({keyword:x.value.trim()||"",start_date:$.value?.start_date||"",end_date:$.value?.end_date||"",status:m.value||"",page:U,limit:dt.value}),window.scrollTo({top:0,behavior:"smooth"}))},X=lt(()=>{const U=[],B=D.value,Z=ct.value;if(B<=5)for(let q=1;q<=B;q++)U.push(q);else Z<=3?U.push(1,2,3,"...",B):Z>=B-2?U.push(1,"...",B-2,B-1,B):U.push(1,"...",Z-1,Z,Z+1,"...",B);return U}),H=U=>
33U?Number(U).toLocaleString("th-TH",{minimumFractionDigits:2,maximumFractionDigits:2}):"0.00",P=async()=>{try{e.value=!0;const U=await _.ExportWithDraw(),B=document.createElement("a");B.href=window.URL.createObjectURL(U),B.download="Affiliate_Payout_Transaction_Report.xlsx",B.click()}catch(U){console.error("ดาวน์โหลดล้มเหลว:",U)}finally{e.value=!1}},W=({start_date:U,end_date:B})=>{$.value={start_date:U,end_date:B},_.WithDraw({start_date:U,end_date:B,keyword:x.value.trim(),page:1,status:m.value||""})};return(U,B)=>(p(),f(at,null,[i("div",uR,[i("div",hR,[i("div",pR,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:B[0]||(B[0]=Z=>h.value=!1)},[...B[5]||(B[5]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("div",fR,c(U.$t("withdraw_history")),1),i("div",_R,[i("div",{onClick:P,class:"w-8 h-8 rounded-full flex items-center justify-center border",style:{"border-color":"#77a8d1"}},[zt(n(al),{class:"w-5 h-5",style:{color:"#77a8d1"}})])])])])]),i("div",mR,[i("div",vR,[(p(),f("svg",{class:"mr-4",style:b({color:n(t).color}),width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...B[6]||(B[6]=[rs('<path d="M35.5009 32.619C43.4038 32.619 49.8104 26.2125 49.8104 18.3095C49.8104 10.4066 43.4038 4 35.5009 4C27.598 4 21.1914 10.4066 21.1914 18.3095C21.1914 26.2125 27.598 32.619 35.5009 32.619Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" data-v-1b4c109d></path><path d="M37.9398 12.5027C37.5294 12.1959 36.2099 11.3824 34.3546 11.9413C32.2828 12.5654 31.7683 15.4002 33.1762 16.5045C33.9845 17.1385 35.2009 17.6599 36.8403 18.2394C40.5095 19.5363 39.1531 24.7107 35.4208 24.7356C33.9643 24.7453 33.2834 24.6529 32.0039 23.8159" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round" data-v-1b4c109d></path><path d="M35.4219 25.5V26.6221" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round" data-v-1b4c109d></path><path d="M35.4219 10V11.2182" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round" data-v-1b4c109d></path><path d="M29.8167 47.9016H40.9154V44.8659C40.9154 42.6896 39.1541 40.9239 36.9778 40.9183L31.9235 40.9029L31.0159 40.0473C27.3899 36.6293 22.0315 35.9482 17.707 38.2194C16.8397 38.6749 15.8777 38.9208 14.8982 38.9208H10.4922V52.2993H16.5427L27.287 55.8473C27.5939 55.9486 27.9151 56.0003 28.2383 56.0003H40.2966C41.1012 56.0003 41.8729 55.6807 42.4418 55.1118L54.906 42.6475C56.3623 41.1912 56.3623 38.8299 54.906 37.3735C53.4497 35.9172 51.0884 35.9172 49.632 37.3735L41.0793 45.7811" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-1b4c109d></path><path d="M10.494 37.3594H4V53.7897H10.494V37.3594Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" data-v-1b4c109d></path>',6)])],4)),i("div",gR,[i("div",bR,[i("p",xR,c(H(n(Y).total_comm)),1),i("p",yR,c(U.$t("baht")),1)]),i("p",wR,c(U.$t("total_commission")),1)])]),i("div",kR,[i("div",$R,[i("div",CR,[i("p",MR,c(n(Y).views||0),1),i("p",SR,c(U.$t("click_time")),1)]),i("p",DR,c(U.$t("visit")),1)]),i("div",AR,[i("div",zR,[i("p",jR,c(n(Y).total_orders||0),1),i("p",TR,c(U.$t("list")),1)]),i("p",PR,c(U.$t("order")),1)]),i("div",LR,[i("div",RR,[i("p",OR,c(H(n(Y).total_sale)),1),i("p",BR,c(U.$t("baht")),1)]),i("p",ER,c(U.$t("total_sale")),1)]),i("div",FR,[i("div",IR,[i("p",NR,c(H(n(Y).current_comm)),1),i("p",HR,c(U.$t("baht")),1)]),i("p",VR,c(U.$t("commission1")),1)]),B[7]||(B[7]=i("div",{class:"hidden md:block absolute top-1/2 left-[25%] transform -translate-x-1/2 -translate-y-1/2 w-[1px] h-[70%] bg-gray-300"},null,-1)),B[8]||(B[8]=i("div",{class:"hidden md:block absolute top-1/2 left-[50%] transform -translate-x-1/2 -translate-y-1/2 w-[1px] h-[70%] bg-gray-300"},null,-1)),B[9]||(B[9]=i("div",{class:"hidden md:block absolute top-1/2 left-[75%] transform -translate-x-1/2 -translate-y-1/2 w-[1px] h-[70%] bg-gray-300"}
33,null,-1))])]),i("div",WR,[i("div",UR,[i("div",YR,[i("p",qR,c(U.$t("product_detail")),1),i("div",ZR,[i("div",XR,[i("div",KR,[zt(n(Ea),{class:"absolute left-4 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),bt(i("input",{"onUpdate:modelValue":B[1]||(B[1]=Z=>x.value=Z),onInput:et,type:"text",class:"custom-placeholder w-full h-full border border-gray-300 rounded-full pl-13 pr-4 text-[16px] focus:outline-none focus:border-[var(--tw-border-color)]",style:b({"--tw-border-color":n(l)}),placeholder:U.$t("search_order")},null,44,GR),[[Lt,x.value]]),i("a",{class:"cursor-pointer absolute inset-y-0 right-0 flex items-center pr-2",onClick:et})]),zt(Gc,{onConfirm:W}),i("div",QR,[i("div",{class:"relative w-full md:w-[160px]",ref_key:"dropdownStatusRef",ref:w},[i("div",{onClick:B[2]||(B[2]=Z=>S.value=!S.value),tabindex:"0",style:b({borderColor:S.value?n(t).color:"#D1D5DB"}),class:"w-full h-[40px] px-3 rounded-full border flex items-center justify-between cursor-pointer text-sm"},[i("span",JR,c(n(v)),1),(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] transition-transform duration-200",{"rotate-180":S.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...B[10]||(B[10]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],4),S.value?(p(),f("div",tO,[(p(!0),f(at,null,xt(n(M),Z=>(p(),f("div",{key:Z.value,onClick:q=>I(Z),class:"px-4 py-2 cursor-pointer hover:bg-gray-100 text-sm",style:b({backgroundColor:m.value===Z.value?n(a):""})},c(Z.label),13,eO))),128))])):C("",!0)],512)])])])]),i("div",oO,[i("table",sO,[i("thead",nO,[i("tr",iO,[i("th",lO,c(U.$t("order_id")),1),i("th",rO,c(U.$t("earnning")),1),i("th",aO,c(U.$t("payment_date1")),1),i("th",cO,c(U.$t("status_order")),1)])]),i("tbody",null,[n(G).length===0?(p(),f("tr",dO,[i("td",uO,c(U.$t("no_data")),1)])):C("",!0),(p(!0),f(at,null,xt(n(G),(Z,q)=>(p(),f("tr",{key:q,class:"border-b border-gray-200 hover:bg-gray-50 font-bold"},[i("td",hO,c(Z.order_number),1),i("td",pO," ฿ "+c(H(Z.amount)),1),i("td",fO,c(ht(Z.date_transfer)),1),i("td",_O,c(Z.status==="สำเร็จ"?U.$t("success"):Z.status==="รอดำเนินการ"?U.$t("pending"):Z.status==="ไม่สำเร็จ"?U.$t("unsuccess"):Z.status==="ยกเลิก"?U.$t("cancelled"):Z.status),1),i("td",mO,[i("div",vO,[i("div",gO,[i("span",null,c(Z.order_number),1)]),i("div",bO,[i("span",xO,c(U.$t("earnning")),1),i("span",null,"฿ "+c(H(Z.amount)),1)]),i("div",yO,[i("span",wO,c(U.$t("payment_date1")),1),i("span",null,c(ht(Z.date_transfer)),1)]),i("div",kO,[i("span",$O,c(U.$t("status_order")),1),i("span",null,c(Z.status==="สำเร็จ"?U.$t("success"):Z.status==="รอดำเนินการ"?U.$t("pending"):Z.status==="ไม่สำเร็จ"?U.$t("unsuccess"):Z.status==="ยกเลิก"?U.$t("cancelled"):Z.status),1)])])])]))),128))])])]),n(G).length!==0?(p(),f("div",CO,[i("div",MO,c(U.$t("showing_results",{start:n(Mt),end:n(ot),total:n(pt)||0})),1),i("nav",SO,[i("button",{onClick:B[3]||(B[3]=Z=>st(ct.value-1)),disabled:ct.value===1,class:"px-2 text-xl text-gray-600 disabled:text-gray-300 cursor-pointer"},[...B[11]||(B[11]=[i("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])],8,DO),(p(!0),f(at,null,xt(n(X),Z=>(p(),f("button",{key:Z,disabled:Z==="...",class:J(["w-8 h-8 rounded-full font-medium flex items-center justify-center cursor-pointer",Z===ct.value?"text-white":Z==="..."?"cursor-default text-gray-400":"text-gray-700 hover:bg-gray-200"]),style:b(Z===ct.value?{backgroundColor:n(l)}:{}),onClick:q=>Z!=="..."&&st(Z)},c(Z),15,AO))),128)),i("button",{onClick:B[4]||(B[4]=Z=>st(ct.value+1)),disabled:ct.value===n(D),class:"px-2 text-xl text-gray-600 disabled:text-gray-300 cursor-pointer"},[...B[12]||(B[12]=[i("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})],-1)])],8,zO)])])):C("",!0)])])],64))}},TO=mo(jO,[["__scopeId","data-v-1b4c109d"]]),PO={class:"w-full rounded-lg px-4 py-6 bg-white mb-8 text-form"},LO={key:0,class:"w-full flex flex-col md:flex-row items-center justify-between gap-4"},RO={class:"flex items-center w-full md:w-auto justify-center md:justify-start gap-2"},OO={class:"text-[16px] xl:text-[18px] font-semibold text-center md:text-left"},BO={class:"block invisible ml-auto"},EO={key:1,class:"flex flex-col w-full space-y-4"},FO={class:"flex flex-col md:flex-row md:items-center justify-between w-full space-y-2 md:space-y-0 md:space-x-3"},IO={class:"flex items-center mb-2 md:mb-0"},NO={class:"text-[16px] xl:text-[18px] font-semibold"},HO={class:"hidden md:inline"},VO={class:"flex items-start md:items-center w-full md:w-auto space-y-2 md:space-y-0 md:space-x-3"}
33,WO={class:"text-[14px] md:text-[16px] font-normal mr-2"},UO={class:"text-[14px] md:text-[16px] font-normal"},YO={class:"flex flex-col items-start ml-4"},qO={class:"flex items-baseline space-x-1 mb-1"},ZO={class:"text-[16px] md:text-[18px] font-bold"},XO={class:"text-[12px] lg:text-[18px] font-bold"},KO={class:"text-[12px] lg:text-[14px] font-normal"},GO={class:"space-y-4 text-form"},QO={key:0,class:"w-full rounded-lg px-4 py-6 bg-white"},JO={class:"mb-4"},tB={class:"text-[16px] xl:text-[18px] font-semibold mb-2"},eB={class:"w-full flex justify-center mb-4"},oB={class:"flex flex-col gap-2 md:flex-row md:items-center md:gap-4 w-full max-w-[1200px]"},sB={class:"relative w-full md:flex-[2] h-[40px]"},nB=["placeholder"],iB={class:"relative w-full md:flex-1"},lB={class:"text-[16px]"},rB={class:"absolute inset-y-0 right-4 flex items-center pointer-events-none"},aB={key:0,class:"absolute z-10 w-full bg-white border border-gray-300 rounded-xl mt-1 shadow-lg overflow-hidden max-h-60 overflow-y-auto"},cB=["onClick"],dB={class:"mt-10 overflow-x-auto"},uB={class:"w-full text-left border-collapse"},hB={class:"hidden align-center text-center md:table-header-group"},pB={class:"border-b border-gray-400"},fB={class:"p-2 text-[14px] font-normal w-[120px]"},_B={class:"p-2 text-[14px] font-normal w-[100px]"},mB={class:"p-2 text-[14px] font-normal w-[100px]"},vB={class:"p-2 text-[14px] font-normal w-[100px]"},gB={key:0},bB={colspan:"5",class:"p-10 text-center text-gray-500"},xB={class:"p-2"},yB={class:"p-2"},wB={class:"p-2"},kB={class:"p-2"},$B=["onClick"],CB={class:"mt-2 text-[12px] md:text-[14px]"},MB={class:"flex justify-between mt-1"},SB={class:"text-[#A4A4A4] font-normal text-[12px] md:text-[14px]"},DB={class:"text-[12px] md:text-[14px]"},AB={class:"flex justify-between mt-1"},zB={class:"text-[#A4A4A4] font-normal text-[12px] md:text-[14px]"},jB={class:"text-[12px] md:text-[14px]"},TB={class:"flex justify-between mt-1"},PB={class:"text-[#A4A4A4] font-normal text-[12px] md:text-[14px]"},LB={class:"text-[12px] md:text-[14px]"},RB=["onClick"],OB={key:0,class:"mt-6 flex flex-row items-center justify-between text-[12px] md:text-[14px]"},BB={class:"text-gray-700 mb-4 sm:mb-0"},EB={class:"flex items-center space-x-1","aria-label":"Pagination"},FB=["disabled"],IB=["disabled","onClick"],NB=["disabled"],HB={key:1,class:"w-full rounded-lg px-4 py-6 bg-white"},VB={class:"mb-4"},WB={class:"text-[16px] xl:text-[18px] font-semibold mb-2"},UB={class:"mt-10 md:overflow-x-auto"},YB={class:"w-full text-left border-collapse"},qB={class:"hidden align-center text-center md:table-header-group"},ZB={class:"border-b border-gray-400"},XB={class:"p-2 text-[14px] font-normal w-[120px]"},KB={class:"p-2 text-[14px] font-normal w-[100px]"},GB={class:"p-2 text-[14px] font-normal w-[100px]"},QB={class:"p-2 text-[14px] font-normal w-[100px]"},JB={key:0},tE={colspan:"5",class:"p-10 text-center text-gray-500"},eE={class:"p-2 text-center"},oE=["src","alt"],sE={class:"p-2 text-left max-w-[150px]"},nE=["title"],iE={class:"p-2"},lE={class:"p-2"},rE={class:"p-2"},aE={class:"p-3"},cE={class:"flex items-start gap-3"},dE={class:"flex-shrink-0 w-[80px] h-[80px]"},uE=["src"],hE={key:1,class:"w-full h-full flex items-center justify-center text-gray-400 border rounded-md"},pE={class:"flex-1 min-w-0"},fE=["title"],_E={class:"text-[13px] flex justify-between"},mE={class:"text-gray-600"},vE={class:"font-bold"},gE={class:"text-[13px] flex justify-between mt-1"},bE={class:"text-gray-600"},xE={class:"font-bold"},yE={class:"text-[13px] flex justify-between mt-1"},wE={class:"text-gray-600"},kE={class:"font-bold"},$E={key:0,class:"mt-6 flex flex-col sm:flex-row sm:items-center sm:justify-between text-[12px] md:text-[14px]"},CE={class:"text-gray-700 mb-4 sm:mb-0"},ME={class:"flex items-center space-x-1","aria-label":"Pagination"},SE=["disabled"],DE=["disabled","onClick"],AE=["disabled"],zE={__name:"PurchaseReport",setup(o){const{t}=ee(),{locale:e}=ee(),s=ke(),{color:l,button_color:r,bg_hover_button:a,price_red:d}=Qt(s),u=je(),{showContent:h}=Qt(u),_=Vs(),m=z(""),x=lt(()=>window.innerWidth<768),$=z(!1),S=z(!1),v=z(""),M=z(""),{t:w}=ee(),I=z({start_date:"",end_date:""}),O=z(""),tt=lt(()=>_.Order?.pagination||{}),G=z(null),Y=z(!1),et=lt(()=>[{value:"",label:w("all_filter")},{value:"Waiting",label:w("pending")},{value:"Success",label:w("payment_com")},{value:"Cancel",label:w("order_can")}]),ht=()=>{Y.value=!Y.value},ct=Q=>{m.value=Q.value,Y.value=!1,st()},dt=Q=>{G.value&&!G.value.contains(Q.target)&&(Y.value=!1)};we(()=>{document.addEventListener("click",dt)}),as(()=>{document.removeEventListener("click",dt)});const pt=lt(()=>{const Q=et.value.find(E=>E.value===m.value);return Q?Q.label:w("all_filter")}),D=lt(()=>_.Order?.data||[]),Mt=()=>{S.value=!1,window.scrollTo({top:0,behavior:"smooth"})},ot=async Q=>{v.value=Q.order_number,M.value=Q.order_date,await _.PurchaseReport({order_number:Q.order_number}),S.value=!0,window.scrollTo({top:0,behavior:"smooth"})},st=async()=>{W.value=1,await _.OrderProduct({start_date:I.value.start_date,end_date:I.value.end_date,keyword:O.value.trim(),page:W.value,status:m.value||"",limit:U.value})},X=lt(()=>_.report?.product||[]),H=lt(()=>_.report||[]);we(()=>{_.OrderProduct(),_.PurchaseReport()});const P=Q=>{const E=new Date(Q),mt=E.getDate().toString().padStart(2,"0"),Zt=(E.getMonth()+1).toString().padStart(2,"0"),ve=(e.value==="th"?E.getFullYear()+543:E.getFullYear()).toString().slice(-2);return`${mt}/${Zt}/${ve}`},W=z(1),U=z(10),B=lt(()=>tt.value.total||0),Z=lt(()=>tt.value.max_page||1),q=lt(()=>(W.value-1)*U.value+1),ut=lt(()=>Math.min(W.value*U.value,B.value)),wt=async Q=>{Q<1||Q>Z.value||(W.value=Q,await _.OrderProduct({start_date:I.value.start_date,end_date:I.value.end_date,keyword:O.value.trim(),status:m.value||"",page:Q,limit:U.value}),window.scrollTo({top:0,behavior:"smooth"}))},St=lt(()=>{const Q=[],E=Z.value,mt=W.value;if(E<=5)for(let Zt=1;Zt<=E;Zt++)Q.push(Zt);else mt<=3?Q.push(1,2,3,"...",E):mt>=E-2?Q.push(1,"...",E-2,E-1,E):Q.push(1,"...",mt-1,mt,mt+1,"...",E);return Q}),Tt=Q=>{if(!Q)return"-";switch(Q){case"ชำระเงินสำเร็จ":return t("status1.success");case"รอดำเนินการ":return t("status1.waiting");case"ยกเลิกคำสั่งซื้อ":case"ยกเลิก":return t("status1.fail");default:return Q}},vt=Q=>
33Q==null||Q===""||Number(Q)===0?"-":Number(Q).toLocaleString("th-TH",{minimumFractionDigits:2,maximumFractionDigits:2}),yt=Q=>{const E=vt(Q);return E!=="-"?`฿ ${E}`:"-"},Ft=async()=>{try{$.value=!0;const Q=await _.ExportOrder(),E=document.createElement("a");E.href=window.URL.createObjectURL(Q),E.download="Affiliate_Order_Report.xlsx",E.click()}catch(Q){console.error("ดาวน์โหลดล้มเหลว:",Q)}finally{$.value=!1}},N=z(1),$t=z(5),T=lt(()=>_.report?.pagination||{}),Pt=lt(()=>T.value.total||0),Rt=lt(()=>T.value.max_page||1),ft=lt(()=>(N.value-1)*$t.value+1),F=lt(()=>Math.min(N.value*$t.value,Pt.value)),R=async Q=>{Q<1||Q>Rt.value||(N.value=Q,v.value&&await _.PurchaseReport({order_number:v.value,page:Q,limit:$t.value}),window.scrollTo({top:0,behavior:"smooth"}))},kt=(Q,E)=>{const mt=[];if(E<=5)for(let Zt=1;Zt<=E;Zt++)mt.push(Zt);else Q<=3?mt.push(1,2,3,"...",E):Q>=E-2?mt.push(1,"...",E-2,E-1,E):mt.push(1,"...",Q-1,Q,Q+1,"...",E);return mt},qt=lt(()=>kt(N.value,Rt.value)),It=({start_date:Q,end_date:E})=>{I.value={start_date:Q,end_date:E},W.value=1,_.OrderProduct({start_date:Q,end_date:E,keyword:O.value.trim(),page:1,limit:U.value,status:m.value||""})},he=Q=>{if(!Q)return"";const E=new Date(Q),mt=String(E.getDate()).padStart(2,"0"),Zt=String(E.getMonth()+1).padStart(2,"0"),Oe=e.value==="th"?E.getFullYear()+543:E.getFullYear(),ve=String(Oe).slice(-2);return`${mt}/${Zt}/${ve}`};return(Q,E)=>(p(),f(at,null,[i("div",PO,[S.value?C("",!0):(p(),f("div",LO,[i("div",RO,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:E[0]||(E[0]=mt=>h.value=!1)},[...E[6]||(E[6]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("div",OO,c(n(t)("order_report")),1),i("div",BO,[i("div",{onClick:Ft,class:"w-8 h-8 rounded-full flex items-center justify-center border",style:{"border-color":"#77a8d1"}},[zt(n(al),{class:"w-5 h-5",style:{color:"#77a8d1"}})])])])])),S.value?(p(),f("div",EO,[i("div",FO,[i("div",IO,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:Mt},[...E[7]||(E[7]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("div",NO,[i("span",HO,c(n(t)("order_id"))+" : ",1),i("span",null,c(v.value),1)])]),i("div",VO,[i("p",WO,c(Tt(n(H).status)),1),i("p",UO,c(n(t)("date"))+" "+c(he(M.value)),1)])]),n(H).status==="ชำระเงินสำเร็จ"?(p(),f("div",{key:0,style:b({width:"100%",height:"96px",border:"1px solid",borderColor:n(l),backgroundColor:n(a),borderRadius:"8px"}),class:"flex items-center px-4"},[(p(),f("svg",{class:"mb-2",style:b({color:n(s).color}),width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...E[8]||(E[8]=[rs('<path d="M35.5009 32.619C43.4038 32.619 49.8104 26.2125 49.8104 18.3095C49.8104 10.4066 43.4038 4 35.5009 4C27.598 4 21.1914 10.4066 21.1914 18.3095C21.1914 26.2125 27.598 32.619 35.5009 32.619Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" data-v-7e86c5a6></path><path d="M37.9398 12.5027C37.5294 12.1959 36.2099 11.3824 34.3546 11.9413C32.2828 12.5654 31.7683 15.4002 33.1762 16.5045C33.9845 17.1385 35.2009 17.6599 36.8403 18.2394C40.5095 19.5363 39.1531 24.7107 35.4208 24.7356C33.9643 24.7453 33.2834 24.6529 32.0039 23.8159" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round" data-v-7e86c5a6></path><path d="M35.4219 25.5V26.6221" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round" data-v-7e86c5a6></path><path d="M35.4219 10V11.2182" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round" data-v-7e86c5a6></path><path d="M29.8167 47.9016H40.9154V44.8659C40.9154 42.6896 39.1541 40.9239 36.9778 40.9183L31.9235 40.9029L31.0159 40.0473C27.3899 36.6293 22.0315 35.9482 17.707 38.2194C16.8397 38.6749 15.8777 38.9208 14.8982 38.9208H10.4922V52.2993H16.5427L27.287 55.8473C27.5939 55.9486 27.9
33151 56.0003 28.2383 56.0003H40.2966C41.1012 56.0003 41.8729 55.6807 42.4418 55.1118L54.906 42.6475C56.3623 41.1912 56.3623 38.8299 54.906 37.3735C53.4497 35.9172 51.0884 35.9172 49.632 37.3735L41.0793 45.7811" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" data-v-7e86c5a6></path><path d="M10.494 37.3594H4V53.7897H10.494V37.3594Z" stroke="currentColor" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" data-v-7e86c5a6></path>',6)])],4)),i("div",YO,[i("div",qO,[i("p",ZO,c(vt(n(H).total_affilaite)),1),i("p",XO,c(n(t)("baht")),1)]),i("p",KO,c(n(t)("total_com")),1)])],4)):C("",!0)])):C("",!0)]),i("div",GO,[S.value?C("",!0):(p(),f("div",QO,[i("div",JO,[i("p",tB,c(n(t)("product_detail")),1),i("div",eB,[i("div",oB,[i("div",sB,[zt(n(Ea),{class:"absolute left-4 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),bt(i("input",{"onUpdate:modelValue":E[1]||(E[1]=mt=>O.value=mt),onInput:st,type:"text",placeholder:n(t)("search_order"),class:"custom-placeholder w-full h-full border border-gray-300 rounded-full pl-13 pr-4 text-[16px] focus:outline-none focus:border-[var(--tw-border-color)]",style:b({"--tw-border-color":n(l)})},null,44,nB),[[Lt,O.value]])]),zt(Gc,{onConfirm:It}),i("div",iB,[i("div",{class:"relative w-full md:w-[200px]",ref_key:"dropdownStatusRef",ref:G},[i("div",{onClick:ht,tabindex:"0",style:b({borderColor:Y.value?n(s).color:"#D1D5DB"}),class:"w-full h-[40px] px-3 pr-8 rounded-full border flex items-center justify-between cursor-pointer text-[16px]"},[i("span",lB,c(n(pt)),1),i("div",rB,[(p(),f("svg",{class:J(["w-5 h-5 text-[#343434] transition-transform duration-200",{"rotate-180":Y.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[...E[9]||(E[9]=[i("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))])],4),Y.value?(p(),f("div",aB,[(p(!0),f(at,null,xt(n(et),mt=>(p(),f("div",{key:mt.value,onClick:Zt=>ct(mt),class:"px-4 py-2 cursor-pointer hover:bg-gray-100",style:b({backgroundColor:m.value===mt.value?n(a):""})},c(mt.label),13,cB))),128))])):C("",!0)],512)])])])]),i("div",dB,[i("table",uB,[i("thead",hB,[i("tr",pB,[i("th",fB,c(n(t)("order_id")),1),i("th",_B,c(n(t)("order_dates")),1),i("th",mB,c(n(t)("status_order")),1),i("th",vB,c(n(t)("commission1")),1),E[10]||(E[10]=i("th",{class:"p-2 text-[14px] font-normal w-[50px]"},null,-1))])]),i("tbody",null,[n(D).length===0?(p(),f("tr",gB,[i("td",bB,c(n(t)("no_product")),1)])):n(D).length!==0&&!n(x)?(p(!0),f(at,{key:1},xt(n(D),(mt,Zt)=>(p(),f("tr",{key:Zt,class:"align-center text-center border-b border-gray-200 hover:bg-gray-50 text-[14px] font-bold"},[i("td",xB,c(mt.order_number),1),i("td",yB,c(P(mt.order_date)),1),i("td",wB,c(Tt(mt.status)),1),i("td",kB,c(yt(mt.amount)),1),i("div",{class:"w-8 h-8 mt-3 mb-2 cursor-pointer rounded-full flex items-center justify-center",style:b({border:`1px solid ${n(s).color}`}),onClick:Oe=>ot(mt)},[zt(n(Hi),{class:"w-5 h-5",style:b({color:n(l)})},null,8,["style"])],12,$B)]))),128)):n(D).length!==0&&n(x)?(p(!0),f(at,{key:2},xt(n(D),(mt,Zt)=>(p(),f("tr",{key:Zt,class:"align-center border-b border-gray-200 hover:bg-gray-50 text-[14px] font-bold"},[i("p",CB,c(mt.order_number),1),i("div",MB,[i("p",SB,c(n(t)("order_dates")),1),i("p",DB,c(P(mt.order_date)),1)]),i("div",AB,[i("p",zB,c(n(t)("status_order")),1),i("td",jB,c(Tt(mt.status)),1)]),i("div",TB,[i("p",PB,c(n(t)("commission1")),1),i("p",LB,c(vt(mt.amount)),1)]),i("div",{class:"w-8 h-8 mt-3 mb-2 cursor-pointer rounded-full flex items-center justify-center",style:b({border:`1px solid ${n(s).color}`}),onClick:Oe=>ot(mt)},[zt(n(Hi),{class:"w-5 h-5",style:b({color:n(l)})},null,8,["style"])],12,RB)]))),128)):C("",!0)])])]),n(D).length!==0?(p(),f("div",OB,[i("div",BB,c(n(t)("showing_results",{start:n(q),end:n(ut),total:n(B)||0})),1),i("nav",EB,[i("button",{onClick:E[2]||(E[2]=mt=>wt(W.value-1)),disabled:W.value===1,class:"px-2 text-gray-600 disabled:text-gray-300 cursor-pointer"},[...E[11]||(E[11]=[i("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])],8,FB),(p(!0),f(at,null,xt(n(St),mt=>(p(),f("button",{key:mt,disabled:mt==="...",class:J(["w-8 h-8 rounded-full text-[12px] md:text-[14px] font-medium flex items-center justify-center cursor-pointer",mt==="..."?"cursor-default text-gray-400":"text-gray-700 hover:bg-gray-200"]),style:b(mt===W.value?{background:n(l),color:"white"}:{}),onClick:Zt=>mt!=="..."&&wt(mt)},c(mt),15,IB))),128)),i("button",{onClick:E[3]||(E[3]=mt=>wt(W.value+1)),disabled:W.value===n(Z),class:"px-2 text-xl text-gray-600 disabled:text-gray-300 cursor-pointer"},[...E[12]||(E[12]=[i("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})],-1)])],8,NB)])])):C("",!0)])),S.value?(p(),f("div",HB,[i("div",VB,[i("p",WB,c(n(t)("order_item")),1)]),i("div",UB,[i("table",YB,[i("thead",qB,[i("tr",ZB,[i("th",XB,c(n(t)("product_list")),1),E[13]||(E[13]=i("th",{class:"p-2 text-[14px] font-normal w-[100px]"},null,-1)),i("th",KB,c(n(t)("quantity")),1),i("th",GB,c(n(t)("price")),1),i("th",QB,c(n(t)("commission1")),1)])]),i("tbody",null,[n(X).length===0?(p(),f("tr",JB,[i("td",tE,c(n(t)("no_product")),1)])):(p(!0),f(at,{key:1},xt(n(X),(mt,Zt)=>(p(),f("tr",{key:Zt,class:"hidden md:table-row align-center text-center border-b border-gray-200 hover:bg-gray-50 text-[14px] font-bold"},[i("td",eE,[i("img",{src:mt.image&&mt.image!==""?mt.image:n(re),alt:mt.manufacturer_name||"Product Image",class:"w-[100px] h-[100px] object-contain rounded-md mx-auto"},null,8,oE)]),i("td",sE,[i("div",{class:"font-semibold truncate",title:mt.name},c(n(e)==="th"?mt.name:mt.name_en||mt.name),9,nE)]),i("td",iE,c(mt.quantity),1),i("td",lE,"฿ "+c(vt(mt.price)),1),i("td",rE,c(yt(mt.amount)),1)]))),128)),(p(!0),f(at,null,xt(n(X),(mt,Zt)=>(p(),f("tr",{key:"mobile-"+Zt,class:"md:hidden border-b border-gray-200 hover:bg-gray-50"},[i("td",aE,[i("div",cE,[i("div",dE,[mt.image&&mt.image!==""?(p(),f("img",{key:0,src:mt.image,alt:"Product Image",class:"w-full h-full object-contain rounded-md"},null,8,uE)):(p(),f("div",hE," - "))]),i("div",pE,[i("div",{class:"font-semibold text-[14px] truncate overflow-hidden whitespace-nowrap text-ellipsis max-w-[150px]",title:mt.name},c(n(e)==="th"?mt.name:mt.name_en||mt.name),9,fE),C("",!0),E[14]||(E[14]=i("div",{class:"border-b border-gray-200 my-2"},null,-1)),i("div",_E,[i("span",mE,c(n(t)("quantity")),1),i("span",vE,c(mt.quantity),1)]),i("div",gE,[i("span",bE,c(n(t)("price")),1),i("span",xE,"฿ "+c(vt(mt.price)),1)]),i("div",yE,[i("span",wE,c(n(t)("commission1")),1),i("span",kE,c(yt(mt.amount)),1)])])])])]))),128))])])]),n(X).length!==0?(p(),f("div",$E,[i("div",CE,c(n(t)("showing_results",{start:n(ft),end:n(F),total:n(Pt)||0})),1),i("nav",ME,[i("button",{onClick:E[4]||(E[4]=mt=>R(N.value-1)),disabled:N.value===1,class:"px-2 text-xl text-gray-600 disabled:text-gray-300 cursor-pointer"},[...E[15]||(E[15]=[i("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])],8,SE),(p(!0),f(at,null,xt(n(qt),mt=>(p(),f("button",{key:mt,disabled:mt==="...",class:J(["w-8 h-8 rounded-full font-medium flex items-center justify-center cursor-pointer",mt==="..."?"cursor-default text-gray-400":"text-gray-700 hover:bg-gray-200"]),style:b(mt===N.value?{background:n(l),color:"white"}:{}),onClick:Zt=>mt!=="..."&&R(mt)}
33,c(mt),15,DE))),128)),i("button",{onClick:E[5]||(E[5]=mt=>R(N.value+1)),disabled:N.value===n(Rt),class:"px-2 text-[12px] md:text-sm text-gray-600 disabled:text-gray-300 cursor-pointer"},[...E[16]||(E[16]=[i("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})],-1)])],8,AE)])])):C("",!0)])):C("",!0)])],64))}},jE=mo(zE,[["__scopeId","data-v-7e86c5a6"]]),TE={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 60 60"};function PE(o,t){return p(),f("svg",TE,[...t[0]||(t[0]=[rs('<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M25.883 38.227v-2.032M25.883 54.477v-2.032M25.883 46.352V44.32M25.883 28.07v2.032"></path><mask id="a" width="52" height="52" x="4" y="4" maskUnits="userSpaceOnUse" style="mask-type:luminance;"><path fill="#fff" stroke="#fff" stroke-width="2" d="M55 55V5H5v50z"></path></mask><g mask="url(#a)"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M20.758 54.477H5.523V5.523l3.555 2.032 3.555-2.032 3.555 2.032 3.554-2.032 3.555 2.032 3.555-2.032 3.554 2.032 3.555-2.032V28.07"></path></g><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M11.617 15.883h16.25M11.617 21.977h3.047M11.617 28.07h3.047M11.617 34.164h3.047M11.617 40.258h3.047M11.617 46.352h3.047M20.758 21.977h7.11"></path><mask id="b" width="52" height="52" x="4" y="4" maskUnits="userSpaceOnUse" style="mask-type:luminance;"><path fill="#fff" stroke="#fff" stroke-width="2" d="M55 55V5H5v50z"></path></mask><g mask="url(#b)"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M18 28.07v10.157c1.82 0 3.296 1.364 3.296 3.046 0 1.683-1.476 3.047-3.296 3.047v10.157h36.477V28.07z"></path></g><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M41.267 51.667c5.744 0 10.4-4.656 10.4-10.4s-4.656-10.4-10.4-10.4-10.4 4.656-10.4 10.4 4.656 10.4 10.4 10.4"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M41.268 48.867a7.598 7.598 0 1 0 0-15.195 7.598 7.598 0 0 0 0 15.195"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="m41.267 44.22-2.486 1.138a.334.334 0 0 1-.47-.343l.313-2.715-1.85-2.013a.334.334 0 0 1 .18-.554l2.68-.54 1.342-2.382a.334.334 0 0 1 .582 0l1.343 2.381 2.68.541a.334.334 0 0 1 .18.554L43.91 42.3l.313 2.715a.334.334 0 0 1-.47.343z"></path>',9)])])}const LE={render:PE},RE={key:0,class:"absolute top-full left-3 md:left-[-70px] xl:left-3 mt-2 w-[290px] bg-white rounded-2xl shadow-xl border border-gray-300 p-4 z-50"},OE={class:"flex items-center justify-between mb-4 px-1"},BE={class:"flex items-center gap-3"},EE={key:0,class:"grid grid-cols-3 gap-2"},FE=["onClick"],IE={key:1,class:"grid grid-cols-3 gap-2"},NE=["onClick"],HE={class:"grid grid-cols-7 text-center text-xs text-gray-500 mb-2"},VE={class:"grid grid-cols-7 gap-y-2"},WE=["onMouseenter"],UE=["onClick"],YE={class:"flex gap-3 mt-4 pt-4 border-t border-gray-200"},qE={__name:"CalendarPoint",emits:["update:modelValue"],setup(o,{emit:t}){const e=ke(),s=t,{locale:l}=ee(),r=z(!1),a=z("date"),d=z(null),u=new Date,h=z(u.getMonth()),_=z(u.getFullYear()),m=z(""),x=z(""),$=z(""),S={th:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],en:["January","February","March","April","May","June","July","August","September","October","November","December"]},v=lt(()=>l.value==="th"?["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),M=lt(()=>S[l.value]||S.en),w=lt(()=>{if(!m.value)return"";const X=new Date(m.value).toLocaleDateString("th-TH");if(!x.value)return X;const H=new Date(x.value).toLocaleDateString("th-TH");return`${X} - ${H}`}),I=lt(()=>{const X=_.value-6;return Array.from({length:12},(H,P)=>X+P)}),O=lt(()=>{const X=_.value,H=h.value,W=new Date(X,H,1).getDay(),U=new Date(X,H+1,0).getDate(),B=[],Z=new Date(X,H,0).getDate();for(let q=0;q<W;q++)B.push({key:`prev-${q}`,day:Z-W+1+q,currentMonth:!1});for(let q=1;q<=U;q++)B.push({key:q,day:q,currentMonth:!0,date:`${X}
33-${String(H+1).padStart(2,"0")}-${String(q).padStart(2,"0")}`});return B}),tt=X=>{m.value&&!x.value&&X&&($.value=X)},G=X=>X?X===m.value||X===x.value:!1,Y=X=>{if(!X||!m.value)return!1;const H=x.value||(m.value&&!x.value?$.value:null);if(!H)return!1;const P=new Date(X).getTime(),W=new Date(m.value).getTime(),U=new Date(H).getTime(),B=Math.min(W,U),Z=Math.max(W,U);return P>B&&P<Z},et=X=>{if(!X||!m.value)return!1;const H=x.value||(m.value&&!x.value?$.value:null);if(!H||m.value===H)return!1;const P=new Date(X).getTime(),W=new Date(m.value).getTime(),U=new Date(H).getTime();return P===Math.min(W,U)},ht=X=>{if(!X||!m.value)return!1;const H=x.value||(m.value&&!x.value?$.value:null);if(!H||m.value===H)return!1;const P=new Date(X).getTime(),W=new Date(m.value).getTime(),U=new Date(H).getTime();return P===Math.max(W,U)},ct=X=>{_.value=X,a.value="month"},dt=X=>{h.value=X,a.value="date"},pt=X=>{if(!X.currentMonth)return;const H=X.date;if(!m.value||m.value&&x.value)m.value=H,x.value="",$.value=H;else if(m.value&&!x.value){const P=new Date(m.value).getTime(),W=new Date(H).getTime();W<P?(x.value=m.value,m.value=H):(W>P,x.value=H)}},D=()=>{h.value--,h.value<0&&(h.value=11,_.value--)},Mt=()=>{h.value++,h.value>11&&(h.value=0,_.value++)},ot=()=>{m.value="",x.value="",$.value="",a.value="date",s("update:modelValue",{startDate:"",endDate:""}),h.value=u.getMonth(),_.value=u.getFullYear(),r.value=!1},st=()=>
33{s("update:modelValue",{startDate:m.value,endDate:x.value}),r.value=!1};return si(d,()=>r.value=!1),(X,H)=>(p(),f("div",{class:"relative inline-block w-full",ref_key:"CalendarPointRef",ref:d},[H[7]||(H[7]=i("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[i("svg",{class:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i("path",{d:"M5.625 2.5V4.375M14.375 2.5V4.375M2.5 15.625V6.25C2.5 5.21447 3.33947 4.375 4.375 4.375H15.625C16.6605 4.375 17.5 5.21447 17.5 6.25V15.625M2.5 15.625C2.5 16.6605 3.33947 17.5 4.375 17.5H15.625C16.6605 17.5 17.5 16.6605 17.5 15.625M2.5 15.625V9.375C2.5 8.33947 3.33947 7.5 4.375 7.5H15.625C16.6605 7.5 17.5 8.33947 17.5 9.375V15.625",stroke:"#A4A4A4","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),i("div",{onClick:H[0]||(H[0]=P=>r.value=!r.value),class:"w-full min-w-[230px] h-[40px] pl-12 pr-5 rounded-full border border-gray-300 flex items-center cursor-pointer bg-white"},[i("span",{class:J(m.value?"text-gray-800":"text-gray-400")},c(w.value||X.$t("select_date")),3)]),r.value?(p(),f("div",RE,[i("div",OE,[i("div",BE,[i("button",{class:"font-medium cursor-pointer flex items-center gap-1 text-gray-850",onClick:H[1]||(H[1]=P=>a.value="month")},[gt(c(M.value[h.value])+" ",1),H[3]||(H[3]=i("span",{class:"text-[10px] text-gray-500 scale-90"},"▼",-1))]),i("button",{class:"font-medium cursor-pointer flex items-center gap-1 text-gray-850",onClick:H[2]||(H[2]=P=>a.value="year")},[gt(c(n(l)==="th"?_.value+543:_.value)+" ",1),H[4]||(H[4]=i("span",{class:"text-[10px] text-gray-500 scale-90"},"▼",-1))])]),i("div",{class:"flex items-center gap-1"},[i("button",{onClick:D,class:"w-7 h-7 flex items-center justify-center rounded-full hover:bg-gray-100 transition cursor-pointer text-gray-600"},[...H[5]||(H[5]=[i("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),i("button",{onClick:Mt,class:"w-7 h-7 flex items-center justify-center rounded-full hover:bg-gray-100 transition cursor-pointer text-gray-600"},[...H[6]||(H[6]=[i("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])])])]),a.value==="year"?(p(),f("div",EE,[(p(!0),f(at,null,xt(I.value,P=>(p(),f("button",{key:P,onClick:W=>ct(P),class:J(["h-10 rounded-lg hover:bg-gray-50 cursor-pointer",{"bg-gray-100 font-semibold":P===_.value}]),style:b(P===_.value?{color:n(e).color}:{})},c(n(l)==="th"?P+543:P),15,FE))),128))])):a.value==="month"?(p(),f("div",IE,[(p(!0),f(at,null,xt(M.value,(P,W)=>(p(),f("button",{key:P,onClick:U=>dt(W),class:J(["h-10 rounded-lg hover:bg-gray-50 cursor-pointer",{"bg-gray-100 font-semibold":W===h.value}]),style:b(W===h.value?{color:n(e).color}:{})},c(P.slice(0,3)),15,NE))),128))])):(p(),f(at,{key:2},[i("div",HE,[(p(!0),f(at,null,xt(v.value,P=>(p(),f("div",{key:P},c(P),1))),128))]),i("div",VE,[(p(!0),f(at,null,xt(O.value,P=>(p(),f("div",{key:P.key,class:"relative flex justify-center items-center h-8",onMouseenter:W=>tt(P.date)},[P.currentMonth&&Y(P.date)?(p(),f("div",{key:0,class:"absolute inset-0 opacity-20",style:b({backgroundColor:n(e).color})},null,4)):C("",!0),P.currentMonth&&et(P.date)?(p(),f("div",{key:1,class:"absolute right-0 w-1/2 h-full opacity-20",style:b({backgroundColor:n(e).color})},null,4)):C("",!0),P.currentMonth&&ht(P.date)?(p(),f("div",{key:2,class:"absolute left-0 w-1/2 h-full opacity-20",style:b({backgroundColor:n(e).color})},null,4)):C("",!0),i("button",{onClick:W=>pt(P),class:J(["relative z-10 h-8 w-8 rounded-full text-sm cursor-pointer transition-colors flex items-center justify-center font-medium",{"text-gray-300 pointer-events-none":!P.currentMonth,"text-white":G(P.date),"text-gray-700":P.currentMonth&&!G(P.date),"hover:bg-gray-100":!G(P.date)&&P.currentMonth}]),style:b(G(P.date)?{backgroundColor:n(e).color}:{})}
33,c(P.day),15,UE)],40,WE))),128))])],64)),i("div",YE,[i("button",{onClick:ot,class:"flex-1 h-9 rounded-full border cursor-pointer font-medium text-sm transition",style:b({borderColor:n(e).color,color:n(e).color})},c(X.$t("clear")),5),i("button",{onClick:st,class:"flex-1 h-9 rounded-full text-white cursor-pointer font-medium text-sm transition",style:b({backgroundColor:n(e).color})},c(X.$t("confirm")),5)])])):C("",!0)],512))}},ZE={class:"p-6 rounded-xl bg-white"},XE={class:"flex items-center mb-6"},KE={class:"!text-[18px] font-semibold"},GE={class:"flex flex-col md:flex-row items-start gap-2 md:gap-4"},QE={class:"text-base md:text-lg font-bold"},JE={key:0,class:"text-[10px] sm:text-sm text-[#343434]"},tF={key:1,class:"text-[10px] sm:text-sm text-[#343434]"},eF={key:0,class:"flex overflow-x-auto mt-4"},oF=["onClick"],sF={class:"px-6 py-1 rounded-xl bg-white xl:mt-6 mt-4"},nF={class:"!text-[18px] font-semibold py-4"},iF={class:"flex flex-col md:flex-row md:items-center gap-4"},lF={class:"w-full md:w-[65%] relative"},rF=["placeholder"],aF={class:"w-full md:w-[35%] relative"},cF={key:0,class:"overflow-x-auto px-1 mb-5 mt-4"},dF={class:"w-full table-auto text-left text-xs md:text-sm"},uF={class:"border-b text-[#343434] text-center"},hF={class:"px-3 md:px-4 py-[18px] font-normal"},pF={class:"px-3 md:px-4 py-[18px] font-normal"},fF={class:"md:hidden"},_F={class:"hidden md:inline"},mF={class:"px-3 md:px-4 py-[18px] font-normal"},vF={class:"px-3 md:px-4 py-[18px] font-normal"},gF={key:0},bF={class:"font-semibold"},xF={class:"px-4 py-3"},yF={key:0,class:"font-semibold"},wF={key:1,class:"font-semibold"},kF={key:0,class:"font-semibold text-[#343434]"},$F={key:1,class:"font-semibold text-[#343434]"},CF={key:1},MF={colspan:"4",class:"text-center py-6 text-[14px] text-[#A4A4A4] mt-10",style:{"padding-top":"68px"}},SF={key:1,class:"flex flex-col items-center justify-center py-14 text-center"},DF={class:"w-20 h-20 rounded-full flex items-center justify-center mb-2"},AF={class:"text-xl font-medium mb-2"},zF={class:"text-gray-600"},jF={class:"flex justify-between space-x-1 my-5 px-6 bg-white",style:{"align-items":"center"}},TF={class:"flex items-center space-x-1"},PF=["disabled"],LF=["onClick"],RF=["disabled"],OF="rounded-full border-slate-300 p-2 text-center text-sm transition-all hover:shadow-lg text-slate-600 hover:bg-gray-100 hover:border-slate-800 focus:border-slate-800 active:border-slate-800 active:text-white active:bg-slate-800 disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none",BF="",EF="rounded-full border-slate-300 p-2 text-center text-sm transition-all hover:shadow-lg text-slate-600 hover:bg-gray-100 hover:border-slate-800 focus:border-slate-800 active:border-slate-800 active:text-white active:bg-slate-800 disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none",FF={__name:"PointSection",setup(o){const{t}=ee(),e=z(""),s=je(),{listPoint:l}=Qt(s),r=je(),{showContent:a}=Qt(r),d=ke(),u=z(""),h=z(1),_=z(10),m=z(1),x=z(1),$=z(null),S=l.value?.[0]||{},{color:v,button_color:M,bg_color:w}=Qt(d),I=z(l.value?.[0]?.total_all||0),O=z(l.value?.[0]?.total_earned||0),tt=z(l.value?.[0]?.total_used||0),{locale:G}=ee(),Y=z({startDate:"",endDate:""}),et=()=>{h.value=1},ht=lt(()=>(S?.total_point_remaining/S?.x_point*S?.x_baht).toFixed(2)),ct=()=>{h.value+=1},dt=lt(()=>{const B=h.value,Z=e.value.trim().toLowerCase(),q=l.value[0]||[],ut=Array.isArray(q.point_list)?q.point_list:[];$.value=ut.filter(vt=>{const yt=!Z||vt.order_number?.toLowerCase().includes(Z)||vt.point_type?.toLowerCase().includes(Z);let Ft=!0;const N=vt.created_at?.slice(0,10),{startDate:$t,endDate:T}=Y.value;return($t||T)&&(N?$t&&T?Ft=N>=$t&&N<=T:$t&&!T&&(Ft=N===$t):Ft=!1),yt&&Ft});const wt=[...$.value].sort((vt,yt)=>new Date(yt.created_at)-new Date(vt.created_at)),St=(B-1)*10,Tt=St+10;return _.value=Math.min(Tt,wt.length),wt.slice(St,Tt)}),pt=lt(()=>{const B=$.value?.length||0;x.value=B,m.value=Math.max(1,Math.ceil(B/10)),h.value>m.value&&(h.value=m.value),h.value<1&&(h.value=1);const Z=[];for(let q=1;q<=m.value;q++)q===1||q===m.value||q>=h.value-1&&q<=h.value+1?Z.push(q):Z[Z.length-1]!=="..."&&Z.push("...");return Z}),D=()=>{h.value-=1},Mt=()=>{h.value=1},ot=B=>
33["min-w-[32px] min-h-[32px] md:min-w-[32px] md:min-h-[32px] lg:min-w-[32px] lg:min-h-[32px]  xl:min-w-[32px] xl:min-h-[32px] aspect-square p-1 flex items-center justify-center rounded-full text-sm transition-all hover:shadow-lg text-slate-600 hover:border-slate-800 focus:border-slate-800 active:border-slate-800 disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none",h.value===B?"text-white":"hover:bg-gray-100 "],st=B=>h.value===B?{backgroundColor:d.color}:{},X=B=>{h.value=B};function H(B){h.value=1,u.value=B,s.loadListPoint(B)}const P=lt(()=>[{id:"",name:t("all"),total:I.value},{id:"earned",name:t("earn_points"),total:O.value},{id:"used",name:t("apply_points"),total:tt.value}]);function W(B){return B?Number(B).toLocaleString():"0"}const U=B=>{if(B==null)return" ";{const Z=new Date(B);if(isNaN(Z.getTime()))return"-";const q=["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],ut=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wt=Z.getDate(),St=G.value==="th"?q[Z.getMonth()]:ut[Z.getMonth()],Tt=G.value==="th"?Z.getFullYear()+543:Z.getFullYear(),vt=String(Z.getHours()).padStart(2,"0"),yt=String(Z.getMinutes()).padStart(2,"0");return`${wt} ${St} ${Tt} ${vt}:${yt}`}};return(B,Z)=>(p(),f(at,null,[i("div",ZE,[i("div",XE,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:Z[0]||(Z[0]=q=>a.value=!1)},[...Z[3]||(Z[3]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("h1",KE,c(n(t)("my_points")),1)]),zt(oc,{show:!0,color:n(v)},{default:ne(()=>[i("div",GE,[zt(n(LE),{style:b(`color:${n(v)}`),class:"w-[60px] h-[60px] shrink-0"},null,8,["style"]),i("div",{class:"flex flex-col justify-between gap-1 md:gap-2",style:b({color:n(d).black})},[i("p",QE,c(W(n(S)?.total_point_remaining)||0)+" "+c(n(t)("points")),1),n(S)?.total_point_remaining?(p(),f("div",JE,c(n(t)("can_use_discount"))+" "+c(W(ht.value))+" "+c(n(t)("bath"))+" ("+c(W(n(S)?.x_point))+" "+c(n(t)("points"))+" = "+c(W(n(S)?.x_baht))+" "+c(n(t)("bath"))+") ",1)):n(S)?.total_point_remaining?C("",!0):(p(),f("div",tF,c(n(t)("point_cannot_be_applied")),1))],4)])]),_:1},8,["color"]),dt.value?(p(),f("div",eF,[(p(!0),f(at,null,xt(P.value,q=>(p(),f("button",{key:q.id,class:J(["w-full py-2 whitespace-nowrap transition-all duration-200 border-b-4 border-transparent cursor-pointer px-[6px] md:px-[0px]",u.value===q.id?"text-[#343434] font-semibold border-b-4":"text-[#343434] hover:text-[#343434]"]),style:b(u.value===q.id?`border-color:${n(v)}; color:${n(v)}`:""),onClick:ut=>H(q.id)},c(q.name)+" ("+c(q.total)+") ",15,oF))),128))])):C("",!0)]),i("div",sF,[i("h2",nF,c(n(t)("view_details")),1),i("div",iF,[i("div",lF,[Z[4]||(Z[4]=i("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[i("svg",{class:"h-5 w-5 text-gray-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[i("circle",{cx:"11",cy:"11",r:"8"}),i("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})])],-1)),bt(i("input",{onInput:Mt,type:"search","onUpdate:modelValue":Z[1]||(Z[1]=q=>e.value=q),class:"w-full pl-10 pr-4 h-[40px] rounded-full border border-gray-300 focus:outline-none focus:border-transparent focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(d).color}),placeholder:n(t)("search_order_id")},null,44,rF),[[Lt,e.value]])]),i("div",aF,[zt(qE,{modelValue:Y.value,"onUpdate:modelValue":[Z[2]||(Z[2]=q=>Y.value=q),et],class:"z-10"},null,8,["modelValue"])])]),dt.value?(p(),f("div",cF,[i("table",dF,[i("thead",null,[i("tr",uF,[i("th",hF,c(n(t)("time")),1),i("th",pF,[i("span",fF,c(n(t)("order")),1),i("span",_F,c(n(t)("orders_id")),1)]),i("th",mF,c(n(t)("status_order")),1),i("th",vF,c(n(t)("num_points")),1)])]),dt.value&&dt.value.length>0?(p(),f("tbody",gF,[(p(!0),f(at,null,xt(dt.value,q=>(p(),f("tr",{key:q.id,class:"border-g hover:bg-gray-50 text-center"},[i("td",null,[i("div",bF,c(U(q.created_at)),1)]),i("td",xF,[i("div",{class:"font-semibold",style:b({color:n(d).black})},c(q.order_number),5)]),i("td",null,[q.point_action==="used"?(p(),f("div",yF,c(n(t)("apply_points")),1)):C("",!0),q.point_action==="earned"?(p(),f("div",wF,c(n(t)("earn_points")),1)):C("",!0)]),i("td",null,[q.point_action==="earned"?(p(),f("div",kF," +"+c(q.point),1)):C("",!0),q.point_action==="used"?(p(),f("div",$F," -"+c(q.point_used),1)):C("",!0)])]))),128))])):(p(),f("tbody",CF,[i("tr",null,[i("td",MF,c(n(t)("no_orders_number")),1)])]))])])):(p(),f("div",SF,[i("div",DF,[(p(),f("svg",{class:"h-14 w-14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",style:b(`color:${n(v)}`)},[...Z[5]||(Z[5]=[i("path",{d:"M21 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.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"},null,-1),i("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"},null,-1),i("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"},null,-1),i("line",{x1:"12",y1:"12",x2:"12",y2:"12","stroke-linecap":"round","stroke-width":"4"},null,-1)])],4))]),i("h2",AF,c(n(t)("no_orders_yet")),1),i("p",zF,c(n(t)("start_first_order")),1)])),i("div",jF,[i("div",null,c(n(t)("show_"))+" "+c((h.value-1)*10+1)+" - "+c(h.value*10)+" "+c(n(t)("show_1"))+" "+c(x.value),1),i("div",TF,[i("button",{onClick:D,disabled:h.value===1,class:J(EF)},[...Z[6]||(Z[6]=[i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])],8,PF),(p(!0),f(at,null,xt(pt.value,q=>(p(),f(at,{key:q},[q==="..."?(p(),f("span",{key:0,class:J(BF)},c(q),1)):(p(),f("button",{key:1,onClick:ut=>X(q),class:J(ot(q)),style:b(st(q))},c(q),15,LF))],64))),128)),i("button",{onClick:ct,disabled:h.value===m.value||m.value===0,class:J(OF)},[...Z[7]||(Z[7]=[i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],8,RF)])])])],64))}},IF={class:"hidden bg-white p-6 rounded-xl shadow mb-6"},NF={class:"flex items-center mb-6"},HF={class:"flex justify-between items-center mb-4 mt-3"},VF={class:"text-lg font-semibold"},WF={class:"flex justify-start items-center mb-4"},UF={class:"absolute z-10 mt-2 w-full bg-white border border-gray-200 rounded-lg shadow-lg text-sm"},YF=["onClick"],qF={class:"absolute z-10 mt-2 w-full bg-white border border-gray-200 rounded-lg shadow-lg text-sm"},ZF=["onClick"],XF={class:"bg-white p-3 rounded-xl shadow mb-6"},KF={class:"flex items-center"},GF={class:"flex justify-between items-center py-2 md:py-4 xl:py-0"},QF={class:"text-[16px] xl:text-lg font-semibold"},JF={class:"hidden justify-start items-center mb-4"},tI={class:"absolute z-10 mt-2 w-full bg-white border border-gray-200 rounded-lg shadow-lg text-sm"},eI=["onClick"],oI={class:"absolute z-10 mt-2 w-full bg-white border border-gray-200 rounded-lg shadow-lg text-sm"},sI=["onClick"],nI={class:"bg-white p-4 rounded-xl shadow mb-6"},iI={class:"flex justify-between items-center mb-4 mt-3"},lI={class:"text-lg font-semibold"},rI={key:0,class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 gap-4 justify-items-center"},aI=["onClick"],cI={key:0,class:"absolute top-[2px] right-[2px] xl:top-1 xl:right-1 text-white text-[10px] md:text-sm font-bold px-2 py-1 rounded z-1 bg-black/60"},dI={class:"flex justify-center relative w-full"},uI={class:"w-[142px] h-[142px] md:w-[208px] md:h-[208px] xl:w-[224px] xl:h-[224px] flex items-center justify-center mx-auto overflow-hidden"},hI=["src","alt"],pI={key:0,class:"absolute inset-0 bg-black/70 flex items-center justify-center cursor-pointer rounded-t"},fI={class:"text-white text-xl font-bold"},_I={class:"relative"},mI={class:"absolute bottom-[2px] left-[2px] md:bottom-1 md:left-1 flex items-center gap-[2px]"},vI={key:0,class:"cursor-pointer text-white transition-all duration-200 flex items-center justify-center overflow-hidden h-[26px] w-[26px]"},gI=["src"],bI=["src"],xI=["src"],yI=["onClick"],wI={class:"items-start gap-2 px-4 mt-4"},kI={class:"min-w-0"},$I={class:""},CI={key:0},MI={key:0},SI={key:1},DI={key:0},AI={key:1,class:"opacity-0"}
33,zI={key:1,class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 gap-4"},jI=["onClick"],TI={class:"absolute z-1 m-2 flex gap-1"},PI={key:0,class:"text-white px-2 py-1 bg-[#2E8B57] flex items-center justify-center rounded-[4px]"},LI={key:1,class:"absolute top-[2px] right-[2px] xl:top-1 xl:right-1 text-white text-[10px] md:text-sm font-bold px-2 py-1 rounded z-1 bg-black/60"},RI={class:"flex justify-center relative w-full"},OI=["src","alt"],BI={key:0,class:"absolute inset-0 bg-black/70 flex items-center justify-center cursor-pointer rounded-t"},EI={class:"relative"},FI={class:"absolute bottom-2 left-2 right-2 flex items-center justify-between"},II={class:"flex gap-1"},NI=["src"],HI=["src"],VI=["onClick"],WI={class:"relative group"},UI={key:0,class:"px-2"},YI={key:1,class:"px-2"},qI={key:0},ZI={key:1,class:"opacity-0"},XI={key:2},KI={key:0,class:"flex justify-between items-center space-x-2 mt-8 py-4 overflow-x-auto"},GI={class:"text-[12px] md:!text-[14px] text-nowrap"},QI={class:"flex items-center space-x-reverse md:space-x-1"},JI=["disabled"],tN=["onClick"],eN=["disabled"],oN="rounded-full border-slate-300 p-[5px] md:p-[9px] text-center text-sm transition-all text-slate-600 focus:border-slate-800 active:border-slate-800 active:text-white active:bg-slate-800 disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none",sN="rounded-full border-slate-300 p-[5px] md:p-[9px] text-center text-sm transition-all text-slate-600 focus:border-slate-800 active:border-slate-800 active:text-white active:bg-slate-800 disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none",nN="w-12 h-12 rounded-full border-slate-300 p-2 text-center text-lg transition-all text-slate-600",iN={__name:"FavListSection",setup(o){const{t}=ee(),e=Ls("auth_token"),s=xn();yn();const{locale:l}=ee(),r=bn(),a=Md(),d=_o(),u=ke(),{color:h,button_color:_,bg_color:m}=Qt(u),x=je(),{showContent:$}=Qt(x),S=Hd(),{offset:v,fav_totalPages:M,fav_list_payload:w}=Qt(S),I=z(!1),O=z({label:"เรียงล่าสุด",value:"latest"}),tt=[{label:"เรียงจาก ใหม่-เก่า",value:"latest"},{label:"เรียงจาก เก่า-ใหม่",value:"oldest"},{label:"เรียงจาก ราคาสูง-ต่ำ",value:"high"},{label:"เรียงจาก ราคาต่ำ- สูง",value:"low"}],G=z(!1),Y=z({label:"ประเภททั้งหมด",value:"all"}),et=[{label:"ประเภททั้งหมด",value:"all"},{label:"เครื่องใช้ไฟฟ้า",value:"elect"},{label:"อาหารและเครื่องดื่ม",value:"food_drink"},{label:"ของใช้ในชีวิตประจำวัน",value:"ordinary_tools"},{label:"สินค้าและความงาม",value:"products_and_beauty"}],ht=_o(),ct=z(null),dt=z(null),pt=z([]),D=z(0),Mt=z(0),ot=z(1),st=z(!1),X=z(12),H=z(12),P=z(11),W=z(1),U=lt(()=>pt?.value||[]),B=lt(()=>D?.value),Z=lt(()=>w.value.limit),q=lt(()=>{const ft=M.value,F=W.value,R=[];if(ft<=3)for(let kt=1;kt<=ft;kt++)R.push(kt);else{R.push(1),F>3&&R.push("...");const kt=Math.max(2,F-1),qt=Math.min(ft-1,F+1);for(let It=kt;It<=qt;It++)It!==1&&It!==ft&&R.push(It);F<ft-2&&R.push("..."),R.push(ft)}return R}),ut=ft=>S.getButtonTypeForFlashSaleCard(ft);we(async()=>{document.addEventListener("click",Tt),w.value.page=1,ht.changeStateLoading(!0),await Ft(),ht.changeStateLoading(!1)}),as(()=>document.removeEventListener("click",Tt));function wt(ft){d.showNotAvailableBoxStart()}function St(ft,F){ft===1?(O.value=F,I.value=!1):(Y.value=F,G.value=!1)}function Tt(ft){!ct.value.contains(ft.target)&&!dt.value.contains(ft.target)&&(I.value=!1,G.value=!1)}function vt(ft){console.log(ft);const F=Nd(ft.name,ft.product_id);s.push({path:`/products/${F}`})}const yt=ft=>Number(ft).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});async function Ft(){if(Mt.value===1&&ot.value>1){let F=ot.value>1?ot.value-1:1;w.value.page=F,W.value=F;const kt=(W.value-1)*X.value+X.value;H.value=kt,await Xn(),window.scrollTo({top:0,behavior:"smooth"})}
33let ft=await S.LoadFavProduct();pt.value=ft.data.product_list,D.value=ft?.data?.pagination?.total_items||0,Mt.value=ft?.data?.product_count||0,ot.value=ft?.data?.pagination?.current_page||1}async function N(ft){if(!st.value)if(st.value=!0,e.value){let F={product_id:parseInt(ft,10),action:"unfavorite"};(await S.updateFavProductData(F)).result==="SUCCESS"?r.trigger(t("cancle_favorite"),"success"):r.trigger(t("can_not_update"),"error"),await Ft(),st.value=!1}else{a.open(),st.value=!1;return}}const $t=ft=>["min-w-[32px] min-h-[32px] md:min-w-[32px] md:min-h-[32px] lg:min-w-[32px] lg:min-h-[32px] xl:min-w-[32px] xl:min-h-[32px] aspect-square p-1 rounded-full border-slate-300 text-center text-sm transition-all text-slate-600 focus:border-slate-800 active:border-slate-800 disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none text-center",W.value===ft?"text-white":""],T=ft=>W.value===ft?{backgroundColor:u.color}:{},Pt=async ft=>{if(ft>=1&&ft<=M.value){v.value=(ft-1)*Z.value,w.value.page=ft,W.value=ft;const R=(W.value-1)*X.value+X.value;H.value=R}await Ft(),await Xn(),window.scrollTo({top:0,behavior:"smooth"})};function Rt(ft){const F=ft?.original_image_path,R=ft?.images_URL;return Array.isArray(F)&&F.length>0?F[0]:typeof F=="string"&&F.trim()!==""?F:Array.isArray(R)&&R.length>0?R[0]:re}return(ft,F)=>(p(),f(at,null,[i("div",IF,[i("div",NF,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:F[0]||(F[0]=R=>$.value=!1)},[...F[8]||(F[8]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("div",HF,[i("p",VF,c(n(t)("favorite_list")),1)])]),i("div",WF,[i("div",{ref_key:"dropdownRef1",ref:ct,class:"relative w-48 mr-4"},[i("button",{onClick:F[1]||(F[1]=R=>wt()),class:"w-full flex justify-between items-center bg-white border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(u).color})},[i("span",null,c(O.value.label),1),(p(),f("svg",{class:J(["w-4 h-4 text-gray-500 transform transition-transform duration-200",{"rotate-180":I.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...F[9]||(F[9]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],4),bt(i("ul",UF,[(p(),f(at,null,xt(tt,R=>i("li",{key:R.value,onClick:kt=>St(1,R),class:J(["px-3 py-2 hover:bg-gray-100 cursor-pointer",{"bg-gray-100 font-semibold":O.value.value===R.value}]),style:b({color:n(u).color})},c(R.label),15,YF)),64))],512),[[Ie,I.value]])],512),i("div",{ref_key:"dropdownRef2",ref:dt,class:"relative w-48"},[i("button",{onClick:F[2]||(F[2]=R=>wt()),class:"w-full flex justify-between items-center bg-white border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(u).color})},[i("span",null,c(Y.value.label),1),(p(),f("svg",{class:J(["w-4 h-4 text-gray-500 transform transition-transform duration-200",{"rotate-180":G.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...F[10]||(F[10]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],4),bt(i("ul",qF,[(p(),f(at,null,xt(et,R=>i("li",{key:R.value,onClick:kt=>St(2,R),class:J(["px-3 py-2 hover:bg-gray-100 cursor-pointer",{"bg-gray-100 font-semibold":Y.value.value===R.value}]),style:b({color:n(u).color})},c(R.label),15,ZF)),64))],512),[[Ie,G.value]])],512)])]),i("div",XF,[i("div",KF,[(p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:F[3]||(F[3]=R=>$.value=!1)},[...F[11]||(F[11]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),i("div",GF,[i("p",QF,c(n(t)("favorite_list")),1)])]),i("div",JF,[i("div",{ref_key:"dropdownRef1",ref:ct,class:"relative w-48 mr-4"},[i("button",{onClick:F[4]||(F[4]=R=>wt()),class:"w-full flex justify-between items-center bg-white border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(u).color})},[i("span",null,c(O.value.label),1),(p(),f("svg",{class:J(["w-4 h-4 text-gray-500 transform transition-transform duration-200",{"rotate-180":I.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...F[12]||(F[12]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],4),bt(i("ul",tI,[(p(),f(at,null,xt(tt,R=>i("li",{key:R.value,onClick:kt=>St(1,R),class:J(["px-3 py-2 hover:bg-gray-100 cursor-pointer",{"bg-gray-100 font-semibold":O.value.value===R.value}]),style:b({color:n(u).color})},c(R.label),15,eI)),64))],512),[[Ie,I.value]])],512),i("div",{ref_key:"dropdownRef2",ref:dt,class:"relative w-48"},[i("button",{onClick:F[5]||(F[5]=R=>wt()),class:"w-full flex justify-between items-center bg-white border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)]",style:b({"--focus-color":n(u).color})},[i("span",null,c(Y.value.label),1),(p(),f("svg",{class:J(["w-4 h-4 text-gray-500 transform transition-transform duration-200",{"rotate-180":G.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...F[13]||(F[13]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],4),bt(i("ul",oI,[(p(),f(at,null,xt(et,R=>i("li",{key:R.value,onClick:kt=>St(2,R),class:J(["px-3 py-2 hover:bg-gray-100 cursor-pointer",{"bg-gray-100 font-semibold":Y.value.value===R.value}]),style:b({color:n(u).color})},c(R.label),15,sI)),64))],512),[[Ie,G.value]])],512)])]),i("div",nI,[i("div",iI,[i("p",lI,c(n(t)("all_product"))+" ("+c(n(B))+") ",1)]),i("div",null,[n(U).length>0&&!n(u).isType2?(p(),f("div",rI,[(p(!0),f(at,null,xt(n(U),(R,kt)=>(p(),f("div",{key:R.name+kt,class:"relative w-[142px] h-[280px] md:w-[208px] md:h-[346px] lg:w-[208px] lg:h-[346px] xl:w-[224px] xl:h-[384px] shadow hover:shadow-md rounded-[10px] overflow-hidden bg-white text-center"},[i("a",{onClick:qt=>vt(R)},[bt(i("div",{class:"text-left absolute top-[2px] left-[2px] xl:top-1 xl:left-1 bg-red-500 text-white text-[10px] md:text-sm font-bold px-2 py-1 rounded z-1",style:b({backgroundColor:n(u).discount_bg,color:n(u).discount_text})}," - "+c(R.discount_percent),5),[[Ie,Number(R.discount_percent?.toString().replace("%",""))!==0&&ut(R)!=="contact_staff"]]),R?.message_status==="pre-order"?(p(),f("div",cI,c(n(t)("message_status")),1)):C("",!0),i("div",dI,[i("div",uI,[i("img",{src:Rt(R),alt:R.name,class:"w-[142px] h-[142px] md:w-[208px] md:h-[208px] xl:w-[224px] xl:h-[224px] object-contain cursor-pointer"},null,8,hI)]),R.stock<=0||R.stock_count<=0?(p(),f("div",pI,[i("span",fI,c(n(t)("out_of_stock")),1)])):C("",!0)])],8,aI),i("div",_I,[i("div",mI,[R?.message_status==="new"?(p(),f("div",vI,[i("img",{src:n(Id),style:{width:"26px",height:"26px"},alt:"New"},null,8,gI)])):C("",!0),R?.sold!==0?(p(),f("div",{key:1,style:b({backgroundColor:n(u).bg_fire}),class:"cursor-pointer text-white transition-all duration-200 rounded-sm flex items-center justify-center overflow-hidden h-[26px] w-[28px] bg-white"},[i("img",{src:n(ql),style:{width:"28px",height:"26px"},alt:"Best Sale"},null,8,bI)],4)):C("",!0),R?.get_free_product==="Y"?(p(),f("div",{key:2,style:b({backgroundColor:n(u).bg_gift}),class:"cursor-pointer text-white transition-all duration-200 rounded-sm flex items-center justify-center overflow-hidden h-[26px] w-[28px] bg-white"},[i("img",{src:n(Yl),style:{width:"28px",height:"26px"},alt:"Get Free Product"},null,8,xI)],4)):C("",!0)]),i("div",{class:"absolute right-2 bottom-2 z-10 cursor-pointer flex items-center justify-center flex-shrink-0 rounded-full border-2 h-[28px] w-[28px] md:h-[40px] md:w-[40px] xl:h-[40px] xl:w-[40px]",onClick:qt=>N(R.product_id),style:b({borderColor:n(u).color,backgroundColor:"white"})},[(p(),ae(ls(R?.isFavorite?n(Hl):n(Vl)),{class:"h-[16px] w-[16px] md:h-[20px] md:w-[20px] xl:h-[20px] xl:w-[20px] transition-all duration-300",style:b({color:n(u).color})},null,8,["style"]))],12,yI)]),i("div",wI,[i("h3",kI,[i("div",{class:"mb-2 text-xs md:text-sm font-medium overflow-hidden text-ellipsis leading-[24px] xl:leading-[26px] line-clamp-2 h-[48px]",style:b({color:n(u).black})},[i("p",{class:"text-xs md:text-base font-medium overflow-hidden text-ellipsis leading-[24px] md:leading-[24px] xl:leading-[26px] line-clamp-2 h-[48px]",style:b({color:n(u).black})},[R?.bundle_deal==="Y"?(p(),f("span",{key:0,class:"md:inline-flex xl:inline-flex inline-block text-[10px] font-bold items-center justify-center w-[91px] h-[22px] rounded-full text-white align-text-bottom",style:b({background:`linear-gradient(150deg, ${n(u).bundle_color1}, ${n(u).bundle_color2})`})},[i("span",$I,c(n(t)("Exclusive_Deal")),1)],4)):C("",!0),gt(" "+c(n(l)==="th"?R.name:R.name_en||R.name),1)],4)],4)])]),ut(R)!=="contact_staff"?(p(),f("div",CI,[R.vat_default!=="yes"?(p(),f("div",MI,[i("p",{style:b({color:Number(R.fake_price)>Number(R.real_price)?n(u).price_red:n(u).black}),class:"capitalize font-semibold text-[16px] md:text-[18px]"}," ฿"+c(yt(R.real_price)),5),i("p",{style:b({color:n(u).main_gray_cl}),class:J(["capitalize mt-2 line-through text-[12px] md:text-[14px]",Number(R.fake_price)>Number(R.real_price)?"":"invisible"])}," ฿"+c(yt(R.fake_price)),7)])):R.vat_default==="yes"?(p(),f("div",SI,[i("p",{style:b({color:Number(R.fake_price)>Number(R.revenue_price)?n(u).price_red:n(u).black}),class:"capitalize font-semibold text-[16px] md:text-[18px]"}," ฿"+c(yt(R.revenue_price)),5),i("p",{style:b({color:n(u).main_gray_cl}),class:"capitalize mt-2 line-through text-[12px] md:text-[14px]"},[Number(R.fake_price)>Number(R.revenue_price)?(p(),f("span",DI," ฿"+c(yt(R.fake_price)),1)):(p(),f("span",AI,"0"))],4)])):C("",!0)])):C("",!0)]))),128))])):C("",!0),n(U).length>0&&n(u).isType2?(p(),f("div",zI,[(p(!0),f(at,null,xt(n(U),R=>(p(),f("div",{key:R.name,class:"relative bg-white rounded shadow hover:shadow-md text-center w-full h-full max-w-[144px] max-h-[306px] md:max-w-[208px] md:max-h-[386px] xl:max-w-[224px] xl:max-h-[386px]"},[i("a",{onClick:kt=>vt(R)},[i("div",TI,[R?.message_status==="new"?(p(),f("div",PI,[...F[14]||(F[14]=[i("p",{class:"text-[14px] leading-[24px] font-bold tracking-[0.5px]"}," สินค้าใหม่ ",-1)])])):C("",!0),bt(i("div",{class:"text-left bg-red-500 text-white text-[14px] font-bold px-2 py-1 rounded leading-[24px]",style:b({backgroundColor:n(u).discount_bg,color:n(u).discount_text})}," - "+c(R.discount_percent),5),[[Ie,Number(R.discount_percent?.toString().replace("%",""))!==0]]),R?.message_status==="pre-order"?(p(),f("div",LI,c(n(t)("message_status")),1)):C("",!0)]),i("div",RI,[i("img",{src:Rt(R),alt:R.name,class:"cursor-pointer w-full h-full max-w-[144px] min-h-[168px] md:max-w-[228px] md:min-
33h-[240px] xl:max-w-[222px] object-contain"},null,8,OI),R.stock<=0||R.stock_count<=0?(p(),f("div",BI,[...F[15]||(F[15]=[i("span",{class:"text-white text-xl font-bold"},"สินค้าหมด",-1)])])):C("",!0)])],8,jI),i("div",EI,[i("div",FI,[i("div",II,[R?.sold!==0?(p(),f("div",{key:0,style:b({backgroundColor:n(u).bg_fire}),class:"cursor-pointer text-white transition-all duration-200 rounded-sm flex items-center justify-center overflow-hidden h-[26px] min-w-[28px] bg-white"},[i("img",{src:n(ql),style:{width:"28px",height:"26px"},alt:"Best Sale"},null,8,NI)],4)):C("",!0),R?.get_free_product==="Y"?(p(),f("div",{key:1,style:b({backgroundColor:n(u).bg_gift}),class:"cursor-pointer text-white transition-all duration-200 rounded-sm flex items-center justify-center overflow-hidden h-[26px] min-w-[28px] bg-white"},[i("img",{src:n(Yl),style:{width:"28px",height:"26px"},alt:"Get Free Product"},null,8,HI)],4)):C("",!0)]),i("div",{class:"cursor-pointer flex items-center justify-center flex-shrink-0 rounded-full border-2 h-[28px] w-[28px] md:h-[32px] md:w-[32px] xl:h-[36px] xl:w-[36px] transition-all duration-200",onClick:kt=>N(R.product_id),style:b({borderColor:n(u).color,backgroundColor:"white"})},[(p(),ae(ls(R?.isFavorite?n(Hl):n(Vl)),{class:"h-[20px] w-[20px] md:h-[24px] md:w-[24px] transition-all duration-300",style:b({color:n(u).color})},null,8,["style"]))],12,VI)])]),i("div",WI,[i("p",{class:"px-2 mb-2 mt-4 text-[12px] md:text-[14px] xl:text-[16px] text-left font-medium line-clamp-2 min-h-[2.2rem] md:min-h-[2.7rem] xl:min-h-[3rem]",style:b({color:n(u).black})},c(R.name),5)]),R.vat_default!=="yes"?(p(),f("div",UI,[i("p",{style:b({color:Number(R.fake_price)>Number(R.real_price)?n(u).price_red:n(u).black}),class:"capitalize max-md:mt-5 max-xl:mt-3 text-left font-semibold text-[16px] leading-[24px] md:text-[18px] md:leading-[28px] mb-2"}," ฿ "+c(yt(R.real_price)),5),i("p",{style:b({color:n(u).main_gray_cl}),class:J(["capitalize text-left line-through text-[12px] md:text-[14px] md:leading-[24px] mb-4",Number(R.fake_price)>Number(R.real_price)?"":"invisible"])}," ฿ "+c(yt(R.fake_price)),7)])):R.vat_default==="yes"?(p(),f("div",YI,[i("p",{style:b({color:Number(R.fake_price)>Number(R.revenue_price)?n(u).price_red:n(u).black}),class:"capitalize max-md:mt-5 max-xl:mt-3 text-left font-semibold text-[16px] leading-[24px] md:text-[18px] md:leading-[28px] mb-2"}," ฿ "+c(yt(R.revenue_price)),5),i("p",{style:b({color:n(u).main_gray_cl}),class:"capitalize text-left line-through text-[12px] md:text-[14px] md:leading-[24px] mb-4"},[Number(R.fake_price)>Number(R.revenue_price)?(p(),f("span",qI," ฿ "+c(yt(R.fake_price)),1)):(p(),f("span",ZI,"0"))],4)])):C("",!0)]))),128))])):C("",!0),n(U).length===0?(p(),f("div",XI,[i("div",null,[i("p",null,c(n(t)("not_found_favorite_products")),1)])])):C("",!0)]),F[18]||(F[18]=i("div",{class:"hidden"},null,-1)),n(U).length>0?(p(),f("div",KI,[i("div",GI,c(n(t)("show_"))+" "+c(H.value-P.value)+" - "+c(H.value>n(B)?n(B):H.value)+" "+c(n(t)("show_1"))+" "+c(n(B)),1),i("div",QI,[i("button",{onClick:F[6]||(F[6]=R=>Pt(W.value-1)),disabled:W.value===1,class:J(oN)},[...F[16]||(F[16]=[i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-3.5 h-3.5 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])],8,JI),(p(!0),f(at,null,xt(n(q),R=>(p(),f(at,{key:R},[R==="..."?(p(),f("span",{key:0,class:J(nN)},c(R),1)):(p(),f("button",{key:1,onClick:kt=>Pt(R),class:J(["cursor-pointer",$t(R)]),style:b(T(R))},c(R),15,tN))],64))),128)),i("button",{onClick:F[7]||(F[7]=R=>Pt(W.value+1)),disabled:W.value===n(M),class:J(sN)},[...F[17]||(F[17]=[i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-3.5 h-3.5 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],8,eN)])])):C("",!0)])],64))}},lN=mo(iN,[["__scopeId","data-v-ac3350f3"]]),rN={class:"p-6 xl:px-6 xl:pt-[28px] xl:pb-6 rounded-xl bg-white"},aN={class:"flex justify-between items-center mb-4"},cN={class:"flex items-center"},dN={key:2,class:"!text-base xl:!text-lg font-semibold"},uN={key:3,class:"!text-base xl:!text-lg font-semibold"},hN=["disabled"],pN=["disabled"],fN={class:"space-y-3"},_N={key:0,class:"flex flex-col items-center justify-center"},mN={key:0,class:"flex flex-col items-center justify-center"},vN={width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gN={"clip-path":"url(#clip0_20060_1514)"},bN=["stroke"],xN=["stroke"],yN=["stroke"],wN=["stroke"],kN=["stroke"],$N=["stroke"],CN=["stroke"],MN={class:"text-sm mt-4"},SN={key:1,class:"space-y-4 w-full"}
33,DN={class:"font-semibold text-gray-800 mb-1 flex flex-wrap justify-between items-start gap-y-1"},AN={class:"flex flex-col md:flex-row md:items-center sm:gap-x-2 text-gray-800 min-w-0 flex-1"},zN=["title"],jN={key:0,class:"whitespace-nowrap"},TN=["onClick"],PN=["onClick"],LN={key:1},RN={class:"flex items-center gap-2 mb-4"},ON={class:"relative flex items-center justify-center w-5 h-5 cursor-pointer"},BN=["disabled"],EN={class:"text-base"},FN={class:"text-base font-bold mb-4"},IN={class:"grid grid-cols-1 md:grid-cols-2 gap-4 items-start"},NN={class:"block text-base font-medium text-gray-700 mb-1"},HN=["value","placeholder"],VN={key:0,class:"text-[#C4021A] text-sm mt-1"},WN={class:"block text-base font-medium text-gray-700 mb-1"},UN=["title"],YN={class:"absolute z-10 mt-2 w-full border border-gray-300 bg-white rounded-lg shadow-md overflow-y-auto max-h-44 md:max-h-50 custom-scrollbar"},qN=["onClick"],ZN={key:0,class:"text-[#C4021A] text-sm mt-1"},XN={class:"block text-base font-medium text-gray-700 mb-1"},KN=["placeholder","value","maxlength"],GN={key:0,class:"text-[#C4021A] text-sm mt-1"},QN={key:2,class:"mt-8 mb-4 border-gray-300"},JN={key:3,class:"flex justify-end gap-4"},tH=["disabled"],eH={key:0,class:"fixed inset-0 bg-black/60 flex items-center justify-center z-50"},oH={class:"bg-white rounded-lg p-6 w-[90%] md:w-[600px] max-w-full shadow-lg text-center"},sH={class:"!text-base xl:!text-xl font-bold mb-4"},nH={class:"mb-4 md:mb-8 text-sm xl:text-base"},iH={class:"flex gap-4 w-full"},lH={key:1,class:"fixed inset-0 bg-black/60 flex items-center justify-center z-50"},rH={class:"bg-white rounded-lg p-6 w-[90%] md:w-[600px] max-w-full shadow-lg text-center"},aH={class:"!text-base xl:!text-xl font-bold mb-4"},cH={class:"mb-4 md:mb-8 !text-sm xl:!text-base"},dH={class:"flex gap-4 w-full"},uH={__name:"BookBankSection",setup(o){const{t}=ee(),e=ke();Po();const{color:s,button_color:l,bg_color:r}=Qt(e);Sa();const{GetAccountList:a,GetBankList:d,GetAddAccount:u,GetUpdateAccount:h,GetDeleteAccount:_,GetChangMainAccount:m}=ll(),x=je(),{showContent:$}=Qt(x),S=_o(),v=z(!1),M=z([]),w=z([]),I=z(!1),O=z(null),tt=bn(),{locale:G}=ee(),Y=lt(()=>{const $t=!ot.value.accountName?.trim()||!O.value||!ot.value.bankNumber?.trim(),T=et.accountName!==""||et.bankName!==""||et.bankNumber!=="";return $t||T});we(async()=>{S.changeStateLoading(!0);try{const[$t,T]=await Promise.all([a(),d()]);M.value=$t?.data||[],w.value=T?.data||[]}catch($t){console.error("Fetch Error:",$t)}finally{S.changeStateLoading(!1)}});const et=We({accountName:"",bankName:"",bankNumber:""}),ht=z({accountName:"",bankName:"",bankNumber:""}),ct=z(!1),dt=z(!1),pt=z(!1),D=z(!1),Mt=z(null);si(Mt,()=>I.value=!1);const ot=z({}),st=$t=>["w-full border bg-white text-black focus:border-transparent rounded-full px-3 text-base py-1.5 focus:outline-none focus:ring-2 focus:ring-[var(--focus-color)] text-[16px]",$t?"border-[#C4021A]":"border-[#D1D1D1]"];function X(){ot.value={...ht.value},O.value=null,ct.value=!0,dt.value=!0}const H=z({}),P=z(null);function W($t){console.log("account :>> ",$t),P.value=$t,ot.value={...ht.value},ot.value.accountName=$t?.bank_user_name,ot.value.bankNumber=$t?.bank_no,ot.value.bankName=$t?.bank_name,H.value={...ht.value},H.value.accountName=$t?.bank_user_name,H.value.bankNumber=$t?.bank_no,H.value.bankName=$t?.bank_name,$t?.main_account==1&&(v.value=!0);const T=w.value.find(Pt=>Pt.code===$t.bank_code);T?O.value=T:O.value=null,ct.value=!0}function U(){ot.value={},ct.value=!1,dt.value=!1,pt.value=!1,D.value=!1,P.value=null,H.value={},et.accountName="",et.bankName="",et.bankNumber="",v.value=!1}const B=async $t=>{ot.value.bankName=$t?.name,ot.value.bankNumber="",O.value=$t,I.value=!1,console.log("selectedBank.value  :>> ",O.value),et.bankName="",Tt("bankNumber")},Z=async()=>{S.changeStateLoading(!0);let $t={bank_user_name:ot.value.accountName||"",bank_no:ot.value.bankNumber||"",bank_name:O.value.name||"",bank_code:O.value.code||"",bank_branch:""};console.log("payloadAccount :>> ",$t);const T=await u($t);if(T?.code==200){console.log("Success ADD :>> "),v.value&&await m({id:T?.data?.id||""});const Pt=await a();M.value=Pt?.data||[],U(),tt.trigger(t("bank_account_add_success"),"success")}S.changeStateLoading(!1)},q=async()=>{S.changeStateLoading(!0);let $t={bank_user_name:ot.value.accountName||"",bank_no:ot.value.bankNumber||"",bank_name:O.value.name||"",bank_code:O.value.code||"",bank_branch:"",id:P.value.id||""};
33if(console.log("payloadAccount :>> ",$t),(await h($t))?.code==200){console.log("Success ADD :>> "),v.value&&await m({id:P.value.id||""}),tt.trigger(t("bank_account_update_success"),"success");const Pt=await a();M.value=Pt?.data||[],U()}S.changeStateLoading(!1)},ut=async()=>{ot.value.accountName?.trim()||O.value||ot.value.bankNumber?.trim()?pt.value=!0:U()},wt=()=>{const $t=JSON.stringify(ot.value),T=JSON.stringify(H.value);$t!==T?pt.value=!0:U()},St=($t,T)=>{let Pt=T;if($t==="accountName"&&(Pt=T,et.accountName=Pt.trim()?"":"enter_account_name"),$t==="bankNumber"){const Rt=/[^0-9-]/g;Pt=T.replace(Rt,""),et.bankNumber=Pt.trim()?"":"enter_bank_account"}ot.value[$t]=Pt},Tt=$t=>{const T=ot.value[$t]||"";if($t==="accountName"&&(et.accountName=T.trim()?"":"enter_account_name"),$t==="bankNumber"){const Pt=O.value?.digits;T.trim()?Pt&&!Pt.includes(T.length)?et.bankNumber="enter_bank_account":et.bankNumber="":et.bankNumber="enter_bank_account"}},vt=$t=>{const T=$t.which?$t.which:$t.keyCode;T>31&&(T<48||T>57)&&$t.preventDefault()},yt=$t=>{/[ก-๙a-zA-Z0-9.\s]/.test($t.key)||$t.preventDefault()},Ft=async()=>{S.changeStateLoading(!0);let $t={id:P.value.id||""};if((await _($t))?.code==200){console.log("Success ADD :>> "),tt.trigger(t("bank_account_delete_success"),"success");const Pt=await a();M.value=Pt?.data||[],U()}S.changeStateLoading(!1)};pe(I,($t,T)=>{T===!0&&$t===!1&&(O.value?et.bankName="":et.bankName="enter_bank_name")});const N=$t=>{const T=$t?.toString().trim();if(!T||!w.value||w.value.length===0)return $t;const Pt=w.value.find(Rt=>{const ft=Rt.name?.toString().trim(),F=Rt.name_en?.toString().trim();return ft===T||F===T});return Pt?G.value==="th"?Pt.name:Pt.name_en||Pt.name:$t};return($t,T)=>(p(),f(at,null,[i("div",rN,[i("div",aN,[i("div",cN,[ct.value?C("",!0):(p(),f("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer block xl:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:T[0]||(T[0]=Pt=>$.value=!1)},[...T[15]||(T[15]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])),ct.value?(p(),f("svg",{key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500 mr-2 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",onClick:T[1]||(T[1]=Pt=>dt.value?ut():wt())},[...T[16]||(T[16]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])])):C("",!0),ct.value?(p(),f("h3",uN,c(dt.value?n(t)("add_bank_account"):n(t)("edit_bank_account")),1)):(p(),f("h3",dN,c(n(t)("bank_account"))+" ("+c(M.value.length)+"/2) ",1))]),ct.value?C("",!0):(p(),f("button",{key:0,onClick:X,disabled:M.value.length>=2,style:b(M.value.length>=2?"color: #A4A4A4":`color: ${n(s)}`),class:J(["underline font-bold text-sm xl:text-base underline-offset-4 transition-all",M.value.length>=2?"cursor-not-allowed ":"cursor-pointer"])},c(n(t)("add_account")),15,hN)),ct.value&&!dt.value?(p(),f("button",{key:1,disabled:P.value?.main_account==1,onClick:T[2]||(T[2]=Pt=>D.value=!0),style:b(`color: ${P.value?.main_account==1?"#a4a4a4":n(s)}`),class:J(["underline font-bold text-sm xl:text-base underline-offset-4 transition-all",P.value?.main_account==1?"cursor-not-allowed ":"cursor-pointer"])},c(n(t)("delete_account")),15,pN)):C("",!0)]),i("div",fN,[ct.value?C("",!0):(p(),f("div",_N,[M.value.length<1?(p(),f("div",mN,[(p(),f("svg",vN,[i("g",gN,[i("path",{d:"M13.6596 25.9998H49.5L51 34.3506M13.6596 25.9998L6 52.5261H15.5946M13.6596 25.9998L14.1702 34.3506M15.5946 52.5261L15.7021 53.9998L54 53.5085L51 34.3506M15.5946 52.5261L14.1702 34.3506M14.1702 34.3506H51",stroke:n(e).color,"stroke-width":"2","stroke-miterlimit":"10"},null,8,bN),i("path",{d:"M30 21.9998C34.4183 21.9998 38 18.418 38 13.9998C38 9.58148 34.4183 5.99976 30 5.99976C25.5817 5.99976 22 9.58148 22 13.9998C22 18.418 25.5817 21.9998 30 21.9998Z",stroke:n(e).color,"stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}
33,null,8,xN),i("path",{d:"M31.3625 10.7512C31.1331 10.5796 30.3954 10.1248 29.3581 10.4373C28.1999 10.7862 27.9122 12.371 28.6993 12.9884C29.1513 13.3429 29.8313 13.6344 30.7478 13.9583C32.7991 14.6834 32.0409 17.5762 29.9542 17.5902C29.1399 17.5956 28.7593 17.5439 28.0439 17.076",stroke:n(e).color,"stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square","stroke-linejoin":"round"},null,8,yN),i("path",{d:"M29.9542 18.0188V18.6461",stroke:n(e).color,"stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square","stroke-linejoin":"round"},null,8,wN),i("path",{d:"M29.9542 9.35376V10.0348",stroke:n(e).color,"stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square","stroke-linejoin":"round"},null,8,kN),i("path",{d:"M38 48.9998H48",stroke:n(e).color,"stroke-width":"2"},null,8,$N),i("path",{d:"M38 45.9998H48",stroke:n(e).color,"stroke-width":"2"},null,8,CN)]),T[17]||(T[17]=i("defs",null,[i("clipPath",{id:"clip0_20060_1514"},[i("rect",{width:"52",height:"52",fill:"white",transform:"translate(4 3.99976)"})])],-1))])),i("p",MN,c(n(t)("no_bank_account")),1)])):(p(),f("div",SN,[(p(!0),f(at,null,xt(M.value,(Pt,Rt)=>(p(),f("div",{key:Rt,class:"relative border p-4 rounded-lg overflow-hidden",style:b({border:`1px solid ${n(s)}`,backgroundColor:Pt.main_account=="1"?n(e).bg_color2:$t.bg_white})},[i("div",DN,[i("div",AN,[i("span",{class:"block truncate max-w-full",title:Pt.bank_name},c(Pt.bank_user_name),9,zN),i("span",{class:"hidden md:block",style:b({color:n(e).color})},"|",4),Pt.bank_no?(p(),f("span",jN,[i("span",{class:"inline md:hidden",style:b({color:n(e).color})},"|",4),gt(" "+c(Pt.bank_no),1)])):C("",!0)]),i("button",{class:J(["hidden md:block text-sm hover:underline cursor-pointer rounded-3xl px-2 py-1 !text-[12px] bg-white max-h-[27.14px] ml-2",Pt.main_account==="1"?"black":"white"]),onClick:ft=>W(Pt),style:b({border:`1px solid ${n(s)}`,color:n(s)})},c(n(t)("edit")),15,TN)]),i("div",null,[i("p",null,c(N(Pt.bank_name)),1)]),Pt.main_account=="1"?(p(),f("div",{key:0,class:"mt-[6px]",style:b({color:n(e).color})},c(n(t)("default_settings")),5)):C("",!0),i("button",{class:J(["block md:hidden text-sm hover:underline cursor-pointer rounded-3xl px-2 py-1 !text-[12px] font-bold bg-white max-h-[27.14px] mt-2",Pt.main_account==="1"?"black":"white"]),onClick:ft=>W(Pt),style:b({border:`1px solid ${n(s)}`,color:n(s)})},c(n(t)("edit")),15,PN)],4))),128))]))])),ct.value?(p(),f("div",LN,[i("div",RN,[i("label",ON,[bt(i("input",{"onUpdate:modelValue":T[3]||(T[3]=Pt=>v.value=Pt),type:"checkbox",class:J(["peer absolute w-full h-full opacity-0 z-10",P.value?.main_account==1?"cursor-not-allowed ":"cursor-pointer"]),onClick:T[4]||(T[4]=(...Pt)=>$t.validateAndSet&&$t.validateAndSet(...Pt)),disabled:P.value?.main_account==1},null,10,BN),[[Rs,v.value]]),i("div",{class:"w-full h-full rounded-[6px] border flex items-center justify-center",style:b(v.value?P.value?.main_account==1?{backgroundColor:"#E7E7E7",borderColor:"#D1D1D1"}:{backgroundColor:n(e).colorcheckbox,borderColor:n(e).colorcheckbox}:{backgroundColor:"white",borderColor:n(e).colorcheckbox})},[bt((p(),f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3.5","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4",style:b({color:P.value?.main_account==1?"#A4A4A4":n(e).white})},[...T[18]||(T[18]=[i("polyline",{points:"20 6 9 17 4 12"},null,-1)])],4)),[[Ie,v.value]])],4)]),i("p",EN,c(n(t)("set_default_account")),1)]),i("p",FN,c(n(t)("account_information")),1),i("div",IN,[i("div",null,[i("label",NN,[gt(c(n(t)("bank_account_name")),1),T[19]||(T[19]=i("span",{class:"text-[#C4021A]"}," *",-1))]),i("input",{type:"text",value:ot.value.accountName,placeholder:n(t)("enter_bank"),onInput:T[5]||(T[5]=Pt=>St("accountName",Pt.target.value)),onKeypress:yt,onBlur:T[6]||(T[6]=Pt=>Tt("accountName")),class:J([st(n(et).accountName),"placeholder:text-[#D1D1D1]"]),style:b({"--focus-color":n(e).color})},null,46,HN),n(et).accountName?(p(),f("p",VN,c(`${n(t)(n(et).accountName)}`),1)):C("",!0)]),i("div",{class:"relative",ref_key:"bankDropdownRef",ref:Mt},[i("label",WN,[gt(c(n(t)("bank")),1),T[20]||(T[20]=i("span",{class:"text-[#C4021A]"}," *",-1))]),i("div",{onClick:T[7]||(T[7]=Pt=>
33I.value=!I.value),class:"w-full px-3 py-1.5 border border-[#D1D1D1] rounded-full bg-white cursor-pointer text-[16px] flex justify-between items-center",style:b({borderColor:I.value?n(e).color:n(et).bankName?"#C4021A":"#D1D1D1"})},[i("span",{class:"truncate",style:b({color:O.value?"black":n(e).underline_color}),title:n(G)==="th"?O.value?.name||n(t)("select_bank"):O.value?.name_en||O.value?.name||n(t)("select_bank")},c(n(G)==="th"?O.value?.name||n(t)("select_bank"):O.value?.name_en||O.value?.name||n(t)("select_bank")),13,UN),(p(),f("svg",{class:J(["w-4 h-4 pointer-events-none transform transition-transform",{"rotate-180":I.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...T[21]||(T[21]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],4),bt(i("ul",YN,[(p(!0),f(at,null,xt(w.value,(Pt,Rt)=>(p(),f("li",{key:Rt,onClick:ft=>B(Pt),class:J(["px-4 py-2 cursor-pointer hover:bg-gray-100",{"bg-[#d1d1d1] font-bold text-[var(--text-color)]":O.value?.name==Pt.name}]),style:b({"--text-color":n(e).color})},c(n(G)==="th"?Pt.name:Pt.name_en),15,qN))),128))],512),[[Ie,I.value]]),n(et).bankName&&!I.value?(p(),f("p",ZN,c(`${n(t)(n(et).bankName)}`),1)):C("",!0)],512),i("div",null,[i("label",XN,[gt(c(n(t)("bank_account_number")),1),T[22]||(T[22]=i("span",{class:"text-[#C4021A]"}," *",-1))]),i("input",{type:"tel",placeholder:n(t)("enter_bank_number"),onInput:T[8]||(T[8]=Pt=>St("bankNumber",Pt.target.value)),onBlur:T[9]||(T[9]=Pt=>Tt("bankNumber")),onKeypress:vt,value:ot.value.bankNumber,class:J([st(n(et).bankNumber),"placeholder:text-[#D1D1D1]"]),maxlength:O.value?.digits?.length?Math.max(...O.value.digits):15,style:b({"--focus-color":n(e).color})},null,46,KN),n(et).bankNumber?(p(),f("p",GN,c(`${n(t)(n(et).bankNumber)}`),1)):C("",!0)])])])):C("",!0),ct.value?(p(),f("hr",QN)):C("",!0),ct.value?(p(),f("div",JN,[dt.value?C("",!0):(p(),f("button",{key:0,onClick:T[10]||(T[10]=Pt=>wt()),class:"py-2 rounded-full w-40 h-10 hover:bg-opacity-10 focus:outline-none focus:ring-opacity-50 cursor-pointer text-sm xl:text-base font-bold",style:b({border:`1px solid ${n(e).color}`,color:n(e).color,backgroundColor:"transparent","--tw-ring-color":n(e).color})},c(n(t)("discard_changes")),5)),i("button",{onClick:T[11]||(T[11]=Pt=>dt.value?Z():q()),disabled:Y.value,class:J(["py-2 rounded-full w-40 h-10 text-sm xl:text-base font-bold",Y.value?"bg-[#E7E7E7] cursor-not-allowed text-[#a4a4a4]":"cursor-pointer text-white bg-[var(--bg-color)]"]),style:b({"--bg-color":n(e).color})},c(n(t)("save")),15,tH)])):C("",!0)]),pt.value?(p(),f("div",eH,[i("div",oH,[i("h2",sH,c(dt.value?n(t)("cancel_add_bank_account"):n(t)("discard_changes")),1),i("p",nH,c(dt.value?n(t)("alert_save_bank_account"):n(t)("confirm_discard_warning")),1),T[23]||(T[23]=i("hr",{class:"my-7 border-gray-300"},null,-1)),i("div",iH,[i("button",{onClick:T[12]||(T[12]=Pt=>pt.value=!1),class:"py-2 rounded-full h-10 hover:bg-opacity-10 focus:outline-none focus:ring-opacity-50 cursor-pointer text-sm xl:text-base font-bold w-full",style:b({border:`1px solid ${n(e).color}`,color:n(e).color,backgroundColor:"transparent","--tw-ring-color":n(e).color})},c(n(t)("continue")),5),i("button",{onClick:U,class:"py-2 rounded-full h-10 text-white cursor-pointer text-sm xl:text-base font-bold w-full",style:b({backgroundColor:n(s)})},c(n(t)("confirm")),5)])])])):C("",!0),D.value?(p(),f("div",lH,[i("div",rH,[i("h2",aH,c(n(t)("delete_bank_account")),1),i("p",cH,c(n(t)("once_delete_cant_recove")),1),T[24]||(T[24]=i("hr",{class:"my-7 border-gray-300"},null,-1)),i("div",dH,[i("button",{onClick:T[13]||(T[13]=Pt=>D.value=!1),class:"py-2 rounded-full h-10 hover:bg-opacity-10 focus:outline-none focus:ring-opacity-50 cursor-pointer text-sm xl:text-base font-bold w-full",style:b({border:`1px solid ${n(e).color}`,color:n(e).color,backgroundColor:"transparent","--tw-ring-color":n(e).color})},c(n(t)("cancel")),5),i("button",{onClick:T[14]||(T[14]=Pt=>Ft()),class:"py-2 rounded-full h-10 text-white cursor-pointer text-sm xl:text-base font-bold w-full",style:b({backgroundColor:n(s)})},c(n(t)("confirm")),5)])])])):C("",!0)]),zt(ni)],64))}},hH=mo(uH,[["__scopeId","data-v-78298d47"]]),pH={class:"px-6 xl:px-40 w-full xl:py-[64px] py-8"},fH={class:"flex items-start flex-col xl:flex-row gap-6 h-full text-form"},_H={key:0,class:"xl:w-1/3 w-full bg-white p-6 flex flex-col text-left rounded-lg"},mH={class:"flex items-center justify-start gap-2 mb-4 pl-1"},vH={class:"text-[24px] font-bold"},gH={class:"list-none p-0 w-full"},bH=["onClick"],xH={class:"flex items-center justify-start gap-2 mb-4 pl-1"},yH={class:"text-[24px] font-bold"},wH={class:"list-none p-0 w-full"},kH=["onClick"],$H={key:0},CH={class:"flex items-center justify-start gap-2 mb-4 pl-1"},MH={class:"text-[24px] font-bold"},SH={class:"list-none p-0 w-full"}
33,DH=["onClick"],AH={key:1,class:"xl:w-2/3 w-full bg-white rounded-lg"},zH={key:2,class:"xl:w-2/3 w-full rounded-lg"},jH={key:3,class:"xl:w-2/3 w-full rounded-lg"},TH={key:4,class:"xl:w-2/3 w-full rounded-lg"},PH={key:5,class:"xl:w-2/3 w-full rounded-lg"},LH={key:6,class:"xl:w-2/3 w-full rounded-lg"},RH={key:7,class:"xl:w-2/3 w-full rounded-lg"},OH={key:8,class:"xl:w-2/3 w-full rounded-lg"},BH={key:9,class:"xl:w-2/3 w-full rounded-lg"},EH={key:10,class:"xl:w-2/3 w-full rounded-lg"},FH={key:11,class:"xl:w-2/3 w-full rounded-lg"},IH={key:12,class:"xl:w-2/3 w-full rounded-lg"},aV={__name:"index",setup(o){const t=yn(),e=xn(),s=Po(),l=je(),r=Vs(),{showContent:a}=Qt(l),d=_o();d.changeStateLoading(!0),Promise.all([l.loadUserAllAddress(),s.loadListUserAddress(),l.loadListPoint(),l.checkRegister(),r.checkStatus()]);const{locale:u}=ee(),h=ke(),{color:_,button_color:m,bg_color:x}=Qt(h),$=z("#d5b0ff"),S=z([]),v=["order_list","cancelled_orders"],M=["account_affiliate","offer","my_share","order_report","withdraw_history"],w=lt(()=>r.getStatus?.status?r.getStatus.status==="approve"?M:["account_affiliate"]:["account_affiliate"]),I=lt(()=>r.resultdata&&r.resultdata!=="This shop from ngc is not join affiliate program"),O=z(S[0]),tt=z(!1),G=lt(()=>t.query.menu),Y=lt(()=>t.query.showContent);function et(){a.value=!a.value}function ht(){tt.value=window.innerWidth>=1280,tt.value&&(a.value=!1)}function ct(){const D=["personal_information","address"],Mt=["bank_account"],st=[{condition:h.point_allow,label:"my_points"},{condition:h.handleFavProductAllow,label:"favorite_list"}].filter(H=>H.condition).map(H=>H.label),X=h.BookBank?[...D,...Mt,...st]:[...D,...st];S.value=X,O.value=X[0]}we(async()=>{await ct(),ht(),window.addEventListener("resize",ht),Y.value==="true"&&(a.value=!0),G.value=="orders"?O.value="order_list":G.value=="user"?O.value="personal_information":G.value=="cancelorder"?O.value="cancelled_orders":G.value&&(O.value=G.value),d.changeStateLoading(!1)}),Pa(()=>{window.removeEventListener("resize",ht)}),pe(()=>t.query.menu,D=>{D==="orders"?O.value="order_list":D==="user"?O.value="personal_information":D==="cancelorder"?O.value="cancelled_orders":D&&(O.value=D)},{immediate:!0});const dt=async D=>{await e.push({path:t.path,query:{...t.query,menu:D,showContent:"true"}}),pt()},pt=()=>{const D={...t.query};delete D.order,e.replace({query:D})};return(D,Mt)=>(p(),f("section",pH,[i("div",fH,[!n(a)||tt.value?(p(),f("div",_H,[i("div",mH,[zt(n(Ad),{style:b(`color:${n(_)}`),class:J(`h-7 w-7  text-[${$.value}]`)},null,8,["style","class"]),i("h1",vH,c(D.$t("my_account")),1)]),i("ul",gH,[(p(!0),f(at,null,xt(S.value,(ot,st)=>(p(),f("li",{key:st,onClick:X=>{O.value=ot,et(),dt(ot)},class:J(["cursor-pointer px-4 py-2 rounded w-full text-left transition flex items-center justify-between",O.value===ot&&tt.value?"text-white font-bold":"hover:bg-gray-200"]),style:b(O.value===ot&&tt.value?{backgroundColor:n(x)}:{})},[i("span",null,c(D.$t(ot)),1),Mt[0]||(Mt[0]=i("svg",{class:"w-4 h-4 ml-2 text-gray-500 block xl:hidden",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))],14,bH))),128))]),Mt[4]||(Mt[4]=i("hr",{class:"my-3 border-t border-gray-300"},null,-1)),i("div",xH,[zt(n(Od),{style:b(`color:${n(_)}`),class:J(`h-7 w-7  text-[${$.value}]`)},null,8,["style","class"]),i("h2",null,[i("p",yH,c(D.$t("order")),1)])]),i("ul",wH,[(p(),f(at,null,xt(v,(ot,st)=>i("li",{key:st,onClick:X=>{O.value=ot,et(),dt(ot)},class:J(["cursor-pointer px-4 py-2 rounded w-full text-left transition flex items-center justify-between",O.value===ot&&tt.value?"text-white font-bold":"hover:bg-gray-200"]),style:b(O.value===ot&&tt.value?{backgroundColor:n(x)}:{})},[i("span",null,c(D.$t(ot)),1),Mt[1]||(Mt[1]=i("svg",{class:"w-4 h-4 ml-2 text-gray-500 block xl:hidden",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))],14,kH)),64))]),n(I)?(p(),f("div",$H,[Mt[3]||(Mt[3]=i("hr",{class:"my-3 border-t border-gray-300"},null,-1)),i("div",CH,[zt(n(Yd),{style:b(`color:${n(_)}`),class:J(`h-7 w-7  text-[${$.value}]`)},null,8,["style","class"]),i("h2",null,[i("p",MH,c(D.$t("affiliate_programe")),1)])]),i("ul",SH,[(p(!0),f(at,null,xt(n(w),(ot,st)=>(p(),f("li",{key:st,onClick:X=>{O.value=ot,et(),dt(ot)},class:J(["cursor-pointer px-4 py-2 rounded w-full text-left transition flex items-center justify-between",O.value===ot&&tt.value?"text-white font-bold":"hover:bg-gray-200"]),style:b(O.value===ot&&tt.value?{backgroundColor:n(x)}:{})},[i("span",null,c(D.$t(ot)),1),Mt[2]||(Mt[2]=i("svg",{class:"w-4 h-4 ml-2 text-gray-500 block xl:hidden",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))],14,DH))),128))])])):C("",!0)])):C("",!0),O.value==="personal_information"&&(n(a)||tt.value)?(p(),f("div",AH,[zt(kh)])):O.value==="address"&&(n(a)||tt.value)?(p(),f("div",zH,[zt(Mm)])):O.value==="bank_account"&&(n(a)||tt.value)?(p(),f("div",jH,[zt(hH)])):O.value==="my_points"&&(n(a)||tt.value)?(p(),f("div",TH,[zt(FF)])):O.value==="favorite_list"&&(n(a)||tt.value)?(p(),f("div",PH,[zt(lN)])):O.value==="order_list"&&(n(a)||tt.value)?(p(),f("div",LH,[zt(T4)])):O.value==="cancelled_orders"&&(n(a)||tt.value)?(p(),f("div",RH,[zt(M5)])):O.value==="account_affiliate"&&(n(a)||tt.value)?(p(),f("div",OH,[zt(IM)])):O.value==="offer"&&(n(a)||tt.value)?(p(),f("div",BH,[zt(cD)])):O.value==="my_share"&&(n(a)||tt.value)?(p(),f("div",EH,[zt(FL)])):O.value==="order_report"&&(n(a)||tt.value)?(p(),f("div",FH,[zt(jE)])):O.value==="withdraw_history"&&(n(a)||tt.value)?(p(),f("div",IH,[zt(TO)])):C("",!0)])]))}};export{aV as default};

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.